diff --git a/asset-manifest.json b/asset-manifest.json deleted file mode 100644 index 2d6477e..0000000 --- a/asset-manifest.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "files": { - "static/js/0.1cba575d.chunk.js": "./static/js/0.1cba575d.chunk.js", - "static/js/1.7f06461f.chunk.js": "./static/js/1.7f06461f.chunk.js", - "main.css": "./static/css/main.fe2d32cf.chunk.css", - "main.js": "./static/js/main.1a8f0a5a.chunk.js", - "runtime-main.js": "./static/js/runtime-main.a61292da.js", - "static/js/4.58d00759.chunk.js": "./static/js/4.58d00759.chunk.js", - "static/js/5.93c34853.chunk.js": "./static/js/5.93c34853.chunk.js", - "static/js/6.7fe8be6e.chunk.js": "./static/js/6.7fe8be6e.chunk.js", - "static/js/7.a55712d4.chunk.js": "./static/js/7.a55712d4.chunk.js", - "static/js/8.f57f6f91.chunk.js": "./static/js/8.f57f6f91.chunk.js", - "static/js/9.1c89abfd.chunk.js": "./static/js/9.1c89abfd.chunk.js", - "static/js/10.920cd77d.chunk.js": "./static/js/10.920cd77d.chunk.js", - "static/js/11.712bf097.chunk.js": "./static/js/11.712bf097.chunk.js", - "static/js/12.beefb4e7.chunk.js": "./static/js/12.beefb4e7.chunk.js", - "static/js/13.f00d9410.chunk.js": "./static/js/13.f00d9410.chunk.js", - "static/js/14.be73d5ae.chunk.js": "./static/js/14.be73d5ae.chunk.js", - "static/js/15.ca3f9ed0.chunk.js": "./static/js/15.ca3f9ed0.chunk.js", - "index.html": "./index.html", - "precache-manifest.3fc752b0ff3de85a845623d8931d7a6c.js": "./precache-manifest.3fc752b0ff3de85a845623d8931d7a6c.js", - "service-worker.js": "./service-worker.js", - "static/js/10.920cd77d.chunk.js.LICENSE.txt": "./static/js/10.920cd77d.chunk.js.LICENSE.txt", - "static/js/11.712bf097.chunk.js.LICENSE.txt": "./static/js/11.712bf097.chunk.js.LICENSE.txt", - "static/js/12.beefb4e7.chunk.js.LICENSE.txt": "./static/js/12.beefb4e7.chunk.js.LICENSE.txt", - "static/js/13.f00d9410.chunk.js.LICENSE.txt": "./static/js/13.f00d9410.chunk.js.LICENSE.txt", - "static/js/4.58d00759.chunk.js.LICENSE.txt": "./static/js/4.58d00759.chunk.js.LICENSE.txt", - "static/media/metamask.svg": "./static/media/metamask.a357c69f.svg", - "static/media/index.css": "./static/media/wormhole.b1048062.svg" - }, - "entrypoints": [ - "static/js/runtime-main.a61292da.js", - "static/js/4.58d00759.chunk.js", - "static/css/main.fe2d32cf.chunk.css", - "static/js/main.1a8f0a5a.chunk.js" - ] -} \ No newline at end of file diff --git a/bridge/asset-manifest.json b/bridge/asset-manifest.json new file mode 100644 index 0000000..fcb5ce8 --- /dev/null +++ b/bridge/asset-manifest.json @@ -0,0 +1,37 @@ +{ + "files": { + "static/js/0.777debaa.chunk.js": "./static/js/0.777debaa.chunk.js", + "static/js/1.fff4dd3b.chunk.js": "./static/js/1.fff4dd3b.chunk.js", + "main.css": "./static/css/main.5d738a05.chunk.css", + "main.js": "./static/js/main.c2de8fb2.chunk.js", + "runtime-main.js": "./static/js/runtime-main.7cfb9342.js", + "static/js/4.2f1eeddd.chunk.js": "./static/js/4.2f1eeddd.chunk.js", + "static/js/5.3d5e884f.chunk.js": "./static/js/5.3d5e884f.chunk.js", + "static/js/6.e6e98e1e.chunk.js": "./static/js/6.e6e98e1e.chunk.js", + "static/js/7.0a79856d.chunk.js": "./static/js/7.0a79856d.chunk.js", + "static/js/8.f0c9d709.chunk.js": "./static/js/8.f0c9d709.chunk.js", + "static/js/9.f9e9985a.chunk.js": "./static/js/9.f9e9985a.chunk.js", + "static/js/10.38a242e1.chunk.js": "./static/js/10.38a242e1.chunk.js", + "static/js/11.711038e8.chunk.js": "./static/js/11.711038e8.chunk.js", + "static/js/12.9ac8c380.chunk.js": "./static/js/12.9ac8c380.chunk.js", + "static/js/13.548c9873.chunk.js": "./static/js/13.548c9873.chunk.js", + "static/js/14.aa4cabf9.chunk.js": "./static/js/14.aa4cabf9.chunk.js", + "static/js/15.79ad0e86.chunk.js": "./static/js/15.79ad0e86.chunk.js", + "index.html": "./index.html", + "precache-manifest.e9ab0ddc53e6f3dec6da71d3cbc41835.js": "./precache-manifest.e9ab0ddc53e6f3dec6da71d3cbc41835.js", + "service-worker.js": "./service-worker.js", + "static/js/10.38a242e1.chunk.js.LICENSE.txt": "./static/js/10.38a242e1.chunk.js.LICENSE.txt", + "static/js/11.711038e8.chunk.js.LICENSE.txt": "./static/js/11.711038e8.chunk.js.LICENSE.txt", + "static/js/12.9ac8c380.chunk.js.LICENSE.txt": "./static/js/12.9ac8c380.chunk.js.LICENSE.txt", + "static/js/13.548c9873.chunk.js.LICENSE.txt": "./static/js/13.548c9873.chunk.js.LICENSE.txt", + "static/js/4.2f1eeddd.chunk.js.LICENSE.txt": "./static/js/4.2f1eeddd.chunk.js.LICENSE.txt", + "static/media/metamask.svg": "./static/media/metamask.a357c69f.svg", + "static/media/index.css": "./static/media/wormhole.b1048062.svg" + }, + "entrypoints": [ + "static/js/runtime-main.7cfb9342.js", + "static/js/4.2f1eeddd.chunk.js", + "static/css/main.5d738a05.chunk.css", + "static/js/main.c2de8fb2.chunk.js" + ] +} \ No newline at end of file diff --git a/blockchains/ETH.svg b/bridge/blockchains/ETH.svg similarity index 100% rename from blockchains/ETH.svg rename to bridge/blockchains/ETH.svg diff --git a/blockchains/solana.webp b/bridge/blockchains/solana.webp similarity index 100% rename from blockchains/solana.webp rename to bridge/blockchains/solana.webp diff --git a/bridge/index.html b/bridge/index.html new file mode 100644 index 0000000..224c3d1 --- /dev/null +++ b/bridge/index.html @@ -0,0 +1 @@ +Wormhole Solana Bridge
\ No newline at end of file diff --git a/logo.ico b/bridge/logo.ico similarity index 100% rename from logo.ico rename to bridge/logo.ico diff --git a/manifest.json b/bridge/manifest.json similarity index 100% rename from manifest.json rename to bridge/manifest.json diff --git a/bridge/precache-manifest.e9ab0ddc53e6f3dec6da71d3cbc41835.js b/bridge/precache-manifest.e9ab0ddc53e6f3dec6da71d3cbc41835.js new file mode 100644 index 0000000..3f8f0c7 --- /dev/null +++ b/bridge/precache-manifest.e9ab0ddc53e6f3dec6da71d3cbc41835.js @@ -0,0 +1,102 @@ +self.__precacheManifest = (self.__precacheManifest || []).concat([ + { + "revision": "4dec35f0bd01943ab0e3ef2a41b6300d", + "url": "./index.html" + }, + { + "revision": "f2102f4e9f985a7ea8f6", + "url": "./static/css/main.5d738a05.chunk.css" + }, + { + "revision": "131d09804fca0b38f779", + "url": "./static/js/0.777debaa.chunk.js" + }, + { + "revision": "ca3945d17e730f52378c", + "url": "./static/js/1.fff4dd3b.chunk.js" + }, + { + "revision": "3631daefdb6dc47e536f", + "url": "./static/js/10.38a242e1.chunk.js" + }, + { + "revision": "800c8c88b71490b35d9e636bbf8c583d", + "url": "./static/js/10.38a242e1.chunk.js.LICENSE.txt" + }, + { + "revision": "41ce04b6ed17b2c40265", + "url": "./static/js/11.711038e8.chunk.js" + }, + { + "revision": "7ec01595672f75e83fd81b41f132f4c1", + "url": "./static/js/11.711038e8.chunk.js.LICENSE.txt" + }, + { + "revision": "cfd3f6ec8b7680988aa5", + "url": "./static/js/12.9ac8c380.chunk.js" + }, + { + "revision": "d43bcb65c23262ca7bd991f5625a0c00", + "url": "./static/js/12.9ac8c380.chunk.js.LICENSE.txt" + }, + { + "revision": "2bcecb08b69da38aae02", + "url": "./static/js/13.548c9873.chunk.js" + }, + { + "revision": "88e5053053539c8b4a53480943cb0e08", + "url": "./static/js/13.548c9873.chunk.js.LICENSE.txt" + }, + { + "revision": "5b98139f4944f2a3e9ec", + "url": "./static/js/14.aa4cabf9.chunk.js" + }, + { + "revision": "9fb8f1f4c39e0e57b07f", + "url": "./static/js/15.79ad0e86.chunk.js" + }, + { + "revision": "f8bc693dff0c4a1bf398", + "url": "./static/js/4.2f1eeddd.chunk.js" + }, + { + "revision": "588a3517b4a58861ec011570d4f5fb88", + "url": "./static/js/4.2f1eeddd.chunk.js.LICENSE.txt" + }, + { + "revision": "8d35f7cb2b8c1e0ff61e", + "url": "./static/js/5.3d5e884f.chunk.js" + }, + { + "revision": "b4a00b24fcc077a635e3", + "url": "./static/js/6.e6e98e1e.chunk.js" + }, + { + "revision": "8e5d03f38534d96f2b9a", + "url": "./static/js/7.0a79856d.chunk.js" + }, + { + "revision": "03a8307cb3bfd7448585", + "url": "./static/js/8.f0c9d709.chunk.js" + }, + { + "revision": "8940c7fa7fe9d8d80655", + "url": "./static/js/9.f9e9985a.chunk.js" + }, + { + "revision": "f2102f4e9f985a7ea8f6", + "url": "./static/js/main.c2de8fb2.chunk.js" + }, + { + "revision": "cde227e0f32c6798ca2d", + "url": "./static/js/runtime-main.7cfb9342.js" + }, + { + "revision": "a357c69f4384506d7970bb4befb88f23", + "url": "./static/media/metamask.a357c69f.svg" + }, + { + "revision": "b10480622bd62847e66763794b8b83e3", + "url": "./static/media/wormhole.b1048062.svg" + } +]); \ No newline at end of file diff --git a/robots.txt b/bridge/robots.txt similarity index 100% rename from robots.txt rename to bridge/robots.txt diff --git a/service-worker.js b/bridge/service-worker.js similarity index 94% rename from service-worker.js rename to bridge/service-worker.js index f28a90c..31d1ed1 100644 --- a/service-worker.js +++ b/bridge/service-worker.js @@ -14,7 +14,7 @@ importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js"); importScripts( - "./precache-manifest.3fc752b0ff3de85a845623d8931d7a6c.js" + "./precache-manifest.e9ab0ddc53e6f3dec6da71d3cbc41835.js" ); self.addEventListener('message', (event) => { diff --git a/static/css/main.fe2d32cf.chunk.css b/bridge/static/css/main.5d738a05.chunk.css similarity index 99% rename from static/css/main.fe2d32cf.chunk.css rename to bridge/static/css/main.5d738a05.chunk.css index cd87fb2..c951722 100644 --- a/static/css/main.fe2d32cf.chunk.css +++ b/bridge/static/css/main.5d738a05.chunk.css @@ -1,2 +1,2 @@ body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,"Courier New",monospace}.ant-pro-basicLayout-content{margin:0!important;background-color:#141414;color:hsla(0,0%,100%,.85)}.home-info-row{min-height:75vh}.wormhole-bg{background-image:url(../../static/media/wormhole.b1048062.svg);background-size:cover;background-position:50%}[class*=ant-]::-ms-clear,[class*=ant-] input::-ms-clear,[class*=ant-] input::-ms-reveal,[class^=ant-]::-ms-clear,[class^=ant-] input::-ms-clear,[class^=ant-] input::-ms-reveal{display:none}[class*=ant-],[class*=ant-] *,[class*=ant-] :after,[class*=ant-] :before,[class^=ant-],[class^=ant-] *,[class^=ant-] :after,[class^=ant-] :before{box-sizing:border-box}body,html{width:100%;height:100%}input::-ms-clear,input::-ms-reveal{display:none}*,:after,:before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}@-ms-viewport{width:device-width}body{margin:0;color:hsla(0,0%,100%,.85);font-size:14px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-variant:tabular-nums;line-height:1.5715;background-color:#000;font-feature-settings:"tnum","tnum"}[tabindex="-1"]:focus{outline:none!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;color:hsla(0,0%,100%,.85);font-weight:500}p{margin-top:0;margin-bottom:1em}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;border-bottom:0;cursor:help}address{margin-bottom:1em;font-style:normal;line-height:inherit}input[type=number],input[type=password],input[type=text],textarea{-webkit-appearance:none}dl,ol,ul{margin-top:0;margin-bottom:1em}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#2abdd2;text-decoration:none;background-color:transparent;outline:none;cursor:pointer;transition:color .3s;-webkit-text-decoration-skip:objects}a:hover{color:#228290}a:active{color:#4abdca}a:active,a:focus,a:hover{text-decoration:none;outline:0}a[disabled]{color:hsla(0,0%,100%,.3);cursor:not-allowed;pointer-events:none}code,kbd,pre,samp{font-size:1em;font-family:"SFMono-Regular",Consolas,"Liberation Mono",Menlo,Courier,monospace}pre{margin-top:0;margin-bottom:1em;overflow:auto}figure{margin:0 0 1em}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}[role=button],a,area,button,input:not([type=range]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75em;padding-bottom:.3em;color:hsla(0,0%,100%,.45);text-align:left;caption-side:bottom}th{text-align:inherit}button,input,optgroup,select,textarea{margin:0;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;margin:0;padding:0;border:0}legend{display:block;width:100%;max-width:100%;margin-bottom:.5em;padding:0;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{padding:.2em;background-color:#2b2611}::selection{color:#fff;background:#2abdd2}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}.anticon{display:inline-block;color:inherit;font-style:normal;line-height:0;text-align:center;text-transform:none;vertical-align:-.125em;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.anticon>*{line-height:1}.anticon svg{display:inline-block}.anticon:before{display:none}.anticon .anticon-icon{display:block}.anticon[tabindex]{cursor:pointer}.anticon-spin,.anticon-spin:before{display:inline-block;animation:loadingCircle 1s linear infinite}.fade-appear,.fade-enter,.fade-leave{animation-duration:.2s;animation-fill-mode:both;animation-play-state:paused}.fade-appear.fade-appear-active,.fade-enter.fade-enter-active{animation-name:antFadeIn;animation-play-state:running}.fade-leave.fade-leave-active{animation-name:antFadeOut;animation-play-state:running;pointer-events:none}.fade-appear,.fade-enter{opacity:0}.fade-appear,.fade-enter,.fade-leave{animation-timing-function:linear}@keyframes antFadeIn{0%{opacity:0}to{opacity:1}}@keyframes antFadeOut{0%{opacity:1}to{opacity:0}}.move-up-appear,.move-up-enter,.move-up-leave{animation-duration:.2s;animation-fill-mode:both;animation-play-state:paused}.move-up-appear.move-up-appear-active,.move-up-enter.move-up-enter-active{animation-name:antMoveUpIn;animation-play-state:running}.move-up-leave.move-up-leave-active{animation-name:antMoveUpOut;animation-play-state:running;pointer-events:none}.move-up-appear,.move-up-enter{opacity:0;animation-timing-function:cubic-bezier(.08,.82,.17,1)}.move-up-leave{animation-timing-function:cubic-bezier(.6,.04,.98,.34)}.move-down-appear,.move-down-enter,.move-down-leave{animation-duration:.2s;animation-fill-mode:both;animation-play-state:paused}.move-down-appear.move-down-appear-active,.move-down-enter.move-down-enter-active{animation-name:antMoveDownIn;animation-play-state:running}.move-down-leave.move-down-leave-active{animation-name:antMoveDownOut;animation-play-state:running;pointer-events:none}.move-down-appear,.move-down-enter{opacity:0;animation-timing-function:cubic-bezier(.08,.82,.17,1)}.move-down-leave{animation-timing-function:cubic-bezier(.6,.04,.98,.34)}.move-left-appear,.move-left-enter,.move-left-leave{animation-duration:.2s;animation-fill-mode:both;animation-play-state:paused}.move-left-appear.move-left-appear-active,.move-left-enter.move-left-enter-active{animation-name:antMoveLeftIn;animation-play-state:running}.move-left-leave.move-left-leave-active{animation-name:antMoveLeftOut;animation-play-state:running;pointer-events:none}.move-left-appear,.move-left-enter{opacity:0;animation-timing-function:cubic-bezier(.08,.82,.17,1)}.move-left-leave{animation-timing-function:cubic-bezier(.6,.04,.98,.34)}.move-right-appear,.move-right-enter,.move-right-leave{animation-duration:.2s;animation-fill-mode:both;animation-play-state:paused}.move-right-appear.move-right-appear-active,.move-right-enter.move-right-enter-active{animation-name:antMoveRightIn;animation-play-state:running}.move-right-leave.move-right-leave-active{animation-name:antMoveRightOut;animation-play-state:running;pointer-events:none}.move-right-appear,.move-right-enter{opacity:0;animation-timing-function:cubic-bezier(.08,.82,.17,1)}.move-right-leave{animation-timing-function:cubic-bezier(.6,.04,.98,.34)}@keyframes antMoveDownIn{0%{transform:translateY(100%);transform-origin:0 0;opacity:0}to{transform:translateY(0);transform-origin:0 0;opacity:1}}@keyframes antMoveDownOut{0%{transform:translateY(0);transform-origin:0 0;opacity:1}to{transform:translateY(100%);transform-origin:0 0;opacity:0}}@keyframes antMoveLeftIn{0%{transform:translateX(-100%);transform-origin:0 0;opacity:0}to{transform:translateX(0);transform-origin:0 0;opacity:1}}@keyframes antMoveLeftOut{0%{transform:translateX(0);transform-origin:0 0;opacity:1}to{transform:translateX(-100%);transform-origin:0 0;opacity:0}}@keyframes antMoveRightIn{0%{transform:translateX(100%);transform-origin:0 0;opacity:0}to{transform:translateX(0);transform-origin:0 0;opacity:1}}@keyframes antMoveRightOut{0%{transform:translateX(0);transform-origin:0 0;opacity:1}to{transform:translateX(100%);transform-origin:0 0;opacity:0}}@keyframes antMoveUpIn{0%{transform:translateY(-100%);transform-origin:0 0;opacity:0}to{transform:translateY(0);transform-origin:0 0;opacity:1}}@keyframes antMoveUpOut{0%{transform:translateY(0);transform-origin:0 0;opacity:1}to{transform:translateY(-100%);transform-origin:0 0;opacity:0}}@keyframes loadingCircle{to{transform:rotate(1turn)}}[ant-click-animating-without-extra-node=true],[ant-click-animating=true]{position:relative}html{--antd-wave-shadow-color:#2abdd2;--scroll-bar:0}.ant-click-animating-node,[ant-click-animating-without-extra-node=true]:after{position:absolute;top:0;right:0;bottom:0;left:0;display:block;border-radius:inherit;box-shadow:0 0 0 0 #2abdd2;box-shadow:0 0 0 0 var(--antd-wave-shadow-color);opacity:.2;animation:fadeEffect 2s cubic-bezier(.08,.82,.17,1),waveEffect .4s cubic-bezier(.08,.82,.17,1);animation-fill-mode:forwards;content:"";pointer-events:none}@keyframes waveEffect{to{box-shadow:0 0 0 #2abdd2;box-shadow:0 0 0 6px #2abdd2;box-shadow:0 0 0 6px var(--antd-wave-shadow-color)}}@keyframes fadeEffect{to{opacity:0}}.slide-up-appear,.slide-up-enter,.slide-up-leave{animation-duration:.2s;animation-fill-mode:both;animation-play-state:paused}.slide-up-appear.slide-up-appear-active,.slide-up-enter.slide-up-enter-active{animation-name:antSlideUpIn;animation-play-state:running}.slide-up-leave.slide-up-leave-active{animation-name:antSlideUpOut;animation-play-state:running;pointer-events:none}.slide-up-appear,.slide-up-enter{opacity:0;animation-timing-function:cubic-bezier(.23,1,.32,1)}.slide-up-leave{animation-timing-function:cubic-bezier(.755,.05,.855,.06)}.slide-down-appear,.slide-down-enter,.slide-down-leave{animation-duration:.2s;animation-fill-mode:both;animation-play-state:paused}.slide-down-appear.slide-down-appear-active,.slide-down-enter.slide-down-enter-active{animation-name:antSlideDownIn;animation-play-state:running}.slide-down-leave.slide-down-leave-active{animation-name:antSlideDownOut;animation-play-state:running;pointer-events:none}.slide-down-appear,.slide-down-enter{opacity:0;animation-timing-function:cubic-bezier(.23,1,.32,1)}.slide-down-leave{animation-timing-function:cubic-bezier(.755,.05,.855,.06)}.slide-left-appear,.slide-left-enter,.slide-left-leave{animation-duration:.2s;animation-fill-mode:both;animation-play-state:paused}.slide-left-appear.slide-left-appear-active,.slide-left-enter.slide-left-enter-active{animation-name:antSlideLeftIn;animation-play-state:running}.slide-left-leave.slide-left-leave-active{animation-name:antSlideLeftOut;animation-play-state:running;pointer-events:none}.slide-left-appear,.slide-left-enter{opacity:0;animation-timing-function:cubic-bezier(.23,1,.32,1)}.slide-left-leave{animation-timing-function:cubic-bezier(.755,.05,.855,.06)}.slide-right-appear,.slide-right-enter,.slide-right-leave{animation-duration:.2s;animation-fill-mode:both;animation-play-state:paused}.slide-right-appear.slide-right-appear-active,.slide-right-enter.slide-right-enter-active{animation-name:antSlideRightIn;animation-play-state:running}.slide-right-leave.slide-right-leave-active{animation-name:antSlideRightOut;animation-play-state:running;pointer-events:none}.slide-right-appear,.slide-right-enter{opacity:0;animation-timing-function:cubic-bezier(.23,1,.32,1)}.slide-right-leave{animation-timing-function:cubic-bezier(.755,.05,.855,.06)}@keyframes antSlideUpIn{0%{transform:scaleY(.8);transform-origin:0 0;opacity:0}to{transform:scaleY(1);transform-origin:0 0;opacity:1}}@keyframes antSlideUpOut{0%{transform:scaleY(1);transform-origin:0 0;opacity:1}to{transform:scaleY(.8);transform-origin:0 0;opacity:0}}@keyframes antSlideDownIn{0%{transform:scaleY(.8);transform-origin:100% 100%;opacity:0}to{transform:scaleY(1);transform-origin:100% 100%;opacity:1}}@keyframes antSlideDownOut{0%{transform:scaleY(1);transform-origin:100% 100%;opacity:1}to{transform:scaleY(.8);transform-origin:100% 100%;opacity:0}}@keyframes antSlideLeftIn{0%{transform:scaleX(.8);transform-origin:0 0;opacity:0}to{transform:scaleX(1);transform-origin:0 0;opacity:1}}@keyframes antSlideLeftOut{0%{transform:scaleX(1);transform-origin:0 0;opacity:1}to{transform:scaleX(.8);transform-origin:0 0;opacity:0}}@keyframes antSlideRightIn{0%{transform:scaleX(.8);transform-origin:100% 0;opacity:0}to{transform:scaleX(1);transform-origin:100% 0;opacity:1}}@keyframes antSlideRightOut{0%{transform:scaleX(1);transform-origin:100% 0;opacity:1}to{transform:scaleX(.8);transform-origin:100% 0;opacity:0}}.zoom-appear,.zoom-enter,.zoom-leave{animation-duration:.2s;animation-fill-mode:both;animation-play-state:paused}.zoom-appear.zoom-appear-active,.zoom-enter.zoom-enter-active{animation-name:antZoomIn;animation-play-state:running}.zoom-leave.zoom-leave-active{animation-name:antZoomOut;animation-play-state:running;pointer-events:none}.zoom-appear,.zoom-enter{transform:scale(0);opacity:0;animation-timing-function:cubic-bezier(.08,.82,.17,1)}.zoom-appear-prepare,.zoom-enter-prepare{transform:none}.zoom-leave{animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.zoom-big-appear,.zoom-big-enter,.zoom-big-leave{animation-duration:.2s;animation-fill-mode:both;animation-play-state:paused}.zoom-big-appear.zoom-big-appear-active,.zoom-big-enter.zoom-big-enter-active{animation-name:antZoomBigIn;animation-play-state:running}.zoom-big-leave.zoom-big-leave-active{animation-name:antZoomBigOut;animation-play-state:running;pointer-events:none}.zoom-big-appear,.zoom-big-enter{transform:scale(0);opacity:0;animation-timing-function:cubic-bezier(.08,.82,.17,1)}.zoom-big-appear-prepare,.zoom-big-enter-prepare{transform:none}.zoom-big-leave{animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.zoom-big-fast-appear,.zoom-big-fast-enter,.zoom-big-fast-leave{animation-duration:.1s;animation-fill-mode:both;animation-play-state:paused}.zoom-big-fast-appear.zoom-big-fast-appear-active,.zoom-big-fast-enter.zoom-big-fast-enter-active{animation-name:antZoomBigIn;animation-play-state:running}.zoom-big-fast-leave.zoom-big-fast-leave-active{animation-name:antZoomBigOut;animation-play-state:running;pointer-events:none}.zoom-big-fast-appear,.zoom-big-fast-enter{transform:scale(0);opacity:0;animation-timing-function:cubic-bezier(.08,.82,.17,1)}.zoom-big-fast-appear-prepare,.zoom-big-fast-enter-prepare{transform:none}.zoom-big-fast-leave{animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.zoom-up-appear,.zoom-up-enter,.zoom-up-leave{animation-duration:.2s;animation-fill-mode:both;animation-play-state:paused}.zoom-up-appear.zoom-up-appear-active,.zoom-up-enter.zoom-up-enter-active{animation-name:antZoomUpIn;animation-play-state:running}.zoom-up-leave.zoom-up-leave-active{animation-name:antZoomUpOut;animation-play-state:running;pointer-events:none}.zoom-up-appear,.zoom-up-enter{transform:scale(0);opacity:0;animation-timing-function:cubic-bezier(.08,.82,.17,1)}.zoom-up-appear-prepare,.zoom-up-enter-prepare{transform:none}.zoom-up-leave{animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.zoom-down-appear,.zoom-down-enter,.zoom-down-leave{animation-duration:.2s;animation-fill-mode:both;animation-play-state:paused}.zoom-down-appear.zoom-down-appear-active,.zoom-down-enter.zoom-down-enter-active{animation-name:antZoomDownIn;animation-play-state:running}.zoom-down-leave.zoom-down-leave-active{animation-name:antZoomDownOut;animation-play-state:running;pointer-events:none}.zoom-down-appear,.zoom-down-enter{transform:scale(0);opacity:0;animation-timing-function:cubic-bezier(.08,.82,.17,1)}.zoom-down-appear-prepare,.zoom-down-enter-prepare{transform:none}.zoom-down-leave{animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.zoom-left-appear,.zoom-left-enter,.zoom-left-leave{animation-duration:.2s;animation-fill-mode:both;animation-play-state:paused}.zoom-left-appear.zoom-left-appear-active,.zoom-left-enter.zoom-left-enter-active{animation-name:antZoomLeftIn;animation-play-state:running}.zoom-left-leave.zoom-left-leave-active{animation-name:antZoomLeftOut;animation-play-state:running;pointer-events:none}.zoom-left-appear,.zoom-left-enter{transform:scale(0);opacity:0;animation-timing-function:cubic-bezier(.08,.82,.17,1)}.zoom-left-appear-prepare,.zoom-left-enter-prepare{transform:none}.zoom-left-leave{animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.zoom-right-appear,.zoom-right-enter,.zoom-right-leave{animation-duration:.2s;animation-fill-mode:both;animation-play-state:paused}.zoom-right-appear.zoom-right-appear-active,.zoom-right-enter.zoom-right-enter-active{animation-name:antZoomRightIn;animation-play-state:running}.zoom-right-leave.zoom-right-leave-active{animation-name:antZoomRightOut;animation-play-state:running;pointer-events:none}.zoom-right-appear,.zoom-right-enter{transform:scale(0);opacity:0;animation-timing-function:cubic-bezier(.08,.82,.17,1)}.zoom-right-appear-prepare,.zoom-right-enter-prepare{transform:none}.zoom-right-leave{animation-timing-function:cubic-bezier(.78,.14,.15,.86)}@keyframes antZoomIn{0%{transform:scale(.2);opacity:0}to{transform:scale(1);opacity:1}}@keyframes antZoomOut{0%{transform:scale(1)}to{transform:scale(.2);opacity:0}}@keyframes antZoomBigIn{0%{transform:scale(.8);opacity:0}to{transform:scale(1);opacity:1}}@keyframes antZoomBigOut{0%{transform:scale(1)}to{transform:scale(.8);opacity:0}}@keyframes antZoomUpIn{0%{transform:scale(.8);transform-origin:50% 0;opacity:0}to{transform:scale(1);transform-origin:50% 0}}@keyframes antZoomUpOut{0%{transform:scale(1);transform-origin:50% 0}to{transform:scale(.8);transform-origin:50% 0;opacity:0}}@keyframes antZoomLeftIn{0%{transform:scale(.8);transform-origin:0 50%;opacity:0}to{transform:scale(1);transform-origin:0 50%}}@keyframes antZoomLeftOut{0%{transform:scale(1);transform-origin:0 50%}to{transform:scale(.8);transform-origin:0 50%;opacity:0}}@keyframes antZoomRightIn{0%{transform:scale(.8);transform-origin:100% 50%;opacity:0}to{transform:scale(1);transform-origin:100% 50%}}@keyframes antZoomRightOut{0%{transform:scale(1);transform-origin:100% 50%}to{transform:scale(.8);transform-origin:100% 50%;opacity:0}}@keyframes antZoomDownIn{0%{transform:scale(.8);transform-origin:50% 100%;opacity:0}to{transform:scale(1);transform-origin:50% 100%}}@keyframes antZoomDownOut{0%{transform:scale(1);transform-origin:50% 100%}to{transform:scale(.8);transform-origin:50% 100%;opacity:0}}.ant-motion-collapse-legacy{overflow:hidden}.ant-motion-collapse,.ant-motion-collapse-legacy-active{transition:height .2s cubic-bezier(.645,.045,.355,1),opacity .2s cubic-bezier(.645,.045,.355,1)!important}.ant-motion-collapse{overflow:hidden}.ant-affix{position:fixed;z-index:10}.ant-alert{box-sizing:border-box;margin:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:relative;display:flex;align-items:center;padding:8px 15px;word-wrap:break-word;border-radius:2px}.ant-alert-content{flex:1 1;min-width:0}.ant-alert-icon{margin-right:8px}.ant-alert-description{display:none;font-size:14px;line-height:22px}.ant-alert-success{background-color:#162312;border:1px solid #274916}.ant-alert-success .ant-alert-icon{color:#49aa19}.ant-alert-info{background-color:#132125;border:1px solid #1b474d}.ant-alert-info .ant-alert-icon{color:#2abdd2}.ant-alert-warning{background-color:#2b2111;border:1px solid #594214}.ant-alert-warning .ant-alert-icon{color:#d89614}.ant-alert-error{background-color:#2a1215;border:1px solid #58181c}.ant-alert-error .ant-alert-icon{color:#a61d24}.ant-alert-error .ant-alert-description>pre{margin:0;padding:0}.ant-alert-action{margin-left:8px}.ant-alert-close-icon{margin-left:8px;padding:0;overflow:hidden;font-size:12px;line-height:12px;background-color:transparent;border:none;outline:none;cursor:pointer}.ant-alert-close-icon .anticon-close{color:hsla(0,0%,100%,.45);transition:color .3s}.ant-alert-close-icon .anticon-close:hover{color:hsla(0,0%,100%,.75)}.ant-alert-close-text{color:hsla(0,0%,100%,.45);transition:color .3s}.ant-alert-close-text:hover{color:hsla(0,0%,100%,.75)}.ant-alert-with-description{align-items:flex-start;padding:15px 15px 15px 24px}.ant-alert-with-description.ant-alert-no-icon{padding:15px}.ant-alert-with-description .ant-alert-icon{margin-right:15px;font-size:24px}.ant-alert-with-description .ant-alert-message{display:block;margin-bottom:4px;color:hsla(0,0%,100%,.85);font-size:16px}.ant-alert-message{color:hsla(0,0%,100%,.85)}.ant-alert-with-description .ant-alert-description{display:block}.ant-alert.ant-alert-motion-leave{overflow:hidden;opacity:1;transition:max-height .3s cubic-bezier(.78,.14,.15,.86),opacity .3s cubic-bezier(.78,.14,.15,.86),padding-top .3s cubic-bezier(.78,.14,.15,.86),padding-bottom .3s cubic-bezier(.78,.14,.15,.86),margin-bottom .3s cubic-bezier(.78,.14,.15,.86)}.ant-alert.ant-alert-motion-leave-active{max-height:0;margin-bottom:0!important;padding-top:0;padding-bottom:0;opacity:0}.ant-alert-banner{margin-bottom:0;border:0;border-radius:0}.ant-alert.ant-alert-rtl{direction:rtl}.ant-alert-rtl.ant-alert.ant-alert-no-icon{padding:8px 15px}.ant-alert-rtl .ant-alert-icon{margin-right:auto;margin-left:8px}.ant-alert-rtl .ant-alert-action,.ant-alert-rtl .ant-alert-close-icon{margin-right:8px;margin-left:auto}.ant-alert-rtl.ant-alert-with-description .ant-alert-icon{margin-right:auto;margin-left:15px}.ant-anchor{box-sizing:border-box;margin:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:relative;padding:0 0 0 2px}.ant-anchor-wrapper{margin-left:-4px;padding-left:4px;overflow:auto;background-color:#141414}.ant-anchor-ink{position:absolute;top:0;left:0;height:100%}.ant-anchor-ink:before{position:relative;display:block;width:2px;height:100%;margin:0 auto;background-color:#303030;content:" "}.ant-anchor-ink-ball{position:absolute;left:50%;display:none;width:8px;height:8px;background-color:#141414;border:2px solid #2abdd2;border-radius:8px;transform:translateX(-50%);transition:top .3s ease-in-out}.ant-anchor-ink-ball.visible{display:inline-block}.ant-anchor.fixed .ant-anchor-ink .ant-anchor-ink-ball{display:none}.ant-anchor-link{padding:7px 0 7px 16px;line-height:1.143}.ant-anchor-link-title{position:relative;display:block;margin-bottom:6px;overflow:hidden;color:hsla(0,0%,100%,.85);white-space:nowrap;text-overflow:ellipsis;transition:all .3s}.ant-anchor-link-title:only-child{margin-bottom:0}.ant-anchor-link-active>.ant-anchor-link-title{color:#2abdd2}.ant-anchor-link .ant-anchor-link{padding-top:5px;padding-bottom:5px}.ant-anchor-rtl{direction:rtl}.ant-anchor-rtl.ant-anchor-wrapper{margin-right:-4px;margin-left:0;padding-right:4px;padding-left:0}.ant-anchor-rtl .ant-anchor-ink{right:0;left:auto}.ant-anchor-rtl .ant-anchor-ink-ball{right:50%;left:0;transform:translateX(50%)}.ant-anchor-rtl .ant-anchor-link{padding:7px 16px 7px 0}.ant-select-auto-complete{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum"}.ant-select-auto-complete .ant-select-clear{right:13px}.ant-avatar{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:relative;display:inline-block;overflow:hidden;color:#fff;white-space:nowrap;text-align:center;vertical-align:middle;background:hsla(0,0%,100%,.3);width:32px;height:32px;line-height:32px;border-radius:50%}.ant-avatar-image{background:transparent}.ant-avatar .ant-image-img{display:block}.ant-avatar-string{position:absolute;left:50%;transform-origin:0 center}.ant-avatar.ant-avatar-icon{font-size:18px}.ant-avatar.ant-avatar-icon>.anticon{margin:0}.ant-avatar-lg{width:40px;height:40px;line-height:40px;border-radius:50%}.ant-avatar-lg-string{position:absolute;left:50%;transform-origin:0 center}.ant-avatar-lg.ant-avatar-icon{font-size:24px}.ant-avatar-lg.ant-avatar-icon>.anticon{margin:0}.ant-avatar-sm{width:24px;height:24px;line-height:24px;border-radius:50%}.ant-avatar-sm-string{position:absolute;left:50%;transform-origin:0 center}.ant-avatar-sm.ant-avatar-icon{font-size:14px}.ant-avatar-sm.ant-avatar-icon>.anticon{margin:0}.ant-avatar-square{border-radius:2px}.ant-avatar>img{display:block;width:100%;height:100%;object-fit:cover}.ant-avatar-group{display:inline-flex}.ant-avatar-group .ant-avatar{border:1px solid #fff}.ant-avatar-group .ant-avatar:not(:first-child){margin-left:-8px}.ant-avatar-group-popover .ant-avatar+.ant-avatar{margin-left:3px}.ant-avatar-group-rtl .ant-avatar:not(:first-child){margin-right:-8px;margin-left:0}.ant-avatar-group-popover.ant-popover-rtl .ant-avatar+.ant-avatar{margin-right:3px;margin-left:0}.ant-back-top{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:fixed;right:100px;bottom:50px;z-index:10;width:40px;height:40px;cursor:pointer}.ant-back-top:empty{display:none}.ant-back-top-rtl{right:auto;left:100px;direction:rtl}.ant-back-top-content{width:40px;height:40px;overflow:hidden;color:#fff;text-align:center;background-color:hsla(0,0%,100%,.45);border-radius:20px;transition:all .3s}.ant-back-top-content:hover{background-color:hsla(0,0%,100%,.85);transition:all .3s}.ant-back-top-icon{font-size:24px;line-height:40px}@media screen and (max-width:768px){.ant-back-top{right:60px}}@media screen and (max-width:480px){.ant-back-top{right:20px}}.ant-badge{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:relative;display:inline-block;line-height:1}.ant-badge-count{z-index:auto;min-width:20px;height:20px;padding:0 6px;color:#fff;font-weight:400;font-size:12px;line-height:20px;white-space:nowrap;text-align:center;background:#a61d24;border-radius:10px;box-shadow:0 0 0 1px #141414}.ant-badge-count a,.ant-badge-count a:hover{color:#fff}.ant-badge-count-sm{min-width:14px;height:14px;padding:0;font-size:12px;line-height:14px;border-radius:7px}.ant-badge-multiple-words{padding:0 8px}.ant-badge-dot{z-index:auto;width:6px;min-width:6px;height:6px;background:#a61d24;border-radius:100%;box-shadow:0 0 0 1px #141414}.ant-badge-count,.ant-badge-dot,.ant-badge .ant-scroll-number-custom-component{position:absolute;top:0;right:0;transform:translate(50%,-50%);transform-origin:100% 0}.ant-badge-status{line-height:inherit;vertical-align:baseline}.ant-badge-status-dot{position:relative;top:-1px;display:inline-block;width:6px;height:6px;vertical-align:middle;border-radius:50%}.ant-badge-status-success{background-color:#49aa19}.ant-badge-status-processing{position:relative;background-color:#177ddc}.ant-badge-status-processing:after{position:absolute;top:0;left:0;width:100%;height:100%;border:1px solid #177ddc;border-radius:50%;animation:antStatusProcessing 1.2s ease-in-out infinite;content:""}.ant-badge-status-default{background-color:#d9d9d9}.ant-badge-status-error{background-color:#a61d24}.ant-badge-status-warning{background-color:#d89614}.ant-badge-status-magenta,.ant-badge-status-pink{background:#cb2b83}.ant-badge-status-red{background:#d32029}.ant-badge-status-volcano{background:#d84a1b}.ant-badge-status-orange{background:#d87a16}.ant-badge-status-yellow{background:#d8bd14}.ant-badge-status-gold{background:#d89614}.ant-badge-status-cyan{background:#13a8a8}.ant-badge-status-lime{background:#8bbb11}.ant-badge-status-green{background:#49aa19}.ant-badge-status-blue{background:#177ddc}.ant-badge-status-geekblue{background:#2b4acb}.ant-badge-status-purple{background:#642ab5}.ant-badge-status-text{margin-left:8px;color:hsla(0,0%,100%,.85);font-size:14px}.ant-badge-zoom-appear,.ant-badge-zoom-enter{animation:antZoomBadgeIn .3s cubic-bezier(.12,.4,.29,1.46);animation-fill-mode:both}.ant-badge-zoom-leave{animation:antZoomBadgeOut .3s cubic-bezier(.71,-.46,.88,.6);animation-fill-mode:both}.ant-badge-not-a-wrapper .ant-badge-zoom-appear,.ant-badge-not-a-wrapper .ant-badge-zoom-enter{animation:antNoWrapperZoomBadgeIn .3s cubic-bezier(.12,.4,.29,1.46)}.ant-badge-not-a-wrapper .ant-badge-zoom-leave{animation:antNoWrapperZoomBadgeOut .3s cubic-bezier(.71,-.46,.88,.6)}.ant-badge-not-a-wrapper:not(.ant-badge-status){vertical-align:middle}.ant-badge-not-a-wrapper .ant-scroll-number-custom-component{transform:none}.ant-badge-not-a-wrapper .ant-scroll-number,.ant-badge-not-a-wrapper .ant-scroll-number-custom-component{position:relative;top:auto;display:block;transform-origin:50% 50%}@keyframes antStatusProcessing{0%{transform:scale(.8);opacity:.5}to{transform:scale(2.4);opacity:0}}.ant-scroll-number{overflow:hidden}.ant-scroll-number-only{position:relative;display:inline-block;transition:all .3s cubic-bezier(.645,.045,.355,1)}.ant-scroll-number-only,.ant-scroll-number-only>p.ant-scroll-number-only-unit{height:20px;-webkit-transform-style:preserve-3d;-webkit-backface-visibility:hidden}.ant-scroll-number-only>p.ant-scroll-number-only-unit{margin:0}.ant-scroll-number-symbol{vertical-align:top}@keyframes antZoomBadgeIn{0%{transform:scale(0) translate(50%,-50%);opacity:0}to{transform:scale(1) translate(50%,-50%)}}@keyframes antZoomBadgeOut{0%{transform:scale(1) translate(50%,-50%)}to{transform:scale(0) translate(50%,-50%);opacity:0}}@keyframes antNoWrapperZoomBadgeIn{0%{transform:scale(0);opacity:0}to{transform:scale(1)}}@keyframes antNoWrapperZoomBadgeOut{0%{transform:scale(1)}to{transform:scale(0);opacity:0}}.ant-ribbon-wrapper{position:relative}.ant-ribbon{box-sizing:border-box;margin:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:absolute;top:8px;height:22px;padding:0 8px;color:#fff;line-height:22px;white-space:nowrap;background-color:#2abdd2;border-radius:2px}.ant-ribbon-text{color:#fff}.ant-ribbon-corner{position:absolute;top:100%;width:8px;height:8px;color:currentColor;border:4px solid;transform:scaleY(.75);transform-origin:top}.ant-ribbon-corner:after{position:absolute;top:-4px;left:-4px;width:inherit;height:inherit;color:rgba(0,0,0,.25);border:inherit;content:""}.ant-ribbon-color-magenta,.ant-ribbon-color-pink{color:#cb2b83;background:#cb2b83}.ant-ribbon-color-red{color:#d32029;background:#d32029}.ant-ribbon-color-volcano{color:#d84a1b;background:#d84a1b}.ant-ribbon-color-orange{color:#d87a16;background:#d87a16}.ant-ribbon-color-yellow{color:#d8bd14;background:#d8bd14}.ant-ribbon-color-gold{color:#d89614;background:#d89614}.ant-ribbon-color-cyan{color:#13a8a8;background:#13a8a8}.ant-ribbon-color-lime{color:#8bbb11;background:#8bbb11}.ant-ribbon-color-green{color:#49aa19;background:#49aa19}.ant-ribbon-color-blue{color:#177ddc;background:#177ddc}.ant-ribbon-color-geekblue{color:#2b4acb;background:#2b4acb}.ant-ribbon-color-purple{color:#642ab5;background:#642ab5}.ant-ribbon.ant-ribbon-placement-end{right:-8px;border-bottom-right-radius:0}.ant-ribbon.ant-ribbon-placement-end .ant-ribbon-corner{right:0;border-color:currentColor transparent transparent currentColor}.ant-ribbon.ant-ribbon-placement-start{left:-8px;border-bottom-left-radius:0}.ant-ribbon.ant-ribbon-placement-start .ant-ribbon-corner{left:0;border-color:currentColor currentColor transparent transparent}.ant-badge-rtl{direction:rtl}.ant-badge-rtl .ant-badge-count,.ant-badge-rtl .ant-badge-dot,.ant-badge-rtl .ant-badge .ant-scroll-number-custom-component{right:auto;left:0;direction:ltr;transform:translate(-50%,-50%);transform-origin:0 0}.ant-badge-rtl.ant-badge .ant-scroll-number-custom-component{right:auto;left:0;transform:translate(-50%,-50%);transform-origin:0 0}.ant-badge-rtl .ant-badge-status-text{margin-right:8px;margin-left:0}.ant-badge-rtl .ant-badge-zoom-appear,.ant-badge-rtl .ant-badge-zoom-enter{animation-name:antZoomBadgeInRtl}.ant-badge-rtl .ant-badge-zoom-leave{animation-name:antZoomBadgeOutRtl}.ant-badge-not-a-wrapper .ant-badge-count{transform:none}.ant-ribbon-rtl{direction:rtl}.ant-ribbon-rtl.ant-ribbon-placement-end{right:unset;left:-8px;border-bottom-right-radius:2px;border-bottom-left-radius:0}.ant-ribbon-rtl.ant-ribbon-placement-end .ant-ribbon-corner{right:unset;left:0}.ant-ribbon-rtl.ant-ribbon-placement-end .ant-ribbon-corner,.ant-ribbon-rtl.ant-ribbon-placement-end .ant-ribbon-corner:after{border-color:currentColor currentColor transparent transparent}.ant-ribbon-rtl.ant-ribbon-placement-start{right:-8px;left:unset;border-bottom-right-radius:0;border-bottom-left-radius:2px}.ant-ribbon-rtl.ant-ribbon-placement-start .ant-ribbon-corner{right:0;left:unset}.ant-ribbon-rtl.ant-ribbon-placement-start .ant-ribbon-corner,.ant-ribbon-rtl.ant-ribbon-placement-start .ant-ribbon-corner:after{border-color:currentColor transparent transparent currentColor}@keyframes antZoomBadgeInRtl{0%{transform:scale(0) translate(-50%,-50%);opacity:0}to{transform:scale(1) translate(-50%,-50%)}}@keyframes antZoomBadgeOutRtl{0%{transform:scale(1) translate(-50%,-50%)}to{transform:scale(0) translate(-50%,-50%);opacity:0}}.ant-breadcrumb{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";color:hsla(0,0%,100%,.45);font-size:14px}.ant-breadcrumb .anticon{font-size:14px}.ant-breadcrumb a{color:hsla(0,0%,100%,.45);transition:color .3s}.ant-breadcrumb a:hover{color:#228290}.ant-breadcrumb>span:last-child,.ant-breadcrumb>span:last-child a{color:hsla(0,0%,100%,.85)}.ant-breadcrumb>span:last-child .ant-breadcrumb-separator{display:none}.ant-breadcrumb-separator{margin:0 8px;color:hsla(0,0%,100%,.45)}.ant-breadcrumb-link>.anticon+a,.ant-breadcrumb-link>.anticon+span,.ant-breadcrumb-overlay-link>.anticon{margin-left:4px}.ant-breadcrumb-rtl{direction:rtl}.ant-breadcrumb-rtl:before{display:table;content:""}.ant-breadcrumb-rtl:after{display:table;clear:both;content:""}.ant-breadcrumb-rtl>span{float:right}.ant-breadcrumb-rtl .ant-breadcrumb-link>.anticon+a,.ant-breadcrumb-rtl .ant-breadcrumb-link>.anticon+span,.ant-breadcrumb-rtl .ant-breadcrumb-overlay-link>.anticon{margin-right:4px;margin-left:0}.ant-btn{line-height:1.5715;position:relative;display:inline-block;font-weight:400;white-space:nowrap;text-align:center;background-image:none;box-shadow:0 2px 0 rgba(0,0,0,.015);cursor:pointer;transition:all .3s cubic-bezier(.645,.045,.355,1);-webkit-user-select:none;-ms-user-select:none;user-select:none;touch-action:manipulation;height:32px;padding:4px 15px;font-size:14px;border-radius:2px;color:hsla(0,0%,100%,.85);background:transparent;border:1px solid #434343}.ant-btn>.anticon{line-height:1}.ant-btn,.ant-btn:active,.ant-btn:focus{outline:0}.ant-btn:not([disabled]):hover{text-decoration:none}.ant-btn:not([disabled]):active{outline:0;box-shadow:none}.ant-btn[disabled]{cursor:not-allowed}.ant-btn[disabled]>*{pointer-events:none}.ant-btn-lg{height:40px;padding:6.4px 15px;font-size:16px;border-radius:2px}.ant-btn-sm{height:24px;padding:0 7px;font-size:14px;border-radius:2px}.ant-btn>a:only-child{color:currentColor}.ant-btn>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn:focus,.ant-btn:hover{color:#228290;background:transparent;border-color:#228290}.ant-btn:focus>a:only-child,.ant-btn:hover>a:only-child{color:currentColor}.ant-btn:focus>a:only-child:after,.ant-btn:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn:active{color:#4abdca;background:transparent;border-color:#4abdca}.ant-btn:active>a:only-child{color:currentColor}.ant-btn:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn[disabled],.ant-btn[disabled]:active,.ant-btn[disabled]:focus,.ant-btn[disabled]:hover{color:hsla(0,0%,100%,.3);background:hsla(0,0%,100%,.08);border-color:#434343;text-shadow:none;box-shadow:none}.ant-btn[disabled]:active>a:only-child,.ant-btn[disabled]:focus>a:only-child,.ant-btn[disabled]:hover>a:only-child,.ant-btn[disabled]>a:only-child{color:currentColor}.ant-btn[disabled]:active>a:only-child:after,.ant-btn[disabled]:focus>a:only-child:after,.ant-btn[disabled]:hover>a:only-child:after,.ant-btn[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn:active,.ant-btn:focus,.ant-btn:hover{text-decoration:none;background:transparent}.ant-btn>span{display:inline-block}.ant-btn-primary{color:#fff;background:#2abdd2;border-color:#2abdd2;text-shadow:0 -1px 0 rgba(0,0,0,.12);box-shadow:0 2px 0 rgba(0,0,0,.045)}.ant-btn-primary>a:only-child{color:currentColor}.ant-btn-primary>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-primary:focus,.ant-btn-primary:hover{color:#fff;background:#1a93ab;border-color:#1a93ab}.ant-btn-primary:focus>a:only-child,.ant-btn-primary:hover>a:only-child{color:currentColor}.ant-btn-primary:focus>a:only-child:after,.ant-btn-primary:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-primary:active{color:#fff;background:#50d0de;border-color:#50d0de}.ant-btn-primary:active>a:only-child{color:currentColor}.ant-btn-primary:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-primary[disabled],.ant-btn-primary[disabled]:active,.ant-btn-primary[disabled]:focus,.ant-btn-primary[disabled]:hover{color:hsla(0,0%,100%,.3);background:hsla(0,0%,100%,.08);border-color:#434343;text-shadow:none;box-shadow:none}.ant-btn-primary[disabled]:active>a:only-child,.ant-btn-primary[disabled]:focus>a:only-child,.ant-btn-primary[disabled]:hover>a:only-child,.ant-btn-primary[disabled]>a:only-child{color:currentColor}.ant-btn-primary[disabled]:active>a:only-child:after,.ant-btn-primary[disabled]:focus>a:only-child:after,.ant-btn-primary[disabled]:hover>a:only-child:after,.ant-btn-primary[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-group .ant-btn-primary:not(:first-child):not(:last-child){border-right-color:#228290;border-left-color:#228290}.ant-btn-group .ant-btn-primary:not(:first-child):not(:last-child):disabled{border-color:#434343}.ant-btn-group .ant-btn-primary:first-child:not(:last-child){border-right-color:#228290}.ant-btn-group .ant-btn-primary:first-child:not(:last-child)[disabled]{border-right-color:#434343}.ant-btn-group .ant-btn-primary+.ant-btn-primary,.ant-btn-group .ant-btn-primary:last-child:not(:first-child){border-left-color:#228290}.ant-btn-group .ant-btn-primary+.ant-btn-primary[disabled],.ant-btn-group .ant-btn-primary:last-child:not(:first-child)[disabled]{border-left-color:#434343}.ant-btn-ghost{color:hsla(0,0%,100%,.85);background:transparent;border-color:#434343}.ant-btn-ghost>a:only-child{color:currentColor}.ant-btn-ghost>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-ghost:focus,.ant-btn-ghost:hover{color:#228290;background:transparent;border-color:#228290}.ant-btn-ghost:focus>a:only-child,.ant-btn-ghost:hover>a:only-child{color:currentColor}.ant-btn-ghost:focus>a:only-child:after,.ant-btn-ghost:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-ghost:active{color:#4abdca;background:transparent;border-color:#4abdca}.ant-btn-ghost:active>a:only-child{color:currentColor}.ant-btn-ghost:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-ghost[disabled],.ant-btn-ghost[disabled]:active,.ant-btn-ghost[disabled]:focus,.ant-btn-ghost[disabled]:hover{color:hsla(0,0%,100%,.3);background:hsla(0,0%,100%,.08);border-color:#434343;text-shadow:none;box-shadow:none}.ant-btn-ghost[disabled]:active>a:only-child,.ant-btn-ghost[disabled]:focus>a:only-child,.ant-btn-ghost[disabled]:hover>a:only-child,.ant-btn-ghost[disabled]>a:only-child{color:currentColor}.ant-btn-ghost[disabled]:active>a:only-child:after,.ant-btn-ghost[disabled]:focus>a:only-child:after,.ant-btn-ghost[disabled]:hover>a:only-child:after,.ant-btn-ghost[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dashed{color:hsla(0,0%,100%,.85);background:transparent;border-color:#434343;border-style:dashed}.ant-btn-dashed>a:only-child{color:currentColor}.ant-btn-dashed>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dashed:focus,.ant-btn-dashed:hover{color:#228290;background:transparent;border-color:#228290}.ant-btn-dashed:focus>a:only-child,.ant-btn-dashed:hover>a:only-child{color:currentColor}.ant-btn-dashed:focus>a:only-child:after,.ant-btn-dashed:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dashed:active{color:#4abdca;background:transparent;border-color:#4abdca}.ant-btn-dashed:active>a:only-child{color:currentColor}.ant-btn-dashed:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dashed[disabled],.ant-btn-dashed[disabled]:active,.ant-btn-dashed[disabled]:focus,.ant-btn-dashed[disabled]:hover{color:hsla(0,0%,100%,.3);background:hsla(0,0%,100%,.08);border-color:#434343;text-shadow:none;box-shadow:none}.ant-btn-dashed[disabled]:active>a:only-child,.ant-btn-dashed[disabled]:focus>a:only-child,.ant-btn-dashed[disabled]:hover>a:only-child,.ant-btn-dashed[disabled]>a:only-child{color:currentColor}.ant-btn-dashed[disabled]:active>a:only-child:after,.ant-btn-dashed[disabled]:focus>a:only-child:after,.ant-btn-dashed[disabled]:hover>a:only-child:after,.ant-btn-dashed[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-danger{color:#fff;background:#a61d24;border-color:#a61d24;text-shadow:0 -1px 0 rgba(0,0,0,.12);box-shadow:0 2px 0 rgba(0,0,0,.045)}.ant-btn-danger>a:only-child{color:currentColor}.ant-btn-danger>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-danger:focus,.ant-btn-danger:hover{color:#fff;background:#800f19;border-color:#800f19}.ant-btn-danger:focus>a:only-child,.ant-btn-danger:hover>a:only-child{color:currentColor}.ant-btn-danger:focus>a:only-child:after,.ant-btn-danger:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-danger:active{color:#fff;background:#b33b3d;border-color:#b33b3d}.ant-btn-danger:active>a:only-child{color:currentColor}.ant-btn-danger:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-danger[disabled],.ant-btn-danger[disabled]:active,.ant-btn-danger[disabled]:focus,.ant-btn-danger[disabled]:hover{color:hsla(0,0%,100%,.3);background:hsla(0,0%,100%,.08);border-color:#434343;text-shadow:none;box-shadow:none}.ant-btn-danger[disabled]:active>a:only-child,.ant-btn-danger[disabled]:focus>a:only-child,.ant-btn-danger[disabled]:hover>a:only-child,.ant-btn-danger[disabled]>a:only-child{color:currentColor}.ant-btn-danger[disabled]:active>a:only-child:after,.ant-btn-danger[disabled]:focus>a:only-child:after,.ant-btn-danger[disabled]:hover>a:only-child:after,.ant-btn-danger[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-link{color:#2abdd2;background:transparent;border-color:transparent;box-shadow:none}.ant-btn-link>a:only-child{color:currentColor}.ant-btn-link>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-link:focus,.ant-btn-link:hover{color:#228290;background:transparent;border-color:#228290}.ant-btn-link:focus>a:only-child,.ant-btn-link:hover>a:only-child{color:currentColor}.ant-btn-link:focus>a:only-child:after,.ant-btn-link:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-link:active{color:#4abdca;background:transparent;border-color:#4abdca}.ant-btn-link:active>a:only-child{color:currentColor}.ant-btn-link:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-link[disabled],.ant-btn-link[disabled]:active,.ant-btn-link[disabled]:focus,.ant-btn-link[disabled]:hover{background:hsla(0,0%,100%,.08);border-color:#434343}.ant-btn-link:hover{background:transparent}.ant-btn-link:active,.ant-btn-link:focus,.ant-btn-link:hover{border-color:transparent}.ant-btn-link[disabled],.ant-btn-link[disabled]:active,.ant-btn-link[disabled]:focus,.ant-btn-link[disabled]:hover{color:hsla(0,0%,100%,.3);background:transparent;border-color:transparent;text-shadow:none;box-shadow:none}.ant-btn-link[disabled]:active>a:only-child,.ant-btn-link[disabled]:focus>a:only-child,.ant-btn-link[disabled]:hover>a:only-child,.ant-btn-link[disabled]>a:only-child{color:currentColor}.ant-btn-link[disabled]:active>a:only-child:after,.ant-btn-link[disabled]:focus>a:only-child:after,.ant-btn-link[disabled]:hover>a:only-child:after,.ant-btn-link[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-text{color:hsla(0,0%,100%,.85);background:transparent;border-color:transparent;box-shadow:none}.ant-btn-text>a:only-child{color:currentColor}.ant-btn-text>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-text:focus,.ant-btn-text:hover{color:#228290;background:transparent;border-color:#228290}.ant-btn-text:focus>a:only-child,.ant-btn-text:hover>a:only-child{color:currentColor}.ant-btn-text:focus>a:only-child:after,.ant-btn-text:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-text:active{color:#4abdca;background:transparent;border-color:#4abdca}.ant-btn-text:active>a:only-child{color:currentColor}.ant-btn-text:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-text[disabled],.ant-btn-text[disabled]:active,.ant-btn-text[disabled]:focus,.ant-btn-text[disabled]:hover{background:hsla(0,0%,100%,.08);border-color:#434343}.ant-btn-text:focus,.ant-btn-text:hover{color:hsla(0,0%,100%,.85);background:hsla(0,0%,100%,.03);border-color:transparent}.ant-btn-text:active{color:hsla(0,0%,100%,.85);background:hsla(0,0%,100%,.04);border-color:transparent}.ant-btn-text[disabled],.ant-btn-text[disabled]:active,.ant-btn-text[disabled]:focus,.ant-btn-text[disabled]:hover{color:hsla(0,0%,100%,.3);background:transparent;border-color:transparent;text-shadow:none;box-shadow:none}.ant-btn-text[disabled]:active>a:only-child,.ant-btn-text[disabled]:focus>a:only-child,.ant-btn-text[disabled]:hover>a:only-child,.ant-btn-text[disabled]>a:only-child{color:currentColor}.ant-btn-text[disabled]:active>a:only-child:after,.ant-btn-text[disabled]:focus>a:only-child:after,.ant-btn-text[disabled]:hover>a:only-child:after,.ant-btn-text[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous{color:#a61d24;background:transparent;border-color:#a61d24}.ant-btn-dangerous>a:only-child{color:currentColor}.ant-btn-dangerous>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous:focus,.ant-btn-dangerous:hover{color:#800f19;background:transparent;border-color:#800f19}.ant-btn-dangerous:focus>a:only-child,.ant-btn-dangerous:hover>a:only-child{color:currentColor}.ant-btn-dangerous:focus>a:only-child:after,.ant-btn-dangerous:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous:active{color:#b33b3d;background:transparent;border-color:#b33b3d}.ant-btn-dangerous:active>a:only-child{color:currentColor}.ant-btn-dangerous:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous[disabled],.ant-btn-dangerous[disabled]:active,.ant-btn-dangerous[disabled]:focus,.ant-btn-dangerous[disabled]:hover{color:hsla(0,0%,100%,.3);background:hsla(0,0%,100%,.08);border-color:#434343;text-shadow:none;box-shadow:none}.ant-btn-dangerous[disabled]:active>a:only-child,.ant-btn-dangerous[disabled]:focus>a:only-child,.ant-btn-dangerous[disabled]:hover>a:only-child,.ant-btn-dangerous[disabled]>a:only-child{color:currentColor}.ant-btn-dangerous[disabled]:active>a:only-child:after,.ant-btn-dangerous[disabled]:focus>a:only-child:after,.ant-btn-dangerous[disabled]:hover>a:only-child:after,.ant-btn-dangerous[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous.ant-btn-primary{color:#fff;background:#a61d24;border-color:#a61d24;text-shadow:0 -1px 0 rgba(0,0,0,.12);box-shadow:0 2px 0 rgba(0,0,0,.045)}.ant-btn-dangerous.ant-btn-primary>a:only-child{color:currentColor}.ant-btn-dangerous.ant-btn-primary>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous.ant-btn-primary:focus,.ant-btn-dangerous.ant-btn-primary:hover{color:#fff;background:#800f19;border-color:#800f19}.ant-btn-dangerous.ant-btn-primary:focus>a:only-child,.ant-btn-dangerous.ant-btn-primary:hover>a:only-child{color:currentColor}.ant-btn-dangerous.ant-btn-primary:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-primary:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous.ant-btn-primary:active{color:#fff;background:#b33b3d;border-color:#b33b3d}.ant-btn-dangerous.ant-btn-primary:active>a:only-child{color:currentColor}.ant-btn-dangerous.ant-btn-primary:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous.ant-btn-primary[disabled],.ant-btn-dangerous.ant-btn-primary[disabled]:active,.ant-btn-dangerous.ant-btn-primary[disabled]:focus,.ant-btn-dangerous.ant-btn-primary[disabled]:hover{color:hsla(0,0%,100%,.3);background:hsla(0,0%,100%,.08);border-color:#434343;text-shadow:none;box-shadow:none}.ant-btn-dangerous.ant-btn-primary[disabled]:active>a:only-child,.ant-btn-dangerous.ant-btn-primary[disabled]:focus>a:only-child,.ant-btn-dangerous.ant-btn-primary[disabled]:hover>a:only-child,.ant-btn-dangerous.ant-btn-primary[disabled]>a:only-child{color:currentColor}.ant-btn-dangerous.ant-btn-primary[disabled]:active>a:only-child:after,.ant-btn-dangerous.ant-btn-primary[disabled]:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-primary[disabled]:hover>a:only-child:after,.ant-btn-dangerous.ant-btn-primary[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous.ant-btn-link{color:#a61d24;background:transparent;border-color:transparent;box-shadow:none}.ant-btn-dangerous.ant-btn-link>a:only-child{color:currentColor}.ant-btn-dangerous.ant-btn-link>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous.ant-btn-link:focus,.ant-btn-dangerous.ant-btn-link:hover{color:#228290;border-color:#228290}.ant-btn-dangerous.ant-btn-link:active{color:#4abdca;border-color:#4abdca}.ant-btn-dangerous.ant-btn-link[disabled],.ant-btn-dangerous.ant-btn-link[disabled]:active,.ant-btn-dangerous.ant-btn-link[disabled]:focus,.ant-btn-dangerous.ant-btn-link[disabled]:hover{background:hsla(0,0%,100%,.08);border-color:#434343}.ant-btn-dangerous.ant-btn-link:focus,.ant-btn-dangerous.ant-btn-link:hover{color:#800f19;background:transparent;border-color:transparent}.ant-btn-dangerous.ant-btn-link:focus>a:only-child,.ant-btn-dangerous.ant-btn-link:hover>a:only-child{color:currentColor}.ant-btn-dangerous.ant-btn-link:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-link:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous.ant-btn-link:active{color:#b33b3d;background:transparent;border-color:transparent}.ant-btn-dangerous.ant-btn-link:active>a:only-child{color:currentColor}.ant-btn-dangerous.ant-btn-link:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous.ant-btn-link[disabled],.ant-btn-dangerous.ant-btn-link[disabled]:active,.ant-btn-dangerous.ant-btn-link[disabled]:focus,.ant-btn-dangerous.ant-btn-link[disabled]:hover{color:hsla(0,0%,100%,.3);background:transparent;border-color:transparent;text-shadow:none;box-shadow:none}.ant-btn-dangerous.ant-btn-link[disabled]:active>a:only-child,.ant-btn-dangerous.ant-btn-link[disabled]:focus>a:only-child,.ant-btn-dangerous.ant-btn-link[disabled]:hover>a:only-child,.ant-btn-dangerous.ant-btn-link[disabled]>a:only-child{color:currentColor}.ant-btn-dangerous.ant-btn-link[disabled]:active>a:only-child:after,.ant-btn-dangerous.ant-btn-link[disabled]:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-link[disabled]:hover>a:only-child:after,.ant-btn-dangerous.ant-btn-link[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous.ant-btn-text{color:#a61d24;background:transparent;border-color:transparent;box-shadow:none}.ant-btn-dangerous.ant-btn-text>a:only-child{color:currentColor}.ant-btn-dangerous.ant-btn-text>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous.ant-btn-text:focus,.ant-btn-dangerous.ant-btn-text:hover{color:#228290;background:transparent;border-color:#228290}.ant-btn-dangerous.ant-btn-text:active{color:#4abdca;background:transparent;border-color:#4abdca}.ant-btn-dangerous.ant-btn-text[disabled],.ant-btn-dangerous.ant-btn-text[disabled]:active,.ant-btn-dangerous.ant-btn-text[disabled]:focus,.ant-btn-dangerous.ant-btn-text[disabled]:hover{background:hsla(0,0%,100%,.08);border-color:#434343}.ant-btn-dangerous.ant-btn-text:focus,.ant-btn-dangerous.ant-btn-text:hover{color:#800f19;background:hsla(0,0%,100%,.03);border-color:transparent}.ant-btn-dangerous.ant-btn-text:focus>a:only-child,.ant-btn-dangerous.ant-btn-text:hover>a:only-child{color:currentColor}.ant-btn-dangerous.ant-btn-text:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-text:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous.ant-btn-text:active{color:#b33b3d;background:hsla(0,0%,100%,.04);border-color:transparent}.ant-btn-dangerous.ant-btn-text:active>a:only-child{color:currentColor}.ant-btn-dangerous.ant-btn-text:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-dangerous.ant-btn-text[disabled],.ant-btn-dangerous.ant-btn-text[disabled]:active,.ant-btn-dangerous.ant-btn-text[disabled]:focus,.ant-btn-dangerous.ant-btn-text[disabled]:hover{color:hsla(0,0%,100%,.3);background:transparent;border-color:transparent;text-shadow:none;box-shadow:none}.ant-btn-dangerous.ant-btn-text[disabled]:active>a:only-child,.ant-btn-dangerous.ant-btn-text[disabled]:focus>a:only-child,.ant-btn-dangerous.ant-btn-text[disabled]:hover>a:only-child,.ant-btn-dangerous.ant-btn-text[disabled]>a:only-child{color:currentColor}.ant-btn-dangerous.ant-btn-text[disabled]:active>a:only-child:after,.ant-btn-dangerous.ant-btn-text[disabled]:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-text[disabled]:hover>a:only-child:after,.ant-btn-dangerous.ant-btn-text[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-icon-only{width:32px;height:32px;padding:2.4px 0;font-size:16px;border-radius:2px;vertical-align:-1px}.ant-btn-icon-only>*{font-size:16px}.ant-btn-icon-only.ant-btn-lg{width:40px;height:40px;padding:4.9px 0;font-size:18px;border-radius:2px}.ant-btn-icon-only.ant-btn-lg>*{font-size:18px}.ant-btn-icon-only.ant-btn-sm{width:24px;height:24px;padding:0;font-size:14px;border-radius:2px}.ant-btn-icon-only.ant-btn-sm>*{font-size:14px}.ant-btn-round{height:32px;padding:4px 16px;font-size:14px;border-radius:32px}.ant-btn-round.ant-btn-lg{height:40px;padding:6.4px 20px;font-size:16px;border-radius:40px}.ant-btn-round.ant-btn-sm{height:24px;padding:0 12px;font-size:14px;border-radius:24px}.ant-btn-round.ant-btn-icon-only{width:auto}.ant-btn-circle{min-width:32px;padding-right:0;padding-left:0;text-align:center;border-radius:50%}.ant-btn-circle.ant-btn-lg{min-width:40px;border-radius:50%}.ant-btn-circle.ant-btn-sm{min-width:24px;border-radius:50%}.ant-btn:before{position:absolute;top:-1px;right:-1px;bottom:-1px;left:-1px;z-index:1;display:none;background:#141414;border-radius:inherit;opacity:.35;transition:opacity .2s;content:"";pointer-events:none}.ant-btn .anticon{transition:margin-left .3s cubic-bezier(.645,.045,.355,1)}.ant-btn .anticon.anticon-minus>svg,.ant-btn .anticon.anticon-plus>svg{shape-rendering:optimizeSpeed}.ant-btn.ant-btn-loading{position:relative}.ant-btn.ant-btn-loading:not([disabled]){pointer-events:none}.ant-btn.ant-btn-loading:before{display:block}.ant-btn>.ant-btn-loading-icon{transition:all .3s cubic-bezier(.645,.045,.355,1)}.ant-btn>.ant-btn-loading-icon .anticon{padding-right:8px;animation:none}.ant-btn>.ant-btn-loading-icon .anticon svg{animation:loadingCircle 1s linear infinite}.ant-btn-group{display:inline-flex}.ant-btn-group,.ant-btn-group>.ant-btn,.ant-btn-group>span>.ant-btn{position:relative}.ant-btn-group>.ant-btn:active,.ant-btn-group>.ant-btn:focus,.ant-btn-group>.ant-btn:hover,.ant-btn-group>span>.ant-btn:active,.ant-btn-group>span>.ant-btn:focus,.ant-btn-group>span>.ant-btn:hover{z-index:2}.ant-btn-group>.ant-btn[disabled],.ant-btn-group>span>.ant-btn[disabled]{z-index:0}.ant-btn-group .ant-btn-icon-only{font-size:14px}.ant-btn-group-lg>.ant-btn,.ant-btn-group-lg>span>.ant-btn{height:40px;padding:6.4px 15px;font-size:16px;border-radius:0}.ant-btn-group-lg .ant-btn.ant-btn-icon-only{width:40px;height:40px;padding-right:0;padding-left:0}.ant-btn-group-sm>.ant-btn,.ant-btn-group-sm>span>.ant-btn{height:24px;padding:0 7px;font-size:14px;border-radius:0}.ant-btn-group-sm>.ant-btn>.anticon,.ant-btn-group-sm>span>.ant-btn>.anticon{font-size:14px}.ant-btn-group-sm .ant-btn.ant-btn-icon-only{width:24px;height:24px;padding-right:0;padding-left:0}.ant-btn+.ant-btn-group,.ant-btn-group+.ant-btn,.ant-btn-group+.ant-btn-group,.ant-btn-group .ant-btn+.ant-btn,.ant-btn-group .ant-btn+span,.ant-btn-group>span+span,.ant-btn-group span+.ant-btn{margin-left:-1px}.ant-btn-group .ant-btn-primary+.ant-btn:not(.ant-btn-primary):not([disabled]){border-left-color:transparent}.ant-btn-group .ant-btn{border-radius:0}.ant-btn-group>.ant-btn:first-child,.ant-btn-group>span:first-child>.ant-btn{margin-left:0}.ant-btn-group>.ant-btn:only-child,.ant-btn-group>span:only-child>.ant-btn{border-radius:2px}.ant-btn-group>.ant-btn:first-child:not(:last-child),.ant-btn-group>span:first-child:not(:last-child)>.ant-btn{border-top-left-radius:2px;border-bottom-left-radius:2px}.ant-btn-group>.ant-btn:last-child:not(:first-child),.ant-btn-group>span:last-child:not(:first-child)>.ant-btn{border-top-right-radius:2px;border-bottom-right-radius:2px}.ant-btn-group-sm>.ant-btn:only-child,.ant-btn-group-sm>span:only-child>.ant-btn{border-radius:2px}.ant-btn-group-sm>.ant-btn:first-child:not(:last-child),.ant-btn-group-sm>span:first-child:not(:last-child)>.ant-btn{border-top-left-radius:2px;border-bottom-left-radius:2px}.ant-btn-group-sm>.ant-btn:last-child:not(:first-child),.ant-btn-group-sm>span:last-child:not(:first-child)>.ant-btn{border-top-right-radius:2px;border-bottom-right-radius:2px}.ant-btn-group>.ant-btn-group{float:left}.ant-btn-group>.ant-btn-group:not(:first-child):not(:last-child)>.ant-btn{border-radius:0}.ant-btn-group>.ant-btn-group:first-child:not(:last-child)>.ant-btn:last-child{padding-right:8px;border-top-right-radius:0;border-bottom-right-radius:0}.ant-btn-group>.ant-btn-group:last-child:not(:first-child)>.ant-btn:first-child{padding-left:8px;border-top-left-radius:0;border-bottom-left-radius:0}.ant-btn-group-rtl.ant-btn+.ant-btn-group,.ant-btn-group-rtl.ant-btn-group+.ant-btn,.ant-btn-group-rtl.ant-btn-group+.ant-btn-group,.ant-btn-group-rtl.ant-btn-group .ant-btn+.ant-btn,.ant-btn-group-rtl.ant-btn-group .ant-btn+span,.ant-btn-group-rtl.ant-btn-group>span+span,.ant-btn-group-rtl.ant-btn-group span+.ant-btn,.ant-btn-rtl.ant-btn+.ant-btn-group,.ant-btn-rtl.ant-btn-group+.ant-btn,.ant-btn-rtl.ant-btn-group+.ant-btn-group,.ant-btn-rtl.ant-btn-group .ant-btn+.ant-btn,.ant-btn-rtl.ant-btn-group .ant-btn+span,.ant-btn-rtl.ant-btn-group>span+span,.ant-btn-rtl.ant-btn-group span+.ant-btn{margin-right:-1px;margin-left:auto}.ant-btn-group.ant-btn-group-rtl{direction:rtl}.ant-btn-group-rtl.ant-btn-group>.ant-btn:first-child:not(:last-child),.ant-btn-group-rtl.ant-btn-group>span:first-child:not(:last-child)>.ant-btn{border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}.ant-btn-group-rtl.ant-btn-group>.ant-btn:last-child:not(:first-child),.ant-btn-group-rtl.ant-btn-group>span:last-child:not(:first-child)>.ant-btn{border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.ant-btn-group-rtl.ant-btn-group-sm>.ant-btn:first-child:not(:last-child),.ant-btn-group-rtl.ant-btn-group-sm>span:first-child:not(:last-child)>.ant-btn{border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}.ant-btn-group-rtl.ant-btn-group-sm>.ant-btn:last-child:not(:first-child),.ant-btn-group-rtl.ant-btn-group-sm>span:last-child:not(:first-child)>.ant-btn{border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.ant-btn:active>span,.ant-btn:focus>span{position:relative}.ant-btn>.anticon+span,.ant-btn>span+.anticon{margin-left:8px}.ant-btn-background-ghost{color:hsla(0,0%,100%,.85);background:transparent!important;border-color:hsla(0,0%,100%,.25)}.ant-btn-background-ghost.ant-btn-primary{color:#2abdd2;background:transparent;border-color:#2abdd2;text-shadow:none}.ant-btn-background-ghost.ant-btn-primary>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-primary>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-primary:focus,.ant-btn-background-ghost.ant-btn-primary:hover{color:#1a93ab;background:transparent;border-color:#1a93ab}.ant-btn-background-ghost.ant-btn-primary:focus>a:only-child,.ant-btn-background-ghost.ant-btn-primary:hover>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-primary:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-primary:active{color:#50d0de;background:transparent;border-color:#50d0de}.ant-btn-background-ghost.ant-btn-primary:active>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-primary:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-primary[disabled],.ant-btn-background-ghost.ant-btn-primary[disabled]:active,.ant-btn-background-ghost.ant-btn-primary[disabled]:focus,.ant-btn-background-ghost.ant-btn-primary[disabled]:hover{color:hsla(0,0%,100%,.3);background:hsla(0,0%,100%,.08);border-color:#434343;text-shadow:none;box-shadow:none}.ant-btn-background-ghost.ant-btn-primary[disabled]:active>a:only-child,.ant-btn-background-ghost.ant-btn-primary[disabled]:focus>a:only-child,.ant-btn-background-ghost.ant-btn-primary[disabled]:hover>a:only-child,.ant-btn-background-ghost.ant-btn-primary[disabled]>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-primary[disabled]:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary[disabled]:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary[disabled]:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-danger{color:#a61d24;background:transparent;border-color:#a61d24;text-shadow:none}.ant-btn-background-ghost.ant-btn-danger>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-danger>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-danger:focus,.ant-btn-background-ghost.ant-btn-danger:hover{color:#800f19;background:transparent;border-color:#800f19}.ant-btn-background-ghost.ant-btn-danger:focus>a:only-child,.ant-btn-background-ghost.ant-btn-danger:hover>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-danger:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-danger:active{color:#b33b3d;background:transparent;border-color:#b33b3d}.ant-btn-background-ghost.ant-btn-danger:active>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-danger:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-danger[disabled],.ant-btn-background-ghost.ant-btn-danger[disabled]:active,.ant-btn-background-ghost.ant-btn-danger[disabled]:focus,.ant-btn-background-ghost.ant-btn-danger[disabled]:hover{color:hsla(0,0%,100%,.3);background:hsla(0,0%,100%,.08);border-color:#434343;text-shadow:none;box-shadow:none}.ant-btn-background-ghost.ant-btn-danger[disabled]:active>a:only-child,.ant-btn-background-ghost.ant-btn-danger[disabled]:focus>a:only-child,.ant-btn-background-ghost.ant-btn-danger[disabled]:hover>a:only-child,.ant-btn-background-ghost.ant-btn-danger[disabled]>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-danger[disabled]:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger[disabled]:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger[disabled]:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-dangerous{color:#a61d24;background:transparent;border-color:#a61d24;text-shadow:none}.ant-btn-background-ghost.ant-btn-dangerous>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-dangerous>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-dangerous:focus,.ant-btn-background-ghost.ant-btn-dangerous:hover{color:#800f19;background:transparent;border-color:#800f19}.ant-btn-background-ghost.ant-btn-dangerous:focus>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous:hover>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-dangerous:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-dangerous:active{color:#b33b3d;background:transparent;border-color:#b33b3d}.ant-btn-background-ghost.ant-btn-dangerous:active>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-dangerous:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-dangerous[disabled],.ant-btn-background-ghost.ant-btn-dangerous[disabled]:active,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:focus,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:hover{color:hsla(0,0%,100%,.3);background:hsla(0,0%,100%,.08);border-color:#434343;text-shadow:none;box-shadow:none}.ant-btn-background-ghost.ant-btn-dangerous[disabled]:active>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:focus>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:hover>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous[disabled]>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-dangerous[disabled]:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link{color:#a61d24;background:transparent;border-color:transparent;text-shadow:none}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:focus,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:hover{color:#800f19;background:transparent;border-color:transparent}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:focus>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:hover>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:hover>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:active{color:#b33b3d;background:transparent;border-color:transparent}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:active>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:active>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled],.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:active,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:focus,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:hover{color:hsla(0,0%,100%,.3);background:hsla(0,0%,100%,.08);border-color:#434343;text-shadow:none;box-shadow:none}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:active>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:focus>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:hover>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]>a:only-child:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;content:""}.ant-btn-two-chinese-chars:first-letter{letter-spacing:.34em}.ant-btn-two-chinese-chars>:not(.anticon){margin-right:-.34em;letter-spacing:.34em}.ant-btn-block{width:100%}.ant-btn:empty{display:inline-block;width:0;visibility:hidden;content:"\a0"}a.ant-btn{padding-top:.1px;line-height:30px}a.ant-btn-lg{line-height:38px}a.ant-btn-sm{line-height:22px}.ant-btn-rtl{direction:rtl}.ant-btn-group-rtl.ant-btn-group .ant-btn-primary+.ant-btn-primary,.ant-btn-group-rtl.ant-btn-group .ant-btn-primary:last-child:not(:first-child){border-right-color:#228290;border-left-color:#434343}.ant-btn-group-rtl.ant-btn-group .ant-btn-primary+.ant-btn-primary[disabled],.ant-btn-group-rtl.ant-btn-group .ant-btn-primary:last-child:not(:first-child)[disabled]{border-right-color:#434343;border-left-color:#228290}.ant-btn-rtl.ant-btn>.ant-btn-loading-icon .anticon{padding-right:0;padding-left:8px}.ant-btn>.ant-btn-loading-icon:only-child .anticon{padding-right:0;padding-left:0}.ant-btn-rtl.ant-btn>.anticon+span,.ant-btn-rtl.ant-btn>span+.anticon{margin-right:8px;margin-left:0}.ant-picker-calendar{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";background:#141414}.ant-picker-calendar-header{display:flex;justify-content:flex-end;padding:12px 0}.ant-picker-calendar-header .ant-picker-calendar-year-select{min-width:80px}.ant-picker-calendar-header .ant-picker-calendar-month-select{min-width:70px;margin-left:8px}.ant-picker-calendar-header .ant-picker-calendar-mode-switch{margin-left:8px}.ant-picker-calendar .ant-picker-panel{background:#141414;border:0;border-top:1px solid #303030;border-radius:0}.ant-picker-calendar .ant-picker-panel .ant-picker-date-panel,.ant-picker-calendar .ant-picker-panel .ant-picker-month-panel{width:auto}.ant-picker-calendar .ant-picker-panel .ant-picker-body{padding:8px 0}.ant-picker-calendar .ant-picker-panel .ant-picker-content{width:100%}.ant-picker-calendar-mini{border-radius:2px}.ant-picker-calendar-mini .ant-picker-calendar-header{padding-right:8px;padding-left:8px}.ant-picker-calendar-mini .ant-picker-panel{border-radius:0 0 2px 2px}.ant-picker-calendar-mini .ant-picker-content{height:256px}.ant-picker-calendar-mini .ant-picker-content th{height:auto;padding:0;line-height:18px}.ant-picker-calendar-full .ant-picker-panel{display:block;width:100%;text-align:right;background:#141414;border:0}.ant-picker-calendar-full .ant-picker-panel .ant-picker-body td,.ant-picker-calendar-full .ant-picker-panel .ant-picker-body th{padding:0}.ant-picker-calendar-full .ant-picker-panel .ant-picker-body th{height:auto;padding:0 12px 5px 0;line-height:18px}.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell:before{display:none}.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell:hover .ant-picker-calendar-date{background:hsla(0,0%,100%,.08)}.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell .ant-picker-calendar-date-today:before{display:none}.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected .ant-picker-calendar-date,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected .ant-picker-calendar-date-today,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected:hover .ant-picker-calendar-date,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected:hover .ant-picker-calendar-date-today{background:#132125}.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected .ant-picker-calendar-date-today .ant-picker-calendar-date-value,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected .ant-picker-calendar-date .ant-picker-calendar-date-value,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected:hover .ant-picker-calendar-date-today .ant-picker-calendar-date-value,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected:hover .ant-picker-calendar-date .ant-picker-calendar-date-value{color:#2abdd2}.ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date{display:block;width:auto;height:auto;margin:0 4px;padding:4px 8px 0;border:0;border-top:2px solid #303030;border-radius:0;transition:background .3s}.ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date-value{line-height:24px;transition:color .3s}.ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date-content{position:static;width:auto;height:86px;overflow-y:auto;color:hsla(0,0%,100%,.85);line-height:1.5715;text-align:left}.ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date-today{border-color:#2abdd2}.ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date-today .ant-picker-calendar-date-value{color:hsla(0,0%,100%,.85)}@media only screen and (max-width:480px){.ant-picker-calendar-header{display:block}.ant-picker-calendar-header .ant-picker-calendar-year-select{width:50%}.ant-picker-calendar-header .ant-picker-calendar-month-select{width:calc(50% - 8px)}.ant-picker-calendar-header .ant-picker-calendar-mode-switch{width:100%;margin-top:8px;margin-left:0}.ant-picker-calendar-header .ant-picker-calendar-mode-switch>label{width:50%;text-align:center}}.ant-picker-calendar-rtl{direction:rtl}.ant-picker-calendar-rtl .ant-picker-calendar-header .ant-picker-calendar-mode-switch,.ant-picker-calendar-rtl .ant-picker-calendar-header .ant-picker-calendar-month-select{margin-right:8px;margin-left:0}.ant-picker-calendar-rtl.ant-picker-calendar-full .ant-picker-panel{text-align:left}.ant-picker-calendar-rtl.ant-picker-calendar-full .ant-picker-panel .ant-picker-body th{padding:0 0 5px 12px}.ant-picker-calendar-rtl.ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date-content{text-align:right}.ant-card{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:relative;background:#141414;border-radius:2px}.ant-card-rtl{direction:rtl}.ant-card-hoverable{cursor:pointer;transition:box-shadow .3s,border-color .3s}.ant-card-hoverable:hover{border-color:transparent;box-shadow:0 1px 2px -2px rgba(0,0,0,.64),0 3px 6px 0 rgba(0,0,0,.48),0 5px 12px 4px rgba(0,0,0,.36)}.ant-card-bordered{border:1px solid #303030}.ant-card-head{min-height:48px;margin-bottom:-1px;padding:0 24px;color:hsla(0,0%,100%,.85);font-weight:500;font-size:16px;background:transparent;border-bottom:1px solid #303030;border-radius:2px 2px 0 0}.ant-card-head:after,.ant-card-head:before{display:table;content:""}.ant-card-head:after{clear:both}.ant-card-head-wrapper{display:flex;align-items:center}.ant-card-head-title{display:inline-block;flex:1 1;padding:16px 0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ant-card-head-title>.ant-typography,.ant-card-head-title>.ant-typography-edit-content{left:0;margin-top:0;margin-bottom:0}.ant-card-head .ant-tabs{clear:both;margin-bottom:-17px;color:hsla(0,0%,100%,.85);font-weight:400;font-size:14px}.ant-card-head .ant-tabs-bar{border-bottom:1px solid #303030}.ant-card-extra{float:right;margin-left:auto;padding:16px 0;color:hsla(0,0%,100%,.85);font-weight:400;font-size:14px}.ant-card-rtl .ant-card-extra{margin-right:auto;margin-left:0}.ant-card-body{padding:24px}.ant-card-body:after,.ant-card-body:before{display:table;content:""}.ant-card-body:after{clear:both}.ant-card-contain-grid:not(.ant-card-loading) .ant-card-body{margin:-1px 0 0 -1px;padding:0}.ant-card-grid{float:left;width:33.33%;padding:24px;border:0;border-radius:0;box-shadow:1px 0 0 0 #303030,0 1px 0 0 #303030,1px 1px 0 0 #303030,inset 1px 0 0 0 #303030,inset 0 1px 0 0 #303030;transition:all .3s}.ant-card-rtl .ant-card-grid{float:right}.ant-card-grid-hoverable:hover{position:relative;z-index:1;box-shadow:0 1px 2px -2px rgba(0,0,0,.64),0 3px 6px 0 rgba(0,0,0,.48),0 5px 12px 4px rgba(0,0,0,.36)}.ant-card-contain-tabs>.ant-card-head .ant-card-head-title{min-height:32px;padding-bottom:0}.ant-card-contain-tabs>.ant-card-head .ant-card-extra{padding-bottom:0}.ant-card-bordered .ant-card-cover{margin-top:-1px;margin-right:-1px;margin-left:-1px}.ant-card-cover>*{display:block;width:100%}.ant-card-cover img{border-radius:2px 2px 0 0}.ant-card-actions{margin:0;padding:0;list-style:none;background:#141414;border-top:1px solid #303030}.ant-card-actions:after,.ant-card-actions:before{display:table;content:""}.ant-card-actions:after{clear:both}.ant-card-actions>li{float:left;margin:12px 0;color:hsla(0,0%,100%,.45);text-align:center}.ant-card-rtl .ant-card-actions>li{float:right}.ant-card-actions>li>span{position:relative;display:block;min-width:32px;font-size:14px;line-height:1.5715;cursor:pointer}.ant-card-actions>li>span:hover{color:#2abdd2;transition:color .3s}.ant-card-actions>li>span>.anticon,.ant-card-actions>li>span a:not(.ant-btn){display:inline-block;width:100%;color:hsla(0,0%,100%,.45);line-height:22px;transition:color .3s}.ant-card-actions>li>span>.anticon:hover,.ant-card-actions>li>span a:not(.ant-btn):hover{color:#2abdd2}.ant-card-actions>li>span>.anticon{font-size:16px;line-height:22px}.ant-card-actions>li:not(:last-child){border-right:1px solid #303030}.ant-card-rtl .ant-card-actions>li:not(:last-child){border-right:none;border-left:1px solid #303030}.ant-card-type-inner .ant-card-head{padding:0 24px;background:hsla(0,0%,100%,.04)}.ant-card-type-inner .ant-card-head-title{padding:12px 0;font-size:14px}.ant-card-type-inner .ant-card-body{padding:16px 24px}.ant-card-type-inner .ant-card-extra{padding:13.5px 0}.ant-card-meta{margin:-4px 0}.ant-card-meta:after,.ant-card-meta:before{display:table;content:""}.ant-card-meta:after{clear:both}.ant-card-meta-avatar{float:left;padding-right:16px}.ant-card-rtl .ant-card-meta-avatar{float:right;padding-right:0;padding-left:16px}.ant-card-meta-detail{overflow:hidden}.ant-card-meta-detail>div:not(:last-child){margin-bottom:8px}.ant-card-meta-title{overflow:hidden;color:hsla(0,0%,100%,.85);font-weight:500;font-size:16px;white-space:nowrap;text-overflow:ellipsis}.ant-card-meta-description{color:hsla(0,0%,100%,.45)}.ant-card-loading{overflow:hidden}.ant-card-loading .ant-card-body{-webkit-user-select:none;-ms-user-select:none;user-select:none}.ant-card-loading-content p{margin:0}.ant-card-loading-block{height:14px;margin:4px 0;background:linear-gradient(90deg,rgba(48,48,48,.2),rgba(48,48,48,.4),rgba(48,48,48,.2));background-size:600% 600%;border-radius:2px;animation:card-loading 1.4s ease infinite}@keyframes card-loading{0%,to{background-position:0 50%}50%{background-position:100% 50%}}.ant-card-small>.ant-card-head{min-height:36px;padding:0 12px;font-size:14px}.ant-card-small>.ant-card-head>.ant-card-head-wrapper>.ant-card-head-title{padding:8px 0}.ant-card-small>.ant-card-head>.ant-card-head-wrapper>.ant-card-extra{padding:8px 0;font-size:14px}.ant-card-small>.ant-card-body{padding:12px}.ant-carousel{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum"}.ant-carousel .slick-slider{position:relative;display:block;box-sizing:border-box;touch-action:pan-y;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}.ant-carousel .slick-list{position:relative;display:block;margin:0;padding:0;overflow:hidden}.ant-carousel .slick-list:focus{outline:none}.ant-carousel .slick-list.dragging{cursor:pointer}.ant-carousel .slick-list .slick-slide{pointer-events:none}.ant-carousel .slick-list .slick-slide input.ant-checkbox-input,.ant-carousel .slick-list .slick-slide input.ant-radio-input{visibility:hidden}.ant-carousel .slick-list .slick-slide.slick-active{pointer-events:auto}.ant-carousel .slick-list .slick-slide.slick-active input.ant-checkbox-input,.ant-carousel .slick-list .slick-slide.slick-active input.ant-radio-input{visibility:visible}.ant-carousel .slick-list .slick-slide>div>div{vertical-align:bottom}.ant-carousel .slick-slider .slick-list,.ant-carousel .slick-slider .slick-track{transform:translateZ(0);touch-action:pan-y}.ant-carousel .slick-track{position:relative;top:0;left:0;display:block}.ant-carousel .slick-track:after,.ant-carousel .slick-track:before{display:table;content:""}.ant-carousel .slick-track:after{clear:both}.slick-loading .ant-carousel .slick-track{visibility:hidden}.ant-carousel .slick-slide{display:none;float:left;height:100%;min-height:1px}.ant-carousel .slick-slide img{display:block}.ant-carousel .slick-slide.slick-loading img{display:none}.ant-carousel .slick-slide.dragging img{pointer-events:none}.ant-carousel .slick-initialized .slick-slide{display:block}.ant-carousel .slick-loading .slick-slide{visibility:hidden}.ant-carousel .slick-vertical .slick-slide{display:block;height:auto}.ant-carousel .slick-arrow.slick-hidden{display:none}.ant-carousel .slick-next,.ant-carousel .slick-prev{position:absolute;top:50%;display:block;width:20px;height:20px;margin-top:-10px;padding:0;font-size:0;line-height:0;border:0;cursor:pointer}.ant-carousel .slick-next,.ant-carousel .slick-next:focus,.ant-carousel .slick-next:hover,.ant-carousel .slick-prev,.ant-carousel .slick-prev:focus,.ant-carousel .slick-prev:hover{color:transparent;background:transparent;outline:none}.ant-carousel .slick-next:focus:before,.ant-carousel .slick-next:hover:before,.ant-carousel .slick-prev:focus:before,.ant-carousel .slick-prev:hover:before{opacity:1}.ant-carousel .slick-next.slick-disabled:before,.ant-carousel .slick-prev.slick-disabled:before{opacity:.25}.ant-carousel .slick-prev{left:-25px}.ant-carousel .slick-prev:before{content:"←"}.ant-carousel .slick-next{right:-25px}.ant-carousel .slick-next:before{content:"→"}.ant-carousel .slick-dots{position:absolute;right:0;bottom:0;left:0;z-index:15;display:flex!important;justify-content:center;margin-right:15%;margin-left:15%;padding-left:0;list-style:none}.ant-carousel .slick-dots-bottom{bottom:12px}.ant-carousel .slick-dots-top{top:12px}.ant-carousel .slick-dots li{position:relative;display:inline-block;flex:0 1 auto;box-sizing:content-box;width:16px;height:3px;margin:0 3px;padding:0;text-align:center;text-indent:-999px;vertical-align:top;transition:all .5s}.ant-carousel .slick-dots li button{display:block;width:100%;height:3px;padding:0;color:transparent;font-size:0;background:#141414;border:0;border-radius:1px;outline:none;cursor:pointer;opacity:.3;transition:all .5s}.ant-carousel .slick-dots li button:focus,.ant-carousel .slick-dots li button:hover{opacity:.75}.ant-carousel .slick-dots li.slick-active{width:24px}.ant-carousel .slick-dots li.slick-active button{background:#141414;opacity:1}.ant-carousel .slick-dots li.slick-active:focus,.ant-carousel .slick-dots li.slick-active:hover{opacity:1}.ant-carousel-vertical .slick-dots{top:50%;bottom:auto;flex-direction:column;width:3px;height:auto;margin:0;transform:translateY(-50%)}.ant-carousel-vertical .slick-dots-left{right:auto;left:12px}.ant-carousel-vertical .slick-dots-right{right:12px;left:auto}.ant-carousel-vertical .slick-dots li{width:3px;height:16px;margin:4px 2px;vertical-align:baseline}.ant-carousel-vertical .slick-dots li button{width:3px;height:16px}.ant-carousel-vertical .slick-dots li.slick-active,.ant-carousel-vertical .slick-dots li.slick-active button{width:3px;height:24px}.ant-carousel-rtl{direction:rtl}.ant-carousel-rtl .ant-carousel .slick-track{right:0;left:auto}.ant-carousel-rtl .ant-carousel .slick-prev{right:-25px;left:auto}.ant-carousel-rtl .ant-carousel .slick-prev:before{content:"→"}.ant-carousel-rtl .ant-carousel .slick-next{right:auto;left:-25px}.ant-carousel-rtl .ant-carousel .slick-next:before{content:"←"}.ant-carousel-rtl.ant-carousel .slick-dots{flex-direction:row-reverse}.ant-carousel-rtl.ant-carousel-vertical .slick-dots{flex-direction:column}.ant-cascader{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum"}.ant-cascader-input.ant-input{position:static;width:100%;padding-right:24px;background-color:transparent!important;cursor:pointer}.ant-cascader-picker-show-search .ant-cascader-input.ant-input{position:relative}.ant-cascader-picker{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:relative;display:inline-block;background-color:transparent;border-radius:2px;outline:0;cursor:pointer;transition:color .3s}.ant-cascader-picker-with-value .ant-cascader-picker-label{color:transparent}.ant-cascader-picker-disabled{color:hsla(0,0%,100%,.3);background:hsla(0,0%,100%,.08);cursor:not-allowed}.ant-cascader-picker-disabled .ant-cascader-input{cursor:not-allowed}.ant-cascader-picker:focus .ant-cascader-input{border-color:#2abdd2;border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(42,189,210,.2)}.ant-input-rtl .ant-cascader-picker:focus .ant-cascader-input{border-right-width:0;border-left-width:1px!important}.ant-cascader-picker-borderless .ant-cascader-input{border-color:transparent!important;box-shadow:none!important}.ant-cascader-picker-show-search.ant-cascader-picker-focused{color:hsla(0,0%,100%,.3)}.ant-cascader-picker-label{position:absolute;top:50%;left:0;width:100%;height:20px;margin-top:-10px;padding:0 20px 0 12px;overflow:hidden;line-height:20px;white-space:nowrap;text-overflow:ellipsis}.ant-cascader-picker-clear{position:absolute;top:50%;right:12px;z-index:2;width:12px;height:12px;margin-top:-6px;color:hsla(0,0%,100%,.3);font-size:12px;line-height:12px;background:#141414;cursor:pointer;opacity:0;transition:color .3s ease,opacity .15s ease}.ant-cascader-picker-clear:hover{color:hsla(0,0%,100%,.45)}.ant-cascader-picker:hover .ant-cascader-picker-clear{opacity:1}.ant-cascader-picker-arrow{position:absolute;top:50%;right:12px;z-index:1;width:12px;height:12px;margin-top:-6px;color:hsla(0,0%,100%,.3);font-size:12px;line-height:12px}.ant-cascader-picker-label:hover+.ant-cascader-input:not(.ant-cascader-picker-disabled .ant-cascader-picker-label:hover+.ant-cascader-input){border-color:#228290;border-right-width:1px!important}.ant-input-rtl .ant-cascader-picker-label:hover+.ant-cascader-input:not(.ant-cascader-picker-disabled .ant-cascader-picker-label:hover+.ant-cascader-input){border-right-width:0;border-left-width:1px!important}.ant-cascader-picker-small .ant-cascader-picker-arrow,.ant-cascader-picker-small .ant-cascader-picker-clear{right:8px}.ant-cascader-menus{position:absolute;z-index:1050;font-size:14px;white-space:nowrap;background:#1a2029;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.48),0 6px 16px 0 rgba(0,0,0,.32),0 9px 28px 8px rgba(0,0,0,.2)}.ant-cascader-menus ol,.ant-cascader-menus ul{margin:0;list-style:none}.ant-cascader-menus-empty,.ant-cascader-menus-hidden{display:none}.ant-cascader-menus.slide-up-appear.slide-up-appear-active.ant-cascader-menus-placement-bottomLeft,.ant-cascader-menus.slide-up-enter.slide-up-enter-active.ant-cascader-menus-placement-bottomLeft{animation-name:antSlideUpIn}.ant-cascader-menus.slide-up-appear.slide-up-appear-active.ant-cascader-menus-placement-topLeft,.ant-cascader-menus.slide-up-enter.slide-up-enter-active.ant-cascader-menus-placement-topLeft{animation-name:antSlideDownIn}.ant-cascader-menus.slide-up-leave.slide-up-leave-active.ant-cascader-menus-placement-bottomLeft{animation-name:antSlideUpOut}.ant-cascader-menus.slide-up-leave.slide-up-leave-active.ant-cascader-menus-placement-topLeft{animation-name:antSlideDownOut}.ant-cascader-menu{display:inline-block;min-width:111px;height:180px;margin:0;padding:4px 0;overflow:auto;vertical-align:top;list-style:none;border-right:1px solid #303030;-ms-overflow-style:-ms-autohiding-scrollbar}.ant-cascader-menu:first-child{border-radius:2px 0 0 2px}.ant-cascader-menu:last-child{margin-right:-1px;border-right-color:transparent;border-radius:0 2px 2px 0}.ant-cascader-menu:only-child{border-radius:2px}.ant-cascader-menu-item{padding:5px 12px;overflow:hidden;line-height:22px;white-space:nowrap;text-overflow:ellipsis;cursor:pointer;transition:all .3s}.ant-cascader-menu-item:hover{background:hsla(0,0%,100%,.08)}.ant-cascader-menu-item-disabled{color:hsla(0,0%,100%,.3);cursor:not-allowed}.ant-cascader-menu-item-disabled:hover{background:transparent}.ant-cascader-menu-empty .ant-cascader-menu-item{color:hsla(0,0%,100%,.3);cursor:default;pointer-events:none}.ant-cascader-menu-item-active:not(.ant-cascader-menu-item-disabled),.ant-cascader-menu-item-active:not(.ant-cascader-menu-item-disabled):hover{font-weight:600;background-color:#132125}.ant-cascader-menu-item-expand{position:relative;padding-right:24px}.ant-cascader-menu-item-expand .ant-cascader-menu-item-expand-icon,.ant-cascader-menu-item-loading-icon{position:absolute;right:12px;color:hsla(0,0%,100%,.45);font-size:10px}.ant-cascader-menu-item-disabled.ant-cascader-menu-item-expand .ant-cascader-menu-item-expand-icon,.ant-cascader-menu-item-disabled.ant-cascader-menu-item-loading-icon{color:hsla(0,0%,100%,.3)}.ant-cascader-menu-item .ant-cascader-menu-item-keyword{color:#a61d24}.ant-cascader-picker-rtl .ant-cascader-input.ant-input{padding-right:11px;padding-left:24px;text-align:right}.ant-cascader-picker-rtl{direction:rtl}.ant-cascader-picker-rtl .ant-cascader-picker-label{padding:0 12px 0 20px;text-align:right}.ant-cascader-picker-rtl .ant-cascader-picker-arrow,.ant-cascader-picker-rtl .ant-cascader-picker-clear{right:auto;left:12px}.ant-cascader-picker-rtl.ant-cascader-picker-small .ant-cascader-picker-arrow,.ant-cascader-picker-rtl.ant-cascader-picker-small .ant-cascader-picker-clear{right:auto;left:8px}.ant-cascader-menu-rtl .ant-cascader-menu{direction:rtl;border-right:none;border-left:1px solid #303030}.ant-cascader-menu-rtl .ant-cascader-menu:first-child{border-radius:0 2px 2px 0}.ant-cascader-menu-rtl .ant-cascader-menu:last-child{margin-right:0;margin-left:-1px;border-left-color:transparent;border-radius:2px 0 0 2px}.ant-cascader-menu-rtl .ant-cascader-menu:only-child{border-radius:2px}.ant-cascader-menu-rtl .ant-cascader-menu-item-expand{padding-right:12px;padding-left:24px}.ant-cascader-menu-rtl .ant-cascader-menu-item-expand .ant-cascader-menu-item-expand-icon,.ant-cascader-menu-rtl .ant-cascader-menu-item-loading-icon{right:auto;left:12px}.ant-cascader-menu-rtl .ant-cascader-menu-item-loading-icon{transform:scaleY(-1)}@keyframes antCheckboxEffect{0%{transform:scale(1);opacity:.5}to{transform:scale(1.6);opacity:0}}.ant-checkbox{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:relative;top:-.09em;display:inline-block;line-height:1;white-space:nowrap;vertical-align:middle;outline:none;cursor:pointer}.ant-checkbox-input:focus+.ant-checkbox-inner,.ant-checkbox-wrapper:hover .ant-checkbox-inner,.ant-checkbox:hover .ant-checkbox-inner{border-color:#2abdd2}.ant-checkbox-checked:after{position:absolute;top:0;left:0;width:100%;height:100%;border:1px solid #2abdd2;border-radius:2px;visibility:hidden;animation:antCheckboxEffect .36s ease-in-out;animation-fill-mode:backwards;content:""}.ant-checkbox-wrapper:hover .ant-checkbox:after,.ant-checkbox:hover:after{visibility:visible}.ant-checkbox-inner{position:relative;top:0;left:0;display:block;width:16px;height:16px;direction:ltr;background-color:transparent;border:1px solid #434343;border-radius:2px;border-collapse:separate;transition:all .3s}.ant-checkbox-inner:after{position:absolute;top:50%;left:22%;display:table;width:5.71428571px;height:9.14285714px;border:2px solid #fff;border-top:0;border-left:0;transform:rotate(45deg) scale(0) translate(-50%,-50%);opacity:0;transition:all .1s cubic-bezier(.71,-.46,.88,.6),opacity .1s;content:" "}.ant-checkbox-input{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;width:100%;height:100%;cursor:pointer;opacity:0}.ant-checkbox-checked .ant-checkbox-inner:after{position:absolute;display:table;border:2px solid #fff;border-top:0;border-left:0;transform:rotate(45deg) scale(1) translate(-50%,-50%);opacity:1;transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s;content:" "}.ant-checkbox-checked .ant-checkbox-inner{background-color:#2abdd2;border-color:#2abdd2}.ant-checkbox-disabled{cursor:not-allowed}.ant-checkbox-disabled.ant-checkbox-checked .ant-checkbox-inner:after{border-color:hsla(0,0%,100%,.3);animation-name:none}.ant-checkbox-disabled .ant-checkbox-input{cursor:not-allowed}.ant-checkbox-disabled .ant-checkbox-inner{background-color:hsla(0,0%,100%,.08);border-color:#434343!important}.ant-checkbox-disabled .ant-checkbox-inner:after{border-color:hsla(0,0%,100%,.08);border-collapse:separate;animation-name:none}.ant-checkbox-disabled+span{color:hsla(0,0%,100%,.3);cursor:not-allowed}.ant-checkbox-disabled:hover:after,.ant-checkbox-wrapper:hover .ant-checkbox-disabled:after{visibility:hidden}.ant-checkbox-wrapper{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";display:inline-block;line-height:unset;cursor:pointer}.ant-checkbox-wrapper.ant-checkbox-wrapper-disabled{cursor:not-allowed}.ant-checkbox-wrapper+.ant-checkbox-wrapper{margin-left:8px}.ant-checkbox+span{padding-right:8px;padding-left:8px}.ant-checkbox-group{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";display:inline-block}.ant-checkbox-group-item{display:inline-block;margin-right:8px}.ant-checkbox-group-item:last-child{margin-right:0}.ant-checkbox-group-item+.ant-checkbox-group-item{margin-left:0}.ant-checkbox-indeterminate .ant-checkbox-inner{background-color:transparent;border-color:#434343}.ant-checkbox-indeterminate .ant-checkbox-inner:after{top:50%;left:50%;width:8px;height:8px;background-color:#2abdd2;border:0;transform:translate(-50%,-50%) scale(1);opacity:1;content:" "}.ant-checkbox-indeterminate.ant-checkbox-disabled .ant-checkbox-inner:after{background-color:hsla(0,0%,100%,.3);border-color:hsla(0,0%,100%,.3)}.ant-checkbox-rtl{direction:rtl}.ant-checkbox-group-rtl .ant-checkbox-group-item{margin-right:0;margin-left:8px}.ant-checkbox-group-rtl .ant-checkbox-group-item:last-child{margin-left:0!important}.ant-checkbox-group-rtl .ant-checkbox-group-item+.ant-checkbox-group-item{margin-left:8px}.ant-collapse{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";background-color:hsla(0,0%,100%,.04);border:1px solid #434343;border-bottom:0;border-radius:2px}.ant-collapse>.ant-collapse-item{border-bottom:1px solid #434343}.ant-collapse>.ant-collapse-item:last-child,.ant-collapse>.ant-collapse-item:last-child>.ant-collapse-header{border-radius:0 0 2px 2px}.ant-collapse>.ant-collapse-item>.ant-collapse-header{position:relative;padding:12px 16px 12px 40px;color:hsla(0,0%,100%,.85);line-height:1.5715;cursor:pointer;transition:all .3s,visibility 0s}.ant-collapse>.ant-collapse-item>.ant-collapse-header:before{display:table;content:""}.ant-collapse>.ant-collapse-item>.ant-collapse-header:after{display:table;clear:both;content:""}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow{color:inherit;font-style:normal;line-height:0;text-align:center;text-transform:none;vertical-align:-.125em;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:absolute;top:5.0005px;left:16px;display:inline-block;padding:12px 0 0;font-size:12px}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow>*{line-height:1}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow svg{display:inline-block}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow:before{display:none}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow .ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow-icon{display:block}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow svg{transition:transform .24s}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-extra{float:right}.ant-collapse>.ant-collapse-item>.ant-collapse-header:focus{outline:none}.ant-collapse>.ant-collapse-item .ant-collapse-header-collapsible-only{cursor:default}.ant-collapse>.ant-collapse-item .ant-collapse-header-collapsible-only .ant-collapse-header-text{cursor:pointer}.ant-collapse>.ant-collapse-item.ant-collapse-no-arrow>.ant-collapse-header{padding-left:12px}.ant-collapse-icon-position-right>.ant-collapse-item>.ant-collapse-header{padding:12px 40px 12px 16px}.ant-collapse-icon-position-right>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow{right:16px;left:auto}.ant-collapse-content{color:hsla(0,0%,100%,.85);background-color:#141414;border-top:1px solid #434343}.ant-collapse-content>.ant-collapse-content-box{padding:16px}.ant-collapse-content-hidden{display:none}.ant-collapse-item:last-child>.ant-collapse-content{border-radius:0 0 2px 2px}.ant-collapse-borderless{background-color:hsla(0,0%,100%,.04);border:0}.ant-collapse-borderless>.ant-collapse-item{border-bottom:1px solid #434343}.ant-collapse-borderless>.ant-collapse-item:last-child,.ant-collapse-borderless>.ant-collapse-item:last-child .ant-collapse-header{border-radius:0}.ant-collapse-borderless>.ant-collapse-item>.ant-collapse-content{background-color:transparent;border-top:0}.ant-collapse-borderless>.ant-collapse-item>.ant-collapse-content>.ant-collapse-content-box{padding-top:4px}.ant-collapse-ghost{background-color:transparent;border:0}.ant-collapse-ghost>.ant-collapse-item{border-bottom:0}.ant-collapse-ghost>.ant-collapse-item>.ant-collapse-content{background-color:transparent;border-top:0}.ant-collapse-ghost>.ant-collapse-item>.ant-collapse-content>.ant-collapse-content-box{padding-top:12px;padding-bottom:12px}.ant-collapse .ant-collapse-item-disabled>.ant-collapse-header,.ant-collapse .ant-collapse-item-disabled>.ant-collapse-header>.arrow{color:hsla(0,0%,100%,.3);cursor:not-allowed}.ant-collapse-rtl{direction:rtl}.ant-collapse-rtl .ant-collapse>.ant-collapse-item>.ant-collapse-header{padding:12px 40px 12px 16px}.ant-collapse-rtl.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow svg{transform:rotate(180deg)}.ant-collapse-rtl.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-extra{float:left}.ant-collapse-rtl.ant-collapse>.ant-collapse-item.ant-collapse-no-arrow>.ant-collapse-header{padding-right:12px;padding-left:0}.ant-comment{position:relative;background-color:transparent}.ant-comment-inner{display:flex;padding:16px 0}.ant-comment-avatar{position:relative;flex-shrink:0;margin-right:12px;cursor:pointer}.ant-comment-avatar img{width:32px;height:32px;border-radius:50%}.ant-comment-content{position:relative;flex:1 1 auto;min-width:1px;font-size:14px;word-wrap:break-word}.ant-comment-content-author{display:flex;flex-wrap:wrap;justify-content:flex-start;margin-bottom:4px;font-size:14px}.ant-comment-content-author>a,.ant-comment-content-author>span{padding-right:8px;font-size:12px;line-height:18px}.ant-comment-content-author-name{color:hsla(0,0%,100%,.45);font-size:14px;transition:color .3s}.ant-comment-content-author-name>*,.ant-comment-content-author-name>:hover{color:hsla(0,0%,100%,.45)}.ant-comment-content-author-time{color:hsla(0,0%,100%,.3);white-space:nowrap;cursor:auto}.ant-comment-content-detail p{margin-bottom:inherit;white-space:pre-wrap}.ant-comment-actions{margin-top:12px;margin-bottom:inherit;padding-left:0}.ant-comment-actions>li{display:inline-block;color:hsla(0,0%,100%,.45)}.ant-comment-actions>li>span{margin-right:10px;color:hsla(0,0%,100%,.45);font-size:12px;cursor:pointer;transition:color .3s;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ant-comment-actions>li>span:hover{color:hsla(0,0%,100%,.65)}.ant-comment-nested{margin-left:44px}.ant-comment-rtl{direction:rtl}.ant-comment-rtl .ant-comment-avatar{margin-right:0;margin-left:12px}.ant-comment-rtl .ant-comment-content-author>a,.ant-comment-rtl .ant-comment-content-author>span{padding-right:0;padding-left:8px}.ant-comment-rtl .ant-comment-actions{padding-right:0}.ant-comment-rtl .ant-comment-actions>li>span{margin-right:0;margin-left:10px}.ant-comment-rtl .ant-comment-nested{margin-right:44px;margin-left:0}.ant-picker{box-sizing:border-box;margin:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";padding:4px 11px;position:relative;display:inline-flex;align-items:center;background:transparent;border:1px solid #434343;border-radius:2px;transition:border .3s,box-shadow .3s}.ant-picker-focused,.ant-picker:hover{border-color:#228290;border-right-width:1px!important}.ant-input-rtl .ant-picker-focused,.ant-input-rtl .ant-picker:hover{border-right-width:0;border-left-width:1px!important}.ant-picker-focused{border-color:#2abdd2;border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(42,189,210,.2)}.ant-input-rtl .ant-picker-focused{border-right-width:0;border-left-width:1px!important}.ant-picker.ant-picker-disabled{background:hsla(0,0%,100%,.08);border-color:#434343;cursor:not-allowed}.ant-picker.ant-picker-disabled .ant-picker-suffix{color:hsla(0,0%,100%,.3)}.ant-picker.ant-picker-borderless{background-color:transparent!important;border-color:transparent!important;box-shadow:none!important}.ant-picker-input{position:relative;display:inline-flex;align-items:center;width:100%}.ant-picker-input>input{position:relative;display:inline-block;width:100%;min-width:0;color:hsla(0,0%,100%,.85);font-size:14px;line-height:1.5715;background-color:transparent;background-image:none;border-radius:2px;transition:all .3s;flex:auto;min-width:1px;height:auto;padding:0;background:transparent;border:0}.ant-picker-input>input::-webkit-input-placeholder{color:hsla(0,0%,100%,.3)}.ant-picker-input>input:-ms-input-placeholder{color:hsla(0,0%,100%,.3)}.ant-picker-input>input::placeholder{color:hsla(0,0%,100%,.3)}.ant-picker-input>input:-ms-input-placeholder{text-overflow:ellipsis}.ant-picker-input>input:placeholder-shown{text-overflow:ellipsis}.ant-picker-input>input:hover{border-color:#228290;border-right-width:1px!important}.ant-input-rtl .ant-picker-input>input:hover{border-right-width:0;border-left-width:1px!important}.ant-picker-input>input-focused,.ant-picker-input>input:focus{border-color:#2abdd2;border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(42,189,210,.2)}.ant-input-rtl .ant-picker-input>input-focused,.ant-input-rtl .ant-picker-input>input:focus{border-right-width:0;border-left-width:1px!important}.ant-picker-input>input-disabled{color:hsla(0,0%,100%,.3);background-color:hsla(0,0%,100%,.08);cursor:not-allowed;opacity:1}.ant-picker-input>input-disabled:hover{border-color:#434343;border-right-width:1px!important}.ant-picker-input>input[disabled]{color:hsla(0,0%,100%,.3);background-color:hsla(0,0%,100%,.08);cursor:not-allowed;opacity:1}.ant-picker-input>input[disabled]:hover{border-color:#434343;border-right-width:1px!important}.ant-picker-input>input-borderless,.ant-picker-input>input-borderless-disabled,.ant-picker-input>input-borderless-focused,.ant-picker-input>input-borderless:focus,.ant-picker-input>input-borderless:hover,.ant-picker-input>input-borderless[disabled]{background-color:transparent;border:none;box-shadow:none}textarea.ant-picker-input>input{max-width:100%;height:auto;min-height:32px;line-height:1.5715;vertical-align:bottom;transition:all .3s,height 0s}.ant-picker-input>input-lg{padding:6.5px 11px;font-size:16px}.ant-picker-input>input-sm{padding:0 7px}.ant-picker-input>input-rtl{direction:rtl}.ant-picker-input>input:focus{box-shadow:none}.ant-picker-input>input[disabled]{background:transparent}.ant-picker-input:hover .ant-picker-clear{opacity:1}.ant-picker-input-placeholder>input{color:hsla(0,0%,100%,.3)}.ant-picker-large{padding:6.5px 11px}.ant-picker-large .ant-picker-input>input{font-size:16px}.ant-picker-small{padding:0 7px}.ant-picker-suffix{align-self:center;margin-left:4px;color:hsla(0,0%,100%,.3);line-height:1;pointer-events:none}.ant-picker-suffix>*{vertical-align:top}.ant-picker-clear{position:absolute;top:50%;right:0;color:hsla(0,0%,100%,.3);line-height:1;background:#141414;transform:translateY(-50%);cursor:pointer;opacity:0;transition:opacity .3s,color .3s}.ant-picker-clear>*{vertical-align:top}.ant-picker-clear:hover{color:hsla(0,0%,100%,.45)}.ant-picker-separator{position:relative;display:inline-block;width:1em;height:16px;color:hsla(0,0%,100%,.3);font-size:16px;vertical-align:top;cursor:default}.ant-picker-focused .ant-picker-separator{color:hsla(0,0%,100%,.45)}.ant-picker-disabled .ant-picker-range-separator .ant-picker-separator{cursor:not-allowed}.ant-picker-range{position:relative;display:inline-flex}.ant-picker-range .ant-picker-clear{right:11px}.ant-picker-range:hover .ant-picker-clear{opacity:1}.ant-picker-range .ant-picker-active-bar{bottom:-1px;height:2px;margin-left:11px;background:#2abdd2;opacity:0;transition:all .3s ease-out;pointer-events:none}.ant-picker-range.ant-picker-focused .ant-picker-active-bar{opacity:1}.ant-picker-range-separator{align-items:center;padding:0 8px;line-height:1}.ant-picker-range.ant-picker-small .ant-picker-clear{right:7px}.ant-picker-range.ant-picker-small .ant-picker-active-bar{margin-left:7px}.ant-picker-dropdown{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:absolute;z-index:1050}.ant-picker-dropdown-hidden{display:none}.ant-picker-dropdown-placement-bottomLeft .ant-picker-range-arrow{top:1.66666667px;display:block;transform:rotate(-45deg)}.ant-picker-dropdown-placement-topLeft .ant-picker-range-arrow{bottom:1.66666667px;display:block;transform:rotate(135deg)}.ant-picker-dropdown.slide-up-appear.slide-up-appear-active.ant-picker-dropdown-placement-topLeft,.ant-picker-dropdown.slide-up-appear.slide-up-appear-active.ant-picker-dropdown-placement-topRight,.ant-picker-dropdown.slide-up-enter.slide-up-enter-active.ant-picker-dropdown-placement-topLeft,.ant-picker-dropdown.slide-up-enter.slide-up-enter-active.ant-picker-dropdown-placement-topRight{animation-name:antSlideDownIn}.ant-picker-dropdown.slide-up-appear.slide-up-appear-active.ant-picker-dropdown-placement-bottomLeft,.ant-picker-dropdown.slide-up-appear.slide-up-appear-active.ant-picker-dropdown-placement-bottomRight,.ant-picker-dropdown.slide-up-enter.slide-up-enter-active.ant-picker-dropdown-placement-bottomLeft,.ant-picker-dropdown.slide-up-enter.slide-up-enter-active.ant-picker-dropdown-placement-bottomRight{animation-name:antSlideUpIn}.ant-picker-dropdown.slide-up-leave.slide-up-leave-active.ant-picker-dropdown-placement-topLeft,.ant-picker-dropdown.slide-up-leave.slide-up-leave-active.ant-picker-dropdown-placement-topRight{animation-name:antSlideDownOut}.ant-picker-dropdown.slide-up-leave.slide-up-leave-active.ant-picker-dropdown-placement-bottomLeft,.ant-picker-dropdown.slide-up-leave.slide-up-leave-active.ant-picker-dropdown-placement-bottomRight{animation-name:antSlideUpOut}.ant-picker-dropdown-range{padding:6.66666667px 0}.ant-picker-dropdown-range-hidden{display:none}.ant-picker-dropdown .ant-picker-panel>.ant-picker-time-panel{padding-top:4px}.ant-picker-ranges{margin-bottom:0;padding:4px 12px;overflow:hidden;line-height:34px;text-align:left;list-style:none}.ant-picker-ranges>li{display:inline-block}.ant-picker-ranges .ant-picker-preset>.ant-tag-blue{color:#2abdd2;background:#132125;border-color:#1b474d;cursor:pointer}.ant-picker-ranges .ant-picker-ok{float:right;margin-left:8px}.ant-picker-range-wrapper{display:flex}.ant-picker-range-arrow{position:absolute;z-index:1;display:none;width:10px;height:10px;margin-left:16.5px;box-shadow:2px -2px 6px rgba(0,0,0,.06);transition:left .3s ease-out}.ant-picker-range-arrow:after{position:absolute;top:1px;right:1px;width:10px;height:10px;border-color:#1a2029 #1a2029 transparent transparent;border-style:solid;border-width:5px;content:""}.ant-picker-panel-container{overflow:hidden;vertical-align:top;background:#1a2029;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.48),0 6px 16px 0 rgba(0,0,0,.32),0 9px 28px 8px rgba(0,0,0,.2);transition:margin .3s}.ant-picker-panel-container .ant-picker-panels{display:inline-flex;flex-wrap:nowrap;direction:ltr}.ant-picker-panel-container .ant-picker-panel{vertical-align:top;background:transparent;border-width:0 0 1px;border-radius:0}.ant-picker-panel-container .ant-picker-panel-focused{border-color:#303030}.ant-picker-panel{display:inline-flex;flex-direction:column;text-align:center;background:#1a2029;border:1px solid #303030;border-radius:2px;outline:none}.ant-picker-panel-focused{border-color:#2abdd2}.ant-picker-date-panel,.ant-picker-decade-panel,.ant-picker-month-panel,.ant-picker-quarter-panel,.ant-picker-time-panel,.ant-picker-week-panel,.ant-picker-year-panel{display:flex;flex-direction:column;width:280px}.ant-picker-header{display:flex;padding:0 8px;color:hsla(0,0%,100%,.85);border-bottom:1px solid #303030}.ant-picker-header>*{flex:none}.ant-picker-header button{padding:0;color:hsla(0,0%,100%,.3);line-height:40px;background:transparent;border:0;cursor:pointer;transition:color .3s}.ant-picker-header>button{min-width:1.6em;font-size:14px}.ant-picker-header>button:hover{color:hsla(0,0%,100%,.85)}.ant-picker-header-view{flex:auto;font-weight:500;line-height:40px}.ant-picker-header-view button{color:inherit;font-weight:inherit}.ant-picker-header-view button:not(:first-child){margin-left:8px}.ant-picker-header-view button:hover{color:#2abdd2}.ant-picker-next-icon,.ant-picker-prev-icon,.ant-picker-super-next-icon,.ant-picker-super-prev-icon{position:relative;display:inline-block;width:7px;height:7px}.ant-picker-next-icon:before,.ant-picker-prev-icon:before,.ant-picker-super-next-icon:before,.ant-picker-super-prev-icon:before{position:absolute;top:0;left:0;display:inline-block;width:7px;height:7px;border:0 solid;border-width:1.5px 0 0 1.5px;content:""}.ant-picker-super-next-icon:after,.ant-picker-super-prev-icon:after{position:absolute;top:4px;left:4px;display:inline-block;width:7px;height:7px;border:0 solid;border-width:1.5px 0 0 1.5px;content:""}.ant-picker-prev-icon,.ant-picker-super-prev-icon{transform:rotate(-45deg)}.ant-picker-next-icon,.ant-picker-super-next-icon{transform:rotate(135deg)}.ant-picker-content{width:100%;table-layout:fixed;border-collapse:collapse}.ant-picker-content td,.ant-picker-content th{position:relative;min-width:24px;font-weight:400}.ant-picker-content th{height:30px;color:hsla(0,0%,100%,.85);line-height:30px}.ant-picker-cell{padding:3px 0;color:hsla(0,0%,100%,.3);cursor:pointer}.ant-picker-cell-in-view{color:hsla(0,0%,100%,.85)}.ant-picker-cell-disabled{cursor:not-allowed}.ant-picker-cell:before{position:absolute;top:50%;right:0;left:0;z-index:1;height:24px;transform:translateY(-50%);content:""}.ant-picker-cell:hover:not(.ant-picker-cell-in-view) .ant-picker-cell-inner,.ant-picker-cell:hover:not(.ant-picker-cell-selected):not(.ant-picker-cell-range-start):not(.ant-picker-cell-range-end):not(.ant-picker-cell-range-hover-start):not(.ant-picker-cell-range-hover-end) .ant-picker-cell-inner{background:hsla(0,0%,100%,.08)}.ant-picker-cell-in-view.ant-picker-cell-today .ant-picker-cell-inner:before{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;border:1px solid #2abdd2;border-radius:2px;content:""}.ant-picker-cell-in-view.ant-picker-cell-in-range{position:relative}.ant-picker-cell-in-view.ant-picker-cell-in-range:before{background:#132125}.ant-picker-cell-in-view.ant-picker-cell-range-end .ant-picker-cell-inner,.ant-picker-cell-in-view.ant-picker-cell-range-start .ant-picker-cell-inner,.ant-picker-cell-in-view.ant-picker-cell-selected .ant-picker-cell-inner{color:#fff;background:#2abdd2}.ant-picker-cell-in-view.ant-picker-cell-range-end:not(.ant-picker-cell-range-end-single):before,.ant-picker-cell-in-view.ant-picker-cell-range-start:not(.ant-picker-cell-range-start-single):before{background:#132125}.ant-picker-cell-in-view.ant-picker-cell-range-start:before{left:50%}.ant-picker-cell-in-view.ant-picker-cell-range-end:before{right:50%}.ant-picker-cell-in-view.ant-picker-cell-range-hover-end.ant-picker-cell-range-end-single:after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-end.ant-picker-cell-range-start.ant-picker-cell-range-end.ant-picker-cell-range-start-near-hover:after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-end:not(.ant-picker-cell-in-range):not(.ant-picker-cell-range-start):not(.ant-picker-cell-range-end):after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-start.ant-picker-cell-range-start-single:after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-start.ant-picker-cell-range-start.ant-picker-cell-range-end.ant-picker-cell-range-end-near-hover:after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-start:not(.ant-picker-cell-in-range):not(.ant-picker-cell-range-start):not(.ant-picker-cell-range-end):after,.ant-picker-cell-in-view.ant-picker-cell-range-hover:not(.ant-picker-cell-in-range):after{position:absolute;top:50%;z-index:0;height:24px;border-top:1px dashed #19707d;border-bottom:1px dashed #19707d;transform:translateY(-50%);content:""}.ant-picker-cell-range-hover-end:after,.ant-picker-cell-range-hover-start:after,.ant-picker-cell-range-hover:after{right:0;left:2px}.ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover:before,.ant-picker-cell-in-view.ant-picker-cell-range-end.ant-picker-cell-range-hover:before,.ant-picker-cell-in-view.ant-picker-cell-range-end:not(.ant-picker-cell-range-end-single).ant-picker-cell-range-hover-end:before,.ant-picker-cell-in-view.ant-picker-cell-range-start.ant-picker-cell-range-hover:before,.ant-picker-cell-in-view.ant-picker-cell-range-start:not(.ant-picker-cell-range-start-single).ant-picker-cell-range-hover-start:before,.ant-picker-panel>:not(.ant-picker-date-panel) .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-end:before,.ant-picker-panel>:not(.ant-picker-date-panel) .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-start:before{background:#0c373d}.ant-picker-cell-in-view.ant-picker-cell-range-start:not(.ant-picker-cell-range-start-single):not(.ant-picker-cell-range-end) .ant-picker-cell-inner{border-radius:2px 0 0 2px}.ant-picker-cell-in-view.ant-picker-cell-range-end:not(.ant-picker-cell-range-end-single):not(.ant-picker-cell-range-start) .ant-picker-cell-inner{border-radius:0 2px 2px 0}.ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-end .ant-picker-cell-inner:after,.ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-start .ant-picker-cell-inner:after{position:absolute;top:0;bottom:0;z-index:-1;background:#0c373d;content:""}.ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-start .ant-picker-cell-inner:after{right:-6px;left:0}.ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-end .ant-picker-cell-inner:after{right:0;left:-6px}.ant-picker-cell-range-hover.ant-picker-cell-range-start:after{right:50%}.ant-picker-cell-range-hover.ant-picker-cell-range-end:after{left:50%}.ant-picker-cell-in-view.ant-picker-cell-range-hover-edge-start:not(.ant-picker-cell-range-hover-edge-start-near-range):after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-start:after,.ant-picker-cell-in-view.ant-picker-cell-start.ant-picker-cell-range-hover-edge-start.ant-picker-cell-range-hover-edge-start-near-range:after,tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover-end:first-child:after,tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover:first-child:after{left:6px;border-left:1px dashed #19707d;border-top-left-radius:2px;border-bottom-left-radius:2px}.ant-picker-cell-in-view.ant-picker-cell-end.ant-picker-cell-range-hover-edge-end.ant-picker-cell-range-hover-edge-end-near-range:after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-edge-end:not(.ant-picker-cell-range-hover-edge-end-near-range):after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-end:after,tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child:after,tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover:last-child:after{right:6px;border-right:1px dashed #19707d;border-top-right-radius:2px;border-bottom-right-radius:2px}.ant-picker-cell-disabled{pointer-events:none}.ant-picker-cell-disabled .ant-picker-cell-inner{color:hsla(0,0%,100%,.3);background:transparent}.ant-picker-cell-disabled:before{background:#303030}.ant-picker-cell-disabled.ant-picker-cell-today .ant-picker-cell-inner:before{border-color:hsla(0,0%,100%,.3)}.ant-picker-decade-panel .ant-picker-content,.ant-picker-month-panel .ant-picker-content,.ant-picker-quarter-panel .ant-picker-content,.ant-picker-year-panel .ant-picker-content{height:264px}.ant-picker-decade-panel .ant-picker-cell-inner,.ant-picker-month-panel .ant-picker-cell-inner,.ant-picker-quarter-panel .ant-picker-cell-inner,.ant-picker-year-panel .ant-picker-cell-inner{padding:0 8px}.ant-picker-decade-panel .ant-picker-cell-disabled .ant-picker-cell-inner,.ant-picker-month-panel .ant-picker-cell-disabled .ant-picker-cell-inner,.ant-picker-quarter-panel .ant-picker-cell-disabled .ant-picker-cell-inner,.ant-picker-year-panel .ant-picker-cell-disabled .ant-picker-cell-inner{background:#303030}.ant-picker-quarter-panel .ant-picker-content{height:56px}.ant-picker-footer{width:-webkit-min-content;width:-moz-min-content;width:min-content;min-width:100%;line-height:38px;text-align:center;border-bottom:1px solid transparent}.ant-picker-panel .ant-picker-footer{border-top:1px solid #303030}.ant-picker-footer-extra{padding:0 12px;line-height:38px;text-align:left}.ant-picker-footer-extra:not(:last-child){border-bottom:1px solid #303030}.ant-picker-now{text-align:left}.ant-picker-today-btn{color:#2abdd2}.ant-picker-today-btn:hover{color:#228290}.ant-picker-today-btn:active{color:#4abdca}.ant-picker-today-btn.ant-picker-today-btn-disabled{color:hsla(0,0%,100%,.3);cursor:not-allowed}.ant-picker-decade-panel .ant-picker-cell-inner{padding:0 4px}.ant-picker-decade-panel .ant-picker-cell:before{display:none}.ant-picker-month-panel .ant-picker-body,.ant-picker-quarter-panel .ant-picker-body,.ant-picker-year-panel .ant-picker-body{padding:0 8px}.ant-picker-month-panel .ant-picker-cell-inner,.ant-picker-quarter-panel .ant-picker-cell-inner,.ant-picker-year-panel .ant-picker-cell-inner{width:60px}.ant-picker-month-panel .ant-picker-cell-range-hover-start:after,.ant-picker-quarter-panel .ant-picker-cell-range-hover-start:after,.ant-picker-year-panel .ant-picker-cell-range-hover-start:after{left:14px;border-left:1px dashed #19707d;border-radius:2px 0 0 2px}.ant-picker-month-panel .ant-picker-cell-range-hover-end:after,.ant-picker-panel-rtl .ant-picker-month-panel .ant-picker-cell-range-hover-start:after,.ant-picker-panel-rtl .ant-picker-quarter-panel .ant-picker-cell-range-hover-start:after,.ant-picker-panel-rtl .ant-picker-year-panel .ant-picker-cell-range-hover-start:after,.ant-picker-quarter-panel .ant-picker-cell-range-hover-end:after,.ant-picker-year-panel .ant-picker-cell-range-hover-end:after{right:14px;border-right:1px dashed #19707d;border-radius:0 2px 2px 0}.ant-picker-panel-rtl .ant-picker-month-panel .ant-picker-cell-range-hover-end:after,.ant-picker-panel-rtl .ant-picker-quarter-panel .ant-picker-cell-range-hover-end:after,.ant-picker-panel-rtl .ant-picker-year-panel .ant-picker-cell-range-hover-end:after{left:14px;border-left:1px dashed #19707d;border-radius:2px 0 0 2px}.ant-picker-week-panel .ant-picker-body{padding:8px 12px}.ant-picker-week-panel .ant-picker-cell-selected .ant-picker-cell-inner,.ant-picker-week-panel .ant-picker-cell .ant-picker-cell-inner,.ant-picker-week-panel .ant-picker-cell:hover .ant-picker-cell-inner{background:transparent!important}.ant-picker-week-panel-row td{transition:background .3s}.ant-picker-week-panel-row:hover td{background:hsla(0,0%,100%,.08)}.ant-picker-week-panel-row-selected:hover td,.ant-picker-week-panel-row-selected td{background:#2abdd2}.ant-picker-week-panel-row-selected:hover td.ant-picker-cell-week,.ant-picker-week-panel-row-selected td.ant-picker-cell-week{color:hsla(0,0%,100%,.5)}.ant-picker-week-panel-row-selected:hover td.ant-picker-cell-today .ant-picker-cell-inner:before,.ant-picker-week-panel-row-selected td.ant-picker-cell-today .ant-picker-cell-inner:before{border-color:#fff}.ant-picker-week-panel-row-selected:hover td .ant-picker-cell-inner,.ant-picker-week-panel-row-selected td .ant-picker-cell-inner{color:#fff}.ant-picker-date-panel .ant-picker-body{padding:8px 12px}.ant-picker-date-panel .ant-picker-content{width:252px}.ant-picker-date-panel .ant-picker-content th{width:36px}.ant-picker-datetime-panel{display:flex}.ant-picker-datetime-panel .ant-picker-time-panel{border-left:1px solid #303030}.ant-picker-datetime-panel .ant-picker-date-panel,.ant-picker-datetime-panel .ant-picker-time-panel{transition:opacity .3s}.ant-picker-datetime-panel-active .ant-picker-date-panel,.ant-picker-datetime-panel-active .ant-picker-time-panel{opacity:.3}.ant-picker-datetime-panel-active .ant-picker-date-panel-active,.ant-picker-datetime-panel-active .ant-picker-time-panel-active{opacity:1}.ant-picker-time-panel{width:auto;min-width:auto}.ant-picker-time-panel .ant-picker-content{display:flex;flex:auto;height:224px}.ant-picker-time-panel-column{flex:1 0 auto;width:56px;margin:0;padding:0;overflow-y:hidden;text-align:left;list-style:none;transition:background .3s}.ant-picker-time-panel-column:after{display:block;height:196px;content:""}.ant-picker-datetime-panel .ant-picker-time-panel-column:after{height:198px}.ant-picker-time-panel-column:not(:first-child){border-left:1px solid #303030}.ant-picker-time-panel-column-active{background:rgba(19,33,37,.2)}.ant-picker-time-panel-column:hover{overflow-y:auto}.ant-picker-time-panel-column>li{margin:0;padding:0}.ant-picker-time-panel-column>li.ant-picker-time-panel-cell .ant-picker-time-panel-cell-inner{display:block;width:100%;height:28px;margin:0;padding:0 0 0 14px;color:hsla(0,0%,100%,.85);line-height:28px;border-radius:0;cursor:pointer;transition:background .3s}.ant-picker-time-panel-column>li.ant-picker-time-panel-cell .ant-picker-time-panel-cell-inner:hover{background:hsla(0,0%,100%,.08)}.ant-picker-time-panel-column>li.ant-picker-time-panel-cell-selected .ant-picker-time-panel-cell-inner{background:#132125}.ant-picker-time-panel-column>li.ant-picker-time-panel-cell-disabled .ant-picker-time-panel-cell-inner{color:hsla(0,0%,100%,.3);background:transparent;cursor:not-allowed}:root .ant-picker-range-wrapper .ant-picker-month-panel .ant-picker-cell,:root .ant-picker-range-wrapper .ant-picker-year-panel .ant-picker-cell,_:-ms-fullscreen .ant-picker-range-wrapper .ant-picker-month-panel .ant-picker-cell,_:-ms-fullscreen .ant-picker-range-wrapper .ant-picker-year-panel .ant-picker-cell{padding:21px 0}.ant-picker-rtl{direction:rtl}.ant-picker-rtl .ant-picker-suffix{margin-right:4px;margin-left:0}.ant-picker-rtl .ant-picker-clear{right:auto;left:0}.ant-picker-rtl .ant-picker-separator{transform:rotate(180deg)}.ant-picker-panel-rtl .ant-picker-header-view button:not(:first-child){margin-right:8px;margin-left:0}.ant-picker-rtl.ant-picker-range .ant-picker-clear{right:auto;left:11px}.ant-picker-rtl.ant-picker-range .ant-picker-active-bar{margin-right:11px;margin-left:0}.ant-picker-rtl.ant-picker-range.ant-picker-small .ant-picker-active-bar{margin-right:7px}.ant-picker-dropdown-rtl .ant-picker-ranges{text-align:right}.ant-picker-dropdown-rtl .ant-picker-ranges .ant-picker-ok{float:left;margin-right:8px;margin-left:0}.ant-picker-panel-rtl{direction:rtl}.ant-picker-panel-rtl .ant-picker-prev-icon,.ant-picker-panel-rtl .ant-picker-super-prev-icon{transform:rotate(135deg)}.ant-picker-panel-rtl .ant-picker-next-icon,.ant-picker-panel-rtl .ant-picker-super-next-icon{transform:rotate(-45deg)}.ant-picker-cell .ant-picker-cell-inner{position:relative;z-index:2;display:inline-block;min-width:24px;height:24px;line-height:24px;border-radius:2px;transition:background .3s,border .3s}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-start:before{right:50%;left:0}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-end:before{right:0;left:50%}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-start.ant-picker-cell-range-end:before{right:50%;left:50%}.ant-picker-panel-rtl .ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-start .ant-picker-cell-inner:after{right:0;left:-6px}.ant-picker-panel-rtl .ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-end .ant-picker-cell-inner:after{right:-6px;left:0}.ant-picker-panel-rtl .ant-picker-cell-range-hover.ant-picker-cell-range-start:after{right:0;left:50%}.ant-picker-panel-rtl .ant-picker-cell-range-hover.ant-picker-cell-range-end:after{right:50%;left:0}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-start:not(.ant-picker-cell-range-start-single):not(.ant-picker-cell-range-end) .ant-picker-cell-inner{border-radius:0 2px 2px 0}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-end:not(.ant-picker-cell-range-end-single):not(.ant-picker-cell-range-start) .ant-picker-cell-inner{border-radius:2px 0 0 2px}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-hover-edge-start:not(.ant-picker-cell-range-hover-edge-start-near-range):after,.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:after,.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-start.ant-picker-cell-range-hover-edge-start.ant-picker-cell-range-hover-edge-start-near-range:after,.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover:not(.ant-picker-cell-selected):first-child:after{right:6px;left:0;border-right:1px dashed #19707d;border-left:none;border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-end.ant-picker-cell-range-hover-edge-end.ant-picker-cell-range-hover-edge-end-near-range:after,.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-hover-edge-end:not(.ant-picker-cell-range-hover-edge-end-near-range):after,.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-hover-end:after,.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover:not(.ant-picker-cell-selected):last-child:after{right:0;left:6px;border-right:none;border-left:1px dashed #19707d;border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-end.ant-picker-cell-range-hover-start.ant-picker-cell-range-hover-edge-end:not(.ant-picker-cell-range-hover):after,.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-start.ant-picker-cell-range-hover-edge-start:not(.ant-picker-cell-range-hover):after,.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-start.ant-picker-cell-range-hover-end.ant-picker-cell-range-hover-edge-start:not(.ant-picker-cell-range-hover):after,.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-end.ant-picker-cell-range-hover.ant-picker-cell-range-hover-edge-end:first-child:after,.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover-end:first-child:after,.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child:after,.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-start.ant-picker-cell-range-hover.ant-picker-cell-range-hover-edge-start:last-child:after{right:6px;left:6px;border-right:1px dashed #19707d;border-left:1px dashed #19707d;border-radius:2px}.ant-picker-dropdown-rtl .ant-picker-footer-extra{direction:rtl;text-align:right}.ant-picker-panel-rtl .ant-picker-time-panel{direction:ltr}.ant-descriptions-header{display:flex;align-items:center;margin-bottom:20px}.ant-descriptions-title{flex:auto;overflow:hidden;color:hsla(0,0%,100%,.85);font-weight:700;font-size:16px;line-height:1.5715;white-space:nowrap;text-overflow:ellipsis}.ant-descriptions-extra{margin-left:auto;color:hsla(0,0%,100%,.85);font-size:14px}.ant-descriptions-view{width:100%;overflow:hidden;border-radius:2px}.ant-descriptions-view table{width:100%;table-layout:fixed}.ant-descriptions-row>td,.ant-descriptions-row>th{padding-bottom:16px}.ant-descriptions-row:last-child{border-bottom:none}.ant-descriptions-item-label{color:hsla(0,0%,100%,.85);font-weight:400;font-size:14px;line-height:1.5715;text-align:start}.ant-descriptions-item-label:after{content:":";position:relative;top:-.5px;margin:0 8px 0 2px}.ant-descriptions-item-label.ant-descriptions-item-no-colon:after{content:" "}.ant-descriptions-item-no-label:after{margin:0;content:""}.ant-descriptions-item-content{display:table-cell;flex:1 1;color:hsla(0,0%,100%,.85);font-size:14px;line-height:1.5715;word-break:break-word;overflow-wrap:break-word}.ant-descriptions-item{padding-bottom:0;vertical-align:top}.ant-descriptions-item-container{display:flex}.ant-descriptions-item-container .ant-descriptions-item-content,.ant-descriptions-item-container .ant-descriptions-item-label{display:inline-flex;align-items:baseline}.ant-descriptions-middle .ant-descriptions-row>td,.ant-descriptions-middle .ant-descriptions-row>th{padding-bottom:12px}.ant-descriptions-small .ant-descriptions-row>td,.ant-descriptions-small .ant-descriptions-row>th{padding-bottom:8px}.ant-descriptions-bordered .ant-descriptions-view{border:1px solid #303030}.ant-descriptions-bordered .ant-descriptions-view>table{table-layout:auto}.ant-descriptions-bordered .ant-descriptions-item-content,.ant-descriptions-bordered .ant-descriptions-item-label{padding:16px 24px;border-right:1px solid #303030}.ant-descriptions-bordered .ant-descriptions-item-content:last-child,.ant-descriptions-bordered .ant-descriptions-item-label:last-child{border-right:none}.ant-descriptions-bordered .ant-descriptions-item-label{background-color:hsla(0,0%,100%,.04)}.ant-descriptions-bordered .ant-descriptions-item-label:after{display:none}.ant-descriptions-bordered .ant-descriptions-row{border-bottom:1px solid #303030}.ant-descriptions-bordered .ant-descriptions-row:last-child{border-bottom:none}.ant-descriptions-bordered.ant-descriptions-middle .ant-descriptions-item-content,.ant-descriptions-bordered.ant-descriptions-middle .ant-descriptions-item-label{padding:12px 24px}.ant-descriptions-bordered.ant-descriptions-small .ant-descriptions-item-content,.ant-descriptions-bordered.ant-descriptions-small .ant-descriptions-item-label{padding:8px 16px}.ant-descriptions-rtl{direction:rtl}.ant-descriptions-rtl .ant-descriptions-item-label:after{margin:0 2px 0 8px}.ant-descriptions-rtl.ant-descriptions-bordered .ant-descriptions-item-content,.ant-descriptions-rtl.ant-descriptions-bordered .ant-descriptions-item-label{border-right:none;border-left:1px solid #303030}.ant-descriptions-rtl.ant-descriptions-bordered .ant-descriptions-item-content:last-child,.ant-descriptions-rtl.ant-descriptions-bordered .ant-descriptions-item-label:last-child{border-left:none}.ant-divider{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";border-top:1px solid hsla(0,0%,100%,.12)}.ant-divider-vertical{position:relative;top:-.06em;display:inline-block;height:.9em;margin:0 8px;vertical-align:middle;border-top:0;border-left:1px solid hsla(0,0%,100%,.12)}.ant-divider-horizontal{display:flex;clear:both;width:100%;min-width:100%;margin:24px 0}.ant-divider-horizontal.ant-divider-with-text{display:flex;margin:16px 0;color:hsla(0,0%,100%,.85);font-weight:500;font-size:16px;white-space:nowrap;text-align:center;border-top:0;border-top-color:hsla(0,0%,100%,.12)}.ant-divider-horizontal.ant-divider-with-text:after,.ant-divider-horizontal.ant-divider-with-text:before{position:relative;top:50%;width:50%;border-top:1px solid transparent;border-top-color:inherit;border-bottom:0;transform:translateY(50%);content:""}.ant-divider-horizontal.ant-divider-with-text-left:before{top:50%;width:5%}.ant-divider-horizontal.ant-divider-with-text-left:after,.ant-divider-horizontal.ant-divider-with-text-right:before{top:50%;width:95%}.ant-divider-horizontal.ant-divider-with-text-right:after{top:50%;width:5%}.ant-divider-inner-text{display:inline-block;padding:0 1em}.ant-divider-dashed{background:none;border:dashed hsla(0,0%,100%,.12);border-width:1px 0 0}.ant-divider-horizontal.ant-divider-with-text.ant-divider-dashed{border-top:0}.ant-divider-horizontal.ant-divider-with-text.ant-divider-dashed:after,.ant-divider-horizontal.ant-divider-with-text.ant-divider-dashed:before{border-style:dashed none none}.ant-divider-vertical.ant-divider-dashed{border-width:0 0 0 1px}.ant-divider-plain.ant-divider-with-text{color:hsla(0,0%,100%,.85);font-weight:400;font-size:14px}.ant-divider-rtl{direction:rtl}.ant-divider-rtl.ant-divider-horizontal.ant-divider-with-text-left:before{width:95%}.ant-divider-rtl.ant-divider-horizontal.ant-divider-with-text-left:after,.ant-divider-rtl.ant-divider-horizontal.ant-divider-with-text-right:before{width:5%}.ant-divider-rtl.ant-divider-horizontal.ant-divider-with-text-right:after{width:95%}.ant-drawer{position:fixed;z-index:1000;width:0;height:100%;transition:transform .3s cubic-bezier(.7,.3,.1,1),height 0s ease .3s,width 0s ease .3s}.ant-drawer>*{transition:transform .3s cubic-bezier(.7,.3,.1,1),box-shadow .3s cubic-bezier(.7,.3,.1,1)}.ant-drawer-content-wrapper{position:absolute;width:100%;height:100%}.ant-drawer .ant-drawer-content{width:100%;height:100%}.ant-drawer-left,.ant-drawer-right{top:0;width:0;height:100%}.ant-drawer-left .ant-drawer-content-wrapper,.ant-drawer-right .ant-drawer-content-wrapper{height:100%}.ant-drawer-left.ant-drawer-open,.ant-drawer-right.ant-drawer-open{width:100%;transition:transform .3s cubic-bezier(.7,.3,.1,1)}.ant-drawer-left,.ant-drawer-left .ant-drawer-content-wrapper{left:0}.ant-drawer-left.ant-drawer-open .ant-drawer-content-wrapper{box-shadow:6px 0 16px -8px rgba(0,0,0,.32),9px 0 28px 0 rgba(0,0,0,.2),12px 0 48px 16px rgba(0,0,0,.12)}.ant-drawer-right,.ant-drawer-right .ant-drawer-content-wrapper{right:0}.ant-drawer-right.ant-drawer-open .ant-drawer-content-wrapper{box-shadow:-6px 0 16px -8px rgba(0,0,0,.08),-9px 0 28px 0 rgba(0,0,0,.05),-12px 0 48px 16px rgba(0,0,0,.03)}.ant-drawer-right.ant-drawer-open.no-mask{right:1px;transform:translateX(1px)}.ant-drawer-bottom,.ant-drawer-top{left:0;width:100%;height:0%}.ant-drawer-bottom .ant-drawer-content-wrapper,.ant-drawer-top .ant-drawer-content-wrapper{width:100%}.ant-drawer-bottom.ant-drawer-open,.ant-drawer-top.ant-drawer-open{height:100%;transition:transform .3s cubic-bezier(.7,.3,.1,1)}.ant-drawer-top{top:0}.ant-drawer-top.ant-drawer-open .ant-drawer-content-wrapper{box-shadow:0 6px 16px -8px rgba(0,0,0,.32),0 9px 28px 0 rgba(0,0,0,.2),0 12px 48px 16px rgba(0,0,0,.12)}.ant-drawer-bottom,.ant-drawer-bottom .ant-drawer-content-wrapper{bottom:0}.ant-drawer-bottom.ant-drawer-open .ant-drawer-content-wrapper{box-shadow:0 -6px 16px -8px rgba(0,0,0,.32),0 -9px 28px 0 rgba(0,0,0,.2),0 -12px 48px 16px rgba(0,0,0,.12)}.ant-drawer-bottom.ant-drawer-open.no-mask{bottom:1px;transform:translateY(1px)}.ant-drawer.ant-drawer-open .ant-drawer-mask{height:100%;opacity:1;transition:none;animation:antdDrawerFadeIn .3s cubic-bezier(.7,.3,.1,1);pointer-events:auto}.ant-drawer-title{margin:0;color:hsla(0,0%,100%,.85);font-weight:500;font-size:16px;line-height:22px}.ant-drawer-content{position:relative;z-index:1;overflow:auto;background-color:#1a2029;background-clip:padding-box;border:0}.ant-drawer-close{position:absolute;top:0;right:0;z-index:10;display:block;padding:20px;color:hsla(0,0%,100%,.45);font-weight:700;font-size:16px;font-style:normal;line-height:1;text-align:center;text-transform:none;text-decoration:none;background:transparent;border:0;outline:0;cursor:pointer;transition:color .3s;text-rendering:auto}.ant-drawer-close:focus,.ant-drawer-close:hover{color:hsla(0,0%,100%,.75);text-decoration:none}.ant-drawer-header-no-title .ant-drawer-close{margin-right:0;margin-right:var(--scroll-bar);padding-right:20px;padding-right:calc(20px - var(--scroll-bar))}.ant-drawer-header{position:relative;padding:16px 24px;border-bottom:1px solid #303030;border-radius:2px 2px 0 0}.ant-drawer-header,.ant-drawer-header-no-title{color:hsla(0,0%,100%,.85);background:#1a2029}.ant-drawer-wrapper-body{display:flex;flex-direction:column;flex-wrap:nowrap;width:100%;height:100%}.ant-drawer-body{flex-grow:1;padding:24px;overflow:auto;font-size:14px;line-height:1.5715;word-wrap:break-word}.ant-drawer-footer{flex-shrink:0;padding:10px 16px;border-top:1px solid #303030}.ant-drawer-mask{position:absolute;top:0;left:0;width:100%;height:0;background-color:rgba(0,0,0,.45);opacity:0;filter:alpha(opacity=45);transition:opacity .3s linear,height 0s ease .3s;pointer-events:none}.ant-drawer-open-content{box-shadow:0 3px 6px -4px rgba(0,0,0,.48),0 6px 16px 0 rgba(0,0,0,.32),0 9px 28px 8px rgba(0,0,0,.2)}.ant-drawer .ant-picker-clear{background:#1a2029}@keyframes antdDrawerFadeIn{0%{opacity:0}to{opacity:1}}.ant-drawer .ant-anchor-wrapper,.ant-drawer .ant-card,.ant-drawer .ant-collapse-content,.ant-drawer .ant-picker-clear,.ant-drawer .ant-slider-handle,.ant-drawer .ant-timeline-item-head{background-color:#1a2029}.ant-drawer .ant-transfer-list-header{background:#1a2029;border-bottom:1px solid #3a3a3a}.ant-drawer .ant-transfer-list-content-item:not(.ant-transfer-list-content-item-disabled):hover{background-color:hsla(0,0%,100%,.08)}.ant-drawer tr.ant-table-expanded-row:hover>td,.ant-drawer tr.ant-table-expanded-row>td{background:#272727}.ant-drawer .ant-table.ant-table-small thead>tr>th{background-color:#1a2029;border-bottom:1px solid #3a3a3a}.ant-drawer .ant-table{background-color:#1a2029}.ant-drawer .ant-table .ant-table-row-expand-icon{border:1px solid #3a3a3a}.ant-drawer .ant-table tfoot>tr>td,.ant-drawer .ant-table tfoot>tr>th{border-bottom:1px solid #3a3a3a}.ant-drawer .ant-table thead>tr>th{background-color:#272727;border-bottom:1px solid #3a3a3a}.ant-drawer .ant-table tbody>tr>td{border-bottom:1px solid #3a3a3a}.ant-drawer .ant-table tbody>tr>td.ant-table-cell-fix-left,.ant-drawer .ant-table tbody>tr>td.ant-table-cell-fix-right{background-color:#1a2029}.ant-drawer .ant-table tbody>tr.ant-table-row:hover>td{background:#303030}.ant-drawer .ant-table.ant-table-bordered .ant-table-title{border:1px solid #3a3a3a}.ant-drawer .ant-table.ant-table-bordered .ant-table-cell-fix-right-first:after,.ant-drawer .ant-table.ant-table-bordered tbody>tr>td,.ant-drawer .ant-table.ant-table-bordered tfoot>tr>td,.ant-drawer .ant-table.ant-table-bordered tfoot>tr>th,.ant-drawer .ant-table.ant-table-bordered thead>tr>th{border-right:1px solid #3a3a3a}.ant-drawer .ant-table.ant-table-bordered table thead>tr:not(:last-child)>th{border-bottom:1px solid #303030}.ant-drawer .ant-table.ant-table-bordered .ant-table-container{border:1px solid #3a3a3a}.ant-drawer .ant-table.ant-table-bordered .ant-table-expanded-row-fixed:after{border-right:1px solid #3a3a3a}.ant-drawer .ant-table.ant-table-bordered .ant-table-footer{border:1px solid #3a3a3a}.ant-drawer .ant-table .ant-table-filter-trigger-container-open{background-color:#525252}.ant-drawer .ant-picker-calendar-full,.ant-drawer .ant-picker-calendar-full .ant-picker-panel{background-color:#1a2029}.ant-drawer .ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date{border-top:2px solid #3a3a3a}.ant-drawer .ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active{background-color:#1a2029;border-bottom:1px solid #1a2029}.ant-drawer .ant-badge-count{box-shadow:0 0 0 1px #1a2029}.ant-drawer .ant-tree-show-line .ant-tree-switcher{background:#1a2029}.ant-drawer-rtl{direction:rtl}.ant-drawer-rtl .ant-drawer-close{right:auto;left:0}.ant-dropdown-menu-item.ant-dropdown-menu-item-danger{color:#a61d24}.ant-dropdown-menu-item.ant-dropdown-menu-item-danger:hover{color:#fff;background-color:#a61d24}.ant-dropdown{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:absolute;top:-9999px;left:-9999px;z-index:1050;display:block}.ant-dropdown:before{position:absolute;top:-4px;right:0;bottom:-4px;left:-7px;z-index:-9999;opacity:.0001;content:" "}.ant-dropdown-wrap{position:relative}.ant-dropdown-wrap .ant-btn>.anticon-down{font-size:10px}.ant-dropdown-wrap .anticon-down:before{transition:transform .2s}.ant-dropdown-wrap-open .anticon-down:before{transform:rotate(180deg)}.ant-dropdown-hidden,.ant-dropdown-menu-hidden{display:none}.ant-dropdown-show-arrow.ant-dropdown-placement-topCenter,.ant-dropdown-show-arrow.ant-dropdown-placement-topLeft,.ant-dropdown-show-arrow.ant-dropdown-placement-topRight{padding-bottom:10px}.ant-dropdown-show-arrow.ant-dropdown-placement-bottomCenter,.ant-dropdown-show-arrow.ant-dropdown-placement-bottomLeft,.ant-dropdown-show-arrow.ant-dropdown-placement-bottomRight{padding-top:10px}.ant-dropdown-arrow{position:absolute;z-index:1;display:block;width:8.48528137px;height:8.48528137px;background:transparent;border-style:solid;border-width:4.24264069px;transform:rotate(45deg)}.ant-dropdown-placement-topCenter>.ant-dropdown-arrow,.ant-dropdown-placement-topLeft>.ant-dropdown-arrow,.ant-dropdown-placement-topRight>.ant-dropdown-arrow{bottom:6.2px;border-color:transparent #1a2029 #1a2029 transparent;box-shadow:3px 3px 7px rgba(0,0,0,.07)}.ant-dropdown-placement-topCenter>.ant-dropdown-arrow{left:50%;transform:translateX(-50%) rotate(45deg)}.ant-dropdown-placement-topLeft>.ant-dropdown-arrow{left:16px}.ant-dropdown-placement-topRight>.ant-dropdown-arrow{right:16px}.ant-dropdown-placement-bottomCenter>.ant-dropdown-arrow,.ant-dropdown-placement-bottomLeft>.ant-dropdown-arrow,.ant-dropdown-placement-bottomRight>.ant-dropdown-arrow{top:6px;border-color:#1a2029 transparent transparent #1a2029;box-shadow:-2px -2px 5px rgba(0,0,0,.06)}.ant-dropdown-placement-bottomCenter>.ant-dropdown-arrow{left:50%;transform:translateX(-50%) rotate(45deg)}.ant-dropdown-placement-bottomLeft>.ant-dropdown-arrow{left:16px}.ant-dropdown-placement-bottomRight>.ant-dropdown-arrow{right:16px}.ant-dropdown-menu{position:relative;margin:0;padding:4px 0;text-align:left;list-style-type:none;background-color:#1a2029;background-clip:padding-box;border-radius:2px;outline:none;box-shadow:0 3px 6px -4px rgba(0,0,0,.48),0 6px 16px 0 rgba(0,0,0,.32),0 9px 28px 8px rgba(0,0,0,.2)}.ant-dropdown-menu-item-group-title{padding:5px 12px;color:hsla(0,0%,100%,.45);transition:all .3s}.ant-dropdown-menu-submenu-popup{position:absolute;z-index:1050;background:transparent;box-shadow:none;transform-origin:0 0}.ant-dropdown-menu-submenu-popup li,.ant-dropdown-menu-submenu-popup ul{list-style:none}.ant-dropdown-menu-submenu-popup ul{margin-right:.3em;margin-left:.3em}.ant-dropdown-menu-item,.ant-dropdown-menu-submenu-title{clear:both;margin:0;padding:5px 12px;color:hsla(0,0%,100%,.85);font-weight:400;font-size:14px;line-height:22px;white-space:nowrap;cursor:pointer;transition:all .3s}.ant-dropdown-menu-item>.anticon:first-child,.ant-dropdown-menu-item>a>.anticon:first-child,.ant-dropdown-menu-item>span>.anticon:first-child,.ant-dropdown-menu-submenu-title>.anticon:first-child,.ant-dropdown-menu-submenu-title>a>.anticon:first-child,.ant-dropdown-menu-submenu-title>span>.anticon:first-child{min-width:12px;margin-right:8px;font-size:12px;vertical-align:-.1em}.ant-dropdown-menu-item>a,.ant-dropdown-menu-submenu-title>a{display:block;margin:-5px -12px;padding:5px 12px;color:hsla(0,0%,100%,.85);transition:all .3s}.ant-dropdown-menu-item>a:hover,.ant-dropdown-menu-submenu-title>a:hover{color:hsla(0,0%,100%,.85)}.ant-dropdown-menu-item>.anticon+span>a,.ant-dropdown-menu-submenu-title>.anticon+span>a{color:hsla(0,0%,100%,.85);transition:all .3s}.ant-dropdown-menu-item>.anticon+span>a:hover,.ant-dropdown-menu-submenu-title>.anticon+span>a:hover{color:hsla(0,0%,100%,.85)}.ant-dropdown-menu-item-selected,.ant-dropdown-menu-item-selected>a,.ant-dropdown-menu-submenu-title-selected,.ant-dropdown-menu-submenu-title-selected>a{color:#2abdd2;background-color:#132125}.ant-dropdown-menu-item:hover,.ant-dropdown-menu-submenu-title:hover{background-color:hsla(0,0%,100%,.08)}.ant-dropdown-menu-item-disabled,.ant-dropdown-menu-submenu-title-disabled{color:hsla(0,0%,100%,.3);cursor:not-allowed}.ant-dropdown-menu-item-disabled:hover,.ant-dropdown-menu-submenu-title-disabled:hover{color:hsla(0,0%,100%,.3);background-color:transparent;cursor:not-allowed}.ant-dropdown-menu-item-disabled>a,.ant-dropdown-menu-submenu-title-disabled>a{position:relative;color:hsla(0,0%,100%,.3);pointer-events:none}.ant-dropdown-menu-item-disabled>a:after,.ant-dropdown-menu-submenu-title-disabled>a:after{position:absolute;top:0;left:0;width:100%;height:100%;cursor:not-allowed;content:""}.ant-dropdown-menu-item-divider,.ant-dropdown-menu-submenu-title-divider{height:1px;margin:4px 0;overflow:hidden;line-height:0;background-color:#303030}.ant-dropdown-menu-item .ant-dropdown-menu-submenu-expand-icon,.ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-expand-icon{position:absolute;right:8px}.ant-dropdown-menu-item .ant-dropdown-menu-submenu-expand-icon .ant-dropdown-menu-submenu-arrow-icon,.ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-expand-icon .ant-dropdown-menu-submenu-arrow-icon{margin-right:0!important;color:hsla(0,0%,100%,.45);font-size:10px;font-style:normal}.ant-dropdown-menu-item-group-list{margin:0 8px;padding:0;list-style:none}.ant-dropdown-menu-submenu-title{padding-right:24px}.ant-dropdown-menu-submenu-vertical{position:relative}.ant-dropdown-menu-submenu-vertical>.ant-dropdown-menu{position:absolute;top:0;left:100%;min-width:100%;margin-left:4px;transform-origin:0 0}.ant-dropdown-menu-submenu.ant-dropdown-menu-submenu-disabled .ant-dropdown-menu-submenu-title,.ant-dropdown-menu-submenu.ant-dropdown-menu-submenu-disabled .ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-arrow-icon{color:hsla(0,0%,100%,.3);background-color:transparent;cursor:not-allowed}.ant-dropdown-menu-submenu-selected .ant-dropdown-menu-submenu-title{color:#2abdd2}.ant-dropdown.slide-down-appear.slide-down-appear-active.ant-dropdown-placement-bottomCenter,.ant-dropdown.slide-down-appear.slide-down-appear-active.ant-dropdown-placement-bottomLeft,.ant-dropdown.slide-down-appear.slide-down-appear-active.ant-dropdown-placement-bottomRight,.ant-dropdown.slide-down-enter.slide-down-enter-active.ant-dropdown-placement-bottomCenter,.ant-dropdown.slide-down-enter.slide-down-enter-active.ant-dropdown-placement-bottomLeft,.ant-dropdown.slide-down-enter.slide-down-enter-active.ant-dropdown-placement-bottomRight{animation-name:antSlideUpIn}.ant-dropdown.slide-up-appear.slide-up-appear-active.ant-dropdown-placement-topCenter,.ant-dropdown.slide-up-appear.slide-up-appear-active.ant-dropdown-placement-topLeft,.ant-dropdown.slide-up-appear.slide-up-appear-active.ant-dropdown-placement-topRight,.ant-dropdown.slide-up-enter.slide-up-enter-active.ant-dropdown-placement-topCenter,.ant-dropdown.slide-up-enter.slide-up-enter-active.ant-dropdown-placement-topLeft,.ant-dropdown.slide-up-enter.slide-up-enter-active.ant-dropdown-placement-topRight{animation-name:antSlideDownIn}.ant-dropdown.slide-down-leave.slide-down-leave-active.ant-dropdown-placement-bottomCenter,.ant-dropdown.slide-down-leave.slide-down-leave-active.ant-dropdown-placement-bottomLeft,.ant-dropdown.slide-down-leave.slide-down-leave-active.ant-dropdown-placement-bottomRight{animation-name:antSlideUpOut}.ant-dropdown.slide-up-leave.slide-up-leave-active.ant-dropdown-placement-topCenter,.ant-dropdown.slide-up-leave.slide-up-leave-active.ant-dropdown-placement-topLeft,.ant-dropdown.slide-up-leave.slide-up-leave-active.ant-dropdown-placement-topRight{animation-name:antSlideDownOut}.ant-dropdown-button>.anticon.anticon-down,.ant-dropdown-link>.anticon.anticon-down,.ant-dropdown-trigger>.anticon.anticon-down{font-size:10px;vertical-align:baseline}.ant-dropdown-button{white-space:nowrap}.ant-dropdown-button.ant-btn-group>.ant-btn:last-child:not(:first-child):not(.ant-btn-icon-only){padding-right:8px;padding-left:8px}.ant-dropdown-menu-dark,.ant-dropdown-menu-dark .ant-dropdown-menu{background:#1a2029}.ant-dropdown-menu-dark .ant-dropdown-menu-item,.ant-dropdown-menu-dark .ant-dropdown-menu-item .ant-dropdown-menu-submenu-arrow:after,.ant-dropdown-menu-dark .ant-dropdown-menu-item>.anticon+span>a,.ant-dropdown-menu-dark .ant-dropdown-menu-item>.anticon+span>a .ant-dropdown-menu-submenu-arrow:after,.ant-dropdown-menu-dark .ant-dropdown-menu-item>a,.ant-dropdown-menu-dark .ant-dropdown-menu-item>a .ant-dropdown-menu-submenu-arrow:after,.ant-dropdown-menu-dark .ant-dropdown-menu-submenu-title,.ant-dropdown-menu-dark .ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-arrow:after{color:hsla(0,0%,100%,.65)}.ant-dropdown-menu-dark .ant-dropdown-menu-item:hover,.ant-dropdown-menu-dark .ant-dropdown-menu-item>.anticon+span>a:hover,.ant-dropdown-menu-dark .ant-dropdown-menu-item>a:hover,.ant-dropdown-menu-dark .ant-dropdown-menu-submenu-title:hover{color:#fff;background:transparent}.ant-dropdown-menu-dark .ant-dropdown-menu-item-selected,.ant-dropdown-menu-dark .ant-dropdown-menu-item-selected:hover,.ant-dropdown-menu-dark .ant-dropdown-menu-item-selected>a{color:#fff;background:#2abdd2}.ant-dropdown-rtl{direction:rtl}.ant-dropdown-rtl.ant-dropdown:before{right:-7px;left:0}.ant-dropdown-menu.ant-dropdown-menu-rtl,.ant-dropdown-rtl .ant-dropdown-menu-item-group-title{direction:rtl;text-align:right}.ant-dropdown-menu-submenu-popup.ant-dropdown-menu-submenu-rtl{transform-origin:100% 0}.ant-dropdown-rtl .ant-dropdown-menu-item,.ant-dropdown-rtl .ant-dropdown-menu-submenu-popup li,.ant-dropdown-rtl .ant-dropdown-menu-submenu-popup ul,.ant-dropdown-rtl .ant-dropdown-menu-submenu-title{text-align:right}.ant-dropdown-rtl .ant-dropdown-menu-item>.anticon:first-child,.ant-dropdown-rtl .ant-dropdown-menu-item>span>.anticon:first-child,.ant-dropdown-rtl .ant-dropdown-menu-submenu-title>.anticon:first-child,.ant-dropdown-rtl .ant-dropdown-menu-submenu-title>span>.anticon:first-child{margin-right:0;margin-left:8px}.ant-dropdown-rtl .ant-dropdown-menu-item .ant-dropdown-menu-submenu-arrow,.ant-dropdown-rtl .ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-arrow{right:auto;left:8px}.ant-dropdown-rtl .ant-dropdown-menu-item .ant-dropdown-menu-submenu-arrow-icon,.ant-dropdown-rtl .ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-arrow-icon{margin-left:0!important;transform:scaleX(-1)}.ant-dropdown-rtl .ant-dropdown-menu-submenu-title{padding-right:12px;padding-left:24px}.ant-dropdown-rtl .ant-dropdown-menu-submenu-vertical>.ant-dropdown-menu{right:100%;left:0;margin-right:4px;margin-left:0}.ant-empty{margin:0 8px;font-size:14px;line-height:1.5715;text-align:center}.ant-empty-image{height:100px;margin-bottom:8px}.ant-empty-image img{height:100%}.ant-empty-image svg{height:100%;margin:auto}.ant-empty-footer{margin-top:16px}.ant-empty-normal{margin:32px 0;color:hsla(0,0%,100%,.3)}.ant-empty-normal .ant-empty-image{height:40px}.ant-empty-small{margin:8px 0;color:hsla(0,0%,100%,.3)}.ant-empty-small .ant-empty-image{height:35px}.ant-empty-img-default-ellipse{fill:#fff;fill-opacity:.08}.ant-empty-img-default-path-1{fill:#262626}.ant-empty-img-default-path-2{fill:url(#linearGradient-1)}.ant-empty-img-default-path-3{fill:#595959}.ant-empty-img-default-path-4{fill:#434343}.ant-empty-img-default-path-5{fill:#595959}.ant-empty-img-default-g{fill:#434343}.ant-empty-img-simple-ellipse{fill:#fff;fill-opacity:.08}.ant-empty-img-simple-g{stroke:#434343}.ant-empty-img-simple-path{fill:#262626;stroke:#434343}.ant-empty-rtl{direction:rtl}.ant-form-item .ant-mentions,.ant-form-item textarea.ant-input{height:auto}.ant-form-item .ant-upload{background:transparent}.ant-form-item .ant-upload.ant-upload-drag{background:hsla(0,0%,100%,.04)}.ant-form-item input[type=checkbox],.ant-form-item input[type=radio]{width:14px;height:14px}.ant-form-item .ant-checkbox-inline,.ant-form-item .ant-radio-inline{display:inline-block;margin-left:8px;font-weight:400;vertical-align:middle;cursor:pointer}.ant-form-item .ant-checkbox-inline:first-child,.ant-form-item .ant-radio-inline:first-child{margin-left:0}.ant-form-item .ant-checkbox-vertical,.ant-form-item .ant-radio-vertical{display:block}.ant-form-item .ant-checkbox-vertical+.ant-checkbox-vertical,.ant-form-item .ant-radio-vertical+.ant-radio-vertical{margin-left:0}.ant-form-item .ant-input-number+.ant-form-text{margin-left:8px}.ant-form-item .ant-input-number-handler-wrap{z-index:2}.ant-form-item .ant-cascader-picker,.ant-form-item .ant-select{width:100%}.ant-form-item .ant-input-group .ant-cascader-picker,.ant-form-item .ant-input-group .ant-select{width:auto}.ant-form-inline{display:flex;flex-wrap:wrap}.ant-form-inline .ant-form-item{flex:none;flex-wrap:nowrap;margin-right:16px;margin-bottom:0}.ant-form-inline .ant-form-item-with-help{margin-bottom:24px}.ant-form-inline .ant-form-item>.ant-form-item-control,.ant-form-inline .ant-form-item>.ant-form-item-label{display:inline-block;vertical-align:top}.ant-form-inline .ant-form-item>.ant-form-item-label{flex:none}.ant-form-inline .ant-form-item .ant-form-item-has-feedback,.ant-form-inline .ant-form-item .ant-form-text{display:inline-block}.ant-form-horizontal .ant-form-item-label{flex-grow:0}.ant-form-horizontal .ant-form-item-control{flex:1 1}.ant-form-vertical .ant-form-item{flex-direction:column}.ant-form-vertical .ant-form-item-label>label{height:auto}.ant-col-24.ant-form-item-label,.ant-col-xl-24.ant-form-item-label,.ant-form-vertical .ant-form-item-label{padding:0 0 8px;line-height:1.5715;white-space:normal;text-align:left}.ant-col-24.ant-form-item-label>label,.ant-col-xl-24.ant-form-item-label>label,.ant-form-vertical .ant-form-item-label>label{margin:0}.ant-col-24.ant-form-item-label>label:after,.ant-col-xl-24.ant-form-item-label>label:after,.ant-form-vertical .ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-24.ant-form-item-label,.ant-form-rtl.ant-col-xl-24.ant-form-item-label,.ant-form-rtl.ant-form-vertical .ant-form-item-label{text-align:right}@media (max-width:575px){.ant-form-item .ant-form-item-label{padding:0 0 8px;line-height:1.5715;white-space:normal;text-align:left}.ant-form-item .ant-form-item-label>label{margin:0}.ant-form-item .ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-form-item .ant-form-item-label{text-align:right}.ant-form .ant-form-item{flex-wrap:wrap}.ant-form .ant-form-item .ant-form-item-control,.ant-form .ant-form-item .ant-form-item-label{flex:0 0 100%;max-width:100%}.ant-col-xs-24.ant-form-item-label{padding:0 0 8px;line-height:1.5715;white-space:normal;text-align:left}.ant-col-xs-24.ant-form-item-label>label{margin:0}.ant-col-xs-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-xs-24.ant-form-item-label{text-align:right}}@media (max-width:767px){.ant-col-sm-24.ant-form-item-label{padding:0 0 8px;line-height:1.5715;white-space:normal;text-align:left}.ant-col-sm-24.ant-form-item-label>label{margin:0}.ant-col-sm-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-sm-24.ant-form-item-label{text-align:right}}@media (max-width:991px){.ant-col-md-24.ant-form-item-label{padding:0 0 8px;line-height:1.5715;white-space:normal;text-align:left}.ant-col-md-24.ant-form-item-label>label{margin:0}.ant-col-md-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-md-24.ant-form-item-label{text-align:right}}@media (max-width:1199px){.ant-col-lg-24.ant-form-item-label{padding:0 0 8px;line-height:1.5715;white-space:normal;text-align:left}.ant-col-lg-24.ant-form-item-label>label{margin:0}.ant-col-lg-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-lg-24.ant-form-item-label{text-align:right}}@media (max-width:1599px){.ant-col-xl-24.ant-form-item-label{padding:0 0 8px;line-height:1.5715;white-space:normal;text-align:left}.ant-col-xl-24.ant-form-item-label>label{margin:0}.ant-col-xl-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-xl-24.ant-form-item-label{text-align:right}}.ant-form-item-explain.ant-form-item-explain-error{color:#a61d24}.ant-form-item-explain.ant-form-item-explain-warning{color:#d89614}.ant-form-item-has-feedback .ant-input{padding-right:24px}.ant-form-item-has-feedback .ant-input-affix-wrapper .ant-input-suffix{padding-right:18px}.ant-form-item-has-feedback .ant-input-search:not(.ant-input-search-enter-button) .ant-input-suffix{right:28px}.ant-form-item-has-feedback .ant-switch{margin:2px 0 4px}.ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-arrow,.ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-clear,.ant-form-item-has-feedback>.ant-select .ant-select-arrow,.ant-form-item-has-feedback>.ant-select .ant-select-clear{right:32px}.ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-selection-selected-value,.ant-form-item-has-feedback>.ant-select .ant-select-selection-selected-value{padding-right:42px}.ant-form-item-has-feedback .ant-cascader-picker-arrow{margin-right:19px}.ant-form-item-has-feedback .ant-cascader-picker-clear{right:32px}.ant-form-item-has-feedback .ant-picker,.ant-form-item-has-feedback .ant-picker-large{padding-right:29.2px}.ant-form-item-has-feedback .ant-picker-small{padding-right:25.2px}.ant-form-item-has-feedback.ant-form-item-has-error .ant-form-item-children-icon,.ant-form-item-has-feedback.ant-form-item-has-success .ant-form-item-children-icon,.ant-form-item-has-feedback.ant-form-item-has-warning .ant-form-item-children-icon,.ant-form-item-has-feedback.ant-form-item-is-validating .ant-form-item-children-icon{position:absolute;top:50%;right:0;z-index:1;width:32px;height:20px;margin-top:-10px;font-size:14px;line-height:20px;text-align:center;visibility:visible;animation:zoomIn .3s cubic-bezier(.12,.4,.29,1.46);pointer-events:none}.ant-form-item-has-success.ant-form-item-has-feedback .ant-form-item-children-icon{color:#49aa19;animation-name:diffZoomIn1!important}.ant-form-item-has-warning .ant-form-item-split{color:#d89614}.ant-form-item-has-warning .ant-input,.ant-form-item-has-warning .ant-input-affix-wrapper,.ant-form-item-has-warning .ant-input-affix-wrapper:hover,.ant-form-item-has-warning .ant-input:hover{background-color:transparent;border-color:#d89614}.ant-form-item-has-warning .ant-input-affix-wrapper-focused,.ant-form-item-has-warning .ant-input-affix-wrapper:focus,.ant-form-item-has-warning .ant-input-focused,.ant-form-item-has-warning .ant-input:focus{border-color:#d89614;border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(216,150,20,.2)}.ant-form-item-has-warning .ant-input-affix-wrapper-disabled,.ant-form-item-has-warning .ant-input-disabled{background-color:hsla(0,0%,100%,.08);border-color:#434343}.ant-form-item-has-warning .ant-input-affix-wrapper-disabled input:focus{box-shadow:none!important}.ant-form-item-has-warning .ant-calendar-picker-open .ant-calendar-picker-input{border-color:#d89614;border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(216,150,20,.2)}.ant-form-item-has-warning .ant-input-prefix{color:#d89614}.ant-form-item-has-warning .ant-input-group-addon{color:#d89614;border-color:#d89614}.ant-form-item-has-warning .has-feedback{color:#d89614}.ant-form-item-has-warning.ant-form-item-has-feedback .ant-form-item-children-icon{color:#d89614;animation-name:diffZoomIn3!important}.ant-form-item-has-warning .ant-select:not(.ant-select-disabled):not(.ant-select-customize-input) .ant-select-selector{background-color:transparent;border-color:#d89614!important}.ant-form-item-has-warning .ant-select:not(.ant-select-disabled):not(.ant-select-customize-input).ant-select-focused .ant-select-selector,.ant-form-item-has-warning .ant-select:not(.ant-select-disabled):not(.ant-select-customize-input).ant-select-open .ant-select-selector{border-color:#d89614;border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(216,150,20,.2)}.ant-form-item-has-warning .ant-input-number,.ant-form-item-has-warning .ant-picker{background-color:transparent;border-color:#d89614}.ant-form-item-has-warning .ant-input-number-focused,.ant-form-item-has-warning .ant-input-number:focus,.ant-form-item-has-warning .ant-picker-focused,.ant-form-item-has-warning .ant-picker:focus{border-color:#d89614;border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(216,150,20,.2)}.ant-form-item-has-warning .ant-input-number:not([disabled]):hover,.ant-form-item-has-warning .ant-picker:not([disabled]):hover{background-color:transparent;border-color:#d89614}.ant-form-item-has-warning .ant-cascader-picker:focus .ant-cascader-input{border-color:#d89614;border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(216,150,20,.2)}.ant-form-item-has-error .ant-form-item-split{color:#a61d24}.ant-form-item-has-error .ant-input,.ant-form-item-has-error .ant-input-affix-wrapper,.ant-form-item-has-error .ant-input-affix-wrapper:hover,.ant-form-item-has-error .ant-input:hover{background-color:transparent;border-color:#a61d24}.ant-form-item-has-error .ant-input-affix-wrapper-focused,.ant-form-item-has-error .ant-input-affix-wrapper:focus,.ant-form-item-has-error .ant-input-focused,.ant-form-item-has-error .ant-input:focus{border-color:#a61d24;border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(166,29,36,.2)}.ant-form-item-has-error .ant-input-affix-wrapper-disabled,.ant-form-item-has-error .ant-input-disabled{background-color:hsla(0,0%,100%,.08);border-color:#434343}.ant-form-item-has-error .ant-input-affix-wrapper-disabled input:focus{box-shadow:none!important}.ant-form-item-has-error .ant-calendar-picker-open .ant-calendar-picker-input{border-color:#a61d24;border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(166,29,36,.2)}.ant-form-item-has-error .ant-input-prefix{color:#a61d24}.ant-form-item-has-error .ant-input-group-addon{color:#a61d24;border-color:#a61d24}.ant-form-item-has-error .has-feedback{color:#a61d24}.ant-form-item-has-error.ant-form-item-has-feedback .ant-form-item-children-icon{color:#a61d24;animation-name:diffZoomIn2!important}.ant-form-item-has-error .ant-select:not(.ant-select-disabled):not(.ant-select-customize-input) .ant-select-selector{background-color:transparent;border-color:#a61d24!important}.ant-form-item-has-error .ant-select:not(.ant-select-disabled):not(.ant-select-customize-input).ant-select-focused .ant-select-selector,.ant-form-item-has-error .ant-select:not(.ant-select-disabled):not(.ant-select-customize-input).ant-select-open .ant-select-selector{border-color:#a61d24;border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(166,29,36,.2)}.ant-form-item-has-error .ant-input-group-addon .ant-select.ant-select-single:not(.ant-select-customize-input) .ant-select-selector{border:0}.ant-form-item-has-error .ant-select.ant-select-auto-complete .ant-input:focus{border-color:#a61d24}.ant-form-item-has-error .ant-input-number,.ant-form-item-has-error .ant-picker{background-color:transparent;border-color:#a61d24}.ant-form-item-has-error .ant-input-number-focused,.ant-form-item-has-error .ant-input-number:focus,.ant-form-item-has-error .ant-picker-focused,.ant-form-item-has-error .ant-picker:focus{border-color:#a61d24;border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(166,29,36,.2)}.ant-form-item-has-error .ant-input-number:not([disabled]):hover,.ant-form-item-has-error .ant-mention-wrapper .ant-mention-editor,.ant-form-item-has-error .ant-mention-wrapper .ant-mention-editor:not([disabled]):hover,.ant-form-item-has-error .ant-picker:not([disabled]):hover{background-color:transparent;border-color:#a61d24}.ant-form-item-has-error .ant-cascader-picker:focus .ant-cascader-input,.ant-form-item-has-error .ant-mention-wrapper.ant-mention-active:not([disabled]) .ant-mention-editor,.ant-form-item-has-error .ant-mention-wrapper .ant-mention-editor:not([disabled]):focus{border-color:#a61d24;border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(166,29,36,.2)}.ant-form-item-has-error .ant-cascader-picker:focus .ant-cascader-input{background-color:transparent}.ant-form-item-has-error .ant-transfer-list{border-color:#a61d24}.ant-form-item-has-error .ant-transfer-list-search:not([disabled]){border-color:#434343}.ant-form-item-has-error .ant-transfer-list-search:not([disabled]):hover{border-color:#228290;border-right-width:1px!important}.ant-input-rtl .ant-form-item-has-error .ant-transfer-list-search:not([disabled]):hover{border-right-width:0;border-left-width:1px!important}.ant-form-item-has-error .ant-transfer-list-search:not([disabled]):focus{border-color:#2abdd2;border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(42,189,210,.2)}.ant-input-rtl .ant-form-item-has-error .ant-transfer-list-search:not([disabled]):focus{border-right-width:0;border-left-width:1px!important}.ant-form-item-has-error .ant-radio-button-wrapper{border-color:#a61d24!important}.ant-form-item-has-error .ant-radio-button-wrapper:not(:first-child):before{background-color:#a61d24}.ant-form-item-is-validating.ant-form-item-has-feedback .ant-form-item-children-icon{display:inline-block;color:#2abdd2}.ant-form{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum"}.ant-form legend{display:block;width:100%;margin-bottom:20px;padding:0;color:hsla(0,0%,100%,.45);font-size:16px;line-height:inherit;border:0;border-bottom:1px solid #434343}.ant-form label{font-size:14px}.ant-form input[type=search]{box-sizing:border-box}.ant-form input[type=checkbox],.ant-form input[type=radio]{line-height:normal}.ant-form input[type=file]{display:block}.ant-form input[type=range]{display:block;width:100%}.ant-form select[multiple],.ant-form select[size]{height:auto}.ant-form input[type=checkbox]:focus,.ant-form input[type=file]:focus,.ant-form input[type=radio]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.ant-form output{display:block;padding-top:15px;color:hsla(0,0%,100%,.85);font-size:14px;line-height:1.5715}.ant-form .ant-form-text{display:inline-block;padding-right:8px}.ant-form-small .ant-form-item-label>label{height:24px}.ant-form-small .ant-form-item-control-input{min-height:24px}.ant-form-large .ant-form-item-label>label{height:40px}.ant-form-large .ant-form-item-control-input{min-height:40px}.ant-form-item{box-sizing:border-box;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";margin:0 0 24px;vertical-align:top}.ant-form-item-with-help{margin-bottom:0}.ant-form-item-hidden,.ant-form-item-hidden.ant-row{display:none}.ant-form-item-label{display:inline-block;flex-grow:0;overflow:hidden;white-space:nowrap;text-align:right;vertical-align:middle}.ant-form-item-label-left{text-align:left}.ant-form-item-label>label{position:relative;display:inline-flex;align-items:center;height:32px;color:hsla(0,0%,100%,.85);font-size:14px}.ant-form-item-label>label>.anticon{font-size:14px;vertical-align:top}.ant-form-item-label>label.ant-form-item-required:not(.ant-form-item-required-mark-optional):before{display:inline-block;margin-right:4px;color:#a61d24;font-size:14px;font-family:SimSun,sans-serif;line-height:1;content:"*"}.ant-form-hide-required-mark .ant-form-item-label>label.ant-form-item-required:not(.ant-form-item-required-mark-optional):before{display:none}.ant-form-item-label>label .ant-form-item-optional{display:inline-block;margin-left:4px;color:hsla(0,0%,100%,.45)}.ant-form-hide-required-mark .ant-form-item-label>label .ant-form-item-optional{display:none}.ant-form-item-label>label .ant-form-item-tooltip{color:hsla(0,0%,100%,.45);-ms-writing-mode:lr-tb;writing-mode:horizontal-tb;-webkit-margin-start:4px;margin-inline-start:4px}.ant-form-item-label>label:after{content:":";position:relative;top:-.5px;margin:0 8px 0 2px}.ant-form-item-label>label.ant-form-item-no-colon:after{content:" "}.ant-form-item-control{display:flex;flex-direction:column;flex-grow:1}.ant-form-item-control:first-child:not([class^=ant-col-]):not([class*=" ant-col-"]){width:100%}.ant-form-item-control-input{position:relative;display:flex;align-items:center;min-height:32px}.ant-form-item-control-input-content{flex:auto;max-width:100%}.ant-form-item-explain,.ant-form-item-extra{clear:both;min-height:24px;color:hsla(0,0%,100%,.45);font-size:14px;line-height:1.5715;transition:color .3s cubic-bezier(.215,.61,.355,1);padding-top:0}.ant-form-item .ant-input-textarea-show-count:after{margin-bottom:-22px}.show-help-appear,.show-help-enter,.show-help-leave{animation-duration:.3s;animation-fill-mode:both;animation-play-state:paused}.show-help-appear.show-help-appear-active,.show-help-enter.show-help-enter-active{animation-name:antShowHelpIn;animation-play-state:running}.show-help-leave.show-help-leave-active{animation-name:antShowHelpOut;animation-play-state:running;pointer-events:none}.show-help-appear,.show-help-enter{opacity:0}.show-help-appear,.show-help-enter,.show-help-leave{animation-timing-function:cubic-bezier(.645,.045,.355,1)}@keyframes antShowHelpIn{0%{transform:translateY(-5px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes antShowHelpOut{to{transform:translateY(-5px);opacity:0}}@keyframes diffZoomIn1{0%{transform:scale(0)}to{transform:scale(1)}}@keyframes diffZoomIn2{0%{transform:scale(0)}to{transform:scale(1)}}@keyframes diffZoomIn3{0%{transform:scale(0)}to{transform:scale(1)}}.ant-form-rtl{direction:rtl}.ant-form-rtl .ant-form-item-label{text-align:left}.ant-form-rtl .ant-form-item-label>label.ant-form-item-required:before{margin-right:0;margin-left:4px}.ant-form-rtl .ant-form-item-label>label:after{margin:0 2px 0 8px}.ant-form-rtl .ant-form-item-label>label .ant-form-item-optional{margin-right:4px;margin-left:0}.ant-col-rtl .ant-form-item-control:first-child{width:100%}.ant-form-rtl .ant-form-item-has-feedback .ant-input{padding-right:11px;padding-left:24px}.ant-form-rtl .ant-form-item-has-feedback .ant-input-affix-wrapper .ant-input-suffix{padding-right:11px;padding-left:18px}.ant-form-rtl .ant-form-item-has-feedback .ant-input-affix-wrapper .ant-input{padding:0}.ant-form-rtl .ant-form-item-has-feedback .ant-input-search:not(.ant-input-search-enter-button) .ant-input-suffix{right:auto;left:28px}.ant-form-rtl .ant-form-item-has-feedback .ant-input-number{padding-left:18px}.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-arrow,.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-clear,.ant-form-rtl .ant-form-item-has-feedback>.ant-select .ant-select-arrow,.ant-form-rtl .ant-form-item-has-feedback>.ant-select .ant-select-clear{right:auto;left:32px}.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-selection-selected-value,.ant-form-rtl .ant-form-item-has-feedback>.ant-select .ant-select-selection-selected-value{padding-right:0;padding-left:42px}.ant-form-rtl .ant-form-item-has-feedback .ant-cascader-picker-arrow{margin-right:0;margin-left:19px}.ant-form-rtl .ant-form-item-has-feedback .ant-cascader-picker-clear{right:auto;left:32px}.ant-form-rtl .ant-form-item-has-feedback .ant-picker,.ant-form-rtl .ant-form-item-has-feedback .ant-picker-large{padding-right:11px;padding-left:29.2px}.ant-form-rtl .ant-form-item-has-feedback .ant-picker-small{padding-right:7px;padding-left:25.2px}.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-has-error .ant-form-item-children-icon,.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-has-success .ant-form-item-children-icon,.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-has-warning .ant-form-item-children-icon,.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-is-validating .ant-form-item-children-icon{right:auto;left:0}.ant-form-rtl.ant-form-inline .ant-form-item{margin-right:0;margin-left:16px}.ant-row{flex-flow:row wrap}.ant-row,.ant-row:after,.ant-row:before{display:flex}.ant-row-no-wrap{flex-wrap:nowrap}.ant-row-start{justify-content:flex-start}.ant-row-center{justify-content:center}.ant-row-end{justify-content:flex-end}.ant-row-space-between{justify-content:space-between}.ant-row-space-around{justify-content:space-around}.ant-row-top{align-items:flex-start}.ant-row-middle{align-items:center}.ant-row-bottom{align-items:flex-end}.ant-col{position:relative;max-width:100%;min-height:1px}.ant-col-24{display:block;flex:0 0 100%;max-width:100%}.ant-col-push-24{left:100%}.ant-col-pull-24{right:100%}.ant-col-offset-24{margin-left:100%}.ant-col-order-24{order:24}.ant-col-23{display:block;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-push-23{left:95.83333333%}.ant-col-pull-23{right:95.83333333%}.ant-col-offset-23{margin-left:95.83333333%}.ant-col-order-23{order:23}.ant-col-22{display:block;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-push-22{left:91.66666667%}.ant-col-pull-22{right:91.66666667%}.ant-col-offset-22{margin-left:91.66666667%}.ant-col-order-22{order:22}.ant-col-21{display:block;flex:0 0 87.5%;max-width:87.5%}.ant-col-push-21{left:87.5%}.ant-col-pull-21{right:87.5%}.ant-col-offset-21{margin-left:87.5%}.ant-col-order-21{order:21}.ant-col-20{display:block;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-push-20{left:83.33333333%}.ant-col-pull-20{right:83.33333333%}.ant-col-offset-20{margin-left:83.33333333%}.ant-col-order-20{order:20}.ant-col-19{display:block;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-push-19{left:79.16666667%}.ant-col-pull-19{right:79.16666667%}.ant-col-offset-19{margin-left:79.16666667%}.ant-col-order-19{order:19}.ant-col-18{display:block;flex:0 0 75%;max-width:75%}.ant-col-push-18{left:75%}.ant-col-pull-18{right:75%}.ant-col-offset-18{margin-left:75%}.ant-col-order-18{order:18}.ant-col-17{display:block;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-push-17{left:70.83333333%}.ant-col-pull-17{right:70.83333333%}.ant-col-offset-17{margin-left:70.83333333%}.ant-col-order-17{order:17}.ant-col-16{display:block;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-push-16{left:66.66666667%}.ant-col-pull-16{right:66.66666667%}.ant-col-offset-16{margin-left:66.66666667%}.ant-col-order-16{order:16}.ant-col-15{display:block;flex:0 0 62.5%;max-width:62.5%}.ant-col-push-15{left:62.5%}.ant-col-pull-15{right:62.5%}.ant-col-offset-15{margin-left:62.5%}.ant-col-order-15{order:15}.ant-col-14{display:block;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-push-14{left:58.33333333%}.ant-col-pull-14{right:58.33333333%}.ant-col-offset-14{margin-left:58.33333333%}.ant-col-order-14{order:14}.ant-col-13{display:block;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-push-13{left:54.16666667%}.ant-col-pull-13{right:54.16666667%}.ant-col-offset-13{margin-left:54.16666667%}.ant-col-order-13{order:13}.ant-col-12{display:block;flex:0 0 50%;max-width:50%}.ant-col-push-12{left:50%}.ant-col-pull-12{right:50%}.ant-col-offset-12{margin-left:50%}.ant-col-order-12{order:12}.ant-col-11{display:block;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-push-11{left:45.83333333%}.ant-col-pull-11{right:45.83333333%}.ant-col-offset-11{margin-left:45.83333333%}.ant-col-order-11{order:11}.ant-col-10{display:block;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-push-10{left:41.66666667%}.ant-col-pull-10{right:41.66666667%}.ant-col-offset-10{margin-left:41.66666667%}.ant-col-order-10{order:10}.ant-col-9{display:block;flex:0 0 37.5%;max-width:37.5%}.ant-col-push-9{left:37.5%}.ant-col-pull-9{right:37.5%}.ant-col-offset-9{margin-left:37.5%}.ant-col-order-9{order:9}.ant-col-8{display:block;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-push-8{left:33.33333333%}.ant-col-pull-8{right:33.33333333%}.ant-col-offset-8{margin-left:33.33333333%}.ant-col-order-8{order:8}.ant-col-7{display:block;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-push-7{left:29.16666667%}.ant-col-pull-7{right:29.16666667%}.ant-col-offset-7{margin-left:29.16666667%}.ant-col-order-7{order:7}.ant-col-6{display:block;flex:0 0 25%;max-width:25%}.ant-col-push-6{left:25%}.ant-col-pull-6{right:25%}.ant-col-offset-6{margin-left:25%}.ant-col-order-6{order:6}.ant-col-5{display:block;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-push-5{left:20.83333333%}.ant-col-pull-5{right:20.83333333%}.ant-col-offset-5{margin-left:20.83333333%}.ant-col-order-5{order:5}.ant-col-4{display:block;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-push-4{left:16.66666667%}.ant-col-pull-4{right:16.66666667%}.ant-col-offset-4{margin-left:16.66666667%}.ant-col-order-4{order:4}.ant-col-3{display:block;flex:0 0 12.5%;max-width:12.5%}.ant-col-push-3{left:12.5%}.ant-col-pull-3{right:12.5%}.ant-col-offset-3{margin-left:12.5%}.ant-col-order-3{order:3}.ant-col-2{display:block;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-push-2{left:8.33333333%}.ant-col-pull-2{right:8.33333333%}.ant-col-offset-2{margin-left:8.33333333%}.ant-col-order-2{order:2}.ant-col-1{display:block;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-push-1{left:4.16666667%}.ant-col-pull-1{right:4.16666667%}.ant-col-offset-1{margin-left:4.16666667%}.ant-col-order-1{order:1}.ant-col-0{display:none}.ant-col-offset-0{margin-left:0}.ant-col-order-0{order:0}.ant-col-offset-0.ant-col-rtl{margin-right:0}.ant-col-push-1.ant-col-rtl{right:4.16666667%;left:auto}.ant-col-pull-1.ant-col-rtl{right:auto;left:4.16666667%}.ant-col-offset-1.ant-col-rtl{margin-right:4.16666667%;margin-left:0}.ant-col-push-2.ant-col-rtl{right:8.33333333%;left:auto}.ant-col-pull-2.ant-col-rtl{right:auto;left:8.33333333%}.ant-col-offset-2.ant-col-rtl{margin-right:8.33333333%;margin-left:0}.ant-col-push-3.ant-col-rtl{right:12.5%;left:auto}.ant-col-pull-3.ant-col-rtl{right:auto;left:12.5%}.ant-col-offset-3.ant-col-rtl{margin-right:12.5%;margin-left:0}.ant-col-push-4.ant-col-rtl{right:16.66666667%;left:auto}.ant-col-pull-4.ant-col-rtl{right:auto;left:16.66666667%}.ant-col-offset-4.ant-col-rtl{margin-right:16.66666667%;margin-left:0}.ant-col-push-5.ant-col-rtl{right:20.83333333%;left:auto}.ant-col-pull-5.ant-col-rtl{right:auto;left:20.83333333%}.ant-col-offset-5.ant-col-rtl{margin-right:20.83333333%;margin-left:0}.ant-col-push-6.ant-col-rtl{right:25%;left:auto}.ant-col-pull-6.ant-col-rtl{right:auto;left:25%}.ant-col-offset-6.ant-col-rtl{margin-right:25%;margin-left:0}.ant-col-push-7.ant-col-rtl{right:29.16666667%;left:auto}.ant-col-pull-7.ant-col-rtl{right:auto;left:29.16666667%}.ant-col-offset-7.ant-col-rtl{margin-right:29.16666667%;margin-left:0}.ant-col-push-8.ant-col-rtl{right:33.33333333%;left:auto}.ant-col-pull-8.ant-col-rtl{right:auto;left:33.33333333%}.ant-col-offset-8.ant-col-rtl{margin-right:33.33333333%;margin-left:0}.ant-col-push-9.ant-col-rtl{right:37.5%;left:auto}.ant-col-pull-9.ant-col-rtl{right:auto;left:37.5%}.ant-col-offset-9.ant-col-rtl{margin-right:37.5%;margin-left:0}.ant-col-push-10.ant-col-rtl{right:41.66666667%;left:auto}.ant-col-pull-10.ant-col-rtl{right:auto;left:41.66666667%}.ant-col-offset-10.ant-col-rtl{margin-right:41.66666667%;margin-left:0}.ant-col-push-11.ant-col-rtl{right:45.83333333%;left:auto}.ant-col-pull-11.ant-col-rtl{right:auto;left:45.83333333%}.ant-col-offset-11.ant-col-rtl{margin-right:45.83333333%;margin-left:0}.ant-col-push-12.ant-col-rtl{right:50%;left:auto}.ant-col-pull-12.ant-col-rtl{right:auto;left:50%}.ant-col-offset-12.ant-col-rtl{margin-right:50%;margin-left:0}.ant-col-push-13.ant-col-rtl{right:54.16666667%;left:auto}.ant-col-pull-13.ant-col-rtl{right:auto;left:54.16666667%}.ant-col-offset-13.ant-col-rtl{margin-right:54.16666667%;margin-left:0}.ant-col-push-14.ant-col-rtl{right:58.33333333%;left:auto}.ant-col-pull-14.ant-col-rtl{right:auto;left:58.33333333%}.ant-col-offset-14.ant-col-rtl{margin-right:58.33333333%;margin-left:0}.ant-col-push-15.ant-col-rtl{right:62.5%;left:auto}.ant-col-pull-15.ant-col-rtl{right:auto;left:62.5%}.ant-col-offset-15.ant-col-rtl{margin-right:62.5%;margin-left:0}.ant-col-push-16.ant-col-rtl{right:66.66666667%;left:auto}.ant-col-pull-16.ant-col-rtl{right:auto;left:66.66666667%}.ant-col-offset-16.ant-col-rtl{margin-right:66.66666667%;margin-left:0}.ant-col-push-17.ant-col-rtl{right:70.83333333%;left:auto}.ant-col-pull-17.ant-col-rtl{right:auto;left:70.83333333%}.ant-col-offset-17.ant-col-rtl{margin-right:70.83333333%;margin-left:0}.ant-col-push-18.ant-col-rtl{right:75%;left:auto}.ant-col-pull-18.ant-col-rtl{right:auto;left:75%}.ant-col-offset-18.ant-col-rtl{margin-right:75%;margin-left:0}.ant-col-push-19.ant-col-rtl{right:79.16666667%;left:auto}.ant-col-pull-19.ant-col-rtl{right:auto;left:79.16666667%}.ant-col-offset-19.ant-col-rtl{margin-right:79.16666667%;margin-left:0}.ant-col-push-20.ant-col-rtl{right:83.33333333%;left:auto}.ant-col-pull-20.ant-col-rtl{right:auto;left:83.33333333%}.ant-col-offset-20.ant-col-rtl{margin-right:83.33333333%;margin-left:0}.ant-col-push-21.ant-col-rtl{right:87.5%;left:auto}.ant-col-pull-21.ant-col-rtl{right:auto;left:87.5%}.ant-col-offset-21.ant-col-rtl{margin-right:87.5%;margin-left:0}.ant-col-push-22.ant-col-rtl{right:91.66666667%;left:auto}.ant-col-pull-22.ant-col-rtl{right:auto;left:91.66666667%}.ant-col-offset-22.ant-col-rtl{margin-right:91.66666667%;margin-left:0}.ant-col-push-23.ant-col-rtl{right:95.83333333%;left:auto}.ant-col-pull-23.ant-col-rtl{right:auto;left:95.83333333%}.ant-col-offset-23.ant-col-rtl{margin-right:95.83333333%;margin-left:0}.ant-col-push-24.ant-col-rtl{right:100%;left:auto}.ant-col-pull-24.ant-col-rtl{right:auto;left:100%}.ant-col-offset-24.ant-col-rtl{margin-right:100%;margin-left:0}.ant-col-xs-24{display:block;flex:0 0 100%;max-width:100%}.ant-col-xs-push-24{left:100%}.ant-col-xs-pull-24{right:100%}.ant-col-xs-offset-24{margin-left:100%}.ant-col-xs-order-24{order:24}.ant-col-xs-23{display:block;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-xs-push-23{left:95.83333333%}.ant-col-xs-pull-23{right:95.83333333%}.ant-col-xs-offset-23{margin-left:95.83333333%}.ant-col-xs-order-23{order:23}.ant-col-xs-22{display:block;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-xs-push-22{left:91.66666667%}.ant-col-xs-pull-22{right:91.66666667%}.ant-col-xs-offset-22{margin-left:91.66666667%}.ant-col-xs-order-22{order:22}.ant-col-xs-21{display:block;flex:0 0 87.5%;max-width:87.5%}.ant-col-xs-push-21{left:87.5%}.ant-col-xs-pull-21{right:87.5%}.ant-col-xs-offset-21{margin-left:87.5%}.ant-col-xs-order-21{order:21}.ant-col-xs-20{display:block;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-xs-push-20{left:83.33333333%}.ant-col-xs-pull-20{right:83.33333333%}.ant-col-xs-offset-20{margin-left:83.33333333%}.ant-col-xs-order-20{order:20}.ant-col-xs-19{display:block;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-xs-push-19{left:79.16666667%}.ant-col-xs-pull-19{right:79.16666667%}.ant-col-xs-offset-19{margin-left:79.16666667%}.ant-col-xs-order-19{order:19}.ant-col-xs-18{display:block;flex:0 0 75%;max-width:75%}.ant-col-xs-push-18{left:75%}.ant-col-xs-pull-18{right:75%}.ant-col-xs-offset-18{margin-left:75%}.ant-col-xs-order-18{order:18}.ant-col-xs-17{display:block;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-xs-push-17{left:70.83333333%}.ant-col-xs-pull-17{right:70.83333333%}.ant-col-xs-offset-17{margin-left:70.83333333%}.ant-col-xs-order-17{order:17}.ant-col-xs-16{display:block;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-xs-push-16{left:66.66666667%}.ant-col-xs-pull-16{right:66.66666667%}.ant-col-xs-offset-16{margin-left:66.66666667%}.ant-col-xs-order-16{order:16}.ant-col-xs-15{display:block;flex:0 0 62.5%;max-width:62.5%}.ant-col-xs-push-15{left:62.5%}.ant-col-xs-pull-15{right:62.5%}.ant-col-xs-offset-15{margin-left:62.5%}.ant-col-xs-order-15{order:15}.ant-col-xs-14{display:block;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-xs-push-14{left:58.33333333%}.ant-col-xs-pull-14{right:58.33333333%}.ant-col-xs-offset-14{margin-left:58.33333333%}.ant-col-xs-order-14{order:14}.ant-col-xs-13{display:block;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-xs-push-13{left:54.16666667%}.ant-col-xs-pull-13{right:54.16666667%}.ant-col-xs-offset-13{margin-left:54.16666667%}.ant-col-xs-order-13{order:13}.ant-col-xs-12{display:block;flex:0 0 50%;max-width:50%}.ant-col-xs-push-12{left:50%}.ant-col-xs-pull-12{right:50%}.ant-col-xs-offset-12{margin-left:50%}.ant-col-xs-order-12{order:12}.ant-col-xs-11{display:block;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-xs-push-11{left:45.83333333%}.ant-col-xs-pull-11{right:45.83333333%}.ant-col-xs-offset-11{margin-left:45.83333333%}.ant-col-xs-order-11{order:11}.ant-col-xs-10{display:block;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-xs-push-10{left:41.66666667%}.ant-col-xs-pull-10{right:41.66666667%}.ant-col-xs-offset-10{margin-left:41.66666667%}.ant-col-xs-order-10{order:10}.ant-col-xs-9{display:block;flex:0 0 37.5%;max-width:37.5%}.ant-col-xs-push-9{left:37.5%}.ant-col-xs-pull-9{right:37.5%}.ant-col-xs-offset-9{margin-left:37.5%}.ant-col-xs-order-9{order:9}.ant-col-xs-8{display:block;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-xs-push-8{left:33.33333333%}.ant-col-xs-pull-8{right:33.33333333%}.ant-col-xs-offset-8{margin-left:33.33333333%}.ant-col-xs-order-8{order:8}.ant-col-xs-7{display:block;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-xs-push-7{left:29.16666667%}.ant-col-xs-pull-7{right:29.16666667%}.ant-col-xs-offset-7{margin-left:29.16666667%}.ant-col-xs-order-7{order:7}.ant-col-xs-6{display:block;flex:0 0 25%;max-width:25%}.ant-col-xs-push-6{left:25%}.ant-col-xs-pull-6{right:25%}.ant-col-xs-offset-6{margin-left:25%}.ant-col-xs-order-6{order:6}.ant-col-xs-5{display:block;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-xs-push-5{left:20.83333333%}.ant-col-xs-pull-5{right:20.83333333%}.ant-col-xs-offset-5{margin-left:20.83333333%}.ant-col-xs-order-5{order:5}.ant-col-xs-4{display:block;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-xs-push-4{left:16.66666667%}.ant-col-xs-pull-4{right:16.66666667%}.ant-col-xs-offset-4{margin-left:16.66666667%}.ant-col-xs-order-4{order:4}.ant-col-xs-3{display:block;flex:0 0 12.5%;max-width:12.5%}.ant-col-xs-push-3{left:12.5%}.ant-col-xs-pull-3{right:12.5%}.ant-col-xs-offset-3{margin-left:12.5%}.ant-col-xs-order-3{order:3}.ant-col-xs-2{display:block;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-xs-push-2{left:8.33333333%}.ant-col-xs-pull-2{right:8.33333333%}.ant-col-xs-offset-2{margin-left:8.33333333%}.ant-col-xs-order-2{order:2}.ant-col-xs-1{display:block;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-xs-push-1{left:4.16666667%}.ant-col-xs-pull-1{right:4.16666667%}.ant-col-xs-offset-1{margin-left:4.16666667%}.ant-col-xs-order-1{order:1}.ant-col-xs-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-xs-push-0{left:auto}.ant-col-xs-pull-0{right:auto}.ant-col-xs-offset-0{margin-left:0}.ant-col-xs-order-0{order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-xs-push-0.ant-col-rtl{right:auto}.ant-col-xs-pull-0.ant-col-rtl{left:auto}.ant-col-xs-offset-0.ant-col-rtl{margin-right:0}.ant-col-xs-push-1.ant-col-rtl{right:4.16666667%;left:auto}.ant-col-xs-pull-1.ant-col-rtl{right:auto;left:4.16666667%}.ant-col-xs-offset-1.ant-col-rtl{margin-right:4.16666667%;margin-left:0}.ant-col-xs-push-2.ant-col-rtl{right:8.33333333%;left:auto}.ant-col-xs-pull-2.ant-col-rtl{right:auto;left:8.33333333%}.ant-col-xs-offset-2.ant-col-rtl{margin-right:8.33333333%;margin-left:0}.ant-col-xs-push-3.ant-col-rtl{right:12.5%;left:auto}.ant-col-xs-pull-3.ant-col-rtl{right:auto;left:12.5%}.ant-col-xs-offset-3.ant-col-rtl{margin-right:12.5%;margin-left:0}.ant-col-xs-push-4.ant-col-rtl{right:16.66666667%;left:auto}.ant-col-xs-pull-4.ant-col-rtl{right:auto;left:16.66666667%}.ant-col-xs-offset-4.ant-col-rtl{margin-right:16.66666667%;margin-left:0}.ant-col-xs-push-5.ant-col-rtl{right:20.83333333%;left:auto}.ant-col-xs-pull-5.ant-col-rtl{right:auto;left:20.83333333%}.ant-col-xs-offset-5.ant-col-rtl{margin-right:20.83333333%;margin-left:0}.ant-col-xs-push-6.ant-col-rtl{right:25%;left:auto}.ant-col-xs-pull-6.ant-col-rtl{right:auto;left:25%}.ant-col-xs-offset-6.ant-col-rtl{margin-right:25%;margin-left:0}.ant-col-xs-push-7.ant-col-rtl{right:29.16666667%;left:auto}.ant-col-xs-pull-7.ant-col-rtl{right:auto;left:29.16666667%}.ant-col-xs-offset-7.ant-col-rtl{margin-right:29.16666667%;margin-left:0}.ant-col-xs-push-8.ant-col-rtl{right:33.33333333%;left:auto}.ant-col-xs-pull-8.ant-col-rtl{right:auto;left:33.33333333%}.ant-col-xs-offset-8.ant-col-rtl{margin-right:33.33333333%;margin-left:0}.ant-col-xs-push-9.ant-col-rtl{right:37.5%;left:auto}.ant-col-xs-pull-9.ant-col-rtl{right:auto;left:37.5%}.ant-col-xs-offset-9.ant-col-rtl{margin-right:37.5%;margin-left:0}.ant-col-xs-push-10.ant-col-rtl{right:41.66666667%;left:auto}.ant-col-xs-pull-10.ant-col-rtl{right:auto;left:41.66666667%}.ant-col-xs-offset-10.ant-col-rtl{margin-right:41.66666667%;margin-left:0}.ant-col-xs-push-11.ant-col-rtl{right:45.83333333%;left:auto}.ant-col-xs-pull-11.ant-col-rtl{right:auto;left:45.83333333%}.ant-col-xs-offset-11.ant-col-rtl{margin-right:45.83333333%;margin-left:0}.ant-col-xs-push-12.ant-col-rtl{right:50%;left:auto}.ant-col-xs-pull-12.ant-col-rtl{right:auto;left:50%}.ant-col-xs-offset-12.ant-col-rtl{margin-right:50%;margin-left:0}.ant-col-xs-push-13.ant-col-rtl{right:54.16666667%;left:auto}.ant-col-xs-pull-13.ant-col-rtl{right:auto;left:54.16666667%}.ant-col-xs-offset-13.ant-col-rtl{margin-right:54.16666667%;margin-left:0}.ant-col-xs-push-14.ant-col-rtl{right:58.33333333%;left:auto}.ant-col-xs-pull-14.ant-col-rtl{right:auto;left:58.33333333%}.ant-col-xs-offset-14.ant-col-rtl{margin-right:58.33333333%;margin-left:0}.ant-col-xs-push-15.ant-col-rtl{right:62.5%;left:auto}.ant-col-xs-pull-15.ant-col-rtl{right:auto;left:62.5%}.ant-col-xs-offset-15.ant-col-rtl{margin-right:62.5%;margin-left:0}.ant-col-xs-push-16.ant-col-rtl{right:66.66666667%;left:auto}.ant-col-xs-pull-16.ant-col-rtl{right:auto;left:66.66666667%}.ant-col-xs-offset-16.ant-col-rtl{margin-right:66.66666667%;margin-left:0}.ant-col-xs-push-17.ant-col-rtl{right:70.83333333%;left:auto}.ant-col-xs-pull-17.ant-col-rtl{right:auto;left:70.83333333%}.ant-col-xs-offset-17.ant-col-rtl{margin-right:70.83333333%;margin-left:0}.ant-col-xs-push-18.ant-col-rtl{right:75%;left:auto}.ant-col-xs-pull-18.ant-col-rtl{right:auto;left:75%}.ant-col-xs-offset-18.ant-col-rtl{margin-right:75%;margin-left:0}.ant-col-xs-push-19.ant-col-rtl{right:79.16666667%;left:auto}.ant-col-xs-pull-19.ant-col-rtl{right:auto;left:79.16666667%}.ant-col-xs-offset-19.ant-col-rtl{margin-right:79.16666667%;margin-left:0}.ant-col-xs-push-20.ant-col-rtl{right:83.33333333%;left:auto}.ant-col-xs-pull-20.ant-col-rtl{right:auto;left:83.33333333%}.ant-col-xs-offset-20.ant-col-rtl{margin-right:83.33333333%;margin-left:0}.ant-col-xs-push-21.ant-col-rtl{right:87.5%;left:auto}.ant-col-xs-pull-21.ant-col-rtl{right:auto;left:87.5%}.ant-col-xs-offset-21.ant-col-rtl{margin-right:87.5%;margin-left:0}.ant-col-xs-push-22.ant-col-rtl{right:91.66666667%;left:auto}.ant-col-xs-pull-22.ant-col-rtl{right:auto;left:91.66666667%}.ant-col-xs-offset-22.ant-col-rtl{margin-right:91.66666667%;margin-left:0}.ant-col-xs-push-23.ant-col-rtl{right:95.83333333%;left:auto}.ant-col-xs-pull-23.ant-col-rtl{right:auto;left:95.83333333%}.ant-col-xs-offset-23.ant-col-rtl{margin-right:95.83333333%;margin-left:0}.ant-col-xs-push-24.ant-col-rtl{right:100%;left:auto}.ant-col-xs-pull-24.ant-col-rtl{right:auto;left:100%}.ant-col-xs-offset-24.ant-col-rtl{margin-right:100%;margin-left:0}@media (min-width:576px){.ant-col-sm-24{display:block;flex:0 0 100%;max-width:100%}.ant-col-sm-push-24{left:100%}.ant-col-sm-pull-24{right:100%}.ant-col-sm-offset-24{margin-left:100%}.ant-col-sm-order-24{order:24}.ant-col-sm-23{display:block;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-sm-push-23{left:95.83333333%}.ant-col-sm-pull-23{right:95.83333333%}.ant-col-sm-offset-23{margin-left:95.83333333%}.ant-col-sm-order-23{order:23}.ant-col-sm-22{display:block;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-sm-push-22{left:91.66666667%}.ant-col-sm-pull-22{right:91.66666667%}.ant-col-sm-offset-22{margin-left:91.66666667%}.ant-col-sm-order-22{order:22}.ant-col-sm-21{display:block;flex:0 0 87.5%;max-width:87.5%}.ant-col-sm-push-21{left:87.5%}.ant-col-sm-pull-21{right:87.5%}.ant-col-sm-offset-21{margin-left:87.5%}.ant-col-sm-order-21{order:21}.ant-col-sm-20{display:block;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-sm-push-20{left:83.33333333%}.ant-col-sm-pull-20{right:83.33333333%}.ant-col-sm-offset-20{margin-left:83.33333333%}.ant-col-sm-order-20{order:20}.ant-col-sm-19{display:block;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-sm-push-19{left:79.16666667%}.ant-col-sm-pull-19{right:79.16666667%}.ant-col-sm-offset-19{margin-left:79.16666667%}.ant-col-sm-order-19{order:19}.ant-col-sm-18{display:block;flex:0 0 75%;max-width:75%}.ant-col-sm-push-18{left:75%}.ant-col-sm-pull-18{right:75%}.ant-col-sm-offset-18{margin-left:75%}.ant-col-sm-order-18{order:18}.ant-col-sm-17{display:block;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-sm-push-17{left:70.83333333%}.ant-col-sm-pull-17{right:70.83333333%}.ant-col-sm-offset-17{margin-left:70.83333333%}.ant-col-sm-order-17{order:17}.ant-col-sm-16{display:block;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-sm-push-16{left:66.66666667%}.ant-col-sm-pull-16{right:66.66666667%}.ant-col-sm-offset-16{margin-left:66.66666667%}.ant-col-sm-order-16{order:16}.ant-col-sm-15{display:block;flex:0 0 62.5%;max-width:62.5%}.ant-col-sm-push-15{left:62.5%}.ant-col-sm-pull-15{right:62.5%}.ant-col-sm-offset-15{margin-left:62.5%}.ant-col-sm-order-15{order:15}.ant-col-sm-14{display:block;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-sm-push-14{left:58.33333333%}.ant-col-sm-pull-14{right:58.33333333%}.ant-col-sm-offset-14{margin-left:58.33333333%}.ant-col-sm-order-14{order:14}.ant-col-sm-13{display:block;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-sm-push-13{left:54.16666667%}.ant-col-sm-pull-13{right:54.16666667%}.ant-col-sm-offset-13{margin-left:54.16666667%}.ant-col-sm-order-13{order:13}.ant-col-sm-12{display:block;flex:0 0 50%;max-width:50%}.ant-col-sm-push-12{left:50%}.ant-col-sm-pull-12{right:50%}.ant-col-sm-offset-12{margin-left:50%}.ant-col-sm-order-12{order:12}.ant-col-sm-11{display:block;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-sm-push-11{left:45.83333333%}.ant-col-sm-pull-11{right:45.83333333%}.ant-col-sm-offset-11{margin-left:45.83333333%}.ant-col-sm-order-11{order:11}.ant-col-sm-10{display:block;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-sm-push-10{left:41.66666667%}.ant-col-sm-pull-10{right:41.66666667%}.ant-col-sm-offset-10{margin-left:41.66666667%}.ant-col-sm-order-10{order:10}.ant-col-sm-9{display:block;flex:0 0 37.5%;max-width:37.5%}.ant-col-sm-push-9{left:37.5%}.ant-col-sm-pull-9{right:37.5%}.ant-col-sm-offset-9{margin-left:37.5%}.ant-col-sm-order-9{order:9}.ant-col-sm-8{display:block;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-sm-push-8{left:33.33333333%}.ant-col-sm-pull-8{right:33.33333333%}.ant-col-sm-offset-8{margin-left:33.33333333%}.ant-col-sm-order-8{order:8}.ant-col-sm-7{display:block;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-sm-push-7{left:29.16666667%}.ant-col-sm-pull-7{right:29.16666667%}.ant-col-sm-offset-7{margin-left:29.16666667%}.ant-col-sm-order-7{order:7}.ant-col-sm-6{display:block;flex:0 0 25%;max-width:25%}.ant-col-sm-push-6{left:25%}.ant-col-sm-pull-6{right:25%}.ant-col-sm-offset-6{margin-left:25%}.ant-col-sm-order-6{order:6}.ant-col-sm-5{display:block;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-sm-push-5{left:20.83333333%}.ant-col-sm-pull-5{right:20.83333333%}.ant-col-sm-offset-5{margin-left:20.83333333%}.ant-col-sm-order-5{order:5}.ant-col-sm-4{display:block;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-sm-push-4{left:16.66666667%}.ant-col-sm-pull-4{right:16.66666667%}.ant-col-sm-offset-4{margin-left:16.66666667%}.ant-col-sm-order-4{order:4}.ant-col-sm-3{display:block;flex:0 0 12.5%;max-width:12.5%}.ant-col-sm-push-3{left:12.5%}.ant-col-sm-pull-3{right:12.5%}.ant-col-sm-offset-3{margin-left:12.5%}.ant-col-sm-order-3{order:3}.ant-col-sm-2{display:block;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-sm-push-2{left:8.33333333%}.ant-col-sm-pull-2{right:8.33333333%}.ant-col-sm-offset-2{margin-left:8.33333333%}.ant-col-sm-order-2{order:2}.ant-col-sm-1{display:block;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-sm-push-1{left:4.16666667%}.ant-col-sm-pull-1{right:4.16666667%}.ant-col-sm-offset-1{margin-left:4.16666667%}.ant-col-sm-order-1{order:1}.ant-col-sm-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-sm-push-0{left:auto}.ant-col-sm-pull-0{right:auto}.ant-col-sm-offset-0{margin-left:0}.ant-col-sm-order-0{order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-sm-push-0.ant-col-rtl{right:auto}.ant-col-sm-pull-0.ant-col-rtl{left:auto}.ant-col-sm-offset-0.ant-col-rtl{margin-right:0}.ant-col-sm-push-1.ant-col-rtl{right:4.16666667%;left:auto}.ant-col-sm-pull-1.ant-col-rtl{right:auto;left:4.16666667%}.ant-col-sm-offset-1.ant-col-rtl{margin-right:4.16666667%;margin-left:0}.ant-col-sm-push-2.ant-col-rtl{right:8.33333333%;left:auto}.ant-col-sm-pull-2.ant-col-rtl{right:auto;left:8.33333333%}.ant-col-sm-offset-2.ant-col-rtl{margin-right:8.33333333%;margin-left:0}.ant-col-sm-push-3.ant-col-rtl{right:12.5%;left:auto}.ant-col-sm-pull-3.ant-col-rtl{right:auto;left:12.5%}.ant-col-sm-offset-3.ant-col-rtl{margin-right:12.5%;margin-left:0}.ant-col-sm-push-4.ant-col-rtl{right:16.66666667%;left:auto}.ant-col-sm-pull-4.ant-col-rtl{right:auto;left:16.66666667%}.ant-col-sm-offset-4.ant-col-rtl{margin-right:16.66666667%;margin-left:0}.ant-col-sm-push-5.ant-col-rtl{right:20.83333333%;left:auto}.ant-col-sm-pull-5.ant-col-rtl{right:auto;left:20.83333333%}.ant-col-sm-offset-5.ant-col-rtl{margin-right:20.83333333%;margin-left:0}.ant-col-sm-push-6.ant-col-rtl{right:25%;left:auto}.ant-col-sm-pull-6.ant-col-rtl{right:auto;left:25%}.ant-col-sm-offset-6.ant-col-rtl{margin-right:25%;margin-left:0}.ant-col-sm-push-7.ant-col-rtl{right:29.16666667%;left:auto}.ant-col-sm-pull-7.ant-col-rtl{right:auto;left:29.16666667%}.ant-col-sm-offset-7.ant-col-rtl{margin-right:29.16666667%;margin-left:0}.ant-col-sm-push-8.ant-col-rtl{right:33.33333333%;left:auto}.ant-col-sm-pull-8.ant-col-rtl{right:auto;left:33.33333333%}.ant-col-sm-offset-8.ant-col-rtl{margin-right:33.33333333%;margin-left:0}.ant-col-sm-push-9.ant-col-rtl{right:37.5%;left:auto}.ant-col-sm-pull-9.ant-col-rtl{right:auto;left:37.5%}.ant-col-sm-offset-9.ant-col-rtl{margin-right:37.5%;margin-left:0}.ant-col-sm-push-10.ant-col-rtl{right:41.66666667%;left:auto}.ant-col-sm-pull-10.ant-col-rtl{right:auto;left:41.66666667%}.ant-col-sm-offset-10.ant-col-rtl{margin-right:41.66666667%;margin-left:0}.ant-col-sm-push-11.ant-col-rtl{right:45.83333333%;left:auto}.ant-col-sm-pull-11.ant-col-rtl{right:auto;left:45.83333333%}.ant-col-sm-offset-11.ant-col-rtl{margin-right:45.83333333%;margin-left:0}.ant-col-sm-push-12.ant-col-rtl{right:50%;left:auto}.ant-col-sm-pull-12.ant-col-rtl{right:auto;left:50%}.ant-col-sm-offset-12.ant-col-rtl{margin-right:50%;margin-left:0}.ant-col-sm-push-13.ant-col-rtl{right:54.16666667%;left:auto}.ant-col-sm-pull-13.ant-col-rtl{right:auto;left:54.16666667%}.ant-col-sm-offset-13.ant-col-rtl{margin-right:54.16666667%;margin-left:0}.ant-col-sm-push-14.ant-col-rtl{right:58.33333333%;left:auto}.ant-col-sm-pull-14.ant-col-rtl{right:auto;left:58.33333333%}.ant-col-sm-offset-14.ant-col-rtl{margin-right:58.33333333%;margin-left:0}.ant-col-sm-push-15.ant-col-rtl{right:62.5%;left:auto}.ant-col-sm-pull-15.ant-col-rtl{right:auto;left:62.5%}.ant-col-sm-offset-15.ant-col-rtl{margin-right:62.5%;margin-left:0}.ant-col-sm-push-16.ant-col-rtl{right:66.66666667%;left:auto}.ant-col-sm-pull-16.ant-col-rtl{right:auto;left:66.66666667%}.ant-col-sm-offset-16.ant-col-rtl{margin-right:66.66666667%;margin-left:0}.ant-col-sm-push-17.ant-col-rtl{right:70.83333333%;left:auto}.ant-col-sm-pull-17.ant-col-rtl{right:auto;left:70.83333333%}.ant-col-sm-offset-17.ant-col-rtl{margin-right:70.83333333%;margin-left:0}.ant-col-sm-push-18.ant-col-rtl{right:75%;left:auto}.ant-col-sm-pull-18.ant-col-rtl{right:auto;left:75%}.ant-col-sm-offset-18.ant-col-rtl{margin-right:75%;margin-left:0}.ant-col-sm-push-19.ant-col-rtl{right:79.16666667%;left:auto}.ant-col-sm-pull-19.ant-col-rtl{right:auto;left:79.16666667%}.ant-col-sm-offset-19.ant-col-rtl{margin-right:79.16666667%;margin-left:0}.ant-col-sm-push-20.ant-col-rtl{right:83.33333333%;left:auto}.ant-col-sm-pull-20.ant-col-rtl{right:auto;left:83.33333333%}.ant-col-sm-offset-20.ant-col-rtl{margin-right:83.33333333%;margin-left:0}.ant-col-sm-push-21.ant-col-rtl{right:87.5%;left:auto}.ant-col-sm-pull-21.ant-col-rtl{right:auto;left:87.5%}.ant-col-sm-offset-21.ant-col-rtl{margin-right:87.5%;margin-left:0}.ant-col-sm-push-22.ant-col-rtl{right:91.66666667%;left:auto}.ant-col-sm-pull-22.ant-col-rtl{right:auto;left:91.66666667%}.ant-col-sm-offset-22.ant-col-rtl{margin-right:91.66666667%;margin-left:0}.ant-col-sm-push-23.ant-col-rtl{right:95.83333333%;left:auto}.ant-col-sm-pull-23.ant-col-rtl{right:auto;left:95.83333333%}.ant-col-sm-offset-23.ant-col-rtl{margin-right:95.83333333%;margin-left:0}.ant-col-sm-push-24.ant-col-rtl{right:100%;left:auto}.ant-col-sm-pull-24.ant-col-rtl{right:auto;left:100%}.ant-col-sm-offset-24.ant-col-rtl{margin-right:100%;margin-left:0}}@media (min-width:768px){.ant-col-md-24{display:block;flex:0 0 100%;max-width:100%}.ant-col-md-push-24{left:100%}.ant-col-md-pull-24{right:100%}.ant-col-md-offset-24{margin-left:100%}.ant-col-md-order-24{order:24}.ant-col-md-23{display:block;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-md-push-23{left:95.83333333%}.ant-col-md-pull-23{right:95.83333333%}.ant-col-md-offset-23{margin-left:95.83333333%}.ant-col-md-order-23{order:23}.ant-col-md-22{display:block;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-md-push-22{left:91.66666667%}.ant-col-md-pull-22{right:91.66666667%}.ant-col-md-offset-22{margin-left:91.66666667%}.ant-col-md-order-22{order:22}.ant-col-md-21{display:block;flex:0 0 87.5%;max-width:87.5%}.ant-col-md-push-21{left:87.5%}.ant-col-md-pull-21{right:87.5%}.ant-col-md-offset-21{margin-left:87.5%}.ant-col-md-order-21{order:21}.ant-col-md-20{display:block;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-md-push-20{left:83.33333333%}.ant-col-md-pull-20{right:83.33333333%}.ant-col-md-offset-20{margin-left:83.33333333%}.ant-col-md-order-20{order:20}.ant-col-md-19{display:block;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-md-push-19{left:79.16666667%}.ant-col-md-pull-19{right:79.16666667%}.ant-col-md-offset-19{margin-left:79.16666667%}.ant-col-md-order-19{order:19}.ant-col-md-18{display:block;flex:0 0 75%;max-width:75%}.ant-col-md-push-18{left:75%}.ant-col-md-pull-18{right:75%}.ant-col-md-offset-18{margin-left:75%}.ant-col-md-order-18{order:18}.ant-col-md-17{display:block;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-md-push-17{left:70.83333333%}.ant-col-md-pull-17{right:70.83333333%}.ant-col-md-offset-17{margin-left:70.83333333%}.ant-col-md-order-17{order:17}.ant-col-md-16{display:block;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-md-push-16{left:66.66666667%}.ant-col-md-pull-16{right:66.66666667%}.ant-col-md-offset-16{margin-left:66.66666667%}.ant-col-md-order-16{order:16}.ant-col-md-15{display:block;flex:0 0 62.5%;max-width:62.5%}.ant-col-md-push-15{left:62.5%}.ant-col-md-pull-15{right:62.5%}.ant-col-md-offset-15{margin-left:62.5%}.ant-col-md-order-15{order:15}.ant-col-md-14{display:block;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-md-push-14{left:58.33333333%}.ant-col-md-pull-14{right:58.33333333%}.ant-col-md-offset-14{margin-left:58.33333333%}.ant-col-md-order-14{order:14}.ant-col-md-13{display:block;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-md-push-13{left:54.16666667%}.ant-col-md-pull-13{right:54.16666667%}.ant-col-md-offset-13{margin-left:54.16666667%}.ant-col-md-order-13{order:13}.ant-col-md-12{display:block;flex:0 0 50%;max-width:50%}.ant-col-md-push-12{left:50%}.ant-col-md-pull-12{right:50%}.ant-col-md-offset-12{margin-left:50%}.ant-col-md-order-12{order:12}.ant-col-md-11{display:block;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-md-push-11{left:45.83333333%}.ant-col-md-pull-11{right:45.83333333%}.ant-col-md-offset-11{margin-left:45.83333333%}.ant-col-md-order-11{order:11}.ant-col-md-10{display:block;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-md-push-10{left:41.66666667%}.ant-col-md-pull-10{right:41.66666667%}.ant-col-md-offset-10{margin-left:41.66666667%}.ant-col-md-order-10{order:10}.ant-col-md-9{display:block;flex:0 0 37.5%;max-width:37.5%}.ant-col-md-push-9{left:37.5%}.ant-col-md-pull-9{right:37.5%}.ant-col-md-offset-9{margin-left:37.5%}.ant-col-md-order-9{order:9}.ant-col-md-8{display:block;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-md-push-8{left:33.33333333%}.ant-col-md-pull-8{right:33.33333333%}.ant-col-md-offset-8{margin-left:33.33333333%}.ant-col-md-order-8{order:8}.ant-col-md-7{display:block;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-md-push-7{left:29.16666667%}.ant-col-md-pull-7{right:29.16666667%}.ant-col-md-offset-7{margin-left:29.16666667%}.ant-col-md-order-7{order:7}.ant-col-md-6{display:block;flex:0 0 25%;max-width:25%}.ant-col-md-push-6{left:25%}.ant-col-md-pull-6{right:25%}.ant-col-md-offset-6{margin-left:25%}.ant-col-md-order-6{order:6}.ant-col-md-5{display:block;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-md-push-5{left:20.83333333%}.ant-col-md-pull-5{right:20.83333333%}.ant-col-md-offset-5{margin-left:20.83333333%}.ant-col-md-order-5{order:5}.ant-col-md-4{display:block;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-md-push-4{left:16.66666667%}.ant-col-md-pull-4{right:16.66666667%}.ant-col-md-offset-4{margin-left:16.66666667%}.ant-col-md-order-4{order:4}.ant-col-md-3{display:block;flex:0 0 12.5%;max-width:12.5%}.ant-col-md-push-3{left:12.5%}.ant-col-md-pull-3{right:12.5%}.ant-col-md-offset-3{margin-left:12.5%}.ant-col-md-order-3{order:3}.ant-col-md-2{display:block;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-md-push-2{left:8.33333333%}.ant-col-md-pull-2{right:8.33333333%}.ant-col-md-offset-2{margin-left:8.33333333%}.ant-col-md-order-2{order:2}.ant-col-md-1{display:block;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-md-push-1{left:4.16666667%}.ant-col-md-pull-1{right:4.16666667%}.ant-col-md-offset-1{margin-left:4.16666667%}.ant-col-md-order-1{order:1}.ant-col-md-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-md-push-0{left:auto}.ant-col-md-pull-0{right:auto}.ant-col-md-offset-0{margin-left:0}.ant-col-md-order-0{order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-md-push-0.ant-col-rtl{right:auto}.ant-col-md-pull-0.ant-col-rtl{left:auto}.ant-col-md-offset-0.ant-col-rtl{margin-right:0}.ant-col-md-push-1.ant-col-rtl{right:4.16666667%;left:auto}.ant-col-md-pull-1.ant-col-rtl{right:auto;left:4.16666667%}.ant-col-md-offset-1.ant-col-rtl{margin-right:4.16666667%;margin-left:0}.ant-col-md-push-2.ant-col-rtl{right:8.33333333%;left:auto}.ant-col-md-pull-2.ant-col-rtl{right:auto;left:8.33333333%}.ant-col-md-offset-2.ant-col-rtl{margin-right:8.33333333%;margin-left:0}.ant-col-md-push-3.ant-col-rtl{right:12.5%;left:auto}.ant-col-md-pull-3.ant-col-rtl{right:auto;left:12.5%}.ant-col-md-offset-3.ant-col-rtl{margin-right:12.5%;margin-left:0}.ant-col-md-push-4.ant-col-rtl{right:16.66666667%;left:auto}.ant-col-md-pull-4.ant-col-rtl{right:auto;left:16.66666667%}.ant-col-md-offset-4.ant-col-rtl{margin-right:16.66666667%;margin-left:0}.ant-col-md-push-5.ant-col-rtl{right:20.83333333%;left:auto}.ant-col-md-pull-5.ant-col-rtl{right:auto;left:20.83333333%}.ant-col-md-offset-5.ant-col-rtl{margin-right:20.83333333%;margin-left:0}.ant-col-md-push-6.ant-col-rtl{right:25%;left:auto}.ant-col-md-pull-6.ant-col-rtl{right:auto;left:25%}.ant-col-md-offset-6.ant-col-rtl{margin-right:25%;margin-left:0}.ant-col-md-push-7.ant-col-rtl{right:29.16666667%;left:auto}.ant-col-md-pull-7.ant-col-rtl{right:auto;left:29.16666667%}.ant-col-md-offset-7.ant-col-rtl{margin-right:29.16666667%;margin-left:0}.ant-col-md-push-8.ant-col-rtl{right:33.33333333%;left:auto}.ant-col-md-pull-8.ant-col-rtl{right:auto;left:33.33333333%}.ant-col-md-offset-8.ant-col-rtl{margin-right:33.33333333%;margin-left:0}.ant-col-md-push-9.ant-col-rtl{right:37.5%;left:auto}.ant-col-md-pull-9.ant-col-rtl{right:auto;left:37.5%}.ant-col-md-offset-9.ant-col-rtl{margin-right:37.5%;margin-left:0}.ant-col-md-push-10.ant-col-rtl{right:41.66666667%;left:auto}.ant-col-md-pull-10.ant-col-rtl{right:auto;left:41.66666667%}.ant-col-md-offset-10.ant-col-rtl{margin-right:41.66666667%;margin-left:0}.ant-col-md-push-11.ant-col-rtl{right:45.83333333%;left:auto}.ant-col-md-pull-11.ant-col-rtl{right:auto;left:45.83333333%}.ant-col-md-offset-11.ant-col-rtl{margin-right:45.83333333%;margin-left:0}.ant-col-md-push-12.ant-col-rtl{right:50%;left:auto}.ant-col-md-pull-12.ant-col-rtl{right:auto;left:50%}.ant-col-md-offset-12.ant-col-rtl{margin-right:50%;margin-left:0}.ant-col-md-push-13.ant-col-rtl{right:54.16666667%;left:auto}.ant-col-md-pull-13.ant-col-rtl{right:auto;left:54.16666667%}.ant-col-md-offset-13.ant-col-rtl{margin-right:54.16666667%;margin-left:0}.ant-col-md-push-14.ant-col-rtl{right:58.33333333%;left:auto}.ant-col-md-pull-14.ant-col-rtl{right:auto;left:58.33333333%}.ant-col-md-offset-14.ant-col-rtl{margin-right:58.33333333%;margin-left:0}.ant-col-md-push-15.ant-col-rtl{right:62.5%;left:auto}.ant-col-md-pull-15.ant-col-rtl{right:auto;left:62.5%}.ant-col-md-offset-15.ant-col-rtl{margin-right:62.5%;margin-left:0}.ant-col-md-push-16.ant-col-rtl{right:66.66666667%;left:auto}.ant-col-md-pull-16.ant-col-rtl{right:auto;left:66.66666667%}.ant-col-md-offset-16.ant-col-rtl{margin-right:66.66666667%;margin-left:0}.ant-col-md-push-17.ant-col-rtl{right:70.83333333%;left:auto}.ant-col-md-pull-17.ant-col-rtl{right:auto;left:70.83333333%}.ant-col-md-offset-17.ant-col-rtl{margin-right:70.83333333%;margin-left:0}.ant-col-md-push-18.ant-col-rtl{right:75%;left:auto}.ant-col-md-pull-18.ant-col-rtl{right:auto;left:75%}.ant-col-md-offset-18.ant-col-rtl{margin-right:75%;margin-left:0}.ant-col-md-push-19.ant-col-rtl{right:79.16666667%;left:auto}.ant-col-md-pull-19.ant-col-rtl{right:auto;left:79.16666667%}.ant-col-md-offset-19.ant-col-rtl{margin-right:79.16666667%;margin-left:0}.ant-col-md-push-20.ant-col-rtl{right:83.33333333%;left:auto}.ant-col-md-pull-20.ant-col-rtl{right:auto;left:83.33333333%}.ant-col-md-offset-20.ant-col-rtl{margin-right:83.33333333%;margin-left:0}.ant-col-md-push-21.ant-col-rtl{right:87.5%;left:auto}.ant-col-md-pull-21.ant-col-rtl{right:auto;left:87.5%}.ant-col-md-offset-21.ant-col-rtl{margin-right:87.5%;margin-left:0}.ant-col-md-push-22.ant-col-rtl{right:91.66666667%;left:auto}.ant-col-md-pull-22.ant-col-rtl{right:auto;left:91.66666667%}.ant-col-md-offset-22.ant-col-rtl{margin-right:91.66666667%;margin-left:0}.ant-col-md-push-23.ant-col-rtl{right:95.83333333%;left:auto}.ant-col-md-pull-23.ant-col-rtl{right:auto;left:95.83333333%}.ant-col-md-offset-23.ant-col-rtl{margin-right:95.83333333%;margin-left:0}.ant-col-md-push-24.ant-col-rtl{right:100%;left:auto}.ant-col-md-pull-24.ant-col-rtl{right:auto;left:100%}.ant-col-md-offset-24.ant-col-rtl{margin-right:100%;margin-left:0}}@media (min-width:992px){.ant-col-lg-24{display:block;flex:0 0 100%;max-width:100%}.ant-col-lg-push-24{left:100%}.ant-col-lg-pull-24{right:100%}.ant-col-lg-offset-24{margin-left:100%}.ant-col-lg-order-24{order:24}.ant-col-lg-23{display:block;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-lg-push-23{left:95.83333333%}.ant-col-lg-pull-23{right:95.83333333%}.ant-col-lg-offset-23{margin-left:95.83333333%}.ant-col-lg-order-23{order:23}.ant-col-lg-22{display:block;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-lg-push-22{left:91.66666667%}.ant-col-lg-pull-22{right:91.66666667%}.ant-col-lg-offset-22{margin-left:91.66666667%}.ant-col-lg-order-22{order:22}.ant-col-lg-21{display:block;flex:0 0 87.5%;max-width:87.5%}.ant-col-lg-push-21{left:87.5%}.ant-col-lg-pull-21{right:87.5%}.ant-col-lg-offset-21{margin-left:87.5%}.ant-col-lg-order-21{order:21}.ant-col-lg-20{display:block;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-lg-push-20{left:83.33333333%}.ant-col-lg-pull-20{right:83.33333333%}.ant-col-lg-offset-20{margin-left:83.33333333%}.ant-col-lg-order-20{order:20}.ant-col-lg-19{display:block;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-lg-push-19{left:79.16666667%}.ant-col-lg-pull-19{right:79.16666667%}.ant-col-lg-offset-19{margin-left:79.16666667%}.ant-col-lg-order-19{order:19}.ant-col-lg-18{display:block;flex:0 0 75%;max-width:75%}.ant-col-lg-push-18{left:75%}.ant-col-lg-pull-18{right:75%}.ant-col-lg-offset-18{margin-left:75%}.ant-col-lg-order-18{order:18}.ant-col-lg-17{display:block;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-lg-push-17{left:70.83333333%}.ant-col-lg-pull-17{right:70.83333333%}.ant-col-lg-offset-17{margin-left:70.83333333%}.ant-col-lg-order-17{order:17}.ant-col-lg-16{display:block;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-lg-push-16{left:66.66666667%}.ant-col-lg-pull-16{right:66.66666667%}.ant-col-lg-offset-16{margin-left:66.66666667%}.ant-col-lg-order-16{order:16}.ant-col-lg-15{display:block;flex:0 0 62.5%;max-width:62.5%}.ant-col-lg-push-15{left:62.5%}.ant-col-lg-pull-15{right:62.5%}.ant-col-lg-offset-15{margin-left:62.5%}.ant-col-lg-order-15{order:15}.ant-col-lg-14{display:block;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-lg-push-14{left:58.33333333%}.ant-col-lg-pull-14{right:58.33333333%}.ant-col-lg-offset-14{margin-left:58.33333333%}.ant-col-lg-order-14{order:14}.ant-col-lg-13{display:block;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-lg-push-13{left:54.16666667%}.ant-col-lg-pull-13{right:54.16666667%}.ant-col-lg-offset-13{margin-left:54.16666667%}.ant-col-lg-order-13{order:13}.ant-col-lg-12{display:block;flex:0 0 50%;max-width:50%}.ant-col-lg-push-12{left:50%}.ant-col-lg-pull-12{right:50%}.ant-col-lg-offset-12{margin-left:50%}.ant-col-lg-order-12{order:12}.ant-col-lg-11{display:block;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-lg-push-11{left:45.83333333%}.ant-col-lg-pull-11{right:45.83333333%}.ant-col-lg-offset-11{margin-left:45.83333333%}.ant-col-lg-order-11{order:11}.ant-col-lg-10{display:block;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-lg-push-10{left:41.66666667%}.ant-col-lg-pull-10{right:41.66666667%}.ant-col-lg-offset-10{margin-left:41.66666667%}.ant-col-lg-order-10{order:10}.ant-col-lg-9{display:block;flex:0 0 37.5%;max-width:37.5%}.ant-col-lg-push-9{left:37.5%}.ant-col-lg-pull-9{right:37.5%}.ant-col-lg-offset-9{margin-left:37.5%}.ant-col-lg-order-9{order:9}.ant-col-lg-8{display:block;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-lg-push-8{left:33.33333333%}.ant-col-lg-pull-8{right:33.33333333%}.ant-col-lg-offset-8{margin-left:33.33333333%}.ant-col-lg-order-8{order:8}.ant-col-lg-7{display:block;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-lg-push-7{left:29.16666667%}.ant-col-lg-pull-7{right:29.16666667%}.ant-col-lg-offset-7{margin-left:29.16666667%}.ant-col-lg-order-7{order:7}.ant-col-lg-6{display:block;flex:0 0 25%;max-width:25%}.ant-col-lg-push-6{left:25%}.ant-col-lg-pull-6{right:25%}.ant-col-lg-offset-6{margin-left:25%}.ant-col-lg-order-6{order:6}.ant-col-lg-5{display:block;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-lg-push-5{left:20.83333333%}.ant-col-lg-pull-5{right:20.83333333%}.ant-col-lg-offset-5{margin-left:20.83333333%}.ant-col-lg-order-5{order:5}.ant-col-lg-4{display:block;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-lg-push-4{left:16.66666667%}.ant-col-lg-pull-4{right:16.66666667%}.ant-col-lg-offset-4{margin-left:16.66666667%}.ant-col-lg-order-4{order:4}.ant-col-lg-3{display:block;flex:0 0 12.5%;max-width:12.5%}.ant-col-lg-push-3{left:12.5%}.ant-col-lg-pull-3{right:12.5%}.ant-col-lg-offset-3{margin-left:12.5%}.ant-col-lg-order-3{order:3}.ant-col-lg-2{display:block;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-lg-push-2{left:8.33333333%}.ant-col-lg-pull-2{right:8.33333333%}.ant-col-lg-offset-2{margin-left:8.33333333%}.ant-col-lg-order-2{order:2}.ant-col-lg-1{display:block;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-lg-push-1{left:4.16666667%}.ant-col-lg-pull-1{right:4.16666667%}.ant-col-lg-offset-1{margin-left:4.16666667%}.ant-col-lg-order-1{order:1}.ant-col-lg-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-lg-push-0{left:auto}.ant-col-lg-pull-0{right:auto}.ant-col-lg-offset-0{margin-left:0}.ant-col-lg-order-0{order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-lg-push-0.ant-col-rtl{right:auto}.ant-col-lg-pull-0.ant-col-rtl{left:auto}.ant-col-lg-offset-0.ant-col-rtl{margin-right:0}.ant-col-lg-push-1.ant-col-rtl{right:4.16666667%;left:auto}.ant-col-lg-pull-1.ant-col-rtl{right:auto;left:4.16666667%}.ant-col-lg-offset-1.ant-col-rtl{margin-right:4.16666667%;margin-left:0}.ant-col-lg-push-2.ant-col-rtl{right:8.33333333%;left:auto}.ant-col-lg-pull-2.ant-col-rtl{right:auto;left:8.33333333%}.ant-col-lg-offset-2.ant-col-rtl{margin-right:8.33333333%;margin-left:0}.ant-col-lg-push-3.ant-col-rtl{right:12.5%;left:auto}.ant-col-lg-pull-3.ant-col-rtl{right:auto;left:12.5%}.ant-col-lg-offset-3.ant-col-rtl{margin-right:12.5%;margin-left:0}.ant-col-lg-push-4.ant-col-rtl{right:16.66666667%;left:auto}.ant-col-lg-pull-4.ant-col-rtl{right:auto;left:16.66666667%}.ant-col-lg-offset-4.ant-col-rtl{margin-right:16.66666667%;margin-left:0}.ant-col-lg-push-5.ant-col-rtl{right:20.83333333%;left:auto}.ant-col-lg-pull-5.ant-col-rtl{right:auto;left:20.83333333%}.ant-col-lg-offset-5.ant-col-rtl{margin-right:20.83333333%;margin-left:0}.ant-col-lg-push-6.ant-col-rtl{right:25%;left:auto}.ant-col-lg-pull-6.ant-col-rtl{right:auto;left:25%}.ant-col-lg-offset-6.ant-col-rtl{margin-right:25%;margin-left:0}.ant-col-lg-push-7.ant-col-rtl{right:29.16666667%;left:auto}.ant-col-lg-pull-7.ant-col-rtl{right:auto;left:29.16666667%}.ant-col-lg-offset-7.ant-col-rtl{margin-right:29.16666667%;margin-left:0}.ant-col-lg-push-8.ant-col-rtl{right:33.33333333%;left:auto}.ant-col-lg-pull-8.ant-col-rtl{right:auto;left:33.33333333%}.ant-col-lg-offset-8.ant-col-rtl{margin-right:33.33333333%;margin-left:0}.ant-col-lg-push-9.ant-col-rtl{right:37.5%;left:auto}.ant-col-lg-pull-9.ant-col-rtl{right:auto;left:37.5%}.ant-col-lg-offset-9.ant-col-rtl{margin-right:37.5%;margin-left:0}.ant-col-lg-push-10.ant-col-rtl{right:41.66666667%;left:auto}.ant-col-lg-pull-10.ant-col-rtl{right:auto;left:41.66666667%}.ant-col-lg-offset-10.ant-col-rtl{margin-right:41.66666667%;margin-left:0}.ant-col-lg-push-11.ant-col-rtl{right:45.83333333%;left:auto}.ant-col-lg-pull-11.ant-col-rtl{right:auto;left:45.83333333%}.ant-col-lg-offset-11.ant-col-rtl{margin-right:45.83333333%;margin-left:0}.ant-col-lg-push-12.ant-col-rtl{right:50%;left:auto}.ant-col-lg-pull-12.ant-col-rtl{right:auto;left:50%}.ant-col-lg-offset-12.ant-col-rtl{margin-right:50%;margin-left:0}.ant-col-lg-push-13.ant-col-rtl{right:54.16666667%;left:auto}.ant-col-lg-pull-13.ant-col-rtl{right:auto;left:54.16666667%}.ant-col-lg-offset-13.ant-col-rtl{margin-right:54.16666667%;margin-left:0}.ant-col-lg-push-14.ant-col-rtl{right:58.33333333%;left:auto}.ant-col-lg-pull-14.ant-col-rtl{right:auto;left:58.33333333%}.ant-col-lg-offset-14.ant-col-rtl{margin-right:58.33333333%;margin-left:0}.ant-col-lg-push-15.ant-col-rtl{right:62.5%;left:auto}.ant-col-lg-pull-15.ant-col-rtl{right:auto;left:62.5%}.ant-col-lg-offset-15.ant-col-rtl{margin-right:62.5%;margin-left:0}.ant-col-lg-push-16.ant-col-rtl{right:66.66666667%;left:auto}.ant-col-lg-pull-16.ant-col-rtl{right:auto;left:66.66666667%}.ant-col-lg-offset-16.ant-col-rtl{margin-right:66.66666667%;margin-left:0}.ant-col-lg-push-17.ant-col-rtl{right:70.83333333%;left:auto}.ant-col-lg-pull-17.ant-col-rtl{right:auto;left:70.83333333%}.ant-col-lg-offset-17.ant-col-rtl{margin-right:70.83333333%;margin-left:0}.ant-col-lg-push-18.ant-col-rtl{right:75%;left:auto}.ant-col-lg-pull-18.ant-col-rtl{right:auto;left:75%}.ant-col-lg-offset-18.ant-col-rtl{margin-right:75%;margin-left:0}.ant-col-lg-push-19.ant-col-rtl{right:79.16666667%;left:auto}.ant-col-lg-pull-19.ant-col-rtl{right:auto;left:79.16666667%}.ant-col-lg-offset-19.ant-col-rtl{margin-right:79.16666667%;margin-left:0}.ant-col-lg-push-20.ant-col-rtl{right:83.33333333%;left:auto}.ant-col-lg-pull-20.ant-col-rtl{right:auto;left:83.33333333%}.ant-col-lg-offset-20.ant-col-rtl{margin-right:83.33333333%;margin-left:0}.ant-col-lg-push-21.ant-col-rtl{right:87.5%;left:auto}.ant-col-lg-pull-21.ant-col-rtl{right:auto;left:87.5%}.ant-col-lg-offset-21.ant-col-rtl{margin-right:87.5%;margin-left:0}.ant-col-lg-push-22.ant-col-rtl{right:91.66666667%;left:auto}.ant-col-lg-pull-22.ant-col-rtl{right:auto;left:91.66666667%}.ant-col-lg-offset-22.ant-col-rtl{margin-right:91.66666667%;margin-left:0}.ant-col-lg-push-23.ant-col-rtl{right:95.83333333%;left:auto}.ant-col-lg-pull-23.ant-col-rtl{right:auto;left:95.83333333%}.ant-col-lg-offset-23.ant-col-rtl{margin-right:95.83333333%;margin-left:0}.ant-col-lg-push-24.ant-col-rtl{right:100%;left:auto}.ant-col-lg-pull-24.ant-col-rtl{right:auto;left:100%}.ant-col-lg-offset-24.ant-col-rtl{margin-right:100%;margin-left:0}}@media (min-width:1200px){.ant-col-xl-24{display:block;flex:0 0 100%;max-width:100%}.ant-col-xl-push-24{left:100%}.ant-col-xl-pull-24{right:100%}.ant-col-xl-offset-24{margin-left:100%}.ant-col-xl-order-24{order:24}.ant-col-xl-23{display:block;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-xl-push-23{left:95.83333333%}.ant-col-xl-pull-23{right:95.83333333%}.ant-col-xl-offset-23{margin-left:95.83333333%}.ant-col-xl-order-23{order:23}.ant-col-xl-22{display:block;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-xl-push-22{left:91.66666667%}.ant-col-xl-pull-22{right:91.66666667%}.ant-col-xl-offset-22{margin-left:91.66666667%}.ant-col-xl-order-22{order:22}.ant-col-xl-21{display:block;flex:0 0 87.5%;max-width:87.5%}.ant-col-xl-push-21{left:87.5%}.ant-col-xl-pull-21{right:87.5%}.ant-col-xl-offset-21{margin-left:87.5%}.ant-col-xl-order-21{order:21}.ant-col-xl-20{display:block;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-xl-push-20{left:83.33333333%}.ant-col-xl-pull-20{right:83.33333333%}.ant-col-xl-offset-20{margin-left:83.33333333%}.ant-col-xl-order-20{order:20}.ant-col-xl-19{display:block;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-xl-push-19{left:79.16666667%}.ant-col-xl-pull-19{right:79.16666667%}.ant-col-xl-offset-19{margin-left:79.16666667%}.ant-col-xl-order-19{order:19}.ant-col-xl-18{display:block;flex:0 0 75%;max-width:75%}.ant-col-xl-push-18{left:75%}.ant-col-xl-pull-18{right:75%}.ant-col-xl-offset-18{margin-left:75%}.ant-col-xl-order-18{order:18}.ant-col-xl-17{display:block;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-xl-push-17{left:70.83333333%}.ant-col-xl-pull-17{right:70.83333333%}.ant-col-xl-offset-17{margin-left:70.83333333%}.ant-col-xl-order-17{order:17}.ant-col-xl-16{display:block;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-xl-push-16{left:66.66666667%}.ant-col-xl-pull-16{right:66.66666667%}.ant-col-xl-offset-16{margin-left:66.66666667%}.ant-col-xl-order-16{order:16}.ant-col-xl-15{display:block;flex:0 0 62.5%;max-width:62.5%}.ant-col-xl-push-15{left:62.5%}.ant-col-xl-pull-15{right:62.5%}.ant-col-xl-offset-15{margin-left:62.5%}.ant-col-xl-order-15{order:15}.ant-col-xl-14{display:block;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-xl-push-14{left:58.33333333%}.ant-col-xl-pull-14{right:58.33333333%}.ant-col-xl-offset-14{margin-left:58.33333333%}.ant-col-xl-order-14{order:14}.ant-col-xl-13{display:block;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-xl-push-13{left:54.16666667%}.ant-col-xl-pull-13{right:54.16666667%}.ant-col-xl-offset-13{margin-left:54.16666667%}.ant-col-xl-order-13{order:13}.ant-col-xl-12{display:block;flex:0 0 50%;max-width:50%}.ant-col-xl-push-12{left:50%}.ant-col-xl-pull-12{right:50%}.ant-col-xl-offset-12{margin-left:50%}.ant-col-xl-order-12{order:12}.ant-col-xl-11{display:block;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-xl-push-11{left:45.83333333%}.ant-col-xl-pull-11{right:45.83333333%}.ant-col-xl-offset-11{margin-left:45.83333333%}.ant-col-xl-order-11{order:11}.ant-col-xl-10{display:block;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-xl-push-10{left:41.66666667%}.ant-col-xl-pull-10{right:41.66666667%}.ant-col-xl-offset-10{margin-left:41.66666667%}.ant-col-xl-order-10{order:10}.ant-col-xl-9{display:block;flex:0 0 37.5%;max-width:37.5%}.ant-col-xl-push-9{left:37.5%}.ant-col-xl-pull-9{right:37.5%}.ant-col-xl-offset-9{margin-left:37.5%}.ant-col-xl-order-9{order:9}.ant-col-xl-8{display:block;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-xl-push-8{left:33.33333333%}.ant-col-xl-pull-8{right:33.33333333%}.ant-col-xl-offset-8{margin-left:33.33333333%}.ant-col-xl-order-8{order:8}.ant-col-xl-7{display:block;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-xl-push-7{left:29.16666667%}.ant-col-xl-pull-7{right:29.16666667%}.ant-col-xl-offset-7{margin-left:29.16666667%}.ant-col-xl-order-7{order:7}.ant-col-xl-6{display:block;flex:0 0 25%;max-width:25%}.ant-col-xl-push-6{left:25%}.ant-col-xl-pull-6{right:25%}.ant-col-xl-offset-6{margin-left:25%}.ant-col-xl-order-6{order:6}.ant-col-xl-5{display:block;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-xl-push-5{left:20.83333333%}.ant-col-xl-pull-5{right:20.83333333%}.ant-col-xl-offset-5{margin-left:20.83333333%}.ant-col-xl-order-5{order:5}.ant-col-xl-4{display:block;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-xl-push-4{left:16.66666667%}.ant-col-xl-pull-4{right:16.66666667%}.ant-col-xl-offset-4{margin-left:16.66666667%}.ant-col-xl-order-4{order:4}.ant-col-xl-3{display:block;flex:0 0 12.5%;max-width:12.5%}.ant-col-xl-push-3{left:12.5%}.ant-col-xl-pull-3{right:12.5%}.ant-col-xl-offset-3{margin-left:12.5%}.ant-col-xl-order-3{order:3}.ant-col-xl-2{display:block;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-xl-push-2{left:8.33333333%}.ant-col-xl-pull-2{right:8.33333333%}.ant-col-xl-offset-2{margin-left:8.33333333%}.ant-col-xl-order-2{order:2}.ant-col-xl-1{display:block;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-xl-push-1{left:4.16666667%}.ant-col-xl-pull-1{right:4.16666667%}.ant-col-xl-offset-1{margin-left:4.16666667%}.ant-col-xl-order-1{order:1}.ant-col-xl-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-xl-push-0{left:auto}.ant-col-xl-pull-0{right:auto}.ant-col-xl-offset-0{margin-left:0}.ant-col-xl-order-0{order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-xl-push-0.ant-col-rtl{right:auto}.ant-col-xl-pull-0.ant-col-rtl{left:auto}.ant-col-xl-offset-0.ant-col-rtl{margin-right:0}.ant-col-xl-push-1.ant-col-rtl{right:4.16666667%;left:auto}.ant-col-xl-pull-1.ant-col-rtl{right:auto;left:4.16666667%}.ant-col-xl-offset-1.ant-col-rtl{margin-right:4.16666667%;margin-left:0}.ant-col-xl-push-2.ant-col-rtl{right:8.33333333%;left:auto}.ant-col-xl-pull-2.ant-col-rtl{right:auto;left:8.33333333%}.ant-col-xl-offset-2.ant-col-rtl{margin-right:8.33333333%;margin-left:0}.ant-col-xl-push-3.ant-col-rtl{right:12.5%;left:auto}.ant-col-xl-pull-3.ant-col-rtl{right:auto;left:12.5%}.ant-col-xl-offset-3.ant-col-rtl{margin-right:12.5%;margin-left:0}.ant-col-xl-push-4.ant-col-rtl{right:16.66666667%;left:auto}.ant-col-xl-pull-4.ant-col-rtl{right:auto;left:16.66666667%}.ant-col-xl-offset-4.ant-col-rtl{margin-right:16.66666667%;margin-left:0}.ant-col-xl-push-5.ant-col-rtl{right:20.83333333%;left:auto}.ant-col-xl-pull-5.ant-col-rtl{right:auto;left:20.83333333%}.ant-col-xl-offset-5.ant-col-rtl{margin-right:20.83333333%;margin-left:0}.ant-col-xl-push-6.ant-col-rtl{right:25%;left:auto}.ant-col-xl-pull-6.ant-col-rtl{right:auto;left:25%}.ant-col-xl-offset-6.ant-col-rtl{margin-right:25%;margin-left:0}.ant-col-xl-push-7.ant-col-rtl{right:29.16666667%;left:auto}.ant-col-xl-pull-7.ant-col-rtl{right:auto;left:29.16666667%}.ant-col-xl-offset-7.ant-col-rtl{margin-right:29.16666667%;margin-left:0}.ant-col-xl-push-8.ant-col-rtl{right:33.33333333%;left:auto}.ant-col-xl-pull-8.ant-col-rtl{right:auto;left:33.33333333%}.ant-col-xl-offset-8.ant-col-rtl{margin-right:33.33333333%;margin-left:0}.ant-col-xl-push-9.ant-col-rtl{right:37.5%;left:auto}.ant-col-xl-pull-9.ant-col-rtl{right:auto;left:37.5%}.ant-col-xl-offset-9.ant-col-rtl{margin-right:37.5%;margin-left:0}.ant-col-xl-push-10.ant-col-rtl{right:41.66666667%;left:auto}.ant-col-xl-pull-10.ant-col-rtl{right:auto;left:41.66666667%}.ant-col-xl-offset-10.ant-col-rtl{margin-right:41.66666667%;margin-left:0}.ant-col-xl-push-11.ant-col-rtl{right:45.83333333%;left:auto}.ant-col-xl-pull-11.ant-col-rtl{right:auto;left:45.83333333%}.ant-col-xl-offset-11.ant-col-rtl{margin-right:45.83333333%;margin-left:0}.ant-col-xl-push-12.ant-col-rtl{right:50%;left:auto}.ant-col-xl-pull-12.ant-col-rtl{right:auto;left:50%}.ant-col-xl-offset-12.ant-col-rtl{margin-right:50%;margin-left:0}.ant-col-xl-push-13.ant-col-rtl{right:54.16666667%;left:auto}.ant-col-xl-pull-13.ant-col-rtl{right:auto;left:54.16666667%}.ant-col-xl-offset-13.ant-col-rtl{margin-right:54.16666667%;margin-left:0}.ant-col-xl-push-14.ant-col-rtl{right:58.33333333%;left:auto}.ant-col-xl-pull-14.ant-col-rtl{right:auto;left:58.33333333%}.ant-col-xl-offset-14.ant-col-rtl{margin-right:58.33333333%;margin-left:0}.ant-col-xl-push-15.ant-col-rtl{right:62.5%;left:auto}.ant-col-xl-pull-15.ant-col-rtl{right:auto;left:62.5%}.ant-col-xl-offset-15.ant-col-rtl{margin-right:62.5%;margin-left:0}.ant-col-xl-push-16.ant-col-rtl{right:66.66666667%;left:auto}.ant-col-xl-pull-16.ant-col-rtl{right:auto;left:66.66666667%}.ant-col-xl-offset-16.ant-col-rtl{margin-right:66.66666667%;margin-left:0}.ant-col-xl-push-17.ant-col-rtl{right:70.83333333%;left:auto}.ant-col-xl-pull-17.ant-col-rtl{right:auto;left:70.83333333%}.ant-col-xl-offset-17.ant-col-rtl{margin-right:70.83333333%;margin-left:0}.ant-col-xl-push-18.ant-col-rtl{right:75%;left:auto}.ant-col-xl-pull-18.ant-col-rtl{right:auto;left:75%}.ant-col-xl-offset-18.ant-col-rtl{margin-right:75%;margin-left:0}.ant-col-xl-push-19.ant-col-rtl{right:79.16666667%;left:auto}.ant-col-xl-pull-19.ant-col-rtl{right:auto;left:79.16666667%}.ant-col-xl-offset-19.ant-col-rtl{margin-right:79.16666667%;margin-left:0}.ant-col-xl-push-20.ant-col-rtl{right:83.33333333%;left:auto}.ant-col-xl-pull-20.ant-col-rtl{right:auto;left:83.33333333%}.ant-col-xl-offset-20.ant-col-rtl{margin-right:83.33333333%;margin-left:0}.ant-col-xl-push-21.ant-col-rtl{right:87.5%;left:auto}.ant-col-xl-pull-21.ant-col-rtl{right:auto;left:87.5%}.ant-col-xl-offset-21.ant-col-rtl{margin-right:87.5%;margin-left:0}.ant-col-xl-push-22.ant-col-rtl{right:91.66666667%;left:auto}.ant-col-xl-pull-22.ant-col-rtl{right:auto;left:91.66666667%}.ant-col-xl-offset-22.ant-col-rtl{margin-right:91.66666667%;margin-left:0}.ant-col-xl-push-23.ant-col-rtl{right:95.83333333%;left:auto}.ant-col-xl-pull-23.ant-col-rtl{right:auto;left:95.83333333%}.ant-col-xl-offset-23.ant-col-rtl{margin-right:95.83333333%;margin-left:0}.ant-col-xl-push-24.ant-col-rtl{right:100%;left:auto}.ant-col-xl-pull-24.ant-col-rtl{right:auto;left:100%}.ant-col-xl-offset-24.ant-col-rtl{margin-right:100%;margin-left:0}}@media (min-width:1600px){.ant-col-xxl-24{display:block;flex:0 0 100%;max-width:100%}.ant-col-xxl-push-24{left:100%}.ant-col-xxl-pull-24{right:100%}.ant-col-xxl-offset-24{margin-left:100%}.ant-col-xxl-order-24{order:24}.ant-col-xxl-23{display:block;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-xxl-push-23{left:95.83333333%}.ant-col-xxl-pull-23{right:95.83333333%}.ant-col-xxl-offset-23{margin-left:95.83333333%}.ant-col-xxl-order-23{order:23}.ant-col-xxl-22{display:block;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-xxl-push-22{left:91.66666667%}.ant-col-xxl-pull-22{right:91.66666667%}.ant-col-xxl-offset-22{margin-left:91.66666667%}.ant-col-xxl-order-22{order:22}.ant-col-xxl-21{display:block;flex:0 0 87.5%;max-width:87.5%}.ant-col-xxl-push-21{left:87.5%}.ant-col-xxl-pull-21{right:87.5%}.ant-col-xxl-offset-21{margin-left:87.5%}.ant-col-xxl-order-21{order:21}.ant-col-xxl-20{display:block;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-xxl-push-20{left:83.33333333%}.ant-col-xxl-pull-20{right:83.33333333%}.ant-col-xxl-offset-20{margin-left:83.33333333%}.ant-col-xxl-order-20{order:20}.ant-col-xxl-19{display:block;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-xxl-push-19{left:79.16666667%}.ant-col-xxl-pull-19{right:79.16666667%}.ant-col-xxl-offset-19{margin-left:79.16666667%}.ant-col-xxl-order-19{order:19}.ant-col-xxl-18{display:block;flex:0 0 75%;max-width:75%}.ant-col-xxl-push-18{left:75%}.ant-col-xxl-pull-18{right:75%}.ant-col-xxl-offset-18{margin-left:75%}.ant-col-xxl-order-18{order:18}.ant-col-xxl-17{display:block;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-xxl-push-17{left:70.83333333%}.ant-col-xxl-pull-17{right:70.83333333%}.ant-col-xxl-offset-17{margin-left:70.83333333%}.ant-col-xxl-order-17{order:17}.ant-col-xxl-16{display:block;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-xxl-push-16{left:66.66666667%}.ant-col-xxl-pull-16{right:66.66666667%}.ant-col-xxl-offset-16{margin-left:66.66666667%}.ant-col-xxl-order-16{order:16}.ant-col-xxl-15{display:block;flex:0 0 62.5%;max-width:62.5%}.ant-col-xxl-push-15{left:62.5%}.ant-col-xxl-pull-15{right:62.5%}.ant-col-xxl-offset-15{margin-left:62.5%}.ant-col-xxl-order-15{order:15}.ant-col-xxl-14{display:block;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-xxl-push-14{left:58.33333333%}.ant-col-xxl-pull-14{right:58.33333333%}.ant-col-xxl-offset-14{margin-left:58.33333333%}.ant-col-xxl-order-14{order:14}.ant-col-xxl-13{display:block;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-xxl-push-13{left:54.16666667%}.ant-col-xxl-pull-13{right:54.16666667%}.ant-col-xxl-offset-13{margin-left:54.16666667%}.ant-col-xxl-order-13{order:13}.ant-col-xxl-12{display:block;flex:0 0 50%;max-width:50%}.ant-col-xxl-push-12{left:50%}.ant-col-xxl-pull-12{right:50%}.ant-col-xxl-offset-12{margin-left:50%}.ant-col-xxl-order-12{order:12}.ant-col-xxl-11{display:block;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-xxl-push-11{left:45.83333333%}.ant-col-xxl-pull-11{right:45.83333333%}.ant-col-xxl-offset-11{margin-left:45.83333333%}.ant-col-xxl-order-11{order:11}.ant-col-xxl-10{display:block;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-xxl-push-10{left:41.66666667%}.ant-col-xxl-pull-10{right:41.66666667%}.ant-col-xxl-offset-10{margin-left:41.66666667%}.ant-col-xxl-order-10{order:10}.ant-col-xxl-9{display:block;flex:0 0 37.5%;max-width:37.5%}.ant-col-xxl-push-9{left:37.5%}.ant-col-xxl-pull-9{right:37.5%}.ant-col-xxl-offset-9{margin-left:37.5%}.ant-col-xxl-order-9{order:9}.ant-col-xxl-8{display:block;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-xxl-push-8{left:33.33333333%}.ant-col-xxl-pull-8{right:33.33333333%}.ant-col-xxl-offset-8{margin-left:33.33333333%}.ant-col-xxl-order-8{order:8}.ant-col-xxl-7{display:block;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-xxl-push-7{left:29.16666667%}.ant-col-xxl-pull-7{right:29.16666667%}.ant-col-xxl-offset-7{margin-left:29.16666667%}.ant-col-xxl-order-7{order:7}.ant-col-xxl-6{display:block;flex:0 0 25%;max-width:25%}.ant-col-xxl-push-6{left:25%}.ant-col-xxl-pull-6{right:25%}.ant-col-xxl-offset-6{margin-left:25%}.ant-col-xxl-order-6{order:6}.ant-col-xxl-5{display:block;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-xxl-push-5{left:20.83333333%}.ant-col-xxl-pull-5{right:20.83333333%}.ant-col-xxl-offset-5{margin-left:20.83333333%}.ant-col-xxl-order-5{order:5}.ant-col-xxl-4{display:block;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-xxl-push-4{left:16.66666667%}.ant-col-xxl-pull-4{right:16.66666667%}.ant-col-xxl-offset-4{margin-left:16.66666667%}.ant-col-xxl-order-4{order:4}.ant-col-xxl-3{display:block;flex:0 0 12.5%;max-width:12.5%}.ant-col-xxl-push-3{left:12.5%}.ant-col-xxl-pull-3{right:12.5%}.ant-col-xxl-offset-3{margin-left:12.5%}.ant-col-xxl-order-3{order:3}.ant-col-xxl-2{display:block;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-xxl-push-2{left:8.33333333%}.ant-col-xxl-pull-2{right:8.33333333%}.ant-col-xxl-offset-2{margin-left:8.33333333%}.ant-col-xxl-order-2{order:2}.ant-col-xxl-1{display:block;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-xxl-push-1{left:4.16666667%}.ant-col-xxl-pull-1{right:4.16666667%}.ant-col-xxl-offset-1{margin-left:4.16666667%}.ant-col-xxl-order-1{order:1}.ant-col-xxl-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-xxl-push-0{left:auto}.ant-col-xxl-pull-0{right:auto}.ant-col-xxl-offset-0{margin-left:0}.ant-col-xxl-order-0{order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-xxl-push-0.ant-col-rtl{right:auto}.ant-col-xxl-pull-0.ant-col-rtl{left:auto}.ant-col-xxl-offset-0.ant-col-rtl{margin-right:0}.ant-col-xxl-push-1.ant-col-rtl{right:4.16666667%;left:auto}.ant-col-xxl-pull-1.ant-col-rtl{right:auto;left:4.16666667%}.ant-col-xxl-offset-1.ant-col-rtl{margin-right:4.16666667%;margin-left:0}.ant-col-xxl-push-2.ant-col-rtl{right:8.33333333%;left:auto}.ant-col-xxl-pull-2.ant-col-rtl{right:auto;left:8.33333333%}.ant-col-xxl-offset-2.ant-col-rtl{margin-right:8.33333333%;margin-left:0}.ant-col-xxl-push-3.ant-col-rtl{right:12.5%;left:auto}.ant-col-xxl-pull-3.ant-col-rtl{right:auto;left:12.5%}.ant-col-xxl-offset-3.ant-col-rtl{margin-right:12.5%;margin-left:0}.ant-col-xxl-push-4.ant-col-rtl{right:16.66666667%;left:auto}.ant-col-xxl-pull-4.ant-col-rtl{right:auto;left:16.66666667%}.ant-col-xxl-offset-4.ant-col-rtl{margin-right:16.66666667%;margin-left:0}.ant-col-xxl-push-5.ant-col-rtl{right:20.83333333%;left:auto}.ant-col-xxl-pull-5.ant-col-rtl{right:auto;left:20.83333333%}.ant-col-xxl-offset-5.ant-col-rtl{margin-right:20.83333333%;margin-left:0}.ant-col-xxl-push-6.ant-col-rtl{right:25%;left:auto}.ant-col-xxl-pull-6.ant-col-rtl{right:auto;left:25%}.ant-col-xxl-offset-6.ant-col-rtl{margin-right:25%;margin-left:0}.ant-col-xxl-push-7.ant-col-rtl{right:29.16666667%;left:auto}.ant-col-xxl-pull-7.ant-col-rtl{right:auto;left:29.16666667%}.ant-col-xxl-offset-7.ant-col-rtl{margin-right:29.16666667%;margin-left:0}.ant-col-xxl-push-8.ant-col-rtl{right:33.33333333%;left:auto}.ant-col-xxl-pull-8.ant-col-rtl{right:auto;left:33.33333333%}.ant-col-xxl-offset-8.ant-col-rtl{margin-right:33.33333333%;margin-left:0}.ant-col-xxl-push-9.ant-col-rtl{right:37.5%;left:auto}.ant-col-xxl-pull-9.ant-col-rtl{right:auto;left:37.5%}.ant-col-xxl-offset-9.ant-col-rtl{margin-right:37.5%;margin-left:0}.ant-col-xxl-push-10.ant-col-rtl{right:41.66666667%;left:auto}.ant-col-xxl-pull-10.ant-col-rtl{right:auto;left:41.66666667%}.ant-col-xxl-offset-10.ant-col-rtl{margin-right:41.66666667%;margin-left:0}.ant-col-xxl-push-11.ant-col-rtl{right:45.83333333%;left:auto}.ant-col-xxl-pull-11.ant-col-rtl{right:auto;left:45.83333333%}.ant-col-xxl-offset-11.ant-col-rtl{margin-right:45.83333333%;margin-left:0}.ant-col-xxl-push-12.ant-col-rtl{right:50%;left:auto}.ant-col-xxl-pull-12.ant-col-rtl{right:auto;left:50%}.ant-col-xxl-offset-12.ant-col-rtl{margin-right:50%;margin-left:0}.ant-col-xxl-push-13.ant-col-rtl{right:54.16666667%;left:auto}.ant-col-xxl-pull-13.ant-col-rtl{right:auto;left:54.16666667%}.ant-col-xxl-offset-13.ant-col-rtl{margin-right:54.16666667%;margin-left:0}.ant-col-xxl-push-14.ant-col-rtl{right:58.33333333%;left:auto}.ant-col-xxl-pull-14.ant-col-rtl{right:auto;left:58.33333333%}.ant-col-xxl-offset-14.ant-col-rtl{margin-right:58.33333333%;margin-left:0}.ant-col-xxl-push-15.ant-col-rtl{right:62.5%;left:auto}.ant-col-xxl-pull-15.ant-col-rtl{right:auto;left:62.5%}.ant-col-xxl-offset-15.ant-col-rtl{margin-right:62.5%;margin-left:0}.ant-col-xxl-push-16.ant-col-rtl{right:66.66666667%;left:auto}.ant-col-xxl-pull-16.ant-col-rtl{right:auto;left:66.66666667%}.ant-col-xxl-offset-16.ant-col-rtl{margin-right:66.66666667%;margin-left:0}.ant-col-xxl-push-17.ant-col-rtl{right:70.83333333%;left:auto}.ant-col-xxl-pull-17.ant-col-rtl{right:auto;left:70.83333333%}.ant-col-xxl-offset-17.ant-col-rtl{margin-right:70.83333333%;margin-left:0}.ant-col-xxl-push-18.ant-col-rtl{right:75%;left:auto}.ant-col-xxl-pull-18.ant-col-rtl{right:auto;left:75%}.ant-col-xxl-offset-18.ant-col-rtl{margin-right:75%;margin-left:0}.ant-col-xxl-push-19.ant-col-rtl{right:79.16666667%;left:auto}.ant-col-xxl-pull-19.ant-col-rtl{right:auto;left:79.16666667%}.ant-col-xxl-offset-19.ant-col-rtl{margin-right:79.16666667%;margin-left:0}.ant-col-xxl-push-20.ant-col-rtl{right:83.33333333%;left:auto}.ant-col-xxl-pull-20.ant-col-rtl{right:auto;left:83.33333333%}.ant-col-xxl-offset-20.ant-col-rtl{margin-right:83.33333333%;margin-left:0}.ant-col-xxl-push-21.ant-col-rtl{right:87.5%;left:auto}.ant-col-xxl-pull-21.ant-col-rtl{right:auto;left:87.5%}.ant-col-xxl-offset-21.ant-col-rtl{margin-right:87.5%;margin-left:0}.ant-col-xxl-push-22.ant-col-rtl{right:91.66666667%;left:auto}.ant-col-xxl-pull-22.ant-col-rtl{right:auto;left:91.66666667%}.ant-col-xxl-offset-22.ant-col-rtl{margin-right:91.66666667%;margin-left:0}.ant-col-xxl-push-23.ant-col-rtl{right:95.83333333%;left:auto}.ant-col-xxl-pull-23.ant-col-rtl{right:auto;left:95.83333333%}.ant-col-xxl-offset-23.ant-col-rtl{margin-right:95.83333333%;margin-left:0}.ant-col-xxl-push-24.ant-col-rtl{right:100%;left:auto}.ant-col-xxl-pull-24.ant-col-rtl{right:auto;left:100%}.ant-col-xxl-offset-24.ant-col-rtl{margin-right:100%;margin-left:0}}.ant-row-rtl{direction:rtl}.ant-image{position:relative;display:inline-block}.ant-image-img{display:block;width:100%;height:auto}.ant-image-img-placeholder{background-color:#f5f5f5;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjUgMi41aC0xM0EuNS41IDAgMDAxIDN2MTBhLjUuNSAwIDAwLjUuNWgxM2EuNS41IDAgMDAuNS0uNVYzYS41LjUgMCAwMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwMTAgMiAxIDEgMCAwMTAtMnptOC4wMyA2LjgzYS4xMjcuMTI3IDAgMDEtLjA4MS4wM0gyLjc2OWEuMTI1LjEyNSAwIDAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAxLjE3Ny0uMDE2bC4wMTYuMDE2TDcuMDggMTAuMDlsMi40Ny0yLjkzYS4xMjYuMTI2IDAgMDEuMTc3LS4wMTZsLjAxNS4wMTYgMy41ODggNC4yNDRhLjEyNy4xMjcgMCAwMS0uMDIuMTc1eiIgZmlsbD0iIzhDOEM4QyIvPjwvc3ZnPg==);background-repeat:no-repeat;background-position:50%;background-size:30%}.ant-image-mask{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;color:#fff;background:rgba(0,0,0,.5);cursor:pointer;opacity:0;transition:opacity .3s}.ant-image-mask-info .anticon{-webkit-margin-end:4px;margin-inline-end:4px}.ant-image-mask:hover{opacity:1}.ant-image-placeholder{position:absolute;top:0;right:0;bottom:0;left:0}.ant-image-preview{pointer-events:none;height:100%;text-align:center}.ant-image-preview.zoom-appear,.ant-image-preview.zoom-enter{transform:none;opacity:0;animation-duration:.3s;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ant-image-preview-mask{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;height:100%;background-color:rgba(0,0,0,.45)}.ant-image-preview-mask-hidden{display:none}.ant-image-preview-wrap{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;outline:0;-webkit-overflow-scrolling:touch}.ant-image-preview-body{position:absolute;top:0;right:0;bottom:0;left:0;overflow:hidden}.ant-image-preview-img{max-width:100%;max-height:100%;vertical-align:middle;transform:scaleX(1);cursor:-webkit-grab;cursor:grab;-webkit-user-select:none;-ms-user-select:none;user-select:none;pointer-events:auto}.ant-image-preview-img,.ant-image-preview-img-wrapper{transition:transform .3s cubic-bezier(.215,.61,.355,1) 0s}.ant-image-preview-img-wrapper{position:absolute;top:0;right:0;bottom:0;left:0}.ant-image-preview-img-wrapper:before{display:inline-block;width:1px;height:50%;margin-right:-1px;content:""}.ant-image-preview-moving .ant-image-preview-img{cursor:-webkit-grabbing;cursor:grabbing}.ant-image-preview-moving .ant-image-preview-img-wrapper{transition-duration:0s}.ant-image-preview-wrap{z-index:1080}.ant-image-preview-operations{box-sizing:border-box;margin:0;padding:0;font-size:14px;font-variant:tabular-nums;line-height:1.5715;font-feature-settings:"tnum","tnum";position:absolute;top:0;right:0;z-index:1;display:flex;flex-direction:row-reverse;align-items:center;width:100%;color:hsla(0,0%,100%,.85);list-style:none;background:rgba(0,0,0,.1);pointer-events:auto}.ant-image-preview-operations-operation{margin-left:12px;padding:12px;cursor:pointer}.ant-image-preview-operations-operation-disabled{color:hsla(0,0%,100%,.25);pointer-events:none}.ant-image-preview-operations-operation:last-of-type{margin-left:0}.ant-image-preview-operations-icon{font-size:18px}.ant-image-preview-switch-left,.ant-image-preview-switch-right{position:absolute;top:50%;right:10px;z-index:1;display:flex;align-items:center;justify-content:center;width:44px;height:44px;margin-top:-22px;color:hsla(0,0%,100%,.85);background:rgba(0,0,0,.1);border-radius:50%;cursor:pointer;pointer-events:auto}.ant-image-preview-switch-left-disabled,.ant-image-preview-switch-right-disabled{color:hsla(0,0%,100%,.25);cursor:not-allowed}.ant-image-preview-switch-left-disabled>.anticon,.ant-image-preview-switch-right-disabled>.anticon{cursor:not-allowed}.ant-image-preview-switch-left>.anticon,.ant-image-preview-switch-right>.anticon{font-size:18px}.ant-image-preview-switch-left{left:10px}.ant-image-preview-switch-right{right:10px}.ant-input-affix-wrapper{position:relative;display:inline-block;width:100%;min-width:0;padding:4px 11px;color:hsla(0,0%,100%,.85);font-size:14px;line-height:1.5715;background-color:transparent;background-image:none;border:1px solid #434343;border-radius:2px;transition:all .3s;display:inline-flex}.ant-input-affix-wrapper::-webkit-input-placeholder{color:hsla(0,0%,100%,.3)}.ant-input-affix-wrapper:-ms-input-placeholder{color:hsla(0,0%,100%,.3)}.ant-input-affix-wrapper::placeholder{color:hsla(0,0%,100%,.3)}.ant-input-affix-wrapper:-ms-input-placeholder{text-overflow:ellipsis}.ant-input-affix-wrapper:placeholder-shown{text-overflow:ellipsis}.ant-input-affix-wrapper-focused,.ant-input-affix-wrapper:focus{border-color:#2abdd2;border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(42,189,210,.2)}.ant-input-rtl .ant-input-affix-wrapper-focused,.ant-input-rtl .ant-input-affix-wrapper:focus{border-right-width:0;border-left-width:1px!important}.ant-input-affix-wrapper-disabled{color:hsla(0,0%,100%,.3);background-color:hsla(0,0%,100%,.08);cursor:not-allowed;opacity:1}.ant-input-affix-wrapper-disabled:hover{border-color:#434343;border-right-width:1px!important}.ant-input-affix-wrapper[disabled]{color:hsla(0,0%,100%,.3);background-color:hsla(0,0%,100%,.08);cursor:not-allowed;opacity:1}.ant-input-affix-wrapper[disabled]:hover{border-color:#434343;border-right-width:1px!important}.ant-input-affix-wrapper-borderless,.ant-input-affix-wrapper-borderless-disabled,.ant-input-affix-wrapper-borderless-focused,.ant-input-affix-wrapper-borderless:focus,.ant-input-affix-wrapper-borderless:hover,.ant-input-affix-wrapper-borderless[disabled]{background-color:transparent;border:none;box-shadow:none}textarea.ant-input-affix-wrapper{max-width:100%;height:auto;min-height:32px;line-height:1.5715;vertical-align:bottom;transition:all .3s,height 0s}.ant-input-affix-wrapper-lg{padding:6.5px 11px;font-size:16px}.ant-input-affix-wrapper-sm{padding:0 7px}.ant-input-affix-wrapper-rtl{direction:rtl}.ant-input-affix-wrapper:hover{border-color:#228290;border-right-width:1px!important;z-index:1}.ant-input-rtl .ant-input-affix-wrapper:hover{border-right-width:0;border-left-width:1px!important}.ant-input-search-with-button .ant-input-affix-wrapper:hover{z-index:0}.ant-input-affix-wrapper-focused,.ant-input-affix-wrapper:focus{z-index:1}.ant-input-affix-wrapper-disabled .ant-input[disabled]{background:transparent}.ant-input-affix-wrapper>input.ant-input{padding:0;border:none;outline:none}.ant-input-affix-wrapper>input.ant-input:focus{box-shadow:none}.ant-input-affix-wrapper:before{width:0;visibility:hidden;content:"\a0"}.ant-input-prefix,.ant-input-suffix{display:flex;flex:none;align-items:center}.ant-input-prefix{margin-right:4px}.ant-input-suffix{margin-left:4px}.ant-input-clear-icon{margin:0 4px;color:hsla(0,0%,100%,.3);font-size:12px;vertical-align:-1px;cursor:pointer;transition:color .3s}.ant-input-clear-icon:hover{color:hsla(0,0%,100%,.45)}.ant-input-clear-icon:active{color:hsla(0,0%,100%,.85)}.ant-input-clear-icon-hidden{visibility:hidden}.ant-input-clear-icon:last-child{margin-right:0}.ant-input-affix-wrapper-textarea-with-clear-btn{padding:0!important;border:0!important}.ant-input-affix-wrapper-textarea-with-clear-btn .ant-input-clear-icon{position:absolute;top:8px;right:8px;z-index:1}.ant-input{box-sizing:border-box;margin:0;font-variant:tabular-nums;list-style:none;font-feature-settings:"tnum","tnum";position:relative;display:inline-block;width:100%;min-width:0;padding:4px 11px;color:hsla(0,0%,100%,.85);font-size:14px;line-height:1.5715;background-color:transparent;background-image:none;border:1px solid #434343;border-radius:2px;transition:all .3s}.ant-input::-webkit-input-placeholder{color:hsla(0,0%,100%,.3)}.ant-input:-ms-input-placeholder{color:hsla(0,0%,100%,.3)}.ant-input::placeholder{color:hsla(0,0%,100%,.3)}.ant-input:-ms-input-placeholder{text-overflow:ellipsis}.ant-input:placeholder-shown{text-overflow:ellipsis}.ant-input:hover{border-color:#228290;border-right-width:1px!important}.ant-input-rtl .ant-input:hover{border-right-width:0;border-left-width:1px!important}.ant-input-focused,.ant-input:focus{border-color:#2abdd2;border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(42,189,210,.2)}.ant-input-rtl .ant-input-focused,.ant-input-rtl .ant-input:focus{border-right-width:0;border-left-width:1px!important}.ant-input-disabled{color:hsla(0,0%,100%,.3);background-color:hsla(0,0%,100%,.08);cursor:not-allowed;opacity:1}.ant-input-disabled:hover{border-color:#434343;border-right-width:1px!important}.ant-input[disabled]{color:hsla(0,0%,100%,.3);background-color:hsla(0,0%,100%,.08);cursor:not-allowed;opacity:1}.ant-input[disabled]:hover{border-color:#434343;border-right-width:1px!important}.ant-input-borderless,.ant-input-borderless-disabled,.ant-input-borderless-focused,.ant-input-borderless:focus,.ant-input-borderless:hover,.ant-input-borderless[disabled]{background-color:transparent;border:none;box-shadow:none}textarea.ant-input{max-width:100%;height:auto;min-height:32px;line-height:1.5715;vertical-align:bottom;transition:all .3s,height 0s}.ant-input-lg{padding:6.5px 11px;font-size:16px}.ant-input-sm{padding:0 7px}.ant-input-rtl{direction:rtl}.ant-input-group{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:relative;display:table;width:100%;border-collapse:separate;border-spacing:0}.ant-input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.ant-input-group>[class*=col-]{padding-right:8px}.ant-input-group>[class*=col-]:last-child{padding-right:0}.ant-input-group-addon,.ant-input-group-wrap,.ant-input-group>.ant-input{display:table-cell}.ant-input-group-addon:not(:first-child):not(:last-child),.ant-input-group-wrap:not(:first-child):not(:last-child),.ant-input-group>.ant-input:not(:first-child):not(:last-child){border-radius:0}.ant-input-group-addon,.ant-input-group-wrap{width:1px;white-space:nowrap;vertical-align:middle}.ant-input-group-wrap>*{display:block!important}.ant-input-group .ant-input{float:left;width:100%;margin-bottom:0;text-align:inherit}.ant-input-group .ant-input:focus,.ant-input-group .ant-input:hover{z-index:1;border-right-width:1px}.ant-input-search-with-button .ant-input-group .ant-input:hover{z-index:0}.ant-input-group-addon{position:relative;padding:0 11px;color:hsla(0,0%,100%,.85);font-weight:400;font-size:14px;text-align:center;background-color:hsla(0,0%,100%,.04);border:1px solid #434343;border-radius:2px;transition:all .3s}.ant-input-group-addon .ant-select{margin:-5px -11px}.ant-input-group-addon .ant-select.ant-select-single:not(.ant-select-customize-input) .ant-select-selector{background-color:inherit;border:1px solid transparent;box-shadow:none}.ant-input-group-addon .ant-select-focused .ant-select-selector,.ant-input-group-addon .ant-select-open .ant-select-selector{color:#2abdd2}.ant-input-group-addon:first-child,.ant-input-group-addon:first-child .ant-select .ant-select-selector,.ant-input-group>.ant-input:first-child,.ant-input-group>.ant-input:first-child .ant-select .ant-select-selector{border-top-right-radius:0;border-bottom-right-radius:0}.ant-input-group>.ant-input-affix-wrapper:not(:first-child) .ant-input{border-top-left-radius:0;border-bottom-left-radius:0}.ant-input-group>.ant-input-affix-wrapper:not(:last-child) .ant-input{border-top-right-radius:0;border-bottom-right-radius:0}.ant-input-group-addon:first-child{border-right:0}.ant-input-group-addon:last-child{border-left:0}.ant-input-group-addon:last-child,.ant-input-group-addon:last-child .ant-select .ant-select-selector,.ant-input-group>.ant-input:last-child,.ant-input-group>.ant-input:last-child .ant-select .ant-select-selector{border-top-left-radius:0;border-bottom-left-radius:0}.ant-input-group-lg .ant-input,.ant-input-group-lg>.ant-input-group-addon{padding:6.5px 11px;font-size:16px}.ant-input-group-sm .ant-input,.ant-input-group-sm>.ant-input-group-addon{padding:0 7px}.ant-input-group-lg .ant-select-single .ant-select-selector{height:40px}.ant-input-group-sm .ant-select-single .ant-select-selector{height:24px}.ant-input-group .ant-input-affix-wrapper:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.ant-input-group .ant-input-affix-wrapper:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.ant-input-search .ant-input-group .ant-input-affix-wrapper:not(:last-child){border-top-left-radius:2px;border-bottom-left-radius:2px}.ant-input-group.ant-input-group-compact{display:block}.ant-input-group.ant-input-group-compact:before{display:table;content:""}.ant-input-group.ant-input-group-compact:after{display:table;clear:both;content:""}.ant-input-group.ant-input-group-compact-addon:not(:first-child):not(:last-child),.ant-input-group.ant-input-group-compact-wrap:not(:first-child):not(:last-child),.ant-input-group.ant-input-group-compact>.ant-input:not(:first-child):not(:last-child){border-right-width:1px}.ant-input-group.ant-input-group-compact-addon:not(:first-child):not(:last-child):focus,.ant-input-group.ant-input-group-compact-addon:not(:first-child):not(:last-child):hover,.ant-input-group.ant-input-group-compact-wrap:not(:first-child):not(:last-child):focus,.ant-input-group.ant-input-group-compact-wrap:not(:first-child):not(:last-child):hover,.ant-input-group.ant-input-group-compact>.ant-input:not(:first-child):not(:last-child):focus,.ant-input-group.ant-input-group-compact>.ant-input:not(:first-child):not(:last-child):hover{z-index:1}.ant-input-group.ant-input-group-compact>*{display:inline-block;float:none;vertical-align:top;border-radius:0}.ant-input-group.ant-input-group-compact>.ant-input-affix-wrapper,.ant-input-group.ant-input-group-compact>.ant-picker-range{display:inline-flex}.ant-input-group.ant-input-group-compact>:not(:last-child){margin-right:-1px;border-right-width:1px}.ant-input-group.ant-input-group-compact .ant-input{float:none}.ant-input-group.ant-input-group-compact>.ant-cascader-picker .ant-input,.ant-input-group.ant-input-group-compact>.ant-input-group-wrapper .ant-input,.ant-input-group.ant-input-group-compact>.ant-select-auto-complete .ant-input,.ant-input-group.ant-input-group-compact>.ant-select>.ant-select-selector{border-right-width:1px;border-radius:0}.ant-input-group.ant-input-group-compact>.ant-cascader-picker .ant-input:focus,.ant-input-group.ant-input-group-compact>.ant-cascader-picker .ant-input:hover,.ant-input-group.ant-input-group-compact>.ant-input-group-wrapper .ant-input:focus,.ant-input-group.ant-input-group-compact>.ant-input-group-wrapper .ant-input:hover,.ant-input-group.ant-input-group-compact>.ant-select-auto-complete .ant-input:focus,.ant-input-group.ant-input-group-compact>.ant-select-auto-complete .ant-input:hover,.ant-input-group.ant-input-group-compact>.ant-select-focused,.ant-input-group.ant-input-group-compact>.ant-select>.ant-select-arrow,.ant-input-group.ant-input-group-compact>.ant-select>.ant-select-selector:focus,.ant-input-group.ant-input-group-compact>.ant-select>.ant-select-selector:hover{z-index:1}.ant-input-group.ant-input-group-compact>.ant-cascader-picker:first-child .ant-input,.ant-input-group.ant-input-group-compact>.ant-select-auto-complete:first-child .ant-input,.ant-input-group.ant-input-group-compact>.ant-select:first-child>.ant-select-selector,.ant-input-group.ant-input-group-compact>:first-child{border-top-left-radius:2px;border-bottom-left-radius:2px}.ant-input-group.ant-input-group-compact>.ant-cascader-picker-focused:last-child .ant-input,.ant-input-group.ant-input-group-compact>.ant-cascader-picker:last-child .ant-input,.ant-input-group.ant-input-group-compact>.ant-select:last-child>.ant-select-selector,.ant-input-group.ant-input-group-compact>:last-child{border-right-width:1px;border-top-right-radius:2px;border-bottom-right-radius:2px}.ant-input-group.ant-input-group-compact>.ant-select-auto-complete .ant-input{vertical-align:top}.ant-input-group.ant-input-group-compact .ant-input-group-wrapper+.ant-input-group-wrapper{margin-left:-1px}.ant-input-group.ant-input-group-compact .ant-input-group-wrapper+.ant-input-group-wrapper .ant-input-affix-wrapper,.ant-input-group.ant-input-group-compact .ant-input-group-wrapper:not(:last-child).ant-input-search>.ant-input-group>.ant-input-group-addon>.ant-input-search-button{border-radius:0}.ant-input-group.ant-input-group-compact .ant-input-group-wrapper:not(:last-child).ant-input-search>.ant-input-group>.ant-input{border-radius:2px 0 0 2px}.ant-input-group-rtl .ant-input-group-addon:first-child,.ant-input-group>.ant-input-rtl:first-child{border-radius:0 2px 2px 0}.ant-input-group-rtl .ant-input-group-addon:first-child{border-right:1px solid #434343;border-left:0}.ant-input-group-rtl .ant-input-group-addon:last-child{border-right:0;border-left:1px solid #434343}.ant-input-group-rtl.ant-input-group-addon:last-child,.ant-input-group-rtl.ant-input-group .ant-input-affix-wrapper:not(:first-child),.ant-input-group-rtl.ant-input-group>.ant-input:last-child{border-radius:2px 0 0 2px}.ant-input-group-rtl.ant-input-group .ant-input-affix-wrapper:not(:last-child){border-radius:0 2px 2px 0}.ant-input-group-rtl.ant-input-group.ant-input-group-compact>:not(:last-child){margin-right:0;margin-left:-1px;border-left-width:1px}.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-cascader-picker:first-child .ant-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-select-auto-complete:first-child .ant-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-select:first-child>.ant-select-selector,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>:first-child{border-radius:0 2px 2px 0}.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-cascader-picker-focused:last-child .ant-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-cascader-picker:last-child .ant-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-select-auto-complete:last-child .ant-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-select:last-child>.ant-select-selector,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>:last-child{border-left-width:1px;border-radius:2px 0 0 2px}.ant-input-group.ant-input-group-compact .ant-input-group-wrapper-rtl+.ant-input-group-wrapper-rtl{margin-right:-1px;margin-left:0}.ant-input-group.ant-input-group-compact .ant-input-group-wrapper-rtl:not(:last-child).ant-input-search>.ant-input-group>.ant-input{border-radius:0 2px 2px 0}.ant-input-group-wrapper{display:inline-block;width:100%;text-align:start;vertical-align:top}.ant-input-password-icon{color:hsla(0,0%,100%,.45);cursor:pointer;transition:all .3s}.ant-input-password-icon:hover{color:hsla(0,0%,100%,.85)}.ant-input[type=color]{height:32px}.ant-input[type=color].ant-input-lg{height:40px}.ant-input[type=color].ant-input-sm{height:24px;padding-top:3px;padding-bottom:3px}.ant-input-textarea-show-count:after{float:right;color:hsla(0,0%,100%,.45);white-space:nowrap;content:attr(data-count);pointer-events:none}.ant-input-search .ant-input:focus,.ant-input-search .ant-input:hover{border-color:#228290}.ant-input-search .ant-input:focus+.ant-input-group-addon .ant-input-search-button:not(.ant-btn-primary),.ant-input-search .ant-input:hover+.ant-input-group-addon .ant-input-search-button:not(.ant-btn-primary){border-left-color:#228290}.ant-input-search .ant-input-affix-wrapper{border-radius:0}.ant-input-search .ant-input-lg{line-height:1.5713}.ant-input-search>.ant-input-group>.ant-input-group-addon:last-child{left:-1px;padding:0;border:0}.ant-input-search>.ant-input-group>.ant-input-group-addon:last-child .ant-input-search-button{padding-top:0;padding-bottom:0;border-radius:0 2px 2px 0}.ant-input-search>.ant-input-group>.ant-input-group-addon:last-child .ant-input-search-button:not(.ant-btn-primary){color:hsla(0,0%,100%,.45)}.ant-input-search>.ant-input-group>.ant-input-group-addon:last-child .ant-input-search-button:not(.ant-btn-primary).ant-btn-loading:before{top:0;right:0;bottom:0;left:0}.ant-input-search-button{height:32px}.ant-input-search-button:focus,.ant-input-search-button:hover{z-index:1}.ant-input-search-large .ant-input-search-button{height:40px}.ant-input-search-small .ant-input-search-button{height:24px}.ant-input-group-rtl,.ant-input-group-wrapper-rtl{direction:rtl}.ant-input-affix-wrapper.ant-input-affix-wrapper-rtl>input.ant-input{border:none;outline:none}.ant-input-affix-wrapper-rtl .ant-input-prefix{margin:0 0 0 4px}.ant-input-affix-wrapper-rtl .ant-input-suffix{margin:0 4px 0 0}.ant-input-textarea-rtl{direction:rtl}.ant-input-textarea-rtl.ant-input-textarea-show-count:after{text-align:left}.ant-input-affix-wrapper-rtl .ant-input-clear-icon:last-child{margin-right:4px;margin-left:0}.ant-input-affix-wrapper-rtl .ant-input-clear-icon{right:auto;left:8px}.ant-input-search-rtl{direction:rtl}.ant-input-search-rtl .ant-input:focus+.ant-input-group-addon .ant-input-search-button:not(.ant-btn-primary),.ant-input-search-rtl .ant-input:hover+.ant-input-group-addon .ant-input-search-button:not(.ant-btn-primary){border-right-color:#228290;border-left-color:#434343}.ant-input-search-rtl>.ant-input-group>.ant-input-affix-wrapper-focused,.ant-input-search-rtl>.ant-input-group>.ant-input-affix-wrapper:hover{border-right-color:#228290}.ant-input-search-rtl>.ant-input-group>.ant-input-group-addon{right:-1px;left:auto}.ant-input-search-rtl>.ant-input-group>.ant-input-group-addon .ant-input-search-button{border-radius:2px 0 0 2px}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.ant-input{height:32px}.ant-input-lg{height:40px}.ant-input-sm{height:24px}.ant-input-affix-wrapper>input.ant-input{height:auto}}.ant-input-number{box-sizing:border-box;font-variant:tabular-nums;list-style:none;font-feature-settings:"tnum","tnum";position:relative;width:100%;min-width:0;color:hsla(0,0%,100%,.85);font-size:14px;line-height:1.5715;background-color:transparent;background-image:none;transition:all .3s;display:inline-block;width:90px;margin:0;padding:0;border:1px solid #434343;border-radius:2px}.ant-input-number::-webkit-input-placeholder{color:hsla(0,0%,100%,.3)}.ant-input-number:-ms-input-placeholder{color:hsla(0,0%,100%,.3)}.ant-input-number::placeholder{color:hsla(0,0%,100%,.3)}.ant-input-number:-ms-input-placeholder{text-overflow:ellipsis}.ant-input-number:placeholder-shown{text-overflow:ellipsis}.ant-input-rtl .ant-input-number:hover{border-right-width:0;border-left-width:1px!important}.ant-input-number-focused,.ant-input-number:focus{border-color:#2abdd2;border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(42,189,210,.2)}.ant-input-rtl .ant-input-number-focused,.ant-input-rtl .ant-input-number:focus{border-right-width:0;border-left-width:1px!important}.ant-input-number[disabled]{color:hsla(0,0%,100%,.3);background-color:hsla(0,0%,100%,.08);cursor:not-allowed;opacity:1}.ant-input-number[disabled]:hover{border-color:#434343;border-right-width:1px!important}.ant-input-number-borderless,.ant-input-number-borderless-disabled,.ant-input-number-borderless-focused,.ant-input-number-borderless:focus,.ant-input-number-borderless:hover,.ant-input-number-borderless[disabled]{background-color:transparent;border:none;box-shadow:none}textarea.ant-input-number{max-width:100%;height:auto;min-height:32px;line-height:1.5715;vertical-align:bottom;transition:all .3s,height 0s}.ant-input-number-lg{padding:6.5px 11px}.ant-input-number-sm{padding:0 7px}.ant-input-number-handler{position:relative;display:block;width:100%;height:50%;overflow:hidden;color:hsla(0,0%,100%,.45);font-weight:700;line-height:0;text-align:center;transition:all .1s linear}.ant-input-number-handler:active{background:hsla(0,0%,100%,.08)}.ant-input-number-handler:hover .ant-input-number-handler-down-inner,.ant-input-number-handler:hover .ant-input-number-handler-up-inner{color:#228290}.ant-input-number-handler-down-inner,.ant-input-number-handler-up-inner{display:inline-block;color:inherit;font-style:normal;line-height:0;text-align:center;text-transform:none;vertical-align:-.125em;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:absolute;right:4px;width:12px;height:12px;color:hsla(0,0%,100%,.45);line-height:12px;transition:all .1s linear;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ant-input-number-handler-down-inner>*,.ant-input-number-handler-up-inner>*{line-height:1}.ant-input-number-handler-down-inner svg,.ant-input-number-handler-up-inner svg{display:inline-block}.ant-input-number-handler-down-inner:before,.ant-input-number-handler-up-inner:before{display:none}.ant-input-number-handler-down-inner .ant-input-number-handler-down-inner-icon,.ant-input-number-handler-down-inner .ant-input-number-handler-up-inner-icon,.ant-input-number-handler-up-inner .ant-input-number-handler-down-inner-icon,.ant-input-number-handler-up-inner .ant-input-number-handler-up-inner-icon{display:block}.ant-input-number:hover{border-color:#228290;border-right-width:1px!important}.ant-input-number:hover+.ant-form-item-children-icon{opacity:0;transition:opacity .24s linear .24s}.ant-input-number-focused{border-color:#2abdd2;border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(42,189,210,.2)}.ant-input-rtl .ant-input-number-focused{border-right-width:0;border-left-width:1px!important}.ant-input-number-disabled{color:hsla(0,0%,100%,.3);background-color:hsla(0,0%,100%,.08);cursor:not-allowed;opacity:1}.ant-input-number-disabled:hover{border-color:#434343;border-right-width:1px!important}.ant-input-number-disabled .ant-input-number-input{cursor:not-allowed}.ant-input-number-disabled .ant-input-number-handler-wrap,.ant-input-number-readonly .ant-input-number-handler-wrap{display:none}.ant-input-number-input{width:100%;height:30px;padding:0 11px;text-align:left;background-color:transparent;border:0;border-radius:2px;outline:0;transition:all .3s linear;-moz-appearance:textfield!important}.ant-input-number-input::-webkit-input-placeholder{color:hsla(0,0%,100%,.3)}.ant-input-number-input:-ms-input-placeholder{color:hsla(0,0%,100%,.3)}.ant-input-number-input::placeholder{color:hsla(0,0%,100%,.3)}.ant-input-number-input:-ms-input-placeholder{text-overflow:ellipsis}.ant-input-number-input:placeholder-shown{text-overflow:ellipsis}.ant-input-number-input[type=number]::-webkit-inner-spin-button,.ant-input-number-input[type=number]::-webkit-outer-spin-button{margin:0;-webkit-appearance:none}.ant-input-number-lg{padding:0;font-size:16px}.ant-input-number-lg input{height:38px}.ant-input-number-sm{padding:0}.ant-input-number-sm input{height:22px;padding:0 7px}.ant-input-number-handler-wrap{position:absolute;top:0;right:0;width:22px;height:100%;background:#141414;border-left:1px solid #434343;border-radius:0 2px 2px 0;opacity:0;transition:opacity .24s linear .1s}.ant-input-number-handler-wrap .ant-input-number-handler .ant-input-number-handler-down-inner,.ant-input-number-handler-wrap .ant-input-number-handler .ant-input-number-handler-up-inner{min-width:auto;margin-right:0;font-size:7px}.ant-input-number-borderless .ant-input-number-handler-wrap{border-left-width:0}.ant-input-number-handler-wrap:hover .ant-input-number-handler{height:40%}.ant-input-number:hover .ant-input-number-handler-wrap{opacity:1}.ant-input-number-handler-up{border-top-right-radius:2px;cursor:pointer}.ant-input-number-handler-up-inner{top:50%;margin-top:-5px;text-align:center}.ant-input-number-handler-up:hover{height:60%!important}.ant-input-number-handler-down{top:0;border-top:1px solid #434343;border-bottom-right-radius:2px;cursor:pointer}.ant-input-number-handler-down-inner{top:50%;text-align:center;transform:translateY(-50%)}.ant-input-number-handler-down:hover{height:60%!important}.ant-input-number-borderless .ant-input-number-handler-down{border-top-width:0}.ant-input-number-handler-down-disabled,.ant-input-number-handler-up-disabled{cursor:not-allowed}.ant-input-number-handler-down-disabled:hover .ant-input-number-handler-down-inner,.ant-input-number-handler-up-disabled:hover .ant-input-number-handler-up-inner{color:hsla(0,0%,100%,.3)}.ant-input-number-borderless{box-shadow:none}.ant-input-number-rtl{direction:rtl}.ant-input-number-rtl .ant-input-number-handler-wrap{right:auto;left:0;border-right:1px solid #434343;border-left:0;border-radius:2px 0 0 2px}.ant-input-number-rtl.ant-input-number-borderless .ant-input-number-handler-wrap{border-right-width:0}.ant-input-number-rtl .ant-input-number-input{direction:ltr;text-align:right}.ant-layout{display:flex;flex:auto;flex-direction:column;min-height:0;background:#000}.ant-layout,.ant-layout *{box-sizing:border-box}.ant-layout.ant-layout-has-sider{flex-direction:row}.ant-layout.ant-layout-has-sider>.ant-layout,.ant-layout.ant-layout-has-sider>.ant-layout-content{width:0}.ant-layout-footer,.ant-layout-header{flex:0 0 auto}.ant-layout-header{height:64px;padding:0 50px;background:#1a2029}.ant-layout-footer{padding:24px 50px;color:hsla(0,0%,100%,.85);font-size:14px;background:#000}.ant-layout-content{flex:auto;min-height:0}.ant-layout-sider{position:relative;min-width:0;background:#1a2029;transition:all .2s}.ant-layout-sider-children{height:100%;margin-top:-.1px;padding-top:.1px}.ant-layout-sider-has-trigger{padding-bottom:48px}.ant-layout-sider-right{order:1}.ant-layout-sider-trigger{position:fixed;bottom:0;z-index:1;height:48px;color:#fff;line-height:48px;text-align:center;background:#262626;cursor:pointer;transition:all .2s}.ant-layout-sider-zero-width>*{overflow:hidden}.ant-layout-sider-zero-width-trigger{position:absolute;top:64px;right:-36px;z-index:1;width:36px;height:42px;color:#fff;font-size:18px;line-height:42px;text-align:center;background:#1a2029;border-radius:0 2px 2px 0;cursor:pointer;transition:background .3s ease}.ant-layout-sider-zero-width-trigger:after{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;transition:all .3s;content:""}.ant-layout-sider-zero-width-trigger:hover:after{background:hsla(0,0%,100%,.1)}.ant-layout-sider-zero-width-trigger-right{left:-36px;border-radius:2px 0 0 2px}.ant-layout-sider-light{background:#fff}.ant-layout-sider-light .ant-layout-sider-trigger,.ant-layout-sider-light .ant-layout-sider-zero-width-trigger{color:hsla(0,0%,100%,.85);background:#fff}.ant-layout-rtl{direction:rtl}.ant-list .ant-card{background:transparent}.ant-list{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:relative}.ant-list *{outline:none}.ant-list-pagination{margin-top:24px;text-align:right}.ant-list-pagination .ant-pagination-options{text-align:left}.ant-list-more{margin-top:12px;text-align:center}.ant-list-more button{padding-right:32px;padding-left:32px}.ant-list-spin{min-height:40px;text-align:center}.ant-list-empty-text{padding:16px;color:hsla(0,0%,100%,.3);font-size:14px;text-align:center}.ant-list-items{margin:0;padding:0;list-style:none}.ant-list-item{display:flex;align-items:center;justify-content:space-between;padding:12px 0;color:hsla(0,0%,100%,.85)}.ant-list-item-meta{display:flex;flex:1 1;align-items:flex-start;max-width:100%}.ant-list-item-meta-avatar{margin-right:16px}.ant-list-item-meta-content{flex:1 0;width:0;color:hsla(0,0%,100%,.85)}.ant-list-item-meta-title{margin-bottom:4px;color:hsla(0,0%,100%,.85);font-size:14px;line-height:1.5715}.ant-list-item-meta-title>a{color:hsla(0,0%,100%,.85);transition:all .3s}.ant-list-item-meta-title>a:hover{color:#2abdd2}.ant-list-item-meta-description{color:hsla(0,0%,100%,.45);font-size:14px;line-height:1.5715}.ant-list-item-action{flex:0 0 auto;margin-left:48px;padding:0;font-size:0;list-style:none}.ant-list-item-action>li{position:relative;display:inline-block;padding:0 8px;color:hsla(0,0%,100%,.45);font-size:14px;line-height:1.5715;text-align:center}.ant-list-item-action>li:first-child{padding-left:0}.ant-list-item-action-split{position:absolute;top:50%;right:0;width:1px;height:14px;margin-top:-7px;background-color:#303030}.ant-list-footer,.ant-list-header{background:transparent}.ant-list-footer,.ant-list-header{padding-top:12px;padding-bottom:12px}.ant-list-empty{padding:16px 0;color:hsla(0,0%,100%,.45);font-size:12px;text-align:center}.ant-list-split .ant-list-item{border-bottom:1px solid #303030}.ant-list-split .ant-list-item:last-child{border-bottom:none}.ant-list-split .ant-list-header{border-bottom:1px solid #303030}.ant-list-split.ant-list-empty .ant-list-footer{border-top:1px solid #303030}.ant-list-loading .ant-list-spin-nested-loading{min-height:32px}.ant-list-split.ant-list-something-after-last-item .ant-spin-container>.ant-list-items>.ant-list-item:last-child{border-bottom:1px solid #303030}.ant-list-lg .ant-list-item{padding:16px 24px}.ant-list-sm .ant-list-item{padding:8px 16px}.ant-list-vertical .ant-list-item{align-items:normal}.ant-list-vertical .ant-list-item-main{display:block;flex:1 1}.ant-list-vertical .ant-list-item-extra{margin-left:40px}.ant-list-vertical .ant-list-item-meta{margin-bottom:16px}.ant-list-vertical .ant-list-item-meta-title{margin-bottom:12px;color:hsla(0,0%,100%,.85);font-size:16px;line-height:24px}.ant-list-vertical .ant-list-item-action{margin-top:16px;margin-left:auto}.ant-list-vertical .ant-list-item-action>li{padding:0 16px}.ant-list-vertical .ant-list-item-action>li:first-child{padding-left:0}.ant-list-grid .ant-col>.ant-list-item{display:block;max-width:100%;margin-bottom:16px;padding-top:0;padding-bottom:0;border-bottom:none}.ant-list-item-no-flex{display:block}.ant-list:not(.ant-list-vertical) .ant-list-item-no-flex .ant-list-item-action{float:right}.ant-list-bordered{border:1px solid #434343;border-radius:2px}.ant-list-bordered .ant-list-footer,.ant-list-bordered .ant-list-header,.ant-list-bordered .ant-list-item{padding-right:24px;padding-left:24px}.ant-list-bordered .ant-list-pagination{margin:16px 24px}.ant-list-bordered.ant-list-sm .ant-list-footer,.ant-list-bordered.ant-list-sm .ant-list-header,.ant-list-bordered.ant-list-sm .ant-list-item{padding:8px 16px}.ant-list-bordered.ant-list-lg .ant-list-footer,.ant-list-bordered.ant-list-lg .ant-list-header,.ant-list-bordered.ant-list-lg .ant-list-item{padding:16px 24px}@media screen and (max-width:768px){.ant-list-item-action,.ant-list-vertical .ant-list-item-extra{margin-left:24px}}@media screen and (max-width:576px){.ant-list-item{flex-wrap:wrap}.ant-list-item-action{margin-left:12px}.ant-list-vertical .ant-list-item{flex-wrap:wrap-reverse}.ant-list-vertical .ant-list-item-main{min-width:220px}.ant-list-vertical .ant-list-item-extra{margin:auto auto 16px}}.ant-list-rtl{direction:rtl;text-align:right}.ant-list-rtl .ReactVirtualized__List .ant-list-item{direction:rtl}.ant-list-rtl .ant-list-pagination{text-align:left}.ant-list-rtl .ant-list-item-meta-avatar{margin-right:0;margin-left:16px}.ant-list-rtl .ant-list-item-action{margin-right:48px;margin-left:0}.ant-list.ant-list-rtl .ant-list-item-action>li:first-child{padding-right:0;padding-left:16px}.ant-list-rtl .ant-list-item-action-split{right:auto;left:0}.ant-list-rtl.ant-list-vertical .ant-list-item-extra{margin-right:40px;margin-left:0}.ant-list-rtl.ant-list-vertical .ant-list-item-action{margin-right:auto}.ant-list-rtl .ant-list-vertical .ant-list-item-action>li:first-child{padding-right:0;padding-left:16px}.ant-list-rtl .ant-list:not(.ant-list-vertical) .ant-list-item-no-flex .ant-list-item-action{float:left}@media screen and (max-width:768px){.ant-list-rtl .ant-list-item-action,.ant-list-rtl .ant-list-vertical .ant-list-item-extra{margin-right:24px;margin-left:0}}@media screen and (max-width:576px){.ant-list-rtl .ant-list-item-action{margin-right:22px;margin-left:0}.ant-list-rtl.ant-list-vertical .ant-list-item-extra{margin:auto auto 16px}}.ant-mentions{box-sizing:border-box;margin:0;font-variant:tabular-nums;list-style:none;font-feature-settings:"tnum","tnum";width:100%;min-width:0;color:hsla(0,0%,100%,.85);font-size:14px;background-color:transparent;background-image:none;border:1px solid #434343;border-radius:2px;transition:all .3s;position:relative;display:inline-block;height:auto;padding:0;overflow:hidden;line-height:1.5715;white-space:pre-wrap;vertical-align:bottom}.ant-mentions::-webkit-input-placeholder{color:hsla(0,0%,100%,.3)}.ant-mentions:-ms-input-placeholder{color:hsla(0,0%,100%,.3)}.ant-mentions::placeholder{color:hsla(0,0%,100%,.3)}.ant-mentions:-ms-input-placeholder{text-overflow:ellipsis}.ant-mentions:placeholder-shown{text-overflow:ellipsis}.ant-mentions:hover{border-color:#228290;border-right-width:1px!important}.ant-input-rtl .ant-mentions:hover{border-right-width:0;border-left-width:1px!important}.ant-mentions-focused,.ant-mentions:focus{border-color:#2abdd2;border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(42,189,210,.2)}.ant-input-rtl .ant-mentions-focused,.ant-input-rtl .ant-mentions:focus{border-right-width:0;border-left-width:1px!important}.ant-mentions-disabled{color:hsla(0,0%,100%,.3);background-color:hsla(0,0%,100%,.08);cursor:not-allowed;opacity:1}.ant-mentions-disabled:hover{border-color:#434343;border-right-width:1px!important}.ant-mentions[disabled]{color:hsla(0,0%,100%,.3);background-color:hsla(0,0%,100%,.08);cursor:not-allowed;opacity:1}.ant-mentions[disabled]:hover{border-color:#434343;border-right-width:1px!important}.ant-mentions-borderless,.ant-mentions-borderless-disabled,.ant-mentions-borderless-focused,.ant-mentions-borderless:focus,.ant-mentions-borderless:hover,.ant-mentions-borderless[disabled]{background-color:transparent;border:none;box-shadow:none}textarea.ant-mentions{max-width:100%;height:auto;min-height:32px;line-height:1.5715;vertical-align:bottom;transition:all .3s,height 0s}.ant-mentions-lg{padding:6.5px 11px;font-size:16px}.ant-mentions-sm{padding:0 7px}.ant-mentions-disabled>textarea{color:hsla(0,0%,100%,.3);background-color:hsla(0,0%,100%,.08);cursor:not-allowed;opacity:1}.ant-mentions-disabled>textarea:hover{border-color:#434343;border-right-width:1px!important}.ant-mentions-focused{border-color:#2abdd2;border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(42,189,210,.2)}.ant-input-rtl .ant-mentions-focused{border-right-width:0;border-left-width:1px!important}.ant-mentions-measure,.ant-mentions>textarea{min-height:30px;margin:0;padding:4px 11px;overflow:inherit;overflow-x:hidden;overflow-y:auto;font-weight:inherit;font-size:inherit;font-family:inherit;font-style:inherit;font-feature-settings:inherit;font-variant:inherit;font-size-adjust:inherit;font-stretch:inherit;line-height:inherit;direction:inherit;letter-spacing:inherit;white-space:inherit;text-align:inherit;vertical-align:top;word-wrap:break-word;word-break:inherit;-moz-tab-size:inherit;tab-size:inherit}.ant-mentions>textarea{width:100%;border:none;outline:none;resize:none;background-color:transparent}.ant-mentions>textarea::-webkit-input-placeholder{color:hsla(0,0%,100%,.3)}.ant-mentions>textarea:-ms-input-placeholder{color:hsla(0,0%,100%,.3)}.ant-mentions>textarea::placeholder{color:hsla(0,0%,100%,.3)}.ant-mentions>textarea:-ms-input-placeholder{text-overflow:ellipsis}.ant-mentions>textarea:placeholder-shown{text-overflow:ellipsis}.ant-mentions-measure{position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;color:transparent;pointer-events:none}.ant-mentions-measure>span{display:inline-block;min-height:1em}.ant-mentions-dropdown{margin:0;padding:0;color:hsla(0,0%,100%,.85);font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum",;position:absolute;top:-9999px;left:-9999px;z-index:1050;box-sizing:border-box;font-size:14px;font-variant:normal;background-color:#1a2029;border-radius:2px;outline:none;box-shadow:0 3px 6px -4px rgba(0,0,0,.48),0 6px 16px 0 rgba(0,0,0,.32),0 9px 28px 8px rgba(0,0,0,.2)}.ant-mentions-dropdown-hidden{display:none}.ant-mentions-dropdown-menu{max-height:250px;margin-bottom:0;padding-left:0;overflow:auto;list-style:none;outline:none}.ant-mentions-dropdown-menu-item{position:relative;display:block;min-width:100px;padding:5px 12px;overflow:hidden;color:hsla(0,0%,100%,.85);font-weight:400;line-height:1.5715;white-space:nowrap;text-overflow:ellipsis;cursor:pointer;transition:background .3s ease}.ant-mentions-dropdown-menu-item:hover{background-color:hsla(0,0%,100%,.08)}.ant-mentions-dropdown-menu-item:first-child{border-radius:2px 2px 0 0}.ant-mentions-dropdown-menu-item:last-child{border-radius:0 0 2px 2px}.ant-mentions-dropdown-menu-item-disabled{color:hsla(0,0%,100%,.3);cursor:not-allowed}.ant-mentions-dropdown-menu-item-disabled:hover{color:hsla(0,0%,100%,.3);background-color:#1a2029;cursor:not-allowed}.ant-mentions-dropdown-menu-item-selected{color:hsla(0,0%,100%,.85);font-weight:600;background-color:hsla(0,0%,100%,.04)}.ant-mentions-dropdown-menu-item-active{background-color:hsla(0,0%,100%,.08)}.ant-mentions-rtl{direction:rtl}.ant-menu-item-danger.ant-menu-item,.ant-menu-item-danger.ant-menu-item-active,.ant-menu-item-danger.ant-menu-item:hover{color:#a61d24}.ant-menu-item-danger.ant-menu-item:active{background:#2a1215}.ant-menu-item-danger.ant-menu-item-selected,.ant-menu-item-danger.ant-menu-item-selected>a,.ant-menu-item-danger.ant-menu-item-selected>a:hover{color:#a61d24}.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-danger.ant-menu-item-selected{background-color:#2a1215}.ant-menu-inline .ant-menu-item-danger.ant-menu-item:after{border-right-color:#a61d24}.ant-menu-dark .ant-menu-item-danger.ant-menu-item,.ant-menu-dark .ant-menu-item-danger.ant-menu-item:hover,.ant-menu-dark .ant-menu-item-danger.ant-menu-item>a{color:#a61d24}.ant-menu-dark.ant-menu-dark:not(.ant-menu-horizontal) .ant-menu-item-danger.ant-menu-item-selected{color:#fff;background-color:#a61d24}.ant-menu{box-sizing:border-box;font-variant:tabular-nums;line-height:1.5715;font-feature-settings:"tnum","tnum";margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;line-height:0;text-align:left;list-style:none;background:#141414;outline:none;box-shadow:0 3px 6px -4px rgba(0,0,0,.48),0 6px 16px 0 rgba(0,0,0,.32),0 9px 28px 8px rgba(0,0,0,.2);transition:background .3s,width .3s cubic-bezier(.2,0,0,1) 0s}.ant-menu:after,.ant-menu:before{display:table;content:""}.ant-menu:after{clear:both}.ant-menu ol,.ant-menu ul{margin:0;padding:0;list-style:none}.ant-menu-hidden{display:none}.ant-menu-item-group-title{height:1.5715;padding:8px 16px;color:hsla(0,0%,100%,.45);font-size:14px;line-height:1.5715;transition:all .3s}.ant-menu-horizontal .ant-menu-submenu{transition:border-color .3s cubic-bezier(.645,.045,.355,1),background .3s cubic-bezier(.645,.045,.355,1)}.ant-menu-submenu,.ant-menu-submenu-inline{transition:border-color .3s cubic-bezier(.645,.045,.355,1),background .3s cubic-bezier(.645,.045,.355,1),padding .15s cubic-bezier(.645,.045,.355,1)}.ant-menu-submenu-selected{color:#2abdd2}.ant-menu-item:active,.ant-menu-submenu-title:active{background:#132125}.ant-menu-submenu .ant-menu-sub{cursor:auto;transition:background .3s cubic-bezier(.645,.045,.355,1),padding .3s cubic-bezier(.645,.045,.355,1)}.ant-menu-item a{color:hsla(0,0%,100%,.85)}.ant-menu-item a:hover{color:#2abdd2}.ant-menu-item a:before{position:absolute;top:0;right:0;bottom:0;left:0;background-color:transparent;content:""}.ant-menu-item>.ant-badge a{color:hsla(0,0%,100%,.85)}.ant-menu-item>.ant-badge a:hover{color:#2abdd2}.ant-menu-item-divider{height:1px;overflow:hidden;line-height:0;background-color:#303030}.ant-menu-item-active,.ant-menu-item:hover,.ant-menu-submenu-active,.ant-menu-submenu-title:hover,.ant-menu:not(.ant-menu-inline) .ant-menu-submenu-open{color:#2abdd2}.ant-menu-horizontal .ant-menu-item,.ant-menu-horizontal .ant-menu-submenu{margin-top:-1px}.ant-menu-horizontal>.ant-menu-item-active,.ant-menu-horizontal>.ant-menu-item:hover,.ant-menu-horizontal>.ant-menu-submenu .ant-menu-submenu-title:hover{background-color:transparent}.ant-menu-item-selected,.ant-menu-item-selected a,.ant-menu-item-selected a:hover{color:#2abdd2}.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected{background-color:#132125}.ant-menu-inline,.ant-menu-vertical,.ant-menu-vertical-left{border-right:1px solid #303030}.ant-menu-vertical-right{border-left:1px solid #303030}.ant-menu-vertical-left.ant-menu-sub,.ant-menu-vertical-right.ant-menu-sub,.ant-menu-vertical.ant-menu-sub{min-width:160px;max-height:calc(100vh - 100px);padding:0;overflow:hidden;border-right:0}.ant-menu-vertical-left.ant-menu-sub:not([class*=-active]),.ant-menu-vertical-right.ant-menu-sub:not([class*=-active]),.ant-menu-vertical.ant-menu-sub:not([class*=-active]){overflow-x:hidden;overflow-y:auto}.ant-menu-vertical-left.ant-menu-sub .ant-menu-item,.ant-menu-vertical-right.ant-menu-sub .ant-menu-item,.ant-menu-vertical.ant-menu-sub .ant-menu-item{left:0;margin-left:0;border-right:0}.ant-menu-vertical-left.ant-menu-sub .ant-menu-item:after,.ant-menu-vertical-right.ant-menu-sub .ant-menu-item:after,.ant-menu-vertical.ant-menu-sub .ant-menu-item:after{border-right:0}.ant-menu-vertical-left.ant-menu-sub>.ant-menu-item,.ant-menu-vertical-left.ant-menu-sub>.ant-menu-submenu,.ant-menu-vertical-right.ant-menu-sub>.ant-menu-item,.ant-menu-vertical-right.ant-menu-sub>.ant-menu-submenu,.ant-menu-vertical.ant-menu-sub>.ant-menu-item,.ant-menu-vertical.ant-menu-sub>.ant-menu-submenu{transform-origin:0 0}.ant-menu-horizontal.ant-menu-sub{min-width:114px}.ant-menu-horizontal .ant-menu-item,.ant-menu-horizontal .ant-menu-submenu-title{transition:border-color .3s,background .3s}.ant-menu-item,.ant-menu-submenu-title{position:relative;display:block;margin:0;padding:0 20px;white-space:nowrap;cursor:pointer;transition:border-color .3s,background .3s,padding .15s cubic-bezier(.645,.045,.355,1)}.ant-menu-item .ant-menu-item-icon,.ant-menu-item .anticon,.ant-menu-submenu-title .ant-menu-item-icon,.ant-menu-submenu-title .anticon{min-width:14px;margin-right:10px;font-size:14px;transition:font-size .15s cubic-bezier(.215,.61,.355,1),margin .3s cubic-bezier(.645,.045,.355,1),color .3s}.ant-menu-item .ant-menu-item-icon+span,.ant-menu-item .anticon+span,.ant-menu-submenu-title .ant-menu-item-icon+span,.ant-menu-submenu-title .anticon+span{opacity:1;transition:opacity .3s cubic-bezier(.645,.045,.355,1),width .3s cubic-bezier(.645,.045,.355,1),color .3s}.ant-menu-item.ant-menu-item-only-child>.ant-menu-item-icon,.ant-menu-item.ant-menu-item-only-child>.anticon,.ant-menu-submenu-title.ant-menu-item-only-child>.ant-menu-item-icon,.ant-menu-submenu-title.ant-menu-item-only-child>.anticon{margin-right:0}.ant-menu>.ant-menu-item-divider{height:1px;margin:1px 0;padding:0;overflow:hidden;line-height:0;background-color:#303030}.ant-menu-submenu-popup{position:absolute;z-index:1050;background:transparent;border-radius:2px;box-shadow:none;transform-origin:0 0}.ant-menu-submenu-popup:before{position:absolute;top:-7px;right:0;bottom:0;left:0;z-index:-1;width:100%;height:100%;opacity:.0001;content:" "}.ant-menu-submenu-placement-rightTop:before{top:0;left:-7px}.ant-menu-submenu>.ant-menu{background-color:#141414;border-radius:2px}.ant-menu-submenu>.ant-menu-submenu-title:after{transition:transform .3s cubic-bezier(.645,.045,.355,1)}.ant-menu-submenu-popup>.ant-menu{background-color:#1a2029}.ant-menu-submenu-arrow,.ant-menu-submenu-expand-icon{position:absolute;top:50%;right:16px;width:10px;color:hsla(0,0%,100%,.85);transform:translateY(-50%);transition:transform .3s cubic-bezier(.645,.045,.355,1)}.ant-menu-submenu-arrow:after,.ant-menu-submenu-arrow:before{position:absolute;width:6px;height:1.5px;background-color:currentColor;border-radius:2px;transition:background .3s cubic-bezier(.645,.045,.355,1),transform .3s cubic-bezier(.645,.045,.355,1),top .3s cubic-bezier(.645,.045,.355,1),color .3s cubic-bezier(.645,.045,.355,1);content:""}.ant-menu-submenu-arrow:before{transform:rotate(45deg) translateY(-2.5px)}.ant-menu-submenu-arrow:after{transform:rotate(-45deg) translateY(2.5px)}.ant-menu-submenu:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-submenu:hover>.ant-menu-submenu-title>.ant-menu-submenu-expand-icon{color:#2abdd2}.ant-menu-submenu-inline .ant-menu-submenu-arrow:before{transform:rotate(-45deg) translateX(2.5px)}.ant-menu-submenu-inline .ant-menu-submenu-arrow:after{transform:rotate(45deg) translateX(-2.5px)}.ant-menu-submenu-horizontal .ant-menu-submenu-arrow{display:none}.ant-menu-submenu-open.ant-menu-submenu-inline>.ant-menu-submenu-title>.ant-menu-submenu-arrow{transform:translateY(-2px)}.ant-menu-submenu-open.ant-menu-submenu-inline>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after{transform:rotate(-45deg) translateX(-2.5px)}.ant-menu-submenu-open.ant-menu-submenu-inline>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before{transform:rotate(45deg) translateX(2.5px)}.ant-menu-vertical-left .ant-menu-submenu-selected,.ant-menu-vertical-right .ant-menu-submenu-selected,.ant-menu-vertical .ant-menu-submenu-selected{color:#2abdd2}.ant-menu-horizontal{line-height:46px;border:0;border-bottom:1px solid #303030;box-shadow:none}.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-item,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-submenu{margin:-1px 20px 0;padding:0}.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-item-active,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-item-open,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-item-selected,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-item:hover,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-submenu-active,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-submenu-open,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-submenu-selected,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-submenu:hover{color:#2abdd2;border-bottom:2px solid #2abdd2}.ant-menu-horizontal>.ant-menu-item,.ant-menu-horizontal>.ant-menu-submenu{position:relative;top:1px;display:inline-block;vertical-align:bottom;border-bottom:2px solid transparent}.ant-menu-horizontal>.ant-menu-submenu>.ant-menu-submenu-title{padding:0}.ant-menu-horizontal>.ant-menu-item a{color:hsla(0,0%,100%,.85)}.ant-menu-horizontal>.ant-menu-item a:hover{color:#2abdd2}.ant-menu-horizontal>.ant-menu-item a:before{bottom:-2px}.ant-menu-horizontal>.ant-menu-item-selected a{color:#2abdd2}.ant-menu-horizontal:after{display:block;clear:both;height:0;content:"\20"}.ant-menu-inline .ant-menu-item,.ant-menu-vertical-left .ant-menu-item,.ant-menu-vertical-right .ant-menu-item,.ant-menu-vertical .ant-menu-item{position:relative}.ant-menu-inline .ant-menu-item:after,.ant-menu-vertical-left .ant-menu-item:after,.ant-menu-vertical-right .ant-menu-item:after,.ant-menu-vertical .ant-menu-item:after{position:absolute;top:0;right:0;bottom:0;border-right:3px solid #2abdd2;transform:scaleY(.0001);opacity:0;transition:transform .15s cubic-bezier(.215,.61,.355,1),opacity .15s cubic-bezier(.215,.61,.355,1);content:""}.ant-menu-inline .ant-menu-item,.ant-menu-inline .ant-menu-submenu-title,.ant-menu-vertical-left .ant-menu-item,.ant-menu-vertical-left .ant-menu-submenu-title,.ant-menu-vertical-right .ant-menu-item,.ant-menu-vertical-right .ant-menu-submenu-title,.ant-menu-vertical .ant-menu-item,.ant-menu-vertical .ant-menu-submenu-title{height:40px;margin-top:4px;margin-bottom:4px;padding:0 16px;overflow:hidden;line-height:40px;text-overflow:ellipsis}.ant-menu-inline .ant-menu-submenu,.ant-menu-vertical-left .ant-menu-submenu,.ant-menu-vertical-right .ant-menu-submenu,.ant-menu-vertical .ant-menu-submenu{padding-bottom:.02px}.ant-menu-inline .ant-menu-item:not(:last-child),.ant-menu-vertical-left .ant-menu-item:not(:last-child),.ant-menu-vertical-right .ant-menu-item:not(:last-child),.ant-menu-vertical .ant-menu-item:not(:last-child){margin-bottom:8px}.ant-menu-inline>.ant-menu-item,.ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title,.ant-menu-vertical-left>.ant-menu-item,.ant-menu-vertical-left>.ant-menu-submenu>.ant-menu-submenu-title,.ant-menu-vertical-right>.ant-menu-item,.ant-menu-vertical-right>.ant-menu-submenu>.ant-menu-submenu-title,.ant-menu-vertical>.ant-menu-item,.ant-menu-vertical>.ant-menu-submenu>.ant-menu-submenu-title{height:40px;line-height:40px}.ant-menu-vertical .ant-menu-submenu-title{padding-right:34px}.ant-menu-inline{width:100%}.ant-menu-inline .ant-menu-item-selected:after,.ant-menu-inline .ant-menu-selected:after{transform:scaleY(1);opacity:1;transition:transform .15s cubic-bezier(.645,.045,.355,1),opacity .15s cubic-bezier(.645,.045,.355,1)}.ant-menu-inline .ant-menu-item,.ant-menu-inline .ant-menu-submenu-title{width:calc(100% + 1px)}.ant-menu-inline .ant-menu-submenu-title{padding-right:34px}.ant-menu-inline-collapsed{width:80px}.ant-menu-inline-collapsed>.ant-menu-item,.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item,.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title,.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title{left:0;padding:0 calc(50% - 8px);text-overflow:clip}.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .ant-menu-submenu-arrow,.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu-inline-collapsed>.ant-menu-item .ant-menu-submenu-arrow,.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-submenu-arrow{display:none}.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .ant-menu-item-icon,.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .anticon,.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-item-icon,.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .anticon,.ant-menu-inline-collapsed>.ant-menu-item .ant-menu-item-icon,.ant-menu-inline-collapsed>.ant-menu-item .anticon,.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-item-icon,.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .anticon{margin:0;font-size:16px;line-height:40px}.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .ant-menu-item-icon+span,.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .anticon+span,.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-item-icon+span,.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .anticon+span,.ant-menu-inline-collapsed>.ant-menu-item .ant-menu-item-icon+span,.ant-menu-inline-collapsed>.ant-menu-item .anticon+span,.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-item-icon+span,.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .anticon+span{display:inline-block;max-width:0;opacity:0}.ant-menu-inline-collapsed .ant-menu-item-icon,.ant-menu-inline-collapsed .anticon{display:inline-block}.ant-menu-inline-collapsed-tooltip{pointer-events:none}.ant-menu-inline-collapsed-tooltip .ant-menu-item-icon,.ant-menu-inline-collapsed-tooltip .anticon{display:none}.ant-menu-inline-collapsed-tooltip a{color:hsla(0,0%,100%,.85)}.ant-menu-inline-collapsed .ant-menu-item-group-title{padding-right:4px;padding-left:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ant-menu-item-group-list{margin:0;padding:0}.ant-menu-item-group-list .ant-menu-item,.ant-menu-item-group-list .ant-menu-submenu-title{padding:0 16px 0 28px}.ant-menu-root.ant-menu-inline,.ant-menu-root.ant-menu-vertical,.ant-menu-root.ant-menu-vertical-left,.ant-menu-root.ant-menu-vertical-right{box-shadow:none}.ant-menu-root.ant-menu-inline-collapsed .ant-menu-item>.ant-menu-inline-collapsed-noicon,.ant-menu-root.ant-menu-inline-collapsed .ant-menu-submenu .ant-menu-submenu-title>.ant-menu-inline-collapsed-noicon{font-size:16px;text-align:center}.ant-menu-sub.ant-menu-inline{padding:0;background:hsla(0,0%,100%,.04);border-radius:0;box-shadow:none}.ant-menu-sub.ant-menu-inline>.ant-menu-item,.ant-menu-sub.ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title{height:40px;line-height:40px;list-style-position:inside;list-style-type:disc}.ant-menu-sub.ant-menu-inline .ant-menu-item-group-title{padding-left:32px}.ant-menu-item-disabled,.ant-menu-submenu-disabled{color:hsla(0,0%,100%,.3)!important;background:none;border-color:transparent!important;cursor:not-allowed}.ant-menu-item-disabled a,.ant-menu-submenu-disabled a{color:hsla(0,0%,100%,.3)!important;pointer-events:none}.ant-menu-item-disabled>.ant-menu-submenu-title,.ant-menu-submenu-disabled>.ant-menu-submenu-title{color:hsla(0,0%,100%,.3)!important;cursor:not-allowed}.ant-menu-item-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-item-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-submenu-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-submenu-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before{background:hsla(0,0%,100%,.3)!important}.ant-layout-header .ant-menu{line-height:inherit}.ant-menu-dark .ant-menu-sub,.ant-menu.ant-menu-dark,.ant-menu.ant-menu-dark .ant-menu-sub{color:hsla(0,0%,100%,.65);background:#1a2029}.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu.ant-menu-dark .ant-menu-submenu-title .ant-menu-submenu-arrow{opacity:.45;transition:all .3s}.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu.ant-menu-dark .ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu.ant-menu-dark .ant-menu-submenu-title .ant-menu-submenu-arrow:before{background:#fff}.ant-menu-dark.ant-menu-submenu-popup{background:transparent}.ant-menu-dark .ant-menu-inline.ant-menu-sub{background:#141414}.ant-menu-dark.ant-menu-horizontal{border-bottom:0}.ant-menu-dark.ant-menu-horizontal>.ant-menu-item,.ant-menu-dark.ant-menu-horizontal>.ant-menu-submenu{top:0;margin-top:0;padding:0 20px;border-color:#1a2029;border-bottom:0}.ant-menu-dark.ant-menu-horizontal>.ant-menu-item:hover{background-color:#2abdd2}.ant-menu-dark.ant-menu-horizontal>.ant-menu-item>a:before{bottom:0}.ant-menu-dark .ant-menu-item,.ant-menu-dark .ant-menu-item-group-title,.ant-menu-dark .ant-menu-item>a,.ant-menu-dark .ant-menu-item>span>a{color:hsla(0,0%,100%,.65)}.ant-menu-dark.ant-menu-inline,.ant-menu-dark.ant-menu-vertical,.ant-menu-dark.ant-menu-vertical-left,.ant-menu-dark.ant-menu-vertical-right{border-right:0}.ant-menu-dark.ant-menu-inline .ant-menu-item,.ant-menu-dark.ant-menu-vertical-left .ant-menu-item,.ant-menu-dark.ant-menu-vertical-right .ant-menu-item,.ant-menu-dark.ant-menu-vertical .ant-menu-item{left:0;margin-left:0;border-right:0}.ant-menu-dark.ant-menu-inline .ant-menu-item:after,.ant-menu-dark.ant-menu-vertical-left .ant-menu-item:after,.ant-menu-dark.ant-menu-vertical-right .ant-menu-item:after,.ant-menu-dark.ant-menu-vertical .ant-menu-item:after{border-right:0}.ant-menu-dark.ant-menu-inline .ant-menu-item,.ant-menu-dark.ant-menu-inline .ant-menu-submenu-title{width:100%}.ant-menu-dark .ant-menu-item-active,.ant-menu-dark .ant-menu-item:hover,.ant-menu-dark .ant-menu-submenu-active,.ant-menu-dark .ant-menu-submenu-open,.ant-menu-dark .ant-menu-submenu-selected,.ant-menu-dark .ant-menu-submenu-title:hover{color:#fff;background-color:transparent}.ant-menu-dark .ant-menu-item-active>a,.ant-menu-dark .ant-menu-item-active>span>a,.ant-menu-dark .ant-menu-item:hover>a,.ant-menu-dark .ant-menu-item:hover>span>a,.ant-menu-dark .ant-menu-submenu-active>a,.ant-menu-dark .ant-menu-submenu-active>span>a,.ant-menu-dark .ant-menu-submenu-open>a,.ant-menu-dark .ant-menu-submenu-open>span>a,.ant-menu-dark .ant-menu-submenu-selected>a,.ant-menu-dark .ant-menu-submenu-selected>span>a,.ant-menu-dark .ant-menu-submenu-title:hover>a,.ant-menu-dark .ant-menu-submenu-title:hover>span>a{color:#fff}.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow{opacity:1}.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before{background:#fff}.ant-menu-dark .ant-menu-item:hover{background-color:transparent}.ant-menu-dark.ant-menu-dark:not(.ant-menu-horizontal) .ant-menu-item-selected{background-color:#2abdd2}.ant-menu-dark .ant-menu-item-selected{color:#fff;border-right:0}.ant-menu-dark .ant-menu-item-selected:after{border-right:0}.ant-menu-dark .ant-menu-item-selected .ant-menu-item-icon,.ant-menu-dark .ant-menu-item-selected .ant-menu-item-icon+span,.ant-menu-dark .ant-menu-item-selected .anticon,.ant-menu-dark .ant-menu-item-selected .anticon+span,.ant-menu-dark .ant-menu-item-selected>a,.ant-menu-dark .ant-menu-item-selected>a:hover,.ant-menu-dark .ant-menu-item-selected>span>a,.ant-menu-dark .ant-menu-item-selected>span>a:hover{color:#fff}.ant-menu-submenu-popup.ant-menu-dark .ant-menu-item-selected,.ant-menu.ant-menu-dark .ant-menu-item-selected{background-color:#2abdd2}.ant-menu-dark .ant-menu-item-disabled,.ant-menu-dark .ant-menu-item-disabled>a,.ant-menu-dark .ant-menu-item-disabled>span>a,.ant-menu-dark .ant-menu-submenu-disabled,.ant-menu-dark .ant-menu-submenu-disabled>a,.ant-menu-dark .ant-menu-submenu-disabled>span>a{color:hsla(0,0%,100%,.3)!important;opacity:.8}.ant-menu-dark .ant-menu-item-disabled>.ant-menu-submenu-title,.ant-menu-dark .ant-menu-submenu-disabled>.ant-menu-submenu-title{color:hsla(0,0%,100%,.3)!important}.ant-menu-dark .ant-menu-item-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-item-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before{background:hsla(0,0%,100%,.3)!important}.ant-menu.ant-menu-rtl{direction:rtl;text-align:right}.ant-menu-rtl .ant-menu-item-group-title{text-align:right}.ant-menu-rtl.ant-menu-inline,.ant-menu-rtl.ant-menu-vertical{border-right:none;border-left:1px solid #303030}.ant-menu-rtl.ant-menu-dark.ant-menu-inline,.ant-menu-rtl.ant-menu-dark.ant-menu-vertical{border-left:none}.ant-menu-rtl.ant-menu-vertical-left.ant-menu-sub>.ant-menu-item,.ant-menu-rtl.ant-menu-vertical-left.ant-menu-sub>.ant-menu-submenu,.ant-menu-rtl.ant-menu-vertical-right.ant-menu-sub>.ant-menu-item,.ant-menu-rtl.ant-menu-vertical-right.ant-menu-sub>.ant-menu-submenu,.ant-menu-rtl.ant-menu-vertical.ant-menu-sub>.ant-menu-item,.ant-menu-rtl.ant-menu-vertical.ant-menu-sub>.ant-menu-submenu{transform-origin:top right}.ant-menu-rtl .ant-menu-item .ant-menu-item-icon,.ant-menu-rtl .ant-menu-item .anticon,.ant-menu-rtl .ant-menu-submenu-title .ant-menu-item-icon,.ant-menu-rtl .ant-menu-submenu-title .anticon{margin-right:auto;margin-left:10px}.ant-menu-rtl .ant-menu-item.ant-menu-item-only-child>.ant-menu-item-icon,.ant-menu-rtl .ant-menu-item.ant-menu-item-only-child>.anticon,.ant-menu-rtl .ant-menu-submenu-title.ant-menu-item-only-child>.ant-menu-item-icon,.ant-menu-rtl .ant-menu-submenu-title.ant-menu-item-only-child>.anticon{margin-left:0}.ant-menu-submenu-rtl.ant-menu-submenu-popup{transform-origin:100% 0}.ant-menu-rtl .ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu-rtl .ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu-rtl .ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu-rtl .ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow{right:auto;left:16px}.ant-menu-rtl .ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu-rtl .ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu-rtl .ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow:before{transform:rotate(-45deg) translateY(-2px)}.ant-menu-rtl .ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-rtl .ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-rtl .ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow:after{transform:rotate(45deg) translateY(2px)}.ant-menu-rtl.ant-menu-inline .ant-menu-item:after,.ant-menu-rtl.ant-menu-vertical-left .ant-menu-item:after,.ant-menu-rtl.ant-menu-vertical-right .ant-menu-item:after,.ant-menu-rtl.ant-menu-vertical .ant-menu-item:after{right:auto;left:0}.ant-menu-rtl.ant-menu-inline .ant-menu-item,.ant-menu-rtl.ant-menu-inline .ant-menu-submenu-title,.ant-menu-rtl.ant-menu-vertical-left .ant-menu-item,.ant-menu-rtl.ant-menu-vertical-left .ant-menu-submenu-title,.ant-menu-rtl.ant-menu-vertical-right .ant-menu-item,.ant-menu-rtl.ant-menu-vertical-right .ant-menu-submenu-title,.ant-menu-rtl.ant-menu-vertical .ant-menu-item,.ant-menu-rtl.ant-menu-vertical .ant-menu-submenu-title{text-align:right}.ant-menu-rtl.ant-menu-inline .ant-menu-submenu-title{padding-right:0;padding-left:34px}.ant-menu-rtl.ant-menu-vertical .ant-menu-submenu-title{padding-right:16px;padding-left:34px}.ant-menu-rtl.ant-menu-inline-collapsed.ant-menu-vertical .ant-menu-submenu-title{padding:0 calc(50% - 8px)}.ant-menu-rtl .ant-menu-item-group-list .ant-menu-item,.ant-menu-rtl .ant-menu-item-group-list .ant-menu-submenu-title{padding:0 28px 0 16px}.ant-menu-sub.ant-menu-inline{border:0}.ant-menu-rtl.ant-menu-sub.ant-menu-inline .ant-menu-item-group-title{padding-right:32px;padding-left:0}.ant-message{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:fixed;top:8px;left:0;z-index:1010;width:100%;pointer-events:none}.ant-message-notice{padding:8px;text-align:center}.ant-message-notice-content{display:inline-block;padding:10px 16px;background:#1a2029;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.48),0 6px 16px 0 rgba(0,0,0,.32),0 9px 28px 8px rgba(0,0,0,.2);pointer-events:all}.ant-message-success .anticon{color:#49aa19}.ant-message-error .anticon{color:#a61d24}.ant-message-warning .anticon{color:#d89614}.ant-message-info .anticon,.ant-message-loading .anticon{color:#2abdd2}.ant-message .anticon{position:relative;top:1px;margin-right:8px;font-size:16px}.ant-message-notice.move-up-leave.move-up-leave-active{animation-name:MessageMoveOut;animation-duration:.3s}@keyframes MessageMoveOut{0%{max-height:150px;padding:8px;opacity:1}to{max-height:0;padding:0;opacity:0}}.ant-message-rtl,.ant-message-rtl span{direction:rtl}.ant-message-rtl .anticon{margin-right:0;margin-left:8px}.ant-modal{box-sizing:border-box;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";pointer-events:none;position:relative;top:100px;width:auto;max-width:calc(100vw - 32px);margin:0 auto;padding:0 0 24px}.ant-modal.zoom-appear,.ant-modal.zoom-enter{transform:none;opacity:0;animation-duration:.3s;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ant-modal-mask{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;height:100%;background-color:rgba(0,0,0,.45)}.ant-modal-mask-hidden{display:none}.ant-modal-wrap{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;outline:0;-webkit-overflow-scrolling:touch;z-index:1000}.ant-modal-title{margin:0;color:hsla(0,0%,100%,.85);font-weight:500;font-size:16px;line-height:22px;word-wrap:break-word}.ant-modal-content{position:relative;background-color:#1a2029;background-clip:padding-box;border:0;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.48),0 6px 16px 0 rgba(0,0,0,.32),0 9px 28px 8px rgba(0,0,0,.2);pointer-events:auto}.ant-modal-close{position:absolute;top:0;right:0;z-index:10;padding:0;color:hsla(0,0%,100%,.45);font-weight:700;line-height:1;text-decoration:none;background:transparent;border:0;outline:0;cursor:pointer;transition:color .3s}.ant-modal-close-x{display:block;width:56px;height:56px;font-size:16px;font-style:normal;line-height:56px;text-align:center;text-transform:none;text-rendering:auto}.ant-modal-close:focus,.ant-modal-close:hover{color:hsla(0,0%,100%,.75);text-decoration:none}.ant-modal-header{padding:16px 24px;color:hsla(0,0%,100%,.85);background:#1a2029;border-bottom:1px solid #303030;border-radius:2px 2px 0 0}.ant-modal-body{padding:24px;font-size:14px;line-height:1.5715;word-wrap:break-word}.ant-modal-footer{padding:10px 16px;text-align:right;background:transparent;border-top:1px solid #303030;border-radius:0 0 2px 2px}.ant-modal-footer button+button{margin-bottom:0;margin-left:8px}.ant-modal-open{overflow:hidden}.ant-modal-centered{text-align:center}.ant-modal-centered:before{display:inline-block;width:0;height:100%;vertical-align:middle;content:""}.ant-modal-centered .ant-modal{top:0;display:inline-block;text-align:left;vertical-align:middle}@media (max-width:767px){.ant-modal{max-width:calc(100vw - 16px);margin:8px auto}.ant-modal-centered .ant-modal{flex:1 1}}.ant-modal-confirm .ant-modal-header{display:none}.ant-modal-confirm .ant-modal-body{padding:32px 32px 24px}.ant-modal-confirm-body-wrapper:before{display:table;content:""}.ant-modal-confirm-body-wrapper:after{display:table;clear:both;content:""}.ant-modal-confirm-body .ant-modal-confirm-title{display:block;overflow:hidden;color:hsla(0,0%,100%,.85);font-weight:500;font-size:16px;line-height:1.4}.ant-modal-confirm-body .ant-modal-confirm-content{margin-top:8px;color:hsla(0,0%,100%,.85);font-size:14px}.ant-modal-confirm-body>.anticon{float:left;margin-right:16px;font-size:22px}.ant-modal-confirm-body>.anticon+.ant-modal-confirm-title+.ant-modal-confirm-content{margin-left:38px}.ant-modal-confirm .ant-modal-confirm-btns{float:right;margin-top:24px}.ant-modal-confirm .ant-modal-confirm-btns button+button{margin-bottom:0;margin-left:8px}.ant-modal-confirm-error .ant-modal-confirm-body>.anticon{color:#a61d24}.ant-modal-confirm-confirm .ant-modal-confirm-body>.anticon,.ant-modal-confirm-warning .ant-modal-confirm-body>.anticon{color:#d89614}.ant-modal-confirm-info .ant-modal-confirm-body>.anticon{color:#2abdd2}.ant-modal-confirm-success .ant-modal-confirm-body>.anticon{color:#49aa19}.ant-modal .ant-anchor-wrapper,.ant-modal .ant-card,.ant-modal .ant-collapse-content,.ant-modal .ant-picker-clear,.ant-modal .ant-slider-handle,.ant-modal .ant-timeline-item-head{background-color:#1a2029}.ant-modal .ant-transfer-list-header{background:#1a2029;border-bottom:1px solid #3a3a3a}.ant-modal .ant-transfer-list-content-item:not(.ant-transfer-list-content-item-disabled):hover{background-color:hsla(0,0%,100%,.08)}.ant-modal tr.ant-table-expanded-row:hover>td,.ant-modal tr.ant-table-expanded-row>td{background:#272727}.ant-modal .ant-table.ant-table-small thead>tr>th{background-color:#1a2029;border-bottom:1px solid #3a3a3a}.ant-modal .ant-table{background-color:#1a2029}.ant-modal .ant-table .ant-table-row-expand-icon{border:1px solid #3a3a3a}.ant-modal .ant-table tfoot>tr>td,.ant-modal .ant-table tfoot>tr>th{border-bottom:1px solid #3a3a3a}.ant-modal .ant-table thead>tr>th{background-color:#272727;border-bottom:1px solid #3a3a3a}.ant-modal .ant-table tbody>tr>td{border-bottom:1px solid #3a3a3a}.ant-modal .ant-table tbody>tr>td.ant-table-cell-fix-left,.ant-modal .ant-table tbody>tr>td.ant-table-cell-fix-right{background-color:#1a2029}.ant-modal .ant-table tbody>tr.ant-table-row:hover>td{background:#303030}.ant-modal .ant-table.ant-table-bordered .ant-table-title{border:1px solid #3a3a3a}.ant-modal .ant-table.ant-table-bordered .ant-table-cell-fix-right-first:after,.ant-modal .ant-table.ant-table-bordered tbody>tr>td,.ant-modal .ant-table.ant-table-bordered tfoot>tr>td,.ant-modal .ant-table.ant-table-bordered tfoot>tr>th,.ant-modal .ant-table.ant-table-bordered thead>tr>th{border-right:1px solid #3a3a3a}.ant-modal .ant-table.ant-table-bordered table thead>tr:not(:last-child)>th{border-bottom:1px solid #303030}.ant-modal .ant-table.ant-table-bordered .ant-table-container{border:1px solid #3a3a3a}.ant-modal .ant-table.ant-table-bordered .ant-table-expanded-row-fixed:after{border-right:1px solid #3a3a3a}.ant-modal .ant-table.ant-table-bordered .ant-table-footer{border:1px solid #3a3a3a}.ant-modal .ant-table .ant-table-filter-trigger-container-open{background-color:#525252}.ant-modal .ant-picker-calendar-full,.ant-modal .ant-picker-calendar-full .ant-picker-panel{background-color:#1a2029}.ant-modal .ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date{border-top:2px solid #3a3a3a}.ant-modal .ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active{background-color:#1a2029;border-bottom:1px solid #1a2029}.ant-modal .ant-badge-count{box-shadow:0 0 0 1px #1a2029}.ant-modal .ant-tree-show-line .ant-tree-switcher{background:#1a2029}.ant-modal-wrap-rtl{direction:rtl}.ant-modal-wrap-rtl .ant-modal-close{right:auto;left:0}.ant-modal-wrap-rtl .ant-modal-footer{text-align:left}.ant-modal-wrap-rtl .ant-modal-footer button+button{margin-right:8px;margin-left:0}.ant-modal-wrap-rtl .ant-modal-confirm-body{direction:rtl}.ant-modal-wrap-rtl .ant-modal-confirm-body>.anticon{float:right;margin-right:0;margin-left:16px}.ant-modal-wrap-rtl .ant-modal-confirm-body>.anticon+.ant-modal-confirm-title+.ant-modal-confirm-content{margin-right:38px;margin-left:0}.ant-modal-wrap-rtl .ant-modal-confirm-btns{float:left}.ant-modal-wrap-rtl .ant-modal-confirm-btns button+button{margin-right:8px;margin-left:0}.ant-modal-wrap-rtl.ant-modal-centered .ant-modal{text-align:right}.ant-notification .ant-anchor-wrapper,.ant-notification .ant-card,.ant-notification .ant-collapse-content,.ant-notification .ant-picker-clear,.ant-notification .ant-slider-handle,.ant-notification .ant-timeline-item-head{background-color:#1a2029}.ant-notification .ant-transfer-list-header{background:#1a2029;border-bottom:1px solid #3a3a3a}.ant-notification .ant-transfer-list-content-item:not(.ant-transfer-list-content-item-disabled):hover{background-color:hsla(0,0%,100%,.08)}.ant-notification tr.ant-table-expanded-row:hover>td,.ant-notification tr.ant-table-expanded-row>td{background:#272727}.ant-notification .ant-table.ant-table-small thead>tr>th{background-color:#1a2029;border-bottom:1px solid #3a3a3a}.ant-notification .ant-table{background-color:#1a2029}.ant-notification .ant-table .ant-table-row-expand-icon{border:1px solid #3a3a3a}.ant-notification .ant-table tfoot>tr>td,.ant-notification .ant-table tfoot>tr>th{border-bottom:1px solid #3a3a3a}.ant-notification .ant-table thead>tr>th{background-color:#272727;border-bottom:1px solid #3a3a3a}.ant-notification .ant-table tbody>tr>td{border-bottom:1px solid #3a3a3a}.ant-notification .ant-table tbody>tr>td.ant-table-cell-fix-left,.ant-notification .ant-table tbody>tr>td.ant-table-cell-fix-right{background-color:#1a2029}.ant-notification .ant-table tbody>tr.ant-table-row:hover>td{background:#303030}.ant-notification .ant-table.ant-table-bordered .ant-table-title{border:1px solid #3a3a3a}.ant-notification .ant-table.ant-table-bordered .ant-table-cell-fix-right-first:after,.ant-notification .ant-table.ant-table-bordered tbody>tr>td,.ant-notification .ant-table.ant-table-bordered tfoot>tr>td,.ant-notification .ant-table.ant-table-bordered tfoot>tr>th,.ant-notification .ant-table.ant-table-bordered thead>tr>th{border-right:1px solid #3a3a3a}.ant-notification .ant-table.ant-table-bordered table thead>tr:not(:last-child)>th{border-bottom:1px solid #303030}.ant-notification .ant-table.ant-table-bordered .ant-table-container{border:1px solid #3a3a3a}.ant-notification .ant-table.ant-table-bordered .ant-table-expanded-row-fixed:after{border-right:1px solid #3a3a3a}.ant-notification .ant-table.ant-table-bordered .ant-table-footer{border:1px solid #3a3a3a}.ant-notification .ant-table .ant-table-filter-trigger-container-open{background-color:#525252}.ant-notification .ant-picker-calendar-full,.ant-notification .ant-picker-calendar-full .ant-picker-panel{background-color:#1a2029}.ant-notification .ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date{border-top:2px solid #3a3a3a}.ant-notification .ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active{background-color:#1a2029;border-bottom:1px solid #1a2029}.ant-notification .ant-badge-count{box-shadow:0 0 0 1px #1a2029}.ant-notification .ant-tree-show-line .ant-tree-switcher{background:#1a2029}.ant-notification{box-sizing:border-box;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:fixed;z-index:1010;margin:0 24px 0 0}.ant-notification-bottomLeft,.ant-notification-topLeft{margin-right:0;margin-left:24px}.ant-notification-bottomLeft .ant-notification-fade-appear.ant-notification-fade-appear-active,.ant-notification-bottomLeft .ant-notification-fade-enter.ant-notification-fade-enter-active,.ant-notification-topLeft .ant-notification-fade-appear.ant-notification-fade-appear-active,.ant-notification-topLeft .ant-notification-fade-enter.ant-notification-fade-enter-active{animation-name:NotificationLeftFadeIn}.ant-notification-close-icon{font-size:14px;cursor:pointer}.ant-notification-hook-holder,.ant-notification-notice{position:relative;width:384px;max-width:calc(100vw - 48px);margin-bottom:16px;margin-left:auto;overflow:hidden;word-wrap:break-word;background:#1a2029;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.48),0 6px 16px 0 rgba(0,0,0,.32),0 9px 28px 8px rgba(0,0,0,.2)}.ant-notification-bottomLeft .ant-notification-hook-holder,.ant-notification-bottomLeft .ant-notification-notice,.ant-notification-topLeft .ant-notification-hook-holder,.ant-notification-topLeft .ant-notification-notice{margin-right:auto;margin-left:0}.ant-notification-hook-holder>.ant-notification-notice{margin-bottom:0;box-shadow:none}.ant-notification-notice{padding:16px 24px;line-height:1.5715}.ant-notification-notice-message{margin-bottom:8px;color:hsla(0,0%,100%,.85);font-size:16px;line-height:24px}.ant-notification-notice-message-single-line-auto-margin{display:block;width:calc(264px - 100%);max-width:4px;background-color:transparent;pointer-events:none}.ant-notification-notice-message-single-line-auto-margin:before{display:block;content:""}.ant-notification-notice-description{font-size:14px}.ant-notification-notice-closable .ant-notification-notice-message{padding-right:24px}.ant-notification-notice-with-icon .ant-notification-notice-message{margin-bottom:4px;margin-left:48px;font-size:16px}.ant-notification-notice-with-icon .ant-notification-notice-description{margin-left:48px;font-size:14px}.ant-notification-notice-icon{position:absolute;margin-left:4px;font-size:24px;line-height:24px}.anticon.ant-notification-notice-icon-success{color:#49aa19}.anticon.ant-notification-notice-icon-info{color:#2abdd2}.anticon.ant-notification-notice-icon-warning{color:#d89614}.anticon.ant-notification-notice-icon-error{color:#a61d24}.ant-notification-notice-close{position:absolute;top:16px;right:22px;color:hsla(0,0%,100%,.45);outline:none}.ant-notification-notice-close:hover{color:hsla(0,0%,100%,.85)}.ant-notification-notice-btn{float:right;margin-top:16px}.ant-notification .notification-fade-effect{animation-duration:.24s;animation-timing-function:cubic-bezier(.645,.045,.355,1);animation-fill-mode:both}.ant-notification-fade-appear,.ant-notification-fade-enter{opacity:0;animation-play-state:paused}.ant-notification-fade-appear,.ant-notification-fade-enter,.ant-notification-fade-leave{animation-duration:.24s;animation-timing-function:cubic-bezier(.645,.045,.355,1);animation-fill-mode:both}.ant-notification-fade-leave{animation-duration:.2s;animation-play-state:paused}.ant-notification-fade-appear.ant-notification-fade-appear-active,.ant-notification-fade-enter.ant-notification-fade-enter-active{animation-name:NotificationFadeIn;animation-play-state:running}.ant-notification-fade-leave.ant-notification-fade-leave-active{animation-name:NotificationFadeOut;animation-play-state:running}@keyframes NotificationFadeIn{0%{left:384px;opacity:0}to{left:0;opacity:1}}@keyframes NotificationLeftFadeIn{0%{right:384px;opacity:0}to{right:0;opacity:1}}@keyframes NotificationFadeOut{0%{max-height:150px;margin-bottom:16px;opacity:1}to{max-height:0;margin-bottom:0;padding-top:0;padding-bottom:0;opacity:0}}.ant-notification-rtl{direction:rtl}.ant-notification-rtl .ant-notification-notice-closable .ant-notification-notice-message{padding-right:0;padding-left:24px}.ant-notification-rtl .ant-notification-notice-with-icon .ant-notification-notice-description,.ant-notification-rtl .ant-notification-notice-with-icon .ant-notification-notice-message{margin-right:48px;margin-left:0}.ant-notification-rtl .ant-notification-notice-icon{margin-right:4px;margin-left:0}.ant-notification-rtl .ant-notification-notice-close{right:auto;left:22px}.ant-notification-rtl .ant-notification-notice-btn{float:left}.ant-page-header{box-sizing:border-box;margin:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:relative;padding:16px 24px;background-color:#141414}.ant-page-header-ghost{background-color:transparent}.ant-page-header.has-breadcrumb{padding-top:12px}.ant-page-header.has-footer{padding-bottom:0}.ant-page-header-back{margin-right:16px;font-size:16px;line-height:1}.ant-page-header-back-button{color:#2abdd2;text-decoration:none;outline:none;transition:color .3s;color:inherit;cursor:pointer}.ant-page-header-back-button:focus,.ant-page-header-back-button:hover{color:#228290}.ant-page-header-back-button:active{color:#4abdca}.ant-page-header .ant-divider-vertical{height:14px;margin:0 12px;vertical-align:middle}.ant-breadcrumb+.ant-page-header-heading{margin-top:8px}.ant-page-header-heading{display:flex;justify-content:space-between}.ant-page-header-heading-left{display:flex;align-items:center;margin:4px 0;overflow:hidden}.ant-page-header-heading-title{margin-right:12px;margin-bottom:0;color:hsla(0,0%,100%,.85);font-weight:600;font-size:20px;line-height:32px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ant-page-header-heading .ant-avatar{margin-right:12px}.ant-page-header-heading-sub-title{margin-right:12px;color:hsla(0,0%,100%,.45);font-size:14px;line-height:1.5715;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ant-page-header-heading-extra{margin:4px 0;white-space:nowrap}.ant-page-header-heading-extra>*{margin-left:12px;white-space:unset}.ant-page-header-heading-extra>:first-child{margin-left:0}.ant-page-header-content{padding-top:12px}.ant-page-header-footer{margin-top:16px}.ant-page-header-footer .ant-tabs>.ant-tabs-nav{margin:0}.ant-page-header-footer .ant-tabs>.ant-tabs-nav:before{border:none}.ant-page-header-footer .ant-tabs .ant-tabs-tab{padding:8px 0;font-size:16px}.ant-page-header-compact .ant-page-header-heading{flex-wrap:wrap}.ant-page-header-rtl{direction:rtl}.ant-page-header-rtl .ant-page-header-back{float:right;margin-right:0;margin-left:16px}.ant-page-header-rtl .ant-page-header-heading-title,.ant-page-header-rtl .ant-page-header-heading .ant-avatar{margin-right:0;margin-left:12px}.ant-page-header-rtl .ant-page-header-heading-sub-title{float:right;margin-right:0;margin-left:12px}.ant-page-header-rtl .ant-page-header-heading-tags{float:right}.ant-page-header-rtl .ant-page-header-heading-extra{float:left}.ant-page-header-rtl .ant-page-header-heading-extra>*{margin-right:12px;margin-left:0}.ant-page-header-rtl .ant-page-header-heading-extra>:first-child{margin-right:0}.ant-page-header-rtl .ant-page-header-footer .ant-tabs-bar .ant-tabs-nav{float:right}.ant-pagination{box-sizing:border-box;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;font-feature-settings:"tnum","tnum"}.ant-pagination,.ant-pagination ol,.ant-pagination ul{margin:0;padding:0;list-style:none}.ant-pagination:after{display:block;clear:both;height:0;overflow:hidden;visibility:hidden;content:" "}.ant-pagination-item,.ant-pagination-total-text{display:inline-block;height:32px;margin-right:8px;line-height:30px;vertical-align:middle}.ant-pagination-item{min-width:32px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";text-align:center;list-style:none;background-color:transparent;border:1px solid #434343;border-radius:2px;outline:0;cursor:pointer;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ant-pagination-item a{display:block;padding:0 6px;color:hsla(0,0%,100%,.85);transition:none}.ant-pagination-item a:hover{text-decoration:none}.ant-pagination-item:focus,.ant-pagination-item:hover{border-color:#2abdd2;transition:all .3s}.ant-pagination-item:focus a,.ant-pagination-item:hover a{color:#2abdd2}.ant-pagination-item-active{font-weight:500;background:transparent;border-color:#2abdd2}.ant-pagination-item-active a{color:#2abdd2}.ant-pagination-item-active:focus,.ant-pagination-item-active:hover{border-color:#228290}.ant-pagination-item-active:focus a,.ant-pagination-item-active:hover a{color:#228290}.ant-pagination-jump-next,.ant-pagination-jump-prev{outline:0}.ant-pagination-jump-next .ant-pagination-item-container,.ant-pagination-jump-prev .ant-pagination-item-container{position:relative}.ant-pagination-jump-next .ant-pagination-item-container .ant-pagination-item-link-icon,.ant-pagination-jump-prev .ant-pagination-item-container .ant-pagination-item-link-icon{color:#2abdd2;font-size:12px;letter-spacing:-1px;opacity:0;transition:all .2s}.ant-pagination-jump-next .ant-pagination-item-container .ant-pagination-item-link-icon-svg,.ant-pagination-jump-prev .ant-pagination-item-container .ant-pagination-item-link-icon-svg{top:0;right:0;bottom:0;left:0;margin:auto}.ant-pagination-jump-next .ant-pagination-item-container .ant-pagination-item-ellipsis,.ant-pagination-jump-prev .ant-pagination-item-container .ant-pagination-item-ellipsis{position:absolute;top:0;right:0;bottom:0;left:0;display:block;margin:auto;color:hsla(0,0%,100%,.3);font-family:Arial,Helvetica,sans-serif;letter-spacing:2px;text-align:center;text-indent:.13em;opacity:1;transition:all .2s}.ant-pagination-jump-next:focus .ant-pagination-item-link-icon,.ant-pagination-jump-next:hover .ant-pagination-item-link-icon,.ant-pagination-jump-prev:focus .ant-pagination-item-link-icon,.ant-pagination-jump-prev:hover .ant-pagination-item-link-icon{opacity:1}.ant-pagination-jump-next:focus .ant-pagination-item-ellipsis,.ant-pagination-jump-next:hover .ant-pagination-item-ellipsis,.ant-pagination-jump-prev:focus .ant-pagination-item-ellipsis,.ant-pagination-jump-prev:hover .ant-pagination-item-ellipsis{opacity:0}.ant-pagination-jump-next,.ant-pagination-jump-prev,.ant-pagination-prev{margin-right:8px}.ant-pagination-jump-next,.ant-pagination-jump-prev,.ant-pagination-next,.ant-pagination-prev{display:inline-block;min-width:32px;height:32px;color:hsla(0,0%,100%,.85);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";line-height:32px;text-align:center;vertical-align:middle;list-style:none;border-radius:2px;cursor:pointer;transition:all .3s}.ant-pagination-next,.ant-pagination-prev{font-family:Arial,Helvetica,sans-serif;outline:0}.ant-pagination-next button,.ant-pagination-prev button{color:hsla(0,0%,100%,.85);cursor:pointer;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ant-pagination-next:hover button,.ant-pagination-prev:hover button{border-color:#228290}.ant-pagination-next .ant-pagination-item-link,.ant-pagination-prev .ant-pagination-item-link{display:block;width:100%;height:100%;padding:0;font-size:12px;text-align:center;background-color:transparent;border:1px solid #434343;border-radius:2px;outline:none;transition:all .3s}.ant-pagination-next:focus .ant-pagination-item-link,.ant-pagination-next:hover .ant-pagination-item-link,.ant-pagination-prev:focus .ant-pagination-item-link,.ant-pagination-prev:hover .ant-pagination-item-link{color:#2abdd2;border-color:#2abdd2}.ant-pagination-disabled,.ant-pagination-disabled:focus,.ant-pagination-disabled:hover{cursor:not-allowed}.ant-pagination-disabled .ant-pagination-item-link,.ant-pagination-disabled:focus .ant-pagination-item-link,.ant-pagination-disabled:hover .ant-pagination-item-link{color:hsla(0,0%,100%,.3);border-color:#434343;cursor:not-allowed}.ant-pagination-slash{margin:0 10px 0 5px}.ant-pagination-options{display:inline-block;margin-left:16px;vertical-align:middle}@media (-ms-high-contrast:none){.ant-pagination-options,.ant-pagination-options ::-ms-backdrop{vertical-align:top}}.ant-pagination-options-size-changer.ant-select{display:inline-block;width:auto}.ant-pagination-options-quick-jumper{display:inline-block;height:32px;margin-left:8px;line-height:32px;vertical-align:top}.ant-pagination-options-quick-jumper input{position:relative;display:inline-block;width:100%;min-width:0;padding:4px 11px;color:hsla(0,0%,100%,.85);font-size:14px;line-height:1.5715;background-color:transparent;background-image:none;border:1px solid #434343;border-radius:2px;transition:all .3s;width:50px;margin:0 8px}.ant-pagination-options-quick-jumper input::-webkit-input-placeholder{color:hsla(0,0%,100%,.3)}.ant-pagination-options-quick-jumper input:-ms-input-placeholder{color:hsla(0,0%,100%,.3)}.ant-pagination-options-quick-jumper input::placeholder{color:hsla(0,0%,100%,.3)}.ant-pagination-options-quick-jumper input:-ms-input-placeholder{text-overflow:ellipsis}.ant-pagination-options-quick-jumper input:placeholder-shown{text-overflow:ellipsis}.ant-pagination-options-quick-jumper input:hover{border-color:#228290;border-right-width:1px!important}.ant-input-rtl .ant-pagination-options-quick-jumper input:hover{border-right-width:0;border-left-width:1px!important}.ant-pagination-options-quick-jumper input-focused,.ant-pagination-options-quick-jumper input:focus{border-color:#2abdd2;border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(42,189,210,.2)}.ant-input-rtl .ant-pagination-options-quick-jumper input-focused,.ant-input-rtl .ant-pagination-options-quick-jumper input:focus{border-right-width:0;border-left-width:1px!important}.ant-pagination-options-quick-jumper input-disabled{color:hsla(0,0%,100%,.3);background-color:hsla(0,0%,100%,.08);cursor:not-allowed;opacity:1}.ant-pagination-options-quick-jumper input-disabled:hover{border-color:#434343;border-right-width:1px!important}.ant-pagination-options-quick-jumper input[disabled]{color:hsla(0,0%,100%,.3);background-color:hsla(0,0%,100%,.08);cursor:not-allowed;opacity:1}.ant-pagination-options-quick-jumper input[disabled]:hover{border-color:#434343;border-right-width:1px!important}.ant-pagination-options-quick-jumper input-borderless,.ant-pagination-options-quick-jumper input-borderless-disabled,.ant-pagination-options-quick-jumper input-borderless-focused,.ant-pagination-options-quick-jumper input-borderless:focus,.ant-pagination-options-quick-jumper input-borderless:hover,.ant-pagination-options-quick-jumper input-borderless[disabled]{background-color:transparent;border:none;box-shadow:none}textarea.ant-pagination-options-quick-jumper input{max-width:100%;height:auto;min-height:32px;line-height:1.5715;vertical-align:bottom;transition:all .3s,height 0s}.ant-pagination-options-quick-jumper input-lg{padding:6.5px 11px;font-size:16px}.ant-pagination-options-quick-jumper input-sm{padding:0 7px}.ant-pagination-options-quick-jumper input-rtl{direction:rtl}.ant-pagination-simple .ant-pagination-next,.ant-pagination-simple .ant-pagination-prev{height:24px;line-height:24px;vertical-align:top}.ant-pagination-simple .ant-pagination-next .ant-pagination-item-link,.ant-pagination-simple .ant-pagination-prev .ant-pagination-item-link{height:24px;background-color:transparent;border:0}.ant-pagination-simple .ant-pagination-next .ant-pagination-item-link:after,.ant-pagination-simple .ant-pagination-prev .ant-pagination-item-link:after{height:24px;line-height:24px}.ant-pagination-simple .ant-pagination-simple-pager{display:inline-block;height:24px;margin-right:8px}.ant-pagination-simple .ant-pagination-simple-pager input{box-sizing:border-box;height:100%;margin-right:8px;padding:0 6px;text-align:center;background-color:transparent;border:1px solid #434343;border-radius:2px;outline:none;transition:border-color .3s}.ant-pagination-simple .ant-pagination-simple-pager input:hover{border-color:#2abdd2}.ant-pagination-simple .ant-pagination-simple-pager input[disabled]{color:hsla(0,0%,100%,.3);background:hsla(0,0%,100%,.08);border-color:#434343;cursor:not-allowed}.ant-pagination.mini .ant-pagination-simple-pager,.ant-pagination.mini .ant-pagination-total-text{height:24px;line-height:24px}.ant-pagination.mini .ant-pagination-item{min-width:24px;height:24px;margin:0;line-height:22px}.ant-pagination.mini .ant-pagination-item:not(.ant-pagination-item-active){background:transparent;border-color:transparent}.ant-pagination.mini .ant-pagination-next,.ant-pagination.mini .ant-pagination-prev{min-width:24px;height:24px;margin:0;line-height:24px}.ant-pagination.mini .ant-pagination-next .ant-pagination-item-link,.ant-pagination.mini .ant-pagination-prev .ant-pagination-item-link{background:transparent;border-color:transparent}.ant-pagination.mini .ant-pagination-next .ant-pagination-item-link:after,.ant-pagination.mini .ant-pagination-prev .ant-pagination-item-link:after{height:24px;line-height:24px}.ant-pagination.mini .ant-pagination-jump-next,.ant-pagination.mini .ant-pagination-jump-prev{height:24px;margin-right:0;line-height:24px}.ant-pagination.mini .ant-pagination-options{margin-left:2px}.ant-pagination.mini .ant-pagination-options-size-changer{top:0}.ant-pagination.mini .ant-pagination-options-quick-jumper{height:24px;line-height:24px}.ant-pagination.mini .ant-pagination-options-quick-jumper input{padding:0 7px;width:44px}.ant-pagination.ant-pagination-disabled{cursor:not-allowed}.ant-pagination.ant-pagination-disabled .ant-pagination-item{background:hsla(0,0%,100%,.08);border-color:#434343;cursor:not-allowed}.ant-pagination.ant-pagination-disabled .ant-pagination-item a{color:hsla(0,0%,100%,.3);background:transparent;border:none;cursor:not-allowed}.ant-pagination.ant-pagination-disabled .ant-pagination-item-active{background:hsla(0,0%,100%,.25);border-color:transparent}.ant-pagination.ant-pagination-disabled .ant-pagination-item-active a{color:#000}.ant-pagination.ant-pagination-disabled .ant-pagination-item-link{color:hsla(0,0%,100%,.3);background:hsla(0,0%,100%,.08);border-color:#434343;cursor:not-allowed}.ant-pagination-simple.ant-pagination.ant-pagination-disabled .ant-pagination-item-link{background:transparent}.ant-pagination.ant-pagination-disabled .ant-pagination-item-link-icon{opacity:0}.ant-pagination.ant-pagination-disabled .ant-pagination-item-ellipsis{opacity:1}.ant-pagination.ant-pagination-disabled .ant-pagination-simple-pager{color:hsla(0,0%,100%,.3)}@media only screen and (max-width:992px){.ant-pagination-item-after-jump-prev,.ant-pagination-item-before-jump-next{display:none}}@media only screen and (max-width:576px){.ant-pagination-options{display:none}}.ant-pagination-rtl .ant-pagination-item,.ant-pagination-rtl .ant-pagination-jump-next,.ant-pagination-rtl .ant-pagination-jump-prev,.ant-pagination-rtl .ant-pagination-prev,.ant-pagination-rtl .ant-pagination-total-text{margin-right:0;margin-left:8px}.ant-pagination-rtl .ant-pagination-slash{margin:0 5px 0 10px}.ant-pagination-rtl .ant-pagination-options{margin-right:16px;margin-left:0}.ant-pagination-rtl .ant-pagination-options .ant-pagination-options-size-changer.ant-select{margin-right:0;margin-left:8px}.ant-pagination-rtl .ant-pagination-options .ant-pagination-options-quick-jumper{margin-left:0}.ant-pagination-rtl.ant-pagination-simple .ant-pagination-simple-pager,.ant-pagination-rtl.ant-pagination-simple .ant-pagination-simple-pager input{margin-right:0;margin-left:8px}.ant-pagination-rtl.ant-pagination.mini .ant-pagination-options{margin-right:2px;margin-left:0}.ant-popconfirm{z-index:1060}.ant-popover{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:absolute;top:0;left:0;z-index:1030;font-weight:400;white-space:normal;text-align:left;cursor:auto;-webkit-user-select:text;-ms-user-select:text;user-select:text}.ant-popover:after{position:absolute;background:hsla(0,0%,100%,.01);content:""}.ant-popover-hidden{display:none}.ant-popover-placement-top,.ant-popover-placement-topLeft,.ant-popover-placement-topRight{padding-bottom:10px}.ant-popover-placement-right,.ant-popover-placement-rightBottom,.ant-popover-placement-rightTop{padding-left:10px}.ant-popover-placement-bottom,.ant-popover-placement-bottomLeft,.ant-popover-placement-bottomRight{padding-top:10px}.ant-popover-placement-left,.ant-popover-placement-leftBottom,.ant-popover-placement-leftTop{padding-right:10px}.ant-popover-inner{background-color:#1a2029;background-clip:padding-box;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.48),0 6px 16px 0 rgba(0,0,0,.32),0 9px 28px 8px rgba(0,0,0,.2);box-shadow:0 0 8px rgba(0,0,0,.45)\9}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.ant-popover-inner{box-shadow:0 3px 6px -4px rgba(0,0,0,.48),0 6px 16px 0 rgba(0,0,0,.32),0 9px 28px 8px rgba(0,0,0,.2)}}.ant-popover-title{min-width:177px;min-height:32px;margin:0;padding:5px 16px 4px;color:hsla(0,0%,100%,.85);font-weight:500;border-bottom:1px solid #303030}.ant-popover-inner-content{padding:12px 16px;color:hsla(0,0%,100%,.85)}.ant-popover-message{position:relative;padding:4px 0 12px;color:hsla(0,0%,100%,.85);font-size:14px}.ant-popover-message>.anticon{position:absolute;top:8.0005px;color:#d89614;font-size:14px}.ant-popover-message-title{padding-left:22px}.ant-popover-buttons{margin-bottom:4px;text-align:right}.ant-popover-buttons button{margin-left:8px}.ant-popover-arrow{position:absolute;display:block;width:8.48528137px;height:8.48528137px;background:transparent;border-style:solid;border-width:4.24264069px;transform:rotate(45deg)}.ant-popover-placement-top>.ant-popover-content>.ant-popover-arrow,.ant-popover-placement-topLeft>.ant-popover-content>.ant-popover-arrow,.ant-popover-placement-topRight>.ant-popover-content>.ant-popover-arrow{bottom:6.2px;border-color:transparent #1a2029 #1a2029 transparent;box-shadow:3px 3px 7px rgba(0,0,0,.07)}.ant-popover-placement-top>.ant-popover-content>.ant-popover-arrow{left:50%;transform:translateX(-50%) rotate(45deg)}.ant-popover-placement-topLeft>.ant-popover-content>.ant-popover-arrow{left:16px}.ant-popover-placement-topRight>.ant-popover-content>.ant-popover-arrow{right:16px}.ant-popover-placement-right>.ant-popover-content>.ant-popover-arrow,.ant-popover-placement-rightBottom>.ant-popover-content>.ant-popover-arrow,.ant-popover-placement-rightTop>.ant-popover-content>.ant-popover-arrow{left:6px;border-color:transparent transparent #1a2029 #1a2029;box-shadow:-3px 3px 7px rgba(0,0,0,.07)}.ant-popover-placement-right>.ant-popover-content>.ant-popover-arrow{top:50%;transform:translateY(-50%) rotate(45deg)}.ant-popover-placement-rightTop>.ant-popover-content>.ant-popover-arrow{top:12px}.ant-popover-placement-rightBottom>.ant-popover-content>.ant-popover-arrow{bottom:12px}.ant-popover-placement-bottom>.ant-popover-content>.ant-popover-arrow,.ant-popover-placement-bottomLeft>.ant-popover-content>.ant-popover-arrow,.ant-popover-placement-bottomRight>.ant-popover-content>.ant-popover-arrow{top:6px;border-color:#1a2029 transparent transparent #1a2029;box-shadow:-2px -2px 5px rgba(0,0,0,.06)}.ant-popover-placement-bottom>.ant-popover-content>.ant-popover-arrow{left:50%;transform:translateX(-50%) rotate(45deg)}.ant-popover-placement-bottomLeft>.ant-popover-content>.ant-popover-arrow{left:16px}.ant-popover-placement-bottomRight>.ant-popover-content>.ant-popover-arrow{right:16px}.ant-popover-placement-left>.ant-popover-content>.ant-popover-arrow,.ant-popover-placement-leftBottom>.ant-popover-content>.ant-popover-arrow,.ant-popover-placement-leftTop>.ant-popover-content>.ant-popover-arrow{right:6px;border-color:#1a2029 #1a2029 transparent transparent;box-shadow:3px -3px 7px rgba(0,0,0,.07)}.ant-popover-placement-left>.ant-popover-content>.ant-popover-arrow{top:50%;transform:translateY(-50%) rotate(45deg)}.ant-popover-placement-leftTop>.ant-popover-content>.ant-popover-arrow{top:12px}.ant-popover-placement-leftBottom>.ant-popover-content>.ant-popover-arrow{bottom:12px}.ant-popover-rtl{direction:rtl;text-align:right}.ant-popover-rtl .ant-popover-message-title{padding-right:22px;padding-left:16px}.ant-popover-rtl .ant-popover-buttons{text-align:left}.ant-popover-rtl .ant-popover-buttons button{margin-right:8px;margin-left:0}.ant-progress{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";display:inline-block}.ant-progress-line{position:relative;width:100%;font-size:14px}.ant-progress-steps{display:inline-block}.ant-progress-steps-outer{display:flex;flex-direction:row;align-items:center}.ant-progress-steps-item{flex-shrink:0;min-width:2px;margin-right:2px;background:hsla(0,0%,100%,.08);transition:all .3s}.ant-progress-steps-item-active{background:#177ddc}.ant-progress-small.ant-progress-line,.ant-progress-small.ant-progress-line .ant-progress-text .anticon{font-size:12px}.ant-progress-outer{display:inline-block;width:100%;margin-right:0;padding-right:0}.ant-progress-show-info .ant-progress-outer{margin-right:calc(-2em - 8px);padding-right:calc(2em + 8px)}.ant-progress-inner{position:relative;display:inline-block;width:100%;overflow:hidden;vertical-align:middle;background-color:hsla(0,0%,100%,.08);border-radius:100px}.ant-progress-circle-trail{stroke:hsla(0,0%,100%,.08)}.ant-progress-circle-path{animation:ant-progress-appear .3s}.ant-progress-inner:not(.ant-progress-circle-gradient) .ant-progress-circle-path{stroke:#177ddc}.ant-progress-bg,.ant-progress-success-bg{position:relative;background-color:#177ddc;border-radius:100px;transition:all .4s cubic-bezier(.08,.82,.17,1) 0s}.ant-progress-success-bg{position:absolute;top:0;left:0;background-color:#49aa19}.ant-progress-text{display:inline-block;width:2em;margin-left:8px;color:hsla(0,0%,100%,.85);font-size:1em;line-height:1;white-space:nowrap;text-align:left;vertical-align:middle;word-break:normal}.ant-progress-text .anticon{font-size:14px}.ant-progress-status-active .ant-progress-bg:before{position:absolute;top:0;right:0;bottom:0;left:0;background:#141414;border-radius:10px;opacity:0;animation:ant-progress-active 2.4s cubic-bezier(.23,1,.32,1) infinite;content:""}.ant-progress-status-exception .ant-progress-bg{background-color:#a61d24}.ant-progress-status-exception .ant-progress-text{color:#a61d24}.ant-progress-status-exception .ant-progress-inner:not(.ant-progress-circle-gradient) .ant-progress-circle-path{stroke:#a61d24}.ant-progress-status-success .ant-progress-bg{background-color:#49aa19}.ant-progress-status-success .ant-progress-text{color:#49aa19}.ant-progress-status-success .ant-progress-inner:not(.ant-progress-circle-gradient) .ant-progress-circle-path{stroke:#49aa19}.ant-progress-circle .ant-progress-inner{position:relative;line-height:1;background-color:transparent}.ant-progress-circle .ant-progress-text{position:absolute;top:50%;left:50%;width:100%;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:1em;line-height:1;white-space:normal;text-align:center;transform:translate(-50%,-50%)}.ant-progress-circle .ant-progress-text .anticon{font-size:1.16666667em}.ant-progress-circle.ant-progress-status-exception .ant-progress-text{color:#a61d24}.ant-progress-circle.ant-progress-status-success .ant-progress-text{color:#49aa19}@keyframes ant-progress-active{0%{width:0;opacity:.1}20%{width:0;opacity:.5}to{width:100%;opacity:0}}.ant-progress-rtl{direction:rtl}.ant-progress-rtl.ant-progress-show-info .ant-progress-outer{margin-right:0;margin-left:calc(-2em - 8px);padding-right:0;padding-left:calc(2em + 8px)}.ant-progress-rtl .ant-progress-success-bg{right:0;left:auto}.ant-progress-rtl.ant-progress-line .ant-progress-text,.ant-progress-rtl.ant-progress-steps .ant-progress-text{margin-right:8px;margin-left:0;text-align:right}.ant-radio-group{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";display:inline-block;font-size:0;line-height:unset}.ant-radio-group .ant-badge-count{z-index:1}.ant-radio-group>.ant-badge:not(:first-child)>.ant-radio-button-wrapper{border-left:none}.ant-radio-wrapper{margin:0 8px 0 0}.ant-radio,.ant-radio-wrapper{box-sizing:border-box;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:relative;display:inline-block;white-space:nowrap;cursor:pointer}.ant-radio{margin:0;top:0;line-height:1;vertical-align:text-bottom;outline:none}.ant-radio-input:focus+.ant-radio-inner,.ant-radio-wrapper:hover .ant-radio,.ant-radio:hover .ant-radio-inner{border-color:#2abdd2}.ant-radio-input:focus+.ant-radio-inner{box-shadow:0 0 0 3px rgba(42,189,210,.08)}.ant-radio-checked:after{position:absolute;top:0;left:0;width:100%;height:100%;border:1px solid #2abdd2;border-radius:50%;visibility:hidden;animation:antRadioEffect .36s ease-in-out;animation-fill-mode:both;content:""}.ant-radio-wrapper:hover .ant-radio:after,.ant-radio:hover:after{visibility:visible}.ant-radio-inner{position:relative;top:0;left:0;display:block;width:16px;height:16px;background-color:transparent;border:1px solid #434343;border-radius:50%;transition:all .3s}.ant-radio-inner:after{position:absolute;top:3px;left:3px;display:table;width:8px;height:8px;background-color:#2abdd2;border-top:0;border-left:0;border-radius:8px;transform:scale(0);opacity:0;transition:all .3s cubic-bezier(.78,.14,.15,.86);content:" "}.ant-radio-input{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;cursor:pointer;opacity:0}.ant-radio-checked .ant-radio-inner{border-color:#2abdd2}.ant-radio-checked .ant-radio-inner:after{transform:scale(1);opacity:1;transition:all .3s cubic-bezier(.78,.14,.15,.86)}.ant-radio-disabled{cursor:not-allowed}.ant-radio-disabled .ant-radio-inner{background-color:hsla(0,0%,100%,.08);border-color:#434343!important;cursor:not-allowed}.ant-radio-disabled .ant-radio-inner:after{background-color:hsla(0,0%,100%,.2)}.ant-radio-disabled .ant-radio-input{cursor:not-allowed}.ant-radio-disabled+span{color:hsla(0,0%,100%,.3);cursor:not-allowed}span.ant-radio+*{padding-right:8px;padding-left:8px}.ant-radio-button-wrapper{position:relative;display:inline-block;height:32px;margin:0;padding:0 15px;color:hsla(0,0%,100%,.85);font-size:14px;line-height:30px;background:transparent;border-color:#434343;border-style:solid;border-width:1.02px 1px 1px 0;cursor:pointer;transition:color .3s,background .3s,border-color .3s,box-shadow .3s}.ant-radio-button-wrapper a{color:hsla(0,0%,100%,.85)}.ant-radio-button-wrapper>.ant-radio-button{position:absolute;top:0;left:0;z-index:-1;width:100%;height:100%}.ant-radio-group-large .ant-radio-button-wrapper{height:40px;font-size:16px;line-height:38px}.ant-radio-group-small .ant-radio-button-wrapper{height:24px;padding:0 7px;line-height:22px}.ant-radio-button-wrapper:not(:first-child):before{position:absolute;top:-1px;left:-1px;display:block;box-sizing:content-box;width:1px;height:100%;padding:1px 0;background-color:#434343;transition:background-color .3s;content:""}.ant-radio-button-wrapper:first-child{border-left:1px solid #434343;border-radius:2px 0 0 2px}.ant-radio-button-wrapper:last-child{border-radius:0 2px 2px 0}.ant-radio-button-wrapper:first-child:last-child{border-radius:2px}.ant-radio-button-wrapper:hover{position:relative;color:#2abdd2}.ant-radio-button-wrapper:focus-within{box-shadow:0 0 0 3px rgba(42,189,210,.08)}.ant-radio-button-wrapper .ant-radio-inner,.ant-radio-button-wrapper input[type=checkbox],.ant-radio-button-wrapper input[type=radio]{width:0;height:0;opacity:0;pointer-events:none}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled){z-index:1;color:#2abdd2;background:transparent;border-color:#2abdd2}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):before{background-color:#2abdd2}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):first-child{border-color:#2abdd2}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover{color:#228290;border-color:#228290}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover:before{background-color:#228290}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active{color:#4abdca;border-color:#4abdca}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active:before{background-color:#4abdca}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within{box-shadow:0 0 0 3px rgba(42,189,210,.08)}.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled){color:#fff;background:#2abdd2;border-color:#2abdd2}.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover{color:#fff;background:#228290;border-color:#228290}.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active{color:#fff;background:#4abdca;border-color:#4abdca}.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within{box-shadow:0 0 0 3px rgba(42,189,210,.08)}.ant-radio-button-wrapper-disabled{cursor:not-allowed}.ant-radio-button-wrapper-disabled,.ant-radio-button-wrapper-disabled:first-child,.ant-radio-button-wrapper-disabled:hover{color:hsla(0,0%,100%,.3);background-color:hsla(0,0%,100%,.08);border-color:#434343}.ant-radio-button-wrapper-disabled:first-child{border-left-color:#434343}.ant-radio-button-wrapper-disabled.ant-radio-button-wrapper-checked{color:hsla(0,0%,100%,.3);background-color:hsla(0,0%,100%,.2);border-color:#434343;box-shadow:none}@keyframes antRadioEffect{0%{transform:scale(1);opacity:.5}to{transform:scale(1.6);opacity:0}}.ant-radio-group.ant-radio-group-rtl{direction:rtl}.ant-radio-wrapper.ant-radio-wrapper-rtl{margin-right:0;margin-left:8px;direction:rtl}.ant-radio-button-wrapper.ant-radio-button-wrapper-rtl{border-right-width:0;border-left-width:1px}.ant-radio-button-wrapper.ant-radio-button-wrapper-rtl.ant-radio-button-wrapper:not(:first-child):before{right:-1px;left:0}.ant-radio-button-wrapper.ant-radio-button-wrapper-rtl.ant-radio-button-wrapper:first-child{border-right:1px solid #434343;border-radius:0 2px 2px 0}.ant-radio-button-wrapper-checked:not([class*=" ant-radio-button-wrapper-disabled"]).ant-radio-button-wrapper:first-child{border-right-color:#228290}.ant-radio-button-wrapper.ant-radio-button-wrapper-rtl.ant-radio-button-wrapper:last-child{border-radius:2px 0 0 2px}.ant-radio-button-wrapper.ant-radio-button-wrapper-rtl.ant-radio-button-wrapper-disabled:first-child{border-right-color:#434343}.ant-rate{box-sizing:border-box;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;font-feature-settings:"tnum","tnum";display:inline-block;margin:0;padding:0;color:#d8bd14;font-size:20px;line-height:unset;list-style:none;outline:none}.ant-rate-disabled .ant-rate-star{cursor:default}.ant-rate-disabled .ant-rate-star:hover{transform:scale(1)}.ant-rate-star{position:relative;display:inline-block;color:inherit;cursor:pointer;transition:all .3s}.ant-rate-star:not(:last-child){margin-right:8px}.ant-rate-star>div:focus{outline:0}.ant-rate-star>div:focus,.ant-rate-star>div:hover{transform:scale(1.1)}.ant-rate-star-first,.ant-rate-star-second{color:hsla(0,0%,100%,.12);transition:all .3s;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ant-rate-star-first .anticon,.ant-rate-star-second .anticon{vertical-align:middle}.ant-rate-star-first{position:absolute;top:0;left:0;width:50%;height:100%;overflow:hidden;opacity:0}.ant-rate-star-half .ant-rate-star-first,.ant-rate-star-half .ant-rate-star-second{opacity:1}.ant-rate-star-full .ant-rate-star-second,.ant-rate-star-half .ant-rate-star-first{color:inherit}.ant-rate-text{display:inline-block;margin:0 8px;font-size:14px}.ant-rate-rtl{direction:rtl}.ant-rate-rtl .ant-rate-star:not(:last-child){margin-right:0;margin-left:8px}.ant-rate-rtl .ant-rate-star-first{right:0;left:auto}.ant-result{padding:48px 32px}.ant-result-success .ant-result-icon>.anticon{color:#49aa19}.ant-result-error .ant-result-icon>.anticon{color:#a61d24}.ant-result-info .ant-result-icon>.anticon{color:#2abdd2}.ant-result-warning .ant-result-icon>.anticon{color:#d89614}.ant-result-image{width:250px;height:295px;margin:auto}.ant-result-icon{margin-bottom:24px;text-align:center}.ant-result-icon>.anticon{font-size:72px}.ant-result-title{color:hsla(0,0%,100%,.85);font-size:24px;line-height:1.8;text-align:center}.ant-result-subtitle{color:hsla(0,0%,100%,.45);font-size:14px;line-height:1.6;text-align:center}.ant-result-extra{margin:24px 0 0;text-align:center}.ant-result-extra>*{margin-right:8px}.ant-result-extra>:last-child{margin-right:0}.ant-result-content{margin-top:24px;padding:24px 40px;background-color:hsla(0,0%,100%,.04)}.ant-result-rtl{direction:rtl}.ant-result-rtl .ant-result-extra>*{margin-right:0;margin-left:8px}.ant-result-rtl .ant-result-extra>:last-child{margin-left:0}.ant-select-single .ant-select-selector{display:flex}.ant-select-single .ant-select-selector .ant-select-selection-search{position:absolute;top:0;right:11px;bottom:0;left:11px}.ant-select-single .ant-select-selector .ant-select-selection-search-input{width:100%}.ant-select-single .ant-select-selector .ant-select-selection-item,.ant-select-single .ant-select-selector .ant-select-selection-placeholder{padding:0;line-height:30px;transition:all .3s}@supports (-moz-appearance:meterbar){.ant-select-single .ant-select-selector .ant-select-selection-item,.ant-select-single .ant-select-selector .ant-select-selection-placeholder{line-height:30px}}.ant-select-single .ant-select-selector .ant-select-selection-item{position:relative;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ant-select-single .ant-select-selector .ant-select-selection-placeholder{pointer-events:none}.ant-select-single .ant-select-selector .ant-select-selection-item:after,.ant-select-single .ant-select-selector .ant-select-selection-placeholder:after,.ant-select-single .ant-select-selector:after{display:inline-block;width:0;visibility:hidden;content:"\a0"}.ant-select-single.ant-select-show-arrow .ant-select-selection-search{right:25px}.ant-select-single.ant-select-show-arrow .ant-select-selection-item,.ant-select-single.ant-select-show-arrow .ant-select-selection-placeholder{padding-right:18px}.ant-select-single.ant-select-open .ant-select-selection-item{color:hsla(0,0%,100%,.3)}.ant-select-single:not(.ant-select-customize-input) .ant-select-selector{width:100%;height:32px;padding:0 11px}.ant-select-single:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-search-input{height:30px}.ant-select-single:not(.ant-select-customize-input) .ant-select-selector:after{line-height:30px}.ant-select-single.ant-select-customize-input .ant-select-selector:after{display:none}.ant-select-single.ant-select-customize-input .ant-select-selector .ant-select-selection-search{position:static;width:100%}.ant-select-single.ant-select-customize-input .ant-select-selector .ant-select-selection-placeholder{position:absolute;right:0;left:0;padding:0 11px}.ant-select-single.ant-select-customize-input .ant-select-selector .ant-select-selection-placeholder:after{display:none}.ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector{height:40px}.ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-item,.ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-placeholder,.ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector:after{line-height:38px}.ant-select-single.ant-select-lg:not(.ant-select-customize-input):not(.ant-select-customize-input) .ant-select-selection-search-input{height:38px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector{height:24px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-item,.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-placeholder,.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector:after{line-height:22px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input):not(.ant-select-customize-input) .ant-select-selection-search-input{height:22px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selection-search{right:7px;left:7px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector{padding:0 7px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-search{right:28px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-item,.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-placeholder{padding-right:21px}.ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector{padding:0 11px}.ant-select-selection-overflow{position:relative;display:flex;flex:auto;flex-wrap:wrap;max-width:100%}.ant-select-selection-overflow-item{flex:none;align-self:center;max-width:100%}.ant-select-multiple .ant-select-selector{display:flex;flex-wrap:wrap;align-items:center;padding:1px 4px}.ant-select-show-search.ant-select-multiple .ant-select-selector{cursor:text}.ant-select-disabled.ant-select-multiple .ant-select-selector{background:#141414;cursor:not-allowed}.ant-select-multiple .ant-select-selector:after{display:inline-block;width:0;margin:2px 0;line-height:24px;content:"\a0"}.ant-select-multiple.ant-select-allow-clear .ant-select-selector,.ant-select-multiple.ant-select-show-arrow .ant-select-selector{padding-right:24px}.ant-select-multiple .ant-select-selection-item{position:relative;display:flex;flex:none;box-sizing:border-box;max-width:100%;height:24px;margin-top:2px;margin-bottom:2px;line-height:22px;background:hsla(0,0%,100%,.08);border:1px solid #303030;border-radius:2px;cursor:default;transition:font-size .3s,line-height .3s,height .3s;-webkit-user-select:none;-ms-user-select:none;user-select:none;-webkit-margin-end:4px;margin-inline-end:4px;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:4px;padding-inline-end:4px}.ant-select-disabled.ant-select-multiple .ant-select-selection-item{color:#595959;border-color:#1a2029;cursor:not-allowed}.ant-select-multiple .ant-select-selection-item-content{display:inline-block;margin-right:4px;overflow:hidden;white-space:pre;text-overflow:ellipsis}.ant-select-multiple .ant-select-selection-item-remove{color:inherit;font-style:normal;line-height:0;text-align:center;text-transform:none;vertical-align:-.125em;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;color:hsla(0,0%,100%,.45);font-weight:700;font-size:10px;line-height:inherit;cursor:pointer}.ant-select-multiple .ant-select-selection-item-remove>*{line-height:1}.ant-select-multiple .ant-select-selection-item-remove svg{display:inline-block}.ant-select-multiple .ant-select-selection-item-remove:before{display:none}.ant-select-multiple .ant-select-selection-item-remove .ant-select-multiple .ant-select-selection-item-remove-icon{display:block}.ant-select-multiple .ant-select-selection-item-remove>.anticon{vertical-align:-.2em}.ant-select-multiple .ant-select-selection-item-remove:hover{color:hsla(0,0%,100%,.75)}.ant-select-multiple .ant-select-selection-overflow-item+.ant-select-selection-overflow-item .ant-select-selection-search{-webkit-margin-start:0;margin-inline-start:0}.ant-select-multiple .ant-select-selection-search{position:relative;max-width:100%;margin-top:2px;margin-bottom:2px;-webkit-margin-start:7px;margin-inline-start:7px}.ant-select-multiple .ant-select-selection-search-input,.ant-select-multiple .ant-select-selection-search-mirror{height:24px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";line-height:24px;transition:all .3s}.ant-select-multiple .ant-select-selection-search-input{width:100%;min-width:4.1px}.ant-select-multiple .ant-select-selection-search-mirror{position:absolute;top:0;left:0;z-index:999;white-space:pre;visibility:hidden}.ant-select-multiple .ant-select-selection-placeholder{position:absolute;top:50%;right:11px;left:11px;transform:translateY(-50%);transition:all .3s}.ant-select-multiple.ant-select-lg .ant-select-selector:after{line-height:32px}.ant-select-multiple.ant-select-lg .ant-select-selection-item{line-height:30px}.ant-select-multiple.ant-select-lg .ant-select-selection-search{height:33px;line-height:33px}.ant-select-multiple.ant-select-lg .ant-select-selection-search-input,.ant-select-multiple.ant-select-lg .ant-select-selection-search-mirror{height:32px;line-height:30px}.ant-select-multiple.ant-select-sm .ant-select-selector:after{line-height:16px}.ant-select-multiple.ant-select-sm .ant-select-selection-item{height:16px;line-height:14px}.ant-select-multiple.ant-select-sm .ant-select-selection-search{height:17px;line-height:17px}.ant-select-multiple.ant-select-sm .ant-select-selection-search-input,.ant-select-multiple.ant-select-sm .ant-select-selection-search-mirror{height:16px;line-height:14px}.ant-select-multiple.ant-select-sm .ant-select-selection-placeholder{left:7px}.ant-select-multiple.ant-select-sm .ant-select-selection-search:first-child .ant-select-selection-search-input{margin-left:3px}.ant-select-multiple.ant-select-lg .ant-select-selection-item{height:32px;line-height:32px}.ant-select-disabled .ant-select-selection-item-remove{display:none}.ant-select{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:relative;display:inline-block;cursor:pointer}.ant-select:not(.ant-select-customize-input) .ant-select-selector{position:relative;background-color:transparent;border:1px solid #434343;border-radius:2px;transition:all .3s cubic-bezier(.645,.045,.355,1)}.ant-select:not(.ant-select-customize-input) .ant-select-selector input{cursor:pointer}.ant-select-show-search.ant-select:not(.ant-select-customize-input) .ant-select-selector{cursor:text}.ant-select-show-search.ant-select:not(.ant-select-customize-input) .ant-select-selector input{cursor:auto}.ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector{border-color:#2abdd2;border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(42,189,210,.2)}.ant-input-rtl .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector{border-right-width:0;border-left-width:1px!important}.ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector{color:hsla(0,0%,100%,.3);background:hsla(0,0%,100%,.08);cursor:not-allowed}.ant-select-multiple.ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector{background:#141414}.ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector input{cursor:not-allowed}.ant-select:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-search-input{margin:0;padding:0;background:transparent;border:none;outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.ant-select:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-search-input::-webkit-search-cancel-button{display:none;-webkit-appearance:none}.ant-select:not(.ant-select-disabled):hover .ant-select-selector{border-color:#228290;border-right-width:1px!important}.ant-input-rtl .ant-select:not(.ant-select-disabled):hover .ant-select-selector{border-right-width:0;border-left-width:1px!important}.ant-select-selection-item{flex:1 1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}@media (-ms-high-contrast:none){.ant-select-selection-item,.ant-select-selection-item ::-ms-backdrop{flex:auto}}.ant-select-selection-placeholder{flex:1 1;overflow:hidden;color:hsla(0,0%,100%,.3);white-space:nowrap;text-overflow:ellipsis;pointer-events:none}@media (-ms-high-contrast:none){.ant-select-selection-placeholder,.ant-select-selection-placeholder ::-ms-backdrop{flex:auto}}.ant-select-arrow{display:inline-block;color:inherit;font-style:normal;line-height:0;text-transform:none;vertical-align:-.125em;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:absolute;top:53%;right:11px;width:12px;height:12px;margin-top:-6px;color:hsla(0,0%,100%,.3);font-size:12px;line-height:1;text-align:center;pointer-events:none}.ant-select-arrow>*{line-height:1}.ant-select-arrow svg{display:inline-block}.ant-select-arrow:before{display:none}.ant-select-arrow .ant-select-arrow-icon{display:block}.ant-select-arrow .anticon{vertical-align:top;transition:transform .3s}.ant-select-arrow .anticon>svg{vertical-align:top}.ant-select-arrow .anticon:not(.ant-select-suffix){pointer-events:auto}.ant-select-disabled .ant-select-arrow{cursor:not-allowed}.ant-select-clear{position:absolute;top:50%;right:11px;z-index:1;display:inline-block;width:12px;height:12px;margin-top:-6px;color:hsla(0,0%,100%,.3);font-size:12px;font-style:normal;line-height:1;text-align:center;text-transform:none;background:#141414;cursor:pointer;opacity:0;transition:color .3s ease,opacity .15s ease;text-rendering:auto}.ant-select-clear:before{display:block}.ant-select-clear:hover{color:hsla(0,0%,100%,.45)}.ant-select:hover .ant-select-clear{opacity:1}.ant-select-dropdown{margin:0;color:hsla(0,0%,100%,.85);font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum",;position:absolute;top:-9999px;left:-9999px;z-index:1050;box-sizing:border-box;padding:4px 0;overflow:hidden;font-size:14px;font-variant:normal;background-color:#1a2029;border-radius:2px;outline:none;box-shadow:0 3px 6px -4px rgba(0,0,0,.48),0 6px 16px 0 rgba(0,0,0,.32),0 9px 28px 8px rgba(0,0,0,.2)}.ant-select-dropdown.slide-up-appear.slide-up-appear-active.ant-select-dropdown-placement-bottomLeft,.ant-select-dropdown.slide-up-enter.slide-up-enter-active.ant-select-dropdown-placement-bottomLeft{animation-name:antSlideUpIn}.ant-select-dropdown.slide-up-appear.slide-up-appear-active.ant-select-dropdown-placement-topLeft,.ant-select-dropdown.slide-up-enter.slide-up-enter-active.ant-select-dropdown-placement-topLeft{animation-name:antSlideDownIn}.ant-select-dropdown.slide-up-leave.slide-up-leave-active.ant-select-dropdown-placement-bottomLeft{animation-name:antSlideUpOut}.ant-select-dropdown.slide-up-leave.slide-up-leave-active.ant-select-dropdown-placement-topLeft{animation-name:antSlideDownOut}.ant-select-dropdown-hidden{display:none}.ant-select-dropdown-empty{color:hsla(0,0%,100%,.3)}.ant-select-item-empty{color:hsla(0,0%,100%,.85);color:hsla(0,0%,100%,.3)}.ant-select-item,.ant-select-item-empty{position:relative;display:block;min-height:32px;padding:5px 12px;font-weight:400;font-size:14px;line-height:22px}.ant-select-item{color:hsla(0,0%,100%,.85);cursor:pointer;transition:background .3s ease}.ant-select-item-group{color:hsla(0,0%,100%,.45);font-size:12px;cursor:default}.ant-select-item-option{display:flex}.ant-select-item-option-content{flex:auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ant-select-item-option-state{flex:none}.ant-select-item-option-active:not(.ant-select-item-option-disabled){background-color:hsla(0,0%,100%,.08)}.ant-select-item-option-selected:not(.ant-select-item-option-disabled){color:hsla(0,0%,100%,.85);font-weight:600;background-color:#132125}.ant-select-item-option-selected:not(.ant-select-item-option-disabled) .ant-select-item-option-state{color:#2abdd2}.ant-select-item-option-disabled{color:hsla(0,0%,100%,.3);cursor:not-allowed}.ant-select-item-option-grouped{padding-left:24px}.ant-select-lg{font-size:16px}.ant-select-borderless .ant-select-selector{background-color:transparent!important;border-color:transparent!important;box-shadow:none!important}.ant-select-rtl{direction:rtl}.ant-select-rtl .ant-select-arrow,.ant-select-rtl .ant-select-clear{right:auto;left:11px}.ant-select-dropdown-rtl{direction:rtl}.ant-select-dropdown-rtl .ant-select-item-option-grouped{padding-right:24px;padding-left:12px}.ant-select-rtl.ant-select-multiple.ant-select-allow-clear .ant-select-selector,.ant-select-rtl.ant-select-multiple.ant-select-show-arrow .ant-select-selector{padding-right:4px;padding-left:24px}.ant-select-rtl.ant-select-multiple .ant-select-selection-item{text-align:right}.ant-select-rtl.ant-select-multiple .ant-select-selection-item-content{margin-right:0;margin-left:4px;text-align:right}.ant-select-rtl.ant-select-multiple .ant-select-selection-search-mirror{right:0;left:auto}.ant-select-rtl.ant-select-multiple .ant-select-selection-search:first-child>.ant-select-selection-search-input{margin-right:5px!important;margin-left:0!important}.ant-select-rtl.ant-select-multiple .ant-select-selection-placeholder{right:11px;left:auto}.ant-select-rtl.ant-select-multiple.ant-select-sm .ant-select-selection-placeholder{right:7px}.ant-select-rtl.ant-select-single .ant-select-selector .ant-select-selection-item,.ant-select-rtl.ant-select-single .ant-select-selector .ant-select-selection-placeholder{right:0;left:9px;text-align:right}.ant-select-rtl.ant-select-single.ant-select-show-arrow .ant-select-selection-search{right:11px;left:25px}.ant-select-rtl.ant-select-single.ant-select-show-arrow .ant-select-selection-item,.ant-select-rtl.ant-select-single.ant-select-show-arrow .ant-select-selection-placeholder{padding-right:0;padding-left:18px}.ant-select-rtl.ant-select-single:not(.ant-select-customize-input) .ant-select-selector{padding:0 11px}.ant-select-rtl.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-search{right:0}.ant-select-rtl.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-item,.ant-select-rtl.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-placeholder{padding-right:0;padding-left:21px}.ant-skeleton{display:table;width:100%}.ant-skeleton-header{display:table-cell;padding-right:16px;vertical-align:top}.ant-skeleton-header .ant-skeleton-avatar{display:inline-block;vertical-align:top;background:hsla(0,0%,74.5%,.2);width:32px;height:32px;line-height:32px}.ant-skeleton-header .ant-skeleton-avatar.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-header .ant-skeleton-avatar-lg{width:40px;height:40px;line-height:40px}.ant-skeleton-header .ant-skeleton-avatar-lg.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-header .ant-skeleton-avatar-sm{width:24px;height:24px;line-height:24px}.ant-skeleton-header .ant-skeleton-avatar-sm.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-content{display:table-cell;width:100%;vertical-align:top}.ant-skeleton-content .ant-skeleton-title{width:100%;height:16px;margin-top:16px;background:hsla(0,0%,74.5%,.2);border-radius:4px}.ant-skeleton-content .ant-skeleton-title+.ant-skeleton-paragraph{margin-top:24px}.ant-skeleton-content .ant-skeleton-paragraph{padding:0}.ant-skeleton-content .ant-skeleton-paragraph>li{width:100%;height:16px;list-style:none;background:hsla(0,0%,74.5%,.2);border-radius:4px}.ant-skeleton-content .ant-skeleton-paragraph>li:last-child:not(:first-child):not(:nth-child(2)){width:61%}.ant-skeleton-content .ant-skeleton-paragraph>li+li{margin-top:16px}.ant-skeleton-with-avatar .ant-skeleton-content .ant-skeleton-title{margin-top:12px}.ant-skeleton-with-avatar .ant-skeleton-content .ant-skeleton-title+.ant-skeleton-paragraph{margin-top:28px}.ant-skeleton-round .ant-skeleton-content .ant-skeleton-paragraph>li,.ant-skeleton-round .ant-skeleton-content .ant-skeleton-title{border-radius:100px}.ant-skeleton.ant-skeleton-active .ant-skeleton-avatar,.ant-skeleton.ant-skeleton-active .ant-skeleton-button,.ant-skeleton.ant-skeleton-active .ant-skeleton-content .ant-skeleton-paragraph>li,.ant-skeleton.ant-skeleton-active .ant-skeleton-content .ant-skeleton-title,.ant-skeleton.ant-skeleton-active .ant-skeleton-image,.ant-skeleton.ant-skeleton-active .ant-skeleton-input{background:linear-gradient(90deg,hsla(0,0%,74.5%,.2) 25%,hsla(0,0%,100%,.16) 37%,hsla(0,0%,74.5%,.2) 63%);background-size:400% 100%;animation:ant-skeleton-loading 1.4s ease infinite}.ant-skeleton-element{display:inline-block;width:auto}.ant-skeleton-element .ant-skeleton-button{display:inline-block;vertical-align:top;background:hsla(0,0%,74.5%,.2);border-radius:2px;width:64px;height:32px;line-height:32px}.ant-skeleton-element .ant-skeleton-button.ant-skeleton-button-circle{width:32px;border-radius:50%}.ant-skeleton-element .ant-skeleton-button.ant-skeleton-button-round{border-radius:32px}.ant-skeleton-element .ant-skeleton-button-lg{width:80px;height:40px;line-height:40px}.ant-skeleton-element .ant-skeleton-button-lg.ant-skeleton-button-circle{width:40px;border-radius:50%}.ant-skeleton-element .ant-skeleton-button-lg.ant-skeleton-button-round{border-radius:40px}.ant-skeleton-element .ant-skeleton-button-sm{width:48px;height:24px;line-height:24px}.ant-skeleton-element .ant-skeleton-button-sm.ant-skeleton-button-circle{width:24px;border-radius:50%}.ant-skeleton-element .ant-skeleton-button-sm.ant-skeleton-button-round{border-radius:24px}.ant-skeleton-element .ant-skeleton-avatar{display:inline-block;vertical-align:top;background:hsla(0,0%,74.5%,.2);width:32px;height:32px;line-height:32px}.ant-skeleton-element .ant-skeleton-avatar.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-element .ant-skeleton-avatar-lg{width:40px;height:40px;line-height:40px}.ant-skeleton-element .ant-skeleton-avatar-lg.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-element .ant-skeleton-avatar-sm{width:24px;height:24px;line-height:24px}.ant-skeleton-element .ant-skeleton-avatar-sm.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-element .ant-skeleton-input{display:inline-block;vertical-align:top;background:hsla(0,0%,74.5%,.2);width:100%;height:32px;line-height:32px}.ant-skeleton-element .ant-skeleton-input-lg{width:100%;height:40px;line-height:40px}.ant-skeleton-element .ant-skeleton-input-sm{width:100%;height:24px;line-height:24px}.ant-skeleton-element .ant-skeleton-image{display:flex;align-items:center;justify-content:center;vertical-align:top;background:hsla(0,0%,74.5%,.2);width:96px;height:96px;line-height:96px}.ant-skeleton-element .ant-skeleton-image.ant-skeleton-image-circle{border-radius:50%}.ant-skeleton-element .ant-skeleton-image-path{fill:#bfbfbf}.ant-skeleton-element .ant-skeleton-image-svg{width:48px;height:48px;line-height:48px;max-width:192px;max-height:192px}.ant-skeleton-element .ant-skeleton-image-svg.ant-skeleton-image-circle{border-radius:50%}@keyframes ant-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}.ant-skeleton-rtl{direction:rtl}.ant-skeleton-rtl .ant-skeleton-header{padding-right:0;padding-left:16px}.ant-skeleton-rtl.ant-skeleton.ant-skeleton-active .ant-skeleton-avatar,.ant-skeleton-rtl.ant-skeleton.ant-skeleton-active .ant-skeleton-content .ant-skeleton-paragraph>li,.ant-skeleton-rtl.ant-skeleton.ant-skeleton-active .ant-skeleton-content .ant-skeleton-title{animation-name:ant-skeleton-loading-rtl}@keyframes ant-skeleton-loading-rtl{0%{background-position:0 50%}to{background-position:100% 50%}}.ant-slider{box-sizing:border-box;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:relative;height:12px;margin:10px 6px;padding:4px 0;cursor:pointer;touch-action:none}.ant-slider-vertical{width:12px;height:100%;margin:6px 10px;padding:0 4px}.ant-slider-vertical .ant-slider-rail{width:4px;height:100%}.ant-slider-vertical .ant-slider-track{width:4px}.ant-slider-vertical .ant-slider-handle{margin-top:-6px;margin-left:-5px}.ant-slider-vertical .ant-slider-mark{top:0;left:12px;width:18px;height:100%}.ant-slider-vertical .ant-slider-mark-text{left:4px;white-space:nowrap}.ant-slider-vertical .ant-slider-step{width:4px;height:100%}.ant-slider-vertical .ant-slider-dot{top:auto;left:2px;margin-bottom:-4px}.ant-slider-tooltip .ant-tooltip-inner{min-width:unset}.ant-slider-rtl.ant-slider-vertical .ant-slider-handle{margin-right:-5px;margin-left:0}.ant-slider-rtl.ant-slider-vertical .ant-slider-mark{right:12px;left:auto}.ant-slider-rtl.ant-slider-vertical .ant-slider-mark-text{right:4px;left:auto}.ant-slider-rtl.ant-slider-vertical .ant-slider-dot{right:2px;left:auto}.ant-slider-with-marks{margin-bottom:28px}.ant-slider-rail{width:100%;background-color:#262626}.ant-slider-rail,.ant-slider-track{position:absolute;height:4px;border-radius:2px;transition:background-color .3s}.ant-slider-track{background-color:#1b474d}.ant-slider-handle{position:absolute;width:14px;height:14px;margin-top:-5px;background-color:#141414;border:2px solid #1b474d;border-radius:50%;box-shadow:0;cursor:pointer;transition:border-color .3s,box-shadow .6s,transform .3s cubic-bezier(.18,.89,.32,1.28)}.ant-slider-handle-dragging.ant-slider-handle-dragging.ant-slider-handle-dragging,.ant-slider-handle:focus{border-color:#55cadb;box-shadow:0 0 0 5px rgba(42,189,210,.12)}.ant-slider-handle:focus{outline:none}.ant-slider-handle.ant-tooltip-open{border-color:#2abdd2}.ant-slider:hover .ant-slider-rail{background-color:#434343}.ant-slider:hover .ant-slider-track{background-color:#1e606a}.ant-slider:hover .ant-slider-handle:not(.ant-tooltip-open){border-color:#1e606a}.ant-slider-mark{position:absolute;top:14px;left:0;width:100%;font-size:14px}.ant-slider-mark-text{position:absolute;display:inline-block;color:hsla(0,0%,100%,.45);text-align:center;word-break:keep-all;cursor:pointer;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ant-slider-mark-text-active{color:hsla(0,0%,100%,.85)}.ant-slider-step{position:absolute;width:100%;height:4px;background:transparent}.ant-slider-dot{position:absolute;top:-2px;width:8px;height:8px;background-color:#141414;border:2px solid #303030;border-radius:50%;cursor:pointer}.ant-slider-dot,.ant-slider-dot:first-child,.ant-slider-dot:last-child{margin-left:-4px}.ant-slider-dot-active{border-color:#1e606a}.ant-slider-disabled{cursor:not-allowed}.ant-slider-disabled .ant-slider-track{background-color:hsla(0,0%,100%,.3)!important}.ant-slider-disabled .ant-slider-dot,.ant-slider-disabled .ant-slider-handle{background-color:#141414;border-color:hsla(0,0%,100%,.3)!important;box-shadow:none;cursor:not-allowed}.ant-slider-disabled .ant-slider-dot,.ant-slider-disabled .ant-slider-mark-text{cursor:not-allowed!important}.ant-slider-rtl{direction:rtl}.ant-slider-rtl .ant-slider-mark{right:0;left:auto}.ant-slider-rtl .ant-slider-dot,.ant-slider-rtl .ant-slider-dot:first-child,.ant-slider-rtl .ant-slider-dot:last-child{margin-right:-4px;margin-left:0}.ant-space{display:inline-flex}.ant-space-vertical{flex-direction:column}.ant-space-align-center{align-items:center}.ant-space-align-start{align-items:flex-start}.ant-space-align-end{align-items:flex-end}.ant-space-align-baseline{align-items:baseline}.ant-space-item:empty{display:none}.ant-space-rtl{direction:rtl}.ant-spin{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:absolute;display:none;color:#2abdd2;text-align:center;vertical-align:middle;opacity:0;transition:transform .3s cubic-bezier(.78,.14,.15,.86)}.ant-spin-spinning{position:static;display:inline-block;opacity:1}.ant-spin-nested-loading{position:relative}.ant-spin-nested-loading>div>.ant-spin{position:absolute;top:0;left:0;z-index:4;display:block;width:100%;height:100%;max-height:400px}.ant-spin-nested-loading>div>.ant-spin .ant-spin-dot{position:absolute;top:50%;left:50%;margin:-10px}.ant-spin-nested-loading>div>.ant-spin .ant-spin-text{position:absolute;top:50%;width:100%;padding-top:5px;text-shadow:0 1px 2px #141414}.ant-spin-nested-loading>div>.ant-spin.ant-spin-show-text .ant-spin-dot{margin-top:-20px}.ant-spin-nested-loading>div>.ant-spin-sm .ant-spin-dot{margin:-7px}.ant-spin-nested-loading>div>.ant-spin-sm .ant-spin-text{padding-top:2px}.ant-spin-nested-loading>div>.ant-spin-sm.ant-spin-show-text .ant-spin-dot{margin-top:-17px}.ant-spin-nested-loading>div>.ant-spin-lg .ant-spin-dot{margin:-16px}.ant-spin-nested-loading>div>.ant-spin-lg .ant-spin-text{padding-top:11px}.ant-spin-nested-loading>div>.ant-spin-lg.ant-spin-show-text .ant-spin-dot{margin-top:-26px}.ant-spin-container{position:relative;transition:opacity .3s}.ant-spin-container:after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:10;display:none\9;width:100%;height:100%;background:#141414;opacity:0;transition:all .3s;content:"";pointer-events:none}.ant-spin-blur{clear:both;overflow:hidden;opacity:.5;-webkit-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none}.ant-spin-blur:after{opacity:.4;pointer-events:auto}.ant-spin-tip{color:hsla(0,0%,100%,.45)}.ant-spin-dot{position:relative;display:inline-block;font-size:20px;width:1em;height:1em}.ant-spin-dot-item{position:absolute;display:block;width:9px;height:9px;background-color:#2abdd2;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s linear infinite alternate}.ant-spin-dot-item:first-child{top:0;left:0}.ant-spin-dot-item:nth-child(2){top:0;right:0;animation-delay:.4s}.ant-spin-dot-item:nth-child(3){right:0;bottom:0;animation-delay:.8s}.ant-spin-dot-item:nth-child(4){bottom:0;left:0;animation-delay:1.2s}.ant-spin-dot-spin{transform:rotate(45deg);animation:antRotate 1.2s linear infinite}.ant-spin-sm .ant-spin-dot{font-size:14px}.ant-spin-sm .ant-spin-dot i{width:6px;height:6px}.ant-spin-lg .ant-spin-dot{font-size:32px}.ant-spin-lg .ant-spin-dot i{width:14px;height:14px}.ant-spin.ant-spin-show-text .ant-spin-text{display:block}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.ant-spin-blur{background:#141414;opacity:.5}}@keyframes antSpinMove{to{opacity:1}}@keyframes antRotate{to{transform:rotate(405deg)}}.ant-spin-rtl{direction:rtl}.ant-spin-rtl .ant-spin-dot-spin{transform:rotate(-45deg);animation-name:antRotateRtl}@keyframes antRotateRtl{to{transform:rotate(-405deg)}}.ant-statistic{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum"}.ant-statistic-title{margin-bottom:4px;color:hsla(0,0%,100%,.45);font-size:14px}.ant-statistic-content{color:hsla(0,0%,100%,.85);font-size:24px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"}.ant-statistic-content-value{display:inline-block;direction:ltr}.ant-statistic-content-prefix,.ant-statistic-content-suffix{display:inline-block}.ant-statistic-content-prefix{margin-right:4px}.ant-statistic-content-suffix{margin-left:4px}.ant-statistic-rtl{direction:rtl}.ant-statistic-rtl .ant-statistic-content-prefix{margin-right:0;margin-left:4px}.ant-statistic-rtl .ant-statistic-content-suffix{margin-right:4px;margin-left:0}.ant-steps{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";display:flex;width:100%;font-size:0;text-align:left;text-align:initial}.ant-steps-item{position:relative;display:inline-block;flex:1 1;overflow:hidden;vertical-align:top}.ant-steps-item-container{outline:none}.ant-steps-item:last-child{flex:none}.ant-steps-item:last-child>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after,.ant-steps-item:last-child>.ant-steps-item-container>.ant-steps-item-tail{display:none}.ant-steps-item-content,.ant-steps-item-icon{display:inline-block;vertical-align:top}.ant-steps-item-icon{width:32px;height:32px;margin:0 8px 0 0;font-size:16px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";line-height:32px;text-align:center;border:1px solid hsla(0,0%,100%,.3);border-radius:32px;transition:background-color .3s,border-color .3s}.ant-steps-item-icon .ant-steps-icon{position:relative;top:-1px;color:#2abdd2;line-height:1}.ant-steps-item-tail{position:absolute;top:12px;left:0;width:100%;padding:0 10px}.ant-steps-item-tail:after{display:inline-block;width:100%;height:1px;background:#303030;border-radius:1px;transition:background .3s;content:""}.ant-steps-item-title{position:relative;display:inline-block;padding-right:16px;color:hsla(0,0%,100%,.85);font-size:16px;line-height:32px}.ant-steps-item-title:after{position:absolute;top:16px;left:100%;display:block;width:9999px;height:1px;background:#303030;content:""}.ant-steps-item-subtitle{display:inline;margin-left:8px;font-weight:400}.ant-steps-item-description,.ant-steps-item-subtitle{color:hsla(0,0%,100%,.45);font-size:14px}.ant-steps-item-wait .ant-steps-item-icon{background-color:transparent;border-color:hsla(0,0%,100%,.3)}.ant-steps-item-wait .ant-steps-item-icon>.ant-steps-icon{color:hsla(0,0%,100%,.3)}.ant-steps-item-wait .ant-steps-item-icon>.ant-steps-icon .ant-steps-icon-dot{background:hsla(0,0%,100%,.3)}.ant-steps-item-wait>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title{color:hsla(0,0%,100%,.45)}.ant-steps-item-wait>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after{background-color:#303030}.ant-steps-item-wait>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-description{color:hsla(0,0%,100%,.45)}.ant-steps-item-wait>.ant-steps-item-container>.ant-steps-item-tail:after{background-color:#303030}.ant-steps-item-process .ant-steps-item-icon{background-color:transparent;border-color:#2abdd2}.ant-steps-item-process .ant-steps-item-icon>.ant-steps-icon{color:#2abdd2}.ant-steps-item-process .ant-steps-item-icon>.ant-steps-icon .ant-steps-icon-dot{background:#2abdd2}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title{color:hsla(0,0%,100%,.85)}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after{background-color:#303030}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-description{color:hsla(0,0%,100%,.85)}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-tail:after{background-color:#303030}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-icon{background:#2abdd2}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-icon .ant-steps-icon{color:#fff}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-title{font-weight:500}.ant-steps-item-finish .ant-steps-item-icon{background-color:transparent;border-color:#2abdd2}.ant-steps-item-finish .ant-steps-item-icon>.ant-steps-icon{color:#2abdd2}.ant-steps-item-finish .ant-steps-item-icon>.ant-steps-icon .ant-steps-icon-dot{background:#2abdd2}.ant-steps-item-finish>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title{color:hsla(0,0%,100%,.85)}.ant-steps-item-finish>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after{background-color:#2abdd2}.ant-steps-item-finish>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-description{color:hsla(0,0%,100%,.45)}.ant-steps-item-finish>.ant-steps-item-container>.ant-steps-item-tail:after{background-color:#2abdd2}.ant-steps-item-error .ant-steps-item-icon{background-color:transparent;border-color:#a61d24}.ant-steps-item-error .ant-steps-item-icon>.ant-steps-icon{color:#a61d24}.ant-steps-item-error .ant-steps-item-icon>.ant-steps-icon .ant-steps-icon-dot{background:#a61d24}.ant-steps-item-error>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title{color:#a61d24}.ant-steps-item-error>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after{background-color:#303030}.ant-steps-item-error>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-description{color:#a61d24}.ant-steps-item-error>.ant-steps-item-container>.ant-steps-item-tail:after{background-color:#303030}.ant-steps-item.ant-steps-next-error .ant-steps-item-title:after{background:#a61d24}.ant-steps-item-disabled{cursor:not-allowed}.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button]{cursor:pointer}.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button] .ant-steps-item-description,.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button] .ant-steps-item-icon .ant-steps-icon,.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button] .ant-steps-item-subtitle,.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button] .ant-steps-item-title{transition:color .3s}.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button]:hover .ant-steps-item-description,.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button]:hover .ant-steps-item-subtitle,.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button]:hover .ant-steps-item-title{color:#2abdd2}.ant-steps .ant-steps-item:not(.ant-steps-item-active):not(.ant-steps-item-process)>.ant-steps-item-container[role=button]:hover .ant-steps-item-icon{border-color:#2abdd2}.ant-steps .ant-steps-item:not(.ant-steps-item-active):not(.ant-steps-item-process)>.ant-steps-item-container[role=button]:hover .ant-steps-item-icon .ant-steps-icon{color:#2abdd2}.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item{padding-left:16px;white-space:nowrap}.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:first-child{padding-left:0}.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:last-child .ant-steps-item-title{padding-right:0}.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item-tail{display:none}.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item-description{max-width:140px;white-space:normal}.ant-steps-item-custom>.ant-steps-item-container>.ant-steps-item-icon{height:auto;background:none;border:0}.ant-steps-item-custom>.ant-steps-item-container>.ant-steps-item-icon>.ant-steps-icon{top:0;left:.5px;width:32px;height:32px;font-size:24px;line-height:32px}.ant-steps-item-custom.ant-steps-item-process .ant-steps-item-icon>.ant-steps-icon{color:#2abdd2}.ant-steps:not(.ant-steps-vertical) .ant-steps-item-custom .ant-steps-item-icon{width:auto;background:none}.ant-steps-small.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item{padding-left:12px}.ant-steps-small.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:first-child{padding-left:0}.ant-steps-small .ant-steps-item-icon{width:24px;height:24px;margin:0 8px 0 0;font-size:12px;line-height:24px;text-align:center;border-radius:24px}.ant-steps-small .ant-steps-item-title{padding-right:12px;font-size:14px;line-height:24px}.ant-steps-small .ant-steps-item-title:after{top:12px}.ant-steps-small .ant-steps-item-description{color:hsla(0,0%,100%,.45);font-size:14px}.ant-steps-small .ant-steps-item-tail{top:8px}.ant-steps-small .ant-steps-item-custom .ant-steps-item-icon{width:inherit;height:inherit;line-height:inherit;background:none;border:0;border-radius:0}.ant-steps-small .ant-steps-item-custom .ant-steps-item-icon>.ant-steps-icon{font-size:24px;line-height:24px;transform:none}.ant-steps-vertical{display:flex;flex-direction:column}.ant-steps-vertical>.ant-steps-item{display:block;flex:1 0 auto;padding-left:0;overflow:visible}.ant-steps-vertical>.ant-steps-item .ant-steps-item-icon{float:left;margin-right:16px}.ant-steps-vertical>.ant-steps-item .ant-steps-item-content{display:block;min-height:48px;overflow:hidden}.ant-steps-vertical>.ant-steps-item .ant-steps-item-title{line-height:32px}.ant-steps-vertical>.ant-steps-item .ant-steps-item-description{padding-bottom:12px}.ant-steps-vertical>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{position:absolute;top:0;left:16px;width:1px;height:100%;padding:38px 0 6px}.ant-steps-vertical>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail:after{width:1px;height:100%}.ant-steps-vertical>.ant-steps-item:not(:last-child)>.ant-steps-item-container>.ant-steps-item-tail{display:block}.ant-steps-vertical>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after{display:none}.ant-steps-vertical.ant-steps-small .ant-steps-item-container .ant-steps-item-tail{position:absolute;top:0;left:12px;padding:30px 0 6px}.ant-steps-vertical.ant-steps-small .ant-steps-item-container .ant-steps-item-title{line-height:24px}.ant-steps-label-vertical .ant-steps-item{overflow:visible}.ant-steps-label-vertical .ant-steps-item-tail{margin-left:58px;padding:3.5px 24px}.ant-steps-label-vertical .ant-steps-item-content{display:block;width:116px;margin-top:8px;text-align:center}.ant-steps-label-vertical .ant-steps-item-icon{display:inline-block;margin-left:42px}.ant-steps-label-vertical .ant-steps-item-title{padding-right:0;padding-left:0}.ant-steps-label-vertical .ant-steps-item-title:after{display:none}.ant-steps-label-vertical .ant-steps-item-subtitle{display:block;margin-bottom:4px;margin-left:0;line-height:1.5715}.ant-steps-label-vertical.ant-steps-small:not(.ant-steps-dot) .ant-steps-item-icon{margin-left:46px}.ant-steps-dot .ant-steps-item-title,.ant-steps-dot.ant-steps-small .ant-steps-item-title{line-height:1.5715}.ant-steps-dot .ant-steps-item-tail,.ant-steps-dot.ant-steps-small .ant-steps-item-tail{top:2px;width:100%;margin:0 0 0 70px;padding:0}.ant-steps-dot .ant-steps-item-tail:after,.ant-steps-dot.ant-steps-small .ant-steps-item-tail:after{width:calc(100% - 20px);height:3px;margin-left:12px}.ant-steps-dot .ant-steps-item:first-child .ant-steps-icon-dot,.ant-steps-dot.ant-steps-small .ant-steps-item:first-child .ant-steps-icon-dot{left:2px}.ant-steps-dot .ant-steps-item-icon,.ant-steps-dot.ant-steps-small .ant-steps-item-icon{width:8px;height:8px;margin-left:67px;padding-right:0;line-height:8px;background:transparent;border:0}.ant-steps-dot .ant-steps-item-icon .ant-steps-icon-dot,.ant-steps-dot.ant-steps-small .ant-steps-item-icon .ant-steps-icon-dot{position:relative;float:left;width:100%;height:100%;border-radius:100px;transition:all .3s}.ant-steps-dot .ant-steps-item-icon .ant-steps-icon-dot:after,.ant-steps-dot.ant-steps-small .ant-steps-item-icon .ant-steps-icon-dot:after{position:absolute;top:-12px;left:-26px;width:60px;height:32px;background:rgba(0,0,0,.001);content:""}.ant-steps-dot .ant-steps-item-content,.ant-steps-dot.ant-steps-small .ant-steps-item-content{width:140px}.ant-steps-dot .ant-steps-item-process .ant-steps-item-icon,.ant-steps-dot.ant-steps-small .ant-steps-item-process .ant-steps-item-icon{position:relative;top:-1px;width:10px;height:10px;line-height:10px;background:none}.ant-steps-dot .ant-steps-item-process .ant-steps-icon:first-child .ant-steps-icon-dot,.ant-steps-dot.ant-steps-small .ant-steps-item-process .ant-steps-icon:first-child .ant-steps-icon-dot{left:0}.ant-steps-vertical.ant-steps-dot .ant-steps-item-icon{margin-top:8px;margin-left:0;background:none}.ant-steps-vertical.ant-steps-dot .ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{top:2px;left:-9px;margin:0;padding:22px 0 4px}.ant-steps-vertical.ant-steps-dot .ant-steps-item:first-child .ant-steps-icon-dot{left:0}.ant-steps-vertical.ant-steps-dot .ant-steps-item-content{width:inherit}.ant-steps-vertical.ant-steps-dot .ant-steps-item-process .ant-steps-item-container .ant-steps-item-icon .ant-steps-icon-dot{left:-2px}.ant-steps-navigation{padding-top:12px}.ant-steps-navigation.ant-steps-small .ant-steps-item-container{margin-left:-12px}.ant-steps-navigation .ant-steps-item{overflow:visible;text-align:center}.ant-steps-navigation .ant-steps-item-container{display:inline-block;height:100%;margin-left:-16px;padding-bottom:12px;text-align:left;transition:opacity .3s}.ant-steps-navigation .ant-steps-item-container .ant-steps-item-content{max-width:auto}.ant-steps-navigation .ant-steps-item-container .ant-steps-item-title{max-width:100%;padding-right:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ant-steps-navigation .ant-steps-item-container .ant-steps-item-title:after{display:none}.ant-steps-navigation .ant-steps-item:not(.ant-steps-item-active) .ant-steps-item-container[role=button]{cursor:pointer}.ant-steps-navigation .ant-steps-item:not(.ant-steps-item-active) .ant-steps-item-container[role=button]:hover{opacity:.85}.ant-steps-navigation .ant-steps-item:last-child{flex:1 1}.ant-steps-navigation .ant-steps-item:last-child:after{display:none}.ant-steps-navigation .ant-steps-item:after{position:absolute;top:50%;left:100%;display:inline-block;width:12px;height:12px;margin-top:-14px;margin-left:-2px;border:1px solid hsla(0,0%,100%,.2);border-bottom:none;border-left:none;transform:rotate(45deg);content:""}.ant-steps-navigation .ant-steps-item:before{position:absolute;bottom:0;left:50%;display:inline-block;width:0;height:2px;background-color:#2abdd2;transition:width .3s,left .3s;transition-timing-function:ease-out;content:""}.ant-steps-navigation .ant-steps-item.ant-steps-item-active:before{left:0;width:100%}.ant-steps-navigation.ant-steps-vertical>.ant-steps-item{margin-right:0!important}.ant-steps-navigation.ant-steps-vertical>.ant-steps-item:before{display:none}.ant-steps-navigation.ant-steps-vertical>.ant-steps-item.ant-steps-item-active:before{top:0;right:0;left:unset;display:block;width:3px;height:calc(100% - 24px)}.ant-steps-navigation.ant-steps-vertical>.ant-steps-item:after{position:relative;top:-2px;left:50%;display:block;width:8px;height:8px;margin-bottom:8px;text-align:center;transform:rotate(135deg)}.ant-steps-navigation.ant-steps-vertical>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{visibility:hidden}.ant-steps-rtl{direction:rtl}.ant-steps.ant-steps-rtl .ant-steps-item-icon{margin-right:0;margin-left:8px}.ant-steps-rtl .ant-steps-item-tail{right:0;left:auto}.ant-steps-rtl .ant-steps-item-title{padding-right:0;padding-left:16px}.ant-steps-rtl .ant-steps-item-title:after{right:100%;left:auto}.ant-steps-rtl.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item{padding-right:16px;padding-left:0}.ant-steps-rtl.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:first-child{padding-right:0}.ant-steps-rtl.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:last-child .ant-steps-item-title{padding-left:0}.ant-steps-rtl .ant-steps-item-custom .ant-steps-item-icon>.ant-steps-icon{right:.5px;left:auto}.ant-steps-rtl.ant-steps-navigation.ant-steps-small .ant-steps-item-container{margin-right:-12px;margin-left:0}.ant-steps-rtl.ant-steps-navigation .ant-steps-item-container{margin-right:-16px;margin-left:0;text-align:right}.ant-steps-rtl.ant-steps-navigation .ant-steps-item-container .ant-steps-item-title{padding-left:0}.ant-steps-rtl.ant-steps-navigation .ant-steps-item:after{right:100%;left:auto;margin-right:-2px;margin-left:0;transform:rotate(225deg)}.ant-steps-rtl.ant-steps-small.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item{padding-right:12px;padding-left:0}.ant-steps-rtl.ant-steps-small.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:first-child{padding-right:0}.ant-steps-rtl.ant-steps-small .ant-steps-item-title{padding-right:0;padding-left:12px}.ant-steps-rtl.ant-steps-vertical>.ant-steps-item .ant-steps-item-icon{float:right;margin-right:0;margin-left:16px}.ant-steps-rtl.ant-steps-vertical>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{right:16px;left:auto}.ant-steps-rtl.ant-steps-vertical.ant-steps-small .ant-steps-item-container .ant-steps-item-tail{right:12px;left:auto}.ant-steps-rtl.ant-steps-label-vertical .ant-steps-item-title{padding-left:0}.ant-steps-rtl.ant-steps-dot .ant-steps-item-tail,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item-tail{margin:0 70px 0 0}.ant-steps-rtl.ant-steps-dot .ant-steps-item-tail:after,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item-tail:after{margin-right:12px;margin-left:0}.ant-steps-rtl.ant-steps-dot .ant-steps-item:first-child .ant-steps-icon-dot,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item:first-child .ant-steps-icon-dot{right:2px;left:auto}.ant-steps-rtl.ant-steps-dot .ant-steps-item-icon,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item-icon{margin-right:67px;margin-left:0}.ant-steps-rtl.ant-steps-dot .ant-steps-item-icon .ant-steps-icon-dot,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item-icon .ant-steps-icon-dot{float:right}.ant-steps-rtl.ant-steps-dot .ant-steps-item-icon .ant-steps-icon-dot:after,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item-icon .ant-steps-icon-dot:after{right:-26px;left:auto}.ant-steps-rtl.ant-steps-vertical.ant-steps-dot .ant-steps-item-icon{margin-right:0;margin-left:16px}.ant-steps-rtl.ant-steps-vertical.ant-steps-dot .ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{right:-9px;left:auto}.ant-steps-rtl.ant-steps-vertical.ant-steps-dot .ant-steps-item:first-child .ant-steps-icon-dot{right:0;left:auto}.ant-steps-rtl.ant-steps-vertical.ant-steps-dot .ant-steps-item-process .ant-steps-icon-dot{right:-2px;left:auto}.ant-steps-with-progress .ant-steps-item{padding-top:4px}.ant-steps-with-progress .ant-steps-item .ant-steps-item-tail{top:4px!important}.ant-steps-with-progress .ant-steps-item-icon{position:relative}.ant-steps-with-progress .ant-steps-item-icon .ant-progress{position:absolute;top:-5px;right:-5px;bottom:-5px;left:-5px}.ant-switch{margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:relative;display:inline-block;box-sizing:border-box;min-width:44px;height:22px;line-height:22px;vertical-align:middle;background-color:hsla(0,0%,100%,.3);border:0;border-radius:100px;cursor:pointer;transition:all .2s;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ant-switch:focus{outline:0;box-shadow:0 0 0 2px hsla(0,0%,100%,.1)}.ant-switch-checked:focus{box-shadow:0 0 0 2px rgba(42,189,210,.2)}.ant-switch:focus:hover{box-shadow:none}.ant-switch-checked{background-color:#2abdd2}.ant-switch-disabled,.ant-switch-loading{cursor:not-allowed;opacity:.4}.ant-switch-disabled *,.ant-switch-loading *{box-shadow:none;cursor:not-allowed}.ant-switch-inner{display:block;margin:0 7px 0 25px;color:#fff;font-size:12px;transition:margin .2s}.ant-switch-checked .ant-switch-inner{margin:0 25px 0 7px}.ant-switch-handle{top:2px;left:2px;width:18px;height:18px}.ant-switch-handle,.ant-switch-handle:before{position:absolute;transition:all .2s ease-in-out}.ant-switch-handle:before{top:0;right:0;bottom:0;left:0;background-color:#fff;border-radius:9px;box-shadow:0 2px 4px 0 rgba(0,35,11,.2);content:""}.ant-switch-checked .ant-switch-handle{left:calc(100% - 20px)}.ant-switch:not(.ant-switch-disabled):active .ant-switch-handle:before{right:-30%;left:0}.ant-switch:not(.ant-switch-disabled):active.ant-switch-checked .ant-switch-handle:before{right:0;left:-30%}.ant-switch-loading-icon{position:relative;top:2px;color:rgba(0,0,0,.65);vertical-align:top}.ant-switch-checked .ant-switch-loading-icon{color:#2abdd2}.ant-switch-small{min-width:28px;height:16px;line-height:16px}.ant-switch-small .ant-switch-inner{margin:0 5px 0 18px;font-size:12px}.ant-switch-small .ant-switch-handle{width:12px;height:12px}.ant-switch-small .ant-switch-loading-icon{top:1.5px;font-size:9px}.ant-switch-small.ant-switch-checked .ant-switch-inner{margin:0 18px 0 5px}.ant-switch-small.ant-switch-checked .ant-switch-handle{left:calc(100% - 14px)}.ant-switch-rtl{direction:rtl}.ant-switch-rtl .ant-switch-inner{margin:0 25px 0 7px}.ant-switch-rtl .ant-switch-handle{right:2px;left:auto}.ant-switch-rtl:not(.ant-switch-rtl-disabled):active .ant-switch-handle:before{right:0;left:-30%}.ant-switch-rtl:not(.ant-switch-rtl-disabled):active.ant-switch-checked .ant-switch-handle:before{right:-30%;left:0}.ant-switch-rtl.ant-switch-checked .ant-switch-inner{margin:0 7px 0 25px}.ant-switch-rtl.ant-switch-checked .ant-switch-handle{right:calc(100% - 20px)}.ant-switch-rtl.ant-switch-small.ant-switch-checked .ant-switch-handle{right:calc(100% - 14px)}.ant-table.ant-table-middle{font-size:14px}.ant-table.ant-table-middle .ant-table-footer,.ant-table.ant-table-middle .ant-table-tbody>tr>td,.ant-table.ant-table-middle .ant-table-thead>tr>th,.ant-table.ant-table-middle .ant-table-title,.ant-table.ant-table-middle tfoot>tr>td,.ant-table.ant-table-middle tfoot>tr>th{padding:12px 8px}.ant-table.ant-table-middle .ant-table-thead th.ant-table-column-has-sorters{padding:0}.ant-table.ant-table-middle .ant-table-thead .ant-table-filter-column{margin:-12px -8px}.ant-table.ant-table-middle .ant-table-thead .ant-table-filter-column-title{padding:12px 2.3em 12px 8px}.ant-table.ant-table-middle .ant-table-thead .ant-table-column-sorters{padding:12px 8px}.ant-table.ant-table-middle .ant-table-expanded-row-fixed{margin:-12px -8px}.ant-table.ant-table-middle .ant-table-tbody .ant-table-wrapper:only-child .ant-table{margin:-12px -8px -12px 25px}.ant-table.ant-table-small{font-size:14px}.ant-table.ant-table-small .ant-table-footer,.ant-table.ant-table-small .ant-table-tbody>tr>td,.ant-table.ant-table-small .ant-table-thead>tr>th,.ant-table.ant-table-small .ant-table-title,.ant-table.ant-table-small tfoot>tr>td,.ant-table.ant-table-small tfoot>tr>th{padding:8px}.ant-table.ant-table-small .ant-table-thead th.ant-table-column-has-sorters{padding:0}.ant-table.ant-table-small .ant-table-thead .ant-table-filter-column{margin:-8px}.ant-table.ant-table-small .ant-table-thead .ant-table-filter-column-title{padding:8px 2.3em 8px 8px}.ant-table.ant-table-small .ant-table-thead .ant-table-column-sorters{padding:8px}.ant-table.ant-table-small .ant-table-expanded-row-fixed{margin:-8px}.ant-table.ant-table-small .ant-table-tbody .ant-table-wrapper:only-child .ant-table{margin:-8px -8px -8px 25px}.ant-table-small .ant-table-thead>tr>th{background-color:#1d1d1d}.ant-table-small .ant-table-selection-column{width:46px;min-width:46px}.ant-table.ant-table-bordered>.ant-table-title{border:1px solid #303030;border-bottom:0}.ant-table.ant-table-bordered>.ant-table-container{border:1px solid #303030;border-right:0;border-bottom:0}.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>tbody>tr>td,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>tfoot>tr>td,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>tfoot>tr>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>thead>tr>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>tbody>tr>td,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>tfoot>tr>td,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>tfoot>tr>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>thead>tr>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>tbody>tr>td,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>tfoot>tr>td,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>tfoot>tr>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>thead>tr>th{border-right:1px solid #303030}.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>thead>tr:not(:last-child)>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>thead>tr:not(:last-child)>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>thead>tr:not(:last-child)>th{border-bottom:1px solid #303030}.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>tbody>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>tfoot>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>thead>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>tbody>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>tfoot>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>thead>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>tbody>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>tfoot>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>thead>tr>.ant-table-cell-fix-right-first:after{border-right:1px solid #303030}.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>tbody>tr>td>.ant-table-expanded-row-fixed,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>tbody>tr>td>.ant-table-expanded-row-fixed,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>tbody>tr>td>.ant-table-expanded-row-fixed{margin:-16px -17px}.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>tbody>tr>td>.ant-table-expanded-row-fixed:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>tbody>tr>td>.ant-table-expanded-row-fixed:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>tbody>tr>td>.ant-table-expanded-row-fixed:after{position:absolute;top:0;right:1px;bottom:0;border-right:1px solid #303030;content:""}.ant-table.ant-table-bordered.ant-table-scroll-horizontal>.ant-table-container>.ant-table-body>table>tbody>tr.ant-table-expanded-row>td,.ant-table.ant-table-bordered.ant-table-scroll-horizontal>.ant-table-container>.ant-table-body>table>tbody>tr.ant-table-placeholder>td{border-right:0}.ant-table.ant-table-bordered.ant-table-middle>.ant-table-container>.ant-table-body>table>tbody>tr>td>.ant-table-expanded-row-fixed,.ant-table.ant-table-bordered.ant-table-middle>.ant-table-container>.ant-table-content>table>tbody>tr>td>.ant-table-expanded-row-fixed{margin:-12px -9px}.ant-table.ant-table-bordered.ant-table-small>.ant-table-container>.ant-table-body>table>tbody>tr>td>.ant-table-expanded-row-fixed,.ant-table.ant-table-bordered.ant-table-small>.ant-table-container>.ant-table-content>table>tbody>tr>td>.ant-table-expanded-row-fixed{margin:-8px -9px}.ant-table.ant-table-bordered>.ant-table-footer{border:1px solid #303030;border-top:0}.ant-table-cell .ant-table-container:first-child{border-top:0}.ant-table-cell-scrollbar{box-shadow:0 1px 0 1px #1d1d1d}.ant-table-wrapper{clear:both;max-width:100%}.ant-table-wrapper:before{display:table;content:""}.ant-table-wrapper:after{display:table;clear:both;content:""}.ant-table{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:relative;font-size:14px;background:#141414;border-radius:2px}.ant-table table{width:100%;text-align:left;border-radius:2px 2px 0 0;border-collapse:separate;border-spacing:0}.ant-table-tbody>tr>td,.ant-table-thead>tr>th,.ant-table tfoot>tr>td,.ant-table tfoot>tr>th{position:relative;padding:16px;overflow-wrap:break-word}.ant-table-cell-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all}.ant-table-cell-ellipsis.ant-table-cell-fix-left-last,.ant-table-cell-ellipsis.ant-table-cell-fix-right-first{overflow:visible}.ant-table-cell-ellipsis.ant-table-cell-fix-left-last .ant-table-cell-content,.ant-table-cell-ellipsis.ant-table-cell-fix-right-first .ant-table-cell-content{display:block;overflow:hidden;text-overflow:ellipsis}.ant-table-title{padding:16px}.ant-table-footer{padding:16px;color:hsla(0,0%,100%,.85);background:hsla(0,0%,100%,.04)}.ant-table-thead>tr>th{color:hsla(0,0%,100%,.85);font-weight:500;text-align:left;background:#1d1d1d;border-bottom:1px solid #303030;transition:background .3s ease}.ant-table-thead>tr>th[colspan]:not([colspan="1"]){text-align:center}.ant-table-thead>tr:not(:last-child)>th[colspan]{border-bottom:0}.ant-table-tbody>tr>td{border-bottom:1px solid #303030;transition:background .3s}.ant-table-tbody>tr>td>.ant-table-wrapper:only-child .ant-table{margin:-16px -16px -16px 33px}.ant-table-tbody>tr>td>.ant-table-wrapper:only-child .ant-table-tbody>tr:last-child>td{border-bottom:0}.ant-table-tbody>tr>td>.ant-table-wrapper:only-child .ant-table-tbody>tr:last-child>td:first-child,.ant-table-tbody>tr>td>.ant-table-wrapper:only-child .ant-table-tbody>tr:last-child>td:last-child{border-radius:0}.ant-table-tbody>tr.ant-table-row:hover>td{background:#262626}.ant-table-tbody>tr.ant-table-row-selected>td{background:#132125;border-color:rgba(0,0,0,.03)}.ant-table-tbody>tr.ant-table-row-selected:hover>td{background:#0f1b1e}.ant-table tfoot>tr>td,.ant-table tfoot>tr>th{border-bottom:1px solid #303030}.ant-table-pagination.ant-pagination{margin:16px 0}.ant-table-pagination{display:flex}.ant-table-pagination-left{justify-content:flex-start}.ant-table-pagination-center{justify-content:center}.ant-table-pagination-right{justify-content:flex-end}.ant-table-thead th.ant-table-column-has-sorters{padding:0;cursor:pointer;transition:all .3s}.ant-table-thead th.ant-table-column-has-sorters:hover{background:#303030}.ant-table-thead th.ant-table-column-has-sorters:hover .ant-table-filter-trigger-container{background:#353535}.ant-table-thead th.ant-table-column-sort{background:#262626}td.ant-table-column-sort{background:hsla(0,0%,100%,.01)}.ant-table-column-sorters-with-tooltip{display:inline-block;width:100%}.ant-table-column-sorters{display:inline-flex;align-items:center;padding:16px}.ant-table-column-sorter{margin-top:.15em;margin-bottom:-.15em;margin-left:8px;color:#bfbfbf}.ant-table-column-sorter-full{margin-top:-.2em;margin-bottom:0}.ant-table-column-sorter-inner{display:inline-flex;flex-direction:column;align-items:center}.ant-table-column-sorter-down,.ant-table-column-sorter-up{font-size:11px}.ant-table-column-sorter-down.active,.ant-table-column-sorter-up.active{color:#2abdd2}.ant-table-column-sorter-up+.ant-table-column-sorter-down{margin-top:-.3em}.ant-table-filter-column{display:flex;align-items:center;margin:-16px}.ant-table-filter-column-title{flex:auto;padding:16px 2.3em 16px 16px}.ant-table-thead tr th.ant-table-column-has-sorters .ant-table-filter-column{margin:0}.ant-table-thead tr th.ant-table-column-has-sorters .ant-table-filter-column-title{padding:0 2.3em 0 0}.ant-table-filter-trigger-container{position:absolute;top:0;right:0;bottom:0;display:flex;flex:none;align-items:stretch;align-self:stretch;cursor:pointer;transition:background-color .3s}.ant-table-filter-trigger-container-open,.ant-table-filter-trigger-container:hover,.ant-table-thead th.ant-table-column-has-sorters:hover .ant-table-filter-trigger-container:hover{background:#434343}.ant-table-filter-trigger{display:block;width:2.3em;color:#bfbfbf;font-size:12px;transition:color .3s}.ant-table-filter-trigger .anticon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.ant-table-filter-trigger-container-open .ant-table-filter-trigger,.ant-table-filter-trigger:hover{color:hsla(0,0%,100%,.45)}.ant-table-filter-trigger.active{color:#2abdd2}.ant-table-filter-dropdown{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";min-width:120px;background-color:#1a2029;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.48),0 6px 16px 0 rgba(0,0,0,.32),0 9px 28px 8px rgba(0,0,0,.2)}.ant-table-filter-dropdown .ant-dropdown-menu{max-height:264px;overflow-x:hidden;border:0;box-shadow:none}.ant-table-filter-dropdown-submenu>ul{max-height:calc(100vh - 130px);overflow-x:hidden;overflow-y:auto}.ant-table-filter-dropdown-submenu .ant-checkbox-wrapper+span,.ant-table-filter-dropdown .ant-checkbox-wrapper+span{padding-left:8px}.ant-table-filter-dropdown-btns{display:flex;justify-content:space-between;padding:7px 8px 7px 3px;overflow:hidden;background-color:#1a2029;border-top:1px solid #303030}.ant-table .ant-table-selection-col{width:32px}table tr td.ant-table-selection-column,table tr th.ant-table-selection-column{padding-right:8px;padding-left:8px;text-align:center}table tr td.ant-table-selection-column .ant-radio-wrapper,table tr th.ant-table-selection-column .ant-radio-wrapper{margin-right:0}.ant-table-selection{position:relative;display:inline-flex;flex-direction:column}.ant-table-selection-extra{position:absolute;top:0;z-index:1;cursor:pointer;transition:all .3s;-webkit-margin-start:100%;margin-inline-start:100%;-webkit-padding-start:4px;padding-inline-start:4px}.ant-table-selection-extra .anticon{color:#bfbfbf;font-size:10px}.ant-table-selection-extra .anticon:hover{color:#a6a6a6}.ant-table-expand-icon-col{width:48px}.ant-table-row-expand-icon-cell{text-align:center}.ant-table-row-indent{float:left;height:1px}.ant-table-row-expand-icon{color:#2abdd2;text-decoration:none;cursor:pointer;transition:color .3s;position:relative;display:inline-flex;float:left;box-sizing:border-box;width:17px;height:17px;padding:0;color:inherit;line-height:17px;background:transparent;border:1px solid #303030;border-radius:2px;outline:none;transform:scale(.94117647);transform-origin:bottom;transition:all .3s;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ant-table-row-expand-icon:focus,.ant-table-row-expand-icon:hover{color:#228290}.ant-table-row-expand-icon:active{color:#4abdca}.ant-table-row-expand-icon:active,.ant-table-row-expand-icon:focus,.ant-table-row-expand-icon:hover{border-color:currentColor}.ant-table-row-expand-icon:after,.ant-table-row-expand-icon:before{position:absolute;background:currentColor;transition:transform .3s ease-out;content:""}.ant-table-row-expand-icon:before{top:7px;right:3px;left:3px;height:1px}.ant-table-row-expand-icon:after{top:3px;bottom:3px;left:7px;width:1px;transform:rotate(90deg)}.ant-table-row-expand-icon-collapsed:before{transform:rotate(-180deg)}.ant-table-row-expand-icon-collapsed:after{transform:rotate(0deg)}.ant-table-row-expand-icon-spaced{background:transparent;border:0;visibility:hidden}.ant-table-row-expand-icon-spaced:after,.ant-table-row-expand-icon-spaced:before{display:none;content:none}.ant-table-row-indent+.ant-table-row-expand-icon{margin-top:2.5005px;margin-right:8px}tr.ant-table-expanded-row:hover>td,tr.ant-table-expanded-row>td{background:#1d1d1d}tr.ant-table-expanded-row .ant-descriptions-view table{width:auto}.ant-table .ant-table-expanded-row-fixed{position:relative;margin:-16px;padding:16px}.ant-table-tbody>tr.ant-table-placeholder{text-align:center}.ant-table-empty .ant-table-tbody>tr.ant-table-placeholder{color:hsla(0,0%,100%,.3)}.ant-table-tbody>tr.ant-table-placeholder:hover>td{background:#141414}.ant-table-cell-fix-left,.ant-table-cell-fix-right{position:-webkit-sticky!important;position:sticky!important;z-index:2;background:#141414}.ant-table-cell-fix-left-first:after,.ant-table-cell-fix-left-last:after{position:absolute;top:0;right:0;bottom:-1px;width:30px;transform:translateX(100%);transition:box-shadow .3s;content:"";pointer-events:none}.ant-table-cell-fix-right-first:after,.ant-table-cell-fix-right-last:after{position:absolute;top:0;bottom:-1px;left:0;width:30px;transform:translateX(-100%);transition:box-shadow .3s;content:"";pointer-events:none}.ant-table .ant-table-container:after,.ant-table .ant-table-container:before{position:absolute;top:0;bottom:0;z-index:1;width:30px;transition:box-shadow .3s;content:"";pointer-events:none}.ant-table .ant-table-container:before{left:0}.ant-table .ant-table-container:after{right:0}.ant-table-ping-left:not(.ant-table-has-fix-left) .ant-table-container{position:relative}.ant-table-ping-left .ant-table-cell-fix-left-first:after,.ant-table-ping-left .ant-table-cell-fix-left-last:after,.ant-table-ping-left:not(.ant-table-has-fix-left) .ant-table-container:before{box-shadow:inset 10px 0 8px -8px rgba(0,0,0,.45)}.ant-table-ping-right:not(.ant-table-has-fix-right) .ant-table-container{position:relative}.ant-table-ping-right .ant-table-cell-fix-right-first:after,.ant-table-ping-right .ant-table-cell-fix-right-last:after,.ant-table-ping-right:not(.ant-table-has-fix-right) .ant-table-container:after{box-shadow:inset -10px 0 8px -8px rgba(0,0,0,.45)}.ant-table-sticky-header,.ant-table-sticky-scroll{position:-webkit-sticky;position:sticky;z-index:3}.ant-table-sticky-scroll{bottom:0;display:flex;align-items:center;background:#fcfcfc;border-top:1px solid #303030;opacity:.6}.ant-table-sticky-scroll:hover{transform-origin:center bottom}.ant-table-sticky-scroll-bar{height:8px;background-color:rgba(0,0,0,.35);border-radius:4px}.ant-table-sticky-scroll-bar-active,.ant-table-sticky-scroll-bar:hover{background-color:rgba(0,0,0,.8)}@media (-ms-high-contrast:none){.ant-table-ping-left .ant-table-cell-fix-left-last:after,.ant-table-ping-right .ant-table-cell-fix-right-first:after{box-shadow:none!important}}.ant-table-title{border-radius:2px 2px 0 0}.ant-table-title+.ant-table-container{border-top-left-radius:0;border-top-right-radius:0}.ant-table-title+.ant-table-container table>thead>tr:first-child th:first-child,.ant-table-title+.ant-table-container table>thead>tr:first-child th:last-child{border-radius:0}.ant-table-container{border-top-right-radius:2px}.ant-table-container,.ant-table-container table>thead>tr:first-child th:first-child{border-top-left-radius:2px}.ant-table-container table>thead>tr:first-child th:last-child{border-top-right-radius:2px}.ant-table-footer{border-radius:0 0 2px 2px}.ant-table-rtl,.ant-table-wrapper-rtl{direction:rtl}.ant-table-wrapper-rtl .ant-table table{text-align:right}.ant-table-wrapper-rtl .ant-table-thead>tr>th[colspan]:not([colspan="1"]){text-align:center}.ant-table-wrapper-rtl .ant-table-thead>tr>th{text-align:right}.ant-table-tbody>tr .ant-table-wrapper:only-child .ant-table.ant-table-rtl{margin:-16px 33px -16px -16px}.ant-table-wrapper.ant-table-wrapper-rtl .ant-table-pagination-left{justify-content:flex-end}.ant-table-wrapper.ant-table-wrapper-rtl .ant-table-pagination-right{justify-content:flex-start}.ant-table-wrapper-rtl .ant-table-column-sorter{margin-right:8px;margin-left:0}.ant-table-wrapper-rtl .ant-table-filter-column-title{padding:16px 16px 16px 2.3em}.ant-table-rtl .ant-table-thead tr th.ant-table-column-has-sorters .ant-table-filter-column-title{padding:0 0 0 2.3em}.ant-table-wrapper-rtl .ant-table-filter-trigger-container{right:auto;left:0}.ant-dropdown-menu-submenu-rtl.ant-table-filter-dropdown-submenu .ant-checkbox-wrapper+span,.ant-dropdown-menu-submenu-rtl.ant-table-filter-dropdown .ant-checkbox-wrapper+span,.ant-dropdown-rtl .ant-table-filter-dropdown-submenu .ant-checkbox-wrapper+span,.ant-dropdown-rtl .ant-table-filter-dropdown .ant-checkbox-wrapper+span{padding-right:8px;padding-left:0}.ant-table-wrapper-rtl .ant-table-selection{text-align:center}.ant-table-wrapper-rtl .ant-table-row-expand-icon,.ant-table-wrapper-rtl .ant-table-row-indent{float:right}.ant-table-wrapper-rtl .ant-table-row-indent+.ant-table-row-expand-icon{margin-right:0;margin-left:8px}.ant-table-wrapper-rtl .ant-table-row-expand-icon:after{transform:rotate(-90deg)}.ant-table-wrapper-rtl .ant-table-row-expand-icon-collapsed:before{transform:rotate(180deg)}.ant-table-wrapper-rtl .ant-table-row-expand-icon-collapsed:after{transform:rotate(0deg)}.ant-tabs-small>.ant-tabs-nav .ant-tabs-tab{padding:8px 0;font-size:14px}.ant-tabs-large>.ant-tabs-nav .ant-tabs-tab{padding:16px 0;font-size:16px}.ant-tabs-card.ant-tabs-small>.ant-tabs-nav .ant-tabs-tab{padding:6px 16px}.ant-tabs-card.ant-tabs-large>.ant-tabs-nav .ant-tabs-tab{padding:7px 16px 6px}.ant-tabs-rtl{direction:rtl}.ant-tabs-rtl .ant-tabs-nav .ant-tabs-tab{margin:0 0 0 32px}.ant-tabs-rtl .ant-tabs-nav .ant-tabs-tab:last-of-type{margin-left:0}.ant-tabs-rtl .ant-tabs-nav .ant-tabs-tab .anticon{margin-right:0;margin-left:12px}.ant-tabs-rtl .ant-tabs-nav .ant-tabs-tab .ant-tabs-tab-remove{margin-right:8px;margin-left:-4px}.ant-tabs-rtl .ant-tabs-nav .ant-tabs-tab .ant-tabs-tab-remove .anticon{margin:0}.ant-tabs-rtl.ant-tabs-left>.ant-tabs-nav{order:1}.ant-tabs-rtl.ant-tabs-left>.ant-tabs-content-holder,.ant-tabs-rtl.ant-tabs-right>.ant-tabs-nav{order:0}.ant-tabs-rtl.ant-tabs-right>.ant-tabs-content-holder{order:1}.ant-tabs-rtl.ant-tabs-card.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-tab:not(:last-of-type),.ant-tabs-rtl.ant-tabs-card.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-tab:not(:last-of-type),.ant-tabs-rtl.ant-tabs-card.ant-tabs-top>.ant-tabs-nav .ant-tabs-tab:not(:last-of-type),.ant-tabs-rtl.ant-tabs-card.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-tab:not(:last-of-type){margin-right:0;margin-left:2px}.ant-tabs-dropdown-rtl{direction:rtl}.ant-tabs-dropdown-rtl .ant-tabs-dropdown-menu-item{text-align:right}.ant-tabs-bottom,.ant-tabs-top{flex-direction:column}.ant-tabs-bottom>.ant-tabs-nav,.ant-tabs-bottom>div>.ant-tabs-nav,.ant-tabs-top>.ant-tabs-nav,.ant-tabs-top>div>.ant-tabs-nav{margin:0 0 16px}.ant-tabs-bottom>.ant-tabs-nav:before,.ant-tabs-bottom>div>.ant-tabs-nav:before,.ant-tabs-top>.ant-tabs-nav:before,.ant-tabs-top>div>.ant-tabs-nav:before{position:absolute;right:0;left:0;border-bottom:1px solid #303030;content:""}.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-top>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-ink-bar{height:2px}.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-ink-bar-animated,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-ink-bar-animated,.ant-tabs-top>.ant-tabs-nav .ant-tabs-ink-bar-animated,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-ink-bar-animated{transition:width .3s,left .3s,right .3s}.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-top>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-top>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-nav-wrap:before{top:0;bottom:0;width:30px}.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-top>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-nav-wrap:before{left:0;box-shadow:inset 10px 0 8px -8px rgba(0,0,0,.08)}.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-top>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-nav-wrap:after{right:0;box-shadow:inset -10px 0 8px -8px rgba(0,0,0,.08)}.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-left:before,.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-right:after,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-left:before,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-right:after,.ant-tabs-top>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-left:before,.ant-tabs-top>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-right:after,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-left:before,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-right:after{opacity:1}.ant-tabs-top>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-top>.ant-tabs-nav:before,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-top>div>.ant-tabs-nav:before{bottom:0}.ant-tabs-bottom>.ant-tabs-nav,.ant-tabs-bottom>div>.ant-tabs-nav{order:1;margin-top:16px;margin-bottom:0}.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-bottom>.ant-tabs-nav:before,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-bottom>div>.ant-tabs-nav:before{top:0}.ant-tabs-bottom>.ant-tabs-content-holder,.ant-tabs-bottom>div>.ant-tabs-content-holder{order:0}.ant-tabs-left>.ant-tabs-nav,.ant-tabs-left>div>.ant-tabs-nav,.ant-tabs-right>.ant-tabs-nav,.ant-tabs-right>div>.ant-tabs-nav{flex-direction:column;min-width:50px}.ant-tabs-left>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-right>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-tab{margin:0 0 16px;padding:8px 24px;text-align:center}.ant-tabs-left>.ant-tabs-nav .ant-tabs-tab:last-of-type,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-tab:last-of-type,.ant-tabs-right>.ant-tabs-nav .ant-tabs-tab:last-of-type,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-tab:last-of-type{margin-bottom:0}.ant-tabs-left>.ant-tabs-nav .ant-tabs-tab-active .ant-tabs-tab-btn,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-tab-active .ant-tabs-tab-btn,.ant-tabs-right>.ant-tabs-nav .ant-tabs-tab-active .ant-tabs-tab-btn,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-tab-active .ant-tabs-tab-btn{font-weight:400;text-shadow:0 0 .25px #4abdca}.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-wrap,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-wrap,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-wrap,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-wrap{flex-direction:column}.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-wrap:before{right:0;left:0;height:30px}.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-wrap:before{top:0;box-shadow:inset 0 10px 8px -8px rgba(0,0,0,.08)}.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-wrap:after{bottom:0;box-shadow:inset 0 -10px 8px -8px rgba(0,0,0,.08)}.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-bottom:after,.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-top:before,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-bottom:after,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-top:before,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-bottom:after,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-top:before,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-bottom:after,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-top:before{opacity:1}.ant-tabs-left>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-right>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-ink-bar{width:2px}.ant-tabs-left>.ant-tabs-nav .ant-tabs-ink-bar-animated,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-ink-bar-animated,.ant-tabs-right>.ant-tabs-nav .ant-tabs-ink-bar-animated,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-ink-bar-animated{transition:height .3s,top .3s}.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-list,.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-operations,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-list,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-operations,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-list,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-operations,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-list,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-operations{flex-direction:column}.ant-tabs-left>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-ink-bar{right:0}.ant-tabs-left>.ant-tabs-content-holder,.ant-tabs-left>div>.ant-tabs-content-holder{margin-left:-1px;border-left:1px solid #303030}.ant-tabs-left>.ant-tabs-content-holder>.ant-tabs-content>.ant-tabs-tabpane,.ant-tabs-left>div>.ant-tabs-content-holder>.ant-tabs-content>.ant-tabs-tabpane{padding-left:24px}.ant-tabs-right>.ant-tabs-nav,.ant-tabs-right>div>.ant-tabs-nav{order:1}.ant-tabs-right>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-ink-bar{left:0}.ant-tabs-right>.ant-tabs-content-holder,.ant-tabs-right>div>.ant-tabs-content-holder{order:0;margin-right:-1px;border-right:1px solid #303030}.ant-tabs-right>.ant-tabs-content-holder>.ant-tabs-content>.ant-tabs-tabpane,.ant-tabs-right>div>.ant-tabs-content-holder>.ant-tabs-content>.ant-tabs-tabpane{padding-right:24px}.ant-tabs-dropdown{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:absolute;top:-9999px;left:-9999px;z-index:1050;display:block}.ant-tabs-dropdown-hidden{display:none}.ant-tabs-dropdown-menu{max-height:200px;margin:0;padding:4px 0;overflow-x:hidden;overflow-y:auto;text-align:left;list-style-type:none;background-color:#1a2029;background-clip:padding-box;border-radius:2px;outline:none;box-shadow:0 3px 6px -4px rgba(0,0,0,.48),0 6px 16px 0 rgba(0,0,0,.32),0 9px 28px 8px rgba(0,0,0,.2)}.ant-tabs-dropdown-menu-item{min-width:120px;margin:0;padding:5px 12px;overflow:hidden;color:hsla(0,0%,100%,.85);font-weight:400;font-size:14px;line-height:22px;white-space:nowrap;text-overflow:ellipsis;cursor:pointer;transition:all .3s}.ant-tabs-dropdown-menu-item:hover{background:hsla(0,0%,100%,.08)}.ant-tabs-dropdown-menu-item-disabled,.ant-tabs-dropdown-menu-item-disabled:hover{color:hsla(0,0%,100%,.3);background:transparent;cursor:not-allowed}.ant-tabs-card>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-card>div>.ant-tabs-nav .ant-tabs-tab{margin:0;padding:8px 16px;background:hsla(0,0%,100%,.04);border:1px solid #303030;transition:all .3s cubic-bezier(.645,.045,.355,1)}.ant-tabs-card>.ant-tabs-nav .ant-tabs-tab-active,.ant-tabs-card>div>.ant-tabs-nav .ant-tabs-tab-active{color:#2abdd2;background:#141414}.ant-tabs-card>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-card>div>.ant-tabs-nav .ant-tabs-ink-bar{visibility:hidden}.ant-tabs-card.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-tab:not(:last-of-type),.ant-tabs-card.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-tab:not(:last-of-type),.ant-tabs-card.ant-tabs-top>.ant-tabs-nav .ant-tabs-tab:not(:last-of-type),.ant-tabs-card.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-tab:not(:last-of-type){margin-right:2px}.ant-tabs-card.ant-tabs-top>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-card.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-tab{border-radius:2px 2px 0 0}.ant-tabs-card.ant-tabs-top>.ant-tabs-nav .ant-tabs-tab-active,.ant-tabs-card.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-tab-active{border-bottom-color:#141414}.ant-tabs-card.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-card.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-tab{border-radius:0 0 2px 2px}.ant-tabs-card.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-tab-active,.ant-tabs-card.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-tab-active{border-top-color:#141414}.ant-tabs-card.ant-tabs-left>.ant-tabs-nav .ant-tabs-tab:not(:last-of-type),.ant-tabs-card.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-tab:not(:last-of-type),.ant-tabs-card.ant-tabs-right>.ant-tabs-nav .ant-tabs-tab:not(:last-of-type),.ant-tabs-card.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-tab:not(:last-of-type){margin-bottom:2px}.ant-tabs-card.ant-tabs-left>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-card.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-tab{border-radius:2px 0 0 2px}.ant-tabs-card.ant-tabs-left>.ant-tabs-nav .ant-tabs-tab-active,.ant-tabs-card.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-tab-active{border-right-color:#141414}.ant-tabs-card.ant-tabs-right>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-card.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-tab{border-radius:0 2px 2px 0}.ant-tabs-card.ant-tabs-right>.ant-tabs-nav .ant-tabs-tab-active,.ant-tabs-card.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-tab-active{border-left-color:#141414}.ant-tabs{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";display:flex;overflow:hidden}.ant-tabs>.ant-tabs-nav,.ant-tabs>div>.ant-tabs-nav{position:relative;display:flex;flex:none;align-items:center}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-wrap,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-wrap{position:relative;display:inline-block;display:flex;flex:auto;align-self:stretch;overflow:hidden;white-space:nowrap;transform:translate(0)}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-wrap:before{position:absolute;z-index:1;opacity:0;transition:opacity .3s;content:"";pointer-events:none}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-list,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-list{position:relative;display:flex;transition:transform .3s}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-operations,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-operations{display:flex;align-self:stretch}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-operations-hidden,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-operations-hidden{position:absolute;visibility:hidden;pointer-events:none}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-more,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-more{position:relative;padding:8px 16px;background:transparent;border:0}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-more:after,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-more:after{position:absolute;right:0;bottom:0;left:0;height:5px;transform:translateY(100%);content:""}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-add,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-add{min-width:40px;padding:0 8px;background:hsla(0,0%,100%,.04);border:1px solid #303030;border-radius:2px 2px 0 0;outline:none;cursor:pointer;transition:all .3s cubic-bezier(.645,.045,.355,1)}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-add:hover,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-add:hover{color:#228290}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-add:active,.ant-tabs>.ant-tabs-nav .ant-tabs-nav-add:focus,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-add:active,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-add:focus{color:#4abdca}.ant-tabs-extra-content{flex:none}.ant-tabs-centered>.ant-tabs-nav .ant-tabs-nav-wrap:not([class*=ant-tabs-nav-wrap-ping]),.ant-tabs-centered>div>.ant-tabs-nav .ant-tabs-nav-wrap:not([class*=ant-tabs-nav-wrap-ping]){justify-content:center}.ant-tabs-ink-bar{position:absolute;background:#2abdd2;pointer-events:none}.ant-tabs-tab{position:relative;display:inline-flex;align-items:center;margin:0 32px 0 0;padding:12px 0;font-size:14px;background:transparent;border:0;outline:none;cursor:pointer}.ant-tabs-tab:last-of-type{margin-right:0;margin-left:0}.ant-tabs-tab-btn:active,.ant-tabs-tab-btn:focus,.ant-tabs-tab-remove:active,.ant-tabs-tab-remove:focus{color:#4abdca}.ant-tabs-tab-btn,.ant-tabs-tab-remove{outline:none;transition:all .3s}.ant-tabs-tab-remove{flex:none;margin-right:-4px;margin-left:8px;color:hsla(0,0%,100%,.45);font-size:12px;background:transparent;border:none;cursor:pointer}.ant-tabs-tab-remove:hover{color:hsla(0,0%,100%,.85)}.ant-tabs-tab:hover{color:#228290}.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn{color:#2abdd2;font-weight:500}.ant-tabs-tab.ant-tabs-tab-disabled{color:hsla(0,0%,100%,.3);cursor:not-allowed}.ant-tabs-tab.ant-tabs-tab-disabled .ant-tabs-tab-btn:active,.ant-tabs-tab.ant-tabs-tab-disabled .ant-tabs-tab-btn:focus,.ant-tabs-tab.ant-tabs-tab-disabled .ant-tabs-tab-remove:active,.ant-tabs-tab.ant-tabs-tab-disabled .ant-tabs-tab-remove:focus{color:hsla(0,0%,100%,.3)}.ant-tabs-tab .ant-tabs-tab-remove .anticon{margin:0}.ant-tabs-tab .anticon{margin-right:12px}.ant-tabs-content{display:flex;width:100%}.ant-tabs-content-holder{flex:auto;min-width:0;min-height:0}.ant-tabs-content-animated{transition:margin .3s}.ant-tabs-tabpane{flex:none;width:100%;outline:none}.ant-tag{box-sizing:border-box;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";display:inline-block;height:auto;margin:0 8px 0 0;padding:0 7px;font-size:12px;line-height:20px;white-space:nowrap;background:hsla(0,0%,100%,.04);border:1px solid #434343;border-radius:2px;opacity:1;transition:all .3s}.ant-tag:hover{opacity:.85}.ant-tag,.ant-tag a,.ant-tag a:hover{color:hsla(0,0%,100%,.85)}.ant-tag>a:first-child:last-child{display:inline-block;margin:0 -8px;padding:0 8px}.ant-tag-close-icon{margin-left:3px;color:hsla(0,0%,100%,.45);font-size:10px;cursor:pointer;transition:all .3s}.ant-tag-close-icon:hover{color:hsla(0,0%,100%,.85)}.ant-tag-has-color{border-color:transparent}.ant-tag-has-color,.ant-tag-has-color .anticon-close,.ant-tag-has-color .anticon-close:hover,.ant-tag-has-color a,.ant-tag-has-color a:hover{color:#fff}.ant-tag-checkable{background-color:transparent;border-color:transparent;cursor:pointer}.ant-tag-checkable:not(.ant-tag-checkable-checked):hover{color:#2abdd2}.ant-tag-checkable-checked,.ant-tag-checkable:active{color:#fff}.ant-tag-checkable-checked{background-color:#2abdd2}.ant-tag-checkable:active{background-color:#4abdca}.ant-tag-hidden{display:none}.ant-tag-pink{color:#e0529c;background:#291321;border-color:#551c3b}.ant-tag-pink-inverse{color:#fff;background:#cb2b83;border-color:#cb2b83}.ant-tag-magenta{color:#e0529c;background:#291321;border-color:#551c3b}.ant-tag-magenta-inverse{color:#fff;background:#cb2b83;border-color:#cb2b83}.ant-tag-red{color:#e84749;background:#2a1215;border-color:#58181c}.ant-tag-red-inverse{color:#fff;background:#d32029;border-color:#d32029}.ant-tag-volcano{color:#e87040;background:#2b1611;border-color:#592716}.ant-tag-volcano-inverse{color:#fff;background:#d84a1b;border-color:#d84a1b}.ant-tag-orange{color:#e89a3c;background:#2b1d11;border-color:#593815}.ant-tag-orange-inverse{color:#fff;background:#d87a16;border-color:#d87a16}.ant-tag-yellow{color:#e8d639;background:#2b2611;border-color:#595014}.ant-tag-yellow-inverse{color:#fff;background:#d8bd14;border-color:#d8bd14}.ant-tag-gold{color:#e8b339;background:#2b2111;border-color:#594214}.ant-tag-gold-inverse{color:#fff;background:#d89614;border-color:#d89614}.ant-tag-cyan{color:#33bcb7;background:#112123;border-color:#144848}.ant-tag-cyan-inverse{color:#fff;background:#13a8a8;border-color:#13a8a8}.ant-tag-lime{color:#a9d134;background:#1f2611;border-color:#3e4f13}.ant-tag-lime-inverse{color:#fff;background:#8bbb11;border-color:#8bbb11}.ant-tag-green{color:#6abe39;background:#162312;border-color:#274916}.ant-tag-green-inverse{color:#fff;background:#49aa19;border-color:#49aa19}.ant-tag-blue{color:#3c9ae8;background:#111d2c;border-color:#15395b}.ant-tag-blue-inverse{color:#fff;background:#177ddc;border-color:#177ddc}.ant-tag-geekblue{color:#5273e0;background:#131629;border-color:#1c2755}.ant-tag-geekblue-inverse{color:#fff;background:#2b4acb;border-color:#2b4acb}.ant-tag-purple{color:#854eca;background:#1a1325;border-color:#301c4d}.ant-tag-purple-inverse{color:#fff;background:#642ab5;border-color:#642ab5}.ant-tag-success{color:#49aa19;background:#162312;border-color:#274916}.ant-tag-processing{color:#177ddc;background:#111d2c;border-color:#15395b}.ant-tag-error{color:#d32029;background:#2a1215;border-color:#58181c}.ant-tag-warning{color:#d87a16;background:#2b1d11;border-color:#593815}.ant-tag>.anticon+span,.ant-tag>span+.anticon{margin-left:7px}.ant-tag.ant-tag-rtl{margin-right:0;margin-left:8px;direction:rtl;text-align:right}.ant-tag-rtl .ant-tag-close-icon{margin-right:3px;margin-left:0}.ant-tag-rtl.ant-tag>.anticon+span,.ant-tag-rtl.ant-tag>span+.anticon{margin-right:7px;margin-left:0}.ant-timeline{box-sizing:border-box;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;font-feature-settings:"tnum","tnum";margin:0;padding:0;list-style:none}.ant-timeline-item{position:relative;margin:0;padding-bottom:20px;font-size:14px;list-style:none}.ant-timeline-item-tail{position:absolute;top:10px;left:4px;height:calc(100% - 10px);border-left:2px solid #303030}.ant-timeline-item-pending .ant-timeline-item-head{font-size:12px;background-color:transparent}.ant-timeline-item-pending .ant-timeline-item-tail{display:none}.ant-timeline-item-head{position:absolute;width:10px;height:10px;background-color:#141414;border:2px solid transparent;border-radius:100px}.ant-timeline-item-head-blue{color:#2abdd2;border-color:#2abdd2}.ant-timeline-item-head-red{color:#a61d24;border-color:#a61d24}.ant-timeline-item-head-green{color:#49aa19;border-color:#49aa19}.ant-timeline-item-head-gray{color:hsla(0,0%,100%,.3);border-color:hsla(0,0%,100%,.3)}.ant-timeline-item-head-custom{position:absolute;top:5.5px;left:5px;width:auto;height:auto;margin-top:0;padding:3px 1px;line-height:1;text-align:center;border:0;border-radius:0;transform:translate(-50%,-50%)}.ant-timeline-item-content{position:relative;top:-7.001px;margin:0 0 0 26px;word-break:break-word}.ant-timeline-item-last>.ant-timeline-item-tail{display:none}.ant-timeline-item-last>.ant-timeline-item-content{min-height:48px}.ant-timeline.ant-timeline-alternate .ant-timeline-item-head,.ant-timeline.ant-timeline-alternate .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-alternate .ant-timeline-item-tail,.ant-timeline.ant-timeline-label .ant-timeline-item-head,.ant-timeline.ant-timeline-label .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-label .ant-timeline-item-tail,.ant-timeline.ant-timeline-right .ant-timeline-item-head,.ant-timeline.ant-timeline-right .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-right .ant-timeline-item-tail{left:50%}.ant-timeline.ant-timeline-alternate .ant-timeline-item-head,.ant-timeline.ant-timeline-label .ant-timeline-item-head,.ant-timeline.ant-timeline-right .ant-timeline-item-head{margin-left:-4px}.ant-timeline.ant-timeline-alternate .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-label .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-right .ant-timeline-item-head-custom{margin-left:1px}.ant-timeline.ant-timeline-alternate .ant-timeline-item-left .ant-timeline-item-content,.ant-timeline.ant-timeline-label .ant-timeline-item-left .ant-timeline-item-content,.ant-timeline.ant-timeline-right .ant-timeline-item-left .ant-timeline-item-content{left:calc(50% - 4px);width:calc(50% - 14px);text-align:left}.ant-timeline.ant-timeline-alternate .ant-timeline-item-right .ant-timeline-item-content,.ant-timeline.ant-timeline-label .ant-timeline-item-right .ant-timeline-item-content,.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-content{width:calc(50% - 12px);margin:0;text-align:right}.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-head,.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-tail{left:calc(100% - 6px)}.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-content{width:calc(100% - 18px)}.ant-timeline.ant-timeline-pending .ant-timeline-item-last .ant-timeline-item-tail{display:block;height:calc(100% - 14px);border-left:2px dotted #303030}.ant-timeline.ant-timeline-reverse .ant-timeline-item-last .ant-timeline-item-tail{display:none}.ant-timeline.ant-timeline-reverse .ant-timeline-item-pending .ant-timeline-item-tail{top:15px;display:block;height:calc(100% - 15px);border-left:2px dotted #303030}.ant-timeline.ant-timeline-reverse .ant-timeline-item-pending .ant-timeline-item-content{min-height:48px}.ant-timeline.ant-timeline-label .ant-timeline-item-label{position:absolute;top:-7.001px;width:calc(50% - 12px);text-align:right}.ant-timeline.ant-timeline-label .ant-timeline-item-right .ant-timeline-item-label{left:calc(50% + 14px);width:calc(50% - 14px);text-align:left}.ant-timeline-rtl{direction:rtl}.ant-timeline-rtl .ant-timeline-item-tail{right:4px;left:auto;border-right:2px solid #303030;border-left:none}.ant-timeline-rtl .ant-timeline-item-head-custom{right:5px;left:auto;transform:translate(50%,-50%)}.ant-timeline-rtl .ant-timeline-item-content{margin:0 18px 0 0}.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-tail,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-tail,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-tail{right:50%;left:auto}.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-head{margin-right:-4px;margin-left:0}.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-head-custom{margin-right:1px;margin-left:0}.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-left .ant-timeline-item-content,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-left .ant-timeline-item-content,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-left .ant-timeline-item-content{right:calc(50% - 4px);left:auto;text-align:right}.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-right .ant-timeline-item-content,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-right .ant-timeline-item-content,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-content{text-align:left}.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-tail{right:0;left:auto}.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-content{width:100%;margin-right:18px;text-align:right}.ant-timeline-rtl.ant-timeline.ant-timeline-pending .ant-timeline-item-last .ant-timeline-item-tail,.ant-timeline-rtl.ant-timeline.ant-timeline-reverse .ant-timeline-item-pending .ant-timeline-item-tail{border-right:2px dotted #303030;border-left:none}.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-label{text-align:left}.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-right .ant-timeline-item-label{right:calc(50% + 14px);text-align:right}.ant-tooltip{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:absolute;z-index:1070;display:block;max-width:250px;visibility:visible}.ant-tooltip-hidden{display:none}.ant-tooltip-placement-top,.ant-tooltip-placement-topLeft,.ant-tooltip-placement-topRight{padding-bottom:8px}.ant-tooltip-placement-right,.ant-tooltip-placement-rightBottom,.ant-tooltip-placement-rightTop{padding-left:8px}.ant-tooltip-placement-bottom,.ant-tooltip-placement-bottomLeft,.ant-tooltip-placement-bottomRight{padding-top:8px}.ant-tooltip-placement-left,.ant-tooltip-placement-leftBottom,.ant-tooltip-placement-leftTop{padding-right:8px}.ant-tooltip-inner{min-width:30px;min-height:32px;padding:6px 8px;color:#fff;text-align:left;text-decoration:none;word-wrap:break-word;background-color:#434343;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.48),0 6px 16px 0 rgba(0,0,0,.32),0 9px 28px 8px rgba(0,0,0,.2)}.ant-tooltip-arrow{position:absolute;display:block;width:13.07106781px;height:13.07106781px;overflow:hidden;background:transparent;pointer-events:none}.ant-tooltip-arrow-content{position:absolute;top:0;right:0;bottom:0;left:0;display:block;width:5px;height:5px;margin:auto;background-color:#434343;content:"";pointer-events:auto}.ant-tooltip-placement-top .ant-tooltip-arrow,.ant-tooltip-placement-topLeft .ant-tooltip-arrow,.ant-tooltip-placement-topRight .ant-tooltip-arrow{bottom:-5.07106781px}.ant-tooltip-placement-top .ant-tooltip-arrow-content,.ant-tooltip-placement-topLeft .ant-tooltip-arrow-content,.ant-tooltip-placement-topRight .ant-tooltip-arrow-content{box-shadow:3px 3px 7px rgba(0,0,0,.07);transform:translateY(-6.53553391px) rotate(45deg)}.ant-tooltip-placement-top .ant-tooltip-arrow{left:50%;transform:translateX(-50%)}.ant-tooltip-placement-topLeft .ant-tooltip-arrow{left:13px}.ant-tooltip-placement-topRight .ant-tooltip-arrow{right:13px}.ant-tooltip-placement-right .ant-tooltip-arrow,.ant-tooltip-placement-rightBottom .ant-tooltip-arrow,.ant-tooltip-placement-rightTop .ant-tooltip-arrow{left:-5.07106781px}.ant-tooltip-placement-right .ant-tooltip-arrow-content,.ant-tooltip-placement-rightBottom .ant-tooltip-arrow-content,.ant-tooltip-placement-rightTop .ant-tooltip-arrow-content{box-shadow:-3px 3px 7px rgba(0,0,0,.07);transform:translateX(6.53553391px) rotate(45deg)}.ant-tooltip-placement-right .ant-tooltip-arrow{top:50%;transform:translateY(-50%)}.ant-tooltip-placement-rightTop .ant-tooltip-arrow{top:5px}.ant-tooltip-placement-rightBottom .ant-tooltip-arrow{bottom:5px}.ant-tooltip-placement-left .ant-tooltip-arrow,.ant-tooltip-placement-leftBottom .ant-tooltip-arrow,.ant-tooltip-placement-leftTop .ant-tooltip-arrow{right:-5.07106781px}.ant-tooltip-placement-left .ant-tooltip-arrow-content,.ant-tooltip-placement-leftBottom .ant-tooltip-arrow-content,.ant-tooltip-placement-leftTop .ant-tooltip-arrow-content{box-shadow:3px -3px 7px rgba(0,0,0,.07);transform:translateX(-6.53553391px) rotate(45deg)}.ant-tooltip-placement-left .ant-tooltip-arrow{top:50%;transform:translateY(-50%)}.ant-tooltip-placement-leftTop .ant-tooltip-arrow{top:5px}.ant-tooltip-placement-leftBottom .ant-tooltip-arrow{bottom:5px}.ant-tooltip-placement-bottom .ant-tooltip-arrow,.ant-tooltip-placement-bottomLeft .ant-tooltip-arrow,.ant-tooltip-placement-bottomRight .ant-tooltip-arrow{top:-5.07106781px}.ant-tooltip-placement-bottom .ant-tooltip-arrow-content,.ant-tooltip-placement-bottomLeft .ant-tooltip-arrow-content,.ant-tooltip-placement-bottomRight .ant-tooltip-arrow-content{box-shadow:-3px -3px 7px rgba(0,0,0,.07);transform:translateY(6.53553391px) rotate(45deg)}.ant-tooltip-placement-bottom .ant-tooltip-arrow{left:50%;transform:translateX(-50%)}.ant-tooltip-placement-bottomLeft .ant-tooltip-arrow{left:13px}.ant-tooltip-placement-bottomRight .ant-tooltip-arrow{right:13px}.ant-tooltip-magenta .ant-tooltip-arrow-content,.ant-tooltip-magenta .ant-tooltip-inner,.ant-tooltip-pink .ant-tooltip-arrow-content,.ant-tooltip-pink .ant-tooltip-inner{background-color:#cb2b83}.ant-tooltip-red .ant-tooltip-arrow-content,.ant-tooltip-red .ant-tooltip-inner{background-color:#d32029}.ant-tooltip-volcano .ant-tooltip-arrow-content,.ant-tooltip-volcano .ant-tooltip-inner{background-color:#d84a1b}.ant-tooltip-orange .ant-tooltip-arrow-content,.ant-tooltip-orange .ant-tooltip-inner{background-color:#d87a16}.ant-tooltip-yellow .ant-tooltip-arrow-content,.ant-tooltip-yellow .ant-tooltip-inner{background-color:#d8bd14}.ant-tooltip-gold .ant-tooltip-arrow-content,.ant-tooltip-gold .ant-tooltip-inner{background-color:#d89614}.ant-tooltip-cyan .ant-tooltip-arrow-content,.ant-tooltip-cyan .ant-tooltip-inner{background-color:#13a8a8}.ant-tooltip-lime .ant-tooltip-arrow-content,.ant-tooltip-lime .ant-tooltip-inner{background-color:#8bbb11}.ant-tooltip-green .ant-tooltip-arrow-content,.ant-tooltip-green .ant-tooltip-inner{background-color:#49aa19}.ant-tooltip-blue .ant-tooltip-arrow-content,.ant-tooltip-blue .ant-tooltip-inner{background-color:#177ddc}.ant-tooltip-geekblue .ant-tooltip-arrow-content,.ant-tooltip-geekblue .ant-tooltip-inner{background-color:#2b4acb}.ant-tooltip-purple .ant-tooltip-arrow-content,.ant-tooltip-purple .ant-tooltip-inner{background-color:#642ab5}.ant-tooltip-rtl{direction:rtl}.ant-tooltip-rtl .ant-tooltip-inner{text-align:right}.ant-transfer-customize-list .ant-transfer-list{flex:1 1 50%;width:auto;height:auto;min-height:200px}.ant-transfer-customize-list .ant-table-wrapper .ant-table-small{border:0;border-radius:0}.ant-transfer-customize-list .ant-table-wrapper .ant-table-small>.ant-table-content>.ant-table-body>table>.ant-table-thead>tr>th{background:#1d1d1d}.ant-transfer-customize-list .ant-table-wrapper .ant-table-small>.ant-table-content .ant-table-row:last-child td{border-bottom:1px solid #303030}.ant-transfer-customize-list .ant-table-wrapper .ant-table-small .ant-table-body{margin:0}.ant-transfer-customize-list .ant-table-wrapper .ant-table-pagination.ant-pagination{margin:16px 0 4px}.ant-transfer-customize-list .ant-input[disabled]{background-color:transparent}.ant-transfer{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:relative;display:flex;align-items:stretch}.ant-transfer-disabled .ant-transfer-list{background:hsla(0,0%,100%,.08)}.ant-transfer-list{display:flex;flex-direction:column;width:180px;height:200px;border:1px solid #434343;border-radius:2px}.ant-transfer-list-with-pagination{width:250px;height:auto}.ant-transfer-list-search{padding-right:24px;padding-left:8px}.ant-transfer-list-search-action{position:absolute;top:12px;right:12px;bottom:12px;width:28px;color:hsla(0,0%,100%,.3);line-height:32px;text-align:center}.ant-transfer-list-search-action .anticon{color:hsla(0,0%,100%,.3);transition:all .3s}.ant-transfer-list-search-action .anticon:hover{color:hsla(0,0%,100%,.45)}span.ant-transfer-list-search-action{pointer-events:none}.ant-transfer-list-header{display:flex;flex:none;align-items:center;height:40px;padding:8px 12px 9px;color:hsla(0,0%,100%,.85);background:#141414;border-bottom:1px solid #303030;border-radius:2px 2px 0 0}.ant-transfer-list-header>:not(:last-child){margin-right:4px}.ant-transfer-list-header>*{flex:none}.ant-transfer-list-header-title{flex:auto;overflow:hidden;white-space:nowrap;text-align:right;text-overflow:ellipsis}.ant-transfer-list-header-dropdown{font-size:10px;transform:translateY(10%);cursor:pointer}.ant-transfer-list-header-dropdown[disabled]{cursor:not-allowed}.ant-transfer-list-body{display:flex;flex:auto;flex-direction:column;overflow:hidden;font-size:14px}.ant-transfer-list-body-search-wrapper{position:relative;flex:none;padding:12px}.ant-transfer-list-content{flex:auto;margin:0;padding:0;overflow:auto;list-style:none}.ant-transfer-list-content-item{display:flex;align-items:center;min-height:32px;padding:6px 12px;overflow:hidden;line-height:20px;transition:all .3s}.ant-transfer-list-content-item>:not(:last-child){margin-right:8px}.ant-transfer-list-content-item>*{flex:none}.ant-transfer-list-content-item-text{flex:auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ant-transfer-list-content-item-remove{color:#2abdd2;text-decoration:none;outline:none;cursor:pointer;transition:color .3s;position:relative;color:#434343}.ant-transfer-list-content-item-remove:focus,.ant-transfer-list-content-item-remove:hover{color:#228290}.ant-transfer-list-content-item-remove:active{color:#4abdca}.ant-transfer-list-content-item-remove:after{position:absolute;top:-6px;right:-50%;bottom:-6px;left:-50%;content:""}.ant-transfer-list-content-item-remove:hover{color:#228290}.ant-transfer-list-content-item:not(.ant-transfer-list-content-item-disabled):hover{background-color:#262626;cursor:pointer}.ant-transfer-list-content-item:not(.ant-transfer-list-content-item-disabled).ant-transfer-list-content-item-checked:hover{background-color:#0f1b1e}.ant-transfer-list-content-show-remove .ant-transfer-list-content-item:not(.ant-transfer-list-content-item-disabled):hover{background:transparent;cursor:default}.ant-transfer-list-content-item-checked{background-color:#132125}.ant-transfer-list-content-item-disabled{color:hsla(0,0%,100%,.3);cursor:not-allowed}.ant-transfer-list-pagination{padding:8px 0;text-align:right;border-top:1px solid #303030}.ant-transfer-list-body-not-found{flex:none;width:100%;margin:auto 0;color:hsla(0,0%,100%,.3);text-align:center}.ant-transfer-list-footer{border-top:1px solid #303030}.ant-transfer-operation{display:flex;flex:none;flex-direction:column;align-self:center;margin:0 8px;overflow:hidden;vertical-align:middle}.ant-transfer-operation .ant-btn{display:block}.ant-transfer-operation .ant-btn:first-child{margin-bottom:4px}.ant-transfer-operation .ant-btn .anticon{font-size:12px}.ant-transfer .ant-empty-image{max-height:-2px}.ant-transfer-rtl{direction:rtl}.ant-transfer-rtl .ant-transfer-list-search{padding-right:8px;padding-left:24px}.ant-transfer-rtl .ant-transfer-list-search-action{right:auto;left:12px}.ant-transfer-rtl .ant-transfer-list-header>:not(:last-child){margin-right:0;margin-left:4px}.ant-transfer-rtl .ant-transfer-list-header{right:0;left:auto}.ant-transfer-rtl .ant-transfer-list-header-title{text-align:left}.ant-transfer-rtl .ant-transfer-list-content-item>:not(:last-child){margin-right:0;margin-left:8px}.ant-transfer-rtl .ant-transfer-list-pagination{text-align:left}.ant-transfer-rtl .ant-transfer-list-footer{right:0;left:auto}.ant-tree-treenode-leaf-last .ant-tree-switcher-leaf-line:before{top:auto!important;bottom:auto!important;height:14px!important}.ant-tree.ant-tree-directory .ant-tree-treenode{position:relative}.ant-tree.ant-tree-directory .ant-tree-treenode:before{position:absolute;top:0;right:0;bottom:4px;left:0;transition:background-color .3s;content:"";pointer-events:none}.ant-tree.ant-tree-directory .ant-tree-treenode:hover:before{background:hsla(0,0%,100%,.08)}.ant-tree.ant-tree-directory .ant-tree-treenode>*{z-index:1}.ant-tree.ant-tree-directory .ant-tree-treenode .ant-tree-switcher{transition:color .3s}.ant-tree.ant-tree-directory .ant-tree-treenode .ant-tree-node-content-wrapper{border-radius:0;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ant-tree.ant-tree-directory .ant-tree-treenode .ant-tree-node-content-wrapper:hover{background:transparent}.ant-tree.ant-tree-directory .ant-tree-treenode .ant-tree-node-content-wrapper.ant-tree-node-selected{color:#fff;background:transparent}.ant-tree.ant-tree-directory .ant-tree-treenode-selected:before,.ant-tree.ant-tree-directory .ant-tree-treenode-selected:hover:before{background:#2abdd2}.ant-tree.ant-tree-directory .ant-tree-treenode-selected .ant-tree-switcher{color:#fff}.ant-tree.ant-tree-directory .ant-tree-treenode-selected .ant-tree-node-content-wrapper{color:#fff;background:transparent}.ant-tree-checkbox{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:relative;top:-.09em;display:inline-block;line-height:1;white-space:nowrap;vertical-align:middle;outline:none;cursor:pointer}.ant-tree-checkbox-input:focus+.ant-tree-checkbox-inner,.ant-tree-checkbox-wrapper:hover .ant-tree-checkbox-inner,.ant-tree-checkbox:hover .ant-tree-checkbox-inner{border-color:#2abdd2}.ant-tree-checkbox-checked:after{position:absolute;top:0;left:0;width:100%;height:100%;border:1px solid #2abdd2;border-radius:2px;visibility:hidden;animation:antCheckboxEffect .36s ease-in-out;animation-fill-mode:backwards;content:""}.ant-tree-checkbox-wrapper:hover .ant-tree-checkbox:after,.ant-tree-checkbox:hover:after{visibility:visible}.ant-tree-checkbox-inner{position:relative;top:0;left:0;display:block;width:16px;height:16px;direction:ltr;background-color:transparent;border:1px solid #434343;border-radius:2px;border-collapse:separate;transition:all .3s}.ant-tree-checkbox-inner:after{position:absolute;top:50%;left:22%;display:table;width:5.71428571px;height:9.14285714px;border:2px solid #fff;border-top:0;border-left:0;transform:rotate(45deg) scale(0) translate(-50%,-50%);opacity:0;transition:all .1s cubic-bezier(.71,-.46,.88,.6),opacity .1s;content:" "}.ant-tree-checkbox-input{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;width:100%;height:100%;cursor:pointer;opacity:0}.ant-tree-checkbox-checked .ant-tree-checkbox-inner:after{position:absolute;display:table;border:2px solid #fff;border-top:0;border-left:0;transform:rotate(45deg) scale(1) translate(-50%,-50%);opacity:1;transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s;content:" "}.ant-tree-checkbox-checked .ant-tree-checkbox-inner{background-color:#2abdd2;border-color:#2abdd2}.ant-tree-checkbox-disabled{cursor:not-allowed}.ant-tree-checkbox-disabled.ant-tree-checkbox-checked .ant-tree-checkbox-inner:after{border-color:hsla(0,0%,100%,.3);animation-name:none}.ant-tree-checkbox-disabled .ant-tree-checkbox-input{cursor:not-allowed}.ant-tree-checkbox-disabled .ant-tree-checkbox-inner{background-color:hsla(0,0%,100%,.08);border-color:#434343!important}.ant-tree-checkbox-disabled .ant-tree-checkbox-inner:after{border-color:hsla(0,0%,100%,.08);border-collapse:separate;animation-name:none}.ant-tree-checkbox-disabled+span{color:hsla(0,0%,100%,.3);cursor:not-allowed}.ant-tree-checkbox-disabled:hover:after,.ant-tree-checkbox-wrapper:hover .ant-tree-checkbox-disabled:after{visibility:hidden}.ant-tree-checkbox-wrapper{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";display:inline-block;line-height:unset;cursor:pointer}.ant-tree-checkbox-wrapper.ant-tree-checkbox-wrapper-disabled{cursor:not-allowed}.ant-tree-checkbox-wrapper+.ant-tree-checkbox-wrapper{margin-left:8px}.ant-tree-checkbox+span{padding-right:8px;padding-left:8px}.ant-tree-checkbox-group{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";display:inline-block}.ant-tree-checkbox-group-item{display:inline-block;margin-right:8px}.ant-tree-checkbox-group-item:last-child{margin-right:0}.ant-tree-checkbox-group-item+.ant-tree-checkbox-group-item{margin-left:0}.ant-tree-checkbox-indeterminate .ant-tree-checkbox-inner{background-color:transparent;border-color:#434343}.ant-tree-checkbox-indeterminate .ant-tree-checkbox-inner:after{top:50%;left:50%;width:8px;height:8px;background-color:#2abdd2;border:0;transform:translate(-50%,-50%) scale(1);opacity:1;content:" "}.ant-tree-checkbox-indeterminate.ant-tree-checkbox-disabled .ant-tree-checkbox-inner:after{background-color:hsla(0,0%,100%,.3);border-color:hsla(0,0%,100%,.3)}.ant-tree-checkbox-rtl{direction:rtl}.ant-tree-checkbox-group-rtl .ant-tree-checkbox-group-item{margin-right:0;margin-left:8px}.ant-tree-checkbox-group-rtl .ant-tree-checkbox-group-item:last-child{margin-left:0!important}.ant-tree-checkbox-group-rtl .ant-tree-checkbox-group-item+.ant-tree-checkbox-group-item{margin-left:8px}.ant-tree{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";background:transparent;border-radius:2px;transition:background-color .3s}.ant-tree-focused:not(:hover):not(.ant-tree-active-focused){background:#132125}.ant-tree-list-holder-inner{align-items:flex-start}.ant-tree.ant-tree-block-node .ant-tree-list-holder-inner{align-items:stretch}.ant-tree.ant-tree-block-node .ant-tree-list-holder-inner .ant-tree-node-content-wrapper{flex:auto}.ant-tree .ant-tree-treenode{display:flex;align-items:flex-start;padding:0 0 4px;outline:none}.ant-tree .ant-tree-treenode-disabled .ant-tree-node-content-wrapper{color:hsla(0,0%,100%,.3);cursor:not-allowed}.ant-tree .ant-tree-treenode-disabled .ant-tree-node-content-wrapper:hover{background:transparent}.ant-tree .ant-tree-treenode-active .ant-tree-node-content-wrapper{background:hsla(0,0%,100%,.08)}.ant-tree .ant-tree-treenode:not(.ant-tree .ant-tree-treenode-disabled).filter-node .ant-tree-title{color:inherit;font-weight:500}.ant-tree-indent{align-self:stretch;white-space:nowrap;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ant-tree-indent-unit{display:inline-block;width:24px}.ant-tree-switcher{position:relative;flex:none;align-self:stretch;width:24px;margin:0;line-height:24px;text-align:center;cursor:pointer;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ant-tree-switcher .ant-select-tree-switcher-icon,.ant-tree-switcher .ant-tree-switcher-icon{display:inline-block;font-size:10px;vertical-align:baseline}.ant-tree-switcher .ant-select-tree-switcher-icon svg,.ant-tree-switcher .ant-tree-switcher-icon svg{transition:transform .3s}.ant-tree-switcher-noop{cursor:default}.ant-tree-switcher_close .ant-tree-switcher-icon svg{transform:rotate(-90deg)}.ant-tree-switcher-loading-icon{color:#2abdd2}.ant-tree-switcher-leaf-line{position:relative;z-index:1;display:inline-block;width:100%;height:100%}.ant-tree-switcher-leaf-line:before{position:absolute;top:0;bottom:-4px;margin-left:-1px;border-left:1px solid #d9d9d9;content:" "}.ant-tree-switcher-leaf-line:after{position:absolute;width:10px;height:14px;margin-left:-1px;border-bottom:1px solid #d9d9d9;content:" "}.ant-tree-checkbox{top:auto;margin:4px 8px 0 0}.ant-tree .ant-tree-node-content-wrapper{position:relative;z-index:auto;min-height:24px;margin:0;padding:0 4px;color:inherit;line-height:24px;background:transparent;border-radius:2px;cursor:pointer;transition:all .3s,border 0s,line-height 0s,box-shadow 0s}.ant-tree .ant-tree-node-content-wrapper:hover{background-color:hsla(0,0%,100%,.08)}.ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected{background-color:#16343a}.ant-tree .ant-tree-node-content-wrapper .ant-tree-iconEle{display:inline-block;width:24px;height:24px;line-height:24px;text-align:center;vertical-align:top}.ant-tree .ant-tree-node-content-wrapper .ant-tree-iconEle:empty{display:none}.ant-tree-unselectable .ant-tree-node-content-wrapper:hover{background-color:transparent}.ant-tree-node-content-wrapper[draggable=true]{line-height:24px;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ant-tree-node-content-wrapper[draggable=true] .ant-tree-drop-indicator{position:absolute;z-index:1;height:2px;background-color:#2abdd2;border-radius:1px;pointer-events:none}.ant-tree-node-content-wrapper[draggable=true] .ant-tree-drop-indicator:after{position:absolute;top:-3px;left:-6px;width:8px;height:8px;background-color:transparent;border:2px solid #2abdd2;border-radius:50%;content:""}.ant-tree .ant-tree-treenode.drop-container>[draggable]{box-shadow:0 0 0 2px #2abdd2}.ant-tree-show-line .ant-tree-indent-unit{position:relative;height:100%}.ant-tree-show-line .ant-tree-indent-unit:before{position:absolute;top:0;right:12px;bottom:-4px;border-right:1px solid #434343;content:""}.ant-tree-show-line .ant-tree-indent-unit-end:before{display:none}.ant-tree-show-line .ant-tree-switcher{background:#141414}.ant-tree-show-line .ant-tree-switcher-line-icon{vertical-align:-.225em}.ant-tree-rtl{direction:rtl}.ant-tree-rtl .ant-tree-node-content-wrapper[draggable=true] .ant-tree-drop-indicator:after{right:-6px;left:unset}.ant-tree .ant-tree-treenode-rtl{direction:rtl}.ant-tree-rtl .ant-tree-switcher_close .ant-tree-switcher-icon svg{transform:rotate(90deg)}.ant-tree-rtl.ant-tree-show-line .ant-tree-indent-unit:before{right:auto;left:-13px;border-right:none;border-left:1px solid #434343}.ant-tree-rtl.ant-tree-checkbox,.ant-tree-select-dropdown-rtl .ant-select-tree-checkbox{margin:4px 0 0 8px}.ant-select-tree-checkbox{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";position:relative;top:-.09em;display:inline-block;line-height:1;white-space:nowrap;vertical-align:middle;outline:none;cursor:pointer}.ant-select-tree-checkbox-input:focus+.ant-select-tree-checkbox-inner,.ant-select-tree-checkbox-wrapper:hover .ant-select-tree-checkbox-inner,.ant-select-tree-checkbox:hover .ant-select-tree-checkbox-inner{border-color:#2abdd2}.ant-select-tree-checkbox-checked:after{position:absolute;top:0;left:0;width:100%;height:100%;border:1px solid #2abdd2;border-radius:2px;visibility:hidden;animation:antCheckboxEffect .36s ease-in-out;animation-fill-mode:backwards;content:""}.ant-select-tree-checkbox-wrapper:hover .ant-select-tree-checkbox:after,.ant-select-tree-checkbox:hover:after{visibility:visible}.ant-select-tree-checkbox-inner{position:relative;top:0;left:0;display:block;width:16px;height:16px;direction:ltr;background-color:transparent;border:1px solid #434343;border-radius:2px;border-collapse:separate;transition:all .3s}.ant-select-tree-checkbox-inner:after{position:absolute;top:50%;left:22%;display:table;width:5.71428571px;height:9.14285714px;border:2px solid #fff;border-top:0;border-left:0;transform:rotate(45deg) scale(0) translate(-50%,-50%);opacity:0;transition:all .1s cubic-bezier(.71,-.46,.88,.6),opacity .1s;content:" "}.ant-select-tree-checkbox-input{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;width:100%;height:100%;cursor:pointer;opacity:0}.ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner:after{position:absolute;display:table;border:2px solid #fff;border-top:0;border-left:0;transform:rotate(45deg) scale(1) translate(-50%,-50%);opacity:1;transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s;content:" "}.ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner{background-color:#2abdd2;border-color:#2abdd2}.ant-select-tree-checkbox-disabled{cursor:not-allowed}.ant-select-tree-checkbox-disabled.ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner:after{border-color:hsla(0,0%,100%,.3);animation-name:none}.ant-select-tree-checkbox-disabled .ant-select-tree-checkbox-input{cursor:not-allowed}.ant-select-tree-checkbox-disabled .ant-select-tree-checkbox-inner{background-color:hsla(0,0%,100%,.08);border-color:#434343!important}.ant-select-tree-checkbox-disabled .ant-select-tree-checkbox-inner:after{border-color:hsla(0,0%,100%,.08);border-collapse:separate;animation-name:none}.ant-select-tree-checkbox-disabled+span{color:hsla(0,0%,100%,.3);cursor:not-allowed}.ant-select-tree-checkbox-disabled:hover:after,.ant-select-tree-checkbox-wrapper:hover .ant-select-tree-checkbox-disabled:after{visibility:hidden}.ant-select-tree-checkbox-wrapper{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";display:inline-block;line-height:unset;cursor:pointer}.ant-select-tree-checkbox-wrapper.ant-select-tree-checkbox-wrapper-disabled{cursor:not-allowed}.ant-select-tree-checkbox-wrapper+.ant-select-tree-checkbox-wrapper{margin-left:8px}.ant-select-tree-checkbox+span{padding-right:8px;padding-left:8px}.ant-select-tree-checkbox-group{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";display:inline-block}.ant-select-tree-checkbox-group-item{display:inline-block;margin-right:8px}.ant-select-tree-checkbox-group-item:last-child{margin-right:0}.ant-select-tree-checkbox-group-item+.ant-select-tree-checkbox-group-item{margin-left:0}.ant-select-tree-checkbox-indeterminate .ant-select-tree-checkbox-inner{background-color:transparent;border-color:#434343}.ant-select-tree-checkbox-indeterminate .ant-select-tree-checkbox-inner:after{top:50%;left:50%;width:8px;height:8px;background-color:#2abdd2;border:0;transform:translate(-50%,-50%) scale(1);opacity:1;content:" "}.ant-select-tree-checkbox-indeterminate.ant-select-tree-checkbox-disabled .ant-select-tree-checkbox-inner:after{background-color:hsla(0,0%,100%,.3);border-color:hsla(0,0%,100%,.3)}.ant-select-tree-checkbox-rtl{direction:rtl}.ant-select-tree-checkbox-group-rtl .ant-select-tree-checkbox-group-item{margin-right:0;margin-left:8px}.ant-select-tree-checkbox-group-rtl .ant-select-tree-checkbox-group-item:last-child{margin-left:0!important}.ant-select-tree-checkbox-group-rtl .ant-select-tree-checkbox-group-item+.ant-select-tree-checkbox-group-item{margin-left:8px}.ant-tree-select-dropdown{padding:8px 4px 0}.ant-tree-select-dropdown-rtl{direction:rtl}.ant-tree-select-dropdown .ant-select-tree{border-radius:0}.ant-tree-select-dropdown .ant-select-tree-list-holder-inner{align-items:stretch}.ant-tree-select-dropdown .ant-select-tree-list-holder-inner .ant-select-tree-treenode{padding-bottom:8px}.ant-tree-select-dropdown .ant-select-tree-list-holder-inner .ant-select-tree-treenode .ant-select-tree-node-content-wrapper{flex:auto}.ant-select-tree{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";background:transparent;border-radius:2px;transition:background-color .3s}.ant-select-tree-focused:not(:hover):not(.ant-select-tree-active-focused){background:#132125}.ant-select-tree-list-holder-inner{align-items:flex-start}.ant-select-tree.ant-select-tree-block-node .ant-select-tree-list-holder-inner{align-items:stretch}.ant-select-tree.ant-select-tree-block-node .ant-select-tree-list-holder-inner .ant-select-tree-node-content-wrapper{flex:auto}.ant-select-tree .ant-select-tree-treenode{display:flex;align-items:flex-start;padding:0 0 4px;outline:none}.ant-select-tree .ant-select-tree-treenode-disabled .ant-select-tree-node-content-wrapper{color:hsla(0,0%,100%,.3);cursor:not-allowed}.ant-select-tree .ant-select-tree-treenode-disabled .ant-select-tree-node-content-wrapper:hover{background:transparent}.ant-select-tree .ant-select-tree-treenode-active .ant-select-tree-node-content-wrapper{background:hsla(0,0%,100%,.08)}.ant-select-tree .ant-select-tree-treenode:not(.ant-select-tree .ant-select-tree-treenode-disabled).filter-node .ant-select-tree-title{color:inherit;font-weight:500}.ant-select-tree-indent{align-self:stretch;white-space:nowrap;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ant-select-tree-indent-unit{display:inline-block;width:24px}.ant-select-tree-switcher{position:relative;flex:none;align-self:stretch;width:24px;margin:0;line-height:24px;text-align:center;cursor:pointer;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ant-select-tree-switcher .ant-select-tree-switcher-icon,.ant-select-tree-switcher .ant-tree-switcher-icon{display:inline-block;font-size:10px;vertical-align:baseline}.ant-select-tree-switcher .ant-select-tree-switcher-icon svg,.ant-select-tree-switcher .ant-tree-switcher-icon svg{transition:transform .3s}.ant-select-tree-switcher-noop{cursor:default}.ant-select-tree-switcher_close .ant-select-tree-switcher-icon svg{transform:rotate(-90deg)}.ant-select-tree-switcher-loading-icon{color:#2abdd2}.ant-select-tree-switcher-leaf-line{position:relative;z-index:1;display:inline-block;width:100%;height:100%}.ant-select-tree-switcher-leaf-line:before{position:absolute;top:0;bottom:-4px;margin-left:-1px;border-left:1px solid #d9d9d9;content:" "}.ant-select-tree-switcher-leaf-line:after{position:absolute;width:10px;height:14px;margin-left:-1px;border-bottom:1px solid #d9d9d9;content:" "}.ant-select-tree-checkbox{top:auto;margin:4px 8px 0 0}.ant-select-tree .ant-select-tree-node-content-wrapper{position:relative;z-index:auto;min-height:24px;margin:0;padding:0 4px;color:inherit;line-height:24px;background:transparent;border-radius:2px;cursor:pointer;transition:all .3s,border 0s,line-height 0s,box-shadow 0s}.ant-select-tree .ant-select-tree-node-content-wrapper:hover{background-color:hsla(0,0%,100%,.08)}.ant-select-tree .ant-select-tree-node-content-wrapper.ant-select-tree-node-selected{background-color:#16343a}.ant-select-tree .ant-select-tree-node-content-wrapper .ant-select-tree-iconEle{display:inline-block;width:24px;height:24px;line-height:24px;text-align:center;vertical-align:top}.ant-select-tree .ant-select-tree-node-content-wrapper .ant-select-tree-iconEle:empty{display:none}.ant-select-tree-unselectable .ant-select-tree-node-content-wrapper:hover{background-color:transparent}.ant-select-tree-node-content-wrapper[draggable=true]{line-height:24px;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ant-select-tree-node-content-wrapper[draggable=true] .ant-tree-drop-indicator{position:absolute;z-index:1;height:2px;background-color:#2abdd2;border-radius:1px;pointer-events:none}.ant-select-tree-node-content-wrapper[draggable=true] .ant-tree-drop-indicator:after{position:absolute;top:-3px;left:-6px;width:8px;height:8px;background-color:transparent;border:2px solid #2abdd2;border-radius:50%;content:""}.ant-select-tree .ant-select-tree-treenode.drop-container>[draggable]{box-shadow:0 0 0 2px #2abdd2}.ant-select-tree-show-line .ant-select-tree-indent-unit{position:relative;height:100%}.ant-select-tree-show-line .ant-select-tree-indent-unit:before{position:absolute;top:0;right:12px;bottom:-4px;border-right:1px solid #434343;content:""}.ant-select-tree-show-line .ant-select-tree-indent-unit-end:before{display:none}.ant-select-tree-show-line .ant-select-tree-switcher{background:#141414}.ant-select-tree-show-line .ant-select-tree-switcher-line-icon{vertical-align:-.225em}.ant-tree-select-dropdown-rtl .ant-select-tree .ant-select-tree-switcher_close .ant-select-tree-switcher-icon svg{transform:rotate(90deg)}.ant-tree-select-dropdown-rtl .ant-select-tree .ant-select-tree-switcher-loading-icon{transform:scaleY(-1)}.ant-typography{color:hsla(0,0%,100%,.85);overflow-wrap:break-word}.ant-typography.ant-typography-secondary{color:hsla(0,0%,100%,.45)}.ant-typography.ant-typography-success{color:#49aa19}.ant-typography.ant-typography-warning{color:#d89614}.ant-typography.ant-typography-danger{color:#a61d24}a.ant-typography.ant-typography-danger:active,a.ant-typography.ant-typography-danger:focus,a.ant-typography.ant-typography-danger:hover{color:#b33b3d}.ant-typography.ant-typography-disabled{color:hsla(0,0%,100%,.3);cursor:not-allowed;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ant-typography p,div.ant-typography{margin-bottom:1em}.ant-typography h1,h1.ant-typography{margin-bottom:.5em;color:hsla(0,0%,100%,.85);font-weight:600;font-size:38px;line-height:1.23}.ant-typography h2,h2.ant-typography{font-size:30px}.ant-typography h2,.ant-typography h3,h2.ant-typography,h3.ant-typography{margin-bottom:.5em;color:hsla(0,0%,100%,.85);font-weight:600;line-height:1.35}.ant-typography h3,h3.ant-typography{font-size:24px}.ant-typography h4,h4.ant-typography{margin-bottom:.5em;color:hsla(0,0%,100%,.85);font-weight:600;font-size:20px;line-height:1.4}.ant-typography h5,h5.ant-typography{margin-bottom:.5em;color:hsla(0,0%,100%,.85);font-weight:600;font-size:16px;line-height:1.5}.ant-typography+h1.ant-typography,.ant-typography+h2.ant-typography,.ant-typography+h3.ant-typography,.ant-typography+h4.ant-typography,.ant-typography+h5.ant-typography,.ant-typography div+h1,.ant-typography div+h2,.ant-typography div+h3,.ant-typography div+h4,.ant-typography div+h5,.ant-typography h1+h1,.ant-typography h1+h2,.ant-typography h1+h3,.ant-typography h1+h4,.ant-typography h1+h5,.ant-typography h2+h1,.ant-typography h2+h2,.ant-typography h2+h3,.ant-typography h2+h4,.ant-typography h2+h5,.ant-typography h3+h1,.ant-typography h3+h2,.ant-typography h3+h3,.ant-typography h3+h4,.ant-typography h3+h5,.ant-typography h4+h1,.ant-typography h4+h2,.ant-typography h4+h3,.ant-typography h4+h4,.ant-typography h4+h5,.ant-typography h5+h1,.ant-typography h5+h2,.ant-typography h5+h3,.ant-typography h5+h4,.ant-typography h5+h5,.ant-typography li+h1,.ant-typography li+h2,.ant-typography li+h3,.ant-typography li+h4,.ant-typography li+h5,.ant-typography p+h1,.ant-typography p+h2,.ant-typography p+h3,.ant-typography p+h4,.ant-typography p+h5,.ant-typography ul+h1,.ant-typography ul+h2,.ant-typography ul+h3,.ant-typography ul+h4,.ant-typography ul+h5{margin-top:1.2em}a.ant-typography-ellipsis,span.ant-typography-ellipsis{display:inline-block}.ant-typography a,a.ant-typography{color:#2abdd2;outline:none;cursor:pointer;transition:color .3s;text-decoration:none}.ant-typography a:focus,.ant-typography a:hover,a.ant-typography:focus,a.ant-typography:hover{color:#228290}.ant-typography a:active,a.ant-typography:active{color:#4abdca}.ant-typography a:active,.ant-typography a:hover,a.ant-typography:active,a.ant-typography:hover{text-decoration:none}.ant-typography a.ant-typography-disabled,.ant-typography a[disabled],a.ant-typography.ant-typography-disabled,a.ant-typography[disabled]{color:hsla(0,0%,100%,.3);cursor:not-allowed}.ant-typography a.ant-typography-disabled:active,.ant-typography a.ant-typography-disabled:hover,.ant-typography a[disabled]:active,.ant-typography a[disabled]:hover,a.ant-typography.ant-typography-disabled:active,a.ant-typography.ant-typography-disabled:hover,a.ant-typography[disabled]:active,a.ant-typography[disabled]:hover{color:hsla(0,0%,100%,.3)}.ant-typography a.ant-typography-disabled:active,.ant-typography a[disabled]:active,a.ant-typography.ant-typography-disabled:active,a.ant-typography[disabled]:active{pointer-events:none}.ant-typography code{margin:0 .2em;padding:.2em .4em .1em;font-size:85%;background:hsla(0,0%,58.8%,.1);border:1px solid hsla(0,0%,39.2%,.2);border-radius:3px}.ant-typography kbd{margin:0 .2em;padding:.15em .4em .1em;font-size:90%;background:hsla(0,0%,58.8%,.06);border:solid hsla(0,0%,39.2%,.2);border-width:1px 1px 2px;border-radius:3px}.ant-typography mark{padding:0;background-color:#594214}.ant-typography ins,.ant-typography u{text-decoration:underline;-webkit-text-decoration-skip:ink;text-decoration-skip-ink:auto}.ant-typography del,.ant-typography s{text-decoration:line-through}.ant-typography strong{font-weight:600}.ant-typography-copy,.ant-typography-edit,.ant-typography-expand{color:#2abdd2;text-decoration:none;outline:none;cursor:pointer;transition:color .3s;margin-left:4px}.ant-typography-copy:focus,.ant-typography-copy:hover,.ant-typography-edit:focus,.ant-typography-edit:hover,.ant-typography-expand:focus,.ant-typography-expand:hover{color:#228290}.ant-typography-copy:active,.ant-typography-edit:active,.ant-typography-expand:active{color:#4abdca}.ant-typography-copy-success,.ant-typography-copy-success:focus,.ant-typography-copy-success:hover{color:#49aa19}.ant-typography-edit-content{position:relative}div.ant-typography-edit-content{left:-12px;margin-top:-5px;margin-bottom:calc(1em - 5px)}.ant-typography-edit-content-confirm{position:absolute;right:10px;bottom:8px;color:hsla(0,0%,100%,.45);pointer-events:none}.ant-typography-edit-content textarea{-moz-transition:none}.ant-typography ol,.ant-typography ul{margin:0 0 1em;padding:0}.ant-typography ol li,.ant-typography ul li{margin:0 0 0 20px;padding:0 0 0 4px}.ant-typography ul{list-style-type:circle}.ant-typography ul ul{list-style-type:disc}.ant-typography ol{list-style-type:decimal}.ant-typography blockquote,.ant-typography pre{margin:1em 0}.ant-typography pre{padding:.4em .6em;white-space:pre-wrap;word-wrap:break-word;background:hsla(0,0%,58.8%,.1);border:1px solid hsla(0,0%,39.2%,.2);border-radius:3px}.ant-typography pre code{display:inline;margin:0;padding:0;font-size:inherit;font-family:inherit;background:transparent;border:0}.ant-typography blockquote{padding:0 0 0 .6em;border-left:4px solid hsla(0,0%,39.2%,.2);opacity:.85}.ant-typography-ellipsis-single-line{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}a.ant-typography-ellipsis-single-line,span.ant-typography-ellipsis-single-line{vertical-align:bottom}.ant-typography-ellipsis-multiple-line{display:-webkit-box;overflow:hidden;-webkit-line-clamp:3; - /*! autoprefixer: ignore next */-webkit-box-orient:vertical}.ant-typography-rtl{direction:rtl}.ant-typography-rtl .ant-typography-copy,.ant-typography-rtl .ant-typography-edit,.ant-typography-rtl .ant-typography-expand{margin-right:4px;margin-left:0}.ant-typography-rtl .ant-typography-expand{float:left}div.ant-typography-edit-content.ant-typography-rtl{right:-12px;left:auto}.ant-typography-rtl .ant-typography-edit-content-confirm{right:auto;left:10px}.ant-typography-rtl.ant-typography ol li,.ant-typography-rtl.ant-typography ul li{margin:0 20px 0 0;padding:0 4px 0 0}.ant-upload{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";outline:0}.ant-upload p{margin:0}.ant-upload-btn{display:block;width:100%;outline:none}.ant-upload input[type=file]{cursor:pointer}.ant-upload.ant-upload-select{display:inline-block}.ant-upload.ant-upload-disabled{cursor:not-allowed}.ant-upload.ant-upload-select-picture-card{width:104px;height:104px;margin-right:8px;margin-bottom:8px;text-align:center;vertical-align:top;background-color:hsla(0,0%,100%,.04);border:1px dashed #434343;border-radius:2px;cursor:pointer;transition:border-color .3s}.ant-upload.ant-upload-select-picture-card>.ant-upload{display:flex;align-items:center;justify-content:center;height:100%;text-align:center}.ant-upload.ant-upload-select-picture-card:hover{border-color:#2abdd2}.ant-upload-disabled.ant-upload.ant-upload-select-picture-card:hover{border-color:#434343}.ant-upload.ant-upload-drag{position:relative;width:100%;height:100%;text-align:center;background:hsla(0,0%,100%,.04);border:1px dashed #434343;border-radius:2px;cursor:pointer;transition:border-color .3s}.ant-upload.ant-upload-drag .ant-upload{padding:16px 0}.ant-upload.ant-upload-drag.ant-upload-drag-hover:not(.ant-upload-disabled){border-color:#4abdca}.ant-upload.ant-upload-drag.ant-upload-disabled{cursor:not-allowed}.ant-upload.ant-upload-drag .ant-upload-btn{display:table;height:100%}.ant-upload.ant-upload-drag .ant-upload-drag-container{display:table-cell;vertical-align:middle}.ant-upload.ant-upload-drag:not(.ant-upload-disabled):hover{border-color:#228290}.ant-upload.ant-upload-drag p.ant-upload-drag-icon{margin-bottom:20px}.ant-upload.ant-upload-drag p.ant-upload-drag-icon .anticon{color:#228290;font-size:48px}.ant-upload.ant-upload-drag p.ant-upload-text{margin:0 0 4px;color:hsla(0,0%,100%,.85);font-size:16px}.ant-upload.ant-upload-drag p.ant-upload-hint{color:hsla(0,0%,100%,.45);font-size:14px}.ant-upload.ant-upload-drag .anticon-plus{color:hsla(0,0%,100%,.3);font-size:30px;transition:all .3s}.ant-upload.ant-upload-drag .anticon-plus:hover,.ant-upload.ant-upload-drag:hover .anticon-plus{color:hsla(0,0%,100%,.45)}.ant-upload-picture-card-wrapper{display:inline-block;width:100%}.ant-upload-picture-card-wrapper:before{display:table;content:""}.ant-upload-picture-card-wrapper:after{display:table;clear:both;content:""}.ant-upload-list{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;list-style:none;font-feature-settings:"tnum","tnum";line-height:1.5715}.ant-upload-list:after,.ant-upload-list:before{display:table;content:""}.ant-upload-list:after{clear:both}.ant-upload-list-item{position:relative;height:22.001px;margin-top:8px;font-size:14px}.ant-upload-list-item-name{display:inline-block;width:100%;padding-left:22px;overflow:hidden;line-height:1.5715;white-space:nowrap;text-overflow:ellipsis}.ant-upload-list-item-card-actions{position:absolute;right:0}.ant-upload-list-item-card-actions-btn{opacity:0}.ant-upload-list-item-card-actions-btn.ant-btn-sm{height:20px;line-height:1}.ant-upload-list-item-card-actions.picture{top:22px;line-height:0}.ant-upload-list-item-card-actions-btn:focus,.ant-upload-list-item-card-actions.picture .ant-upload-list-item-card-actions-btn{opacity:1}.ant-upload-list-item-card-actions .anticon{color:hsla(0,0%,100%,.45)}.ant-upload-list-item-info{height:100%;padding:0 4px;transition:background-color .3s}.ant-upload-list-item-info>span{display:block;width:100%;height:100%}.ant-upload-list-item-info .ant-upload-text-icon .anticon,.ant-upload-list-item-info .anticon-loading .anticon{position:absolute;top:5px;color:hsla(0,0%,100%,.45);font-size:14px}.ant-upload-list-item .anticon-close{position:absolute;top:6px;right:4px;color:hsla(0,0%,100%,.45);font-size:10px;line-height:0;cursor:pointer;opacity:0;transition:all .3s}.ant-upload-list-item .anticon-close:hover{color:hsla(0,0%,100%,.85)}.ant-upload-list-item:hover .ant-upload-list-item-info{background-color:hsla(0,0%,100%,.08)}.ant-upload-list-item:hover .ant-upload-list-item-card-actions-btn,.ant-upload-list-item:hover .anticon-close{opacity:1}.ant-upload-list-item-error,.ant-upload-list-item-error .ant-upload-list-item-card-actions .anticon,.ant-upload-list-item-error .ant-upload-list-item-name,.ant-upload-list-item-error .ant-upload-text-icon>.anticon{color:#a61d24}.ant-upload-list-item-error .ant-upload-list-item-card-actions-btn{opacity:1}.ant-upload-list-item-progress{position:absolute;bottom:-12px;width:100%;padding-left:26px;font-size:14px;line-height:0}.ant-upload-list-picture-card .ant-upload-list-item,.ant-upload-list-picture .ant-upload-list-item{position:relative;height:66px;padding:8px;border:1px solid #434343;border-radius:2px}.ant-upload-list-picture-card .ant-upload-list-item:hover,.ant-upload-list-picture .ant-upload-list-item:hover{background:transparent}.ant-upload-list-picture-card .ant-upload-list-item-error,.ant-upload-list-picture .ant-upload-list-item-error{border-color:#a61d24}.ant-upload-list-picture-card .ant-upload-list-item:hover .ant-upload-list-item-info,.ant-upload-list-picture .ant-upload-list-item:hover .ant-upload-list-item-info{background:transparent}.ant-upload-list-picture-card .ant-upload-list-item-uploading,.ant-upload-list-picture .ant-upload-list-item-uploading{border-style:dashed}.ant-upload-list-picture-card .ant-upload-list-item-thumbnail,.ant-upload-list-picture .ant-upload-list-item-thumbnail{width:48px;height:48px;line-height:54px;text-align:center;opacity:.8}.ant-upload-list-picture-card .ant-upload-list-item-thumbnail .anticon,.ant-upload-list-picture .ant-upload-list-item-thumbnail .anticon{font-size:26px}.ant-upload-list-picture-card .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#e6f7ff"],.ant-upload-list-picture .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#e6f7ff"]{fill:#e6d9d8}.ant-upload-list-picture-card .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#1890ff"],.ant-upload-list-picture .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#1890ff"]{fill:#a61d24}.ant-upload-list-picture-card .ant-upload-list-item-icon,.ant-upload-list-picture .ant-upload-list-item-icon{position:absolute;top:50%;left:50%;font-size:26px;transform:translate(-50%,-50%)}.ant-upload-list-picture-card .ant-upload-list-item-icon .anticon,.ant-upload-list-picture .ant-upload-list-item-icon .anticon{font-size:26px}.ant-upload-list-picture-card .ant-upload-list-item-image,.ant-upload-list-picture .ant-upload-list-item-image{max-width:100%}.ant-upload-list-picture-card .ant-upload-list-item-thumbnail img,.ant-upload-list-picture .ant-upload-list-item-thumbnail img{display:block;width:48px;height:48px;overflow:hidden}.ant-upload-list-picture-card .ant-upload-list-item-name,.ant-upload-list-picture .ant-upload-list-item-name{display:inline-block;box-sizing:border-box;max-width:100%;margin:0 0 0 8px;padding-right:8px;padding-left:48px;overflow:hidden;line-height:44px;white-space:nowrap;text-overflow:ellipsis;transition:all .3s}.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-name,.ant-upload-list-picture .ant-upload-list-item-uploading .ant-upload-list-item-name{line-height:28px}.ant-upload-list-picture-card .ant-upload-list-item-progress,.ant-upload-list-picture .ant-upload-list-item-progress{bottom:14px;width:calc(100% - 24px);margin-top:0;padding-left:56px}.ant-upload-list-picture-card .anticon-close,.ant-upload-list-picture .anticon-close{position:absolute;top:8px;right:8px;line-height:1;opacity:1}.ant-upload-list-picture-card-container{display:inline-block;width:104px;height:104px;margin:0 8px 8px 0;vertical-align:top}.ant-upload-list-picture-card.ant-upload-list:after{display:none}.ant-upload-list-picture-card .ant-upload-list-item{height:100%;margin:0}.ant-upload-list-picture-card .ant-upload-list-item-info{position:relative;height:100%;overflow:hidden}.ant-upload-list-picture-card .ant-upload-list-item-info:before{position:absolute;z-index:1;width:100%;height:100%;background-color:rgba(0,0,0,.5);opacity:0;transition:all .3s;content:" "}.ant-upload-list-picture-card .ant-upload-list-item:hover .ant-upload-list-item-info:before{opacity:1}.ant-upload-list-picture-card .ant-upload-list-item-actions{position:absolute;top:50%;left:50%;z-index:10;white-space:nowrap;transform:translate(-50%,-50%);opacity:0;transition:all .3s}.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-delete,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-download,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-eye{z-index:10;width:16px;margin:0 4px;color:hsla(0,0%,100%,.85);font-size:16px;cursor:pointer;transition:all .3s}.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-delete:hover,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-download:hover,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-eye:hover{color:#fff}.ant-upload-list-picture-card .ant-upload-list-item-actions:hover,.ant-upload-list-picture-card .ant-upload-list-item-info:hover+.ant-upload-list-item-actions{opacity:1}.ant-upload-list-picture-card .ant-upload-list-item-thumbnail,.ant-upload-list-picture-card .ant-upload-list-item-thumbnail img{position:static;display:block;width:100%;height:100%;object-fit:contain}.ant-upload-list-picture-card .ant-upload-list-item-name{display:none;margin:8px 0 0;padding:0;line-height:1.5715;text-align:center}.ant-upload-list-picture-card .ant-upload-list-item-file+.ant-upload-list-item-name{position:absolute;bottom:10px;display:block}.ant-upload-list-picture-card .ant-upload-list-item-uploading.ant-upload-list-item{background-color:hsla(0,0%,100%,.04)}.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info{height:auto}.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info .anticon-delete,.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info .anticon-eye,.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info:before{display:none}.ant-upload-list-picture-card .ant-upload-list-item-progress{bottom:32px;width:calc(100% - 14px);padding-left:0}.ant-upload-list-picture-container,.ant-upload-list-text-container{transition:opacity .3s,height .3s}.ant-upload-list-picture-container:before,.ant-upload-list-text-container:before{display:table;width:0;height:0;content:""}.ant-upload-list-picture-container .ant-upload-span,.ant-upload-list-text-container .ant-upload-span{display:block;flex:auto}.ant-upload-list-picture .ant-upload-span,.ant-upload-list-text .ant-upload-span{display:flex;align-items:center}.ant-upload-list-picture .ant-upload-span>*,.ant-upload-list-text .ant-upload-span>*{flex:none}.ant-upload-list-picture .ant-upload-list-item-name,.ant-upload-list-text .ant-upload-list-item-name{flex:auto;padding:0 8px}.ant-upload-list-picture .ant-upload-list-item-card-actions,.ant-upload-list-text .ant-upload-list-item-card-actions,.ant-upload-list-text .ant-upload-text-icon .anticon{position:static}.ant-upload-list .ant-upload-animate-inline-appear,.ant-upload-list .ant-upload-animate-inline-enter,.ant-upload-list .ant-upload-animate-inline-leave{animation-duration:.3s;animation-fill-mode:cubic-bezier(.78,.14,.15,.86)}.ant-upload-list .ant-upload-animate-inline-appear,.ant-upload-list .ant-upload-animate-inline-enter{animation-name:uploadAnimateInlineIn}.ant-upload-list .ant-upload-animate-inline-leave{animation-name:uploadAnimateInlineOut}@keyframes uploadAnimateInlineIn{0%{width:0;height:0;margin:0;padding:0;opacity:0}}@keyframes uploadAnimateInlineOut{to{width:0;height:0;margin:0;padding:0;opacity:0}}.ant-upload-rtl{direction:rtl}.ant-upload-rtl.ant-upload.ant-upload-select-picture-card{margin-right:auto;margin-left:8px}.ant-upload-list-rtl{direction:rtl}.ant-upload-list-rtl .ant-upload-list-item-list-type-text:hover .ant-upload-list-item-name-icon-count-1{padding-right:22px;padding-left:14px}.ant-upload-list-rtl .ant-upload-list-item-list-type-text:hover .ant-upload-list-item-name-icon-count-2{padding-right:22px;padding-left:28px}.ant-upload-list-rtl .ant-upload-list-item-name{padding-right:22px;padding-left:0}.ant-upload-list-rtl .ant-upload-list-item-name-icon-count-1{padding-left:14px}.ant-upload-list-rtl .ant-upload-list-item-card-actions{right:auto;left:0}.ant-upload-list-rtl .ant-upload-list-item-card-actions .anticon{padding-right:0;padding-left:5px}.ant-upload-list-rtl .ant-upload-list-item-info{padding:0 4px 0 12px}.ant-upload-list-rtl .ant-upload-list-item .anticon-close{right:auto;left:4px}.ant-upload-list-rtl .ant-upload-list-item-error .ant-upload-list-item-card-actions .anticon{padding-right:0;padding-left:5px}.ant-upload-list-rtl .ant-upload-list-item-progress{padding-right:26px;padding-left:0}.ant-upload-list-picture-card .ant-upload-list-item-info,.ant-upload-list-picture .ant-upload-list-item-info{padding:0}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-thumbnail,.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-thumbnail{right:8px;left:auto}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-icon,.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-icon{right:50%;left:auto;transform:translate(50%,-50%)}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-name,.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-name{margin:0 8px 0 0;padding-right:48px;padding-left:8px}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-name-icon-count-1,.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-name-icon-count-1{padding-right:48px;padding-left:18px}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-name-icon-count-2,.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-name-icon-count-2{padding-right:48px;padding-left:36px}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-progress,.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-progress{padding-right:0;padding-left:0}.ant-upload-list-rtl.ant-upload-list-picture-card .anticon-close,.ant-upload-list-rtl.ant-upload-list-picture .anticon-close{right:auto;left:8px}.ant-upload-list-rtl .ant-upload-list-picture-card-container{margin:0 0 8px 8px}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-actions{right:50%;left:auto;transform:translate(50%,-50%)}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-file+.ant-upload-list-item-name{margin:8px 0 0;padding:0}@font-face{font-family:"FF Oxide Solid";src:url(//db.onlinewebfonts.com/t/bc30adee89b44a44a5cfdff676aef0fe.eot);src:url(//db.onlinewebfonts.com/t/bc30adee89b44a44a5cfdff676aef0fe.eot#iefix) format("embedded-opentype"),url(//db.onlinewebfonts.com/t/bc30adee89b44a44a5cfdff676aef0fe.woff2) format("woff2"),url(//db.onlinewebfonts.com/t/bc30adee89b44a44a5cfdff676aef0fe.woff) format("woff"),url(//db.onlinewebfonts.com/t/bc30adee89b44a44a5cfdff676aef0fe.ttf) format("truetype"),url(//db.onlinewebfonts.com/t/bc30adee89b44a44a5cfdff676aef0fe.svg#FF%20Oxide%20Solid) format("svg")}body{--row-highlight:hsla(0,0%,100%,0.08)}.app-logo{background-image:url("data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjMwMCIgd2lkdGg9IjMwMCIgZmlsbD0iI2Q4M2FlYiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZD0iTTQwLjM2IDUwLjkxYy4wMDctOC4xNzQgMy44MzYtMTEuNTI1IDcuMDQ4LTEyLjg5OCA2LjU1MS0yLjgwMSAxNi43OS4xNDEgMjMuODA5IDYuODQyYTk1LjExNCA5NS4xMTQgMCAwMTMuMzY1IDMuMzY4Yy01LjY4NC04LjM3Mi0xNS4wMjUtMTcuNTY2LTI5LjA2NC0xOC44NTktNy43OTQtLjcxNi0xMy43OTQgMi43OTktMTYuMDMzIDkuNDA4LTIuNjQ5IDcuODIxLjM0MSAxOS4zMDUgMTEuMTgxIDI2LjEyMiA2LjE1MyAzLjg2OSAxMi4zIDYuODY5IDE3LjM0MSA5LjA0NWE4NS42NzUgODUuNjc1IDAgMDEtMS42Ni0xLjA5MUM0NS43MzMgNjUuNjYyIDQwLjM1NCA1OC4yODEgNDAuMzYgNTAuOTF6Ii8+PHBhdGggZD0iTTYwLjAyNyA2My43NjFjLS4wNzgtNC43MTUgMS44OTgtOC4yNSA1LjQyMi05LjY5OCA0LjEzOS0xLjcgOS40OS0uMDA0IDEzLjYzMyA0LjMyM2EyOC45MjcgMjguOTI3IDAgMDExLjg3NSAyLjE4NGMtMS42NzQtMy42OTktNC41MS03Ljk1OC0xMS4xMjEtMTQuMjY5LTYuMzcxLTYuMDgxLTE1Ljg3OS04LjkxMi0yMS42NDItNi40NS0zLjgxMiAxLjYyOS01LjgyOSA1LjQ1NC01LjgzNCAxMS4wNjEtLjAxIDExLjgxNSAxNi4zMTIgMjEuNjQ2IDI1LjA3MiAyNi4wNzItMy42NTctMy4yMzgtNy4zMTctNy44MTYtNy40MDUtMTMuMjIzeiIvPjxwYXRoIGQ9Ik0yNy41OTEgMzguMTNjMi41NTYtNy41NDUgOS4zMzEtMTEuNTY4IDE4LjExMS0xMC43NTggMTEuNTI5IDEuMDYxIDIwLjAxNSA3LjE0OCAyNi4wMTMgMTMuOTJDNjEuNSAyNi4wNTQgNDguOTYzIDIwLjMzOSA0OC44MTcgMjAuMjc0YTIyLjY3NSAyMi42NzUgMCAwMC0xMC40NTctMi41MzFjLTEyLjc3NCAwLTIzLjE2NyAxMC41OC0yMy4xNjcgMjMuNTgzIDAgNy45NjEgNC4yMDEgMTUuNTIxIDExLjIzOCAyMC4yMjIgMy43ODkgMi41MyAxMS40ODggNS44MjQgMjAuMDQ2IDkuMDM4YTExOS4xMTQgMTE5LjExNCAwIDAxLTYuODc1LTRDMjcuODg1IDU5LjIxOSAyNC42OSA0Ni42OTQgMjcuNTkxIDM4LjEzek03Ny42MzcgNTkuNzY5Yy0zLjU2OC0zLjcyOS04LjA1Ny01LjI0Mi0xMS40MjgtMy44NTUtMi43MjEgMS4xMTgtNC4yNDYgMy45NjctNC4xODIgNy44MTQuMTQ4IDkuMDM1IDExLjMxMyAxNS4zMTggMTMuNTg4IDE2LjU5MiAzLjQ4OSAxLjk1NCA3LjYyNSAyLjA4NyA3LjkwNCAxLjkzOHMuMjc5LS4xNDkuNTMxLS42NTFjLjY2LTEuMzA5IDEuMDUzLTQuMjc1LjM2MS04Ljk2Ni0uNjM0LTMuMTUyLTIuMzE1LTguMjE0LTYuNzc0LTEyLjg3MnoiLz48L3N2Zz4=");height:32px;pointer-events:none;background-repeat:no-repeat;background-size:32px;width:32px}.app-title{font-family:"FF Oxide Solid";font-style:normal;font-weight:300;letter-spacing:0}.app-title h1{font-size:48px;margin:0}.app-title h2{margin:0}.app-title h2 span{display:inline-block;font-size:16px;margin-bottom:20px;background:linear-gradient(270deg,#00ffa3,#dc1fff 101.97%);-webkit-background-clip:text;-webkit-text-fill-color:transparent}.app-action{border-color:#00ffa3;color:#00ffa3;padding:20px 30px;line-height:2px}.action-spinner{position:absolute;right:5px}.ant-tabs-nav-scroll{display:flex;justify-content:center}.discord{font-size:30px;color:#7289da}.discord:hover{color:#8ea1e1}.telegram{color:#32afed;font-size:28px;background-color:#fff;border-radius:30px;display:flex;width:27px;height:27px}em{font-weight:700;font-style:normal;text-decoration:none}.telegram:hover{color:#2789de!important}.App-header{background-color:#282c34;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:calc(10px + 2vmin);color:#fff}.App-link{color:#61dafb}.social-buttons{margin:auto 1rem .5rem auto;grid-gap:.3rem;gap:.3rem;display:flex}.wallet-wrapper{padding-left:.7rem;white-space:nowrap}.wallet-key,.wallet-wrapper{border-radius:.5rem;display:flex;align-items:center}.wallet-key{padding:.1rem .5rem .1rem .7rem;margin-left:.3rem}.flash-positive{color:rgba(0,255,0,.6)}.flash-negative{color:rgba(255,0,0,.6)}.ant-table-cell{padding:6px 16px!important}.ant-table{margin:0 30px}.ant-menu-inline-collapsed>.ant-menu-item{padding-left:16px!important}.ant-pagination-options{display:none}.ant-notification a{color:#00f;text-decoration:underline;cursor:pointer}.ant-layout{background:transparent!important}.ant-layout-content{display:flex;overflow:auto}.flexColumn{display:flex;flex-direction:column;flex:1 1}.card-fill{height:100%}.card-row{margin:5px 0;width:100%;flex-direction:row;padding:0;align-items:center;justify-content:space-between}.card-row,.card-row .card-cell{box-sizing:border-box;min-width:0;display:flex}.card-row .card-cell{text-align:left;margin:0;font-size:14px}.card-row .card-cell,.card-row .left{flex-direction:column;align-items:flex-end}.card-row .left{display:flex}.card-row .small{font-size:11px}.ant-slider{margin:20px 15px 40px}.ant-layout-header{align-items:center;height:42px;padding:0 20px;color:hsla(0,0%,100%,.85);line-height:64px;display:flex}.ant-statistic{-webkit-user-select:none;-ms-user-select:none;user-select:none}.ant-statistic-content{font-weight:700}.ant-select-selection-item .token-balance{display:none}.token-input{display:flex;align-items:center;border:1px solid grey;padding:0 10px;margin:5px 0}.token-balance{margin-left:auto;margin-right:5px;color:hsla(0,0%,100%,.45)}[class=ant-layout-header]{height:16px!important}.dashboard-amount-quote{font-size:10px;font-style:normal;text-align:right}.home-statistic{font-family:"FF Oxide Solid";font-style:normal;font-weight:300;letter-spacing:0}.home-statistic .ant-statistic-title{display:inline-block;font-size:48px!important;background:linear-gradient(254.55deg,#00ffa3 10.02%,#dc1fff 89.22%);-webkit-background-clip:text;-webkit-text-fill-color:transparent}.home-statistic .ant-statistic-content{font-size:20px!important}.links{position:relative;height:100%}.links .bottom-links{position:absolute;bottom:0}.ant-pro-sider,.ant-pro-sider .ant-menu{background:transparent!important}.dashboard-amount-quote-stat{font-size:10px;font-style:normal;text-align:center;font-weight:400}.bridge-card{border-radius:20px;box-shadow:0 0 10px 0 rgba(0,0,0,.1);width:450px;margin:40px auto 4px;padding:0}.bridge-card .ant-tabs-tab{width:50%;margin:0;justify-content:center;border-radius:20px 20px 0 0}.bridge-card .ant-tabs-tab-active{background-color:hsla(0,0%,100%,.04)}.bridge-card .ant-tabs-nav-list{width:100%!important}@media only screen and (max-width:600px){.bridge-card{width:360px}}.identicon-wrapper{display:flex;height:1rem;width:1rem;border-radius:1.125rem;margin:.2rem .2rem .2rem .1rem}.App-Bar{justify-content:space-between;align-items:center;flex-direction:row;width:100%;top:0;position:relative;padding:1rem;z-index:2}.App-Bar .ant-menu-horizontal{border-bottom-color:transparent;background-color:transparent;line-height:inherit;font-size:16px;margin:0 10px}.App-Bar .ant-menu-horizontal .ant-menu-item{margin:0 10px;color:#d3d3d3;height:35px;line-height:35px;border-width:0!important}.App-Bar .ant-menu-horizontal .ant-menu-item:hover{color:#fff;border-width:0!important}.App-Bar .ant-menu-horizontal .ant-menu-item-selected{font-weight:700}.App-Bar-left{box-sizing:border-box;margin:0;min-width:0;padding:0;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.App-Bar-left,.App-Bar-right{display:flex;align-items:center}.App-Bar-right{flex-direction:row;justify-self:flex-end}.success-icon{background-image:url("data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjMwMCIgd2lkdGg9IjMwMCIgZmlsbD0iIzcwYzA0MSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBkYXRhLW5hbWU9IkxheWVyIDEiIHZpZXdCb3g9IjAgMCA2NCA2NCI+PHBhdGggZD0iTTUgMTRhMSAxIDAgMTAtMS0xIDEgMSAwIDAwMSAxek03IDUyaDQ4YTEgMSAwIDAwMC0yaC01VjI3YTEgMSAwIDAwLTIgMHYyM2gtNFYzNGExIDEgMCAwMC0yIDB2MTZoLTRWMzlhMSAxIDAgMDAtMiAwdjExaC00di03YTEgMSAwIDAwLTIgMHY3aC00di00YTEgMSAwIDAwLTIgMHY0aC00di0zYTEgMSAwIDAwLTIgMHYzaC00di0yYTEgMSAwIDAwLTIgMHYySDdhMSAxIDAgMDEtMS0xVjE3YTEgMSAwIDAwLTIgMHYzMmEzIDMgMCAwMDMgM3pNNTkgNTBhMSAxIDAgMDAtMSAxIDEgMSAwIDEwMS0xeiIvPjxwYXRoIGQ9Ik0xMSA0NGguMDdhNDkuMDcgNDkuMDcgMCAwMDI1LjUyLTkuMTlBNDguOTEgNDguOTEgMCAwMDQ5LjcgMjAuNTlMNTIuMzggMjIgNTIgMTRsLTYuNzEgNC4zMSAyLjYzIDEuMzZhNDYuODEgNDYuODEgMCAwMS0xMi41MSAxMy41MkE0Ni45NCA0Ni45NCAwIDAxMTAuOTMgNDJhMSAxIDAgMDAuMDcgMnoiLz48L3N2Zz4=");width:280px;height:280px}.metamask-icon{background-position:50%;background-repeat:no-repeat;background-image:url(/assets/metamask.svg)}.wormhole-overlay{position:absolute;width:100%;height:100%;top:0;left:0}.home-item{display:flex;justify-content:space-between;align-items:center;color:hsla(0,0%,100%,.85);border-bottom:1px solid #303030}.home-item>:nth-child(n){flex:20% 1;text-align:right;margin:10px 0}.home-item>:first-child{flex:80px 1}.home-header>div{flex:20% 1;text-align:right}.home-header>:first-child{text-align:left;flex:80px 1}.home-info-row{margin-bottom:10px;min-height:45vh}.ccy-input{margin-top:10px;margin-bottom:10px}.ccy-input .ant-select-selector,.ccy-input .ant-select-selector:active,.ccy-input .ant-select-selector:focus{border-color:transparent!important;box-shadow:none!important}.ccy-input .ant-select-selection-item{display:flex}.ccy-input .ant-select-selection-item .token-balance{display:none}.token-balance{color:grey}.ccy-input-header{display:grid;grid-template-columns:repeat(2,1fr);grid-column-gap:10px;justify-content:space-between;align-items:center;flex-direction:row;padding:10px 20px 0}.ccy-input-header-left{width:100%;box-sizing:border-box;margin:0;min-width:0;display:flex;padding:0;align-items:center;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.ccy-input-header-right{width:100%;display:flex;flex-direction:row;align-items:center;justify-self:flex-end;justify-content:flex-end}.ant-select-dropdown{width:150px!important}.input-card{display:flex;flex-direction:column;align-items:center;margin-bottom:10px}.swap-button{border-radius:2em;width:32px;padding-left:8px}.token-chain-logo{position:relative}.token-logo{border:1px solid hsla(0,0%,50.2%,.5);border-radius:50px;background:#fff;width:50px;height:50px}.chain-logo{order:1px solid hsla(0,0%,50.2%,.5);border-radius:20px;position:absolute;background:#fff;width:30px;height:30px;bottom:9px;right:-5px} \ No newline at end of file + /*! autoprefixer: ignore next */-webkit-box-orient:vertical}.ant-typography-rtl{direction:rtl}.ant-typography-rtl .ant-typography-copy,.ant-typography-rtl .ant-typography-edit,.ant-typography-rtl .ant-typography-expand{margin-right:4px;margin-left:0}.ant-typography-rtl .ant-typography-expand{float:left}div.ant-typography-edit-content.ant-typography-rtl{right:-12px;left:auto}.ant-typography-rtl .ant-typography-edit-content-confirm{right:auto;left:10px}.ant-typography-rtl.ant-typography ol li,.ant-typography-rtl.ant-typography ul li{margin:0 20px 0 0;padding:0 4px 0 0}.ant-upload{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum","tnum";outline:0}.ant-upload p{margin:0}.ant-upload-btn{display:block;width:100%;outline:none}.ant-upload input[type=file]{cursor:pointer}.ant-upload.ant-upload-select{display:inline-block}.ant-upload.ant-upload-disabled{cursor:not-allowed}.ant-upload.ant-upload-select-picture-card{width:104px;height:104px;margin-right:8px;margin-bottom:8px;text-align:center;vertical-align:top;background-color:hsla(0,0%,100%,.04);border:1px dashed #434343;border-radius:2px;cursor:pointer;transition:border-color .3s}.ant-upload.ant-upload-select-picture-card>.ant-upload{display:flex;align-items:center;justify-content:center;height:100%;text-align:center}.ant-upload.ant-upload-select-picture-card:hover{border-color:#2abdd2}.ant-upload-disabled.ant-upload.ant-upload-select-picture-card:hover{border-color:#434343}.ant-upload.ant-upload-drag{position:relative;width:100%;height:100%;text-align:center;background:hsla(0,0%,100%,.04);border:1px dashed #434343;border-radius:2px;cursor:pointer;transition:border-color .3s}.ant-upload.ant-upload-drag .ant-upload{padding:16px 0}.ant-upload.ant-upload-drag.ant-upload-drag-hover:not(.ant-upload-disabled){border-color:#4abdca}.ant-upload.ant-upload-drag.ant-upload-disabled{cursor:not-allowed}.ant-upload.ant-upload-drag .ant-upload-btn{display:table;height:100%}.ant-upload.ant-upload-drag .ant-upload-drag-container{display:table-cell;vertical-align:middle}.ant-upload.ant-upload-drag:not(.ant-upload-disabled):hover{border-color:#228290}.ant-upload.ant-upload-drag p.ant-upload-drag-icon{margin-bottom:20px}.ant-upload.ant-upload-drag p.ant-upload-drag-icon .anticon{color:#228290;font-size:48px}.ant-upload.ant-upload-drag p.ant-upload-text{margin:0 0 4px;color:hsla(0,0%,100%,.85);font-size:16px}.ant-upload.ant-upload-drag p.ant-upload-hint{color:hsla(0,0%,100%,.45);font-size:14px}.ant-upload.ant-upload-drag .anticon-plus{color:hsla(0,0%,100%,.3);font-size:30px;transition:all .3s}.ant-upload.ant-upload-drag .anticon-plus:hover,.ant-upload.ant-upload-drag:hover .anticon-plus{color:hsla(0,0%,100%,.45)}.ant-upload-picture-card-wrapper{display:inline-block;width:100%}.ant-upload-picture-card-wrapper:before{display:table;content:""}.ant-upload-picture-card-wrapper:after{display:table;clear:both;content:""}.ant-upload-list{box-sizing:border-box;margin:0;padding:0;color:hsla(0,0%,100%,.85);font-size:14px;font-variant:tabular-nums;list-style:none;font-feature-settings:"tnum","tnum";line-height:1.5715}.ant-upload-list:after,.ant-upload-list:before{display:table;content:""}.ant-upload-list:after{clear:both}.ant-upload-list-item{position:relative;height:22.001px;margin-top:8px;font-size:14px}.ant-upload-list-item-name{display:inline-block;width:100%;padding-left:22px;overflow:hidden;line-height:1.5715;white-space:nowrap;text-overflow:ellipsis}.ant-upload-list-item-card-actions{position:absolute;right:0}.ant-upload-list-item-card-actions-btn{opacity:0}.ant-upload-list-item-card-actions-btn.ant-btn-sm{height:20px;line-height:1}.ant-upload-list-item-card-actions.picture{top:22px;line-height:0}.ant-upload-list-item-card-actions-btn:focus,.ant-upload-list-item-card-actions.picture .ant-upload-list-item-card-actions-btn{opacity:1}.ant-upload-list-item-card-actions .anticon{color:hsla(0,0%,100%,.45)}.ant-upload-list-item-info{height:100%;padding:0 4px;transition:background-color .3s}.ant-upload-list-item-info>span{display:block;width:100%;height:100%}.ant-upload-list-item-info .ant-upload-text-icon .anticon,.ant-upload-list-item-info .anticon-loading .anticon{position:absolute;top:5px;color:hsla(0,0%,100%,.45);font-size:14px}.ant-upload-list-item .anticon-close{position:absolute;top:6px;right:4px;color:hsla(0,0%,100%,.45);font-size:10px;line-height:0;cursor:pointer;opacity:0;transition:all .3s}.ant-upload-list-item .anticon-close:hover{color:hsla(0,0%,100%,.85)}.ant-upload-list-item:hover .ant-upload-list-item-info{background-color:hsla(0,0%,100%,.08)}.ant-upload-list-item:hover .ant-upload-list-item-card-actions-btn,.ant-upload-list-item:hover .anticon-close{opacity:1}.ant-upload-list-item-error,.ant-upload-list-item-error .ant-upload-list-item-card-actions .anticon,.ant-upload-list-item-error .ant-upload-list-item-name,.ant-upload-list-item-error .ant-upload-text-icon>.anticon{color:#a61d24}.ant-upload-list-item-error .ant-upload-list-item-card-actions-btn{opacity:1}.ant-upload-list-item-progress{position:absolute;bottom:-12px;width:100%;padding-left:26px;font-size:14px;line-height:0}.ant-upload-list-picture-card .ant-upload-list-item,.ant-upload-list-picture .ant-upload-list-item{position:relative;height:66px;padding:8px;border:1px solid #434343;border-radius:2px}.ant-upload-list-picture-card .ant-upload-list-item:hover,.ant-upload-list-picture .ant-upload-list-item:hover{background:transparent}.ant-upload-list-picture-card .ant-upload-list-item-error,.ant-upload-list-picture .ant-upload-list-item-error{border-color:#a61d24}.ant-upload-list-picture-card .ant-upload-list-item:hover .ant-upload-list-item-info,.ant-upload-list-picture .ant-upload-list-item:hover .ant-upload-list-item-info{background:transparent}.ant-upload-list-picture-card .ant-upload-list-item-uploading,.ant-upload-list-picture .ant-upload-list-item-uploading{border-style:dashed}.ant-upload-list-picture-card .ant-upload-list-item-thumbnail,.ant-upload-list-picture .ant-upload-list-item-thumbnail{width:48px;height:48px;line-height:54px;text-align:center;opacity:.8}.ant-upload-list-picture-card .ant-upload-list-item-thumbnail .anticon,.ant-upload-list-picture .ant-upload-list-item-thumbnail .anticon{font-size:26px}.ant-upload-list-picture-card .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#e6f7ff"],.ant-upload-list-picture .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#e6f7ff"]{fill:#e6d9d8}.ant-upload-list-picture-card .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#1890ff"],.ant-upload-list-picture .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#1890ff"]{fill:#a61d24}.ant-upload-list-picture-card .ant-upload-list-item-icon,.ant-upload-list-picture .ant-upload-list-item-icon{position:absolute;top:50%;left:50%;font-size:26px;transform:translate(-50%,-50%)}.ant-upload-list-picture-card .ant-upload-list-item-icon .anticon,.ant-upload-list-picture .ant-upload-list-item-icon .anticon{font-size:26px}.ant-upload-list-picture-card .ant-upload-list-item-image,.ant-upload-list-picture .ant-upload-list-item-image{max-width:100%}.ant-upload-list-picture-card .ant-upload-list-item-thumbnail img,.ant-upload-list-picture .ant-upload-list-item-thumbnail img{display:block;width:48px;height:48px;overflow:hidden}.ant-upload-list-picture-card .ant-upload-list-item-name,.ant-upload-list-picture .ant-upload-list-item-name{display:inline-block;box-sizing:border-box;max-width:100%;margin:0 0 0 8px;padding-right:8px;padding-left:48px;overflow:hidden;line-height:44px;white-space:nowrap;text-overflow:ellipsis;transition:all .3s}.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-name,.ant-upload-list-picture .ant-upload-list-item-uploading .ant-upload-list-item-name{line-height:28px}.ant-upload-list-picture-card .ant-upload-list-item-progress,.ant-upload-list-picture .ant-upload-list-item-progress{bottom:14px;width:calc(100% - 24px);margin-top:0;padding-left:56px}.ant-upload-list-picture-card .anticon-close,.ant-upload-list-picture .anticon-close{position:absolute;top:8px;right:8px;line-height:1;opacity:1}.ant-upload-list-picture-card-container{display:inline-block;width:104px;height:104px;margin:0 8px 8px 0;vertical-align:top}.ant-upload-list-picture-card.ant-upload-list:after{display:none}.ant-upload-list-picture-card .ant-upload-list-item{height:100%;margin:0}.ant-upload-list-picture-card .ant-upload-list-item-info{position:relative;height:100%;overflow:hidden}.ant-upload-list-picture-card .ant-upload-list-item-info:before{position:absolute;z-index:1;width:100%;height:100%;background-color:rgba(0,0,0,.5);opacity:0;transition:all .3s;content:" "}.ant-upload-list-picture-card .ant-upload-list-item:hover .ant-upload-list-item-info:before{opacity:1}.ant-upload-list-picture-card .ant-upload-list-item-actions{position:absolute;top:50%;left:50%;z-index:10;white-space:nowrap;transform:translate(-50%,-50%);opacity:0;transition:all .3s}.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-delete,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-download,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-eye{z-index:10;width:16px;margin:0 4px;color:hsla(0,0%,100%,.85);font-size:16px;cursor:pointer;transition:all .3s}.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-delete:hover,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-download:hover,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-eye:hover{color:#fff}.ant-upload-list-picture-card .ant-upload-list-item-actions:hover,.ant-upload-list-picture-card .ant-upload-list-item-info:hover+.ant-upload-list-item-actions{opacity:1}.ant-upload-list-picture-card .ant-upload-list-item-thumbnail,.ant-upload-list-picture-card .ant-upload-list-item-thumbnail img{position:static;display:block;width:100%;height:100%;object-fit:contain}.ant-upload-list-picture-card .ant-upload-list-item-name{display:none;margin:8px 0 0;padding:0;line-height:1.5715;text-align:center}.ant-upload-list-picture-card .ant-upload-list-item-file+.ant-upload-list-item-name{position:absolute;bottom:10px;display:block}.ant-upload-list-picture-card .ant-upload-list-item-uploading.ant-upload-list-item{background-color:hsla(0,0%,100%,.04)}.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info{height:auto}.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info .anticon-delete,.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info .anticon-eye,.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info:before{display:none}.ant-upload-list-picture-card .ant-upload-list-item-progress{bottom:32px;width:calc(100% - 14px);padding-left:0}.ant-upload-list-picture-container,.ant-upload-list-text-container{transition:opacity .3s,height .3s}.ant-upload-list-picture-container:before,.ant-upload-list-text-container:before{display:table;width:0;height:0;content:""}.ant-upload-list-picture-container .ant-upload-span,.ant-upload-list-text-container .ant-upload-span{display:block;flex:auto}.ant-upload-list-picture .ant-upload-span,.ant-upload-list-text .ant-upload-span{display:flex;align-items:center}.ant-upload-list-picture .ant-upload-span>*,.ant-upload-list-text .ant-upload-span>*{flex:none}.ant-upload-list-picture .ant-upload-list-item-name,.ant-upload-list-text .ant-upload-list-item-name{flex:auto;padding:0 8px}.ant-upload-list-picture .ant-upload-list-item-card-actions,.ant-upload-list-text .ant-upload-list-item-card-actions,.ant-upload-list-text .ant-upload-text-icon .anticon{position:static}.ant-upload-list .ant-upload-animate-inline-appear,.ant-upload-list .ant-upload-animate-inline-enter,.ant-upload-list .ant-upload-animate-inline-leave{animation-duration:.3s;animation-fill-mode:cubic-bezier(.78,.14,.15,.86)}.ant-upload-list .ant-upload-animate-inline-appear,.ant-upload-list .ant-upload-animate-inline-enter{animation-name:uploadAnimateInlineIn}.ant-upload-list .ant-upload-animate-inline-leave{animation-name:uploadAnimateInlineOut}@keyframes uploadAnimateInlineIn{0%{width:0;height:0;margin:0;padding:0;opacity:0}}@keyframes uploadAnimateInlineOut{to{width:0;height:0;margin:0;padding:0;opacity:0}}.ant-upload-rtl{direction:rtl}.ant-upload-rtl.ant-upload.ant-upload-select-picture-card{margin-right:auto;margin-left:8px}.ant-upload-list-rtl{direction:rtl}.ant-upload-list-rtl .ant-upload-list-item-list-type-text:hover .ant-upload-list-item-name-icon-count-1{padding-right:22px;padding-left:14px}.ant-upload-list-rtl .ant-upload-list-item-list-type-text:hover .ant-upload-list-item-name-icon-count-2{padding-right:22px;padding-left:28px}.ant-upload-list-rtl .ant-upload-list-item-name{padding-right:22px;padding-left:0}.ant-upload-list-rtl .ant-upload-list-item-name-icon-count-1{padding-left:14px}.ant-upload-list-rtl .ant-upload-list-item-card-actions{right:auto;left:0}.ant-upload-list-rtl .ant-upload-list-item-card-actions .anticon{padding-right:0;padding-left:5px}.ant-upload-list-rtl .ant-upload-list-item-info{padding:0 4px 0 12px}.ant-upload-list-rtl .ant-upload-list-item .anticon-close{right:auto;left:4px}.ant-upload-list-rtl .ant-upload-list-item-error .ant-upload-list-item-card-actions .anticon{padding-right:0;padding-left:5px}.ant-upload-list-rtl .ant-upload-list-item-progress{padding-right:26px;padding-left:0}.ant-upload-list-picture-card .ant-upload-list-item-info,.ant-upload-list-picture .ant-upload-list-item-info{padding:0}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-thumbnail,.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-thumbnail{right:8px;left:auto}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-icon,.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-icon{right:50%;left:auto;transform:translate(50%,-50%)}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-name,.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-name{margin:0 8px 0 0;padding-right:48px;padding-left:8px}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-name-icon-count-1,.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-name-icon-count-1{padding-right:48px;padding-left:18px}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-name-icon-count-2,.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-name-icon-count-2{padding-right:48px;padding-left:36px}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-progress,.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-progress{padding-right:0;padding-left:0}.ant-upload-list-rtl.ant-upload-list-picture-card .anticon-close,.ant-upload-list-rtl.ant-upload-list-picture .anticon-close{right:auto;left:8px}.ant-upload-list-rtl .ant-upload-list-picture-card-container{margin:0 0 8px 8px}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-actions{right:50%;left:auto;transform:translate(50%,-50%)}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-file+.ant-upload-list-item-name{margin:8px 0 0;padding:0}@font-face{font-family:"FF Oxide Solid";src:url(//db.onlinewebfonts.com/t/bc30adee89b44a44a5cfdff676aef0fe.eot);src:url(//db.onlinewebfonts.com/t/bc30adee89b44a44a5cfdff676aef0fe.eot#iefix) format("embedded-opentype"),url(//db.onlinewebfonts.com/t/bc30adee89b44a44a5cfdff676aef0fe.woff2) format("woff2"),url(//db.onlinewebfonts.com/t/bc30adee89b44a44a5cfdff676aef0fe.woff) format("woff"),url(//db.onlinewebfonts.com/t/bc30adee89b44a44a5cfdff676aef0fe.ttf) format("truetype"),url(//db.onlinewebfonts.com/t/bc30adee89b44a44a5cfdff676aef0fe.svg#FF%20Oxide%20Solid) format("svg")}body{--row-highlight:hsla(0,0%,100%,0.08)}.app-logo{background-image:url("data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjMwMCIgd2lkdGg9IjMwMCIgZmlsbD0iI2Q4M2FlYiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZD0iTTQwLjM2IDUwLjkxYy4wMDctOC4xNzQgMy44MzYtMTEuNTI1IDcuMDQ4LTEyLjg5OCA2LjU1MS0yLjgwMSAxNi43OS4xNDEgMjMuODA5IDYuODQyYTk1LjExNCA5NS4xMTQgMCAwMTMuMzY1IDMuMzY4Yy01LjY4NC04LjM3Mi0xNS4wMjUtMTcuNTY2LTI5LjA2NC0xOC44NTktNy43OTQtLjcxNi0xMy43OTQgMi43OTktMTYuMDMzIDkuNDA4LTIuNjQ5IDcuODIxLjM0MSAxOS4zMDUgMTEuMTgxIDI2LjEyMiA2LjE1MyAzLjg2OSAxMi4zIDYuODY5IDE3LjM0MSA5LjA0NWE4NS42NzUgODUuNjc1IDAgMDEtMS42Ni0xLjA5MUM0NS43MzMgNjUuNjYyIDQwLjM1NCA1OC4yODEgNDAuMzYgNTAuOTF6Ii8+PHBhdGggZD0iTTYwLjAyNyA2My43NjFjLS4wNzgtNC43MTUgMS44OTgtOC4yNSA1LjQyMi05LjY5OCA0LjEzOS0xLjcgOS40OS0uMDA0IDEzLjYzMyA0LjMyM2EyOC45MjcgMjguOTI3IDAgMDExLjg3NSAyLjE4NGMtMS42NzQtMy42OTktNC41MS03Ljk1OC0xMS4xMjEtMTQuMjY5LTYuMzcxLTYuMDgxLTE1Ljg3OS04LjkxMi0yMS42NDItNi40NS0zLjgxMiAxLjYyOS01LjgyOSA1LjQ1NC01LjgzNCAxMS4wNjEtLjAxIDExLjgxNSAxNi4zMTIgMjEuNjQ2IDI1LjA3MiAyNi4wNzItMy42NTctMy4yMzgtNy4zMTctNy44MTYtNy40MDUtMTMuMjIzeiIvPjxwYXRoIGQ9Ik0yNy41OTEgMzguMTNjMi41NTYtNy41NDUgOS4zMzEtMTEuNTY4IDE4LjExMS0xMC43NTggMTEuNTI5IDEuMDYxIDIwLjAxNSA3LjE0OCAyNi4wMTMgMTMuOTJDNjEuNSAyNi4wNTQgNDguOTYzIDIwLjMzOSA0OC44MTcgMjAuMjc0YTIyLjY3NSAyMi42NzUgMCAwMC0xMC40NTctMi41MzFjLTEyLjc3NCAwLTIzLjE2NyAxMC41OC0yMy4xNjcgMjMuNTgzIDAgNy45NjEgNC4yMDEgMTUuNTIxIDExLjIzOCAyMC4yMjIgMy43ODkgMi41MyAxMS40ODggNS44MjQgMjAuMDQ2IDkuMDM4YTExOS4xMTQgMTE5LjExNCAwIDAxLTYuODc1LTRDMjcuODg1IDU5LjIxOSAyNC42OSA0Ni42OTQgMjcuNTkxIDM4LjEzek03Ny42MzcgNTkuNzY5Yy0zLjU2OC0zLjcyOS04LjA1Ny01LjI0Mi0xMS40MjgtMy44NTUtMi43MjEgMS4xMTgtNC4yNDYgMy45NjctNC4xODIgNy44MTQuMTQ4IDkuMDM1IDExLjMxMyAxNS4zMTggMTMuNTg4IDE2LjU5MiAzLjQ4OSAxLjk1NCA3LjYyNSAyLjA4NyA3LjkwNCAxLjkzOHMuMjc5LS4xNDkuNTMxLS42NTFjLjY2LTEuMzA5IDEuMDUzLTQuMjc1LjM2MS04Ljk2Ni0uNjM0LTMuMTUyLTIuMzE1LTguMjE0LTYuNzc0LTEyLjg3MnoiLz48L3N2Zz4=");height:32px;pointer-events:none;background-repeat:no-repeat;background-size:32px;width:32px}.app-title{font-family:"FF Oxide Solid";font-style:normal;font-weight:300;letter-spacing:0}.app-title h1{font-size:48px;margin:0}.app-title h2{margin:0}.app-title h2 span{display:inline-block;font-size:16px;margin-bottom:20px;background:linear-gradient(270deg,#00ffa3,#dc1fff 101.97%);-webkit-background-clip:text;-webkit-text-fill-color:transparent}.app-action{border-color:#00ffa3;color:#00ffa3;padding:20px 30px;line-height:2px}.action-spinner{position:absolute;right:5px}.ant-tabs-nav-scroll{display:flex;justify-content:center}.discord{font-size:30px;color:#7289da}.discord:hover{color:#8ea1e1}.telegram{color:#32afed;font-size:28px;background-color:#fff;border-radius:30px;display:flex;width:27px;height:27px}em{font-weight:700;font-style:normal;text-decoration:none}.telegram:hover{color:#2789de!important}.App-header{background-color:#282c34;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:calc(10px + 2vmin);color:#fff}.App-link{color:#61dafb}.social-buttons{margin:auto 1rem .5rem auto;grid-gap:.3rem;gap:.3rem;display:flex}.wallet-wrapper{padding-left:.7rem;white-space:nowrap}.wallet-key,.wallet-wrapper{border-radius:.5rem;display:flex;align-items:center}.wallet-key{padding:.1rem .5rem .1rem .7rem;margin-left:.3rem}.flash-positive{color:rgba(0,255,0,.6)}.flash-negative{color:rgba(255,0,0,.6)}.ant-table-cell{padding:6px 16px!important}.ant-table{margin:0 30px}.ant-menu-inline-collapsed>.ant-menu-item{padding-left:16px!important}.ant-pagination-options{display:none}.ant-notification a{color:#00f;text-decoration:underline;cursor:pointer}.ant-layout{background:transparent!important}.ant-layout-content{display:flex;overflow:auto}.flexColumn{display:flex;flex-direction:column;flex:1 1}.card-fill{height:100%}.card-row{margin:5px 0;width:100%;flex-direction:row;padding:0;align-items:center;justify-content:space-between}.card-row,.card-row .card-cell{box-sizing:border-box;min-width:0;display:flex}.card-row .card-cell{text-align:left;margin:0;font-size:14px}.card-row .card-cell,.card-row .left{flex-direction:column;align-items:flex-end}.card-row .left{display:flex}.card-row .small{font-size:11px}.ant-slider{margin:20px 15px 40px}.ant-layout-header{align-items:center;height:42px;padding:0 20px;color:hsla(0,0%,100%,.85);line-height:64px;display:flex}.ant-statistic{-webkit-user-select:none;-ms-user-select:none;user-select:none}.ant-statistic-content{font-weight:700}.ant-select-selection-item .token-balance{display:none}.token-input{display:flex;align-items:center;border:1px solid grey;padding:0 10px;margin:5px 0}.token-balance{margin-left:auto;margin-right:5px;color:hsla(0,0%,100%,.45)}[class=ant-layout-header]{height:16px!important}.dashboard-amount-quote{font-size:10px;font-style:normal;text-align:right}.home-statistic{font-family:"FF Oxide Solid";font-style:normal;font-weight:300;letter-spacing:0}.home-statistic .ant-statistic-title{display:inline-block;font-size:48px!important;background:linear-gradient(254.55deg,#00ffa3 10.02%,#dc1fff 89.22%);-webkit-background-clip:text;-webkit-text-fill-color:transparent}.home-statistic .ant-statistic-content{font-size:20px!important}.links{position:relative;height:100%}.links .bottom-links{position:absolute;bottom:0}.ant-pro-sider,.ant-pro-sider .ant-menu{background:transparent!important}.dashboard-amount-quote-stat{font-size:10px;font-style:normal;text-align:center;font-weight:400}.bridge-card{border-radius:20px;box-shadow:0 0 10px 0 rgba(0,0,0,.1);width:450px;margin:40px auto 4px;padding:0}.bridge-card .ant-tabs-tab{width:50%;margin:0;justify-content:center;border-radius:20px 20px 0 0}.bridge-card .ant-tabs-tab-active{background-color:hsla(0,0%,100%,.04)}.bridge-card .ant-tabs-nav-list{width:100%!important}@media only screen and (max-width:600px){.bridge-card{width:360px}}.identicon-wrapper{display:flex;height:1rem;width:1rem;border-radius:1.125rem;margin:.2rem .2rem .2rem .1rem}.App-Bar{justify-content:space-between;align-items:center;flex-direction:row;width:100%;top:0;position:relative;padding:1rem;z-index:2}.App-Bar .ant-menu-horizontal{border-bottom-color:transparent;background-color:transparent;line-height:inherit;font-size:16px;margin:0 10px}.App-Bar .ant-menu-horizontal .ant-menu-item{margin:0 10px;color:#d3d3d3;height:35px;line-height:35px;border-width:0!important}.App-Bar .ant-menu-horizontal .ant-menu-item:hover{color:#fff;border-width:0!important}.App-Bar .ant-menu-horizontal .ant-menu-item-selected{font-weight:700}.App-Bar-left{box-sizing:border-box;margin:0;min-width:0;padding:0;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.App-Bar-left,.App-Bar-right{display:flex;align-items:center}.App-Bar-right{flex-direction:row;justify-self:flex-end}.success-icon{background-image:url("data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjMwMCIgd2lkdGg9IjMwMCIgZmlsbD0iIzcwYzA0MSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBkYXRhLW5hbWU9IkxheWVyIDEiIHZpZXdCb3g9IjAgMCA2NCA2NCI+PHBhdGggZD0iTTUgMTRhMSAxIDAgMTAtMS0xIDEgMSAwIDAwMSAxek03IDUyaDQ4YTEgMSAwIDAwMC0yaC01VjI3YTEgMSAwIDAwLTIgMHYyM2gtNFYzNGExIDEgMCAwMC0yIDB2MTZoLTRWMzlhMSAxIDAgMDAtMiAwdjExaC00di03YTEgMSAwIDAwLTIgMHY3aC00di00YTEgMSAwIDAwLTIgMHY0aC00di0zYTEgMSAwIDAwLTIgMHYzaC00di0yYTEgMSAwIDAwLTIgMHYySDdhMSAxIDAgMDEtMS0xVjE3YTEgMSAwIDAwLTIgMHYzMmEzIDMgMCAwMDMgM3pNNTkgNTBhMSAxIDAgMDAtMSAxIDEgMSAwIDEwMS0xeiIvPjxwYXRoIGQ9Ik0xMSA0NGguMDdhNDkuMDcgNDkuMDcgMCAwMDI1LjUyLTkuMTlBNDguOTEgNDguOTEgMCAwMDQ5LjcgMjAuNTlMNTIuMzggMjIgNTIgMTRsLTYuNzEgNC4zMSAyLjYzIDEuMzZhNDYuODEgNDYuODEgMCAwMS0xMi41MSAxMy41MkE0Ni45NCA0Ni45NCAwIDAxMTAuOTMgNDJhMSAxIDAgMDAuMDcgMnoiLz48L3N2Zz4=");width:280px;height:280px}.metamask-icon{background-position:50%;background-repeat:no-repeat;background-image:url(/assets/metamask.svg)}.wormhole-overlay{position:absolute;width:100%;height:100%;top:0;left:0}.home-item{display:flex;justify-content:space-between;align-items:center;color:hsla(0,0%,100%,.85);border-bottom:1px solid #303030}.home-item>:nth-child(n){flex:20% 1;text-align:right;margin:10px 0}.home-item>:first-child{flex:80px 1}.home-header>div{flex:20% 1;text-align:right}.home-header>:first-child{text-align:left;flex:80px 1}.home-info-row{margin-bottom:10px;min-height:45vh}.token-chain-logo{position:relative;width:60px;height:60px;display:flex}.token-logo{border:1px solid hsla(0,0%,50.2%,.5);border-radius:50px;background:#fff;width:50px;height:50px}.chain-logo{border:1px solid hsla(0,0%,50.2%,.5);border-radius:20px;position:absolute;background:#fff;width:30px;height:30px;bottom:3px;right:3px}.multichain-option,.multichain-option-content{display:flex;align-items:center}.multichain-option-name{display:flex;flex-direction:row}.ccy-input{margin-top:10px;margin-bottom:10px}.ccy-input .ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector{height:70px}.ccy-input .ant-select-selector,.ccy-input .ant-select-selector:active,.ccy-input .ant-select-selector:focus{border-color:transparent!important;box-shadow:none!important;align-items:center}.ccy-input .ant-select-selection-item{display:flex;height:60px}.ccy-input .ant-select-selection-item .token-balance,.ccy-input .ant-select-selection-item .token-name{display:none}.from-input .token-chain-logo{position:absolute;right:20px}.to-input .token-chain-logo{position:absolute;right:40px}.token-balance{color:grey}.ccy-input-header{display:grid;grid-template-columns:repeat(2,1fr);grid-column-gap:10px;justify-content:space-between;align-items:center;flex-direction:row;padding:10px 20px 0}.ccy-input-header-left{width:100%;box-sizing:border-box;margin:0;min-width:0;display:flex;padding:0;align-items:center;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.ccy-input-header-right{width:100%;display:flex;flex-direction:row;align-items:center;justify-self:flex-end;justify-content:flex-end}.ant-select-dropdown{width:150px!important}.input-card{display:flex;flex-direction:column;align-items:center;margin-bottom:10px}.swap-button{border-radius:2em;width:32px;padding-left:8px} \ No newline at end of file diff --git a/static/js/0.1cba575d.chunk.js b/bridge/static/js/0.777debaa.chunk.js similarity index 93% rename from static/js/0.1cba575d.chunk.js rename to bridge/static/js/0.777debaa.chunk.js index 8718505..07e2a06 100644 --- a/static/js/0.1cba575d.chunk.js +++ b/bridge/static/js/0.777debaa.chunk.js @@ -1 +1 @@ -(this.webpackJsonpbridge=this.webpackJsonpbridge||[]).push([[0],{723:function(t,e,r){var i=r(370).Buffer,n=r(372).Transform,o=r(371).StringDecoder;function a(t){n.call(this),this.hashMode="string"===typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(98)(a,n),a.prototype.update=function(t,e,r){"string"===typeof t&&(t=i.from(t,e));var n=this._update(t);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(t,e,r){var i;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(n){i=n}finally{r(i)}},a.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(r){e=r}t(e)},a.prototype._finalOrDigest=function(t){var e=this.__final()||i.alloc(0);return t&&(e=this._toString(e,t,!0)),e},a.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var i=this._decoder.write(t);return r&&(i+=this._decoder.end()),i},t.exports=a},724:function(t,e,r){"use strict";e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=r(725),e.createHash=e.Hash=r(726),e.createHmac=e.Hmac=r(769);var i=r(816),n=Object.keys(i),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(n);e.getHashes=function(){return o};var a=r(772);e.pbkdf2=a.pbkdf2,e.pbkdf2Sync=a.pbkdf2Sync;var s=r(818);e.Cipher=s.Cipher,e.createCipher=s.createCipher,e.Cipheriv=s.Cipheriv,e.createCipheriv=s.createCipheriv,e.Decipher=s.Decipher,e.createDecipher=s.createDecipher,e.Decipheriv=s.Decipheriv,e.createDecipheriv=s.createDecipheriv,e.getCiphers=s.getCiphers,e.listCiphers=s.listCiphers;var h=r(833);e.DiffieHellmanGroup=h.DiffieHellmanGroup,e.createDiffieHellmanGroup=h.createDiffieHellmanGroup,e.getDiffieHellman=h.getDiffieHellman,e.createDiffieHellman=h.createDiffieHellman,e.DiffieHellman=h.DiffieHellman;var u=r(836);e.createSign=u.createSign,e.Sign=u.Sign,e.createVerify=u.createVerify,e.Verify=u.Verify,e.createECDH=r(855);var f=r(856);e.publicEncrypt=f.publicEncrypt,e.privateEncrypt=f.privateEncrypt,e.publicDecrypt=f.publicDecrypt,e.privateDecrypt=f.privateDecrypt;var l=r(859);e.randomFill=l.randomFill,e.randomFillSync=l.randomFillSync,e.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},725:function(t,e,r){"use strict";(function(e,i){var n=r(370).Buffer,o=e.crypto||e.msCrypto;o&&o.getRandomValues?t.exports=function(t,e){if(t>4294967295)throw new RangeError("requested too many random bytes");var r=n.allocUnsafe(t);if(t>0)if(t>65536)for(var a=0;a2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}n("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,n,a,s;if("string"===typeof e&&(n="not ",e.substr(!a||a<0?0:+a,n.length)===n)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(i," ").concat(o(e,"type"));else{var h=function(t,e,r){return"number"!==typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(h," ").concat(i," ").concat(o(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=i},728:function(t,e,r){"use strict";(function(e){var i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=u;var n=r(761),o=r(765);r(98)(u,n);for(var a=i(o.prototype),s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(4294967295&r)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=n},730:function(t,e,r){"use strict";var i={};function n(t,e,r){r||(r=Error);var n=function(t){var r,i;function n(r,i,n){return t.call(this,function(t,r,i){return"string"===typeof e?e:e(t,r,i)}(r,i,n))||this}return i=t,(r=n).prototype=Object.create(i.prototype),r.prototype.constructor=r,r.__proto__=i,n}(r);n.prototype.name=r.name,n.prototype.code=t,i[t]=n}function o(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}n("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,n,a,s;if("string"===typeof e&&(n="not ",e.substr(!a||a<0?0:+a,n.length)===n)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(i," ").concat(o(e,"type"));else{var h=function(t,e,r){return"number"!==typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(h," ").concat(i," ").concat(o(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=i},731:function(t,e,r){"use strict";(function(e){var i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=u;var n=r(786),o=r(790);r(98)(u,n);for(var a=i(o.prototype),s=0;s>>24]^f[p>>>16&255]^l[m>>>8&255]^c[255&g]^e[y++],a=u[p>>>24]^f[m>>>16&255]^l[g>>>8&255]^c[255&d]^e[y++],s=u[m>>>24]^f[g>>>16&255]^l[d>>>8&255]^c[255&p]^e[y++],h=u[g>>>24]^f[d>>>16&255]^l[p>>>8&255]^c[255&m]^e[y++],d=o,p=a,m=s,g=h;return o=(i[d>>>24]<<24|i[p>>>16&255]<<16|i[m>>>8&255]<<8|i[255&g])^e[y++],a=(i[p>>>24]<<24|i[m>>>16&255]<<16|i[g>>>8&255]<<8|i[255&d])^e[y++],s=(i[m>>>24]<<24|i[g>>>16&255]<<16|i[d>>>8&255]<<8|i[255&p])^e[y++],h=(i[g>>>24]<<24|i[d>>>16&255]<<16|i[p>>>8&255]<<8|i[255&m])^e[y++],[o>>>=0,a>>>=0,s>>>=0,h>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],h=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,h=0;h<256;++h){var u=s^s<<1^s<<2^s<<3^s<<4;u=u>>>8^255&u^99,r[a]=u,i[u]=a;var f=t[a],l=t[f],c=t[l],d=257*t[u]^16843008*u;n[0][a]=d<<24|d>>>8,n[1][a]=d<<16|d>>>16,n[2][a]=d<<8|d>>>24,n[3][a]=d,d=16843009*c^65537*l^257*f^16843008*a,o[0][u]=d<<24|d>>>8,o[1][u]=d<<16|d>>>16,o[2][u]=d<<8|d>>>24,o[3][u]=d,0===a?a=s=1:(a=f^t[t[t[c^f]]],s^=t[t[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}}();function u(t){this._key=n(t),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,i=4*(r+1),n=[],o=0;o>>24,a=h.SBOX[a>>>24]<<24|h.SBOX[a>>>16&255]<<16|h.SBOX[a>>>8&255]<<8|h.SBOX[255&a],a^=s[o/e|0]<<24):e>6&&o%e===4&&(a=h.SBOX[a>>>24]<<24|h.SBOX[a>>>16&255]<<16|h.SBOX[a>>>8&255]<<8|h.SBOX[255&a]),n[o]=n[o-e]^a}for(var u=[],f=0;f>>24]]^h.INV_SUB_MIX[1][h.SBOX[c>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[c>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&c]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=u},u.prototype.encryptBlockRaw=function(t){return a(t=n(t),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},u.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=i.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},u.prototype.decryptBlock=function(t){var e=(t=n(t))[1];t[1]=t[3],t[3]=e;var r=a(t,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),o=i.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},u.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=u},739:function(t,e,r){var i=r(370).Buffer,n=r(746);t.exports=function(t,e,r,o){if(i.isBuffer(t)||(t=i.from(t,"binary")),e&&(i.isBuffer(e)||(e=i.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=r/8,s=i.alloc(a),h=i.alloc(o||0),u=i.alloc(0);a>0||o>0;){var f=new n;f.update(u),f.update(t),e&&f.update(e),u=f.digest();var l=0;if(a>0){var c=s.length-a;l=Math.min(a,u.length),u.copy(s,c,0,l),a-=l}if(l0){var d=h.length-o,p=Math.min(o,u.length-l);u.copy(h,d,l,l+p),o-=p}}return u.fill(0),{key:s,iv:h}}},744:function(t,e,r){var i=r(845),n=r(852),o=r(853),a=r(751),s=r(772),h=r(370).Buffer;function u(t){var e;"object"!==typeof t||h.isBuffer(t)||(e=t.passphrase,t=t.key),"string"===typeof t&&(t=h.from(t));var r,u,f=o(t,e),l=f.tag,c=f.data;switch(l){case"CERTIFICATE":u=i.certificate.decode(c,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(u||(u=i.PublicKey.decode(c,"der")),r=u.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPublicKey.decode(u.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return u.subjectPrivateKey=u.subjectPublicKey,{type:"ec",data:u};case"1.2.840.10040.4.1":return u.algorithm.params.pub_key=i.DSAparam.decode(u.subjectPublicKey.data,"der"),{type:"dsa",data:u.algorithm.params};default:throw new Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":c=function(t,e){var r=t.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=n[t.algorithm.decrypt.cipher.algo.join(".")],u=t.algorithm.decrypt.cipher.iv,f=t.subjectPrivateKey,l=parseInt(o.split("-")[1],10)/8,c=s.pbkdf2Sync(e,r,i,l,"sha1"),d=a.createDecipheriv(o,c,u),p=[];return p.push(d.update(f)),p.push(d.final()),h.concat(p)}(c=i.EncryptedPrivateKey.decode(c,"der"),e);case"PRIVATE KEY":switch(r=(u=i.PrivateKey.decode(c,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPrivateKey.decode(u.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:u.algorithm.curve,privateKey:i.ECPrivateKey.decode(u.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return u.algorithm.params.priv_key=i.DSAparam.decode(u.subjectPrivateKey,"der"),{type:"dsa",params:u.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return i.RSAPublicKey.decode(c,"der");case"RSA PRIVATE KEY":return i.RSAPrivateKey.decode(c,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:i.DSAPrivateKey.decode(c,"der")};case"EC PRIVATE KEY":return{curve:(c=i.ECPrivateKey.decode(c,"der")).parameters.value,privateKey:c.privateKey};default:throw new Error("unknown key type "+l)}}t.exports=u,u.signature=i.signature},746:function(t,e,r){"use strict";var i=r(98),n=r(760),o=r(370).Buffer,a=new Array(16);function s(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function h(t,e){return t<>>32-e}function u(t,e,r,i,n,o,a){return h(t+(e&r|~e&i)+n+o|0,a)+e|0}function f(t,e,r,i,n,o,a){return h(t+(e&i|r&~i)+n+o|0,a)+e|0}function l(t,e,r,i,n,o,a){return h(t+(e^r^i)+n+o|0,a)+e|0}function c(t,e,r,i,n,o,a){return h(t+(r^(e|~i))+n+o|0,a)+e|0}i(s,n),s.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,i=this._b,n=this._c,o=this._d;r=u(r,i,n,o,t[0],3614090360,7),o=u(o,r,i,n,t[1],3905402710,12),n=u(n,o,r,i,t[2],606105819,17),i=u(i,n,o,r,t[3],3250441966,22),r=u(r,i,n,o,t[4],4118548399,7),o=u(o,r,i,n,t[5],1200080426,12),n=u(n,o,r,i,t[6],2821735955,17),i=u(i,n,o,r,t[7],4249261313,22),r=u(r,i,n,o,t[8],1770035416,7),o=u(o,r,i,n,t[9],2336552879,12),n=u(n,o,r,i,t[10],4294925233,17),i=u(i,n,o,r,t[11],2304563134,22),r=u(r,i,n,o,t[12],1804603682,7),o=u(o,r,i,n,t[13],4254626195,12),n=u(n,o,r,i,t[14],2792965006,17),r=f(r,i=u(i,n,o,r,t[15],1236535329,22),n,o,t[1],4129170786,5),o=f(o,r,i,n,t[6],3225465664,9),n=f(n,o,r,i,t[11],643717713,14),i=f(i,n,o,r,t[0],3921069994,20),r=f(r,i,n,o,t[5],3593408605,5),o=f(o,r,i,n,t[10],38016083,9),n=f(n,o,r,i,t[15],3634488961,14),i=f(i,n,o,r,t[4],3889429448,20),r=f(r,i,n,o,t[9],568446438,5),o=f(o,r,i,n,t[14],3275163606,9),n=f(n,o,r,i,t[3],4107603335,14),i=f(i,n,o,r,t[8],1163531501,20),r=f(r,i,n,o,t[13],2850285829,5),o=f(o,r,i,n,t[2],4243563512,9),n=f(n,o,r,i,t[7],1735328473,14),r=l(r,i=f(i,n,o,r,t[12],2368359562,20),n,o,t[5],4294588738,4),o=l(o,r,i,n,t[8],2272392833,11),n=l(n,o,r,i,t[11],1839030562,16),i=l(i,n,o,r,t[14],4259657740,23),r=l(r,i,n,o,t[1],2763975236,4),o=l(o,r,i,n,t[4],1272893353,11),n=l(n,o,r,i,t[7],4139469664,16),i=l(i,n,o,r,t[10],3200236656,23),r=l(r,i,n,o,t[13],681279174,4),o=l(o,r,i,n,t[0],3936430074,11),n=l(n,o,r,i,t[3],3572445317,16),i=l(i,n,o,r,t[6],76029189,23),r=l(r,i,n,o,t[9],3654602809,4),o=l(o,r,i,n,t[12],3873151461,11),n=l(n,o,r,i,t[15],530742520,16),r=c(r,i=l(i,n,o,r,t[2],3299628645,23),n,o,t[0],4096336452,6),o=c(o,r,i,n,t[7],1126891415,10),n=c(n,o,r,i,t[14],2878612391,15),i=c(i,n,o,r,t[5],4237533241,21),r=c(r,i,n,o,t[12],1700485571,6),o=c(o,r,i,n,t[3],2399980690,10),n=c(n,o,r,i,t[10],4293915773,15),i=c(i,n,o,r,t[1],2240044497,21),r=c(r,i,n,o,t[8],1873313359,6),o=c(o,r,i,n,t[15],4264355552,10),n=c(n,o,r,i,t[6],2734768916,15),i=c(i,n,o,r,t[13],1309151649,21),r=c(r,i,n,o,t[4],4149444226,6),o=c(o,r,i,n,t[11],3174756917,10),n=c(n,o,r,i,t[2],718787259,15),i=c(i,n,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+o|0},s.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 t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=s},747:function(t,e,r){"use strict";var i=r(727).codes.ERR_STREAM_PREMATURE_CLOSE;function n(){}t.exports=function t(e,r,o){if("function"===typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n>>32-e}function m(t,e,r,i,n,o,a,s){return p(t+(e^r^i)+o+a|0,s)+n|0}function g(t,e,r,i,n,o,a,s){return p(t+(e&r|~e&i)+o+a|0,s)+n|0}function y(t,e,r,i,n,o,a,s){return p(t+((e|~r)^i)+o+a|0,s)+n|0}function b(t,e,r,i,n,o,a,s){return p(t+(e&i|r&~i)+o+a|0,s)+n|0}function v(t,e,r,i,n,o,a,s){return p(t+(e^(r|~i))+o+a|0,s)+n|0}n(d,o),d.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,i=0|this._b,n=0|this._c,o=0|this._d,d=0|this._e,_=0|this._a,w=0|this._b,M=0|this._c,S=0|this._d,E=0|this._e,k=0;k<80;k+=1){var R,A;k<16?(R=m(r,i,n,o,d,t[s[k]],l[0],u[k]),A=v(_,w,M,S,E,t[h[k]],c[0],f[k])):k<32?(R=g(r,i,n,o,d,t[s[k]],l[1],u[k]),A=b(_,w,M,S,E,t[h[k]],c[1],f[k])):k<48?(R=y(r,i,n,o,d,t[s[k]],l[2],u[k]),A=y(_,w,M,S,E,t[h[k]],c[2],f[k])):k<64?(R=b(r,i,n,o,d,t[s[k]],l[3],u[k]),A=g(_,w,M,S,E,t[h[k]],c[3],f[k])):(R=v(r,i,n,o,d,t[s[k]],l[4],u[k]),A=m(_,w,M,S,E,t[h[k]],c[4],f[k])),r=d,d=o,o=p(n,10),n=i,i=R,_=E,E=S,S=p(M,10),M=w,w=A}var B=this._b+n+S|0;this._b=this._c+o+E|0,this._c=this._d+d+_|0,this._d=this._e+r+w|0,this._e=this._a+i+M|0,this._a=B},d.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 t=i.alloc?i.alloc(20):new i(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=d},749:function(t,e,r){(e=t.exports=function(t){t=t.toLowerCase();var r=e[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r}).sha=r(811),e.sha1=r(812),e.sha224=r(813),e.sha256=r(767),e.sha384=r(814),e.sha512=r(768)},750:function(t,e,r){"use strict";var i=r(159);function n(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}t.exports=n,n.prototype._init=function(){},n.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},n.prototype._buffer=function(t,e){for(var r=Math.min(this.buffer.length-this.bufferOff,t.length-e),i=0;i0;i--)e+=this._buffer(t,e),r+=this._flushBuffer(n,r);return e+=this._buffer(t,e),n},n.prototype.final=function(t){var e,r;return t&&(e=this.update(t)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},n.prototype._pad=function(t,e){if(0===e)return!1;for(;e=0||!e.umod(t.prime1)||!e.umod(t.prime2));return e}function a(t,r){var n=function(t){var e=o(t);return{blinder:e.toRed(i.mont(t.modulus)).redPow(new i(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}(r),a=r.modulus.byteLength(),s=new i(t).mul(n.blinder).umod(r.modulus),h=s.toRed(i.mont(r.prime1)),u=s.toRed(i.mont(r.prime2)),f=r.coefficient,l=r.prime1,c=r.prime2,d=h.redPow(r.exponent1).fromRed(),p=u.redPow(r.exponent2).fromRed(),m=d.isub(p).imul(f).umod(l).imul(c);return p.iadd(m).imul(n.unblinder).umod(r.modulus).toArrayLike(e,"be",a)}a.getr=o,t.exports=a}).call(this,r(52).Buffer)},755:function(t,e,r){"use strict";(function(e){var i,n=r(52),o=n.Buffer,a={};for(i in n)n.hasOwnProperty(i)&&"SlowBuffer"!==i&&"Buffer"!==i&&(a[i]=n[i]);var s=a.Buffer={};for(i in o)o.hasOwnProperty(i)&&"allocUnsafe"!==i&&"allocUnsafeSlow"!==i&&(s[i]=o[i]);if(a.Buffer.prototype=o.prototype,s.from&&s.from!==Uint8Array.from||(s.from=function(t,e,r){if("number"===typeof t)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof t);if(t&&"undefined"===typeof t.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);return o(t,e,r)}),s.alloc||(s.alloc=function(t,e,r){if("number"!==typeof t)throw new TypeError('The "size" argument must be of type number. Received type '+typeof t);if(t<0||t>=2*(1<<30))throw new RangeError('The value "'+t+'" is invalid for option "size"');var i=o(t);return e&&0!==e.length?"string"===typeof r?i.fill(e,r):i.fill(e):i.fill(0),i}),!a.kStringMaxLength)try{a.kStringMaxLength=e.binding("buffer").kStringMaxLength}catch(h){}a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),t.exports=a}).call(this,r(90))},756:function(t,e,r){"use strict";var i=r(757).Reporter,n=r(733).EncoderBuffer,o=r(733).DecoderBuffer,a=r(159),s=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],h=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s);function u(t,e,r){var i={};this._baseState=i,i.name=r,i.enc=t,i.parent=e||null,i.children=null,i.tag=null,i.args=null,i.reverseArgs=null,i.choice=null,i.optional=!1,i.any=!1,i.obj=!1,i.use=null,i.useDecoder=null,i.key=null,i.default=null,i.explicit=null,i.implicit=null,i.contains=null,i.parent||(i.children=[],this._wrap())}t.exports=u;var f=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];u.prototype.clone=function(){var t=this._baseState,e={};f.forEach((function(r){e[r]=t[r]}));var r=new this.constructor(e.parent);return r._baseState=e,r},u.prototype._wrap=function(){var t=this._baseState;h.forEach((function(e){this[e]=function(){var r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}}),this)},u.prototype._init=function(t){var e=this._baseState;a(null===e.parent),t.call(this),e.children=e.children.filter((function(t){return t._baseState.parent===this}),this),a.equal(e.children.length,1,"Root node can have only one child")},u.prototype._useArgs=function(t){var e=this._baseState,r=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==r.length&&(a(null===e.children),e.children=r,r.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(a(null===e.args),e.args=t,e.reverseArgs=t.map((function(t){if("object"!==typeof t||t.constructor!==Object)return t;var e={};return Object.keys(t).forEach((function(r){r==(0|r)&&(r|=0);var i=t[r];e[i]=r})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){u.prototype[t]=function(){var e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}})),s.forEach((function(t){u.prototype[t]=function(){var e=this._baseState,r=Array.prototype.slice.call(arguments);return a(null===e.tag),e.tag=t,this._useArgs(r),this}})),u.prototype.use=function(t){a(t);var e=this._baseState;return a(null===e.use),e.use=t,this},u.prototype.optional=function(){return this._baseState.optional=!0,this},u.prototype.def=function(t){var e=this._baseState;return a(null===e.default),e.default=t,e.optional=!0,this},u.prototype.explicit=function(t){var e=this._baseState;return a(null===e.explicit&&null===e.implicit),e.explicit=t,this},u.prototype.implicit=function(t){var e=this._baseState;return a(null===e.explicit&&null===e.implicit),e.implicit=t,this},u.prototype.obj=function(){var t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},u.prototype.key=function(t){var e=this._baseState;return a(null===e.key),e.key=t,this},u.prototype.any=function(){return this._baseState.any=!0,this},u.prototype.choice=function(t){var e=this._baseState;return a(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map((function(e){return t[e]}))),this},u.prototype.contains=function(t){var e=this._baseState;return a(null===e.use),e.contains=t,this},u.prototype._decode=function(t,e){var r=this._baseState;if(null===r.parent)return t.wrapResult(r.children[0]._decode(t,e));var i,n=r.default,a=!0,s=null;if(null!==r.key&&(s=t.enterKey(r.key)),r.optional){var h=null;if(null!==r.explicit?h=r.explicit:null!==r.implicit?h=r.implicit:null!==r.tag&&(h=r.tag),null!==h||r.any){if(a=this._peekTag(t,h,r.any),t.isError(a))return a}else{var u=t.save();try{null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),a=!0}catch(m){a=!1}t.restore(u)}}if(r.obj&&a&&(i=t.enterObject()),a){if(null!==r.explicit){var f=this._decodeTag(t,r.explicit);if(t.isError(f))return f;t=f}var l=t.offset;if(null===r.use&&null===r.choice){var c;r.any&&(c=t.save());var d=this._decodeTag(t,null!==r.implicit?r.implicit:r.tag,r.any);if(t.isError(d))return d;r.any?n=t.raw(c):t=d}if(e&&e.track&&null!==r.tag&&e.track(t.path(),l,t.length,"tagged"),e&&e.track&&null!==r.tag&&e.track(t.path(),t.offset,t.length,"content"),r.any||(n=null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e)),t.isError(n))return n;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(t,e)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){var p=new o(n);n=this._getUse(r.contains,t._reporterState.obj)._decode(p,e)}}return r.obj&&a&&(n=t.leaveObject(i)),null===r.key||null===n&&!0!==a?null!==s&&t.exitKey(s):t.leaveKey(s,r.key,n),n},u.prototype._decodeGeneric=function(t,e,r){var i=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,i.args[0],r):/str$/.test(t)?this._decodeStr(e,t,r):"objid"===t&&i.args?this._decodeObjid(e,i.args[0],i.args[1],r):"objid"===t?this._decodeObjid(e,null,null,r):"gentime"===t||"utctime"===t?this._decodeTime(e,t,r):"null_"===t?this._decodeNull(e,r):"bool"===t?this._decodeBool(e,r):"objDesc"===t?this._decodeStr(e,t,r):"int"===t||"enum"===t?this._decodeInt(e,i.args&&i.args[0],r):null!==i.use?this._getUse(i.use,e._reporterState.obj)._decode(e,r):e.error("unknown tag: "+t)},u.prototype._getUse=function(t,e){var r=this._baseState;return r.useDecoder=this._use(t,e),a(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},u.prototype._decodeChoice=function(t,e){var r=this._baseState,i=null,n=!1;return Object.keys(r.choice).some((function(o){var a=t.save(),s=r.choice[o];try{var h=s._decode(t,e);if(t.isError(h))return!1;i={type:o,value:h},n=!0}catch(u){return t.restore(a),!1}return!0}),this),n?i:t.error("Choice not matched")},u.prototype._createEncoderBuffer=function(t){return new n(t,this.reporter)},u.prototype._encode=function(t,e,r){var i=this._baseState;if(null===i.default||i.default!==t){var n=this._encodeValue(t,e,r);if(void 0!==n&&!this._skipDefault(n,e,r))return n}},u.prototype._encodeValue=function(t,e,r){var n=this._baseState;if(null===n.parent)return n.children[0]._encode(t,e||new i);var o=null;if(this.reporter=e,n.optional&&void 0===t){if(null===n.default)return;t=n.default}var a=null,s=!1;if(n.any)o=this._createEncoderBuffer(t);else if(n.choice)o=this._encodeChoice(t,e);else if(n.contains)a=this._getUse(n.contains,r)._encode(t,e),s=!0;else if(n.children)a=n.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,e,t);if(null===r._baseState.key)return e.error("Child should have a key");var i=e.enterKey(r._baseState.key);if("object"!==typeof t)return e.error("Child expected, but input is not object");var n=r._encode(t[r._baseState.key],e,t);return e.leaveKey(i),n}),this).filter((function(t){return t})),a=this._createEncoderBuffer(a);else if("seqof"===n.tag||"setof"===n.tag){if(!n.args||1!==n.args.length)return e.error("Too many args for : "+n.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");var h=this.clone();h._baseState.implicit=null,a=this._createEncoderBuffer(t.map((function(r){var i=this._baseState;return this._getUse(i.args[0],t)._encode(r,e)}),h))}else null!==n.use?o=this._getUse(n.use,r)._encode(t,e):(a=this._encodePrimitive(n.tag,t),s=!0);if(!n.any&&null===n.choice){var u=null!==n.implicit?n.implicit:n.tag,f=null===n.implicit?"universal":"context";null===u?null===n.use&&e.error("Tag could be omitted only for .use()"):null===n.use&&(o=this._encodeComposite(u,s,f,a))}return null!==n.explicit&&(o=this._encodeComposite(n.explicit,!1,"context",o)),o},u.prototype._encodeChoice=function(t,e){var r=this._baseState,i=r.choice[t.type];return i||a(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),i._encode(t.value,e)},u.prototype._encodePrimitive=function(t,e){var r=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&r.args)return this._encodeObjid(e,r.reverseArgs[0],r.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,r.args&&r.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},u.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},u.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(t)}},757:function(t,e,r){"use strict";var i=r(98);function n(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function o(t,e){this.path=t,this.rethrow(e)}e.Reporter=n,n.prototype.isError=function(t){return t instanceof o},n.prototype.save=function(){var t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},n.prototype.restore=function(t){var e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},n.prototype.enterKey=function(t){return this._reporterState.path.push(t)},n.prototype.exitKey=function(t){var e=this._reporterState;e.path=e.path.slice(0,t-1)},n.prototype.leaveKey=function(t,e,r){var i=this._reporterState;this.exitKey(t),null!==i.obj&&(i.obj[e]=r)},n.prototype.path=function(){return this._reporterState.path.join("/")},n.prototype.enterObject=function(){var t=this._reporterState,e=t.obj;return t.obj={},e},n.prototype.leaveObject=function(t){var e=this._reporterState,r=e.obj;return e.obj=t,r},n.prototype.error=function(t){var e,r=this._reporterState,i=t instanceof o;if(e=i?t:new o(r.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),t.message||t,t.stack),!r.options.partial)throw e;return i||r.errors.push(e),e},n.prototype.wrapResult=function(t){var e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},i(o,Error),o.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},758:function(t,e,r){"use strict";function i(t){var e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);var i=t[r];e[i]=r})),e}e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=i(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=i(e.tag)},760:function(t,e,r){"use strict";var i=r(370).Buffer,n=r(805).Transform;function o(t){n.call(this),this._block=i.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(98)(o,n),o.prototype._transform=function(t,e,r){var i=null;try{this.update(t,e)}catch(n){i=n}r(i)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(r){e=r}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!i.isBuffer(t)&&"string"!==typeof t)throw new TypeError(e+" must be a string or a buffer")}(t,"Data"),this._finalized)throw new Error("Digest already called");i.isBuffer(t)||(t=i.from(t,e));for(var r=this._block,n=0;this._blockOffset+t.length-n>=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},761:function(t,e,r){"use strict";(function(e,i){var n;t.exports=k,k.ReadableState=E;r(73).EventEmitter;var o=function(t,e){return t.listeners(e).length},a=r(762),s=r(52).Buffer,h=e.Uint8Array||function(){};var u,f=r(736);u=f&&f.debuglog?f.debuglog("stream"):function(){};var l,c,d,p=r(806),m=r(763),g=r(764).getHighWaterMark,y=r(727).codes,b=y.ERR_INVALID_ARG_TYPE,v=y.ERR_STREAM_PUSH_AFTER_EOF,_=y.ERR_METHOD_NOT_IMPLEMENTED,w=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(98)(k,a);var M=m.errorOrDestroy,S=["error","close","destroy","pause","resume"];function E(t,e,i){n=n||r(728),t=t||{},"boolean"!==typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",i),this.buffer=new p,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.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(l||(l=r(371).StringDecoder),this.decoder=new l(t.encoding),this.encoding=t.encoding)}function k(t){if(n=n||r(728),!(this instanceof k))return new k(t);var e=this instanceof n;this._readableState=new E(t,this,e),this.readable=!0,t&&("function"===typeof t.read&&(this._read=t.read),"function"===typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function R(t,e,r,i,n){u("readableAddChunk",e);var o,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(u("onEofChunk"),e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?T(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,x(t)))}(t,a);else if(n||(o=function(t,e){var r;i=e,s.isBuffer(i)||i instanceof h||"string"===typeof e||void 0===e||t.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],e));var i;return r}(a,e)),o)M(t,o);else if(a.objectMode||e&&e.length>0)if("string"===typeof e||a.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),i)a.endEmitted?M(t,new w):A(t,a,e,!0);else if(a.ended)M(t,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?A(t,a,e,!1):D(t,a)):A(t,a,e,!1)}else i||(a.reading=!1,D(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function T(t){var e=t._readableState;u("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(u("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(x,t))}function x(t){var e=t._readableState;u("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,P(t)}function D(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(O,t,e))}function O(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function I(t){u("readable nexttick read 0"),t.read(0)}function C(t,e){u("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),P(t),e.flowing&&!e.reading&&t.read(0)}function P(t){var e=t._readableState;for(u("flow",e.flowing);e.flowing&&null!==t.read(););}function L(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function U(t){var e=t._readableState;u("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(N,e,t))}function N(t,e){if(u("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function q(t,e){for(var r=0,i=t.length;r=e.highWaterMark:e.length>0)||e.ended))return u("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?U(this):T(this),null;if(0===(t=B(t,e))&&e.ended)return 0===e.length&&U(this),null;var i,n=e.needReadable;return u("need readable",n),(0===e.length||e.length-t0?L(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&U(this)),null!==i&&this.emit("data",i),i},k.prototype._read=function(t){M(this,new _("_read()"))},k.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,u("pipe count=%d opts=%j",n.pipesCount,e);var a=(!e||!1!==e.end)&&t!==i.stdout&&t!==i.stderr?h:g;function s(e,i){u("onunpipe"),e===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,u("cleanup"),t.removeListener("close",p),t.removeListener("finish",m),t.removeListener("drain",f),t.removeListener("error",d),t.removeListener("unpipe",s),r.removeListener("end",h),r.removeListener("end",g),r.removeListener("data",c),l=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}function h(){u("onend"),t.end()}n.endEmitted?i.nextTick(a):r.once("end",a),t.on("unpipe",s);var f=function(t){return function(){var e=t._readableState;u("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,P(t))}}(r);t.on("drain",f);var l=!1;function c(e){u("ondata");var i=t.write(e);u("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==q(n.pipes,t))&&!l&&(u("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(e){u("onerror",e),g(),t.removeListener("error",d),0===o(t,"error")&&M(t,e)}function p(){t.removeListener("finish",m),g()}function m(){u("onfinish"),t.removeListener("close",p),g()}function g(){u("unpipe"),r.unpipe(t)}return r.on("data",c),function(t,e,r){if("function"===typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",p),t.once("finish",m),t.emit("pipe",r),n.flowing||(u("pipe resume"),r.resume()),t},k.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,u("on readable",n.length,n.reading),n.length?T(this):n.reading||i.nextTick(I,this))),r},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(j,this),r},k.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(j,this),e},k.prototype.resume=function(){var t=this._readableState;return t.flowing||(u("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(C,t,e))}(this,t)),t.paused=!1,this},k.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var n in t.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(n){(u("wrapped data"),r.decoder&&(n=r.decoder.write(n)),!r.objectMode||null!==n&&void 0!==n)&&((r.objectMode||n&&n.length)&&(e.push(n)||(i=!0,t.pause())))})),t)void 0===this[n]&&"function"===typeof t[n]&&(this[n]=function(e){return function(){return t[e].apply(t,arguments)}}(n));for(var o=0;o-1))throw new w(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(t,e,r){r(new m("_write()"))},k.prototype._writev=null,k.prototype.end=function(t,e,r){var n=this._writableState;return"function"===typeof t?(r=t,t=null,e=null):"function"===typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,D(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),k.prototype.destroy=l.destroy,k.prototype._undestroy=l.undestroy,k.prototype._destroy=function(t,e){e(t)}}).call(this,r(71),r(90))},766:function(t,e,r){"use strict";t.exports=f;var i=r(727).codes,n=i.ERR_METHOD_NOT_IMPLEMENTED,o=i.ERR_MULTIPLE_CALLBACK,a=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=i.ERR_TRANSFORM_WITH_LENGTH_0,h=r(728);function u(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function c(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}i(h,n),h.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},h.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,s=0|this._d,h=0|this._e,p=0|this._f,m=0|this._g,g=0|this._h,y=0;y<16;++y)r[y]=t.readInt32BE(4*y);for(;y<64;++y)r[y]=0|(((e=r[y-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[y-7]+d(r[y-15])+r[y-16];for(var b=0;b<64;++b){var v=g+c(h)+u(h,p,m)+a[b]+r[b]|0,_=l(i)+f(i,n,o)|0;g=m,m=p,p=h,h=s+v|0,s=o,o=n,n=i,i=v+_|0}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=h+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},h.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=h},768:function(t,e,r){var i=r(98),n=r(729),o=r(370).Buffer,a=[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],s=new Array(160);function h(){this.init(),this._w=s,n.call(this,128,112)}function u(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function l(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function c(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function m(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function g(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function y(t,e){return t>>>0>>0?1:0}i(h,n),h.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},h.prototype._update=function(t){for(var e=this._w,r=0|this._ah,i=0|this._bh,n=0|this._ch,o=0|this._dh,s=0|this._eh,h=0|this._fh,b=0|this._gh,v=0|this._hh,_=0|this._al,w=0|this._bl,M=0|this._cl,S=0|this._dl,E=0|this._el,k=0|this._fl,R=0|this._gl,A=0|this._hl,B=0;B<32;B+=2)e[B]=t.readInt32BE(4*B),e[B+1]=t.readInt32BE(4*B+4);for(;B<160;B+=2){var T=e[B-30],x=e[B-30+1],D=d(T,x),O=p(x,T),j=m(T=e[B-4],x=e[B-4+1]),I=g(x,T),C=e[B-14],P=e[B-14+1],L=e[B-32],U=e[B-32+1],N=O+P|0,q=D+C+y(N,O)|0;q=(q=q+j+y(N=N+I|0,I)|0)+L+y(N=N+U|0,U)|0,e[B]=q,e[B+1]=N}for(var K=0;K<160;K+=2){q=e[K],N=e[K+1];var H=f(r,i,n),F=f(_,w,M),W=l(r,_),z=l(_,r),V=c(s,E),G=c(E,s),Z=a[K],X=a[K+1],Y=u(s,h,b),J=u(E,k,R),$=A+G|0,Q=v+V+y($,A)|0;Q=(Q=(Q=Q+Y+y($=$+J|0,J)|0)+Z+y($=$+X|0,X)|0)+q+y($=$+N|0,N)|0;var tt=z+F|0,et=W+H+y(tt,z)|0;v=b,A=R,b=h,R=k,h=s,k=E,s=o+Q+y(E=S+$|0,S)|0,o=n,S=M,n=i,M=w,i=r,w=_,r=Q+et+y(_=$+tt|0,$)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+M|0,this._dl=this._dl+S|0,this._el=this._el+E|0,this._fl=this._fl+k|0,this._gl=this._gl+R|0,this._hl=this._hl+A|0,this._ah=this._ah+r+y(this._al,_)|0,this._bh=this._bh+i+y(this._bl,w)|0,this._ch=this._ch+n+y(this._cl,M)|0,this._dh=this._dh+o+y(this._dl,S)|0,this._eh=this._eh+s+y(this._el,E)|0,this._fh=this._fh+h+y(this._fl,k)|0,this._gh=this._gh+b+y(this._gl,R)|0,this._hh=this._hh+v+y(this._hl,A)|0},h.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=h},769:function(t,e,r){"use strict";var i=r(98),n=r(815),o=r(723),a=r(370).Buffer,s=r(770),h=r(748),u=r(749),f=a.alloc(128);function l(t,e){o.call(this,"digest"),"string"===typeof e&&(e=a.from(e));var r="sha512"===t||"sha384"===t?128:64;(this._alg=t,this._key=e,e.length>r)?e=("rmd160"===t?new h:u(t)).update(e).digest():e.lengthr||e!==e)throw new TypeError("Bad key length")}},774:function(t,e,r){(function(e){var r;if(e.browser)r="utf-8";else if(e.version){r=parseInt(e.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else r="utf-8";t.exports=r}).call(this,r(90))},775:function(t,e,r){var i=r(770),n=r(748),o=r(749),a=r(370).Buffer,s=r(773),h=r(774),u=r(776),f=a.alloc(128),l={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function c(t,e,r){var s=function(t){function e(e){return o(t).update(e).digest()}return"rmd160"===t||"ripemd160"===t?function(t){return(new n).update(t).digest()}:"md5"===t?i:e}(t),h="sha512"===t||"sha384"===t?128:64;e.length>h?e=s(e):e.length>>0},e.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},e.ip=function(t,e,r,i){for(var n=0,o=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=e>>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=t>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1}r[i+0]=n>>>0,r[i+1]=o>>>0},e.rip=function(t,e,r,i){for(var n=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)n<<=1,n|=e>>>s+a&1,n<<=1,n|=t>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=e>>>s+a&1,o<<=1,o|=t>>>s+a&1;r[i+0]=n>>>0,r[i+1]=o>>>0},e.pc1=function(t,e,r,i){for(var n=0,o=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)n<<=1,n|=e>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+a&1}for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;r[i+0]=n>>>0,r[i+1]=o>>>0},e.r28shl=function(t,e){return t<>>28-e};var i=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];e.pc2=function(t,e,r,n){for(var o=0,a=0,s=i.length>>>1,h=0;h>>i[h]&1;for(h=s;h>>i[h]&1;r[n+0]=o>>>0,r[n+1]=a>>>0},e.expand=function(t,e,r){var i=0,n=0;i=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)i<<=6,i|=t>>>o&63;for(o=11;o>=3;o-=4)n|=t>>>o&63,n<<=6;n|=(31&t)<<1|t>>>31,e[r+0]=i>>>0,e[r+1]=n>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];e.substitute=function(t,e){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(t>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(e>>>18-6*i&63)]}return r>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];e.permute=function(t){for(var e=0,r=0;r>>o[r]&1;return e>>>0},e.padSplit=function(t,e,r){for(var i=t.toString(2);i.length>>1];r=o.r28shl(r,s),n=o.r28shl(n,s),o.pc2(r,n,t.keys,a)}},h.prototype._update=function(t,e,r,i){var n=this._desState,a=o.readUInt32BE(t,e),s=o.readUInt32BE(t,e+4);o.ip(a,s,n.tmp,0),a=n.tmp[0],s=n.tmp[1],"encrypt"===this.type?this._encrypt(n,a,s,n.tmp,0):this._decrypt(n,a,s,n.tmp,0),a=n.tmp[0],s=n.tmp[1],o.writeUInt32BE(r,a,i),o.writeUInt32BE(r,s,i+4)},h.prototype._pad=function(t,e){for(var r=t.length-e,i=e;i>>0,a=c}o.rip(s,a,i,n)},h.prototype._decrypt=function(t,e,r,i,n){for(var a=r,s=e,h=t.keys.length-2;h>=0;h-=2){var u=t.keys[h],f=t.keys[h+1];o.expand(a,t.tmp,0),u^=t.tmp[0],f^=t.tmp[1];var l=o.substitute(u,f),c=a;a=(s^o.permute(l))>>>0,s=c}o.rip(a,s,i,n)}},779:function(t,e,r){var i=r(732),n=r(370).Buffer,o=r(780);function a(t){var e=t._cipher.encryptBlockRaw(t._prev);return o(t._prev),e}e.encrypt=function(t,e){var r=Math.ceil(e.length/16),o=t._cache.length;t._cache=n.concat([t._cache,n.allocUnsafe(16*r)]);for(var s=0;st;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(h),e.cmp(h)){if(!e.cmp(u))for(;r.mod(f).cmp(l);)r.iadd(d)}else for(;r.mod(o).cmp(c);)r.iadd(d);if(g(p=r.shrn(1))&&g(r)&&y(p)&&y(r)&&a.test(p)&&a.test(r))return r}}},785:function(t,e,r){var i=r(126),n=r(373);function o(t){this.rand=t||new n.Rand}t.exports=o,o.create=function(t){return new o(t)},o.prototype._randbelow=function(t){var e=t.bitLength(),r=Math.ceil(e/8);do{var n=new i(this.rand.generate(r))}while(n.cmp(t)>=0);return n},o.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},o.prototype.test=function(t,e,r){var n=t.bitLength(),o=i.mont(t),a=new i(1).toRed(o);e||(e=Math.max(1,n/48|0));for(var s=t.subn(1),h=0;!s.testn(h);h++);for(var u=t.shrn(h),f=s.toRed(o);e>0;e--){var l=this._randrange(new i(2),s);r&&r(l);var c=l.toRed(o).redPow(u);if(0!==c.cmp(a)&&0!==c.cmp(f)){for(var d=1;d0;e--){var f=this._randrange(new i(2),a),l=t.gcd(f);if(0!==l.cmpn(1))return l;var c=f.toRed(n).redPow(h);if(0!==c.cmp(o)&&0!==c.cmp(u)){for(var d=1;d0)if("string"===typeof e||a.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),i)a.endEmitted?M(t,new w):A(t,a,e,!0);else if(a.ended)M(t,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?A(t,a,e,!1):D(t,a)):A(t,a,e,!1)}else i||(a.reading=!1,D(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function T(t){var e=t._readableState;u("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(u("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(x,t))}function x(t){var e=t._readableState;u("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,P(t)}function D(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(O,t,e))}function O(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function I(t){u("readable nexttick read 0"),t.read(0)}function C(t,e){u("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),P(t),e.flowing&&!e.reading&&t.read(0)}function P(t){var e=t._readableState;for(u("flow",e.flowing);e.flowing&&null!==t.read(););}function L(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function U(t){var e=t._readableState;u("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(N,e,t))}function N(t,e){if(u("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function q(t,e){for(var r=0,i=t.length;r=e.highWaterMark:e.length>0)||e.ended))return u("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?U(this):T(this),null;if(0===(t=B(t,e))&&e.ended)return 0===e.length&&U(this),null;var i,n=e.needReadable;return u("need readable",n),(0===e.length||e.length-t0?L(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&U(this)),null!==i&&this.emit("data",i),i},k.prototype._read=function(t){M(this,new _("_read()"))},k.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,u("pipe count=%d opts=%j",n.pipesCount,e);var a=(!e||!1!==e.end)&&t!==i.stdout&&t!==i.stderr?h:g;function s(e,i){u("onunpipe"),e===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,u("cleanup"),t.removeListener("close",p),t.removeListener("finish",m),t.removeListener("drain",f),t.removeListener("error",d),t.removeListener("unpipe",s),r.removeListener("end",h),r.removeListener("end",g),r.removeListener("data",c),l=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}function h(){u("onend"),t.end()}n.endEmitted?i.nextTick(a):r.once("end",a),t.on("unpipe",s);var f=function(t){return function(){var e=t._readableState;u("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,P(t))}}(r);t.on("drain",f);var l=!1;function c(e){u("ondata");var i=t.write(e);u("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==q(n.pipes,t))&&!l&&(u("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(e){u("onerror",e),g(),t.removeListener("error",d),0===o(t,"error")&&M(t,e)}function p(){t.removeListener("finish",m),g()}function m(){u("onfinish"),t.removeListener("close",p),g()}function g(){u("unpipe"),r.unpipe(t)}return r.on("data",c),function(t,e,r){if("function"===typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",p),t.once("finish",m),t.emit("pipe",r),n.flowing||(u("pipe resume"),r.resume()),t},k.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,u("on readable",n.length,n.reading),n.length?T(this):n.reading||i.nextTick(I,this))),r},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(j,this),r},k.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(j,this),e},k.prototype.resume=function(){var t=this._readableState;return t.flowing||(u("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(C,t,e))}(this,t)),t.paused=!1,this},k.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var n in t.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(n){(u("wrapped data"),r.decoder&&(n=r.decoder.write(n)),!r.objectMode||null!==n&&void 0!==n)&&((r.objectMode||n&&n.length)&&(e.push(n)||(i=!0,t.pause())))})),t)void 0===this[n]&&"function"===typeof t[n]&&(this[n]=function(e){return function(){return t[e].apply(t,arguments)}}(n));for(var o=0;o-1))throw new w(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(t,e,r){r(new m("_write()"))},k.prototype._writev=null,k.prototype.end=function(t,e,r){var n=this._writableState;return"function"===typeof t?(r=t,t=null,e=null):"function"===typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,D(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),k.prototype.destroy=l.destroy,k.prototype._undestroy=l.undestroy,k.prototype._destroy=function(t,e){e(t)}}).call(this,r(71),r(90))},791:function(t,e,r){"use strict";t.exports=f;var i=r(730).codes,n=i.ERR_METHOD_NOT_IMPLEMENTED,o=i.ERR_MULTIPLE_CALLBACK,a=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=i.ERR_TRANSFORM_WITH_LENGTH_0,h=r(731);function u(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length=49&&u<=54?u-49+10:u>=17&&u<=22?u-17+10:u,a|=h}return i(!(240&a),"Invalid character in "+t),n}function h(t,e,r,n){for(var o=0,a=0,s=Math.min(t.length,r),h=e;h=49?u-49+10:u>=17?u-17+10:u,i(u>=0&&a0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this._strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)a=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=s(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=s(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,a=o%i,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(A){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var l=["","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"],c=[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],d=[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];o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,a=0;a>>24-n&16777215)||a!==this.length-1?l[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=c[t],f=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(f).toString(t);r=(p=p.idivn(f)).isZero()?m+r:l[u-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(a,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function p(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,h=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(a=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r._strip()}o.prototype.toArrayLike=function(t,e,r){this._strip();var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0");var a=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](a,n),a},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,i=0,n=0,o=0;n>8&255),r>16&255),6===o?(r>24&255),i=0,o=0):(i=a>>>24,o+=2)}if(r=0&&(t[r--]=a>>8&255),r>=0&&(t[r--]=a>>16&255),6===o?(r>=0&&(t[r--]=a>>24&255),i=0,o=0):(i=a>>>24,o+=2)}if(r>=0)for(t[r--]=i;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"===typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,g=0|a[2],y=8191&g,b=g>>>13,v=0|a[3],_=8191&v,w=v>>>13,M=0|a[4],S=8191&M,E=M>>>13,k=0|a[5],R=8191&k,A=k>>>13,B=0|a[6],T=8191&B,x=B>>>13,D=0|a[7],O=8191&D,j=D>>>13,I=0|a[8],C=8191&I,P=I>>>13,L=0|a[9],U=8191&L,N=L>>>13,q=0|s[0],K=8191&q,H=q>>>13,F=0|s[1],W=8191&F,z=F>>>13,V=0|s[2],G=8191&V,Z=V>>>13,X=0|s[3],Y=8191&X,J=X>>>13,$=0|s[4],Q=8191&$,tt=$>>>13,et=0|s[5],rt=8191&et,it=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],ht=8191&st,ut=st>>>13,ft=0|s[8],lt=8191&ft,ct=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(u+(i=Math.imul(l,K))|0)+((8191&(n=(n=Math.imul(l,H))+Math.imul(c,K)|0))<<13)|0;u=((o=Math.imul(c,H))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(p,K),n=(n=Math.imul(p,H))+Math.imul(m,K)|0,o=Math.imul(m,H);var yt=(u+(i=i+Math.imul(l,W)|0)|0)+((8191&(n=(n=n+Math.imul(l,z)|0)+Math.imul(c,W)|0))<<13)|0;u=((o=o+Math.imul(c,z)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(y,K),n=(n=Math.imul(y,H))+Math.imul(b,K)|0,o=Math.imul(b,H),i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,z)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,z)|0;var bt=(u+(i=i+Math.imul(l,G)|0)|0)+((8191&(n=(n=n+Math.imul(l,Z)|0)+Math.imul(c,G)|0))<<13)|0;u=((o=o+Math.imul(c,Z)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(_,K),n=(n=Math.imul(_,H))+Math.imul(w,K)|0,o=Math.imul(w,H),i=i+Math.imul(y,W)|0,n=(n=n+Math.imul(y,z)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,z)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,Z)|0;var vt=(u+(i=i+Math.imul(l,Y)|0)|0)+((8191&(n=(n=n+Math.imul(l,J)|0)+Math.imul(c,Y)|0))<<13)|0;u=((o=o+Math.imul(c,J)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(S,K),n=(n=Math.imul(S,H))+Math.imul(E,K)|0,o=Math.imul(E,H),i=i+Math.imul(_,W)|0,n=(n=n+Math.imul(_,z)|0)+Math.imul(w,W)|0,o=o+Math.imul(w,z)|0,i=i+Math.imul(y,G)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,Z)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,J)|0;var _t=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(R,K),n=(n=Math.imul(R,H))+Math.imul(A,K)|0,o=Math.imul(A,H),i=i+Math.imul(S,W)|0,n=(n=n+Math.imul(S,z)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,z)|0,i=i+Math.imul(_,G)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,Z)|0,i=i+Math.imul(y,Y)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var wt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(T,K),n=(n=Math.imul(T,H))+Math.imul(x,K)|0,o=Math.imul(x,H),i=i+Math.imul(R,W)|0,n=(n=n+Math.imul(R,z)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,z)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,J)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,J)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var Mt=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,at)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,at)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,K),n=(n=Math.imul(O,H))+Math.imul(j,K)|0,o=Math.imul(j,H),i=i+Math.imul(T,W)|0,n=(n=n+Math.imul(T,z)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,z)|0,i=i+Math.imul(R,G)|0,n=(n=n+Math.imul(R,Z)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,Z)|0,i=i+Math.imul(S,Y)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,i=i+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,it)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(C,K),n=(n=Math.imul(C,H))+Math.imul(P,K)|0,o=Math.imul(P,H),i=i+Math.imul(O,W)|0,n=(n=n+Math.imul(O,z)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,z)|0,i=i+Math.imul(T,G)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,Z)|0,i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,J)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(_,rt)|0,n=(n=n+Math.imul(_,it)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,it)|0,i=i+Math.imul(y,ot)|0,n=(n=n+Math.imul(y,at)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,at)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var Et=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(U,K),n=(n=Math.imul(U,H))+Math.imul(N,K)|0,o=Math.imul(N,H),i=i+Math.imul(C,W)|0,n=(n=n+Math.imul(C,z)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,z)|0,i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(j,G)|0,o=o+Math.imul(j,Z)|0,i=i+Math.imul(T,Y)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(_,ot)|0,n=(n=n+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,i=i+Math.imul(y,ht)|0,n=(n=n+Math.imul(y,ut)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(U,W),n=(n=Math.imul(U,z))+Math.imul(N,W)|0,o=Math.imul(N,z),i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,Z)|0,i=i+Math.imul(O,Y)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,J)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(R,rt)|0,n=(n=n+Math.imul(R,it)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,at)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,at)|0,i=i+Math.imul(_,ht)|0,n=(n=n+Math.imul(_,ut)|0)+Math.imul(w,ht)|0,o=o+Math.imul(w,ut)|0,i=i+Math.imul(y,lt)|0,n=(n=n+Math.imul(y,ct)|0)+Math.imul(b,lt)|0,o=o+Math.imul(b,ct)|0;var Rt=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(U,G),n=(n=Math.imul(U,Z))+Math.imul(N,G)|0,o=Math.imul(N,Z),i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,J)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(R,ot)|0,n=(n=n+Math.imul(R,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(_,lt)|0,n=(n=n+Math.imul(_,ct)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,ct)|0;var At=(u+(i=i+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,mt)|0)+Math.imul(b,pt)|0))<<13)|0;u=((o=o+Math.imul(b,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(U,Y),n=(n=Math.imul(U,J))+Math.imul(N,Y)|0,o=Math.imul(N,J),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,i=i+Math.imul(R,ht)|0,n=(n=n+Math.imul(R,ut)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Bt=(u+(i=i+Math.imul(_,pt)|0)|0)+((8191&(n=(n=n+Math.imul(_,mt)|0)+Math.imul(w,pt)|0))<<13)|0;u=((o=o+Math.imul(w,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(U,Q),n=(n=Math.imul(U,tt))+Math.imul(N,Q)|0,o=Math.imul(N,tt),i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(R,lt)|0,n=(n=n+Math.imul(R,ct)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,ct)|0;var Tt=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(U,rt),n=(n=Math.imul(U,it))+Math.imul(N,rt)|0,o=Math.imul(N,it),i=i+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var xt=(u+(i=i+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,mt)|0)+Math.imul(A,pt)|0))<<13)|0;u=((o=o+Math.imul(A,mt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(U,ot),n=(n=Math.imul(U,at))+Math.imul(N,ot)|0,o=Math.imul(N,at),i=i+Math.imul(C,ht)|0,n=(n=n+Math.imul(C,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var Dt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,i=Math.imul(U,ht),n=(n=Math.imul(U,ut))+Math.imul(N,ht)|0,o=Math.imul(N,ut),i=i+Math.imul(C,lt)|0,n=(n=n+Math.imul(C,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Ot=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(U,lt),n=(n=Math.imul(U,ct))+Math.imul(N,lt)|0,o=Math.imul(N,ct);var jt=(u+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var It=(u+(i=Math.imul(U,pt))|0)+((8191&(n=(n=Math.imul(U,mt))+Math.imul(N,pt)|0))<<13)|0;return u=((o=Math.imul(N,mt))+(n>>>13)|0)+(It>>>26)|0,It&=67108863,h[0]=gt,h[1]=yt,h[2]=bt,h[3]=vt,h[4]=_t,h[5]=wt,h[6]=Mt,h[7]=St,h[8]=Et,h[9]=kt,h[10]=Rt,h[11]=At,h[12]=Bt,h[13]=Tt,h[14]=xt,h[15]=Dt,h[16]=Ot,h[17]=jt,h[18]=It,0!==u&&(h[19]=u,r.length++),r};function g(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function y(t,e,r){return g(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(m=p),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):r<63?p(this,t,e):r<1024?g(this,t,e):y(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},b.prototype.permute=function(t,e,r,i,n,o){for(var a=0;a>>=1)n++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,r+=o/67108864|0,r+=a>>>26,this.words[n]=67108863&a}return 0!==r&&(this.words[n]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&s}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"===typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===s)return this._strip();for(i(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var s,h=i.length-n.length;if("mod"!==e){(s=new o(null)).length=h+1,s.words=new Array(s.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/a|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);s&&(s.words[l]=c)}return s&&s._strip(),i._strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:s||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:n,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var n,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=(1<<26)%t,n=0,o=this.length-1;o>=0;o--)n=(r*n+(0|this.words[o]))%t;return e?-n:n},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*r;this.words[n]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),a=new o(0),s=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0===(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(f),a.isub(l)),n.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||h.isOdd())&&(s.iadd(f),h.isub(l)),s.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(s),a.isub(h)):(r.isub(e),s.isub(n),h.isub(a))}return{a:s,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,a=new o(1),s=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0===(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);for(var l=0,c=1;0===(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(n=0===e.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"===typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new k(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function _(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function R(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}_.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},_.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(t,e){t.iushrn(this.n,0,e)},_.prototype.imulK=function(t){return t.imul(this.k)},n(w,_),w.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new M;else if("p192"===t)e=new S;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return v[t]=e,e},k.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){i(0===(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(u(t,t.umod(this.m)._forceRed(this)),t)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);i(!n.isZero());var s=new o(1).toRed(this),h=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=a;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();i(g=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===i&&0===f)&&(n=this.mul(n,r[a]),s=0,a=0)):s=0}h=26}return n},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new R(t)},n(R,k),R.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},R.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},R.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},R.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},R.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(99)(t))},793:function(t,e,r){"use strict";var i=e;i.bignum=r(126),i.define=r(846).define,i.base=r(849),i.constants=r(850),i.decoders=r(796),i.encoders=r(794)},794:function(t,e,r){"use strict";var i=e;i.der=r(795),i.pem=r(847)},795:function(t,e,r){"use strict";var i=r(98),n=r(755).Buffer,o=r(756),a=r(758);function s(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new h,this.tree._init(t.body)}function h(t){o.call(this,"der",t)}function u(t){return t<10?"0"+t:t}t.exports=s,s.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},i(h,o),h.prototype._encodeComposite=function(t,e,r,i){var o=function(t,e,r,i){var n;"seqof"===t?t="seq":"setof"===t&&(t="set");if(a.tagByName.hasOwnProperty(t))n=a.tagByName[t];else{if("number"!==typeof t||(0|t)!==t)return i.error("Unknown tag: "+t);n=t}if(n>=31)return i.error("Multi-octet tag encoding unsupported");e||(n|=32);return n|=a.tagClassByName[r||"universal"]<<6}(t,e,r,this.reporter);if(i.length<128){var s=n.alloc(2);return s[0]=o,s[1]=i.length,this._createEncoderBuffer([s,i])}for(var h=1,u=i.length;u>=256;u>>=8)h++;var f=n.alloc(2+h);f[0]=o,f[1]=128|h;for(var l=1+h,c=i.length;c>0;l--,c>>=8)f[l]=255&c;return this._createEncoderBuffer([f,i])},h.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){for(var r=n.alloc(2*t.length),i=0;i=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}for(var a=0,s=0;s=128;h>>=7)a++}for(var u=n.alloc(a),f=u.length-1,l=t.length-1;l>=0;l--){var c=t[l];for(u[f--]=127&c;(c>>=7)>0;)u[f--]=128|127&c}return this._createEncoderBuffer(u)},h.prototype._encodeTime=function(t,e){var r,i=new Date(t);return"gentime"===e?r=[u(i.getUTCFullYear()),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[u(i.getUTCFullYear()%100),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},h.prototype._encodeNull=function(){return this._createEncoderBuffer("")},h.prototype._encodeInt=function(t,e){if("string"===typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!==typeof t&&!n.isBuffer(t)){var r=t.toArray();!t.sign&&128&r[0]&&r.unshift(0),t=n.from(r)}if(n.isBuffer(t)){var i=t.length;0===t.length&&i++;var o=n.alloc(i);return t.copy(o),0===t.length&&(o[0]=0),this._createEncoderBuffer(o)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);for(var a=1,s=t;s>=256;s>>=8)a++;for(var h=new Array(a),u=h.length-1;u>=0;u--)h[u]=255&t,t>>=8;return 128&h[0]&&h.unshift(0),this._createEncoderBuffer(n.from(h))},h.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},h.prototype._use=function(t,e){return"function"===typeof t&&(t=t(e)),t._getEncoder("der").tree},h.prototype._skipDefault=function(t,e,r){var i,n=this._baseState;if(null===n.default)return!1;var o=t.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,e,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;i>6],n=0===(32&r);if(31===(31&r)){var o=r;for(r=0;128===(128&o);){if(o=t.readUInt8(e),t.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:s.tag[r]}}function l(t,e,r){var i=t.readUInt8(r);if(t.isError(i))return i;if(!e&&128===i)return null;if(0===(128&i))return i;var n=127&i;if(n>4)return t.error("length octect is too long");i=0;for(var o=0;o0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return a.alloc(0);for(var e,r,i,n=a.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=o.data,r=n,i=s,a.prototype.copy.call(e,r,i),s+=o.data.length,o=o.next;return n}},{key:"consume",value:function(t,e){var r;return tn.length?n.length:t;if(o===n.length?i+=n:i+=n.slice(0,t),0===(t-=o)){o===n.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=n.slice(o));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(t){var e=a.allocUnsafe(t),r=this.head,i=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var n=r.data,o=t>n.length?n.length:t;if(n.copy(e,e.length-t,0,o),0===(t-=o)){o===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(o));break}++i}return this.length-=i,e}},{key:h,value:function(t,e){return s(this,function(t){for(var e=1;e0,(function(t){i||(i=t),t&&a.forEach(u),o||(a.forEach(u),n(i))}))}));return e.reduce(f)}},811:function(t,e,r){var i=r(98),n=r(729),o=r(370).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function h(){this.init(),this._w=s,n.call(this,64,56)}function u(t){return t<<30|t>>>2}function f(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}i(h,n),h.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},h.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,s=0|this._d,h=0|this._e,l=0;l<16;++l)r[l]=t.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var c=0;c<80;++c){var d=~~(c/20),p=0|((e=i)<<5|e>>>27)+f(d,n,o,s)+h+r[c]+a[d];h=s,s=o,o=u(n),n=i,i=p}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=h+this._e|0},h.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=h},812:function(t,e,r){var i=r(98),n=r(729),o=r(370).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function h(){this.init(),this._w=s,n.call(this,64,56)}function u(t){return t<<5|t>>>27}function f(t){return t<<30|t>>>2}function l(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}i(h,n),h.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},h.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,s=0|this._d,h=0|this._e,c=0;c<16;++c)r[c]=t.readInt32BE(4*c);for(;c<80;++c)r[c]=(e=r[c-3]^r[c-8]^r[c-14]^r[c-16])<<1|e>>>31;for(var d=0;d<80;++d){var p=~~(d/20),m=u(i)+l(p,n,o,s)+h+r[d]+a[p]|0;h=s,s=o,o=f(n),n=i,i=m}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=h+this._e|0},h.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=h},813:function(t,e,r){var i=r(98),n=r(767),o=r(729),a=r(370).Buffer,s=new Array(64);function h(){this.init(),this._w=s,o.call(this,64,56)}i(h,n),h.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},h.prototype._hash=function(){var t=a.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=h},814:function(t,e,r){var i=r(98),n=r(768),o=r(729),a=r(370).Buffer,s=new Array(160);function h(){this.init(),this._w=s,o.call(this,128,112)}i(h,n),h.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},h.prototype._hash=function(){var t=a.allocUnsafe(48);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=h},815:function(t,e,r){"use strict";var i=r(98),n=r(370).Buffer,o=r(723),a=n.alloc(128);function s(t,e){o.call(this,"digest"),"string"===typeof e&&(e=n.from(e)),this._alg=t,this._key=e,e.length>64?e=t(e):e.length<64&&(e=n.concat([e,a],64));for(var r=this._ipad=n.allocUnsafe(64),i=this._opad=n.allocUnsafe(64),s=0;s<64;s++)r[s]=54^e[s],i[s]=92^e[s];this._hash=[r]}i(s,o),s.prototype._update=function(t){this._hash.push(t)},s.prototype._final=function(){var t=this._alg(n.concat(this._hash));return this._alg(n.concat([this._opad,t]))},t.exports=s},816:function(t,e,r){t.exports=r(771)},817:function(t,e,r){(function(e,i){var n,o=r(370).Buffer,a=r(773),s=r(774),h=r(775),u=r(776),f=e.crypto&&e.crypto.subtle,l={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},c=[];function d(t,e,r,i,n){return f.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then((function(t){return f.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:n}},t,i<<3)})).then((function(t){return o.from(t)}))}t.exports=function(t,r,p,m,g,y){"function"===typeof g&&(y=g,g=void 0);var b=l[(g=g||"sha1").toLowerCase()];if(!b||"function"!==typeof e.Promise)return i.nextTick((function(){var e;try{e=h(t,r,p,m,g)}catch(i){return y(i)}y(null,e)}));if(a(p,m),t=u(t,s,"Password"),r=u(r,s,"Salt"),"function"!==typeof y)throw new Error("No callback provided to pbkdf2");!function(t,e){t.then((function(t){i.nextTick((function(){e(null,t)}))}),(function(t){i.nextTick((function(){e(t)}))}))}(function(t){if(e.process&&!e.process.browser)return Promise.resolve(!1);if(!f||!f.importKey||!f.deriveBits)return Promise.resolve(!1);if(void 0!==c[t])return c[t];var r=d(n=n||o.alloc(8),n,10,128,t).then((function(){return!0})).catch((function(){return!1}));return c[t]=r,r}(b).then((function(e){return e?d(t,r,p,m,b):h(t,r,p,m,g)})),y)}}).call(this,r(71),r(90))},818:function(t,e,r){var i=r(819),n=r(751),o=r(752),a=r(832),s=r(739);function h(t,e,r){if(t=t.toLowerCase(),o[t])return n.createCipheriv(t,e,r);if(a[t])return new i({key:e,iv:r,mode:t});throw new TypeError("invalid suite type")}function u(t,e,r){if(t=t.toLowerCase(),o[t])return n.createDecipheriv(t,e,r);if(a[t])return new i({key:e,iv:r,mode:t,decrypt:!0});throw new TypeError("invalid suite type")}e.createCipher=e.Cipher=function(t,e){var r,i;if(t=t.toLowerCase(),o[t])r=o[t].key,i=o[t].iv;else{if(!a[t])throw new TypeError("invalid suite type");r=8*a[t].key,i=a[t].iv}var n=s(e,!1,r,i);return h(t,n.key,n.iv)},e.createCipheriv=e.Cipheriv=h,e.createDecipher=e.Decipher=function(t,e){var r,i;if(t=t.toLowerCase(),o[t])r=o[t].key,i=o[t].iv;else{if(!a[t])throw new TypeError("invalid suite type");r=8*a[t].key,i=a[t].iv}var n=s(e,!1,r,i);return u(t,n.key,n.iv)},e.createDecipheriv=e.Decipheriv=u,e.listCiphers=e.getCiphers=function(){return Object.keys(a).concat(n.getCiphers())}},819:function(t,e,r){var i=r(723),n=r(820),o=r(98),a=r(370).Buffer,s={"des-ede3-cbc":n.CBC.instantiate(n.EDE),"des-ede3":n.EDE,"des-ede-cbc":n.CBC.instantiate(n.EDE),"des-ede":n.EDE,"des-cbc":n.CBC.instantiate(n.DES),"des-ecb":n.DES};function h(t){i.call(this);var e,r=t.mode.toLowerCase(),n=s[r];e=t.decrypt?"decrypt":"encrypt";var o=t.key;a.isBuffer(o)||(o=a.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=a.concat([o,o.slice(0,8)]));var h=t.iv;a.isBuffer(h)||(h=a.from(h)),this._des=n.create({key:o,iv:h,type:e})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],t.exports=h,o(h,i),h.prototype._update=function(t){return a.from(this._des.update(t))},h.prototype._final=function(){return a.from(this._des.final())}},820:function(t,e,r){"use strict";e.utils=r(777),e.Cipher=r(750),e.DES=r(778),e.CBC=r(821),e.EDE=r(822)},821:function(t,e,r){"use strict";var i=r(159),n=r(98),o={};function a(t){i.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},c.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),r=-1;++r>a%8,t._prev=o(t._prev,r?i:n);return s}function o(t,e){var r=t.length,n=-1,o=i.allocUnsafe(t.length);for(t=i.concat([t,i.from([e])]);++n>7;return o}e.encrypt=function(t,e,r){for(var o=e.length,a=i.allocUnsafe(o),s=-1;++s>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function a(t){this.h=t,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(t){for(var e=-1;++e0;e--)i[e]=i[e]>>>1|(1&i[e-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=o(n)},a.prototype.update=function(t){var e;for(this.cache=i.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},a.prototype.final=function(t,e){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,t,0,e])),this.state},t.exports=a},831:function(t,e,r){var i=r(782),n=r(370).Buffer,o=r(752),a=r(783),s=r(723),h=r(738),u=r(739);function f(t,e,r){s.call(this),this._cache=new l,this._last=void 0,this._cipher=new h.AES(e),this._prev=n.from(r),this._mode=t,this._autopadding=!0}function l(){this.cache=n.allocUnsafe(0)}function c(t,e,r){var s=o[t.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"===typeof r&&(r=n.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);if("string"===typeof e&&(e=n.from(e)),e.length!==s.key/8)throw new TypeError("invalid key length "+e.length);return"stream"===s.type?new a(s.module,e,r,!0):"auth"===s.type?new i(s.module,e,r,!0):new f(s.module,e,r)}r(98)(f,s),f.prototype._update=function(t){var e,r;this._cache.add(t);for(var i=[];e=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,e),i.push(r);return n.concat(i)},f.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");var r=-1;for(;++r16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},e.createDecipher=function(t,e){var r=o[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=u(e,!1,r.key,r.iv);return c(t,i.key,i.iv)},e.createDecipheriv=c},832:function(t,e){e["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}},833:function(t,e,r){(function(t){var i=r(784),n=r(834),o=r(835);var a={binary:!0,hex:!0,base64:!0};e.DiffieHellmanGroup=e.createDiffieHellmanGroup=e.getDiffieHellman=function(e){var r=new t(n[e].prime,"hex"),i=new t(n[e].gen,"hex");return new o(r,i)},e.createDiffieHellman=e.DiffieHellman=function e(r,n,s,h){return t.isBuffer(n)||void 0===a[n]?e(r,"binary",n,s):(n=n||"binary",h=h||"binary",s=s||new t([2]),t.isBuffer(s)||(s=new t(s,h)),"number"===typeof r?new o(i(r,s),s,!0):(t.isBuffer(r)||(r=new t(r,n)),new o(r,s,!0)))}}).call(this,r(52).Buffer)},834:function(t){t.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},835:function(t,e,r){(function(e){var i=r(126),n=new(r(785)),o=new i(24),a=new i(11),s=new i(10),h=new i(3),u=new i(7),f=r(784),l=r(725);function c(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this._pub=new i(t),this}function d(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this._priv=new i(t),this}t.exports=m;var p={};function m(t,e,r){this.setGenerator(e),this.__prime=new i(t),this._prime=i.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=c,this.setPrivateKey=d):this._primeCode=8}function g(t,r){var i=new e(t.toArray());return r?i.toString(r):i}Object.defineProperty(m.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!==typeof this._primeCode&&(this._primeCode=function(t,e){var r=e.toString("hex"),i=[r,t.toString(16)].join("_");if(i in p)return p[i];var l,c=0;if(t.isEven()||!f.simpleSieve||!f.fermatTest(t)||!n.test(t))return c+=1,c+="02"===r||"05"===r?8:4,p[i]=c,c;switch(n.test(t.shrn(1))||(c+=2),r){case"02":t.mod(o).cmp(a)&&(c+=8);break;case"05":(l=t.mod(s)).cmp(h)&&l.cmp(u)&&(c+=8);break;default:c+=4}return p[i]=c,c}(this.__prime,this.__gen)),this._primeCode}}),m.prototype.generateKeys=function(){return this._priv||(this._priv=new i(l(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},m.prototype.computeSecret=function(t){var r=(t=(t=new i(t)).toRed(this._prime)).redPow(this._priv).fromRed(),n=new e(r.toArray()),o=this.getPrime();if(n.length0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return a.alloc(0);for(var e,r,i,n=a.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=o.data,r=n,i=s,a.prototype.copy.call(e,r,i),s+=o.data.length,o=o.next;return n}},{key:"consume",value:function(t,e){var r;return tn.length?n.length:t;if(o===n.length?i+=n:i+=n.slice(0,t),0===(t-=o)){o===n.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=n.slice(o));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(t){var e=a.allocUnsafe(t),r=this.head,i=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var n=r.data,o=t>n.length?n.length:t;if(n.copy(e,e.length-t,0,o),0===(t-=o)){o===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(o));break}++i}return this.length-=i,e}},{key:h,value:function(t,e){return s(this,function(t){for(var e=1;e0,(function(t){i||(i=t),t&&a.forEach(u),o||(a.forEach(u),n(i))}))}));return e.reduce(f)}},843:function(t,e,r){var i=r(370).Buffer,n=r(769),o=r(754),a=r(327).ec,s=r(792),h=r(744),u=r(798);function f(t,e,r,o){if((t=i.from(t.toArray())).length0&&r.ishrn(i),r}function c(t,e,r){var o,a;do{for(o=i.alloc(0);8*o.length=49&&u<=54?u-49+10:u>=17&&u<=22?u-17+10:u,a|=h}return i(!(240&a),"Invalid character in "+t),n}function h(t,e,r,n){for(var o=0,a=0,s=Math.min(t.length,r),h=e;h=49?u-49+10:u>=17?u-17+10:u,i(u>=0&&a0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this._strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)a=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=s(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=s(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,a=o%i,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(A){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var l=["","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"],c=[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],d=[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];o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,a=0;a>>24-n&16777215)||a!==this.length-1?l[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=c[t],f=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(f).toString(t);r=(p=p.idivn(f)).isZero()?m+r:l[u-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(a,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function p(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,h=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(a=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r._strip()}o.prototype.toArrayLike=function(t,e,r){this._strip();var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0");var a=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](a,n),a},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,i=0,n=0,o=0;n>8&255),r>16&255),6===o?(r>24&255),i=0,o=0):(i=a>>>24,o+=2)}if(r=0&&(t[r--]=a>>8&255),r>=0&&(t[r--]=a>>16&255),6===o?(r>=0&&(t[r--]=a>>24&255),i=0,o=0):(i=a>>>24,o+=2)}if(r>=0)for(t[r--]=i;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"===typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,g=0|a[2],y=8191&g,b=g>>>13,v=0|a[3],_=8191&v,w=v>>>13,M=0|a[4],S=8191&M,E=M>>>13,k=0|a[5],R=8191&k,A=k>>>13,B=0|a[6],T=8191&B,x=B>>>13,D=0|a[7],O=8191&D,j=D>>>13,I=0|a[8],C=8191&I,P=I>>>13,L=0|a[9],U=8191&L,N=L>>>13,q=0|s[0],K=8191&q,H=q>>>13,F=0|s[1],W=8191&F,z=F>>>13,V=0|s[2],G=8191&V,Z=V>>>13,X=0|s[3],Y=8191&X,J=X>>>13,$=0|s[4],Q=8191&$,tt=$>>>13,et=0|s[5],rt=8191&et,it=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],ht=8191&st,ut=st>>>13,ft=0|s[8],lt=8191&ft,ct=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(u+(i=Math.imul(l,K))|0)+((8191&(n=(n=Math.imul(l,H))+Math.imul(c,K)|0))<<13)|0;u=((o=Math.imul(c,H))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(p,K),n=(n=Math.imul(p,H))+Math.imul(m,K)|0,o=Math.imul(m,H);var yt=(u+(i=i+Math.imul(l,W)|0)|0)+((8191&(n=(n=n+Math.imul(l,z)|0)+Math.imul(c,W)|0))<<13)|0;u=((o=o+Math.imul(c,z)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(y,K),n=(n=Math.imul(y,H))+Math.imul(b,K)|0,o=Math.imul(b,H),i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,z)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,z)|0;var bt=(u+(i=i+Math.imul(l,G)|0)|0)+((8191&(n=(n=n+Math.imul(l,Z)|0)+Math.imul(c,G)|0))<<13)|0;u=((o=o+Math.imul(c,Z)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(_,K),n=(n=Math.imul(_,H))+Math.imul(w,K)|0,o=Math.imul(w,H),i=i+Math.imul(y,W)|0,n=(n=n+Math.imul(y,z)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,z)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,Z)|0;var vt=(u+(i=i+Math.imul(l,Y)|0)|0)+((8191&(n=(n=n+Math.imul(l,J)|0)+Math.imul(c,Y)|0))<<13)|0;u=((o=o+Math.imul(c,J)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(S,K),n=(n=Math.imul(S,H))+Math.imul(E,K)|0,o=Math.imul(E,H),i=i+Math.imul(_,W)|0,n=(n=n+Math.imul(_,z)|0)+Math.imul(w,W)|0,o=o+Math.imul(w,z)|0,i=i+Math.imul(y,G)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,Z)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,J)|0;var _t=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(R,K),n=(n=Math.imul(R,H))+Math.imul(A,K)|0,o=Math.imul(A,H),i=i+Math.imul(S,W)|0,n=(n=n+Math.imul(S,z)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,z)|0,i=i+Math.imul(_,G)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,Z)|0,i=i+Math.imul(y,Y)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var wt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(T,K),n=(n=Math.imul(T,H))+Math.imul(x,K)|0,o=Math.imul(x,H),i=i+Math.imul(R,W)|0,n=(n=n+Math.imul(R,z)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,z)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,J)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,J)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var Mt=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,at)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,at)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,K),n=(n=Math.imul(O,H))+Math.imul(j,K)|0,o=Math.imul(j,H),i=i+Math.imul(T,W)|0,n=(n=n+Math.imul(T,z)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,z)|0,i=i+Math.imul(R,G)|0,n=(n=n+Math.imul(R,Z)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,Z)|0,i=i+Math.imul(S,Y)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,i=i+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,it)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(C,K),n=(n=Math.imul(C,H))+Math.imul(P,K)|0,o=Math.imul(P,H),i=i+Math.imul(O,W)|0,n=(n=n+Math.imul(O,z)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,z)|0,i=i+Math.imul(T,G)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,Z)|0,i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,J)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(_,rt)|0,n=(n=n+Math.imul(_,it)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,it)|0,i=i+Math.imul(y,ot)|0,n=(n=n+Math.imul(y,at)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,at)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var Et=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(U,K),n=(n=Math.imul(U,H))+Math.imul(N,K)|0,o=Math.imul(N,H),i=i+Math.imul(C,W)|0,n=(n=n+Math.imul(C,z)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,z)|0,i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(j,G)|0,o=o+Math.imul(j,Z)|0,i=i+Math.imul(T,Y)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(_,ot)|0,n=(n=n+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,i=i+Math.imul(y,ht)|0,n=(n=n+Math.imul(y,ut)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(U,W),n=(n=Math.imul(U,z))+Math.imul(N,W)|0,o=Math.imul(N,z),i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,Z)|0,i=i+Math.imul(O,Y)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,J)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(R,rt)|0,n=(n=n+Math.imul(R,it)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,at)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,at)|0,i=i+Math.imul(_,ht)|0,n=(n=n+Math.imul(_,ut)|0)+Math.imul(w,ht)|0,o=o+Math.imul(w,ut)|0,i=i+Math.imul(y,lt)|0,n=(n=n+Math.imul(y,ct)|0)+Math.imul(b,lt)|0,o=o+Math.imul(b,ct)|0;var Rt=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(U,G),n=(n=Math.imul(U,Z))+Math.imul(N,G)|0,o=Math.imul(N,Z),i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,J)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(R,ot)|0,n=(n=n+Math.imul(R,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(_,lt)|0,n=(n=n+Math.imul(_,ct)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,ct)|0;var At=(u+(i=i+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,mt)|0)+Math.imul(b,pt)|0))<<13)|0;u=((o=o+Math.imul(b,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(U,Y),n=(n=Math.imul(U,J))+Math.imul(N,Y)|0,o=Math.imul(N,J),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,i=i+Math.imul(R,ht)|0,n=(n=n+Math.imul(R,ut)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Bt=(u+(i=i+Math.imul(_,pt)|0)|0)+((8191&(n=(n=n+Math.imul(_,mt)|0)+Math.imul(w,pt)|0))<<13)|0;u=((o=o+Math.imul(w,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(U,Q),n=(n=Math.imul(U,tt))+Math.imul(N,Q)|0,o=Math.imul(N,tt),i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(R,lt)|0,n=(n=n+Math.imul(R,ct)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,ct)|0;var Tt=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(U,rt),n=(n=Math.imul(U,it))+Math.imul(N,rt)|0,o=Math.imul(N,it),i=i+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var xt=(u+(i=i+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,mt)|0)+Math.imul(A,pt)|0))<<13)|0;u=((o=o+Math.imul(A,mt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(U,ot),n=(n=Math.imul(U,at))+Math.imul(N,ot)|0,o=Math.imul(N,at),i=i+Math.imul(C,ht)|0,n=(n=n+Math.imul(C,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var Dt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,i=Math.imul(U,ht),n=(n=Math.imul(U,ut))+Math.imul(N,ht)|0,o=Math.imul(N,ut),i=i+Math.imul(C,lt)|0,n=(n=n+Math.imul(C,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Ot=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(U,lt),n=(n=Math.imul(U,ct))+Math.imul(N,lt)|0,o=Math.imul(N,ct);var jt=(u+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var It=(u+(i=Math.imul(U,pt))|0)+((8191&(n=(n=Math.imul(U,mt))+Math.imul(N,pt)|0))<<13)|0;return u=((o=Math.imul(N,mt))+(n>>>13)|0)+(It>>>26)|0,It&=67108863,h[0]=gt,h[1]=yt,h[2]=bt,h[3]=vt,h[4]=_t,h[5]=wt,h[6]=Mt,h[7]=St,h[8]=Et,h[9]=kt,h[10]=Rt,h[11]=At,h[12]=Bt,h[13]=Tt,h[14]=xt,h[15]=Dt,h[16]=Ot,h[17]=jt,h[18]=It,0!==u&&(h[19]=u,r.length++),r};function g(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function y(t,e,r){return g(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(m=p),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):r<63?p(this,t,e):r<1024?g(this,t,e):y(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},b.prototype.permute=function(t,e,r,i,n,o){for(var a=0;a>>=1)n++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,r+=o/67108864|0,r+=a>>>26,this.words[n]=67108863&a}return 0!==r&&(this.words[n]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&s}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"===typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===s)return this._strip();for(i(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var s,h=i.length-n.length;if("mod"!==e){(s=new o(null)).length=h+1,s.words=new Array(s.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/a|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);s&&(s.words[l]=c)}return s&&s._strip(),i._strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:s||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:n,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var n,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=(1<<26)%t,n=0,o=this.length-1;o>=0;o--)n=(r*n+(0|this.words[o]))%t;return e?-n:n},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*r;this.words[n]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),a=new o(0),s=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0===(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(f),a.isub(l)),n.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||h.isOdd())&&(s.iadd(f),h.isub(l)),s.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(s),a.isub(h)):(r.isub(e),s.isub(n),h.isub(a))}return{a:s,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,a=new o(1),s=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0===(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);for(var l=0,c=1;0===(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(n=0===e.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"===typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new k(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function _(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function R(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}_.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},_.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(t,e){t.iushrn(this.n,0,e)},_.prototype.imulK=function(t){return t.imul(this.k)},n(w,_),w.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new M;else if("p192"===t)e=new S;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return v[t]=e,e},k.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){i(0===(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(u(t,t.umod(this.m)._forceRed(this)),t)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);i(!n.isZero());var s=new o(1).toRed(this),h=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=a;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();i(g=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===i&&0===f)&&(n=this.mul(n,r[a]),s=0,a=0)):s=0}h=26}return n},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new R(t)},n(R,k),R.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},R.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},R.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},R.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},R.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(99)(t))},845:function(t,e,r){"use strict";var i=r(793);e.certificate=r(851);var n=i.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())}));e.RSAPrivateKey=n;var o=i.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));e.RSAPublicKey=o;var a=i.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())}));e.PublicKey=a;var s=i.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),h=i.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())}));e.PrivateKey=h;var u=i.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));e.EncryptedPrivateKey=u;var f=i.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));e.DSAPrivateKey=f,e.DSAparam=i.define("DSAparam",(function(){this.int()}));var l=i.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(c),this.key("publicKey").optional().explicit(1).bitstr())}));e.ECPrivateKey=l;var c=i.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));e.signature=i.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},846:function(t,e,r){"use strict";var i=r(794),n=r(796),o=r(98);function a(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}e.define=function(t,e){return new a(t,e)},a.prototype._createNamed=function(t){var e=this.name;function r(t){this._initNamed(t,e)}return o(r,t),r.prototype._initNamed=function(e,r){t.call(this,e,r)},new r(this)},a.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(n[t])),this.decoders[t]},a.prototype.decode=function(t,e,r){return this._getDecoder(e).decode(t,r)},a.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(i[t])),this.encoders[t]},a.prototype.encode=function(t,e,r){return this._getEncoder(e).encode(t,r)}},847:function(t,e,r){"use strict";var i=r(98),n=r(795);function o(t){n.call(this,t),this.enc="pem"}i(o,n),t.exports=o,o.prototype.encode=function(t,e){for(var r=n.prototype.encode.call(this,t).toString("base64"),i=["-----BEGIN "+e.label+"-----"],o=0;o=e)throw new Error("invalid sig")}t.exports=function(t,e,r,u,f){var l=a(r);if("ec"===l.type){if("ecdsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");return function(t,e,r){var i=s[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new o(i),a=r.data.subjectPrivateKey.data;return n.verify(e,t,a)}(t,e,l)}if("dsa"===l.type){if("dsa"!==u)throw new Error("wrong public key type");return function(t,e,r){var i=r.data.p,o=r.data.q,s=r.data.g,u=r.data.pub_key,f=a.signature.decode(t,"der"),l=f.s,c=f.r;h(l,o),h(c,o);var d=n.mont(i),p=l.invm(o);return 0===s.toRed(d).redPow(new n(e).mul(p).mod(o)).fromRed().mul(u.toRed(d).redPow(c.mul(p).mod(o)).fromRed()).mod(i).mod(o).cmp(c)}(t,e,l)}if("rsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");e=i.concat([f,e]);for(var c=l.modulus.byteLength(),d=[1],p=0;e.length+d.length+2r-c-2)throw new Error("message too long");var d=l.alloc(r-i-c-2),p=r-f-1,m=n(f),g=s(l.concat([u,d,l.alloc(1,1),e],p),a(m,p)),y=s(m,a(g,f));return new h(l.concat([l.alloc(1),y,g],r))}(p,e);else if(1===c)d=function(t,e,r){var i,o=e.length,a=t.modulus.byteLength();if(o>a-11)throw new Error("message too long");i=r?l.alloc(a-o-3,255):function(t){var e,r=l.allocUnsafe(t),i=0,o=n(2*t),a=0;for(;i=0)throw new Error("data too long for modulus")}return r?f(d,p):u(d,p)}},858:function(t,e,r){var i=r(744),n=r(799),o=r(800),a=r(126),s=r(754),h=r(726),u=r(801),f=r(370).Buffer;t.exports=function(t,e,r){var l;l=t.padding?t.padding:r?1:4;var c,d=i(t),p=d.modulus.byteLength();if(e.length>p||new a(e).cmp(d.modulus)>=0)throw new Error("decryption error");c=r?u(new a(e),d):s(e,d);var m=f.alloc(p-c.length);if(c=f.concat([m,c],p),4===l)return function(t,e){var r=t.modulus.byteLength(),i=h("sha1").update(f.alloc(0)).digest(),a=i.length;if(0!==e[0])throw new Error("decryption error");var s=e.slice(1,a+1),u=e.slice(a+1),l=o(s,n(u,a)),c=o(u,n(l,r-a-1));if(function(t,e){t=f.from(t),e=f.from(e);var r=0,i=t.length;t.length!==e.length&&(r++,i=Math.min(t.length,e.length));var n=-1;for(;++n=e.length){o++;break}var a=e.slice(2,n-1);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return e.slice(n)}(0,c,r);if(3===l)return c;throw new Error("unknown padding")}},859:function(t,e,r){"use strict";(function(t,i){function n(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=r(370),a=r(725),s=o.Buffer,h=o.kMaxLength,u=t.crypto||t.msCrypto,f=Math.pow(2,32)-1;function l(t,e){if("number"!==typeof t||t!==t)throw new TypeError("offset must be a number");if(t>f||t<0)throw new TypeError("offset must be a uint32");if(t>h||t>e)throw new RangeError("offset out of range")}function c(t,e,r){if("number"!==typeof t||t!==t)throw new TypeError("size must be a number");if(t>f||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>h)throw new RangeError("buffer too small")}function d(t,e,r,n){if(i.browser){var o=t.buffer,s=new Uint8Array(o,e,r);return u.getRandomValues(s),n?void i.nextTick((function(){n(null,t)})):t}if(!n)return a(r).copy(t,e),t;a(r,(function(r,i){if(r)return n(r);i.copy(t,e),n(null,t)}))}u&&u.getRandomValues||!i.browser?(e.randomFill=function(e,r,i,n){if(!s.isBuffer(e)&&!(e instanceof t.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"===typeof r)n=r,r=0,i=e.length;else if("function"===typeof i)n=i,i=e.length-r;else if("function"!==typeof n)throw new TypeError('"cb" argument must be a function');return l(r,e.length),c(i,r,e.length),d(e,r,i,n)},e.randomFillSync=function(e,r,i){"undefined"===typeof r&&(r=0);if(!s.isBuffer(e)&&!(e instanceof t.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');l(r,e.length),void 0===i&&(i=e.length-r);return c(i,r,e.length),d(e,r,i)}):(e.randomFill=n,e.randomFillSync=n)}).call(this,r(71),r(90))}}]); \ No newline at end of file +(this.webpackJsonpbridge=this.webpackJsonpbridge||[]).push([[0],{725:function(t,e,r){var i=r(372).Buffer,n=r(374).Transform,o=r(373).StringDecoder;function a(t){n.call(this),this.hashMode="string"===typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(98)(a,n),a.prototype.update=function(t,e,r){"string"===typeof t&&(t=i.from(t,e));var n=this._update(t);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(t,e,r){var i;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(n){i=n}finally{r(i)}},a.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(r){e=r}t(e)},a.prototype._finalOrDigest=function(t){var e=this.__final()||i.alloc(0);return t&&(e=this._toString(e,t,!0)),e},a.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var i=this._decoder.write(t);return r&&(i+=this._decoder.end()),i},t.exports=a},726:function(t,e,r){"use strict";e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=r(727),e.createHash=e.Hash=r(728),e.createHmac=e.Hmac=r(771);var i=r(818),n=Object.keys(i),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(n);e.getHashes=function(){return o};var a=r(774);e.pbkdf2=a.pbkdf2,e.pbkdf2Sync=a.pbkdf2Sync;var s=r(820);e.Cipher=s.Cipher,e.createCipher=s.createCipher,e.Cipheriv=s.Cipheriv,e.createCipheriv=s.createCipheriv,e.Decipher=s.Decipher,e.createDecipher=s.createDecipher,e.Decipheriv=s.Decipheriv,e.createDecipheriv=s.createDecipheriv,e.getCiphers=s.getCiphers,e.listCiphers=s.listCiphers;var h=r(835);e.DiffieHellmanGroup=h.DiffieHellmanGroup,e.createDiffieHellmanGroup=h.createDiffieHellmanGroup,e.getDiffieHellman=h.getDiffieHellman,e.createDiffieHellman=h.createDiffieHellman,e.DiffieHellman=h.DiffieHellman;var u=r(838);e.createSign=u.createSign,e.Sign=u.Sign,e.createVerify=u.createVerify,e.Verify=u.Verify,e.createECDH=r(857);var f=r(858);e.publicEncrypt=f.publicEncrypt,e.privateEncrypt=f.privateEncrypt,e.publicDecrypt=f.publicDecrypt,e.privateDecrypt=f.privateDecrypt;var l=r(861);e.randomFill=l.randomFill,e.randomFillSync=l.randomFillSync,e.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},727:function(t,e,r){"use strict";(function(e,i){var n=r(372).Buffer,o=e.crypto||e.msCrypto;o&&o.getRandomValues?t.exports=function(t,e){if(t>4294967295)throw new RangeError("requested too many random bytes");var r=n.allocUnsafe(t);if(t>0)if(t>65536)for(var a=0;a2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}n("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,n,a,s;if("string"===typeof e&&(n="not ",e.substr(!a||a<0?0:+a,n.length)===n)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(i," ").concat(o(e,"type"));else{var h=function(t,e,r){return"number"!==typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(h," ").concat(i," ").concat(o(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=i},730:function(t,e,r){"use strict";(function(e){var i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=u;var n=r(763),o=r(767);r(98)(u,n);for(var a=i(o.prototype),s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(4294967295&r)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=n},732:function(t,e,r){"use strict";var i={};function n(t,e,r){r||(r=Error);var n=function(t){var r,i;function n(r,i,n){return t.call(this,function(t,r,i){return"string"===typeof e?e:e(t,r,i)}(r,i,n))||this}return i=t,(r=n).prototype=Object.create(i.prototype),r.prototype.constructor=r,r.__proto__=i,n}(r);n.prototype.name=r.name,n.prototype.code=t,i[t]=n}function o(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}n("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,n,a,s;if("string"===typeof e&&(n="not ",e.substr(!a||a<0?0:+a,n.length)===n)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(i," ").concat(o(e,"type"));else{var h=function(t,e,r){return"number"!==typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(h," ").concat(i," ").concat(o(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=i},733:function(t,e,r){"use strict";(function(e){var i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=u;var n=r(788),o=r(792);r(98)(u,n);for(var a=i(o.prototype),s=0;s>>24]^f[p>>>16&255]^l[m>>>8&255]^c[255&g]^e[y++],a=u[p>>>24]^f[m>>>16&255]^l[g>>>8&255]^c[255&d]^e[y++],s=u[m>>>24]^f[g>>>16&255]^l[d>>>8&255]^c[255&p]^e[y++],h=u[g>>>24]^f[d>>>16&255]^l[p>>>8&255]^c[255&m]^e[y++],d=o,p=a,m=s,g=h;return o=(i[d>>>24]<<24|i[p>>>16&255]<<16|i[m>>>8&255]<<8|i[255&g])^e[y++],a=(i[p>>>24]<<24|i[m>>>16&255]<<16|i[g>>>8&255]<<8|i[255&d])^e[y++],s=(i[m>>>24]<<24|i[g>>>16&255]<<16|i[d>>>8&255]<<8|i[255&p])^e[y++],h=(i[g>>>24]<<24|i[d>>>16&255]<<16|i[p>>>8&255]<<8|i[255&m])^e[y++],[o>>>=0,a>>>=0,s>>>=0,h>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],h=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,h=0;h<256;++h){var u=s^s<<1^s<<2^s<<3^s<<4;u=u>>>8^255&u^99,r[a]=u,i[u]=a;var f=t[a],l=t[f],c=t[l],d=257*t[u]^16843008*u;n[0][a]=d<<24|d>>>8,n[1][a]=d<<16|d>>>16,n[2][a]=d<<8|d>>>24,n[3][a]=d,d=16843009*c^65537*l^257*f^16843008*a,o[0][u]=d<<24|d>>>8,o[1][u]=d<<16|d>>>16,o[2][u]=d<<8|d>>>24,o[3][u]=d,0===a?a=s=1:(a=f^t[t[t[c^f]]],s^=t[t[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}}();function u(t){this._key=n(t),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,i=4*(r+1),n=[],o=0;o>>24,a=h.SBOX[a>>>24]<<24|h.SBOX[a>>>16&255]<<16|h.SBOX[a>>>8&255]<<8|h.SBOX[255&a],a^=s[o/e|0]<<24):e>6&&o%e===4&&(a=h.SBOX[a>>>24]<<24|h.SBOX[a>>>16&255]<<16|h.SBOX[a>>>8&255]<<8|h.SBOX[255&a]),n[o]=n[o-e]^a}for(var u=[],f=0;f>>24]]^h.INV_SUB_MIX[1][h.SBOX[c>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[c>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&c]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=u},u.prototype.encryptBlockRaw=function(t){return a(t=n(t),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},u.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=i.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},u.prototype.decryptBlock=function(t){var e=(t=n(t))[1];t[1]=t[3],t[3]=e;var r=a(t,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),o=i.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},u.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=u},741:function(t,e,r){var i=r(372).Buffer,n=r(748);t.exports=function(t,e,r,o){if(i.isBuffer(t)||(t=i.from(t,"binary")),e&&(i.isBuffer(e)||(e=i.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=r/8,s=i.alloc(a),h=i.alloc(o||0),u=i.alloc(0);a>0||o>0;){var f=new n;f.update(u),f.update(t),e&&f.update(e),u=f.digest();var l=0;if(a>0){var c=s.length-a;l=Math.min(a,u.length),u.copy(s,c,0,l),a-=l}if(l0){var d=h.length-o,p=Math.min(o,u.length-l);u.copy(h,d,l,l+p),o-=p}}return u.fill(0),{key:s,iv:h}}},746:function(t,e,r){var i=r(847),n=r(854),o=r(855),a=r(753),s=r(774),h=r(372).Buffer;function u(t){var e;"object"!==typeof t||h.isBuffer(t)||(e=t.passphrase,t=t.key),"string"===typeof t&&(t=h.from(t));var r,u,f=o(t,e),l=f.tag,c=f.data;switch(l){case"CERTIFICATE":u=i.certificate.decode(c,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(u||(u=i.PublicKey.decode(c,"der")),r=u.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPublicKey.decode(u.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return u.subjectPrivateKey=u.subjectPublicKey,{type:"ec",data:u};case"1.2.840.10040.4.1":return u.algorithm.params.pub_key=i.DSAparam.decode(u.subjectPublicKey.data,"der"),{type:"dsa",data:u.algorithm.params};default:throw new Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":c=function(t,e){var r=t.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=n[t.algorithm.decrypt.cipher.algo.join(".")],u=t.algorithm.decrypt.cipher.iv,f=t.subjectPrivateKey,l=parseInt(o.split("-")[1],10)/8,c=s.pbkdf2Sync(e,r,i,l,"sha1"),d=a.createDecipheriv(o,c,u),p=[];return p.push(d.update(f)),p.push(d.final()),h.concat(p)}(c=i.EncryptedPrivateKey.decode(c,"der"),e);case"PRIVATE KEY":switch(r=(u=i.PrivateKey.decode(c,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPrivateKey.decode(u.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:u.algorithm.curve,privateKey:i.ECPrivateKey.decode(u.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return u.algorithm.params.priv_key=i.DSAparam.decode(u.subjectPrivateKey,"der"),{type:"dsa",params:u.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return i.RSAPublicKey.decode(c,"der");case"RSA PRIVATE KEY":return i.RSAPrivateKey.decode(c,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:i.DSAPrivateKey.decode(c,"der")};case"EC PRIVATE KEY":return{curve:(c=i.ECPrivateKey.decode(c,"der")).parameters.value,privateKey:c.privateKey};default:throw new Error("unknown key type "+l)}}t.exports=u,u.signature=i.signature},748:function(t,e,r){"use strict";var i=r(98),n=r(762),o=r(372).Buffer,a=new Array(16);function s(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function h(t,e){return t<>>32-e}function u(t,e,r,i,n,o,a){return h(t+(e&r|~e&i)+n+o|0,a)+e|0}function f(t,e,r,i,n,o,a){return h(t+(e&i|r&~i)+n+o|0,a)+e|0}function l(t,e,r,i,n,o,a){return h(t+(e^r^i)+n+o|0,a)+e|0}function c(t,e,r,i,n,o,a){return h(t+(r^(e|~i))+n+o|0,a)+e|0}i(s,n),s.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,i=this._b,n=this._c,o=this._d;r=u(r,i,n,o,t[0],3614090360,7),o=u(o,r,i,n,t[1],3905402710,12),n=u(n,o,r,i,t[2],606105819,17),i=u(i,n,o,r,t[3],3250441966,22),r=u(r,i,n,o,t[4],4118548399,7),o=u(o,r,i,n,t[5],1200080426,12),n=u(n,o,r,i,t[6],2821735955,17),i=u(i,n,o,r,t[7],4249261313,22),r=u(r,i,n,o,t[8],1770035416,7),o=u(o,r,i,n,t[9],2336552879,12),n=u(n,o,r,i,t[10],4294925233,17),i=u(i,n,o,r,t[11],2304563134,22),r=u(r,i,n,o,t[12],1804603682,7),o=u(o,r,i,n,t[13],4254626195,12),n=u(n,o,r,i,t[14],2792965006,17),r=f(r,i=u(i,n,o,r,t[15],1236535329,22),n,o,t[1],4129170786,5),o=f(o,r,i,n,t[6],3225465664,9),n=f(n,o,r,i,t[11],643717713,14),i=f(i,n,o,r,t[0],3921069994,20),r=f(r,i,n,o,t[5],3593408605,5),o=f(o,r,i,n,t[10],38016083,9),n=f(n,o,r,i,t[15],3634488961,14),i=f(i,n,o,r,t[4],3889429448,20),r=f(r,i,n,o,t[9],568446438,5),o=f(o,r,i,n,t[14],3275163606,9),n=f(n,o,r,i,t[3],4107603335,14),i=f(i,n,o,r,t[8],1163531501,20),r=f(r,i,n,o,t[13],2850285829,5),o=f(o,r,i,n,t[2],4243563512,9),n=f(n,o,r,i,t[7],1735328473,14),r=l(r,i=f(i,n,o,r,t[12],2368359562,20),n,o,t[5],4294588738,4),o=l(o,r,i,n,t[8],2272392833,11),n=l(n,o,r,i,t[11],1839030562,16),i=l(i,n,o,r,t[14],4259657740,23),r=l(r,i,n,o,t[1],2763975236,4),o=l(o,r,i,n,t[4],1272893353,11),n=l(n,o,r,i,t[7],4139469664,16),i=l(i,n,o,r,t[10],3200236656,23),r=l(r,i,n,o,t[13],681279174,4),o=l(o,r,i,n,t[0],3936430074,11),n=l(n,o,r,i,t[3],3572445317,16),i=l(i,n,o,r,t[6],76029189,23),r=l(r,i,n,o,t[9],3654602809,4),o=l(o,r,i,n,t[12],3873151461,11),n=l(n,o,r,i,t[15],530742520,16),r=c(r,i=l(i,n,o,r,t[2],3299628645,23),n,o,t[0],4096336452,6),o=c(o,r,i,n,t[7],1126891415,10),n=c(n,o,r,i,t[14],2878612391,15),i=c(i,n,o,r,t[5],4237533241,21),r=c(r,i,n,o,t[12],1700485571,6),o=c(o,r,i,n,t[3],2399980690,10),n=c(n,o,r,i,t[10],4293915773,15),i=c(i,n,o,r,t[1],2240044497,21),r=c(r,i,n,o,t[8],1873313359,6),o=c(o,r,i,n,t[15],4264355552,10),n=c(n,o,r,i,t[6],2734768916,15),i=c(i,n,o,r,t[13],1309151649,21),r=c(r,i,n,o,t[4],4149444226,6),o=c(o,r,i,n,t[11],3174756917,10),n=c(n,o,r,i,t[2],718787259,15),i=c(i,n,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+o|0},s.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 t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=s},749:function(t,e,r){"use strict";var i=r(729).codes.ERR_STREAM_PREMATURE_CLOSE;function n(){}t.exports=function t(e,r,o){if("function"===typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n>>32-e}function m(t,e,r,i,n,o,a,s){return p(t+(e^r^i)+o+a|0,s)+n|0}function g(t,e,r,i,n,o,a,s){return p(t+(e&r|~e&i)+o+a|0,s)+n|0}function y(t,e,r,i,n,o,a,s){return p(t+((e|~r)^i)+o+a|0,s)+n|0}function b(t,e,r,i,n,o,a,s){return p(t+(e&i|r&~i)+o+a|0,s)+n|0}function v(t,e,r,i,n,o,a,s){return p(t+(e^(r|~i))+o+a|0,s)+n|0}n(d,o),d.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,i=0|this._b,n=0|this._c,o=0|this._d,d=0|this._e,_=0|this._a,w=0|this._b,M=0|this._c,S=0|this._d,E=0|this._e,k=0;k<80;k+=1){var R,A;k<16?(R=m(r,i,n,o,d,t[s[k]],l[0],u[k]),A=v(_,w,M,S,E,t[h[k]],c[0],f[k])):k<32?(R=g(r,i,n,o,d,t[s[k]],l[1],u[k]),A=b(_,w,M,S,E,t[h[k]],c[1],f[k])):k<48?(R=y(r,i,n,o,d,t[s[k]],l[2],u[k]),A=y(_,w,M,S,E,t[h[k]],c[2],f[k])):k<64?(R=b(r,i,n,o,d,t[s[k]],l[3],u[k]),A=g(_,w,M,S,E,t[h[k]],c[3],f[k])):(R=v(r,i,n,o,d,t[s[k]],l[4],u[k]),A=m(_,w,M,S,E,t[h[k]],c[4],f[k])),r=d,d=o,o=p(n,10),n=i,i=R,_=E,E=S,S=p(M,10),M=w,w=A}var B=this._b+n+S|0;this._b=this._c+o+E|0,this._c=this._d+d+_|0,this._d=this._e+r+w|0,this._e=this._a+i+M|0,this._a=B},d.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 t=i.alloc?i.alloc(20):new i(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=d},751:function(t,e,r){(e=t.exports=function(t){t=t.toLowerCase();var r=e[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r}).sha=r(813),e.sha1=r(814),e.sha224=r(815),e.sha256=r(769),e.sha384=r(816),e.sha512=r(770)},752:function(t,e,r){"use strict";var i=r(161);function n(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}t.exports=n,n.prototype._init=function(){},n.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},n.prototype._buffer=function(t,e){for(var r=Math.min(this.buffer.length-this.bufferOff,t.length-e),i=0;i0;i--)e+=this._buffer(t,e),r+=this._flushBuffer(n,r);return e+=this._buffer(t,e),n},n.prototype.final=function(t){var e,r;return t&&(e=this.update(t)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},n.prototype._pad=function(t,e){if(0===e)return!1;for(;e=0||!e.umod(t.prime1)||!e.umod(t.prime2));return e}function a(t,r){var n=function(t){var e=o(t);return{blinder:e.toRed(i.mont(t.modulus)).redPow(new i(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}(r),a=r.modulus.byteLength(),s=new i(t).mul(n.blinder).umod(r.modulus),h=s.toRed(i.mont(r.prime1)),u=s.toRed(i.mont(r.prime2)),f=r.coefficient,l=r.prime1,c=r.prime2,d=h.redPow(r.exponent1).fromRed(),p=u.redPow(r.exponent2).fromRed(),m=d.isub(p).imul(f).umod(l).imul(c);return p.iadd(m).imul(n.unblinder).umod(r.modulus).toArrayLike(e,"be",a)}a.getr=o,t.exports=a}).call(this,r(52).Buffer)},757:function(t,e,r){"use strict";(function(e){var i,n=r(52),o=n.Buffer,a={};for(i in n)n.hasOwnProperty(i)&&"SlowBuffer"!==i&&"Buffer"!==i&&(a[i]=n[i]);var s=a.Buffer={};for(i in o)o.hasOwnProperty(i)&&"allocUnsafe"!==i&&"allocUnsafeSlow"!==i&&(s[i]=o[i]);if(a.Buffer.prototype=o.prototype,s.from&&s.from!==Uint8Array.from||(s.from=function(t,e,r){if("number"===typeof t)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof t);if(t&&"undefined"===typeof t.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);return o(t,e,r)}),s.alloc||(s.alloc=function(t,e,r){if("number"!==typeof t)throw new TypeError('The "size" argument must be of type number. Received type '+typeof t);if(t<0||t>=2*(1<<30))throw new RangeError('The value "'+t+'" is invalid for option "size"');var i=o(t);return e&&0!==e.length?"string"===typeof r?i.fill(e,r):i.fill(e):i.fill(0),i}),!a.kStringMaxLength)try{a.kStringMaxLength=e.binding("buffer").kStringMaxLength}catch(h){}a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),t.exports=a}).call(this,r(90))},758:function(t,e,r){"use strict";var i=r(759).Reporter,n=r(735).EncoderBuffer,o=r(735).DecoderBuffer,a=r(161),s=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],h=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s);function u(t,e,r){var i={};this._baseState=i,i.name=r,i.enc=t,i.parent=e||null,i.children=null,i.tag=null,i.args=null,i.reverseArgs=null,i.choice=null,i.optional=!1,i.any=!1,i.obj=!1,i.use=null,i.useDecoder=null,i.key=null,i.default=null,i.explicit=null,i.implicit=null,i.contains=null,i.parent||(i.children=[],this._wrap())}t.exports=u;var f=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];u.prototype.clone=function(){var t=this._baseState,e={};f.forEach((function(r){e[r]=t[r]}));var r=new this.constructor(e.parent);return r._baseState=e,r},u.prototype._wrap=function(){var t=this._baseState;h.forEach((function(e){this[e]=function(){var r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}}),this)},u.prototype._init=function(t){var e=this._baseState;a(null===e.parent),t.call(this),e.children=e.children.filter((function(t){return t._baseState.parent===this}),this),a.equal(e.children.length,1,"Root node can have only one child")},u.prototype._useArgs=function(t){var e=this._baseState,r=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==r.length&&(a(null===e.children),e.children=r,r.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(a(null===e.args),e.args=t,e.reverseArgs=t.map((function(t){if("object"!==typeof t||t.constructor!==Object)return t;var e={};return Object.keys(t).forEach((function(r){r==(0|r)&&(r|=0);var i=t[r];e[i]=r})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){u.prototype[t]=function(){var e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}})),s.forEach((function(t){u.prototype[t]=function(){var e=this._baseState,r=Array.prototype.slice.call(arguments);return a(null===e.tag),e.tag=t,this._useArgs(r),this}})),u.prototype.use=function(t){a(t);var e=this._baseState;return a(null===e.use),e.use=t,this},u.prototype.optional=function(){return this._baseState.optional=!0,this},u.prototype.def=function(t){var e=this._baseState;return a(null===e.default),e.default=t,e.optional=!0,this},u.prototype.explicit=function(t){var e=this._baseState;return a(null===e.explicit&&null===e.implicit),e.explicit=t,this},u.prototype.implicit=function(t){var e=this._baseState;return a(null===e.explicit&&null===e.implicit),e.implicit=t,this},u.prototype.obj=function(){var t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},u.prototype.key=function(t){var e=this._baseState;return a(null===e.key),e.key=t,this},u.prototype.any=function(){return this._baseState.any=!0,this},u.prototype.choice=function(t){var e=this._baseState;return a(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map((function(e){return t[e]}))),this},u.prototype.contains=function(t){var e=this._baseState;return a(null===e.use),e.contains=t,this},u.prototype._decode=function(t,e){var r=this._baseState;if(null===r.parent)return t.wrapResult(r.children[0]._decode(t,e));var i,n=r.default,a=!0,s=null;if(null!==r.key&&(s=t.enterKey(r.key)),r.optional){var h=null;if(null!==r.explicit?h=r.explicit:null!==r.implicit?h=r.implicit:null!==r.tag&&(h=r.tag),null!==h||r.any){if(a=this._peekTag(t,h,r.any),t.isError(a))return a}else{var u=t.save();try{null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),a=!0}catch(m){a=!1}t.restore(u)}}if(r.obj&&a&&(i=t.enterObject()),a){if(null!==r.explicit){var f=this._decodeTag(t,r.explicit);if(t.isError(f))return f;t=f}var l=t.offset;if(null===r.use&&null===r.choice){var c;r.any&&(c=t.save());var d=this._decodeTag(t,null!==r.implicit?r.implicit:r.tag,r.any);if(t.isError(d))return d;r.any?n=t.raw(c):t=d}if(e&&e.track&&null!==r.tag&&e.track(t.path(),l,t.length,"tagged"),e&&e.track&&null!==r.tag&&e.track(t.path(),t.offset,t.length,"content"),r.any||(n=null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e)),t.isError(n))return n;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(t,e)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){var p=new o(n);n=this._getUse(r.contains,t._reporterState.obj)._decode(p,e)}}return r.obj&&a&&(n=t.leaveObject(i)),null===r.key||null===n&&!0!==a?null!==s&&t.exitKey(s):t.leaveKey(s,r.key,n),n},u.prototype._decodeGeneric=function(t,e,r){var i=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,i.args[0],r):/str$/.test(t)?this._decodeStr(e,t,r):"objid"===t&&i.args?this._decodeObjid(e,i.args[0],i.args[1],r):"objid"===t?this._decodeObjid(e,null,null,r):"gentime"===t||"utctime"===t?this._decodeTime(e,t,r):"null_"===t?this._decodeNull(e,r):"bool"===t?this._decodeBool(e,r):"objDesc"===t?this._decodeStr(e,t,r):"int"===t||"enum"===t?this._decodeInt(e,i.args&&i.args[0],r):null!==i.use?this._getUse(i.use,e._reporterState.obj)._decode(e,r):e.error("unknown tag: "+t)},u.prototype._getUse=function(t,e){var r=this._baseState;return r.useDecoder=this._use(t,e),a(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},u.prototype._decodeChoice=function(t,e){var r=this._baseState,i=null,n=!1;return Object.keys(r.choice).some((function(o){var a=t.save(),s=r.choice[o];try{var h=s._decode(t,e);if(t.isError(h))return!1;i={type:o,value:h},n=!0}catch(u){return t.restore(a),!1}return!0}),this),n?i:t.error("Choice not matched")},u.prototype._createEncoderBuffer=function(t){return new n(t,this.reporter)},u.prototype._encode=function(t,e,r){var i=this._baseState;if(null===i.default||i.default!==t){var n=this._encodeValue(t,e,r);if(void 0!==n&&!this._skipDefault(n,e,r))return n}},u.prototype._encodeValue=function(t,e,r){var n=this._baseState;if(null===n.parent)return n.children[0]._encode(t,e||new i);var o=null;if(this.reporter=e,n.optional&&void 0===t){if(null===n.default)return;t=n.default}var a=null,s=!1;if(n.any)o=this._createEncoderBuffer(t);else if(n.choice)o=this._encodeChoice(t,e);else if(n.contains)a=this._getUse(n.contains,r)._encode(t,e),s=!0;else if(n.children)a=n.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,e,t);if(null===r._baseState.key)return e.error("Child should have a key");var i=e.enterKey(r._baseState.key);if("object"!==typeof t)return e.error("Child expected, but input is not object");var n=r._encode(t[r._baseState.key],e,t);return e.leaveKey(i),n}),this).filter((function(t){return t})),a=this._createEncoderBuffer(a);else if("seqof"===n.tag||"setof"===n.tag){if(!n.args||1!==n.args.length)return e.error("Too many args for : "+n.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");var h=this.clone();h._baseState.implicit=null,a=this._createEncoderBuffer(t.map((function(r){var i=this._baseState;return this._getUse(i.args[0],t)._encode(r,e)}),h))}else null!==n.use?o=this._getUse(n.use,r)._encode(t,e):(a=this._encodePrimitive(n.tag,t),s=!0);if(!n.any&&null===n.choice){var u=null!==n.implicit?n.implicit:n.tag,f=null===n.implicit?"universal":"context";null===u?null===n.use&&e.error("Tag could be omitted only for .use()"):null===n.use&&(o=this._encodeComposite(u,s,f,a))}return null!==n.explicit&&(o=this._encodeComposite(n.explicit,!1,"context",o)),o},u.prototype._encodeChoice=function(t,e){var r=this._baseState,i=r.choice[t.type];return i||a(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),i._encode(t.value,e)},u.prototype._encodePrimitive=function(t,e){var r=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&r.args)return this._encodeObjid(e,r.reverseArgs[0],r.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,r.args&&r.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},u.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},u.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(t)}},759:function(t,e,r){"use strict";var i=r(98);function n(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function o(t,e){this.path=t,this.rethrow(e)}e.Reporter=n,n.prototype.isError=function(t){return t instanceof o},n.prototype.save=function(){var t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},n.prototype.restore=function(t){var e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},n.prototype.enterKey=function(t){return this._reporterState.path.push(t)},n.prototype.exitKey=function(t){var e=this._reporterState;e.path=e.path.slice(0,t-1)},n.prototype.leaveKey=function(t,e,r){var i=this._reporterState;this.exitKey(t),null!==i.obj&&(i.obj[e]=r)},n.prototype.path=function(){return this._reporterState.path.join("/")},n.prototype.enterObject=function(){var t=this._reporterState,e=t.obj;return t.obj={},e},n.prototype.leaveObject=function(t){var e=this._reporterState,r=e.obj;return e.obj=t,r},n.prototype.error=function(t){var e,r=this._reporterState,i=t instanceof o;if(e=i?t:new o(r.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),t.message||t,t.stack),!r.options.partial)throw e;return i||r.errors.push(e),e},n.prototype.wrapResult=function(t){var e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},i(o,Error),o.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},760:function(t,e,r){"use strict";function i(t){var e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);var i=t[r];e[i]=r})),e}e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=i(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=i(e.tag)},762:function(t,e,r){"use strict";var i=r(372).Buffer,n=r(807).Transform;function o(t){n.call(this),this._block=i.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(98)(o,n),o.prototype._transform=function(t,e,r){var i=null;try{this.update(t,e)}catch(n){i=n}r(i)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(r){e=r}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!i.isBuffer(t)&&"string"!==typeof t)throw new TypeError(e+" must be a string or a buffer")}(t,"Data"),this._finalized)throw new Error("Digest already called");i.isBuffer(t)||(t=i.from(t,e));for(var r=this._block,n=0;this._blockOffset+t.length-n>=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},763:function(t,e,r){"use strict";(function(e,i){var n;t.exports=k,k.ReadableState=E;r(73).EventEmitter;var o=function(t,e){return t.listeners(e).length},a=r(764),s=r(52).Buffer,h=e.Uint8Array||function(){};var u,f=r(738);u=f&&f.debuglog?f.debuglog("stream"):function(){};var l,c,d,p=r(808),m=r(765),g=r(766).getHighWaterMark,y=r(729).codes,b=y.ERR_INVALID_ARG_TYPE,v=y.ERR_STREAM_PUSH_AFTER_EOF,_=y.ERR_METHOD_NOT_IMPLEMENTED,w=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(98)(k,a);var M=m.errorOrDestroy,S=["error","close","destroy","pause","resume"];function E(t,e,i){n=n||r(730),t=t||{},"boolean"!==typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",i),this.buffer=new p,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.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(l||(l=r(373).StringDecoder),this.decoder=new l(t.encoding),this.encoding=t.encoding)}function k(t){if(n=n||r(730),!(this instanceof k))return new k(t);var e=this instanceof n;this._readableState=new E(t,this,e),this.readable=!0,t&&("function"===typeof t.read&&(this._read=t.read),"function"===typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function R(t,e,r,i,n){u("readableAddChunk",e);var o,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(u("onEofChunk"),e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?T(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,x(t)))}(t,a);else if(n||(o=function(t,e){var r;i=e,s.isBuffer(i)||i instanceof h||"string"===typeof e||void 0===e||t.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],e));var i;return r}(a,e)),o)M(t,o);else if(a.objectMode||e&&e.length>0)if("string"===typeof e||a.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),i)a.endEmitted?M(t,new w):A(t,a,e,!0);else if(a.ended)M(t,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?A(t,a,e,!1):D(t,a)):A(t,a,e,!1)}else i||(a.reading=!1,D(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function T(t){var e=t._readableState;u("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(u("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(x,t))}function x(t){var e=t._readableState;u("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,P(t)}function D(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(O,t,e))}function O(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function I(t){u("readable nexttick read 0"),t.read(0)}function C(t,e){u("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),P(t),e.flowing&&!e.reading&&t.read(0)}function P(t){var e=t._readableState;for(u("flow",e.flowing);e.flowing&&null!==t.read(););}function L(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function U(t){var e=t._readableState;u("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(N,e,t))}function N(t,e){if(u("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function q(t,e){for(var r=0,i=t.length;r=e.highWaterMark:e.length>0)||e.ended))return u("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?U(this):T(this),null;if(0===(t=B(t,e))&&e.ended)return 0===e.length&&U(this),null;var i,n=e.needReadable;return u("need readable",n),(0===e.length||e.length-t0?L(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&U(this)),null!==i&&this.emit("data",i),i},k.prototype._read=function(t){M(this,new _("_read()"))},k.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,u("pipe count=%d opts=%j",n.pipesCount,e);var a=(!e||!1!==e.end)&&t!==i.stdout&&t!==i.stderr?h:g;function s(e,i){u("onunpipe"),e===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,u("cleanup"),t.removeListener("close",p),t.removeListener("finish",m),t.removeListener("drain",f),t.removeListener("error",d),t.removeListener("unpipe",s),r.removeListener("end",h),r.removeListener("end",g),r.removeListener("data",c),l=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}function h(){u("onend"),t.end()}n.endEmitted?i.nextTick(a):r.once("end",a),t.on("unpipe",s);var f=function(t){return function(){var e=t._readableState;u("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,P(t))}}(r);t.on("drain",f);var l=!1;function c(e){u("ondata");var i=t.write(e);u("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==q(n.pipes,t))&&!l&&(u("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(e){u("onerror",e),g(),t.removeListener("error",d),0===o(t,"error")&&M(t,e)}function p(){t.removeListener("finish",m),g()}function m(){u("onfinish"),t.removeListener("close",p),g()}function g(){u("unpipe"),r.unpipe(t)}return r.on("data",c),function(t,e,r){if("function"===typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",p),t.once("finish",m),t.emit("pipe",r),n.flowing||(u("pipe resume"),r.resume()),t},k.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,u("on readable",n.length,n.reading),n.length?T(this):n.reading||i.nextTick(I,this))),r},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(j,this),r},k.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(j,this),e},k.prototype.resume=function(){var t=this._readableState;return t.flowing||(u("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(C,t,e))}(this,t)),t.paused=!1,this},k.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var n in t.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(n){(u("wrapped data"),r.decoder&&(n=r.decoder.write(n)),!r.objectMode||null!==n&&void 0!==n)&&((r.objectMode||n&&n.length)&&(e.push(n)||(i=!0,t.pause())))})),t)void 0===this[n]&&"function"===typeof t[n]&&(this[n]=function(e){return function(){return t[e].apply(t,arguments)}}(n));for(var o=0;o-1))throw new w(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(t,e,r){r(new m("_write()"))},k.prototype._writev=null,k.prototype.end=function(t,e,r){var n=this._writableState;return"function"===typeof t?(r=t,t=null,e=null):"function"===typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,D(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),k.prototype.destroy=l.destroy,k.prototype._undestroy=l.undestroy,k.prototype._destroy=function(t,e){e(t)}}).call(this,r(71),r(90))},768:function(t,e,r){"use strict";t.exports=f;var i=r(729).codes,n=i.ERR_METHOD_NOT_IMPLEMENTED,o=i.ERR_MULTIPLE_CALLBACK,a=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=i.ERR_TRANSFORM_WITH_LENGTH_0,h=r(730);function u(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function c(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}i(h,n),h.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},h.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,s=0|this._d,h=0|this._e,p=0|this._f,m=0|this._g,g=0|this._h,y=0;y<16;++y)r[y]=t.readInt32BE(4*y);for(;y<64;++y)r[y]=0|(((e=r[y-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[y-7]+d(r[y-15])+r[y-16];for(var b=0;b<64;++b){var v=g+c(h)+u(h,p,m)+a[b]+r[b]|0,_=l(i)+f(i,n,o)|0;g=m,m=p,p=h,h=s+v|0,s=o,o=n,n=i,i=v+_|0}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=h+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},h.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=h},770:function(t,e,r){var i=r(98),n=r(731),o=r(372).Buffer,a=[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],s=new Array(160);function h(){this.init(),this._w=s,n.call(this,128,112)}function u(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function l(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function c(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function m(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function g(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function y(t,e){return t>>>0>>0?1:0}i(h,n),h.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},h.prototype._update=function(t){for(var e=this._w,r=0|this._ah,i=0|this._bh,n=0|this._ch,o=0|this._dh,s=0|this._eh,h=0|this._fh,b=0|this._gh,v=0|this._hh,_=0|this._al,w=0|this._bl,M=0|this._cl,S=0|this._dl,E=0|this._el,k=0|this._fl,R=0|this._gl,A=0|this._hl,B=0;B<32;B+=2)e[B]=t.readInt32BE(4*B),e[B+1]=t.readInt32BE(4*B+4);for(;B<160;B+=2){var T=e[B-30],x=e[B-30+1],D=d(T,x),O=p(x,T),j=m(T=e[B-4],x=e[B-4+1]),I=g(x,T),C=e[B-14],P=e[B-14+1],L=e[B-32],U=e[B-32+1],N=O+P|0,q=D+C+y(N,O)|0;q=(q=q+j+y(N=N+I|0,I)|0)+L+y(N=N+U|0,U)|0,e[B]=q,e[B+1]=N}for(var K=0;K<160;K+=2){q=e[K],N=e[K+1];var H=f(r,i,n),F=f(_,w,M),W=l(r,_),z=l(_,r),V=c(s,E),G=c(E,s),Z=a[K],X=a[K+1],Y=u(s,h,b),J=u(E,k,R),$=A+G|0,Q=v+V+y($,A)|0;Q=(Q=(Q=Q+Y+y($=$+J|0,J)|0)+Z+y($=$+X|0,X)|0)+q+y($=$+N|0,N)|0;var tt=z+F|0,et=W+H+y(tt,z)|0;v=b,A=R,b=h,R=k,h=s,k=E,s=o+Q+y(E=S+$|0,S)|0,o=n,S=M,n=i,M=w,i=r,w=_,r=Q+et+y(_=$+tt|0,$)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+M|0,this._dl=this._dl+S|0,this._el=this._el+E|0,this._fl=this._fl+k|0,this._gl=this._gl+R|0,this._hl=this._hl+A|0,this._ah=this._ah+r+y(this._al,_)|0,this._bh=this._bh+i+y(this._bl,w)|0,this._ch=this._ch+n+y(this._cl,M)|0,this._dh=this._dh+o+y(this._dl,S)|0,this._eh=this._eh+s+y(this._el,E)|0,this._fh=this._fh+h+y(this._fl,k)|0,this._gh=this._gh+b+y(this._gl,R)|0,this._hh=this._hh+v+y(this._hl,A)|0},h.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=h},771:function(t,e,r){"use strict";var i=r(98),n=r(817),o=r(725),a=r(372).Buffer,s=r(772),h=r(750),u=r(751),f=a.alloc(128);function l(t,e){o.call(this,"digest"),"string"===typeof e&&(e=a.from(e));var r="sha512"===t||"sha384"===t?128:64;(this._alg=t,this._key=e,e.length>r)?e=("rmd160"===t?new h:u(t)).update(e).digest():e.lengthr||e!==e)throw new TypeError("Bad key length")}},776:function(t,e,r){(function(e){var r;if(e.browser)r="utf-8";else if(e.version){r=parseInt(e.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else r="utf-8";t.exports=r}).call(this,r(90))},777:function(t,e,r){var i=r(772),n=r(750),o=r(751),a=r(372).Buffer,s=r(775),h=r(776),u=r(778),f=a.alloc(128),l={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function c(t,e,r){var s=function(t){function e(e){return o(t).update(e).digest()}return"rmd160"===t||"ripemd160"===t?function(t){return(new n).update(t).digest()}:"md5"===t?i:e}(t),h="sha512"===t||"sha384"===t?128:64;e.length>h?e=s(e):e.length>>0},e.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},e.ip=function(t,e,r,i){for(var n=0,o=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=e>>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=t>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1}r[i+0]=n>>>0,r[i+1]=o>>>0},e.rip=function(t,e,r,i){for(var n=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)n<<=1,n|=e>>>s+a&1,n<<=1,n|=t>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=e>>>s+a&1,o<<=1,o|=t>>>s+a&1;r[i+0]=n>>>0,r[i+1]=o>>>0},e.pc1=function(t,e,r,i){for(var n=0,o=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)n<<=1,n|=e>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+a&1}for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;r[i+0]=n>>>0,r[i+1]=o>>>0},e.r28shl=function(t,e){return t<>>28-e};var i=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];e.pc2=function(t,e,r,n){for(var o=0,a=0,s=i.length>>>1,h=0;h>>i[h]&1;for(h=s;h>>i[h]&1;r[n+0]=o>>>0,r[n+1]=a>>>0},e.expand=function(t,e,r){var i=0,n=0;i=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)i<<=6,i|=t>>>o&63;for(o=11;o>=3;o-=4)n|=t>>>o&63,n<<=6;n|=(31&t)<<1|t>>>31,e[r+0]=i>>>0,e[r+1]=n>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];e.substitute=function(t,e){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(t>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(e>>>18-6*i&63)]}return r>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];e.permute=function(t){for(var e=0,r=0;r>>o[r]&1;return e>>>0},e.padSplit=function(t,e,r){for(var i=t.toString(2);i.length>>1];r=o.r28shl(r,s),n=o.r28shl(n,s),o.pc2(r,n,t.keys,a)}},h.prototype._update=function(t,e,r,i){var n=this._desState,a=o.readUInt32BE(t,e),s=o.readUInt32BE(t,e+4);o.ip(a,s,n.tmp,0),a=n.tmp[0],s=n.tmp[1],"encrypt"===this.type?this._encrypt(n,a,s,n.tmp,0):this._decrypt(n,a,s,n.tmp,0),a=n.tmp[0],s=n.tmp[1],o.writeUInt32BE(r,a,i),o.writeUInt32BE(r,s,i+4)},h.prototype._pad=function(t,e){for(var r=t.length-e,i=e;i>>0,a=c}o.rip(s,a,i,n)},h.prototype._decrypt=function(t,e,r,i,n){for(var a=r,s=e,h=t.keys.length-2;h>=0;h-=2){var u=t.keys[h],f=t.keys[h+1];o.expand(a,t.tmp,0),u^=t.tmp[0],f^=t.tmp[1];var l=o.substitute(u,f),c=a;a=(s^o.permute(l))>>>0,s=c}o.rip(a,s,i,n)}},781:function(t,e,r){var i=r(734),n=r(372).Buffer,o=r(782);function a(t){var e=t._cipher.encryptBlockRaw(t._prev);return o(t._prev),e}e.encrypt=function(t,e){var r=Math.ceil(e.length/16),o=t._cache.length;t._cache=n.concat([t._cache,n.allocUnsafe(16*r)]);for(var s=0;st;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(h),e.cmp(h)){if(!e.cmp(u))for(;r.mod(f).cmp(l);)r.iadd(d)}else for(;r.mod(o).cmp(c);)r.iadd(d);if(g(p=r.shrn(1))&&g(r)&&y(p)&&y(r)&&a.test(p)&&a.test(r))return r}}},787:function(t,e,r){var i=r(127),n=r(375);function o(t){this.rand=t||new n.Rand}t.exports=o,o.create=function(t){return new o(t)},o.prototype._randbelow=function(t){var e=t.bitLength(),r=Math.ceil(e/8);do{var n=new i(this.rand.generate(r))}while(n.cmp(t)>=0);return n},o.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},o.prototype.test=function(t,e,r){var n=t.bitLength(),o=i.mont(t),a=new i(1).toRed(o);e||(e=Math.max(1,n/48|0));for(var s=t.subn(1),h=0;!s.testn(h);h++);for(var u=t.shrn(h),f=s.toRed(o);e>0;e--){var l=this._randrange(new i(2),s);r&&r(l);var c=l.toRed(o).redPow(u);if(0!==c.cmp(a)&&0!==c.cmp(f)){for(var d=1;d0;e--){var f=this._randrange(new i(2),a),l=t.gcd(f);if(0!==l.cmpn(1))return l;var c=f.toRed(n).redPow(h);if(0!==c.cmp(o)&&0!==c.cmp(u)){for(var d=1;d0)if("string"===typeof e||a.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),i)a.endEmitted?M(t,new w):A(t,a,e,!0);else if(a.ended)M(t,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?A(t,a,e,!1):D(t,a)):A(t,a,e,!1)}else i||(a.reading=!1,D(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function T(t){var e=t._readableState;u("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(u("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(x,t))}function x(t){var e=t._readableState;u("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,P(t)}function D(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(O,t,e))}function O(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function I(t){u("readable nexttick read 0"),t.read(0)}function C(t,e){u("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),P(t),e.flowing&&!e.reading&&t.read(0)}function P(t){var e=t._readableState;for(u("flow",e.flowing);e.flowing&&null!==t.read(););}function L(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function U(t){var e=t._readableState;u("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(N,e,t))}function N(t,e){if(u("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function q(t,e){for(var r=0,i=t.length;r=e.highWaterMark:e.length>0)||e.ended))return u("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?U(this):T(this),null;if(0===(t=B(t,e))&&e.ended)return 0===e.length&&U(this),null;var i,n=e.needReadable;return u("need readable",n),(0===e.length||e.length-t0?L(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&U(this)),null!==i&&this.emit("data",i),i},k.prototype._read=function(t){M(this,new _("_read()"))},k.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,u("pipe count=%d opts=%j",n.pipesCount,e);var a=(!e||!1!==e.end)&&t!==i.stdout&&t!==i.stderr?h:g;function s(e,i){u("onunpipe"),e===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,u("cleanup"),t.removeListener("close",p),t.removeListener("finish",m),t.removeListener("drain",f),t.removeListener("error",d),t.removeListener("unpipe",s),r.removeListener("end",h),r.removeListener("end",g),r.removeListener("data",c),l=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}function h(){u("onend"),t.end()}n.endEmitted?i.nextTick(a):r.once("end",a),t.on("unpipe",s);var f=function(t){return function(){var e=t._readableState;u("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,P(t))}}(r);t.on("drain",f);var l=!1;function c(e){u("ondata");var i=t.write(e);u("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==q(n.pipes,t))&&!l&&(u("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(e){u("onerror",e),g(),t.removeListener("error",d),0===o(t,"error")&&M(t,e)}function p(){t.removeListener("finish",m),g()}function m(){u("onfinish"),t.removeListener("close",p),g()}function g(){u("unpipe"),r.unpipe(t)}return r.on("data",c),function(t,e,r){if("function"===typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",p),t.once("finish",m),t.emit("pipe",r),n.flowing||(u("pipe resume"),r.resume()),t},k.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,u("on readable",n.length,n.reading),n.length?T(this):n.reading||i.nextTick(I,this))),r},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(j,this),r},k.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(j,this),e},k.prototype.resume=function(){var t=this._readableState;return t.flowing||(u("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(C,t,e))}(this,t)),t.paused=!1,this},k.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var n in t.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(n){(u("wrapped data"),r.decoder&&(n=r.decoder.write(n)),!r.objectMode||null!==n&&void 0!==n)&&((r.objectMode||n&&n.length)&&(e.push(n)||(i=!0,t.pause())))})),t)void 0===this[n]&&"function"===typeof t[n]&&(this[n]=function(e){return function(){return t[e].apply(t,arguments)}}(n));for(var o=0;o-1))throw new w(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(t,e,r){r(new m("_write()"))},k.prototype._writev=null,k.prototype.end=function(t,e,r){var n=this._writableState;return"function"===typeof t?(r=t,t=null,e=null):"function"===typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,D(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),k.prototype.destroy=l.destroy,k.prototype._undestroy=l.undestroy,k.prototype._destroy=function(t,e){e(t)}}).call(this,r(71),r(90))},793:function(t,e,r){"use strict";t.exports=f;var i=r(732).codes,n=i.ERR_METHOD_NOT_IMPLEMENTED,o=i.ERR_MULTIPLE_CALLBACK,a=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=i.ERR_TRANSFORM_WITH_LENGTH_0,h=r(733);function u(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length=49&&u<=54?u-49+10:u>=17&&u<=22?u-17+10:u,a|=h}return i(!(240&a),"Invalid character in "+t),n}function h(t,e,r,n){for(var o=0,a=0,s=Math.min(t.length,r),h=e;h=49?u-49+10:u>=17?u-17+10:u,i(u>=0&&a0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this._strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)a=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=s(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=s(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,a=o%i,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(A){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var l=["","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"],c=[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],d=[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];o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,a=0;a>>24-n&16777215)||a!==this.length-1?l[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=c[t],f=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(f).toString(t);r=(p=p.idivn(f)).isZero()?m+r:l[u-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(a,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function p(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,h=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(a=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r._strip()}o.prototype.toArrayLike=function(t,e,r){this._strip();var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0");var a=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](a,n),a},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,i=0,n=0,o=0;n>8&255),r>16&255),6===o?(r>24&255),i=0,o=0):(i=a>>>24,o+=2)}if(r=0&&(t[r--]=a>>8&255),r>=0&&(t[r--]=a>>16&255),6===o?(r>=0&&(t[r--]=a>>24&255),i=0,o=0):(i=a>>>24,o+=2)}if(r>=0)for(t[r--]=i;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"===typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,g=0|a[2],y=8191&g,b=g>>>13,v=0|a[3],_=8191&v,w=v>>>13,M=0|a[4],S=8191&M,E=M>>>13,k=0|a[5],R=8191&k,A=k>>>13,B=0|a[6],T=8191&B,x=B>>>13,D=0|a[7],O=8191&D,j=D>>>13,I=0|a[8],C=8191&I,P=I>>>13,L=0|a[9],U=8191&L,N=L>>>13,q=0|s[0],K=8191&q,H=q>>>13,F=0|s[1],W=8191&F,z=F>>>13,V=0|s[2],G=8191&V,Z=V>>>13,X=0|s[3],Y=8191&X,J=X>>>13,$=0|s[4],Q=8191&$,tt=$>>>13,et=0|s[5],rt=8191&et,it=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],ht=8191&st,ut=st>>>13,ft=0|s[8],lt=8191&ft,ct=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(u+(i=Math.imul(l,K))|0)+((8191&(n=(n=Math.imul(l,H))+Math.imul(c,K)|0))<<13)|0;u=((o=Math.imul(c,H))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(p,K),n=(n=Math.imul(p,H))+Math.imul(m,K)|0,o=Math.imul(m,H);var yt=(u+(i=i+Math.imul(l,W)|0)|0)+((8191&(n=(n=n+Math.imul(l,z)|0)+Math.imul(c,W)|0))<<13)|0;u=((o=o+Math.imul(c,z)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(y,K),n=(n=Math.imul(y,H))+Math.imul(b,K)|0,o=Math.imul(b,H),i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,z)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,z)|0;var bt=(u+(i=i+Math.imul(l,G)|0)|0)+((8191&(n=(n=n+Math.imul(l,Z)|0)+Math.imul(c,G)|0))<<13)|0;u=((o=o+Math.imul(c,Z)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(_,K),n=(n=Math.imul(_,H))+Math.imul(w,K)|0,o=Math.imul(w,H),i=i+Math.imul(y,W)|0,n=(n=n+Math.imul(y,z)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,z)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,Z)|0;var vt=(u+(i=i+Math.imul(l,Y)|0)|0)+((8191&(n=(n=n+Math.imul(l,J)|0)+Math.imul(c,Y)|0))<<13)|0;u=((o=o+Math.imul(c,J)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(S,K),n=(n=Math.imul(S,H))+Math.imul(E,K)|0,o=Math.imul(E,H),i=i+Math.imul(_,W)|0,n=(n=n+Math.imul(_,z)|0)+Math.imul(w,W)|0,o=o+Math.imul(w,z)|0,i=i+Math.imul(y,G)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,Z)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,J)|0;var _t=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(R,K),n=(n=Math.imul(R,H))+Math.imul(A,K)|0,o=Math.imul(A,H),i=i+Math.imul(S,W)|0,n=(n=n+Math.imul(S,z)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,z)|0,i=i+Math.imul(_,G)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,Z)|0,i=i+Math.imul(y,Y)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var wt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(T,K),n=(n=Math.imul(T,H))+Math.imul(x,K)|0,o=Math.imul(x,H),i=i+Math.imul(R,W)|0,n=(n=n+Math.imul(R,z)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,z)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,J)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,J)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var Mt=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,at)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,at)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,K),n=(n=Math.imul(O,H))+Math.imul(j,K)|0,o=Math.imul(j,H),i=i+Math.imul(T,W)|0,n=(n=n+Math.imul(T,z)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,z)|0,i=i+Math.imul(R,G)|0,n=(n=n+Math.imul(R,Z)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,Z)|0,i=i+Math.imul(S,Y)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,i=i+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,it)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(C,K),n=(n=Math.imul(C,H))+Math.imul(P,K)|0,o=Math.imul(P,H),i=i+Math.imul(O,W)|0,n=(n=n+Math.imul(O,z)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,z)|0,i=i+Math.imul(T,G)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,Z)|0,i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,J)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(_,rt)|0,n=(n=n+Math.imul(_,it)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,it)|0,i=i+Math.imul(y,ot)|0,n=(n=n+Math.imul(y,at)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,at)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var Et=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(U,K),n=(n=Math.imul(U,H))+Math.imul(N,K)|0,o=Math.imul(N,H),i=i+Math.imul(C,W)|0,n=(n=n+Math.imul(C,z)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,z)|0,i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(j,G)|0,o=o+Math.imul(j,Z)|0,i=i+Math.imul(T,Y)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(_,ot)|0,n=(n=n+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,i=i+Math.imul(y,ht)|0,n=(n=n+Math.imul(y,ut)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(U,W),n=(n=Math.imul(U,z))+Math.imul(N,W)|0,o=Math.imul(N,z),i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,Z)|0,i=i+Math.imul(O,Y)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,J)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(R,rt)|0,n=(n=n+Math.imul(R,it)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,at)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,at)|0,i=i+Math.imul(_,ht)|0,n=(n=n+Math.imul(_,ut)|0)+Math.imul(w,ht)|0,o=o+Math.imul(w,ut)|0,i=i+Math.imul(y,lt)|0,n=(n=n+Math.imul(y,ct)|0)+Math.imul(b,lt)|0,o=o+Math.imul(b,ct)|0;var Rt=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(U,G),n=(n=Math.imul(U,Z))+Math.imul(N,G)|0,o=Math.imul(N,Z),i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,J)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(R,ot)|0,n=(n=n+Math.imul(R,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(_,lt)|0,n=(n=n+Math.imul(_,ct)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,ct)|0;var At=(u+(i=i+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,mt)|0)+Math.imul(b,pt)|0))<<13)|0;u=((o=o+Math.imul(b,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(U,Y),n=(n=Math.imul(U,J))+Math.imul(N,Y)|0,o=Math.imul(N,J),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,i=i+Math.imul(R,ht)|0,n=(n=n+Math.imul(R,ut)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Bt=(u+(i=i+Math.imul(_,pt)|0)|0)+((8191&(n=(n=n+Math.imul(_,mt)|0)+Math.imul(w,pt)|0))<<13)|0;u=((o=o+Math.imul(w,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(U,Q),n=(n=Math.imul(U,tt))+Math.imul(N,Q)|0,o=Math.imul(N,tt),i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(R,lt)|0,n=(n=n+Math.imul(R,ct)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,ct)|0;var Tt=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(U,rt),n=(n=Math.imul(U,it))+Math.imul(N,rt)|0,o=Math.imul(N,it),i=i+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var xt=(u+(i=i+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,mt)|0)+Math.imul(A,pt)|0))<<13)|0;u=((o=o+Math.imul(A,mt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(U,ot),n=(n=Math.imul(U,at))+Math.imul(N,ot)|0,o=Math.imul(N,at),i=i+Math.imul(C,ht)|0,n=(n=n+Math.imul(C,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var Dt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,i=Math.imul(U,ht),n=(n=Math.imul(U,ut))+Math.imul(N,ht)|0,o=Math.imul(N,ut),i=i+Math.imul(C,lt)|0,n=(n=n+Math.imul(C,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Ot=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(U,lt),n=(n=Math.imul(U,ct))+Math.imul(N,lt)|0,o=Math.imul(N,ct);var jt=(u+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var It=(u+(i=Math.imul(U,pt))|0)+((8191&(n=(n=Math.imul(U,mt))+Math.imul(N,pt)|0))<<13)|0;return u=((o=Math.imul(N,mt))+(n>>>13)|0)+(It>>>26)|0,It&=67108863,h[0]=gt,h[1]=yt,h[2]=bt,h[3]=vt,h[4]=_t,h[5]=wt,h[6]=Mt,h[7]=St,h[8]=Et,h[9]=kt,h[10]=Rt,h[11]=At,h[12]=Bt,h[13]=Tt,h[14]=xt,h[15]=Dt,h[16]=Ot,h[17]=jt,h[18]=It,0!==u&&(h[19]=u,r.length++),r};function g(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function y(t,e,r){return g(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(m=p),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):r<63?p(this,t,e):r<1024?g(this,t,e):y(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},b.prototype.permute=function(t,e,r,i,n,o){for(var a=0;a>>=1)n++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,r+=o/67108864|0,r+=a>>>26,this.words[n]=67108863&a}return 0!==r&&(this.words[n]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&s}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"===typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===s)return this._strip();for(i(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var s,h=i.length-n.length;if("mod"!==e){(s=new o(null)).length=h+1,s.words=new Array(s.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/a|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);s&&(s.words[l]=c)}return s&&s._strip(),i._strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:s||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:n,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var n,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=(1<<26)%t,n=0,o=this.length-1;o>=0;o--)n=(r*n+(0|this.words[o]))%t;return e?-n:n},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*r;this.words[n]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),a=new o(0),s=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0===(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(f),a.isub(l)),n.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||h.isOdd())&&(s.iadd(f),h.isub(l)),s.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(s),a.isub(h)):(r.isub(e),s.isub(n),h.isub(a))}return{a:s,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,a=new o(1),s=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0===(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);for(var l=0,c=1;0===(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(n=0===e.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"===typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new k(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function _(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function R(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}_.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},_.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(t,e){t.iushrn(this.n,0,e)},_.prototype.imulK=function(t){return t.imul(this.k)},n(w,_),w.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new M;else if("p192"===t)e=new S;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return v[t]=e,e},k.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){i(0===(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(u(t,t.umod(this.m)._forceRed(this)),t)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);i(!n.isZero());var s=new o(1).toRed(this),h=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=a;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();i(g=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===i&&0===f)&&(n=this.mul(n,r[a]),s=0,a=0)):s=0}h=26}return n},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new R(t)},n(R,k),R.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},R.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},R.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},R.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},R.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(99)(t))},795:function(t,e,r){"use strict";var i=e;i.bignum=r(127),i.define=r(848).define,i.base=r(851),i.constants=r(852),i.decoders=r(798),i.encoders=r(796)},796:function(t,e,r){"use strict";var i=e;i.der=r(797),i.pem=r(849)},797:function(t,e,r){"use strict";var i=r(98),n=r(757).Buffer,o=r(758),a=r(760);function s(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new h,this.tree._init(t.body)}function h(t){o.call(this,"der",t)}function u(t){return t<10?"0"+t:t}t.exports=s,s.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},i(h,o),h.prototype._encodeComposite=function(t,e,r,i){var o=function(t,e,r,i){var n;"seqof"===t?t="seq":"setof"===t&&(t="set");if(a.tagByName.hasOwnProperty(t))n=a.tagByName[t];else{if("number"!==typeof t||(0|t)!==t)return i.error("Unknown tag: "+t);n=t}if(n>=31)return i.error("Multi-octet tag encoding unsupported");e||(n|=32);return n|=a.tagClassByName[r||"universal"]<<6}(t,e,r,this.reporter);if(i.length<128){var s=n.alloc(2);return s[0]=o,s[1]=i.length,this._createEncoderBuffer([s,i])}for(var h=1,u=i.length;u>=256;u>>=8)h++;var f=n.alloc(2+h);f[0]=o,f[1]=128|h;for(var l=1+h,c=i.length;c>0;l--,c>>=8)f[l]=255&c;return this._createEncoderBuffer([f,i])},h.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){for(var r=n.alloc(2*t.length),i=0;i=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}for(var a=0,s=0;s=128;h>>=7)a++}for(var u=n.alloc(a),f=u.length-1,l=t.length-1;l>=0;l--){var c=t[l];for(u[f--]=127&c;(c>>=7)>0;)u[f--]=128|127&c}return this._createEncoderBuffer(u)},h.prototype._encodeTime=function(t,e){var r,i=new Date(t);return"gentime"===e?r=[u(i.getUTCFullYear()),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[u(i.getUTCFullYear()%100),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},h.prototype._encodeNull=function(){return this._createEncoderBuffer("")},h.prototype._encodeInt=function(t,e){if("string"===typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!==typeof t&&!n.isBuffer(t)){var r=t.toArray();!t.sign&&128&r[0]&&r.unshift(0),t=n.from(r)}if(n.isBuffer(t)){var i=t.length;0===t.length&&i++;var o=n.alloc(i);return t.copy(o),0===t.length&&(o[0]=0),this._createEncoderBuffer(o)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);for(var a=1,s=t;s>=256;s>>=8)a++;for(var h=new Array(a),u=h.length-1;u>=0;u--)h[u]=255&t,t>>=8;return 128&h[0]&&h.unshift(0),this._createEncoderBuffer(n.from(h))},h.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},h.prototype._use=function(t,e){return"function"===typeof t&&(t=t(e)),t._getEncoder("der").tree},h.prototype._skipDefault=function(t,e,r){var i,n=this._baseState;if(null===n.default)return!1;var o=t.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,e,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;i>6],n=0===(32&r);if(31===(31&r)){var o=r;for(r=0;128===(128&o);){if(o=t.readUInt8(e),t.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:s.tag[r]}}function l(t,e,r){var i=t.readUInt8(r);if(t.isError(i))return i;if(!e&&128===i)return null;if(0===(128&i))return i;var n=127&i;if(n>4)return t.error("length octect is too long");i=0;for(var o=0;o0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return a.alloc(0);for(var e,r,i,n=a.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=o.data,r=n,i=s,a.prototype.copy.call(e,r,i),s+=o.data.length,o=o.next;return n}},{key:"consume",value:function(t,e){var r;return tn.length?n.length:t;if(o===n.length?i+=n:i+=n.slice(0,t),0===(t-=o)){o===n.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=n.slice(o));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(t){var e=a.allocUnsafe(t),r=this.head,i=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var n=r.data,o=t>n.length?n.length:t;if(n.copy(e,e.length-t,0,o),0===(t-=o)){o===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(o));break}++i}return this.length-=i,e}},{key:h,value:function(t,e){return s(this,function(t){for(var e=1;e0,(function(t){i||(i=t),t&&a.forEach(u),o||(a.forEach(u),n(i))}))}));return e.reduce(f)}},813:function(t,e,r){var i=r(98),n=r(731),o=r(372).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function h(){this.init(),this._w=s,n.call(this,64,56)}function u(t){return t<<30|t>>>2}function f(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}i(h,n),h.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},h.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,s=0|this._d,h=0|this._e,l=0;l<16;++l)r[l]=t.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var c=0;c<80;++c){var d=~~(c/20),p=0|((e=i)<<5|e>>>27)+f(d,n,o,s)+h+r[c]+a[d];h=s,s=o,o=u(n),n=i,i=p}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=h+this._e|0},h.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=h},814:function(t,e,r){var i=r(98),n=r(731),o=r(372).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function h(){this.init(),this._w=s,n.call(this,64,56)}function u(t){return t<<5|t>>>27}function f(t){return t<<30|t>>>2}function l(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}i(h,n),h.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},h.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,s=0|this._d,h=0|this._e,c=0;c<16;++c)r[c]=t.readInt32BE(4*c);for(;c<80;++c)r[c]=(e=r[c-3]^r[c-8]^r[c-14]^r[c-16])<<1|e>>>31;for(var d=0;d<80;++d){var p=~~(d/20),m=u(i)+l(p,n,o,s)+h+r[d]+a[p]|0;h=s,s=o,o=f(n),n=i,i=m}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=h+this._e|0},h.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=h},815:function(t,e,r){var i=r(98),n=r(769),o=r(731),a=r(372).Buffer,s=new Array(64);function h(){this.init(),this._w=s,o.call(this,64,56)}i(h,n),h.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},h.prototype._hash=function(){var t=a.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=h},816:function(t,e,r){var i=r(98),n=r(770),o=r(731),a=r(372).Buffer,s=new Array(160);function h(){this.init(),this._w=s,o.call(this,128,112)}i(h,n),h.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},h.prototype._hash=function(){var t=a.allocUnsafe(48);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=h},817:function(t,e,r){"use strict";var i=r(98),n=r(372).Buffer,o=r(725),a=n.alloc(128);function s(t,e){o.call(this,"digest"),"string"===typeof e&&(e=n.from(e)),this._alg=t,this._key=e,e.length>64?e=t(e):e.length<64&&(e=n.concat([e,a],64));for(var r=this._ipad=n.allocUnsafe(64),i=this._opad=n.allocUnsafe(64),s=0;s<64;s++)r[s]=54^e[s],i[s]=92^e[s];this._hash=[r]}i(s,o),s.prototype._update=function(t){this._hash.push(t)},s.prototype._final=function(){var t=this._alg(n.concat(this._hash));return this._alg(n.concat([this._opad,t]))},t.exports=s},818:function(t,e,r){t.exports=r(773)},819:function(t,e,r){(function(e,i){var n,o=r(372).Buffer,a=r(775),s=r(776),h=r(777),u=r(778),f=e.crypto&&e.crypto.subtle,l={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},c=[];function d(t,e,r,i,n){return f.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then((function(t){return f.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:n}},t,i<<3)})).then((function(t){return o.from(t)}))}t.exports=function(t,r,p,m,g,y){"function"===typeof g&&(y=g,g=void 0);var b=l[(g=g||"sha1").toLowerCase()];if(!b||"function"!==typeof e.Promise)return i.nextTick((function(){var e;try{e=h(t,r,p,m,g)}catch(i){return y(i)}y(null,e)}));if(a(p,m),t=u(t,s,"Password"),r=u(r,s,"Salt"),"function"!==typeof y)throw new Error("No callback provided to pbkdf2");!function(t,e){t.then((function(t){i.nextTick((function(){e(null,t)}))}),(function(t){i.nextTick((function(){e(t)}))}))}(function(t){if(e.process&&!e.process.browser)return Promise.resolve(!1);if(!f||!f.importKey||!f.deriveBits)return Promise.resolve(!1);if(void 0!==c[t])return c[t];var r=d(n=n||o.alloc(8),n,10,128,t).then((function(){return!0})).catch((function(){return!1}));return c[t]=r,r}(b).then((function(e){return e?d(t,r,p,m,b):h(t,r,p,m,g)})),y)}}).call(this,r(71),r(90))},820:function(t,e,r){var i=r(821),n=r(753),o=r(754),a=r(834),s=r(741);function h(t,e,r){if(t=t.toLowerCase(),o[t])return n.createCipheriv(t,e,r);if(a[t])return new i({key:e,iv:r,mode:t});throw new TypeError("invalid suite type")}function u(t,e,r){if(t=t.toLowerCase(),o[t])return n.createDecipheriv(t,e,r);if(a[t])return new i({key:e,iv:r,mode:t,decrypt:!0});throw new TypeError("invalid suite type")}e.createCipher=e.Cipher=function(t,e){var r,i;if(t=t.toLowerCase(),o[t])r=o[t].key,i=o[t].iv;else{if(!a[t])throw new TypeError("invalid suite type");r=8*a[t].key,i=a[t].iv}var n=s(e,!1,r,i);return h(t,n.key,n.iv)},e.createCipheriv=e.Cipheriv=h,e.createDecipher=e.Decipher=function(t,e){var r,i;if(t=t.toLowerCase(),o[t])r=o[t].key,i=o[t].iv;else{if(!a[t])throw new TypeError("invalid suite type");r=8*a[t].key,i=a[t].iv}var n=s(e,!1,r,i);return u(t,n.key,n.iv)},e.createDecipheriv=e.Decipheriv=u,e.listCiphers=e.getCiphers=function(){return Object.keys(a).concat(n.getCiphers())}},821:function(t,e,r){var i=r(725),n=r(822),o=r(98),a=r(372).Buffer,s={"des-ede3-cbc":n.CBC.instantiate(n.EDE),"des-ede3":n.EDE,"des-ede-cbc":n.CBC.instantiate(n.EDE),"des-ede":n.EDE,"des-cbc":n.CBC.instantiate(n.DES),"des-ecb":n.DES};function h(t){i.call(this);var e,r=t.mode.toLowerCase(),n=s[r];e=t.decrypt?"decrypt":"encrypt";var o=t.key;a.isBuffer(o)||(o=a.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=a.concat([o,o.slice(0,8)]));var h=t.iv;a.isBuffer(h)||(h=a.from(h)),this._des=n.create({key:o,iv:h,type:e})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],t.exports=h,o(h,i),h.prototype._update=function(t){return a.from(this._des.update(t))},h.prototype._final=function(){return a.from(this._des.final())}},822:function(t,e,r){"use strict";e.utils=r(779),e.Cipher=r(752),e.DES=r(780),e.CBC=r(823),e.EDE=r(824)},823:function(t,e,r){"use strict";var i=r(161),n=r(98),o={};function a(t){i.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},c.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),r=-1;++r>a%8,t._prev=o(t._prev,r?i:n);return s}function o(t,e){var r=t.length,n=-1,o=i.allocUnsafe(t.length);for(t=i.concat([t,i.from([e])]);++n>7;return o}e.encrypt=function(t,e,r){for(var o=e.length,a=i.allocUnsafe(o),s=-1;++s>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function a(t){this.h=t,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(t){for(var e=-1;++e0;e--)i[e]=i[e]>>>1|(1&i[e-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=o(n)},a.prototype.update=function(t){var e;for(this.cache=i.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},a.prototype.final=function(t,e){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,t,0,e])),this.state},t.exports=a},833:function(t,e,r){var i=r(784),n=r(372).Buffer,o=r(754),a=r(785),s=r(725),h=r(740),u=r(741);function f(t,e,r){s.call(this),this._cache=new l,this._last=void 0,this._cipher=new h.AES(e),this._prev=n.from(r),this._mode=t,this._autopadding=!0}function l(){this.cache=n.allocUnsafe(0)}function c(t,e,r){var s=o[t.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"===typeof r&&(r=n.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);if("string"===typeof e&&(e=n.from(e)),e.length!==s.key/8)throw new TypeError("invalid key length "+e.length);return"stream"===s.type?new a(s.module,e,r,!0):"auth"===s.type?new i(s.module,e,r,!0):new f(s.module,e,r)}r(98)(f,s),f.prototype._update=function(t){var e,r;this._cache.add(t);for(var i=[];e=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,e),i.push(r);return n.concat(i)},f.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");var r=-1;for(;++r16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},e.createDecipher=function(t,e){var r=o[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=u(e,!1,r.key,r.iv);return c(t,i.key,i.iv)},e.createDecipheriv=c},834:function(t,e){e["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}},835:function(t,e,r){(function(t){var i=r(786),n=r(836),o=r(837);var a={binary:!0,hex:!0,base64:!0};e.DiffieHellmanGroup=e.createDiffieHellmanGroup=e.getDiffieHellman=function(e){var r=new t(n[e].prime,"hex"),i=new t(n[e].gen,"hex");return new o(r,i)},e.createDiffieHellman=e.DiffieHellman=function e(r,n,s,h){return t.isBuffer(n)||void 0===a[n]?e(r,"binary",n,s):(n=n||"binary",h=h||"binary",s=s||new t([2]),t.isBuffer(s)||(s=new t(s,h)),"number"===typeof r?new o(i(r,s),s,!0):(t.isBuffer(r)||(r=new t(r,n)),new o(r,s,!0)))}}).call(this,r(52).Buffer)},836:function(t){t.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},837:function(t,e,r){(function(e){var i=r(127),n=new(r(787)),o=new i(24),a=new i(11),s=new i(10),h=new i(3),u=new i(7),f=r(786),l=r(727);function c(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this._pub=new i(t),this}function d(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this._priv=new i(t),this}t.exports=m;var p={};function m(t,e,r){this.setGenerator(e),this.__prime=new i(t),this._prime=i.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=c,this.setPrivateKey=d):this._primeCode=8}function g(t,r){var i=new e(t.toArray());return r?i.toString(r):i}Object.defineProperty(m.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!==typeof this._primeCode&&(this._primeCode=function(t,e){var r=e.toString("hex"),i=[r,t.toString(16)].join("_");if(i in p)return p[i];var l,c=0;if(t.isEven()||!f.simpleSieve||!f.fermatTest(t)||!n.test(t))return c+=1,c+="02"===r||"05"===r?8:4,p[i]=c,c;switch(n.test(t.shrn(1))||(c+=2),r){case"02":t.mod(o).cmp(a)&&(c+=8);break;case"05":(l=t.mod(s)).cmp(h)&&l.cmp(u)&&(c+=8);break;default:c+=4}return p[i]=c,c}(this.__prime,this.__gen)),this._primeCode}}),m.prototype.generateKeys=function(){return this._priv||(this._priv=new i(l(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},m.prototype.computeSecret=function(t){var r=(t=(t=new i(t)).toRed(this._prime)).redPow(this._priv).fromRed(),n=new e(r.toArray()),o=this.getPrime();if(n.length0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return a.alloc(0);for(var e,r,i,n=a.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=o.data,r=n,i=s,a.prototype.copy.call(e,r,i),s+=o.data.length,o=o.next;return n}},{key:"consume",value:function(t,e){var r;return tn.length?n.length:t;if(o===n.length?i+=n:i+=n.slice(0,t),0===(t-=o)){o===n.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=n.slice(o));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(t){var e=a.allocUnsafe(t),r=this.head,i=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var n=r.data,o=t>n.length?n.length:t;if(n.copy(e,e.length-t,0,o),0===(t-=o)){o===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(o));break}++i}return this.length-=i,e}},{key:h,value:function(t,e){return s(this,function(t){for(var e=1;e0,(function(t){i||(i=t),t&&a.forEach(u),o||(a.forEach(u),n(i))}))}));return e.reduce(f)}},845:function(t,e,r){var i=r(372).Buffer,n=r(771),o=r(756),a=r(329).ec,s=r(794),h=r(746),u=r(800);function f(t,e,r,o){if((t=i.from(t.toArray())).length0&&r.ishrn(i),r}function c(t,e,r){var o,a;do{for(o=i.alloc(0);8*o.length=49&&u<=54?u-49+10:u>=17&&u<=22?u-17+10:u,a|=h}return i(!(240&a),"Invalid character in "+t),n}function h(t,e,r,n){for(var o=0,a=0,s=Math.min(t.length,r),h=e;h=49?u-49+10:u>=17?u-17+10:u,i(u>=0&&a0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this._strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)a=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=s(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=s(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,a=o%i,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(A){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var l=["","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"],c=[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],d=[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];o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,a=0;a>>24-n&16777215)||a!==this.length-1?l[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=c[t],f=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(f).toString(t);r=(p=p.idivn(f)).isZero()?m+r:l[u-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(a,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function p(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,h=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(a=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r._strip()}o.prototype.toArrayLike=function(t,e,r){this._strip();var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0");var a=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](a,n),a},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,i=0,n=0,o=0;n>8&255),r>16&255),6===o?(r>24&255),i=0,o=0):(i=a>>>24,o+=2)}if(r=0&&(t[r--]=a>>8&255),r>=0&&(t[r--]=a>>16&255),6===o?(r>=0&&(t[r--]=a>>24&255),i=0,o=0):(i=a>>>24,o+=2)}if(r>=0)for(t[r--]=i;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"===typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,g=0|a[2],y=8191&g,b=g>>>13,v=0|a[3],_=8191&v,w=v>>>13,M=0|a[4],S=8191&M,E=M>>>13,k=0|a[5],R=8191&k,A=k>>>13,B=0|a[6],T=8191&B,x=B>>>13,D=0|a[7],O=8191&D,j=D>>>13,I=0|a[8],C=8191&I,P=I>>>13,L=0|a[9],U=8191&L,N=L>>>13,q=0|s[0],K=8191&q,H=q>>>13,F=0|s[1],W=8191&F,z=F>>>13,V=0|s[2],G=8191&V,Z=V>>>13,X=0|s[3],Y=8191&X,J=X>>>13,$=0|s[4],Q=8191&$,tt=$>>>13,et=0|s[5],rt=8191&et,it=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],ht=8191&st,ut=st>>>13,ft=0|s[8],lt=8191&ft,ct=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(u+(i=Math.imul(l,K))|0)+((8191&(n=(n=Math.imul(l,H))+Math.imul(c,K)|0))<<13)|0;u=((o=Math.imul(c,H))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(p,K),n=(n=Math.imul(p,H))+Math.imul(m,K)|0,o=Math.imul(m,H);var yt=(u+(i=i+Math.imul(l,W)|0)|0)+((8191&(n=(n=n+Math.imul(l,z)|0)+Math.imul(c,W)|0))<<13)|0;u=((o=o+Math.imul(c,z)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(y,K),n=(n=Math.imul(y,H))+Math.imul(b,K)|0,o=Math.imul(b,H),i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,z)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,z)|0;var bt=(u+(i=i+Math.imul(l,G)|0)|0)+((8191&(n=(n=n+Math.imul(l,Z)|0)+Math.imul(c,G)|0))<<13)|0;u=((o=o+Math.imul(c,Z)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(_,K),n=(n=Math.imul(_,H))+Math.imul(w,K)|0,o=Math.imul(w,H),i=i+Math.imul(y,W)|0,n=(n=n+Math.imul(y,z)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,z)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,Z)|0;var vt=(u+(i=i+Math.imul(l,Y)|0)|0)+((8191&(n=(n=n+Math.imul(l,J)|0)+Math.imul(c,Y)|0))<<13)|0;u=((o=o+Math.imul(c,J)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(S,K),n=(n=Math.imul(S,H))+Math.imul(E,K)|0,o=Math.imul(E,H),i=i+Math.imul(_,W)|0,n=(n=n+Math.imul(_,z)|0)+Math.imul(w,W)|0,o=o+Math.imul(w,z)|0,i=i+Math.imul(y,G)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,Z)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,J)|0;var _t=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(R,K),n=(n=Math.imul(R,H))+Math.imul(A,K)|0,o=Math.imul(A,H),i=i+Math.imul(S,W)|0,n=(n=n+Math.imul(S,z)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,z)|0,i=i+Math.imul(_,G)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,Z)|0,i=i+Math.imul(y,Y)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var wt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(T,K),n=(n=Math.imul(T,H))+Math.imul(x,K)|0,o=Math.imul(x,H),i=i+Math.imul(R,W)|0,n=(n=n+Math.imul(R,z)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,z)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,J)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,J)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var Mt=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,at)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,at)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,K),n=(n=Math.imul(O,H))+Math.imul(j,K)|0,o=Math.imul(j,H),i=i+Math.imul(T,W)|0,n=(n=n+Math.imul(T,z)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,z)|0,i=i+Math.imul(R,G)|0,n=(n=n+Math.imul(R,Z)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,Z)|0,i=i+Math.imul(S,Y)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,i=i+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,it)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(C,K),n=(n=Math.imul(C,H))+Math.imul(P,K)|0,o=Math.imul(P,H),i=i+Math.imul(O,W)|0,n=(n=n+Math.imul(O,z)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,z)|0,i=i+Math.imul(T,G)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,Z)|0,i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,J)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(_,rt)|0,n=(n=n+Math.imul(_,it)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,it)|0,i=i+Math.imul(y,ot)|0,n=(n=n+Math.imul(y,at)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,at)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var Et=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(U,K),n=(n=Math.imul(U,H))+Math.imul(N,K)|0,o=Math.imul(N,H),i=i+Math.imul(C,W)|0,n=(n=n+Math.imul(C,z)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,z)|0,i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(j,G)|0,o=o+Math.imul(j,Z)|0,i=i+Math.imul(T,Y)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(_,ot)|0,n=(n=n+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,i=i+Math.imul(y,ht)|0,n=(n=n+Math.imul(y,ut)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(U,W),n=(n=Math.imul(U,z))+Math.imul(N,W)|0,o=Math.imul(N,z),i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,Z)|0,i=i+Math.imul(O,Y)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,J)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(R,rt)|0,n=(n=n+Math.imul(R,it)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,at)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,at)|0,i=i+Math.imul(_,ht)|0,n=(n=n+Math.imul(_,ut)|0)+Math.imul(w,ht)|0,o=o+Math.imul(w,ut)|0,i=i+Math.imul(y,lt)|0,n=(n=n+Math.imul(y,ct)|0)+Math.imul(b,lt)|0,o=o+Math.imul(b,ct)|0;var Rt=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(U,G),n=(n=Math.imul(U,Z))+Math.imul(N,G)|0,o=Math.imul(N,Z),i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,J)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(R,ot)|0,n=(n=n+Math.imul(R,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(_,lt)|0,n=(n=n+Math.imul(_,ct)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,ct)|0;var At=(u+(i=i+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,mt)|0)+Math.imul(b,pt)|0))<<13)|0;u=((o=o+Math.imul(b,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(U,Y),n=(n=Math.imul(U,J))+Math.imul(N,Y)|0,o=Math.imul(N,J),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,i=i+Math.imul(R,ht)|0,n=(n=n+Math.imul(R,ut)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Bt=(u+(i=i+Math.imul(_,pt)|0)|0)+((8191&(n=(n=n+Math.imul(_,mt)|0)+Math.imul(w,pt)|0))<<13)|0;u=((o=o+Math.imul(w,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(U,Q),n=(n=Math.imul(U,tt))+Math.imul(N,Q)|0,o=Math.imul(N,tt),i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(R,lt)|0,n=(n=n+Math.imul(R,ct)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,ct)|0;var Tt=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(U,rt),n=(n=Math.imul(U,it))+Math.imul(N,rt)|0,o=Math.imul(N,it),i=i+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var xt=(u+(i=i+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,mt)|0)+Math.imul(A,pt)|0))<<13)|0;u=((o=o+Math.imul(A,mt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(U,ot),n=(n=Math.imul(U,at))+Math.imul(N,ot)|0,o=Math.imul(N,at),i=i+Math.imul(C,ht)|0,n=(n=n+Math.imul(C,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var Dt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,i=Math.imul(U,ht),n=(n=Math.imul(U,ut))+Math.imul(N,ht)|0,o=Math.imul(N,ut),i=i+Math.imul(C,lt)|0,n=(n=n+Math.imul(C,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Ot=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(U,lt),n=(n=Math.imul(U,ct))+Math.imul(N,lt)|0,o=Math.imul(N,ct);var jt=(u+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var It=(u+(i=Math.imul(U,pt))|0)+((8191&(n=(n=Math.imul(U,mt))+Math.imul(N,pt)|0))<<13)|0;return u=((o=Math.imul(N,mt))+(n>>>13)|0)+(It>>>26)|0,It&=67108863,h[0]=gt,h[1]=yt,h[2]=bt,h[3]=vt,h[4]=_t,h[5]=wt,h[6]=Mt,h[7]=St,h[8]=Et,h[9]=kt,h[10]=Rt,h[11]=At,h[12]=Bt,h[13]=Tt,h[14]=xt,h[15]=Dt,h[16]=Ot,h[17]=jt,h[18]=It,0!==u&&(h[19]=u,r.length++),r};function g(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function y(t,e,r){return g(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(m=p),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):r<63?p(this,t,e):r<1024?g(this,t,e):y(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},b.prototype.permute=function(t,e,r,i,n,o){for(var a=0;a>>=1)n++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,r+=o/67108864|0,r+=a>>>26,this.words[n]=67108863&a}return 0!==r&&(this.words[n]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&s}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"===typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===s)return this._strip();for(i(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var s,h=i.length-n.length;if("mod"!==e){(s=new o(null)).length=h+1,s.words=new Array(s.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/a|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);s&&(s.words[l]=c)}return s&&s._strip(),i._strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:s||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:n,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var n,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=(1<<26)%t,n=0,o=this.length-1;o>=0;o--)n=(r*n+(0|this.words[o]))%t;return e?-n:n},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*r;this.words[n]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),a=new o(0),s=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0===(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(f),a.isub(l)),n.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||h.isOdd())&&(s.iadd(f),h.isub(l)),s.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(s),a.isub(h)):(r.isub(e),s.isub(n),h.isub(a))}return{a:s,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,a=new o(1),s=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0===(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);for(var l=0,c=1;0===(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(n=0===e.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"===typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new k(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function _(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function R(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}_.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},_.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(t,e){t.iushrn(this.n,0,e)},_.prototype.imulK=function(t){return t.imul(this.k)},n(w,_),w.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new M;else if("p192"===t)e=new S;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return v[t]=e,e},k.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){i(0===(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(u(t,t.umod(this.m)._forceRed(this)),t)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);i(!n.isZero());var s=new o(1).toRed(this),h=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=a;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();i(g=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===i&&0===f)&&(n=this.mul(n,r[a]),s=0,a=0)):s=0}h=26}return n},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new R(t)},n(R,k),R.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},R.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},R.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},R.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},R.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(99)(t))},847:function(t,e,r){"use strict";var i=r(795);e.certificate=r(853);var n=i.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())}));e.RSAPrivateKey=n;var o=i.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));e.RSAPublicKey=o;var a=i.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())}));e.PublicKey=a;var s=i.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),h=i.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())}));e.PrivateKey=h;var u=i.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));e.EncryptedPrivateKey=u;var f=i.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));e.DSAPrivateKey=f,e.DSAparam=i.define("DSAparam",(function(){this.int()}));var l=i.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(c),this.key("publicKey").optional().explicit(1).bitstr())}));e.ECPrivateKey=l;var c=i.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));e.signature=i.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},848:function(t,e,r){"use strict";var i=r(796),n=r(798),o=r(98);function a(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}e.define=function(t,e){return new a(t,e)},a.prototype._createNamed=function(t){var e=this.name;function r(t){this._initNamed(t,e)}return o(r,t),r.prototype._initNamed=function(e,r){t.call(this,e,r)},new r(this)},a.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(n[t])),this.decoders[t]},a.prototype.decode=function(t,e,r){return this._getDecoder(e).decode(t,r)},a.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(i[t])),this.encoders[t]},a.prototype.encode=function(t,e,r){return this._getEncoder(e).encode(t,r)}},849:function(t,e,r){"use strict";var i=r(98),n=r(797);function o(t){n.call(this,t),this.enc="pem"}i(o,n),t.exports=o,o.prototype.encode=function(t,e){for(var r=n.prototype.encode.call(this,t).toString("base64"),i=["-----BEGIN "+e.label+"-----"],o=0;o=e)throw new Error("invalid sig")}t.exports=function(t,e,r,u,f){var l=a(r);if("ec"===l.type){if("ecdsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");return function(t,e,r){var i=s[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new o(i),a=r.data.subjectPrivateKey.data;return n.verify(e,t,a)}(t,e,l)}if("dsa"===l.type){if("dsa"!==u)throw new Error("wrong public key type");return function(t,e,r){var i=r.data.p,o=r.data.q,s=r.data.g,u=r.data.pub_key,f=a.signature.decode(t,"der"),l=f.s,c=f.r;h(l,o),h(c,o);var d=n.mont(i),p=l.invm(o);return 0===s.toRed(d).redPow(new n(e).mul(p).mod(o)).fromRed().mul(u.toRed(d).redPow(c.mul(p).mod(o)).fromRed()).mod(i).mod(o).cmp(c)}(t,e,l)}if("rsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");e=i.concat([f,e]);for(var c=l.modulus.byteLength(),d=[1],p=0;e.length+d.length+2r-c-2)throw new Error("message too long");var d=l.alloc(r-i-c-2),p=r-f-1,m=n(f),g=s(l.concat([u,d,l.alloc(1,1),e],p),a(m,p)),y=s(m,a(g,f));return new h(l.concat([l.alloc(1),y,g],r))}(p,e);else if(1===c)d=function(t,e,r){var i,o=e.length,a=t.modulus.byteLength();if(o>a-11)throw new Error("message too long");i=r?l.alloc(a-o-3,255):function(t){var e,r=l.allocUnsafe(t),i=0,o=n(2*t),a=0;for(;i=0)throw new Error("data too long for modulus")}return r?f(d,p):u(d,p)}},860:function(t,e,r){var i=r(746),n=r(801),o=r(802),a=r(127),s=r(756),h=r(728),u=r(803),f=r(372).Buffer;t.exports=function(t,e,r){var l;l=t.padding?t.padding:r?1:4;var c,d=i(t),p=d.modulus.byteLength();if(e.length>p||new a(e).cmp(d.modulus)>=0)throw new Error("decryption error");c=r?u(new a(e),d):s(e,d);var m=f.alloc(p-c.length);if(c=f.concat([m,c],p),4===l)return function(t,e){var r=t.modulus.byteLength(),i=h("sha1").update(f.alloc(0)).digest(),a=i.length;if(0!==e[0])throw new Error("decryption error");var s=e.slice(1,a+1),u=e.slice(a+1),l=o(s,n(u,a)),c=o(u,n(l,r-a-1));if(function(t,e){t=f.from(t),e=f.from(e);var r=0,i=t.length;t.length!==e.length&&(r++,i=Math.min(t.length,e.length));var n=-1;for(;++n=e.length){o++;break}var a=e.slice(2,n-1);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return e.slice(n)}(0,c,r);if(3===l)return c;throw new Error("unknown padding")}},861:function(t,e,r){"use strict";(function(t,i){function n(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=r(372),a=r(727),s=o.Buffer,h=o.kMaxLength,u=t.crypto||t.msCrypto,f=Math.pow(2,32)-1;function l(t,e){if("number"!==typeof t||t!==t)throw new TypeError("offset must be a number");if(t>f||t<0)throw new TypeError("offset must be a uint32");if(t>h||t>e)throw new RangeError("offset out of range")}function c(t,e,r){if("number"!==typeof t||t!==t)throw new TypeError("size must be a number");if(t>f||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>h)throw new RangeError("buffer too small")}function d(t,e,r,n){if(i.browser){var o=t.buffer,s=new Uint8Array(o,e,r);return u.getRandomValues(s),n?void i.nextTick((function(){n(null,t)})):t}if(!n)return a(r).copy(t,e),t;a(r,(function(r,i){if(r)return n(r);i.copy(t,e),n(null,t)}))}u&&u.getRandomValues||!i.browser?(e.randomFill=function(e,r,i,n){if(!s.isBuffer(e)&&!(e instanceof t.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"===typeof r)n=r,r=0,i=e.length;else if("function"===typeof i)n=i,i=e.length-r;else if("function"!==typeof n)throw new TypeError('"cb" argument must be a function');return l(r,e.length),c(i,r,e.length),d(e,r,i,n)},e.randomFillSync=function(e,r,i){"undefined"===typeof r&&(r=0);if(!s.isBuffer(e)&&!(e instanceof t.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');l(r,e.length),void 0===i&&(i=e.length-r);return c(i,r,e.length),d(e,r,i)}):(e.randomFill=n,e.randomFillSync=n)}).call(this,r(71),r(90))}}]); \ No newline at end of file diff --git a/static/js/1.7f06461f.chunk.js b/bridge/static/js/1.fff4dd3b.chunk.js similarity index 99% rename from static/js/1.7f06461f.chunk.js rename to bridge/static/js/1.fff4dd3b.chunk.js index c80807b..dde7ec8 100644 --- a/static/js/1.7f06461f.chunk.js +++ b/bridge/static/js/1.fff4dd3b.chunk.js @@ -1 +1 @@ -(this.webpackJsonpbridge=this.webpackJsonpbridge||[]).push([[1],{734:function(t,e,r){"use strict";var n=r(371),i=r.n(n);r.d(e,"a",(function(){return i.a}));var a=r(10),f=r.n(a);r.d(e,"b",(function(){return f.a}));var o=r(448),s=r.n(o);r.d(e,"c",(function(){return s.a}))},802:function(t,e,r){"use strict";(function(t,n,i){r.d(e,"a",(function(){return Ie})),r.d(e,"b",(function(){return ya})),r.d(e,"c",(function(){return so})),r.d(e,"d",(function(){return Bi})),r.d(e,"e",(function(){return Ef})),r.d(e,"f",(function(){return Zo})),r.d(e,"g",(function(){return qo})),r.d(e,"h",(function(){return Di})),r.d(e,"i",(function(){return Ri})),r.d(e,"j",(function(){return zi})),r.d(e,"k",(function(){return Ni})),r.d(e,"l",(function(){return bo})),r.d(e,"m",(function(){return gf})),r.d(e,"n",(function(){return Sf})),r.d(e,"o",(function(){return no})),r.d(e,"p",(function(){return If}));var a=r(12),f=r.n(a),o=r(22),s=r(21),c=r(30),u=r(83),d=r(55),h=r(48),l=r(32),b=r(33),p=r(712),v=(r(52),r(735)),_=(r(372),r(371),r(734)),y=(r(724),r(10),r(448),Object(p.b)((function(t,e){var r=v.a.Buffer;function n(t,e){for(var r in t)e[r]=t[r]}function i(t,e,n){return r(t,e,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=v.a:(n(v.a,e),e.Buffer=i),i.prototype=Object.create(r.prototype),n(r,i),i.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return r(t,e,n)},i.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=r(t);return void 0!==e?"string"==typeof n?i.fill(e,n):i.fill(e):i.fill(0),i},i.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r(t)},i.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return v.a.SlowBuffer(t)}}))),m=(y.Buffer,Object(p.b)((function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}}))),g=y.Buffer,w=v.b.Transform,A=y.Buffer,E=v.b.Transform,I=[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],M=function(t){for(var e=0;e<24;++e){var r=t[0]^t[10]^t[20]^t[30]^t[40],n=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],f=t[4]^t[14]^t[24]^t[34]^t[44],o=t[5]^t[15]^t[25]^t[35]^t[45],s=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],u=t[8]^t[18]^t[28]^t[38]^t[48],d=t[9]^t[19]^t[29]^t[39]^t[49],h=u^(i<<1|a>>>31),l=d^(a<<1|i>>>31),b=t[0]^h,p=t[1]^l,v=t[10]^h,_=t[11]^l,y=t[20]^h,m=t[21]^l,g=t[30]^h,w=t[31]^l,A=t[40]^h,E=t[41]^l;h=r^(f<<1|o>>>31),l=n^(o<<1|f>>>31);var M=t[2]^h,S=t[3]^l,k=t[12]^h,L=t[13]^l,x=t[22]^h,P=t[23]^l,T=t[32]^h,R=t[33]^l,j=t[42]^h,O=t[43]^l;h=i^(s<<1|c>>>31),l=a^(c<<1|s>>>31);var C=t[4]^h,B=t[5]^l,N=t[14]^h,z=t[15]^l,D=t[24]^h,K=t[25]^l,V=t[34]^h,U=t[35]^l,q=t[44]^h,Y=t[45]^l;h=f^(u<<1|d>>>31),l=o^(d<<1|u>>>31);var F=t[6]^h,H=t[7]^l,G=t[16]^h,W=t[17]^l,Z=t[26]^h,J=t[27]^l,X=t[36]^h,$=t[37]^l,Q=t[46]^h,tt=t[47]^l;h=s^(r<<1|n>>>31),l=c^(n<<1|r>>>31);var et=t[8]^h,rt=t[9]^l,nt=t[18]^h,it=t[19]^l,at=t[28]^h,ft=t[29]^l,ot=t[38]^h,st=t[39]^l,ct=t[48]^h,ut=t[49]^l,dt=b,ht=p,lt=_<<4|v>>>28,bt=v<<4|_>>>28,pt=y<<3|m>>>29,vt=m<<3|y>>>29,_t=w<<9|g>>>23,yt=g<<9|w>>>23,mt=A<<18|E>>>14,gt=E<<18|A>>>14,wt=M<<1|S>>>31,At=S<<1|M>>>31,Et=L<<12|k>>>20,It=k<<12|L>>>20,Mt=x<<10|P>>>22,St=P<<10|x>>>22,kt=R<<13|T>>>19,Lt=T<<13|R>>>19,xt=j<<2|O>>>30,Pt=O<<2|j>>>30,Tt=B<<30|C>>>2,Rt=C<<30|B>>>2,jt=N<<6|z>>>26,Ot=z<<6|N>>>26,Ct=K<<11|D>>>21,Bt=D<<11|K>>>21,Nt=V<<15|U>>>17,zt=U<<15|V>>>17,Dt=Y<<29|q>>>3,Kt=q<<29|Y>>>3,Vt=F<<28|H>>>4,Ut=H<<28|F>>>4,qt=W<<23|G>>>9,Yt=G<<23|W>>>9,Ft=Z<<25|J>>>7,Ht=J<<25|Z>>>7,Gt=X<<21|$>>>11,Wt=$<<21|X>>>11,Zt=tt<<24|Q>>>8,Jt=Q<<24|tt>>>8,Xt=et<<27|rt>>>5,$t=rt<<27|et>>>5,Qt=nt<<20|it>>>12,te=it<<20|nt>>>12,ee=ft<<7|at>>>25,re=at<<7|ft>>>25,ne=ot<<8|st>>>24,ie=st<<8|ot>>>24,ae=ct<<14|ut>>>18,fe=ut<<14|ct>>>18;t[0]=dt^~Et&Ct,t[1]=ht^~It&Bt,t[10]=Vt^~Qt&pt,t[11]=Ut^~te&vt,t[20]=wt^~jt&Ft,t[21]=At^~Ot&Ht,t[30]=Xt^~lt&Mt,t[31]=$t^~bt&St,t[40]=Tt^~qt&ee,t[41]=Rt^~Yt&re,t[2]=Et^~Ct&Gt,t[3]=It^~Bt&Wt,t[12]=Qt^~pt&kt,t[13]=te^~vt&Lt,t[22]=jt^~Ft&ne,t[23]=Ot^~Ht&ie,t[32]=lt^~Mt&Nt,t[33]=bt^~St&zt,t[42]=qt^~ee&_t,t[43]=Yt^~re&yt,t[4]=Ct^~Gt&ae,t[5]=Bt^~Wt&fe,t[14]=pt^~kt&Dt,t[15]=vt^~Lt&Kt,t[24]=Ft^~ne&mt,t[25]=Ht^~ie>,t[34]=Mt^~Nt&Zt,t[35]=St^~zt&Jt,t[44]=ee^~_t&xt,t[45]=re^~yt&Pt,t[6]=Gt^~ae&dt,t[7]=Wt^~fe&ht,t[16]=kt^~Dt&Vt,t[17]=Lt^~Kt&Ut,t[26]=ne^~mt&wt,t[27]=ie^~gt&At,t[36]=Nt^~Zt&Xt,t[37]=zt^~Jt&$t,t[46]=_t^~xt&Tt,t[47]=yt^~Pt&Rt,t[8]=ae^~dt&Et,t[9]=fe^~ht&It,t[18]=Dt^~Vt&Qt,t[19]=Kt^~Ut&te,t[28]=mt^~wt&jt,t[29]=gt^~At&Ot,t[38]=Zt^~Xt<,t[39]=Jt^~$t&bt,t[48]=xt^~Tt&qt,t[49]=Pt^~Rt&Yt,t[0]^=I[2*e],t[1]^=I[2*e+1]}},S=y.Buffer;function k(){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}k.prototype.initialize=function(t,e){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1},k.prototype.absorb=function(t){for(var e=0;e>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(M(this.state),this.count=0);return e},k.prototype.copy=function(t){for(var e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var L=function(t){var e=function(t){function e(e,r,n,i,a){w.call(this,a),this._rate=e,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=i,this._options=a,this._state=new t,this._state.initialize(e,r),this._finalized=!1}return m(e,w),e.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},e.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},e.prototype.update=function(t,e){if(!g.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return g.isBuffer(t)||(t=g.from(t,e)),this._state.absorb(t),this},e.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var e=this._state.squeeze(this._hashBitLength/8);return void 0!==t&&(e=e.toString(t)),this._resetState(),e},e.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},e.prototype._clone=function(){var t=new e(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t},e}(t),r=function(t){function e(e,r,n,i){E.call(this,i),this._rate=e,this._capacity=r,this._delimitedSuffix=n,this._options=i,this._state=new t,this._state.initialize(e,r),this._finalized=!1}return m(e,E),e.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},e.prototype._flush=function(){},e.prototype._read=function(t){this.push(this.squeeze(t))},e.prototype.update=function(t,e){if(!A.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return A.isBuffer(t)||(t=A.from(t,e)),this._state.absorb(t),this},e.prototype.squeeze=function(t,e){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(t);return void 0!==e&&(r=r.toString(e)),r},e.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},e.prototype._clone=function(){var t=new e(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t},e}(t);return function(t,n){switch("string"==typeof t?t.toLowerCase():t){case"keccak224":return new e(1152,448,null,224,n);case"keccak256":return new e(1088,512,null,256,n);case"keccak384":return new e(832,768,null,384,n);case"keccak512":return new e(576,1024,null,512,n);case"sha3-224":return new e(1152,448,6,224,n);case"sha3-256":return new e(1088,512,6,256,n);case"sha3-384":return new e(832,768,6,384,n);case"sha3-512":return new e(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+t)}}}(k),x=Object.prototype.toString,P=function(e,r){if(!t.isBuffer(e))throw TypeError(r)},T=function(t,e,r){if(t.length!==e)throw RangeError(r)},R=function(t,e,r,n){if(t.length!==e&&t.length!==r)throw RangeError(n)},j=function(t,e){if(0===t.length)throw RangeError(e)},O=y.Buffer,C=function(t){if(t.length<8)throw new Error("DER sequence length is too short");if(t.length>72)throw new Error("DER sequence length is too long");if(48!==t[0])throw new Error("Expected DER sequence");if(t[1]!==t.length-2)throw new Error("DER sequence length is invalid");if(2!==t[2])throw new Error("Expected DER integer");var e=t[3];if(0===e)throw new Error("R length is zero");if(5+e>=t.length)throw new Error("R length is too long");if(2!==t[4+e])throw new Error("Expected DER integer (2)");var r=t[5+e];if(0===r)throw new Error("S length is zero");if(6+e+r!==t.length)throw new Error("S length is invalid");if(128&t[4])throw new Error("R value is negative");if(e>1&&0===t[4]&&!(128&t[5]))throw new Error("R value excessively padded");if(128&t[e+6])throw new Error("S value is negative");if(r>1&&0===t[e+6]&&!(128&t[e+7]))throw new Error("S value excessively padded");return{r:t.slice(4,4+e),s:t.slice(6+e)}},B=function(t,e){var r=t.length,n=e.length;if(0===r)throw new Error("R length is zero");if(0===n)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(n>33)throw new Error("S length is too long");if(128&t[0])throw new Error("R value is negative");if(128&e[0])throw new Error("S value is negative");if(r>1&&0===t[0]&&!(128&t[1]))throw new Error("R value excessively padded");if(n>1&&0===e[0]&&!(128&e[1]))throw new Error("S value excessively padded");var i=O.allocUnsafe(6+r+n);return i[0]=48,i[1]=i.length-2,i[2]=2,i[3]=t.length,t.copy(i,4),i[4+r]=2,i[5+r]=e.length,e.copy(i,6+r),i},N=y.Buffer,z=N.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]),D=N.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]),K="scalar was invalid (zero or overflow)",V="nonce generation function failed or private key is invalid",U={COMPRESSED_TYPE_INVALID:"compressed should be a boolean",EC_PRIVATE_KEY_TYPE_INVALID:"private key should be a Buffer",EC_PRIVATE_KEY_LENGTH_INVALID:"private key length is invalid",EC_PRIVATE_KEY_RANGE_INVALID:"private key range is invalid",EC_PRIVATE_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting private key is invalid",EC_PRIVATE_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PRIVATE_KEY_EXPORT_DER_FAIL:"couldn't export to DER format",EC_PRIVATE_KEY_IMPORT_DER_FAIL:"couldn't import from DER format",EC_PUBLIC_KEYS_TYPE_INVALID:"public keys should be an Array",EC_PUBLIC_KEYS_LENGTH_INVALID:"public keys Array should have at least 1 element",EC_PUBLIC_KEY_TYPE_INVALID:"public key should be a Buffer",EC_PUBLIC_KEY_LENGTH_INVALID:"public key length is invalid",EC_PUBLIC_KEY_PARSE_FAIL:"the public key could not be parsed or is invalid",EC_PUBLIC_KEY_CREATE_FAIL:"private was invalid, try again",EC_PUBLIC_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting public key is invalid",EC_PUBLIC_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PUBLIC_KEY_COMBINE_FAIL:"the sum of the public keys is not valid",ECDH_FAIL:K,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:V,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"},q=Object(p.f)(Object.freeze({__proto__:null,COMPRESSED_TYPE_INVALID:"compressed should be a boolean",EC_PRIVATE_KEY_TYPE_INVALID:"private key should be a Buffer",EC_PRIVATE_KEY_LENGTH_INVALID:"private key length is invalid",EC_PRIVATE_KEY_RANGE_INVALID:"private key range is invalid",EC_PRIVATE_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting private key is invalid",EC_PRIVATE_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PRIVATE_KEY_EXPORT_DER_FAIL:"couldn't export to DER format",EC_PRIVATE_KEY_IMPORT_DER_FAIL:"couldn't import from DER format",EC_PUBLIC_KEYS_TYPE_INVALID:"public keys should be an Array",EC_PUBLIC_KEYS_LENGTH_INVALID:"public keys Array should have at least 1 element",EC_PUBLIC_KEY_TYPE_INVALID:"public key should be a Buffer",EC_PUBLIC_KEY_LENGTH_INVALID:"public key length is invalid",EC_PUBLIC_KEY_PARSE_FAIL:"the public key could not be parsed or is invalid",EC_PUBLIC_KEY_CREATE_FAIL:"private was invalid, try again",EC_PUBLIC_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting public key is invalid",EC_PUBLIC_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PUBLIC_KEY_COMBINE_FAIL:"the sum of the public keys is not valid",ECDH_FAIL:K,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:V,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",default:U}));function Y(t,e){return void 0===t?e:(function(t,e){if("[object Boolean]"!==x.call(t))throw TypeError(e)}(t,q.COMPRESSED_TYPE_INVALID),t)}var F=y.Buffer,H=v.b.Transform;function G(t){H.call(this),this._block=F.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}m(G,H),G.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},G.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},G.prototype.update=function(t,e){if(function(t,e){if(!F.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer")}(t),this._finalized)throw new Error("Digest already called");F.isBuffer(t)||(t=F.from(t,e));for(var r=this._block,n=0;this._blockOffset+t.length-n>=this._blockSize;){for(var i=this._blockOffset;i0;++a)this._length[a]+=f,(f=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*f);return this},G.prototype._update=function(){throw new Error("_update is not implemented")},G.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},G.prototype._digest=function(){throw new Error("_digest is not implemented")};var W=G,Z=y.Buffer,J=new Array(16);function X(){W.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function $(t,e){return t<>>32-e}function Q(t,e,r,n,i,a,f){return $(t+(e&r|~e&n)+i+a|0,f)+e|0}function tt(t,e,r,n,i,a,f){return $(t+(e&n|r&~n)+i+a|0,f)+e|0}function et(t,e,r,n,i,a,f){return $(t+(e^r^n)+i+a|0,f)+e|0}function rt(t,e,r,n,i,a,f){return $(t+(r^(e|~n))+i+a|0,f)+e|0}m(X,W),X.prototype._update=function(){for(var t=J,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,a=this._d;r=Q(r,n,i,a,t[0],3614090360,7),a=Q(a,r,n,i,t[1],3905402710,12),i=Q(i,a,r,n,t[2],606105819,17),n=Q(n,i,a,r,t[3],3250441966,22),r=Q(r,n,i,a,t[4],4118548399,7),a=Q(a,r,n,i,t[5],1200080426,12),i=Q(i,a,r,n,t[6],2821735955,17),n=Q(n,i,a,r,t[7],4249261313,22),r=Q(r,n,i,a,t[8],1770035416,7),a=Q(a,r,n,i,t[9],2336552879,12),i=Q(i,a,r,n,t[10],4294925233,17),n=Q(n,i,a,r,t[11],2304563134,22),r=Q(r,n,i,a,t[12],1804603682,7),a=Q(a,r,n,i,t[13],4254626195,12),i=Q(i,a,r,n,t[14],2792965006,17),r=tt(r,n=Q(n,i,a,r,t[15],1236535329,22),i,a,t[1],4129170786,5),a=tt(a,r,n,i,t[6],3225465664,9),i=tt(i,a,r,n,t[11],643717713,14),n=tt(n,i,a,r,t[0],3921069994,20),r=tt(r,n,i,a,t[5],3593408605,5),a=tt(a,r,n,i,t[10],38016083,9),i=tt(i,a,r,n,t[15],3634488961,14),n=tt(n,i,a,r,t[4],3889429448,20),r=tt(r,n,i,a,t[9],568446438,5),a=tt(a,r,n,i,t[14],3275163606,9),i=tt(i,a,r,n,t[3],4107603335,14),n=tt(n,i,a,r,t[8],1163531501,20),r=tt(r,n,i,a,t[13],2850285829,5),a=tt(a,r,n,i,t[2],4243563512,9),i=tt(i,a,r,n,t[7],1735328473,14),r=et(r,n=tt(n,i,a,r,t[12],2368359562,20),i,a,t[5],4294588738,4),a=et(a,r,n,i,t[8],2272392833,11),i=et(i,a,r,n,t[11],1839030562,16),n=et(n,i,a,r,t[14],4259657740,23),r=et(r,n,i,a,t[1],2763975236,4),a=et(a,r,n,i,t[4],1272893353,11),i=et(i,a,r,n,t[7],4139469664,16),n=et(n,i,a,r,t[10],3200236656,23),r=et(r,n,i,a,t[13],681279174,4),a=et(a,r,n,i,t[0],3936430074,11),i=et(i,a,r,n,t[3],3572445317,16),n=et(n,i,a,r,t[6],76029189,23),r=et(r,n,i,a,t[9],3654602809,4),a=et(a,r,n,i,t[12],3873151461,11),i=et(i,a,r,n,t[15],530742520,16),r=rt(r,n=et(n,i,a,r,t[2],3299628645,23),i,a,t[0],4096336452,6),a=rt(a,r,n,i,t[7],1126891415,10),i=rt(i,a,r,n,t[14],2878612391,15),n=rt(n,i,a,r,t[5],4237533241,21),r=rt(r,n,i,a,t[12],1700485571,6),a=rt(a,r,n,i,t[3],2399980690,10),i=rt(i,a,r,n,t[10],4293915773,15),n=rt(n,i,a,r,t[1],2240044497,21),r=rt(r,n,i,a,t[8],1873313359,6),a=rt(a,r,n,i,t[15],4264355552,10),i=rt(i,a,r,n,t[6],2734768916,15),n=rt(n,i,a,r,t[13],1309151649,21),r=rt(r,n,i,a,t[4],4149444226,6),a=rt(a,r,n,i,t[11],3174756917,10),i=rt(i,a,r,n,t[2],718787259,15),n=rt(n,i,a,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+a|0},X.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 t=Z.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t};var nt=X,it=v.a.Buffer,at=new Array(16),ft=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],ot=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],st=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],ct=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],ut=[0,1518500249,1859775393,2400959708,2840853838],dt=[1352829926,1548603684,1836072691,2053994217,0];function ht(){W.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function lt(t,e){return t<>>32-e}function bt(t,e,r,n,i,a,f,o){return lt(t+(e^r^n)+a+f|0,o)+i|0}function pt(t,e,r,n,i,a,f,o){return lt(t+(e&r|~e&n)+a+f|0,o)+i|0}function vt(t,e,r,n,i,a,f,o){return lt(t+((e|~r)^n)+a+f|0,o)+i|0}function _t(t,e,r,n,i,a,f,o){return lt(t+(e&n|r&~n)+a+f|0,o)+i|0}function yt(t,e,r,n,i,a,f,o){return lt(t+(e^(r|~n))+a+f|0,o)+i|0}m(ht,W),ht.prototype._update=function(){for(var t=at,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,n=0|this._b,i=0|this._c,a=0|this._d,f=0|this._e,o=0|this._a,s=0|this._b,c=0|this._c,u=0|this._d,d=0|this._e,h=0;h<80;h+=1){var l,b;h<16?(l=bt(r,n,i,a,f,t[ft[h]],ut[0],st[h]),b=yt(o,s,c,u,d,t[ot[h]],dt[0],ct[h])):h<32?(l=pt(r,n,i,a,f,t[ft[h]],ut[1],st[h]),b=_t(o,s,c,u,d,t[ot[h]],dt[1],ct[h])):h<48?(l=vt(r,n,i,a,f,t[ft[h]],ut[2],st[h]),b=vt(o,s,c,u,d,t[ot[h]],dt[2],ct[h])):h<64?(l=_t(r,n,i,a,f,t[ft[h]],ut[3],st[h]),b=pt(o,s,c,u,d,t[ot[h]],dt[3],ct[h])):(l=yt(r,n,i,a,f,t[ft[h]],ut[4],st[h]),b=bt(o,s,c,u,d,t[ot[h]],dt[4],ct[h])),r=f,f=a,a=lt(i,10),i=n,n=l,o=d,d=u,u=lt(c,10),c=s,s=b}var p=this._b+i+u|0;this._b=this._c+a+d|0,this._c=this._d+f+o|0,this._d=this._e+r+s|0,this._e=this._a+n+c|0,this._a=p},ht.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 t=it.alloc?it.alloc(20):new it(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t};var mt=ht,gt=y.Buffer;function wt(t,e){this._block=gt.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}wt.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=gt.from(t,e));for(var r=this._block,n=this._blockSize,i=t.length,a=this._len,f=0;f=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var a=this._hash();return t?a.toString(t):a},wt.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var At=wt,Et=y.Buffer,It=[1518500249,1859775393,-1894007588,-899497514],Mt=new Array(80);function St(){this.init(),this._w=Mt,At.call(this,64,56)}function kt(t){return t<<30|t>>>2}function Lt(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}m(St,At),St.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},St.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,a=0|this._c,f=0|this._d,o=0|this._e,s=0;s<16;++s)r[s]=t.readInt32BE(4*s);for(;s<80;++s)r[s]=r[s-3]^r[s-8]^r[s-14]^r[s-16];for(var c=0;c<80;++c){var u=~~(c/20),d=0|((e=n)<<5|e>>>27)+Lt(u,i,a,f)+o+r[c]+It[u];o=f,f=a,a=kt(i),i=n,n=d}this._a=n+this._a|0,this._b=i+this._b|0,this._c=a+this._c|0,this._d=f+this._d|0,this._e=o+this._e|0},St.prototype._hash=function(){var t=Et.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t};var xt=St,Pt=y.Buffer,Tt=[1518500249,1859775393,-1894007588,-899497514],Rt=new Array(80);function jt(){this.init(),this._w=Rt,At.call(this,64,56)}function Ot(t){return t<<5|t>>>27}function Ct(t){return t<<30|t>>>2}function Bt(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}m(jt,At),jt.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},jt.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,a=0|this._c,f=0|this._d,o=0|this._e,s=0;s<16;++s)r[s]=t.readInt32BE(4*s);for(;s<80;++s)r[s]=(e=r[s-3]^r[s-8]^r[s-14]^r[s-16])<<1|e>>>31;for(var c=0;c<80;++c){var u=~~(c/20),d=Ot(n)+Bt(u,i,a,f)+o+r[c]+Tt[u]|0;o=f,f=a,a=Ct(i),i=n,n=d}this._a=n+this._a|0,this._b=i+this._b|0,this._c=a+this._c|0,this._d=f+this._d|0,this._e=o+this._e|0},jt.prototype._hash=function(){var t=Pt.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t};var Nt=jt,zt=y.Buffer,Dt=[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],Kt=new Array(64);function Vt(){this.init(),this._w=Kt,At.call(this,64,56)}function Ut(t,e,r){return r^t&(e^r)}function qt(t,e,r){return t&e|r&(t|e)}function Yt(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function Ft(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function Ht(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}m(Vt,At),Vt.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},Vt.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,a=0|this._c,f=0|this._d,o=0|this._e,s=0|this._f,c=0|this._g,u=0|this._h,d=0;d<16;++d)r[d]=t.readInt32BE(4*d);for(;d<64;++d)r[d]=0|(((e=r[d-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[d-7]+Ht(r[d-15])+r[d-16];for(var h=0;h<64;++h){var l=u+Ft(o)+Ut(o,s,c)+Dt[h]+r[h]|0,b=Yt(n)+qt(n,i,a)|0;u=c,c=s,s=o,o=f+l|0,f=a,a=i,i=n,n=l+b|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=a+this._c|0,this._d=f+this._d|0,this._e=o+this._e|0,this._f=s+this._f|0,this._g=c+this._g|0,this._h=u+this._h|0},Vt.prototype._hash=function(){var t=zt.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};var Gt=Vt,Wt=y.Buffer,Zt=new Array(64);function Jt(){this.init(),this._w=Zt,At.call(this,64,56)}m(Jt,Gt),Jt.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},Jt.prototype._hash=function(){var t=Wt.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};var Xt=Jt,$t=y.Buffer,Qt=[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],te=new Array(160);function ee(){this.init(),this._w=te,At.call(this,128,112)}function re(t,e,r){return r^t&(e^r)}function ne(t,e,r){return t&e|r&(t|e)}function ie(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function ae(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function fe(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function oe(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function se(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function ce(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function ue(t,e){return t>>>0>>0?1:0}m(ee,At),ee.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},ee.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,a=0|this._dh,f=0|this._eh,o=0|this._fh,s=0|this._gh,c=0|this._hh,u=0|this._al,d=0|this._bl,h=0|this._cl,l=0|this._dl,b=0|this._el,p=0|this._fl,v=0|this._gl,_=0|this._hl,y=0;y<32;y+=2)e[y]=t.readInt32BE(4*y),e[y+1]=t.readInt32BE(4*y+4);for(;y<160;y+=2){var m=e[y-30],g=e[y-30+1],w=fe(m,g),A=oe(g,m),E=se(m=e[y-4],g=e[y-4+1]),I=ce(g,m),M=e[y-14],S=e[y-14+1],k=e[y-32],L=e[y-32+1],x=A+S|0,P=w+M+ue(x,A)|0;P=(P=P+E+ue(x=x+I|0,I)|0)+k+ue(x=x+L|0,L)|0,e[y]=P,e[y+1]=x}for(var T=0;T<160;T+=2){P=e[T],x=e[T+1];var R=ne(r,n,i),j=ne(u,d,h),O=ie(r,u),C=ie(u,r),B=ae(f,b),N=ae(b,f),z=Qt[T],D=Qt[T+1],K=re(f,o,s),V=re(b,p,v),U=_+N|0,q=c+B+ue(U,_)|0;q=(q=(q=q+K+ue(U=U+V|0,V)|0)+z+ue(U=U+D|0,D)|0)+P+ue(U=U+x|0,x)|0;var Y=C+j|0,F=O+R+ue(Y,C)|0;c=s,_=v,s=o,v=p,o=f,p=b,f=a+q+ue(b=l+U|0,l)|0,a=i,l=h,i=n,h=d,n=r,d=u,r=q+F+ue(u=U+Y|0,U)|0}this._al=this._al+u|0,this._bl=this._bl+d|0,this._cl=this._cl+h|0,this._dl=this._dl+l|0,this._el=this._el+b|0,this._fl=this._fl+p|0,this._gl=this._gl+v|0,this._hl=this._hl+_|0,this._ah=this._ah+r+ue(this._al,u)|0,this._bh=this._bh+n+ue(this._bl,d)|0,this._ch=this._ch+i+ue(this._cl,h)|0,this._dh=this._dh+a+ue(this._dl,l)|0,this._eh=this._eh+f+ue(this._el,b)|0,this._fh=this._fh+o+ue(this._fl,p)|0,this._gh=this._gh+s+ue(this._gl,v)|0,this._hh=this._hh+c+ue(this._hl,_)|0},ee.prototype._hash=function(){var t=$t.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};var de=ee,he=y.Buffer,le=new Array(160);function be(){this.init(),this._w=le,At.call(this,128,112)}m(be,de),be.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},be.prototype._hash=function(){var t=he.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};var pe=be,ve=Object(p.b)((function(t){var e=t.exports=function(t){t=t.toLowerCase();var r=e[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};e.sha=xt,e.sha1=Nt,e.sha224=Xt,e.sha256=Gt,e.sha384=pe,e.sha512=de})),_e=y.Buffer,ye=v.b.Transform,me=_.a.StringDecoder;function ge(t){ye.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}m(ge,ye),ge.prototype.update=function(t,e,r){"string"==typeof t&&(t=_e.from(t,e));var n=this._update(t);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},ge.prototype.setAutoPadding=function(){},ge.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},ge.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},ge.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},ge.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},ge.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},ge.prototype._finalOrDigest=function(t){var e=this.__final()||_e.alloc(0);return t&&(e=this._toString(e,t,!0)),e},ge.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new me(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n};var we=ge;function Ae(t){we.call(this,"digest"),this._hash=t}m(Ae,we),Ae.prototype._update=function(t){this._hash.update(t)},Ae.prototype._final=function(){return this._hash.digest()};var Ee=function(t){return"md5"===(t=t.toLowerCase())?new nt:"rmd160"===t||"ripemd160"===t?new mt:new Ae(ve(t))},Ie=Object(p.b)((function(t){!function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{a=v.a.Buffer}catch(t){}function f(t,e,r){for(var n=0,i=Math.min(t.length,r),a=e;a=49&&f<=54?f-49+10:f>=17&&f<=22?f-17+10:15&f}return n}function o(t,e,r,n){for(var i=0,a=Math.min(t.length,r),f=e;f=49?o-49+10:o>=17?o-17+10:o}return i}i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initArray=function(t,e,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)f=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=f<>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);else if("le"===n)for(i=0,a=0;i>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);return this.strip()},i.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=f(t,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==e&&(i=f(t,e,r+6),this.words[n]|=i<>>26-a&4194303),this.strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,f=a%n,s=Math.min(a,a-f)+r,c=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var s=["","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"],c=[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],u=[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];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],f=i*a,o=67108863&f,s=f/67108864|0;r.words[0]=o;for(var c=1;c>>26,d=67108863&s,h=Math.min(c,e.length-1),l=Math.max(0,c-t.length+1);l<=h;l++){var b=c-l|0;u+=(f=(i=0|t.words[b])*(a=0|e.words[l])+d)/67108864|0,d=67108863&f}r.words[c]=0|d,s=0|u}return 0!==s?r.words[c]=0|s:r.length--,r.strip()}i.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var i=0,a=0,f=0;f>>24-i&16777215)||f!==this.length-1?s[6-d.length]+d+n:d+n,(i+=2)>=26&&(i-=26,f--)}for(0!==a&&(n=a.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var h=c[t],l=u[t];n="";var b=this.clone();for(b.negative=0;!b.isZero();){var p=b.modn(l).toString(t);n=(b=b.idivn(l)).isZero()?p+n:s[h-p.length]+p+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(t,e){return r(void 0!==a),this.toArrayLike(a,t,e)},i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,n){var i=this.byteLength(),a=n||Math.max(1,i);r(i<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0"),this.strip();var f,o,s="le"===e,c=new t(a),u=this.clone();if(s){for(o=0;!u.isZero();o++)f=u.andln(255),u.iushrn(8),c[o]=f;for(;o=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var n=t/26|0,i=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,f=0;f>26,this.words[f]=67108863&e;for(;0!==a&&f>26,this.words[f]=67108863&e;if(0===a&&f>>13,l=0|f[1],b=8191&l,p=l>>>13,v=0|f[2],_=8191&v,y=v>>>13,m=0|f[3],g=8191&m,w=m>>>13,A=0|f[4],E=8191&A,I=A>>>13,M=0|f[5],S=8191&M,k=M>>>13,L=0|f[6],x=8191&L,P=L>>>13,T=0|f[7],R=8191&T,j=T>>>13,O=0|f[8],C=8191&O,B=O>>>13,N=0|f[9],z=8191&N,D=N>>>13,K=0|o[0],V=8191&K,U=K>>>13,q=0|o[1],Y=8191&q,F=q>>>13,H=0|o[2],G=8191&H,W=H>>>13,Z=0|o[3],J=8191&Z,X=Z>>>13,$=0|o[4],Q=8191&$,tt=$>>>13,et=0|o[5],rt=8191&et,nt=et>>>13,it=0|o[6],at=8191&it,ft=it>>>13,ot=0|o[7],st=8191&ot,ct=ot>>>13,ut=0|o[8],dt=8191&ut,ht=ut>>>13,lt=0|o[9],bt=8191<,pt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(c+(n=Math.imul(d,V))|0)+((8191&(i=(i=Math.imul(d,U))+Math.imul(h,V)|0))<<13)|0;c=((a=Math.imul(h,U))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(b,V),i=(i=Math.imul(b,U))+Math.imul(p,V)|0,a=Math.imul(p,U);var _t=(c+(n=n+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,F)|0)+Math.imul(h,Y)|0))<<13)|0;c=((a=a+Math.imul(h,F)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(_,V),i=(i=Math.imul(_,U))+Math.imul(y,V)|0,a=Math.imul(y,U),n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,F)|0)+Math.imul(p,Y)|0,a=a+Math.imul(p,F)|0;var yt=(c+(n=n+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,W)|0)+Math.imul(h,G)|0))<<13)|0;c=((a=a+Math.imul(h,W)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(g,V),i=(i=Math.imul(g,U))+Math.imul(w,V)|0,a=Math.imul(w,U),n=n+Math.imul(_,Y)|0,i=(i=i+Math.imul(_,F)|0)+Math.imul(y,Y)|0,a=a+Math.imul(y,F)|0,n=n+Math.imul(b,G)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(p,G)|0,a=a+Math.imul(p,W)|0;var mt=(c+(n=n+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(h,J)|0))<<13)|0;c=((a=a+Math.imul(h,X)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(E,V),i=(i=Math.imul(E,U))+Math.imul(I,V)|0,a=Math.imul(I,U),n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,F)|0)+Math.imul(w,Y)|0,a=a+Math.imul(w,F)|0,n=n+Math.imul(_,G)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(y,G)|0,a=a+Math.imul(y,W)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(p,J)|0,a=a+Math.imul(p,X)|0;var gt=(c+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,tt)|0)+Math.imul(h,Q)|0))<<13)|0;c=((a=a+Math.imul(h,tt)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(S,V),i=(i=Math.imul(S,U))+Math.imul(k,V)|0,a=Math.imul(k,U),n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,F)|0)+Math.imul(I,Y)|0,a=a+Math.imul(I,F)|0,n=n+Math.imul(g,G)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(w,G)|0,a=a+Math.imul(w,W)|0,n=n+Math.imul(_,J)|0,i=(i=i+Math.imul(_,X)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,X)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(p,Q)|0,a=a+Math.imul(p,tt)|0;var wt=(c+(n=n+Math.imul(d,rt)|0)|0)+((8191&(i=(i=i+Math.imul(d,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((a=a+Math.imul(h,nt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(x,V),i=(i=Math.imul(x,U))+Math.imul(P,V)|0,a=Math.imul(P,U),n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,F)|0)+Math.imul(k,Y)|0,a=a+Math.imul(k,F)|0,n=n+Math.imul(E,G)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(I,G)|0,a=a+Math.imul(I,W)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(w,J)|0,a=a+Math.imul(w,X)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(y,Q)|0,a=a+Math.imul(y,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(p,rt)|0,a=a+Math.imul(p,nt)|0;var At=(c+(n=n+Math.imul(d,at)|0)|0)+((8191&(i=(i=i+Math.imul(d,ft)|0)+Math.imul(h,at)|0))<<13)|0;c=((a=a+Math.imul(h,ft)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(R,V),i=(i=Math.imul(R,U))+Math.imul(j,V)|0,a=Math.imul(j,U),n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,F)|0)+Math.imul(P,Y)|0,a=a+Math.imul(P,F)|0,n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(k,G)|0,a=a+Math.imul(k,W)|0,n=n+Math.imul(E,J)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(I,J)|0,a=a+Math.imul(I,X)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(y,rt)|0,a=a+Math.imul(y,nt)|0,n=n+Math.imul(b,at)|0,i=(i=i+Math.imul(b,ft)|0)+Math.imul(p,at)|0,a=a+Math.imul(p,ft)|0;var Et=(c+(n=n+Math.imul(d,st)|0)|0)+((8191&(i=(i=i+Math.imul(d,ct)|0)+Math.imul(h,st)|0))<<13)|0;c=((a=a+Math.imul(h,ct)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,V),i=(i=Math.imul(C,U))+Math.imul(B,V)|0,a=Math.imul(B,U),n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,F)|0)+Math.imul(j,Y)|0,a=a+Math.imul(j,F)|0,n=n+Math.imul(x,G)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(P,G)|0,a=a+Math.imul(P,W)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(I,Q)|0,a=a+Math.imul(I,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(w,rt)|0,a=a+Math.imul(w,nt)|0,n=n+Math.imul(_,at)|0,i=(i=i+Math.imul(_,ft)|0)+Math.imul(y,at)|0,a=a+Math.imul(y,ft)|0,n=n+Math.imul(b,st)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(p,st)|0,a=a+Math.imul(p,ct)|0;var It=(c+(n=n+Math.imul(d,dt)|0)|0)+((8191&(i=(i=i+Math.imul(d,ht)|0)+Math.imul(h,dt)|0))<<13)|0;c=((a=a+Math.imul(h,ht)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(z,V),i=(i=Math.imul(z,U))+Math.imul(D,V)|0,a=Math.imul(D,U),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,F)|0)+Math.imul(B,Y)|0,a=a+Math.imul(B,F)|0,n=n+Math.imul(R,G)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(j,G)|0,a=a+Math.imul(j,W)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(P,J)|0,a=a+Math.imul(P,X)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(k,Q)|0,a=a+Math.imul(k,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(I,rt)|0,a=a+Math.imul(I,nt)|0,n=n+Math.imul(g,at)|0,i=(i=i+Math.imul(g,ft)|0)+Math.imul(w,at)|0,a=a+Math.imul(w,ft)|0,n=n+Math.imul(_,st)|0,i=(i=i+Math.imul(_,ct)|0)+Math.imul(y,st)|0,a=a+Math.imul(y,ct)|0,n=n+Math.imul(b,dt)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(p,dt)|0,a=a+Math.imul(p,ht)|0;var Mt=(c+(n=n+Math.imul(d,bt)|0)|0)+((8191&(i=(i=i+Math.imul(d,pt)|0)+Math.imul(h,bt)|0))<<13)|0;c=((a=a+Math.imul(h,pt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(z,Y),i=(i=Math.imul(z,F))+Math.imul(D,Y)|0,a=Math.imul(D,F),n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(B,G)|0,a=a+Math.imul(B,W)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(j,J)|0,a=a+Math.imul(j,X)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(P,Q)|0,a=a+Math.imul(P,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(k,rt)|0,a=a+Math.imul(k,nt)|0,n=n+Math.imul(E,at)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(I,at)|0,a=a+Math.imul(I,ft)|0,n=n+Math.imul(g,st)|0,i=(i=i+Math.imul(g,ct)|0)+Math.imul(w,st)|0,a=a+Math.imul(w,ct)|0,n=n+Math.imul(_,dt)|0,i=(i=i+Math.imul(_,ht)|0)+Math.imul(y,dt)|0,a=a+Math.imul(y,ht)|0;var St=(c+(n=n+Math.imul(b,bt)|0)|0)+((8191&(i=(i=i+Math.imul(b,pt)|0)+Math.imul(p,bt)|0))<<13)|0;c=((a=a+Math.imul(p,pt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(z,G),i=(i=Math.imul(z,W))+Math.imul(D,G)|0,a=Math.imul(D,W),n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(B,J)|0,a=a+Math.imul(B,X)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(j,Q)|0,a=a+Math.imul(j,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(P,rt)|0,a=a+Math.imul(P,nt)|0,n=n+Math.imul(S,at)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(k,at)|0,a=a+Math.imul(k,ft)|0,n=n+Math.imul(E,st)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(I,st)|0,a=a+Math.imul(I,ct)|0,n=n+Math.imul(g,dt)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(w,dt)|0,a=a+Math.imul(w,ht)|0;var kt=(c+(n=n+Math.imul(_,bt)|0)|0)+((8191&(i=(i=i+Math.imul(_,pt)|0)+Math.imul(y,bt)|0))<<13)|0;c=((a=a+Math.imul(y,pt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(z,J),i=(i=Math.imul(z,X))+Math.imul(D,J)|0,a=Math.imul(D,X),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(B,Q)|0,a=a+Math.imul(B,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(j,rt)|0,a=a+Math.imul(j,nt)|0,n=n+Math.imul(x,at)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(P,at)|0,a=a+Math.imul(P,ft)|0,n=n+Math.imul(S,st)|0,i=(i=i+Math.imul(S,ct)|0)+Math.imul(k,st)|0,a=a+Math.imul(k,ct)|0,n=n+Math.imul(E,dt)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(I,dt)|0,a=a+Math.imul(I,ht)|0;var Lt=(c+(n=n+Math.imul(g,bt)|0)|0)+((8191&(i=(i=i+Math.imul(g,pt)|0)+Math.imul(w,bt)|0))<<13)|0;c=((a=a+Math.imul(w,pt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(z,Q),i=(i=Math.imul(z,tt))+Math.imul(D,Q)|0,a=Math.imul(D,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(B,rt)|0,a=a+Math.imul(B,nt)|0,n=n+Math.imul(R,at)|0,i=(i=i+Math.imul(R,ft)|0)+Math.imul(j,at)|0,a=a+Math.imul(j,ft)|0,n=n+Math.imul(x,st)|0,i=(i=i+Math.imul(x,ct)|0)+Math.imul(P,st)|0,a=a+Math.imul(P,ct)|0,n=n+Math.imul(S,dt)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(k,dt)|0,a=a+Math.imul(k,ht)|0;var xt=(c+(n=n+Math.imul(E,bt)|0)|0)+((8191&(i=(i=i+Math.imul(E,pt)|0)+Math.imul(I,bt)|0))<<13)|0;c=((a=a+Math.imul(I,pt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(z,rt),i=(i=Math.imul(z,nt))+Math.imul(D,rt)|0,a=Math.imul(D,nt),n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(B,at)|0,a=a+Math.imul(B,ft)|0,n=n+Math.imul(R,st)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(j,st)|0,a=a+Math.imul(j,ct)|0,n=n+Math.imul(x,dt)|0,i=(i=i+Math.imul(x,ht)|0)+Math.imul(P,dt)|0,a=a+Math.imul(P,ht)|0;var Pt=(c+(n=n+Math.imul(S,bt)|0)|0)+((8191&(i=(i=i+Math.imul(S,pt)|0)+Math.imul(k,bt)|0))<<13)|0;c=((a=a+Math.imul(k,pt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(z,at),i=(i=Math.imul(z,ft))+Math.imul(D,at)|0,a=Math.imul(D,ft),n=n+Math.imul(C,st)|0,i=(i=i+Math.imul(C,ct)|0)+Math.imul(B,st)|0,a=a+Math.imul(B,ct)|0,n=n+Math.imul(R,dt)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(j,dt)|0,a=a+Math.imul(j,ht)|0;var Tt=(c+(n=n+Math.imul(x,bt)|0)|0)+((8191&(i=(i=i+Math.imul(x,pt)|0)+Math.imul(P,bt)|0))<<13)|0;c=((a=a+Math.imul(P,pt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(z,st),i=(i=Math.imul(z,ct))+Math.imul(D,st)|0,a=Math.imul(D,ct),n=n+Math.imul(C,dt)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(B,dt)|0,a=a+Math.imul(B,ht)|0;var Rt=(c+(n=n+Math.imul(R,bt)|0)|0)+((8191&(i=(i=i+Math.imul(R,pt)|0)+Math.imul(j,bt)|0))<<13)|0;c=((a=a+Math.imul(j,pt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(z,dt),i=(i=Math.imul(z,ht))+Math.imul(D,dt)|0,a=Math.imul(D,ht);var jt=(c+(n=n+Math.imul(C,bt)|0)|0)+((8191&(i=(i=i+Math.imul(C,pt)|0)+Math.imul(B,bt)|0))<<13)|0;c=((a=a+Math.imul(B,pt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ot=(c+(n=Math.imul(z,bt))|0)+((8191&(i=(i=Math.imul(z,pt))+Math.imul(D,bt)|0))<<13)|0;return c=((a=Math.imul(D,pt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,s[0]=vt,s[1]=_t,s[2]=yt,s[3]=mt,s[4]=gt,s[5]=wt,s[6]=At,s[7]=Et,s[8]=It,s[9]=Mt,s[10]=St,s[11]=kt,s[12]=Lt,s[13]=xt,s[14]=Pt,s[15]=Tt,s[16]=Rt,s[17]=jt,s[18]=Ot,0!==c&&(s[19]=c,r.length++),r};function l(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(h=d),i.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?h(this,t,e):r<63?d(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,f&=67108863}r.words[a]=o,n=f,f=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):l(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=i.prototype._countBits(t)-1,n=0;n>=1;return n},b.prototype.permute=function(t,e,r,n,i,a){for(var f=0;f>>=1)i++;return 1<>>=13,n[2*f+1]=8191&a,a>>>=13;for(f=2*e;f>=26,e+=i/67108864|0,e+=a>>>26,this.words[n]=67108863&a}return 0!==e&&(this.words[n]=e,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new i(1);for(var r=this,n=0;n=0);var e,n=t%26,i=(t-n)/26,a=67108863>>>26-n<<26-n;if(0!==n){var f=0;for(e=0;e>>26-n}f&&(this.words[e]=f,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var a=t%26,f=Math.min((t-a)/26,this.length),o=67108863^67108863>>>a<f)for(this.length-=f,c=0;c=0&&(0!==u||c>=i);c--){var d=0|this.words[c];this.words[c]=u<<26-a|d>>>a,u=d&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<=0);var e=t%26,n=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(s/67108864|0),this.words[i+n]=67108863&a}for(;i>26,this.words[i+n]=67108863&a;if(0===o)return this.strip();for(r(-1===o),o=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},i.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),a=t,f=0|a.words[a.length-1];0!==(r=26-this._countBits(f))&&(a=a.ushln(r),n.iushln(r),f=0|a.words[a.length-1]);var o,s=n.length-a.length;if("mod"!==e){(o=new i(null)).length=s+1,o.words=new Array(o.length);for(var c=0;c=0;d--){var h=67108864*(0|n.words[a.length+d])+(0|n.words[a.length+d-1]);for(h=Math.min(h/f|0,67108863),n._ishlnsubmul(a,h,d);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(a,1,d),n.isZero()||(n.negative^=1);o&&(o.words[d]=h)}return o&&o.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:o||null,mod:n}},i.prototype.divmod=function(t,e,n){return r(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(o=this.neg().divmod(t,e),"mod"!==e&&(a=o.div.neg()),"div"!==e&&(f=o.mod.neg(),n&&0!==f.negative&&f.iadd(t)),{div:a,mod:f}):0===this.negative&&0!==t.negative?(o=this.divmod(t.neg(),e),"mod"!==e&&(a=o.div.neg()),{div:a,mod:o.mod}):0!=(this.negative&t.negative)?(o=this.neg().divmod(t.neg(),e),"div"!==e&&(f=o.mod.neg(),n&&0!==f.negative&&f.isub(t)),{div:o.div,mod:f}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e);var a,f,o},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(e*n+(0|this.words[i]))%t;return n},i.prototype.idivn=function(t){r(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var a=new i(1),f=new i(0),o=new i(0),s=new i(1),c=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++c;for(var u=n.clone(),d=e.clone();!e.isZero();){for(var h=0,l=1;0==(e.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(a.isOdd()||f.isOdd())&&(a.iadd(u),f.isub(d)),a.iushrn(1),f.iushrn(1);for(var b=0,p=1;0==(n.words[0]&p)&&b<26;++b,p<<=1);if(b>0)for(n.iushrn(b);b-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(u),s.isub(d)),o.iushrn(1),s.iushrn(1);e.cmp(n)>=0?(e.isub(n),a.isub(o),f.isub(s)):(n.isub(e),o.isub(a),s.isub(f))}return{a:o,b:s,gcd:n.iushln(c)}},i.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var a,f=new i(1),o=new i(0),s=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,u=1;0==(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)f.isOdd()&&f.iadd(s),f.iushrn(1);for(var d=0,h=1;0==(n.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(n.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);e.cmp(n)>=0?(e.isub(n),f.isub(o)):(n.isub(e),o.isub(f))}return(a=0===e.cmpn(1)?f:o).cmpn(0)<0&&a.iadd(t),a},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<>>26,o&=67108863,this.words[f]=o}return 0!==a&&(this.words[f]=a,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)e=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new A(t)},i.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var p={k256:null,p224:null,p192:null,p25519:null};function _(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function m(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function g(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){A.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}_.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},_.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},_.prototype.split=function(t,e){t.iushrn(this.n,0,e)},_.prototype.imulK=function(t){return t.imul(this.k)},n(y,_),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(p[t])return p[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new m;else if("p192"===t)e=new g;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return p[t]=e,e},A.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},A.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},A.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},A.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},A.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},A.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},A.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},A.prototype.isqr=function(t){return this.imul(t,t.clone())},A.prototype.sqr=function(t){return this.mul(t,t)},A.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var n=this.m.add(new i(1)).iushrn(2);return this.pow(t,n)}for(var a=this.m.subn(1),f=0;!a.isZero()&&0===a.andln(1);)f++,a.iushrn(1);r(!a.isZero());var o=new i(1).toRed(this),s=o.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);0!==this.pow(u,c).cmp(s);)u.redIAdd(s);for(var d=this.pow(u,a),h=this.pow(t,a.addn(1).iushrn(1)),l=this.pow(t,a),b=f;0!==l.cmp(o);){for(var p=l,v=0;0!==p.cmp(o);v++)p=p.redSqr();r(v=0;n--){for(var c=e.words[n],u=s-1;u>=0;u--){var d=c>>u&1;a!==r[0]&&(a=this.sqr(a)),0!==d||0!==f?(f<<=1,f|=d,(4===++o||0===n&&0===u)&&(a=this.mul(a,r[f]),o=0,f=0)):o=0}s=26}return a},A.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},A.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new E(t)},n(E,A),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),f=a;return a.cmp(this.m)>=0?f=a.isub(this.m):a.cmpn(0)<0&&(f=a.iadd(this.m)),f._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,p.d)})),Me="lib/elliptic.js",Se=["lib"],ke={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",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},Le={type:"git",url:"git@github.com:indutny/elliptic"},xe=["EC","Elliptic","curve","Cryptography"],Pe="Fedor Indutny ",Te={url:"https://github.com/indutny/elliptic/issues"},Re="https://github.com/indutny/elliptic",je={brfs:"^1.4.3",coveralls:"^3.0.8",grunt:"^1.0.4","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":"^9.0.1",istanbul:"^0.4.2",jscs:"^3.0.7",jshint:"^2.10.3",mocha:"^6.2.2"},Oe={"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"},Ce={name:"elliptic",version:"6.5.2",description:"EC cryptography",main:Me,files:Se,scripts:ke,repository:Le,keywords:xe,author:Pe,license:"MIT",bugs:Te,homepage:Re,devDependencies:je,dependencies:Oe},Be=Object.freeze({__proto__:null,name:"elliptic",version:"6.5.2",description:"EC cryptography",main:Me,files:Se,scripts:ke,repository:Le,keywords:xe,author:Pe,license:"MIT",bugs:Te,homepage:Re,devDependencies:je,dependencies:Oe,default:Ce}),Ne=ze;function ze(t,e){if(!t)throw new Error(e||"Assertion failed")}ze.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var De,Ke=Object(p.b)((function(t,e){var r=e;function n(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",r=0;r>8,f=255&i;a?r.push(a,f):r.push(f)}return r},r.zero2=n,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}})),Ve=Object(p.b)((function(t,e){var r=e;r.assert=Ne,r.toArray=Ke.toArray,r.zero2=Ke.zero2,r.toHex=Ke.toHex,r.encode=Ke.encode,r.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-s:s,a.isubn(o)):o=0,n[f]=o,a.iushrn(1)}return n},r.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0;t.cmpn(-n)>0||e.cmpn(-i)>0;){var a,f,o,s=t.andln(3)+n&3,c=e.andln(3)+i&3;3===s&&(s=-1),3===c&&(c=-1),a=0==(1&s)?0:3!==(o=t.andln(7)+n&7)&&5!==o||2!==c?s:-s,r[0].push(a),f=0==(1&c)?0:3!==(o=e.andln(7)+i&7)&&5!==o||2!==s?c:-c,r[1].push(f),2*n===a+1&&(n=1-n),2*i===f+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r},r.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(t){return"string"==typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new Ie(t,"hex","le")}})),Ue=function(t){return De||(De=new qe(null)),De.generate(t)};function qe(t){this.rand=t}var Ye=qe;if(qe.prototype.generate=function(t){return this._rand(t)},qe.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Je=Ze;function Xe(t,e){this.curve=t,this.type=e,this.precomputed=null}Ze.prototype.point=function(){throw new Error("Not implemented")},Ze.prototype.validate=function(){throw new Error("Not implemented")},Ze.prototype._fixedNafMul=function(t,e){We(t.precomputed);var r=t._getDoubles(),n=He(e,1,this._bitLength),i=(1<=f;e--)o=(o<<1)+n[e];a.push(o)}for(var s=this.jpoint(null,null,null),c=this.jpoint(null,null,null),u=i;u>0;u--){for(f=0;f=0;o--){for(e=0;o>=0&&0===a[o];o--)e++;if(o>=0&&e++,f=f.dblp(e),o<0)break;var s=a[o];We(0!==s),f="affine"===t.type?s>0?f.mixedAdd(i[s-1>>1]):f.mixedAdd(i[-s-1>>1].neg()):s>0?f.add(i[s-1>>1]):f.add(i[-s-1>>1].neg())}return"affine"===t.type?f.toP():f},Ze.prototype._wnafMulAdd=function(t,e,r,n,i){for(var a=this._wnafT1,f=this._wnafT2,o=this._wnafT3,s=0,c=0;c=1;c-=2){var d=c-1,h=c;if(1===a[d]&&1===a[h]){var l=[e[d],null,null,e[h]];0===e[d].y.cmp(e[h].y)?(l[1]=e[d].add(e[h]),l[2]=e[d].toJ().mixedAdd(e[h].neg())):0===e[d].y.cmp(e[h].y.redNeg())?(l[1]=e[d].toJ().mixedAdd(e[h]),l[2]=e[d].add(e[h].neg())):(l[1]=e[d].toJ().mixedAdd(e[h]),l[2]=e[d].toJ().mixedAdd(e[h].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],p=Ge(r[d],r[h]);s=Math.max(p[0].length,s),o[d]=new Array(s),o[h]=new Array(s);for(var v=0;v=0;c--){for(var w=0;c>=0;){var A=!0;for(v=0;v=0&&w++,m=m.dblp(w),c<0)break;for(v=0;v0?E=f[v][I-1>>1]:I<0&&(E=f[v][-I-1>>1].neg()),m="affine"===E.type?m.mixedAdd(E):m.add(E))}}for(c=0;c=Math.ceil((t.bitLength()+1)/e.step)},Xe.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(a=e,f=r),n.negative&&(n=n.neg(),i=i.neg()),a.negative&&(a=a.neg(),f=f.neg()),[{a:n,b:i},{a:a,b:f}]},Qe.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),a=r.b.neg().mul(t).divRound(this.n),f=i.mul(r.a),o=a.mul(n.a),s=i.mul(r.b),c=a.mul(n.b);return{k1:t.sub(f).sub(o),k2:s.add(c).neg()}},Qe.prototype.pointFromX=function(t,e){(t=new Ie(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(e&&!i||!e&&i)&&(n=n.redNeg()),this.point(t,n)},Qe.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},Qe.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,a=0;a":""},er.prototype.isInfinity=function(){return this.inf},er.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},er.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),a=i.redSqr().redISub(this.x.redAdd(this.x)),f=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,f)},er.prototype.getX=function(){return this.x.fromRed()},er.prototype.getY=function(){return this.y.fromRed()},er.prototype.mul=function(t){return t=new Ie(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},er.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},er.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},er.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},er.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},er.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},m(rr,Je.BasePoint),Qe.prototype.jpoint=function(t,e,r){return new rr(this,t,e,r)},rr.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},rr.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},rr.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),a=this.y.redMul(e.redMul(t.z)),f=t.y.redMul(r.redMul(this.z)),o=n.redSub(i),s=a.redSub(f);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),d=n.redMul(c),h=s.redSqr().redIAdd(u).redISub(d).redISub(d),l=s.redMul(d.redISub(h)).redISub(a.redMul(u)),b=this.z.redMul(t.z).redMul(o);return this.curve.jpoint(h,l,b)},rr.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,a=t.y.redMul(e).redMul(this.z),f=r.redSub(n),o=i.redSub(a);if(0===f.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var s=f.redSqr(),c=s.redMul(f),u=r.redMul(s),d=o.redSqr().redIAdd(c).redISub(u).redISub(u),h=o.redMul(u.redISub(d)).redISub(i.redMul(c)),l=this.z.redMul(f);return this.curve.jpoint(d,h,l)},rr.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},rr.prototype.inspect=function(){return this.isInfinity()?"":""},rr.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},m(nr,Je);var ir=nr;function ar(t,e,r){Je.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Ie(e,16),this.z=new Ie(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}nr.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},m(ar,Je.BasePoint),nr.prototype.decodePoint=function(t,e){return this.point(Ve.toArray(t,e),1)},nr.prototype.point=function(t,e){return new ar(this,t,e)},nr.prototype.pointFromJSON=function(t){return ar.fromJSON(this,t)},ar.prototype.precompute=function(){},ar.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},ar.fromJSON=function(t,e){return new ar(t,e[0],e[1]||t.one)},ar.prototype.inspect=function(){return this.isInfinity()?"":""},ar.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},ar.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},ar.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},ar.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),a=t.x.redSub(t.z).redMul(r),f=i.redMul(n),o=e.z.redMul(a.redAdd(f).redSqr()),s=e.x.redMul(a.redISub(f).redSqr());return this.curve.point(o,s)},ar.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var a=i.length-1;a>=0;a--)0===i[a]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},ar.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},ar.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},ar.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},ar.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},ar.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var fr=Ve.assert;function or(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,Je.call(this,"edwards",t),this.a=new Ie(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Ie(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Ie(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),fr(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}m(or,Je);var sr=or;function cr(t,e,r,n,i){Je.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Ie(e,16),this.y=new Ie(r,16),this.z=n?new Ie(n,16):this.curve.one,this.t=i&&new Ie(i,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}or.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},or.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},or.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},or.prototype.pointFromX=function(t,e){(t=new Ie(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(i.redInvm()),f=a.redSqrt();if(0!==f.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var o=f.fromRed().isOdd();return(e&&!o||!e&&o)&&(f=f.redNeg()),this.point(t,f)},or.prototype.pointFromY=function(t,e){(t=new Ie(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(i.redInvm());if(0===a.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var f=a.redSqrt();if(0!==f.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return f.fromRed().isOdd()!==e&&(f=f.redNeg()),this.point(f,t)},or.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},m(cr,Je.BasePoint),or.prototype.pointFromJSON=function(t){return cr.fromJSON(this,t)},or.prototype.point=function(t,e,r,n){return new cr(this,t,e,r,n)},cr.fromJSON=function(t,e){return new cr(t,e[0],e[1],e[2])},cr.prototype.inspect=function(){return this.isInfinity()?"":""},cr.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},cr.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),a=n.redAdd(e),f=a.redSub(r),o=n.redSub(e),s=i.redMul(f),c=a.redMul(o),u=i.redMul(o),d=f.redMul(a);return this.curve.point(s,c,d,u)},cr.prototype._projDbl=function(){var t,e,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var f=(c=this.curve._mulA(i)).redAdd(a);if(this.zOne)t=n.redSub(i).redSub(a).redMul(f.redSub(this.curve.two)),e=f.redMul(c.redSub(a)),r=f.redSqr().redSub(f).redSub(f);else{var o=this.z.redSqr(),s=f.redSub(o).redISub(o);t=n.redSub(i).redISub(a).redMul(s),e=f.redMul(c.redSub(a)),r=f.redMul(s)}}else{var c=i.redAdd(a);o=this.curve._mulC(this.z).redSqr(),s=c.redSub(o).redSub(o),t=this.curve._mulC(n.redISub(c)).redMul(s),e=this.curve._mulC(c).redMul(i.redISub(a)),r=c.redMul(s)}return this.curve.point(t,e,r)},cr.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},cr.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),a=r.redSub(e),f=i.redSub(n),o=i.redAdd(n),s=r.redAdd(e),c=a.redMul(f),u=o.redMul(s),d=a.redMul(s),h=f.redMul(o);return this.curve.point(c,u,h,d)},cr.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),a=this.x.redMul(t.x),f=this.y.redMul(t.y),o=this.curve.d.redMul(a).redMul(f),s=i.redSub(o),c=i.redAdd(o),u=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(a).redISub(f),d=n.redMul(s).redMul(u);return this.curve.twisted?(e=n.redMul(c).redMul(f.redSub(this.curve._mulA(a))),r=s.redMul(c)):(e=n.redMul(c).redMul(f.redSub(a)),r=this.curve._mulC(s).redMul(c)),this.curve.point(d,e,r)},cr.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},cr.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},cr.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},cr.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},cr.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},cr.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},cr.prototype.getX=function(){return this.normalize(),this.x.fromRed()},cr.prototype.getY=function(){return this.normalize(),this.y.fromRed()},cr.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},cr.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},cr.prototype.toP=cr.prototype.normalize,cr.prototype.mixedAdd=cr.prototype.add;var ur=Object(p.b)((function(t,e){var r=e;r.base=Je,r.short=tr,r.mont=ir,r.edwards=sr}));function dr(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function hr(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function lr(t){return 1===t.length?"0"+t:t}function br(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}var pr={inherits:m,toArray:function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i>6|192,r[n++]=63&a|128):dr(t,i)?(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i>>0}return a},split32:function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r},rotr32:function(t,e){return t>>>e|t<<32-e},rotl32:function(t,e){return t<>>32-e},sum32:function(t,e){return t+e>>>0},sum32_3:function(t,e,r){return t+e+r>>>0},sum32_4:function(t,e,r,n){return t+e+r+n>>>0},sum32_5:function(t,e,r,n,i){return t+e+r+n+i>>>0},sum64:function(t,e,r,n){var i=t[e],a=n+t[e+1]>>>0,f=(a>>0,t[e+1]=a},sum64_hi:function(t,e,r,n){return(e+n>>>0>>0},sum64_lo:function(t,e,r,n){return e+n>>>0},sum64_4_hi:function(t,e,r,n,i,a,f,o){var s=0,c=e;return s+=(c=c+n>>>0)>>0)>>0)>>0},sum64_4_lo:function(t,e,r,n,i,a,f,o){return e+n+a+o>>>0},sum64_5_hi:function(t,e,r,n,i,a,f,o,s,c){var u=0,d=e;return u+=(d=d+n>>>0)>>0)>>0)>>0)>>0},sum64_5_lo:function(t,e,r,n,i,a,f,o,s,c){return e+n+a+o+c>>>0},rotr64_hi:function(t,e,r){return(e<<32-r|t>>>r)>>>0},rotr64_lo:function(t,e,r){return(t<<32-r|e>>>r)>>>0},shr64_hi:function(t,e,r){return t>>>r},shr64_lo:function(t,e,r){return(t<<32-r|e>>>r)>>>0}};function vr(){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 _r=vr;vr.prototype.update=function(t,e){if(t=pr.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=pr.join32(t,0,t.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a>>3},xr=function(t){return mr(t,17)^mr(t,19)^t>>>10},Pr=pr.rotl32,Tr=pr.sum32,Rr=pr.sum32_5,jr=Er,Or=yr.BlockHash,Cr=[1518500249,1859775393,2400959708,3395469782];function Br(){if(!(this instanceof Br))return new Br;Or.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}pr.inherits(Br,Or);var Nr=Br;Br.blockSize=512,Br.outSize=160,Br.hmacStrength=80,Br.padLength=64,Br.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;nthis.blockSize&&(t=(new this.Hash).update(t).digest()),Ne(t.length<=this.blockSize);for(var e=t.length;e=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var Xn=Jn;Jn.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);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(t.concat(r||[])),this._reseed=1},Jn.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=Ke.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var ei=Ve.assert;function ri(t,e){if(t instanceof ri)return t;this._importDER(t,e)||(ei(t.r&&t.s,"Signature without r or s"),this.r=new Ie(t.r,16),this.s=new Ie(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var ni=ri;function ii(){this.place=0}function ai(t,e){var r=t[e.place++];if(!(128&r))return r;for(var n=15&r,i=0,a=0,f=e.place;a>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}ri.prototype._importDER=function(t,e){t=Ve.toArray(t,e);var r=new ii;if(48!==t[r.place++])return!1;if(ai(t,r)+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var n=ai(t,r),i=t.slice(r.place,n+r.place);if(r.place+=n,2!==t[r.place++])return!1;var a=ai(t,r);if(t.length!==a+r.place)return!1;var f=t.slice(r.place,a+r.place);return 0===i[0]&&128&i[1]&&(i=i.slice(1)),0===f[0]&&128&f[1]&&(f=f.slice(1)),this.r=new Ie(i),this.s=new Ie(f),this.recoveryParam=null,!0},ri.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=fi(e),r=fi(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];oi(n,e.length),(n=n.concat(e)).push(2),oi(n,r.length);var i=n.concat(r),a=[48];return oi(a,i.length),a=a.concat(i),Ve.encode(a,t)};var si=Ve.assert;function ci(t){if(!(this instanceof ci))return new ci(t);"string"==typeof t&&(si(Zn.hasOwnProperty(t),"Unknown curve "+t),t=Zn[t]),t instanceof Zn.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var ui=ci;ci.prototype.keyPair=function(t){return new ti(this,t)},ci.prototype.keyFromPrivate=function(t,e){return ti.fromPrivate(this,t,e)},ci.prototype.keyFromPublic=function(t,e){return ti.fromPublic(this,t,e)},ci.prototype.genKeyPair=function(t){t||(t={});for(var e=new Xn({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||Ue(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new Ie(2));;){var i=new Ie(e.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},ci.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},ci.prototype.sign=function(t,e,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new Ie(t,16));for(var i=this.n.byteLength(),a=e.getPrivate().toArray("be",i),f=t.toArray("be",i),o=new Xn({hash:this.hash,entropy:a,nonce:f,pers:n.pers,persEnc:n.persEnc||"utf8"}),s=this.n.sub(new Ie(1)),c=0;;c++){var u=n.k?n.k(c):new Ie(o.generate(this.n.byteLength()));if(!((u=this._truncateToN(u,!0)).cmpn(1)<=0||u.cmp(s)>=0)){var d=this.g.mul(u);if(!d.isInfinity()){var h=d.getX(),l=h.umod(this.n);if(0!==l.cmpn(0)){var b=u.invm(this.n).mul(l.mul(e.getPrivate()).iadd(t));if(0!==(b=b.umod(this.n)).cmpn(0)){var p=(d.getY().isOdd()?1:0)|(0!==h.cmp(l)?2:0);return n.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),p^=1),new ni({r:l,s:b,recoveryParam:p})}}}}}},ci.prototype.verify=function(t,e,r,n){t=this._truncateToN(new Ie(t,16)),r=this.keyFromPublic(r,n);var i=(e=new ni(e,"hex")).r,a=e.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var f,o=a.invm(this.n),s=o.mul(t).umod(this.n),c=o.mul(i).umod(this.n);return this.curve._maxwellTrick?!(f=this.g.jmulAdd(s,r.getPublic(),c)).isInfinity()&&f.eqXToP(i):!(f=this.g.mulAdd(s,r.getPublic(),c)).isInfinity()&&0===f.getX().umod(this.n).cmp(i)},ci.prototype.recoverPubKey=function(t,e,r,n){si((3&r)===r,"The recovery param is more than two bits"),e=new ni(e,n);var i=this.n,a=new Ie(t),f=e.r,o=e.s,s=1&r,c=r>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");f=c?this.curve.pointFromX(f.add(this.curve.n),s):this.curve.pointFromX(f,s);var u=e.r.invm(i),d=i.sub(a).mul(u).umod(i),h=o.mul(u).umod(i);return this.g.mulAdd(d,f,h)},ci.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new ni(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(t,e,i)}catch(t){continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var di=Ve.assert,hi=Ve.parseBytes,li=Ve.cachedProperty;function bi(t,e){this.eddsa=t,this._secret=hi(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=hi(e.pub)}bi.fromPublic=function(t,e){return e instanceof bi?e:new bi(t,{pub:e})},bi.fromSecret=function(t,e){return e instanceof bi?e:new bi(t,{secret:e})},bi.prototype.secret=function(){return this._secret},li(bi,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),li(bi,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),li(bi,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),li(bi,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),li(bi,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),li(bi,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),bi.prototype.sign=function(t){return di(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},bi.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},bi.prototype.getSecret=function(t){return di(this._secret,"KeyPair is public only"),Ve.encode(this.secret(),t)},bi.prototype.getPublic=function(t){return Ve.encode(this.pubBytes(),t)};var pi=bi,vi=Ve.assert,_i=Ve.cachedProperty,yi=Ve.parseBytes;function mi(t,e){this.eddsa=t,"object"!=typeof e&&(e=yi(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),vi(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof Ie&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}_i(mi,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),_i(mi,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),_i(mi,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),_i(mi,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),mi.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},mi.prototype.toHex=function(){return Ve.encode(this.toBytes(),"hex").toUpperCase()};var gi=mi,wi=Ve.assert,Ai=Ve.parseBytes;function Ei(t){if(wi("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof Ei))return new Ei(t);t=Zn[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=Gn.sha512}var Ii=Ei;Ei.prototype.sign=function(t,e){t=Ai(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),a=this.encodePoint(i),f=this.hashInt(a,r.pubBytes(),t).mul(r.priv()),o=n.add(f).umod(this.curve.n);return this.makeSignature({R:i,S:o,Rencoded:a})},Ei.prototype.verify=function(t,e,r){t=Ai(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),a=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(a)},Ei.prototype.hashInt=function(){for(var t=this.hash(),e=0;e=0)return null;var a=(r=r.toRed(i.red)).redSqr().redIMul(r).redIAdd(i.b).redSqrt();return 3===t!==a.isOdd()&&(a=a.redNeg()),n.keyPair({pub:{x:r,y:a}})}(e,t.slice(1,33));case 4:case 6:case 7:return 65!==t.length?null:function(t,e,r){var a=new Ie(e),f=new Ie(r);if(a.cmp(i.p)>=0||f.cmp(i.p)>=0)return null;if(a=a.toRed(i.red),f=f.toRed(i.red),(6===t||7===t)&&f.isOdd()!==(7===t))return null;var o=a.redSqr().redIMul(a);return f.redSqr().redISub(o.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:a,y:f}}):null}(e,t.slice(1,33),t.slice(33,65));default:return null}}e.privateKeyVerify=function(t){var e=new Ie(t);return e.cmp(i.n)<0&&!e.isZero()},e.privateKeyExport=function(t,e){var a=new Ie(t);if(a.cmp(i.n)>=0||a.isZero())throw new Error(q.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return r.from(n.keyFromPrivate(t).getPublic(e,!0))},e.privateKeyNegate=function(t){var e=new Ie(t);return e.isZero()?r.alloc(32):i.n.sub(e).umod(i.n).toArrayLike(r,"be",32)},e.privateKeyModInverse=function(t){var e=new Ie(t);if(e.cmp(i.n)>=0||e.isZero())throw new Error(q.EC_PRIVATE_KEY_RANGE_INVALID);return e.invm(i.n).toArrayLike(r,"be",32)},e.privateKeyTweakAdd=function(t,e){var n=new Ie(e);if(n.cmp(i.n)>=0)throw new Error(q.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(n.iadd(new Ie(t)),n.cmp(i.n)>=0&&n.isub(i.n),n.isZero())throw new Error(q.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return n.toArrayLike(r,"be",32)},e.privateKeyTweakMul=function(t,e){var n=new Ie(e);if(n.cmp(i.n)>=0||n.isZero())throw new Error(q.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);return n.imul(new Ie(t)),n.cmp(i.n)&&(n=n.umod(i.n)),n.toArrayLike(r,"be",32)},e.publicKeyCreate=function(t,e){var a=new Ie(t);if(a.cmp(i.n)>=0||a.isZero())throw new Error(q.EC_PUBLIC_KEY_CREATE_FAIL);return r.from(n.keyFromPrivate(t).getPublic(e,!0))},e.publicKeyConvert=function(t,e){var n=a(t);if(null===n)throw new Error(q.EC_PUBLIC_KEY_PARSE_FAIL);return r.from(n.getPublic(e,!0))},e.publicKeyVerify=function(t){return null!==a(t)},e.publicKeyTweakAdd=function(t,e,n){var f=a(t);if(null===f)throw new Error(q.EC_PUBLIC_KEY_PARSE_FAIL);if((e=new Ie(e)).cmp(i.n)>=0)throw new Error(q.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);var o=i.g.mul(e).add(f.pub);if(o.isInfinity())throw new Error(q.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return r.from(o.encode(!0,n))},e.publicKeyTweakMul=function(t,e,n){var f=a(t);if(null===f)throw new Error(q.EC_PUBLIC_KEY_PARSE_FAIL);if((e=new Ie(e)).cmp(i.n)>=0||e.isZero())throw new Error(q.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return r.from(f.pub.mul(e).encode(!0,n))},e.publicKeyCombine=function(t,e){for(var n=new Array(t.length),i=0;i=0||a.cmp(i.n)>=0)throw new Error(q.ECDSA_SIGNATURE_PARSE_FAIL);var f=r.from(t);return 1===a.cmp(n.nh)&&i.n.sub(a).toArrayLike(r,"be",32).copy(f,32),f},e.signatureExport=function(t){var e=t.slice(0,32),r=t.slice(32,64);if(new Ie(e).cmp(i.n)>=0||new Ie(r).cmp(i.n)>=0)throw new Error(q.ECDSA_SIGNATURE_PARSE_FAIL);return{r:e,s:r}},e.signatureImport=function(t){var e=new Ie(t.r);e.cmp(i.n)>=0&&(e=new Ie(0));var n=new Ie(t.s);return n.cmp(i.n)>=0&&(n=new Ie(0)),r.concat([e.toArrayLike(r,"be",32),n.toArrayLike(r,"be",32)])},e.sign=function(t,e,a,f){if("function"==typeof a){var o=a;a=function(n){var i=o(t,e,null,f,n);if(!r.isBuffer(i)||32!==i.length)throw new Error(q.ECDSA_SIGN_FAIL);return new Ie(i)}}var s=new Ie(e);if(s.cmp(i.n)>=0||s.isZero())throw new Error(q.ECDSA_SIGN_FAIL);var c=n.sign(t,e,{canonical:!0,k:a,pers:f});return{signature:r.concat([c.r.toArrayLike(r,"be",32),c.s.toArrayLike(r,"be",32)]),recovery:c.recoveryParam}},e.verify=function(t,e,r){var f={r:e.slice(0,32),s:e.slice(32,64)},o=new Ie(f.r),s=new Ie(f.s);if(o.cmp(i.n)>=0||s.cmp(i.n)>=0)throw new Error(q.ECDSA_SIGNATURE_PARSE_FAIL);if(1===s.cmp(n.nh)||o.isZero()||s.isZero())return!1;var c=a(r);if(null===c)throw new Error(q.EC_PUBLIC_KEY_PARSE_FAIL);return n.verify(t,f,{x:c.pub.x,y:c.pub.y})},e.recover=function(t,e,a,f){var o={r:e.slice(0,32),s:e.slice(32,64)},s=new Ie(o.r),c=new Ie(o.s);if(s.cmp(i.n)>=0||c.cmp(i.n)>=0)throw new Error(q.ECDSA_SIGNATURE_PARSE_FAIL);try{if(s.isZero()||c.isZero())throw new Error;var u=n.recoverPubKey(t,o,a);return r.from(u.encode(!0,f))}catch(t){throw new Error(q.ECDSA_RECOVER_FAIL)}},e.ecdh=function(t,r){var n=e.ecdhUnsafe(t,r,!0);return Ee("sha256").update(n).digest()},e.ecdhUnsafe=function(t,e,n){var f=a(t);if(null===f)throw new Error(q.EC_PUBLIC_KEY_PARSE_FAIL);var o=new Ie(e);if(o.cmp(i.n)>=0||o.isZero())throw new Error(q.ECDH_FAIL);return r.from(f.pub.mul(o).encode(!0,n))}})),xi=(Li.privateKeyVerify,Li.privateKeyExport,Li.privateKeyNegate,Li.privateKeyModInverse,Li.privateKeyTweakAdd,Li.privateKeyTweakMul,Li.publicKeyCreate,Li.publicKeyConvert,Li.publicKeyVerify,Li.publicKeyTweakAdd,Li.publicKeyTweakMul,Li.publicKeyCombine,Li.signatureNormalize,Li.signatureExport,Li.signatureImport,Li.sign,Li.verify,Li.recover,Li.ecdh,Li.ecdhUnsafe,Mi=Li,{privateKeyVerify:function(t){return P(t,q.EC_PRIVATE_KEY_TYPE_INVALID),32===t.length&&Mi.privateKeyVerify(t)},privateKeyExport:function(t,e){return P(t,q.EC_PRIVATE_KEY_TYPE_INVALID),T(t,32,q.EC_PRIVATE_KEY_LENGTH_INVALID),e=Y(e,!0),function(t,e,r){var n=N.from(r?z:D);return t.copy(n,r?8:9),e.copy(n,r?181:214),n}(t,Mi.privateKeyExport(t,e),e)},privateKeyImport:function(t){if(P(t,q.EC_PRIVATE_KEY_TYPE_INVALID),(t=function(t){var e=t.length,r=0;if(!(e2||e1?t[r+n-2]<<8:0);if(!(e<(r+=n)+i||e32||e1&&0===e[n]&&!(128&e[n+1]);--r,++n);for(var i=N.concat([N.from([0]),t.s]),a=33,f=0;a>1&&0===i[f]&&!(128&i[f+1]);--a,++f);return B(e.slice(n),i.slice(f))}(Mi.signatureExport(t))},signatureImport:function(t){P(t,q.ECDSA_SIGNATURE_TYPE_INVALID),j(t,q.ECDSA_SIGNATURE_LENGTH_INVALID);var e=function(t){var e=N.alloc(32,0),r=N.alloc(32,0);try{var n=C(t);if(33===n.r.length&&0===n.r[0]&&(n.r=n.r.slice(1)),n.r.length>32)throw new Error("R length is too long");if(33===n.s.length&&0===n.s[0]&&(n.s=n.s.slice(1)),n.s.length>32)throw new Error("S length is too long")}catch(t){return}return n.r.copy(e,32-n.r.length),n.s.copy(r,32-n.s.length),{r:e,s:r}}(t);if(e)return Mi.signatureImport(e);throw new Error(q.ECDSA_SIGNATURE_PARSE_DER_FAIL)},signatureImportLax:function(t){P(t,q.ECDSA_SIGNATURE_TYPE_INVALID),j(t,q.ECDSA_SIGNATURE_LENGTH_INVALID);var e=function(t){var e=N.alloc(32,0),r=N.alloc(32,0),n=t.length,i=0;if(48===t[i++]){var a=t[i++];if(!(128&a&&(i+=a-128)>n)&&2===t[i++]){var f=t[i++];if(128&f){if(i+(a=f-128)>n)return;for(;a>0&&0===t[i];i+=1,a-=1);for(f=0;a>0;i+=1,a-=1)f=(f<<8)+t[i]}if(!(f>n-i)){var o=i;if(i+=f,2===t[i++]){var s=t[i++];if(128&s){if(i+(a=s-128)>n)return;for(;a>0&&0===t[i];i+=1,a-=1);for(s=0;a>0;i+=1,a-=1)s=(s<<8)+t[i]}if(!(s>n-i)){var c=i;for(i+=s;f>0&&0===t[o];f-=1,o+=1);if(!(f>32)){var u=t.slice(o,o+f);for(u.copy(e,32-u.length);s>0&&0===t[c];s-=1,c+=1);if(!(s>32)){var d=t.slice(c,c+s);return d.copy(r,32-d.length),{r:e,s:r}}}}}}}}}(t);if(e)return Mi.signatureImport(e);throw new Error(q.ECDSA_SIGNATURE_PARSE_DER_FAIL)},sign:function(t,e,r){P(t,q.MSG32_TYPE_INVALID),T(t,32,q.MSG32_LENGTH_INVALID),P(e,q.EC_PRIVATE_KEY_TYPE_INVALID),T(e,32,q.EC_PRIVATE_KEY_LENGTH_INVALID);var n=null,i=null;return void 0!==r&&(function(t,e){if("[object Object]"!==x.call(t))throw TypeError(e)}(r,q.OPTIONS_TYPE_INVALID),void 0!==r.data&&(P(r.data,q.OPTIONS_DATA_TYPE_INVALID),T(r.data,32,q.OPTIONS_DATA_LENGTH_INVALID),n=r.data),void 0!==r.noncefn&&(function(t,e){if("[object Function]"!==x.call(t))throw TypeError(e)}(r.noncefn,q.OPTIONS_NONCEFN_TYPE_INVALID),i=r.noncefn)),Mi.sign(t,e,i,n)},verify:function(t,e,r){return P(t,q.MSG32_TYPE_INVALID),T(t,32,q.MSG32_LENGTH_INVALID),P(e,q.ECDSA_SIGNATURE_TYPE_INVALID),T(e,64,q.ECDSA_SIGNATURE_LENGTH_INVALID),P(r,q.EC_PUBLIC_KEY_TYPE_INVALID),R(r,33,65,q.EC_PUBLIC_KEY_LENGTH_INVALID),Mi.verify(t,e,r)},recover:function(t,e,r,n){return P(t,q.MSG32_TYPE_INVALID),T(t,32,q.MSG32_LENGTH_INVALID),P(e,q.ECDSA_SIGNATURE_TYPE_INVALID),T(e,64,q.ECDSA_SIGNATURE_LENGTH_INVALID),function(t,e){if("[object Number]"!==x.call(t))throw TypeError(e)}(r,q.RECOVERY_ID_TYPE_INVALID),function(t,e,r,n){if(t<=e||t>=r)throw RangeError(n)}(r,-1,4,q.RECOVERY_ID_VALUE_INVALID),n=Y(n,!0),Mi.recover(t,e,r,n)},ecdh:function(t,e){return P(t,q.EC_PUBLIC_KEY_TYPE_INVALID),R(t,33,65,q.EC_PUBLIC_KEY_LENGTH_INVALID),P(e,q.EC_PRIVATE_KEY_TYPE_INVALID),T(e,32,q.EC_PRIVATE_KEY_LENGTH_INVALID),Mi.ecdh(t,e)},ecdhUnsafe:function(t,e,r){return P(t,q.EC_PUBLIC_KEY_TYPE_INVALID),R(t,33,65,q.EC_PUBLIC_KEY_LENGTH_INVALID),P(e,q.EC_PRIVATE_KEY_TYPE_INVALID),T(e,32,q.EC_PRIVATE_KEY_LENGTH_INVALID),r=Y(r,!0),Mi.ecdhUnsafe(t,e,r)}}),Pi=Object(p.b)((function(e,r){function n(t,e){if("00"===t.slice(0,2))throw new Error("invalid RLP: extra zeros");return parseInt(t,e)}function i(e,r){if(e<56)return t.from([e+r]);var n=f(e),i=f(r+55+n.length/2);return t.from(i+n,"hex")}function a(t){return"0x"===t.slice(0,2)}function f(t){if(t<0)throw new Error("Invalid integer as argument, must be unsigned!");var e=t.toString(16);return e.length%2?"0"+e:e}function o(e){if(!t.isBuffer(e)){if("string"==typeof e)return a(e)?t.from((n="string"!=typeof(i=e)?i:a(i)?i.slice(2):i).length%2?"0"+n:n,"hex"):t.from(e);if("number"==typeof e)return e?(r=f(e),t.from(r,"hex")):t.from([]);if(null==e)return t.from([]);if(e instanceof Uint8Array)return t.from(e);if(Ie.isBN(e))return t.from(e.toArray());throw new Error("invalid type")}var r,n,i;return e}Object.defineProperty(r,"__esModule",{value:!0}),r.encode=function e(r){if(Array.isArray(r)){for(var n=[],a=0;ar.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(o=r.slice(a,d)).length)throw new Error("invalid rlp, List has a invalid length");for(;o.length;)s=e(o),c.push(s.data),o=s.remainder;return{data:c,remainder:r.slice(d)}}(o(e));if(r)return i;if(0!==i.remainder.length)throw new Error("invalid remainder");return i.data},r.getLength=function(e){if(!e||0===e.length)return t.from([]);var r=o(e),i=r[0];if(i<=127)return r.length;if(i<=183)return i-127;if(i<=191)return i-182;if(i<=247)return i-191;var a=i-246;return a+n(r.slice(1,a).toString("hex"),16)}}));Object(p.c)(Pi),Pi.encode,Pi.decode,Pi.getLength;var Ti=function(t){if("string"!=typeof t)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof t+", while checking isHexPrefixed.");return"0x"===t.slice(0,2)},Ri=function(t){return"string"!=typeof t?t:Ti(t)?t.slice(2):t};function ji(t){var e=t;if("string"!=typeof e)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof e+", while padToEven.");return e.length%2&&(e="0"+e),e}function Oi(t){return"0x"+t.toString(16)}var Ci={arrayContainsArray:function(t,e,r){if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof t+"'");if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof e+"'");return e[Boolean(r)?"some":"every"]((function(e){return t.indexOf(e)>=0}))},intToBuffer:function(e){var r=Oi(e);return new t(ji(r.slice(2)),"hex")},getBinarySize:function(e){if("string"!=typeof e)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof e+"'.");return t.byteLength(e,"utf8")},isHexPrefixed:Ti,stripHexPrefix:Ri,padToEven:ji,intToHex:Oi,fromAscii:function(t){for(var e="",r=0;r0&&"0"===r.toString();)r=(t=t.slice(1))[0];return t},e.toBuffer=function(t){if(!n.isBuffer(t))if(Array.isArray(t))t=n.from(t);else if("string"==typeof t)t=e.isHexString(t)?n.from(e.padToEven(e.stripHexPrefix(t)),"hex"):n.from(t);else if("number"==typeof t)t=e.intToBuffer(t);else if(null==t)t=n.allocUnsafe(0);else if(Ie.isBN(t))t=t.toArrayLike(n);else{if(!t.toArray)throw new Error("invalid type");t=n.from(t.toArray())}return t},e.bufferToInt=function(t){return new Ie(e.toBuffer(t)).toNumber()},e.bufferToHex=function(t){return"0x"+(t=e.toBuffer(t)).toString("hex")},e.fromSigned=function(t){return new Ie(t).fromTwos(256)},e.toUnsigned=function(t){return n.from(t.toTwos(256).toArray())},e.keccak=function(t,r){return t=e.toBuffer(t),r||(r=256),L("keccak"+r).update(t).digest()},e.keccak256=function(t){return e.keccak(t)},e.sha3=e.keccak,e.sha256=function(t){return t=e.toBuffer(t),Ee("sha256").update(t).digest()},e.ripemd160=function(t,r){t=e.toBuffer(t);var n=Ee("rmd160").update(t).digest();return!0===r?e.setLength(n,32):n},e.rlphash=function(t){return e.keccak(Pi.encode(t))},e.isValidPrivate=function(t){return xi.privateKeyVerify(t)},e.isValidPublic=function(t,e){return 64===t.length?xi.publicKeyVerify(n.concat([n.from([4]),t])):!!e&&xi.publicKeyVerify(t)},e.pubToAddress=e.publicToAddress=function(t,r){return t=e.toBuffer(t),r&&64!==t.length&&(t=xi.publicKeyConvert(t,!1).slice(1)),Object(_.b)(64===t.length),e.keccak(t).slice(-20)};var i=e.privateToPublic=function(t){return t=e.toBuffer(t),xi.publicKeyCreate(t,!1).slice(1)};e.importPublic=function(t){return 64!==(t=e.toBuffer(t)).length&&(t=xi.publicKeyConvert(t,!1).slice(1)),t},e.ecsign=function(t,e){var r=xi.sign(t,e),n={};return n.r=r.signature.slice(0,32),n.s=r.signature.slice(32,64),n.v=r.recovery+27,n},e.hashPersonalMessage=function(t){var r=e.toBuffer("\x19Ethereum Signed Message:\n"+t.length.toString());return e.keccak(n.concat([r,t]))},e.ecrecover=function(t,r,i,a){var f=n.concat([e.setLength(i,32),e.setLength(a,32)],64),o=r-27;if(0!==o&&1!==o)throw new Error("Invalid signature v value");var s=xi.recover(t,f,o);return xi.publicKeyConvert(s,!1).slice(1)},e.toRpcSig=function(t,r,i){if(27!==t&&28!==t)throw new Error("Invalid recovery id");return e.bufferToHex(n.concat([e.setLengthLeft(r,32),e.setLengthLeft(i,32),e.toBuffer(t-27)]))},e.fromRpcSig=function(t){if(65!==(t=e.toBuffer(t)).length)throw new Error("Invalid signature length");var r=t[64];return r<27&&(r+=27),{v:r,r:t.slice(0,32),s:t.slice(32,64)}},e.privateToAddress=function(t){return e.publicToAddress(i(t))},e.isValidAddress=function(t){return/^0x[0-9a-fA-F]{40}$/.test(t)},e.isZeroAddress=function(t){return e.zeroAddress()===e.addHexPrefix(t)},e.toChecksumAddress=function(t){t=e.stripHexPrefix(t).toLowerCase();for(var r=e.keccak(t).toString("hex"),n="0x",i=0;i=8?n+=t[i].toUpperCase():n+=t[i];return n},e.isValidChecksumAddress=function(t){return e.isValidAddress(t)&&e.toChecksumAddress(t)===t},e.generateAddress=function(t,r){return t=e.toBuffer(t),r=(r=new Ie(r)).isZero()?null:n.from(r.toArray()),e.rlphash([t,r]).slice(-20)},e.isPrecompiled=function(t){var r=e.unpad(t);return 1===r.length&&r[0]>=1&&r[0]<=8},e.addHexPrefix=function(t){return"string"!=typeof t||e.isHexPrefixed(t)?t:"0x"+t},e.isValidSignature=function(t,e,r,n){var i=new Ie("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),a=new Ie("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===e.length&&32===r.length&&(27===t||28===t)&&(e=new Ie(e),r=new Ie(r),!(e.isZero()||e.gt(a)||r.isZero()||r.gt(a))&&(!1!==n||1!==new Ie(r).cmp(i)))},e.baToJSON=function(t){if(n.isBuffer(t))return"0x"+t.toString("hex");if(t instanceof Array){for(var r=[],i=0;i=a.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===a.length||!r.length||Object(_.b)(r.length===a.length,"The field "+r.name+" must have byte length of "+r.length),t.raw[i]=a}t._fields.push(r.name),Object.defineProperty(t,r.name,{enumerable:!0,configurable:!0,get:a,set:f}),r.default&&(t[r.name]=r.default),r.alias&&Object.defineProperty(t,r.alias,{enumerable:!1,configurable:!0,set:f,get:a})})),a)if("string"==typeof a&&(a=n.from(e.stripHexPrefix(a),"hex")),n.isBuffer(a)&&(a=Pi.decode(a)),Array.isArray(a)){if(a.length>t._fields.length)throw new Error("wrong number of fields in data");a.forEach((function(r,n){t[t._fields[n]]=e.toBuffer(r)}))}else{if("object"!==(void 0===a?"undefined":r(a)))throw new Error("invalid data");var f=Object.keys(a);i.forEach((function(e){-1!==f.indexOf(e.name)&&(t[e.name]=a[e.name]),-1!==f.indexOf(e.alias)&&(t[e.alias]=a[e.alias])}))}}})),Ni=(Bi.MAX_INTEGER,Bi.TWO_POW256,Bi.KECCAK256_NULL_S,Bi.SHA3_NULL_S,Bi.KECCAK256_NULL,Bi.SHA3_NULL,Bi.KECCAK256_RLP_ARRAY_S,Bi.SHA3_RLP_ARRAY_S,Bi.KECCAK256_RLP_ARRAY,Bi.SHA3_RLP_ARRAY,Bi.KECCAK256_RLP_S,Bi.SHA3_RLP_S,Bi.KECCAK256_RLP,Bi.SHA3_RLP,Bi.BN,Bi.rlp,Bi.secp256k1,Bi.zeros,Bi.zeroAddress,Bi.setLengthLeft,Bi.setLength,Bi.setLengthRight,Bi.unpad,Bi.stripZeros,Bi.toBuffer,Bi.bufferToInt,Bi.bufferToHex,Bi.fromSigned,Bi.toUnsigned,Bi.keccak,Bi.keccak256,Bi.sha3,Bi.sha256,Bi.ripemd160,Bi.rlphash,Bi.isValidPrivate,Bi.isValidPublic,Bi.pubToAddress,Bi.publicToAddress,Bi.privateToPublic,Bi.importPublic,Bi.ecsign,Bi.hashPersonalMessage,Bi.ecrecover,Bi.toRpcSig,Bi.fromRpcSig,Bi.privateToAddress,Bi.isValidAddress),zi=(Bi.isZeroAddress,Bi.toChecksumAddress,Bi.isValidChecksumAddress,Bi.generateAddress,Bi.isPrecompiled,Bi.addHexPrefix),Di=(Bi.isValidSignature,Bi.baToJSON,Bi.defineProperties,function(){for(var t={},e=0;e0&&f.length>i&&!f.warned){f.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+f.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=t,s.type=e,s.count=f.length,o=s,console&&console.warn&&console.warn(o)}return t}function ia(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function aa(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=ia.bind(n);return i.listener=r,n.wrapFn=i,i}function fa(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(a=e[0]),a instanceof Error)throw a;var f=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw f.context=a,f}var o=i[t];if(void 0===o)return!1;if("function"==typeof o)Ji(o,this,e);else{var s=o.length,c=sa(o,s);for(r=0;r=0;a--)if(r[a]===e||r[a].listener===e){f=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},$i.prototype.listeners=function(t){return fa(this,t,!0)},$i.prototype.rawListeners=function(t){return fa(this,t,!1)},$i.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):oa.call(t,e)},$i.prototype.listenerCount=oa,$i.prototype.eventNames=function(){return this._eventsCount>0?Wi(this._events):[]};var ca="object"==typeof Reflect?Reflect:null,ua=ca&&"function"==typeof ca.apply?ca.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)},da=ha;function ha(){Qi.call(this)}function la(t,e,r){try{ua(t,e,r)}catch(t){setTimeout((function(){throw t}))}}function ba(t,e){for(var r=new Array(e),n=0;n0&&(a=e[0]),a instanceof Error)throw a;var f=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw f.context=a,f}var o=i[t];if(void 0===o)return!1;if("function"==typeof o)la(o,this,e);else{var s=o.length,c=ba(o,s);for(r=0;r0&&void 0!==arguments[0]?arguments[0]:{};if(Object(s.a)(this,r),!n.provider)throw new Error("PollingBlockTracker - no provider specified.");var i=n.pollingInterval||2e4,a=n.retryTimeout||i/10,f=void 0===n.keepEventLoopActive||n.keepEventLoopActive,o=n.setSkipCacheFlag||!1;return(t=e.call(this,Object.assign({blockResetDuration:i},n)))._provider=n.provider,t._pollingInterval=i,t._retryTimeout=a,t._keepEventLoopActive=f,t._setSkipCacheFlag=o,t}return Object(c.a)(r,[{key:"checkForLatestBlock",value:function(){var t=Object(o.a)(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._updateLatestBlock();case 2:return t.next=4,this.getLatestBlock();case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"_start",value:function(){var t=this;this._performSync().catch((function(e){return t.emit("error",e)}))}},{key:"_performSync",value:function(){var t=Object(o.a)(f.a.mark((function t(){var e;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._isRunning){t.next=16;break}return t.prev=1,t.next=4,this._updateLatestBlock();case 4:return t.next=6,ma(this._pollingInterval,!this._keepEventLoopActive);case 6:t.next=14;break;case 8:t.prev=8,t.t0=t.catch(1),e=new Error("PollingBlockTracker - encountered an error while attempting to update latest block:\n".concat(t.t0.stack));try{this.emit("error",e)}catch(Mi){console.error(e)}return t.next=14,ma(this._retryTimeout,!this._keepEventLoopActive);case 14:t.next=0;break;case 16:case"end":return t.stop()}}),t,this,[[1,8]])})));return function(){return t.apply(this,arguments)}}()},{key:"_updateLatestBlock",value:function(){var t=Object(o.a)(f.a.mark((function t(){var e;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._fetchLatestBlock();case 2:e=t.sent,this._newPotentialLatest(e);case 4:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"_fetchLatestBlock",value:function(){var t=Object(o.a)(f.a.mark((function t(){var e,r,n=this;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e={jsonrpc:"2.0",id:1,method:"eth_blockNumber",params:[]},this._setSkipCacheFlag&&(e.skipCache=!0),t.next=4,Ui((function(t){return n._provider.sendAsync(e,t)}))();case 4:if(!(r=t.sent).error){t.next=7;break}throw new Error("PollingBlockTracker - encountered error fetching block:\n".concat(r.error));case 7:return t.abrupt("return",r.result);case 8:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()}]),r}(function(t){Object(l.a)(r,t);var e=Object(b.a)(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(s.a)(this,r),(t=e.call(this))._blockResetDuration=n.blockResetDuration||2e4,t._blockResetTimeout,t._currentBlock=null,t._isRunning=!1,t._onNewListener=t._onNewListener.bind(Object(u.a)(t)),t._onRemoveListener=t._onRemoveListener.bind(Object(u.a)(t)),t._resetCurrentBlock=t._resetCurrentBlock.bind(Object(u.a)(t)),t._setupInternalEvents(),t}return Object(c.a)(r,[{key:"isRunning",value:function(){return this._isRunning}},{key:"getCurrentBlock",value:function(){return this._currentBlock}},{key:"getLatestBlock",value:function(){var t=Object(o.a)(f.a.mark((function t(){var e=this;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._currentBlock){t.next=2;break}return t.abrupt("return",this._currentBlock);case 2:return t.next=4,new Promise((function(t){return e.once("latest",t)}));case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"removeAllListeners",value:function(t){t?Object(d.a)(Object(h.a)(r.prototype),"removeAllListeners",this).call(this,t):Object(d.a)(Object(h.a)(r.prototype),"removeAllListeners",this).call(this),this._setupInternalEvents(),this._onRemoveListener()}},{key:"_start",value:function(){}},{key:"_end",value:function(){}},{key:"_setupInternalEvents",value:function(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}},{key:"_onNewListener",value:function(t,e){va.includes(t)&&this._maybeStart()}},{key:"_onRemoveListener",value:function(t,e){this._getBlockTrackerEventCount()>0||this._maybeEnd()}},{key:"_maybeStart",value:function(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),this._start())}},{key:"_maybeEnd",value:function(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),this._end())}},{key:"_getBlockTrackerEventCount",value:function(){var t=this;return va.map((function(e){return t.listenerCount(e)})).reduce(pa)}},{key:"_newPotentialLatest",value:function(t){var e=this._currentBlock;e&&_a(t)<=_a(e)||this._setCurrentBlock(t)}},{key:"_setCurrentBlock",value:function(t){var e=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:e,newBlock:t})}},{key:"_setupBlockResetTimeout",value:function(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}},{key:"_cancelBlockResetTimeout",value:function(){clearTimeout(this._blockResetTimeout)}},{key:"_resetCurrentBlock",value:function(){this._currentBlock=null}}]),r}(da));function ma(t,e){return new Promise((function(r){var n=setTimeout(r,t);n.unref&&e&&n.unref()}))}var ga="object"==typeof p.d&&p.d&&p.d.Object===Object&&p.d,wa="object"==typeof self&&self&&self.Object===Object&&self,Aa=ga||wa||Function("return this")(),Ea=Aa.Symbol,Ia=Object.prototype,Ma=Ia.hasOwnProperty,Sa=Ia.toString,ka=Ea?Ea.toStringTag:void 0,La=Object.prototype.toString,xa=Ea?Ea.toStringTag:void 0,Pa=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":xa&&xa in Object(t)?function(t){var e=Ma.call(t,ka),r=t[ka];try{t[ka]=void 0;var n=!0}catch(t){}var i=Sa.call(t);return n&&(e?t[ka]=r:delete t[ka]),i}(t):function(t){return La.call(t)}(t)},Ta=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},Ra=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},ja=function(t){return null!=t&&Ra(t.length)&&!function(t){if(!Ta(t))return!1;var e=Pa(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}(t)},Oa=Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={},t.exports=e.default}));Object(p.c)(Oa);var Ca=function(){},Ba=Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return function(){if(null!==t){var e=t;t=null,e.apply(this,arguments)}}},t.exports=e.default}));Object(p.c)(Ba);var Na=Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return r&&t[r]&&t[r]()};var r="function"==typeof Symbol&&Symbol.iterator;t.exports=e.default}));Object(p.c)(Na);var za=function(t){return null!=t&&"object"==typeof t},Da=function(t){return za(t)&&"[object Arguments]"==Pa(t)},Ka=Object.prototype,Va=Ka.hasOwnProperty,Ua=Ka.propertyIsEnumerable,qa=Da(function(){return arguments}())?Da:function(t){return za(t)&&Va.call(t,"callee")&&!Ua.call(t,"callee")},Ya=Array.isArray,Fa=function(){return!1},Ha=Object(p.b)((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,i=n&&n.exports===r?Aa.Buffer:void 0,a=(i?i.isBuffer:void 0)||Fa;t.exports=a})),Ga=/^(?:0|[1-9]\d*)$/,Wa=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&Ga.test(t))&&t>-1&&t%1==0&&t2&&(n=(0,i.default)(arguments,1)),o[e]=n,r(t)}))}),(function(t){f(t,o)}))};var r=f(Ca),n=f(ja),i=f(uf),a=f(bf);function f(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default}));Object(p.c)(Mf);var Sf=Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){(0,n.default)(r.default,t,e)};var r=i(_f),n=i(Mf);function i(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default}));Object(p.c)(Sf);var kf=Object(p.b)((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.MAX_INTEGER=new Ie("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),r.TWO_POW256=new Ie("10000000000000000000000000000000000000000000000000000000000000000",16),r.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",r.KECCAK256_NULL=t.from(r.KECCAK256_NULL_S,"hex"),r.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",r.KECCAK256_RLP_ARRAY=t.from(r.KECCAK256_RLP_ARRAY_S,"hex"),r.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",r.KECCAK256_RLP=t.from(r.KECCAK256_RLP_S,"hex")}));Object(p.c)(kf),kf.MAX_INTEGER,kf.TWO_POW256,kf.KECCAK256_NULL_S,kf.KECCAK256_NULL,kf.KECCAK256_RLP_ARRAY_S,kf.KECCAK256_RLP_ARRAY,kf.KECCAK256_RLP_S,kf.KECCAK256_RLP;var Lf=Object(p.b)((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.zeros=function(e){return t.allocUnsafe(e).fill(0)},r.setLengthLeft=function(t,e,n){void 0===n&&(n=!1);var i=r.zeros(e);return t=r.toBuffer(t),n?t.length0&&"0"===e.toString();)e=(t=t.slice(1))[0];return t},r.stripZeros=r.unpad,r.toBuffer=function(e){if(!t.isBuffer(e))if(Array.isArray(e))e=t.from(e);else if("string"==typeof e){if(!Ci.isHexString(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+e);e=t.from(Ci.padToEven(Ci.stripHexPrefix(e)),"hex")}else if("number"==typeof e)e=Ci.intToBuffer(e);else if(null==e)e=t.allocUnsafe(0);else if(Ie.isBN(e))e=e.toArrayLike(t);else{if(!e.toArray)throw new Error("invalid type");e=t.from(e.toArray())}return e},r.bufferToInt=function(t){return new Ie(r.toBuffer(t)).toNumber()},r.bufferToHex=function(t){return"0x"+(t=r.toBuffer(t)).toString("hex")},r.fromSigned=function(t){return new Ie(t).fromTwos(256)},r.toUnsigned=function(e){return t.from(e.toTwos(256).toArray())},r.addHexPrefix=function(t){return"string"!=typeof t||Ci.isHexPrefixed(t)?t:"0x"+t},r.baToJSON=function(e){if(t.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var n=[],i=0;i>>31),l=d^(a<<1|i>>>31),b=t[0]^h,p=t[1]^l,v=t[10]^h,_=t[11]^l,y=t[20]^h,m=t[21]^l,g=t[30]^h,w=t[31]^l,A=t[40]^h,E=t[41]^l;h=r^(f<<1|o>>>31),l=n^(o<<1|f>>>31);var I=t[2]^h,M=t[3]^l,S=t[12]^h,k=t[13]^l,L=t[22]^h,x=t[23]^l,P=t[32]^h,T=t[33]^l,R=t[42]^h,j=t[43]^l;h=i^(s<<1|c>>>31),l=a^(c<<1|s>>>31);var O=t[4]^h,C=t[5]^l,B=t[14]^h,N=t[15]^l,z=t[24]^h,D=t[25]^l,K=t[34]^h,V=t[35]^l,U=t[44]^h,q=t[45]^l;h=f^(u<<1|d>>>31),l=o^(d<<1|u>>>31);var Y=t[6]^h,F=t[7]^l,H=t[16]^h,G=t[17]^l,W=t[26]^h,Z=t[27]^l,J=t[36]^h,X=t[37]^l,$=t[46]^h,Q=t[47]^l;h=s^(r<<1|n>>>31),l=c^(n<<1|r>>>31);var tt=t[8]^h,et=t[9]^l,rt=t[18]^h,nt=t[19]^l,it=t[28]^h,at=t[29]^l,ft=t[38]^h,ot=t[39]^l,st=t[48]^h,ct=t[49]^l,ut=b,dt=p,ht=_<<4|v>>>28,lt=v<<4|_>>>28,bt=y<<3|m>>>29,pt=m<<3|y>>>29,vt=w<<9|g>>>23,_t=g<<9|w>>>23,yt=A<<18|E>>>14,mt=E<<18|A>>>14,gt=I<<1|M>>>31,wt=M<<1|I>>>31,At=k<<12|S>>>20,Et=S<<12|k>>>20,It=L<<10|x>>>22,Mt=x<<10|L>>>22,St=T<<13|P>>>19,kt=P<<13|T>>>19,Lt=R<<2|j>>>30,xt=j<<2|R>>>30,Pt=C<<30|O>>>2,Tt=O<<30|C>>>2,Rt=B<<6|N>>>26,jt=N<<6|B>>>26,Ot=D<<11|z>>>21,Ct=z<<11|D>>>21,Bt=K<<15|V>>>17,Nt=V<<15|K>>>17,zt=q<<29|U>>>3,Dt=U<<29|q>>>3,Kt=Y<<28|F>>>4,Vt=F<<28|Y>>>4,Ut=G<<23|H>>>9,qt=H<<23|G>>>9,Yt=W<<25|Z>>>7,Ft=Z<<25|W>>>7,Ht=J<<21|X>>>11,Gt=X<<21|J>>>11,Wt=Q<<24|$>>>8,Zt=$<<24|Q>>>8,Jt=tt<<27|et>>>5,Xt=et<<27|tt>>>5,$t=rt<<20|nt>>>12,Qt=nt<<20|rt>>>12,te=at<<7|it>>>25,ee=it<<7|at>>>25,re=ft<<8|ot>>>24,ne=ot<<8|ft>>>24,ie=st<<14|ct>>>18,ae=ct<<14|st>>>18;t[0]=ut^~At&Ot,t[1]=dt^~Et&Ct,t[10]=Kt^~$t&bt,t[11]=Vt^~Qt&pt,t[20]=gt^~Rt&Yt,t[21]=wt^~jt&Ft,t[30]=Jt^~ht&It,t[31]=Xt^~lt&Mt,t[40]=Pt^~Ut&te,t[41]=Tt^~qt&ee,t[2]=At^~Ot&Ht,t[3]=Et^~Ct&Gt,t[12]=$t^~bt&St,t[13]=Qt^~pt&kt,t[22]=Rt^~Yt&re,t[23]=jt^~Ft&ne,t[32]=ht^~It&Bt,t[33]=lt^~Mt&Nt,t[42]=Ut^~te&vt,t[43]=qt^~ee&_t,t[4]=Ot^~Ht&ie,t[5]=Ct^~Gt&ae,t[14]=bt^~St&zt,t[15]=pt^~kt&Dt,t[24]=Yt^~re&yt,t[25]=Ft^~ne&mt,t[34]=It^~Bt&Wt,t[35]=Mt^~Nt&Zt,t[44]=te^~vt&Lt,t[45]=ee^~_t&xt,t[6]=Ht^~ie&ut,t[7]=Gt^~ae&dt,t[16]=St^~zt&Kt,t[17]=kt^~Dt&Vt,t[26]=re^~yt>,t[27]=ne^~mt&wt,t[36]=Bt^~Wt&Jt,t[37]=Nt^~Zt&Xt,t[46]=vt^~Lt&Pt,t[47]=_t^~xt&Tt,t[8]=ie^~ut&At,t[9]=ae^~dt&Et,t[18]=zt^~Kt&$t,t[19]=Dt^~Vt&Qt,t[28]=yt^~gt&Rt,t[29]=mt^~wt&jt,t[38]=Wt^~Jt&ht,t[39]=Zt^~Xt<,t[48]=Lt^~Pt&Ut,t[49]=xt^~Tt&qt,t[0]^=jf[2*e],t[1]^=jf[2*e+1]}},Cf=y.Buffer;function Bf(){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}Bf.prototype.initialize=function(t,e){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1},Bf.prototype.absorb=function(t){for(var e=0;e>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(Of(this.state),this.count=0);return e},Bf.prototype.copy=function(t){for(var e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var Nf=function(t){var e=function(t){function e(e,r,n,i,a){Pf.call(this,a),this._rate=e,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=i,this._options=a,this._state=new t,this._state.initialize(e,r),this._finalized=!1}return m(e,Pf),e.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},e.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},e.prototype.update=function(t,e){if(!xf.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return xf.isBuffer(t)||(t=xf.from(t,e)),this._state.absorb(t),this},e.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var e=this._state.squeeze(this._hashBitLength/8);return void 0!==t&&(e=e.toString(t)),this._resetState(),e},e.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},e.prototype._clone=function(){var t=new e(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t},e}(t),r=function(t){function e(e,r,n,i){Rf.call(this,i),this._rate=e,this._capacity=r,this._delimitedSuffix=n,this._options=i,this._state=new t,this._state.initialize(e,r),this._finalized=!1}return m(e,Rf),e.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},e.prototype._flush=function(){},e.prototype._read=function(t){this.push(this.squeeze(t))},e.prototype.update=function(t,e){if(!Tf.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Tf.isBuffer(t)||(t=Tf.from(t,e)),this._state.absorb(t),this},e.prototype.squeeze=function(t,e){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(t);return void 0!==e&&(r=r.toString(e)),r},e.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},e.prototype._clone=function(){var t=new e(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t},e}(t);return function(t,n){switch("string"==typeof t?t.toLowerCase():t){case"keccak224":return new e(1152,448,null,224,n);case"keccak256":return new e(1088,512,null,256,n);case"keccak384":return new e(832,768,null,384,n);case"keccak512":return new e(576,1024,null,512,n);case"sha3-224":return new e(1152,448,6,224,n);case"sha3-256":return new e(1088,512,6,256,n);case"sha3-384":return new e(832,768,6,384,n);case"sha3-512":return new e(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+t)}}}(Bf),zf=Object(p.b)((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.keccak=function(e,r){return void 0===r&&(r=256),e="string"!=typeof e||Ci.isHexString(e)?Lf.toBuffer(e):t.from(e,"utf8"),r||(r=256),Nf("keccak"+r).update(e).digest()},r.keccak256=function(t){return r.keccak(t)},r.sha256=function(t){return t=Lf.toBuffer(t),Ee("sha256").update(t).digest()},r.ripemd160=function(t,e){t=Lf.toBuffer(t);var r=Ee("rmd160").update(t).digest();return!0===e?Lf.setLength(r,32):r},r.rlphash=function(t){return r.keccak(Pi.encode(t))}}));Object(p.c)(zf),zf.keccak,zf.keccak256,zf.sha256,zf.ripemd160,zf.rlphash;var Df=Object(p.b)((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.zeroAddress=function(){var t=Lf.zeros(20);return Lf.bufferToHex(t)},r.isValidAddress=function(t){return/^0x[0-9a-fA-F]{40}$/.test(t)},r.isZeroAddress=function(t){return r.zeroAddress()===Lf.addHexPrefix(t)},r.toChecksumAddress=function(t,e){t=Ci.stripHexPrefix(t).toLowerCase();for(var r=void 0!==e?e.toString()+"0x":"",n=zf.keccak(r+t).toString("hex"),i="0x",a=0;a=8?i+=t[a].toUpperCase():i+=t[a];return i},r.isValidChecksumAddress=function(t,e){return r.isValidAddress(t)&&r.toChecksumAddress(t,e)===t},r.generateAddress=function(e,r){e=Lf.toBuffer(e);var n=new Ie(r);return n.isZero()?zf.rlphash([e,null]).slice(-20):zf.rlphash([e,t.from(n.toArray())]).slice(-20)},r.generateAddress2=function(e,r,n){var i=Lf.toBuffer(e),a=Lf.toBuffer(r),f=Lf.toBuffer(n);return Object(_.b)(20===i.length),Object(_.b)(32===a.length),zf.keccak256(t.concat([t.from("ff","hex"),i,a,zf.keccak256(f)])).slice(-20)},r.isPrecompiled=function(t){var e=Lf.unpad(t);return 1===e.length&&e[0]>=1&&e[0]<=8},r.isValidPrivate=function(t){return xi.privateKeyVerify(t)},r.isValidPublic=function(e,r){return void 0===r&&(r=!1),64===e.length?xi.publicKeyVerify(t.concat([t.from([4]),e])):!!r&&xi.publicKeyVerify(e)},r.pubToAddress=function(t,e){return void 0===e&&(e=!1),t=Lf.toBuffer(t),e&&64!==t.length&&(t=xi.publicKeyConvert(t,!1).slice(1)),Object(_.b)(64===t.length),zf.keccak(t).slice(-20)},r.publicToAddress=r.pubToAddress,r.privateToAddress=function(t){return r.publicToAddress(r.privateToPublic(t))},r.privateToPublic=function(t){return t=Lf.toBuffer(t),xi.publicKeyCreate(t,!1).slice(1)},r.importPublic=function(t){return 64!==(t=Lf.toBuffer(t)).length&&(t=xi.publicKeyConvert(t,!1).slice(1)),t}}));Object(p.c)(Df),Df.zeroAddress,Df.isValidAddress,Df.isZeroAddress,Df.toChecksumAddress,Df.isValidChecksumAddress,Df.generateAddress,Df.generateAddress2,Df.isPrecompiled,Df.isValidPrivate,Df.isValidPublic,Df.pubToAddress,Df.publicToAddress,Df.privateToAddress,Df.privateToPublic,Df.importPublic;var Kf=Object(p.b)((function(e,r){function n(t,e){return e?t-(2*e+35):t-27}function i(t){return 0===t||1===t}Object.defineProperty(r,"__esModule",{value:!0}),r.ecsign=function(t,e,r){var n=xi.sign(t,e),i=n.recovery;return{r:n.signature.slice(0,32),s:n.signature.slice(32,64),v:r?i+(2*r+35):i+27}},r.ecrecover=function(e,r,a,f,o){var s=t.concat([Lf.setLength(a,32),Lf.setLength(f,32)],64),c=n(r,o);if(!i(c))throw new Error("Invalid signature v value");var u=xi.recover(e,s,c);return xi.publicKeyConvert(u,!1).slice(1)},r.toRpcSig=function(e,r,a,f){if(!i(n(e,f)))throw new Error("Invalid signature v value");return Lf.bufferToHex(t.concat([Lf.setLengthLeft(r,32),Lf.setLengthLeft(a,32),Lf.toBuffer(e)]))},r.fromRpcSig=function(t){var e=Lf.toBuffer(t);if(65!==e.length)throw new Error("Invalid signature length");var r=e[64];return r<27&&(r+=27),{v:r,r:e.slice(0,32),s:e.slice(32,64)}},r.isValidSignature=function(t,e,r,a,f){void 0===a&&(a=!0);var o=new Ie("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),s=new Ie("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==e.length||32!==r.length)return!1;if(!i(n(t,f)))return!1;var c=new Ie(e),u=new Ie(r);return!(c.isZero()||c.gt(s)||u.isZero()||u.gt(s))&&(!a||1!==u.cmp(o))},r.hashPersonalMessage=function(e){var r=t.from("\x19Ethereum Signed Message:\n"+e.length.toString(),"utf-8");return zf.keccak(t.concat([r,e]))}}));Object(p.c)(Kf),Kf.ecsign,Kf.ecrecover,Kf.toRpcSig,Kf.fromRpcSig,Kf.isValidSignature,Kf.hashPersonalMessage;var Vf=Object(p.b)((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.defineProperties=function(e,r,n){if(e.raw=[],e._fields=[],e.toJSON=function(t){if(void 0===t&&(t=!1),t){var r={};return e._fields.forEach((function(t){r[t]="0x"+e[t].toString("hex")})),r}return Lf.baToJSON(e.raw)},e.serialize=function(){return Pi.encode(e.raw)},r.forEach((function(r,n){function i(){return e.raw[n]}function a(i){"00"!==(i=Lf.toBuffer(i)).toString("hex")||r.allowZero||(i=t.allocUnsafe(0)),r.allowLess&&r.length?(i=Lf.stripZeros(i),Object(_.b)(r.length>=i.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===i.length||!r.length||Object(_.b)(r.length===i.length,"The field "+r.name+" must have byte length of "+r.length),e.raw[n]=i}e._fields.push(r.name),Object.defineProperty(e,r.name,{enumerable:!0,configurable:!0,get:i,set:a}),r.default&&(e[r.name]=r.default),r.alias&&Object.defineProperty(e,r.alias,{enumerable:!1,configurable:!0,set:a,get:i})})),n)if("string"==typeof n&&(n=t.from(Ci.stripHexPrefix(n),"hex")),t.isBuffer(n)&&(n=Pi.decode(n)),Array.isArray(n)){if(n.length>e._fields.length)throw new Error("wrong number of fields in data");n.forEach((function(t,r){e[e._fields[r]]=Lf.toBuffer(t)}))}else{if("object"!=typeof n)throw new Error("invalid data");var i=Object.keys(n);r.forEach((function(t){-1!==i.indexOf(t.name)&&(e[t.name]=n[t.name]),-1!==i.indexOf(t.alias)&&(e[t.alias]=n[t.alias])}))}}}));Object(p.c)(Vf),Vf.defineProperties;var Uf=Object(p.b)((function(t,e){function r(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),e.secp256k1=xi,e.BN=Ie,e.rlp=Pi,Object.assign(e,Ci),r(kf),r(Df),r(zf),r(Kf),r(Lf),r(Vf)}));Object(p.c)(Uf),Uf.secp256k1,Uf.BN,Uf.rlp;var qf=function(){};function Yf(t){return t.startsWith("int[")?"int256"+t.slice(3):"int"===t?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):"uint"===t?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):"fixed"===t?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):"ufixed"===t?"ufixed128x128":t}function Ff(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function Hf(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function Gf(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?""===e[2]?"dynamic":parseInt(e[2],10):null}function Wf(t){var e=typeof t;if("string"===e)return Uf.isHexPrefixed(t)?new Ie(Uf.stripHexPrefix(t),16):new Ie(t,10);if("number"===e)return new Ie(t);if(t.toArray)return t;throw new Error("Argument is not a number")}function Zf(t){var e=/^(\w+)\((.*)\)$/.exec(t);if(3!==e.length)throw new Error("Invalid method signature");var r=/^(.+)\):\((.+)$/.exec(e[2]);if(null!==r&&3===r.length)return{method:e[1],args:r[1].split(","),retargs:r[2].split(",")};var n=e[2].split(",");return 1===n.length&&""===n[0]&&(n=[]),{method:e[1],args:n}}function Jf(e,r){var n,i,a,f;if("address"===e)return Jf("uint160",Wf(r));if("bool"===e)return Jf("uint8",r?1:0);if("string"===e)return Jf("bytes",t.from(r,"utf8"));if(to(e)){if(void 0===r.length)throw new Error("Not an array?");if("dynamic"!==(n=Gf(e))&&0!==n&&r.length>n)throw new Error("Elements exceed array size: "+n);for(f in a=[],e=e.slice(0,e.lastIndexOf("[")),"string"==typeof r&&(r=JSON.parse(r)),r)a.push(Jf(e,r[f]));if("dynamic"===n){var o=Jf("uint256",r.length);a.unshift(o)}return t.concat(a)}if("bytes"===e)return r=t.from(r),a=t.concat([Jf("uint256",r.length),r]),r.length%32!=0&&(a=t.concat([a,Uf.zeros(32-r.length%32)])),a;if(e.startsWith("bytes")){if((n=Ff(e))<1||n>32)throw new Error("Invalid bytes width: "+n);return Uf.setLengthRight(r,32)}if(e.startsWith("uint")){if((n=Ff(e))%8||n<8||n>256)throw new Error("Invalid uint width: "+n);if((i=Wf(r)).bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+i.bitLength());if(i<0)throw new Error("Supplied uint is negative");return i.toArrayLike(t,"be",32)}if(e.startsWith("int")){if((n=Ff(e))%8||n<8||n>256)throw new Error("Invalid int width: "+n);if((i=Wf(r)).bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+i.bitLength());return i.toTwos(256).toArrayLike(t,"be",32)}if(e.startsWith("ufixed")){if(n=Hf(e),(i=Wf(r))<0)throw new Error("Supplied ufixed is negative");return Jf("uint256",i.mul(new Ie(2).pow(new Ie(n[1]))))}if(e.startsWith("fixed"))return n=Hf(e),Jf("int256",Wf(r).mul(new Ie(2).pow(new Ie(n[1]))));throw new Error("Unsupported or invalid type: "+e)}function Xf(e,r,n){var i,a,f,o;if("string"==typeof e&&(e=$f(e)),"address"===e.name)return Xf(e.rawType,r,n).toArrayLike(t,"be",20).toString("hex");if("bool"===e.name)return Xf(e.rawType,r,n).toString()===new Ie(1).toString();if("string"===e.name){var s=Xf(e.rawType,r,n);return t.from(s,"utf8").toString()}if(e.isArray){for(f=[],i=e.size,"dynamic"===e.size&&(n=Xf("uint256",r,n).toNumber(),i=Xf("uint256",r,n).toNumber(),n+=32),o=0;oe.size)throw new Error("Decoded int exceeds width: "+e.size+" vs "+a.bitLength());return a}if(e.name.startsWith("int")){if((a=new Ie(r.slice(n,n+32),16,"be").fromTwos(256)).bitLength()>e.size)throw new Error("Decoded uint exceeds width: "+e.size+" vs "+a.bitLength());return a}if(e.name.startsWith("ufixed")){if(i=new Ie(2).pow(new Ie(e.size[1])),!(a=Xf("uint256",r,n)).mod(i).isZero())throw new Error("Decimals not supported yet");return a.div(i)}if(e.name.startsWith("fixed")){if(i=new Ie(2).pow(new Ie(e.size[1])),!(a=Xf("int256",r,n)).mod(i).isZero())throw new Error("Decimals not supported yet");return a.div(i)}throw new Error("Unsupported or invalid type: "+e.name)}function $f(t){var e,r,n;if(to(t)){e=Gf(t);var i=t.slice(0,t.lastIndexOf("["));return i=$f(i),{isArray:!0,name:t,size:e,memoryUsage:"dynamic"===e?32:i.memoryUsage*e,subArray:i}}switch(t){case"address":n="uint160";break;case"bool":n="uint8";break;case"string":n="bytes"}if(r={rawType:n,name:t,memoryUsage:32},t.startsWith("bytes")&&"bytes"!==t||t.startsWith("uint")||t.startsWith("int")?r.size=Ff(t):(t.startsWith("ufixed")||t.startsWith("fixed"))&&(r.size=Hf(t)),t.startsWith("bytes")&&"bytes"!==t&&(r.size<1||r.size>32))throw new Error("Invalid bytes width: "+r.size);if((t.startsWith("uint")||t.startsWith("int"))&&(r.size%8||r.size<8||r.size>256))throw new Error("Invalid int/uint width: "+r.size);return r}function Qf(t){return"string"===t||"bytes"===t||"dynamic"===Gf(t)}function to(t){return t.lastIndexOf("]")===t.length-1}function eo(t,e){return t.startsWith("address")||t.startsWith("bytes")?"0x"+e.toString("hex"):e.toString()}qf.eventID=function(e,r){var n=e+"("+r.map(Yf).join(",")+")";return Uf.keccak256(t.from(n))},qf.methodID=function(t,e){return qf.eventID(t,e).slice(0,4)},qf.rawEncode=function(e,r){var n=[],i=[],a=0;e.forEach((function(t){if(to(t)){var e=Gf(t);a+="dynamic"!==e?32*e:32}else a+=32}));for(var f=0;fo)throw new Error("Elements exceed array size: "+o)}var s=r.map((function(t){return qf.solidityHexValue(f,t,256)}));return t.concat(s)}if("bytes"===e)return r;if("string"===e)return t.from(r,"utf8");if("bool"===e){n=n||8;var c=Array(n/4).join("0");return t.from(r?c+"1":c+"0","hex")}if("address"===e){var u=20;return n&&(u=n/8),Uf.setLengthLeft(r,u)}if(e.startsWith("bytes")){if((i=Ff(e))<1||i>32)throw new Error("Invalid bytes width: "+i);return Uf.setLengthRight(r,i)}if(e.startsWith("uint")){if((i=Ff(e))%8||i<8||i>256)throw new Error("Invalid uint width: "+i);if((a=Wf(r)).bitLength()>i)throw new Error("Supplied uint exceeds width: "+i+" vs "+a.bitLength());return n=n||i,a.toArrayLike(t,"be",n/8)}if(e.startsWith("int")){if((i=Ff(e))%8||i<8||i>256)throw new Error("Invalid int width: "+i);if((a=Wf(r)).bitLength()>i)throw new Error("Supplied int exceeds width: "+i+" vs "+a.bitLength());return n=n||i,a.toTwos(i).toArrayLike(t,"be",n/8)}throw new Error("Unsupported or invalid type: "+e)},qf.solidityPack=function(e,r){if(e.length!==r.length)throw new Error("Number of types are not matching the values");for(var n=[],i=0;i="0"&&e<="9";)a+=t[f]-"0",f++;n=f-1,r.push(a)}else if("i"===i)r.push("int256");else{if("a"!==i)throw new Error("Unsupported or invalid type: "+i);r.push("int256[]")}}return r},qf.toSerpent=function(t){for(var e=[],r=0;r=2&&("function"==typeof arguments[1]?r.task=arguments[1]:r.n=arguments[1]);var n=r.task;if(r.task=function(){n(e.leave)},e.current+r.n-t>e.capacity)return 1===t&&(e.current--,e.firstHere=!1),e.queue.push(r);e.current+=r.n-t,r.task(e.leave),1===t&&(e.firstHere=!1)},leave:function(t){if(t=t||1,e.current-=t,e.queue.length){var n=e.queue[0];n.n+e.current>e.capacity||(e.queue.shift(),e.current+=n.n,r(n.task))}else if(e.current<0)throw new Error("leave called too many times.")},available:function(t){return t=t||1,e.current+t<=e.capacity}};return e}})),co=function(t){return function(e,r,n,i){var a=t[e.method];return void 0===a?n():"function"==typeof a?a(e,r,n,i):(r.result=a,void i())}},uo=Object.prototype.toString,ho="function"==typeof n?n:function(){var t=[].slice.apply(arguments);t.splice(1,0,0),setTimeout.apply(null,t)},lo=function(t){if(e=t.then,"[object Function]"!==uo.call(e))throw new TypeError("Expected a promise");var e;return function(e){t.then((function(t){ho(e,null,t)}),(function(t){ho(e,t)}))}},bo=function(t){return function(e,r,n,i){var a=null,s=t(e,r,Object(o.a)(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=new Promise((function(t){n((function(e){return t(e)}))})),t.next=3,a;case 3:return t.abrupt("return",void t.sent);case 4:case"end":return t.stop()}}),t)}))));lo(s)((function(t){a?lo(a)((function(e,r){if(e)return console.error(e),i(e);r(t)})):i(t)}))}},po=function(){function t(e){Object(s.a)(this,t),this.tasks=[],this.count=e}return Object(c.a)(t,[{key:"sched",value:function(){if(this.count>0&&this.tasks.length>0){this.count--;var t=this.tasks.shift();if(void 0===t)throw"Unexpected undefined value in tasks list";t()}}},{key:"acquire",value:function(){var t=this;return new Promise((function(e,r){t.tasks.push((function(){var r=!1;e((function(){r||(r=!0,t.count++,t.sched())}))})),i&&i.nextTick?i.nextTick(t.sched.bind(t)):n(t.sched.bind(t))}))}},{key:"use",value:function(t){return this.acquire().then((function(e){return t().then((function(t){return e(),t})).catch((function(t){throw e(),t}))}))}}]),t}(),vo={Semaphore:po,Mutex:function(t){Object(l.a)(r,t);var e=Object(b.a)(r);function r(){return Object(s.a)(this,r),e.call(this,1)}return r}(po)},_o=function(t){Object(l.a)(r,t);var e=Object(b.a)(r);function r(){var t;return Object(s.a)(this,r),(t=e.call(this)).updates=[],t}return Object(c.a)(r,[{key:"initialize",value:function(){var t=Object(o.a)(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()},{key:"update",value:function(){var t=Object(o.a)(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error("BaseFilter - no update method specified");case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()},{key:"addResults",value:function(t){var e=this;this.updates=this.updates.concat(t),t.forEach((function(t){return e.emit("update",t)}))}},{key:"addInitialResults",value:function(t){}},{key:"getChangesAndClear",value:function(){var t=this.updates;return this.updates=[],t}}]),r}(da),yo=function(){for(var t=arguments.length,e=new Array(t),r=0;r=ko(t.blockNumber))return!1;if(Po(this.params.toBlock)&&ko(this.params.toBlock)<=ko(t.blockNumber))return!1;var e=t.address&&t.address.toLowerCase();return!(this.params.address&&e&&!this.params.address.includes(e))&&this.params.topics.every((function(e,r){var n=t.topics[r];if(!n)return!1;n=n.toLowerCase();var i=Array.isArray(e)?e:[e];return!!i.includes(null)||(i=i.map((function(t){return t.toLowerCase()}))).includes(n)}))}}]),r}(function(t){Object(l.a)(r,t);var e=Object(b.a)(r);function r(){var t;return Object(s.a)(this,r),(t=e.call(this)).allResults=[],t}return Object(c.a)(r,[{key:"update",value:function(){var t=Object(o.a)(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error("BaseFilterWithHistory - no update method specified");case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()},{key:"addResults",value:function(t){this.allResults=this.allResults.concat(t),Object(d.a)(Object(h.a)(r.prototype),"addResults",this).call(this,t)}},{key:"addInitialResults",value:function(t){this.allResults=this.allResults.concat(t),Object(d.a)(Object(h.a)(r.prototype),"addInitialResults",this).call(this,t)}},{key:"getAllResults",value:function(){return this.allResults}}]),r}(_o)),Ro=function(){var t=Object(o.a)(f.a.mark((function t(e){var r,n,i,a,o,s;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.provider,n=e.fromBlock,i=e.toBlock,n||(n=i),a=jo(n),o=jo(i),s=Array(o-a+1).fill().map((function(t,e){return a+e})).map(Oo),t.next=5,Promise.all(s.map((function(t){return function(t,e,r){return new Promise((function(e,n){t.sendAsync({id:1,jsonrpc:"2.0",method:"eth_getBlockByNumber",params:r},(function(t,r){if(t)return n(t);e(r.result)}))}))}(r,0,[t,!1])})));case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();function jo(t){return null==t?t:Number.parseInt(t,16)}function Oo(t){return null==t?t:"0x"+t.toString(16)}var Co=go,Bo=function(t){Object(l.a)(r,t);var e=Object(b.a)(r);function r(t){var n,i=t.provider;t.params;return Object(s.a)(this,r),(n=e.call(this)).type="block",n.provider=i,n}return Object(c.a)(r,[{key:"update",value:function(){var t=Object(o.a)(f.a.mark((function t(e){var r,n,i,a,o;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.oldBlock,n=e.newBlock,i=n,a=Co(r),t.next=5,Ro({provider:this.provider,fromBlock:a,toBlock:i});case 5:o=t.sent.map((function(t){return t.hash})),this.addResults(o);case 7:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()}]),r}(_o),No=Object(p.b)((function(t,e){var r="[object Arguments]",n="[object Map]",i="[object Object]",a="[object Set]",f=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/,s=/^\./,c=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,u=/\\(\\)?/g,d=/^\[object .+?Constructor\]$/,h=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[r]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l["[object Function]"]=l[n]=l["[object Number]"]=l[i]=l["[object RegExp]"]=l[a]=l["[object String]"]=l["[object WeakMap]"]=!1;var b="object"==typeof p.d&&p.d&&p.d.Object===Object&&p.d,v="object"==typeof self&&self&&self.Object===Object&&self,_=b||v||Function("return this")(),y=e&&!e.nodeType&&e,m=y&&t&&!t.nodeType&&t,g=m&&m.exports===y&&b.process,w=function(){try{return g&&g.binding("util")}catch(t){}}(),A=w&&w.isTypedArray;function E(t,e){for(var r=-1,n=t?t.length:0,i=Array(n);++r-1},st.prototype.set=function(t,e){var r=this.__data__,n=ht(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},ct.prototype.clear=function(){this.__data__={hash:new ot,map:new(W||st),string:new ot}},ct.prototype.delete=function(t){return At(this,t).delete(t)},ct.prototype.get=function(t){return At(this,t).get(t)},ct.prototype.has=function(t){return At(this,t).has(t)},ct.prototype.set=function(t,e){return At(this,t).set(t,e),this},ut.prototype.add=ut.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},ut.prototype.has=function(t){return this.__data__.has(t)},dt.prototype.clear=function(){this.__data__=new st},dt.prototype.delete=function(t){return this.__data__.delete(t)},dt.prototype.get=function(t){return this.__data__.get(t)},dt.prototype.has=function(t){return this.__data__.has(t)},dt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof st){var n=r.__data__;if(!W||n.length<199)return n.push([t,e]),this;r=this.__data__=new ct(n)}return r.set(t,e),this};var lt,bt=(lt=function(t,e){return t&&pt(t,e,Yt)},function(t,e){if(null==t)return t;if(!Nt(t))return lt(t,e);for(var r=t.length,n=-1,i=Object(t);++no))return!1;var c=a.get(t);if(c&&a.get(e))return c==e;var u=-1,d=!0,h=1&i?new ut:void 0;for(a.set(t,e),a.set(e,t);++u-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991}function Kt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Vt(t){return!!t&&"object"==typeof t}function Ut(t){return"symbol"==typeof t||Vt(t)&&"[object Symbol]"==D.call(t)}var qt=A?function(t){return function(e){return t(e)}}(A):function(t){return Vt(t)&&Dt(t.length)&&!!l[D.call(t)]};function Yt(t){return Nt(t)?function(t,e){var r=Bt(t)||Ct(t)?function(t,e){for(var r=-1,n=Array(t);++r0&&n(s)?r>1?t(s,r-1,n,i,a):I(a,s):i||(a[a.length]=s)}return a}(function(t,e){return(Bt(t)?E:mt)(t,function(t){return"function"==typeof t?t:null==t?Ft:"object"==typeof t?Bt(t)?function(t,e){return kt(t)&&Lt(e)?xt(Tt(t),e):function(r){var n=function(t,e,r){var n=null==t?void 0:vt(t,e);return void 0===n?void 0:n}(r,t);return void 0===n&&n===e?function(t,e){return null!=t&&function(t,e,r){for(var n,i=-1,a=(e=kt(e,t)?[e]:gt(e)).length;++i0?e.on("sync",u):r>0&&0===n&&e.removeListener("sync",u)}};function Yo(t){return Fo(Object(o.a)(f.a.mark((function e(){var r,n=arguments;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.apply(void 0,n);case 2:return r=e.sent,e.abrupt("return",Vo(r.id));case 4:case"end":return e.stop()}}),e)}))))}function Fo(t){return bo(function(){var e=Object(o.a)(f.a.mark((function e(r,n){var i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.apply(null,r.params);case 2:i=e.sent,n.result=i;case 4:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}())}function Ho(t,e){var r=[];for(var n in t)r.push(t[n]);return r}var Go=Ao,Wo=go,Zo=function(t){var e=t.blockTracker,r=t.provider,n={},i=qo({blockTracker:e,provider:r}),a=!1,s=new da,c=co({eth_subscribe:bo(function(){var t=Object(o.a)(f.a.mark((function t(s,c){var d,h,l,b,p;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!a){t.next=2;break}throw new Error("SubscriptionManager - attempting to use after destroying");case 2:d=s.params[0],h=Go(16),t.t0=d,t.next="newHeads"===t.t0?6:"logs"===t.t0?8:14;break;case 6:return l=function(t){var n=t.subId,i={type:d,destroy:function(){var t=Object(o.a)(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.removeListener("sync",i.update);case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),update:function(){var t=Object(o.a)(f.a.mark((function t(e){var i,a,o,s;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.oldBlock,a=e.newBlock,o=a,s=Wo(i),t.next=4,Ro({provider:r,fromBlock:s,toBlock:o});case 4:t.sent.map(Jo).forEach((function(t){u(n,t)}));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()};return e.on("sync",i.update),i}({subId:h}),t.abrupt("break",15);case 8:return b=s.params[1],t.next=11,i.newLogFilter(b);case 11:return p=t.sent,l=function(t){var e=t.subId,r=t.filter;return r.on("update",(function(t){return u(e,t)})),{type:d,destroy:function(){var t=Object(o.a)(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.uninstallFilter(r.idHex);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()}}({subId:h,filter:p}),t.abrupt("break",15);case 14:throw new Error('SubscriptionManager - unsupported subscription type "'.concat(d,'"'));case 15:return t.abrupt("return",(n[h]=l,void(c.result=h)));case 16:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()),eth_unsubscribe:bo(function(){var t=Object(o.a)(f.a.mark((function t(e,r){var i,o;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!a){t.next=2;break}throw new Error("SubscriptionManager - attempting to use after destroying");case 2:if(i=e.params[0],o=n[i]){t.next=5;break}return t.abrupt("return",void(r.result=!1));case 5:return delete n[i],t.next=8,o.destroy();case 8:r.result=!0;case 9:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}())});return c.destroy=function(){for(var t in s.removeAllListeners(),n)n[t].destroy(),delete n[t];a=!0},{events:s,middleware:c};function u(t,e){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:t,result:e}})}};function Jo(t){return{hash:t.hash,parentHash:t.parentHash,sha3Uncles:t.sha3Uncles,miner:t.miner,stateRoot:t.stateRoot,transactionsRoot:t.transactionsRoot,receiptsRoot:t.receiptsRoot,logsBloom:t.logsBloom,difficulty:t.difficulty,number:t.number,gasLimit:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}}).call(this,r(52).Buffer,r(449).setImmediate,r(90))}}]); \ No newline at end of file +(this.webpackJsonpbridge=this.webpackJsonpbridge||[]).push([[1],{736:function(t,e,r){"use strict";var n=r(373),i=r.n(n);r.d(e,"a",(function(){return i.a}));var a=r(10),f=r.n(a);r.d(e,"b",(function(){return f.a}));var o=r(450),s=r.n(o);r.d(e,"c",(function(){return s.a}))},804:function(t,e,r){"use strict";(function(t,n,i){r.d(e,"a",(function(){return Ie})),r.d(e,"b",(function(){return ya})),r.d(e,"c",(function(){return so})),r.d(e,"d",(function(){return Bi})),r.d(e,"e",(function(){return Ef})),r.d(e,"f",(function(){return Zo})),r.d(e,"g",(function(){return qo})),r.d(e,"h",(function(){return Di})),r.d(e,"i",(function(){return Ri})),r.d(e,"j",(function(){return zi})),r.d(e,"k",(function(){return Ni})),r.d(e,"l",(function(){return bo})),r.d(e,"m",(function(){return gf})),r.d(e,"n",(function(){return Sf})),r.d(e,"o",(function(){return no})),r.d(e,"p",(function(){return If}));var a=r(11),f=r.n(a),o=r(22),s=r(21),c=r(30),u=r(83),d=r(55),h=r(48),l=r(32),b=r(33),p=r(714),v=(r(52),r(737)),_=(r(374),r(373),r(736)),y=(r(726),r(10),r(450),Object(p.b)((function(t,e){var r=v.a.Buffer;function n(t,e){for(var r in t)e[r]=t[r]}function i(t,e,n){return r(t,e,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=v.a:(n(v.a,e),e.Buffer=i),i.prototype=Object.create(r.prototype),n(r,i),i.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return r(t,e,n)},i.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=r(t);return void 0!==e?"string"==typeof n?i.fill(e,n):i.fill(e):i.fill(0),i},i.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r(t)},i.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return v.a.SlowBuffer(t)}}))),m=(y.Buffer,Object(p.b)((function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}}))),g=y.Buffer,w=v.b.Transform,A=y.Buffer,E=v.b.Transform,I=[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],M=function(t){for(var e=0;e<24;++e){var r=t[0]^t[10]^t[20]^t[30]^t[40],n=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],f=t[4]^t[14]^t[24]^t[34]^t[44],o=t[5]^t[15]^t[25]^t[35]^t[45],s=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],u=t[8]^t[18]^t[28]^t[38]^t[48],d=t[9]^t[19]^t[29]^t[39]^t[49],h=u^(i<<1|a>>>31),l=d^(a<<1|i>>>31),b=t[0]^h,p=t[1]^l,v=t[10]^h,_=t[11]^l,y=t[20]^h,m=t[21]^l,g=t[30]^h,w=t[31]^l,A=t[40]^h,E=t[41]^l;h=r^(f<<1|o>>>31),l=n^(o<<1|f>>>31);var M=t[2]^h,S=t[3]^l,k=t[12]^h,L=t[13]^l,x=t[22]^h,P=t[23]^l,T=t[32]^h,R=t[33]^l,j=t[42]^h,O=t[43]^l;h=i^(s<<1|c>>>31),l=a^(c<<1|s>>>31);var C=t[4]^h,B=t[5]^l,N=t[14]^h,z=t[15]^l,D=t[24]^h,K=t[25]^l,V=t[34]^h,U=t[35]^l,q=t[44]^h,Y=t[45]^l;h=f^(u<<1|d>>>31),l=o^(d<<1|u>>>31);var F=t[6]^h,H=t[7]^l,G=t[16]^h,W=t[17]^l,Z=t[26]^h,J=t[27]^l,X=t[36]^h,$=t[37]^l,Q=t[46]^h,tt=t[47]^l;h=s^(r<<1|n>>>31),l=c^(n<<1|r>>>31);var et=t[8]^h,rt=t[9]^l,nt=t[18]^h,it=t[19]^l,at=t[28]^h,ft=t[29]^l,ot=t[38]^h,st=t[39]^l,ct=t[48]^h,ut=t[49]^l,dt=b,ht=p,lt=_<<4|v>>>28,bt=v<<4|_>>>28,pt=y<<3|m>>>29,vt=m<<3|y>>>29,_t=w<<9|g>>>23,yt=g<<9|w>>>23,mt=A<<18|E>>>14,gt=E<<18|A>>>14,wt=M<<1|S>>>31,At=S<<1|M>>>31,Et=L<<12|k>>>20,It=k<<12|L>>>20,Mt=x<<10|P>>>22,St=P<<10|x>>>22,kt=R<<13|T>>>19,Lt=T<<13|R>>>19,xt=j<<2|O>>>30,Pt=O<<2|j>>>30,Tt=B<<30|C>>>2,Rt=C<<30|B>>>2,jt=N<<6|z>>>26,Ot=z<<6|N>>>26,Ct=K<<11|D>>>21,Bt=D<<11|K>>>21,Nt=V<<15|U>>>17,zt=U<<15|V>>>17,Dt=Y<<29|q>>>3,Kt=q<<29|Y>>>3,Vt=F<<28|H>>>4,Ut=H<<28|F>>>4,qt=W<<23|G>>>9,Yt=G<<23|W>>>9,Ft=Z<<25|J>>>7,Ht=J<<25|Z>>>7,Gt=X<<21|$>>>11,Wt=$<<21|X>>>11,Zt=tt<<24|Q>>>8,Jt=Q<<24|tt>>>8,Xt=et<<27|rt>>>5,$t=rt<<27|et>>>5,Qt=nt<<20|it>>>12,te=it<<20|nt>>>12,ee=ft<<7|at>>>25,re=at<<7|ft>>>25,ne=ot<<8|st>>>24,ie=st<<8|ot>>>24,ae=ct<<14|ut>>>18,fe=ut<<14|ct>>>18;t[0]=dt^~Et&Ct,t[1]=ht^~It&Bt,t[10]=Vt^~Qt&pt,t[11]=Ut^~te&vt,t[20]=wt^~jt&Ft,t[21]=At^~Ot&Ht,t[30]=Xt^~lt&Mt,t[31]=$t^~bt&St,t[40]=Tt^~qt&ee,t[41]=Rt^~Yt&re,t[2]=Et^~Ct&Gt,t[3]=It^~Bt&Wt,t[12]=Qt^~pt&kt,t[13]=te^~vt&Lt,t[22]=jt^~Ft&ne,t[23]=Ot^~Ht&ie,t[32]=lt^~Mt&Nt,t[33]=bt^~St&zt,t[42]=qt^~ee&_t,t[43]=Yt^~re&yt,t[4]=Ct^~Gt&ae,t[5]=Bt^~Wt&fe,t[14]=pt^~kt&Dt,t[15]=vt^~Lt&Kt,t[24]=Ft^~ne&mt,t[25]=Ht^~ie>,t[34]=Mt^~Nt&Zt,t[35]=St^~zt&Jt,t[44]=ee^~_t&xt,t[45]=re^~yt&Pt,t[6]=Gt^~ae&dt,t[7]=Wt^~fe&ht,t[16]=kt^~Dt&Vt,t[17]=Lt^~Kt&Ut,t[26]=ne^~mt&wt,t[27]=ie^~gt&At,t[36]=Nt^~Zt&Xt,t[37]=zt^~Jt&$t,t[46]=_t^~xt&Tt,t[47]=yt^~Pt&Rt,t[8]=ae^~dt&Et,t[9]=fe^~ht&It,t[18]=Dt^~Vt&Qt,t[19]=Kt^~Ut&te,t[28]=mt^~wt&jt,t[29]=gt^~At&Ot,t[38]=Zt^~Xt<,t[39]=Jt^~$t&bt,t[48]=xt^~Tt&qt,t[49]=Pt^~Rt&Yt,t[0]^=I[2*e],t[1]^=I[2*e+1]}},S=y.Buffer;function k(){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}k.prototype.initialize=function(t,e){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1},k.prototype.absorb=function(t){for(var e=0;e>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(M(this.state),this.count=0);return e},k.prototype.copy=function(t){for(var e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var L=function(t){var e=function(t){function e(e,r,n,i,a){w.call(this,a),this._rate=e,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=i,this._options=a,this._state=new t,this._state.initialize(e,r),this._finalized=!1}return m(e,w),e.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},e.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},e.prototype.update=function(t,e){if(!g.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return g.isBuffer(t)||(t=g.from(t,e)),this._state.absorb(t),this},e.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var e=this._state.squeeze(this._hashBitLength/8);return void 0!==t&&(e=e.toString(t)),this._resetState(),e},e.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},e.prototype._clone=function(){var t=new e(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t},e}(t),r=function(t){function e(e,r,n,i){E.call(this,i),this._rate=e,this._capacity=r,this._delimitedSuffix=n,this._options=i,this._state=new t,this._state.initialize(e,r),this._finalized=!1}return m(e,E),e.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},e.prototype._flush=function(){},e.prototype._read=function(t){this.push(this.squeeze(t))},e.prototype.update=function(t,e){if(!A.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return A.isBuffer(t)||(t=A.from(t,e)),this._state.absorb(t),this},e.prototype.squeeze=function(t,e){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(t);return void 0!==e&&(r=r.toString(e)),r},e.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},e.prototype._clone=function(){var t=new e(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t},e}(t);return function(t,n){switch("string"==typeof t?t.toLowerCase():t){case"keccak224":return new e(1152,448,null,224,n);case"keccak256":return new e(1088,512,null,256,n);case"keccak384":return new e(832,768,null,384,n);case"keccak512":return new e(576,1024,null,512,n);case"sha3-224":return new e(1152,448,6,224,n);case"sha3-256":return new e(1088,512,6,256,n);case"sha3-384":return new e(832,768,6,384,n);case"sha3-512":return new e(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+t)}}}(k),x=Object.prototype.toString,P=function(e,r){if(!t.isBuffer(e))throw TypeError(r)},T=function(t,e,r){if(t.length!==e)throw RangeError(r)},R=function(t,e,r,n){if(t.length!==e&&t.length!==r)throw RangeError(n)},j=function(t,e){if(0===t.length)throw RangeError(e)},O=y.Buffer,C=function(t){if(t.length<8)throw new Error("DER sequence length is too short");if(t.length>72)throw new Error("DER sequence length is too long");if(48!==t[0])throw new Error("Expected DER sequence");if(t[1]!==t.length-2)throw new Error("DER sequence length is invalid");if(2!==t[2])throw new Error("Expected DER integer");var e=t[3];if(0===e)throw new Error("R length is zero");if(5+e>=t.length)throw new Error("R length is too long");if(2!==t[4+e])throw new Error("Expected DER integer (2)");var r=t[5+e];if(0===r)throw new Error("S length is zero");if(6+e+r!==t.length)throw new Error("S length is invalid");if(128&t[4])throw new Error("R value is negative");if(e>1&&0===t[4]&&!(128&t[5]))throw new Error("R value excessively padded");if(128&t[e+6])throw new Error("S value is negative");if(r>1&&0===t[e+6]&&!(128&t[e+7]))throw new Error("S value excessively padded");return{r:t.slice(4,4+e),s:t.slice(6+e)}},B=function(t,e){var r=t.length,n=e.length;if(0===r)throw new Error("R length is zero");if(0===n)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(n>33)throw new Error("S length is too long");if(128&t[0])throw new Error("R value is negative");if(128&e[0])throw new Error("S value is negative");if(r>1&&0===t[0]&&!(128&t[1]))throw new Error("R value excessively padded");if(n>1&&0===e[0]&&!(128&e[1]))throw new Error("S value excessively padded");var i=O.allocUnsafe(6+r+n);return i[0]=48,i[1]=i.length-2,i[2]=2,i[3]=t.length,t.copy(i,4),i[4+r]=2,i[5+r]=e.length,e.copy(i,6+r),i},N=y.Buffer,z=N.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]),D=N.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]),K="scalar was invalid (zero or overflow)",V="nonce generation function failed or private key is invalid",U={COMPRESSED_TYPE_INVALID:"compressed should be a boolean",EC_PRIVATE_KEY_TYPE_INVALID:"private key should be a Buffer",EC_PRIVATE_KEY_LENGTH_INVALID:"private key length is invalid",EC_PRIVATE_KEY_RANGE_INVALID:"private key range is invalid",EC_PRIVATE_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting private key is invalid",EC_PRIVATE_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PRIVATE_KEY_EXPORT_DER_FAIL:"couldn't export to DER format",EC_PRIVATE_KEY_IMPORT_DER_FAIL:"couldn't import from DER format",EC_PUBLIC_KEYS_TYPE_INVALID:"public keys should be an Array",EC_PUBLIC_KEYS_LENGTH_INVALID:"public keys Array should have at least 1 element",EC_PUBLIC_KEY_TYPE_INVALID:"public key should be a Buffer",EC_PUBLIC_KEY_LENGTH_INVALID:"public key length is invalid",EC_PUBLIC_KEY_PARSE_FAIL:"the public key could not be parsed or is invalid",EC_PUBLIC_KEY_CREATE_FAIL:"private was invalid, try again",EC_PUBLIC_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting public key is invalid",EC_PUBLIC_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PUBLIC_KEY_COMBINE_FAIL:"the sum of the public keys is not valid",ECDH_FAIL:K,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:V,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"},q=Object(p.f)(Object.freeze({__proto__:null,COMPRESSED_TYPE_INVALID:"compressed should be a boolean",EC_PRIVATE_KEY_TYPE_INVALID:"private key should be a Buffer",EC_PRIVATE_KEY_LENGTH_INVALID:"private key length is invalid",EC_PRIVATE_KEY_RANGE_INVALID:"private key range is invalid",EC_PRIVATE_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting private key is invalid",EC_PRIVATE_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PRIVATE_KEY_EXPORT_DER_FAIL:"couldn't export to DER format",EC_PRIVATE_KEY_IMPORT_DER_FAIL:"couldn't import from DER format",EC_PUBLIC_KEYS_TYPE_INVALID:"public keys should be an Array",EC_PUBLIC_KEYS_LENGTH_INVALID:"public keys Array should have at least 1 element",EC_PUBLIC_KEY_TYPE_INVALID:"public key should be a Buffer",EC_PUBLIC_KEY_LENGTH_INVALID:"public key length is invalid",EC_PUBLIC_KEY_PARSE_FAIL:"the public key could not be parsed or is invalid",EC_PUBLIC_KEY_CREATE_FAIL:"private was invalid, try again",EC_PUBLIC_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting public key is invalid",EC_PUBLIC_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PUBLIC_KEY_COMBINE_FAIL:"the sum of the public keys is not valid",ECDH_FAIL:K,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:V,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",default:U}));function Y(t,e){return void 0===t?e:(function(t,e){if("[object Boolean]"!==x.call(t))throw TypeError(e)}(t,q.COMPRESSED_TYPE_INVALID),t)}var F=y.Buffer,H=v.b.Transform;function G(t){H.call(this),this._block=F.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}m(G,H),G.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},G.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},G.prototype.update=function(t,e){if(function(t,e){if(!F.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer")}(t),this._finalized)throw new Error("Digest already called");F.isBuffer(t)||(t=F.from(t,e));for(var r=this._block,n=0;this._blockOffset+t.length-n>=this._blockSize;){for(var i=this._blockOffset;i0;++a)this._length[a]+=f,(f=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*f);return this},G.prototype._update=function(){throw new Error("_update is not implemented")},G.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},G.prototype._digest=function(){throw new Error("_digest is not implemented")};var W=G,Z=y.Buffer,J=new Array(16);function X(){W.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function $(t,e){return t<>>32-e}function Q(t,e,r,n,i,a,f){return $(t+(e&r|~e&n)+i+a|0,f)+e|0}function tt(t,e,r,n,i,a,f){return $(t+(e&n|r&~n)+i+a|0,f)+e|0}function et(t,e,r,n,i,a,f){return $(t+(e^r^n)+i+a|0,f)+e|0}function rt(t,e,r,n,i,a,f){return $(t+(r^(e|~n))+i+a|0,f)+e|0}m(X,W),X.prototype._update=function(){for(var t=J,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,a=this._d;r=Q(r,n,i,a,t[0],3614090360,7),a=Q(a,r,n,i,t[1],3905402710,12),i=Q(i,a,r,n,t[2],606105819,17),n=Q(n,i,a,r,t[3],3250441966,22),r=Q(r,n,i,a,t[4],4118548399,7),a=Q(a,r,n,i,t[5],1200080426,12),i=Q(i,a,r,n,t[6],2821735955,17),n=Q(n,i,a,r,t[7],4249261313,22),r=Q(r,n,i,a,t[8],1770035416,7),a=Q(a,r,n,i,t[9],2336552879,12),i=Q(i,a,r,n,t[10],4294925233,17),n=Q(n,i,a,r,t[11],2304563134,22),r=Q(r,n,i,a,t[12],1804603682,7),a=Q(a,r,n,i,t[13],4254626195,12),i=Q(i,a,r,n,t[14],2792965006,17),r=tt(r,n=Q(n,i,a,r,t[15],1236535329,22),i,a,t[1],4129170786,5),a=tt(a,r,n,i,t[6],3225465664,9),i=tt(i,a,r,n,t[11],643717713,14),n=tt(n,i,a,r,t[0],3921069994,20),r=tt(r,n,i,a,t[5],3593408605,5),a=tt(a,r,n,i,t[10],38016083,9),i=tt(i,a,r,n,t[15],3634488961,14),n=tt(n,i,a,r,t[4],3889429448,20),r=tt(r,n,i,a,t[9],568446438,5),a=tt(a,r,n,i,t[14],3275163606,9),i=tt(i,a,r,n,t[3],4107603335,14),n=tt(n,i,a,r,t[8],1163531501,20),r=tt(r,n,i,a,t[13],2850285829,5),a=tt(a,r,n,i,t[2],4243563512,9),i=tt(i,a,r,n,t[7],1735328473,14),r=et(r,n=tt(n,i,a,r,t[12],2368359562,20),i,a,t[5],4294588738,4),a=et(a,r,n,i,t[8],2272392833,11),i=et(i,a,r,n,t[11],1839030562,16),n=et(n,i,a,r,t[14],4259657740,23),r=et(r,n,i,a,t[1],2763975236,4),a=et(a,r,n,i,t[4],1272893353,11),i=et(i,a,r,n,t[7],4139469664,16),n=et(n,i,a,r,t[10],3200236656,23),r=et(r,n,i,a,t[13],681279174,4),a=et(a,r,n,i,t[0],3936430074,11),i=et(i,a,r,n,t[3],3572445317,16),n=et(n,i,a,r,t[6],76029189,23),r=et(r,n,i,a,t[9],3654602809,4),a=et(a,r,n,i,t[12],3873151461,11),i=et(i,a,r,n,t[15],530742520,16),r=rt(r,n=et(n,i,a,r,t[2],3299628645,23),i,a,t[0],4096336452,6),a=rt(a,r,n,i,t[7],1126891415,10),i=rt(i,a,r,n,t[14],2878612391,15),n=rt(n,i,a,r,t[5],4237533241,21),r=rt(r,n,i,a,t[12],1700485571,6),a=rt(a,r,n,i,t[3],2399980690,10),i=rt(i,a,r,n,t[10],4293915773,15),n=rt(n,i,a,r,t[1],2240044497,21),r=rt(r,n,i,a,t[8],1873313359,6),a=rt(a,r,n,i,t[15],4264355552,10),i=rt(i,a,r,n,t[6],2734768916,15),n=rt(n,i,a,r,t[13],1309151649,21),r=rt(r,n,i,a,t[4],4149444226,6),a=rt(a,r,n,i,t[11],3174756917,10),i=rt(i,a,r,n,t[2],718787259,15),n=rt(n,i,a,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+a|0},X.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 t=Z.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t};var nt=X,it=v.a.Buffer,at=new Array(16),ft=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],ot=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],st=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],ct=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],ut=[0,1518500249,1859775393,2400959708,2840853838],dt=[1352829926,1548603684,1836072691,2053994217,0];function ht(){W.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function lt(t,e){return t<>>32-e}function bt(t,e,r,n,i,a,f,o){return lt(t+(e^r^n)+a+f|0,o)+i|0}function pt(t,e,r,n,i,a,f,o){return lt(t+(e&r|~e&n)+a+f|0,o)+i|0}function vt(t,e,r,n,i,a,f,o){return lt(t+((e|~r)^n)+a+f|0,o)+i|0}function _t(t,e,r,n,i,a,f,o){return lt(t+(e&n|r&~n)+a+f|0,o)+i|0}function yt(t,e,r,n,i,a,f,o){return lt(t+(e^(r|~n))+a+f|0,o)+i|0}m(ht,W),ht.prototype._update=function(){for(var t=at,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,n=0|this._b,i=0|this._c,a=0|this._d,f=0|this._e,o=0|this._a,s=0|this._b,c=0|this._c,u=0|this._d,d=0|this._e,h=0;h<80;h+=1){var l,b;h<16?(l=bt(r,n,i,a,f,t[ft[h]],ut[0],st[h]),b=yt(o,s,c,u,d,t[ot[h]],dt[0],ct[h])):h<32?(l=pt(r,n,i,a,f,t[ft[h]],ut[1],st[h]),b=_t(o,s,c,u,d,t[ot[h]],dt[1],ct[h])):h<48?(l=vt(r,n,i,a,f,t[ft[h]],ut[2],st[h]),b=vt(o,s,c,u,d,t[ot[h]],dt[2],ct[h])):h<64?(l=_t(r,n,i,a,f,t[ft[h]],ut[3],st[h]),b=pt(o,s,c,u,d,t[ot[h]],dt[3],ct[h])):(l=yt(r,n,i,a,f,t[ft[h]],ut[4],st[h]),b=bt(o,s,c,u,d,t[ot[h]],dt[4],ct[h])),r=f,f=a,a=lt(i,10),i=n,n=l,o=d,d=u,u=lt(c,10),c=s,s=b}var p=this._b+i+u|0;this._b=this._c+a+d|0,this._c=this._d+f+o|0,this._d=this._e+r+s|0,this._e=this._a+n+c|0,this._a=p},ht.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 t=it.alloc?it.alloc(20):new it(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t};var mt=ht,gt=y.Buffer;function wt(t,e){this._block=gt.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}wt.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=gt.from(t,e));for(var r=this._block,n=this._blockSize,i=t.length,a=this._len,f=0;f=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var a=this._hash();return t?a.toString(t):a},wt.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var At=wt,Et=y.Buffer,It=[1518500249,1859775393,-1894007588,-899497514],Mt=new Array(80);function St(){this.init(),this._w=Mt,At.call(this,64,56)}function kt(t){return t<<30|t>>>2}function Lt(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}m(St,At),St.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},St.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,a=0|this._c,f=0|this._d,o=0|this._e,s=0;s<16;++s)r[s]=t.readInt32BE(4*s);for(;s<80;++s)r[s]=r[s-3]^r[s-8]^r[s-14]^r[s-16];for(var c=0;c<80;++c){var u=~~(c/20),d=0|((e=n)<<5|e>>>27)+Lt(u,i,a,f)+o+r[c]+It[u];o=f,f=a,a=kt(i),i=n,n=d}this._a=n+this._a|0,this._b=i+this._b|0,this._c=a+this._c|0,this._d=f+this._d|0,this._e=o+this._e|0},St.prototype._hash=function(){var t=Et.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t};var xt=St,Pt=y.Buffer,Tt=[1518500249,1859775393,-1894007588,-899497514],Rt=new Array(80);function jt(){this.init(),this._w=Rt,At.call(this,64,56)}function Ot(t){return t<<5|t>>>27}function Ct(t){return t<<30|t>>>2}function Bt(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}m(jt,At),jt.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},jt.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,a=0|this._c,f=0|this._d,o=0|this._e,s=0;s<16;++s)r[s]=t.readInt32BE(4*s);for(;s<80;++s)r[s]=(e=r[s-3]^r[s-8]^r[s-14]^r[s-16])<<1|e>>>31;for(var c=0;c<80;++c){var u=~~(c/20),d=Ot(n)+Bt(u,i,a,f)+o+r[c]+Tt[u]|0;o=f,f=a,a=Ct(i),i=n,n=d}this._a=n+this._a|0,this._b=i+this._b|0,this._c=a+this._c|0,this._d=f+this._d|0,this._e=o+this._e|0},jt.prototype._hash=function(){var t=Pt.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t};var Nt=jt,zt=y.Buffer,Dt=[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],Kt=new Array(64);function Vt(){this.init(),this._w=Kt,At.call(this,64,56)}function Ut(t,e,r){return r^t&(e^r)}function qt(t,e,r){return t&e|r&(t|e)}function Yt(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function Ft(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function Ht(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}m(Vt,At),Vt.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},Vt.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,a=0|this._c,f=0|this._d,o=0|this._e,s=0|this._f,c=0|this._g,u=0|this._h,d=0;d<16;++d)r[d]=t.readInt32BE(4*d);for(;d<64;++d)r[d]=0|(((e=r[d-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[d-7]+Ht(r[d-15])+r[d-16];for(var h=0;h<64;++h){var l=u+Ft(o)+Ut(o,s,c)+Dt[h]+r[h]|0,b=Yt(n)+qt(n,i,a)|0;u=c,c=s,s=o,o=f+l|0,f=a,a=i,i=n,n=l+b|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=a+this._c|0,this._d=f+this._d|0,this._e=o+this._e|0,this._f=s+this._f|0,this._g=c+this._g|0,this._h=u+this._h|0},Vt.prototype._hash=function(){var t=zt.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};var Gt=Vt,Wt=y.Buffer,Zt=new Array(64);function Jt(){this.init(),this._w=Zt,At.call(this,64,56)}m(Jt,Gt),Jt.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},Jt.prototype._hash=function(){var t=Wt.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};var Xt=Jt,$t=y.Buffer,Qt=[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],te=new Array(160);function ee(){this.init(),this._w=te,At.call(this,128,112)}function re(t,e,r){return r^t&(e^r)}function ne(t,e,r){return t&e|r&(t|e)}function ie(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function ae(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function fe(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function oe(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function se(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function ce(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function ue(t,e){return t>>>0>>0?1:0}m(ee,At),ee.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},ee.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,a=0|this._dh,f=0|this._eh,o=0|this._fh,s=0|this._gh,c=0|this._hh,u=0|this._al,d=0|this._bl,h=0|this._cl,l=0|this._dl,b=0|this._el,p=0|this._fl,v=0|this._gl,_=0|this._hl,y=0;y<32;y+=2)e[y]=t.readInt32BE(4*y),e[y+1]=t.readInt32BE(4*y+4);for(;y<160;y+=2){var m=e[y-30],g=e[y-30+1],w=fe(m,g),A=oe(g,m),E=se(m=e[y-4],g=e[y-4+1]),I=ce(g,m),M=e[y-14],S=e[y-14+1],k=e[y-32],L=e[y-32+1],x=A+S|0,P=w+M+ue(x,A)|0;P=(P=P+E+ue(x=x+I|0,I)|0)+k+ue(x=x+L|0,L)|0,e[y]=P,e[y+1]=x}for(var T=0;T<160;T+=2){P=e[T],x=e[T+1];var R=ne(r,n,i),j=ne(u,d,h),O=ie(r,u),C=ie(u,r),B=ae(f,b),N=ae(b,f),z=Qt[T],D=Qt[T+1],K=re(f,o,s),V=re(b,p,v),U=_+N|0,q=c+B+ue(U,_)|0;q=(q=(q=q+K+ue(U=U+V|0,V)|0)+z+ue(U=U+D|0,D)|0)+P+ue(U=U+x|0,x)|0;var Y=C+j|0,F=O+R+ue(Y,C)|0;c=s,_=v,s=o,v=p,o=f,p=b,f=a+q+ue(b=l+U|0,l)|0,a=i,l=h,i=n,h=d,n=r,d=u,r=q+F+ue(u=U+Y|0,U)|0}this._al=this._al+u|0,this._bl=this._bl+d|0,this._cl=this._cl+h|0,this._dl=this._dl+l|0,this._el=this._el+b|0,this._fl=this._fl+p|0,this._gl=this._gl+v|0,this._hl=this._hl+_|0,this._ah=this._ah+r+ue(this._al,u)|0,this._bh=this._bh+n+ue(this._bl,d)|0,this._ch=this._ch+i+ue(this._cl,h)|0,this._dh=this._dh+a+ue(this._dl,l)|0,this._eh=this._eh+f+ue(this._el,b)|0,this._fh=this._fh+o+ue(this._fl,p)|0,this._gh=this._gh+s+ue(this._gl,v)|0,this._hh=this._hh+c+ue(this._hl,_)|0},ee.prototype._hash=function(){var t=$t.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};var de=ee,he=y.Buffer,le=new Array(160);function be(){this.init(),this._w=le,At.call(this,128,112)}m(be,de),be.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},be.prototype._hash=function(){var t=he.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};var pe=be,ve=Object(p.b)((function(t){var e=t.exports=function(t){t=t.toLowerCase();var r=e[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};e.sha=xt,e.sha1=Nt,e.sha224=Xt,e.sha256=Gt,e.sha384=pe,e.sha512=de})),_e=y.Buffer,ye=v.b.Transform,me=_.a.StringDecoder;function ge(t){ye.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}m(ge,ye),ge.prototype.update=function(t,e,r){"string"==typeof t&&(t=_e.from(t,e));var n=this._update(t);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},ge.prototype.setAutoPadding=function(){},ge.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},ge.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},ge.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},ge.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},ge.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},ge.prototype._finalOrDigest=function(t){var e=this.__final()||_e.alloc(0);return t&&(e=this._toString(e,t,!0)),e},ge.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new me(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n};var we=ge;function Ae(t){we.call(this,"digest"),this._hash=t}m(Ae,we),Ae.prototype._update=function(t){this._hash.update(t)},Ae.prototype._final=function(){return this._hash.digest()};var Ee=function(t){return"md5"===(t=t.toLowerCase())?new nt:"rmd160"===t||"ripemd160"===t?new mt:new Ae(ve(t))},Ie=Object(p.b)((function(t){!function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{a=v.a.Buffer}catch(t){}function f(t,e,r){for(var n=0,i=Math.min(t.length,r),a=e;a=49&&f<=54?f-49+10:f>=17&&f<=22?f-17+10:15&f}return n}function o(t,e,r,n){for(var i=0,a=Math.min(t.length,r),f=e;f=49?o-49+10:o>=17?o-17+10:o}return i}i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initArray=function(t,e,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)f=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=f<>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);else if("le"===n)for(i=0,a=0;i>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);return this.strip()},i.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=f(t,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==e&&(i=f(t,e,r+6),this.words[n]|=i<>>26-a&4194303),this.strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,f=a%n,s=Math.min(a,a-f)+r,c=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var s=["","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"],c=[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],u=[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];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],f=i*a,o=67108863&f,s=f/67108864|0;r.words[0]=o;for(var c=1;c>>26,d=67108863&s,h=Math.min(c,e.length-1),l=Math.max(0,c-t.length+1);l<=h;l++){var b=c-l|0;u+=(f=(i=0|t.words[b])*(a=0|e.words[l])+d)/67108864|0,d=67108863&f}r.words[c]=0|d,s=0|u}return 0!==s?r.words[c]=0|s:r.length--,r.strip()}i.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var i=0,a=0,f=0;f>>24-i&16777215)||f!==this.length-1?s[6-d.length]+d+n:d+n,(i+=2)>=26&&(i-=26,f--)}for(0!==a&&(n=a.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var h=c[t],l=u[t];n="";var b=this.clone();for(b.negative=0;!b.isZero();){var p=b.modn(l).toString(t);n=(b=b.idivn(l)).isZero()?p+n:s[h-p.length]+p+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(t,e){return r(void 0!==a),this.toArrayLike(a,t,e)},i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,n){var i=this.byteLength(),a=n||Math.max(1,i);r(i<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0"),this.strip();var f,o,s="le"===e,c=new t(a),u=this.clone();if(s){for(o=0;!u.isZero();o++)f=u.andln(255),u.iushrn(8),c[o]=f;for(;o=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var n=t/26|0,i=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,f=0;f>26,this.words[f]=67108863&e;for(;0!==a&&f>26,this.words[f]=67108863&e;if(0===a&&f>>13,l=0|f[1],b=8191&l,p=l>>>13,v=0|f[2],_=8191&v,y=v>>>13,m=0|f[3],g=8191&m,w=m>>>13,A=0|f[4],E=8191&A,I=A>>>13,M=0|f[5],S=8191&M,k=M>>>13,L=0|f[6],x=8191&L,P=L>>>13,T=0|f[7],R=8191&T,j=T>>>13,O=0|f[8],C=8191&O,B=O>>>13,N=0|f[9],z=8191&N,D=N>>>13,K=0|o[0],V=8191&K,U=K>>>13,q=0|o[1],Y=8191&q,F=q>>>13,H=0|o[2],G=8191&H,W=H>>>13,Z=0|o[3],J=8191&Z,X=Z>>>13,$=0|o[4],Q=8191&$,tt=$>>>13,et=0|o[5],rt=8191&et,nt=et>>>13,it=0|o[6],at=8191&it,ft=it>>>13,ot=0|o[7],st=8191&ot,ct=ot>>>13,ut=0|o[8],dt=8191&ut,ht=ut>>>13,lt=0|o[9],bt=8191<,pt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(c+(n=Math.imul(d,V))|0)+((8191&(i=(i=Math.imul(d,U))+Math.imul(h,V)|0))<<13)|0;c=((a=Math.imul(h,U))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(b,V),i=(i=Math.imul(b,U))+Math.imul(p,V)|0,a=Math.imul(p,U);var _t=(c+(n=n+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,F)|0)+Math.imul(h,Y)|0))<<13)|0;c=((a=a+Math.imul(h,F)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(_,V),i=(i=Math.imul(_,U))+Math.imul(y,V)|0,a=Math.imul(y,U),n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,F)|0)+Math.imul(p,Y)|0,a=a+Math.imul(p,F)|0;var yt=(c+(n=n+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,W)|0)+Math.imul(h,G)|0))<<13)|0;c=((a=a+Math.imul(h,W)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(g,V),i=(i=Math.imul(g,U))+Math.imul(w,V)|0,a=Math.imul(w,U),n=n+Math.imul(_,Y)|0,i=(i=i+Math.imul(_,F)|0)+Math.imul(y,Y)|0,a=a+Math.imul(y,F)|0,n=n+Math.imul(b,G)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(p,G)|0,a=a+Math.imul(p,W)|0;var mt=(c+(n=n+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(h,J)|0))<<13)|0;c=((a=a+Math.imul(h,X)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(E,V),i=(i=Math.imul(E,U))+Math.imul(I,V)|0,a=Math.imul(I,U),n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,F)|0)+Math.imul(w,Y)|0,a=a+Math.imul(w,F)|0,n=n+Math.imul(_,G)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(y,G)|0,a=a+Math.imul(y,W)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(p,J)|0,a=a+Math.imul(p,X)|0;var gt=(c+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,tt)|0)+Math.imul(h,Q)|0))<<13)|0;c=((a=a+Math.imul(h,tt)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(S,V),i=(i=Math.imul(S,U))+Math.imul(k,V)|0,a=Math.imul(k,U),n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,F)|0)+Math.imul(I,Y)|0,a=a+Math.imul(I,F)|0,n=n+Math.imul(g,G)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(w,G)|0,a=a+Math.imul(w,W)|0,n=n+Math.imul(_,J)|0,i=(i=i+Math.imul(_,X)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,X)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(p,Q)|0,a=a+Math.imul(p,tt)|0;var wt=(c+(n=n+Math.imul(d,rt)|0)|0)+((8191&(i=(i=i+Math.imul(d,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((a=a+Math.imul(h,nt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(x,V),i=(i=Math.imul(x,U))+Math.imul(P,V)|0,a=Math.imul(P,U),n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,F)|0)+Math.imul(k,Y)|0,a=a+Math.imul(k,F)|0,n=n+Math.imul(E,G)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(I,G)|0,a=a+Math.imul(I,W)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(w,J)|0,a=a+Math.imul(w,X)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(y,Q)|0,a=a+Math.imul(y,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(p,rt)|0,a=a+Math.imul(p,nt)|0;var At=(c+(n=n+Math.imul(d,at)|0)|0)+((8191&(i=(i=i+Math.imul(d,ft)|0)+Math.imul(h,at)|0))<<13)|0;c=((a=a+Math.imul(h,ft)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(R,V),i=(i=Math.imul(R,U))+Math.imul(j,V)|0,a=Math.imul(j,U),n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,F)|0)+Math.imul(P,Y)|0,a=a+Math.imul(P,F)|0,n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(k,G)|0,a=a+Math.imul(k,W)|0,n=n+Math.imul(E,J)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(I,J)|0,a=a+Math.imul(I,X)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(y,rt)|0,a=a+Math.imul(y,nt)|0,n=n+Math.imul(b,at)|0,i=(i=i+Math.imul(b,ft)|0)+Math.imul(p,at)|0,a=a+Math.imul(p,ft)|0;var Et=(c+(n=n+Math.imul(d,st)|0)|0)+((8191&(i=(i=i+Math.imul(d,ct)|0)+Math.imul(h,st)|0))<<13)|0;c=((a=a+Math.imul(h,ct)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,V),i=(i=Math.imul(C,U))+Math.imul(B,V)|0,a=Math.imul(B,U),n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,F)|0)+Math.imul(j,Y)|0,a=a+Math.imul(j,F)|0,n=n+Math.imul(x,G)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(P,G)|0,a=a+Math.imul(P,W)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(I,Q)|0,a=a+Math.imul(I,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(w,rt)|0,a=a+Math.imul(w,nt)|0,n=n+Math.imul(_,at)|0,i=(i=i+Math.imul(_,ft)|0)+Math.imul(y,at)|0,a=a+Math.imul(y,ft)|0,n=n+Math.imul(b,st)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(p,st)|0,a=a+Math.imul(p,ct)|0;var It=(c+(n=n+Math.imul(d,dt)|0)|0)+((8191&(i=(i=i+Math.imul(d,ht)|0)+Math.imul(h,dt)|0))<<13)|0;c=((a=a+Math.imul(h,ht)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(z,V),i=(i=Math.imul(z,U))+Math.imul(D,V)|0,a=Math.imul(D,U),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,F)|0)+Math.imul(B,Y)|0,a=a+Math.imul(B,F)|0,n=n+Math.imul(R,G)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(j,G)|0,a=a+Math.imul(j,W)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(P,J)|0,a=a+Math.imul(P,X)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(k,Q)|0,a=a+Math.imul(k,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(I,rt)|0,a=a+Math.imul(I,nt)|0,n=n+Math.imul(g,at)|0,i=(i=i+Math.imul(g,ft)|0)+Math.imul(w,at)|0,a=a+Math.imul(w,ft)|0,n=n+Math.imul(_,st)|0,i=(i=i+Math.imul(_,ct)|0)+Math.imul(y,st)|0,a=a+Math.imul(y,ct)|0,n=n+Math.imul(b,dt)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(p,dt)|0,a=a+Math.imul(p,ht)|0;var Mt=(c+(n=n+Math.imul(d,bt)|0)|0)+((8191&(i=(i=i+Math.imul(d,pt)|0)+Math.imul(h,bt)|0))<<13)|0;c=((a=a+Math.imul(h,pt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(z,Y),i=(i=Math.imul(z,F))+Math.imul(D,Y)|0,a=Math.imul(D,F),n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(B,G)|0,a=a+Math.imul(B,W)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(j,J)|0,a=a+Math.imul(j,X)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(P,Q)|0,a=a+Math.imul(P,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(k,rt)|0,a=a+Math.imul(k,nt)|0,n=n+Math.imul(E,at)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(I,at)|0,a=a+Math.imul(I,ft)|0,n=n+Math.imul(g,st)|0,i=(i=i+Math.imul(g,ct)|0)+Math.imul(w,st)|0,a=a+Math.imul(w,ct)|0,n=n+Math.imul(_,dt)|0,i=(i=i+Math.imul(_,ht)|0)+Math.imul(y,dt)|0,a=a+Math.imul(y,ht)|0;var St=(c+(n=n+Math.imul(b,bt)|0)|0)+((8191&(i=(i=i+Math.imul(b,pt)|0)+Math.imul(p,bt)|0))<<13)|0;c=((a=a+Math.imul(p,pt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(z,G),i=(i=Math.imul(z,W))+Math.imul(D,G)|0,a=Math.imul(D,W),n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(B,J)|0,a=a+Math.imul(B,X)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(j,Q)|0,a=a+Math.imul(j,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(P,rt)|0,a=a+Math.imul(P,nt)|0,n=n+Math.imul(S,at)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(k,at)|0,a=a+Math.imul(k,ft)|0,n=n+Math.imul(E,st)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(I,st)|0,a=a+Math.imul(I,ct)|0,n=n+Math.imul(g,dt)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(w,dt)|0,a=a+Math.imul(w,ht)|0;var kt=(c+(n=n+Math.imul(_,bt)|0)|0)+((8191&(i=(i=i+Math.imul(_,pt)|0)+Math.imul(y,bt)|0))<<13)|0;c=((a=a+Math.imul(y,pt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(z,J),i=(i=Math.imul(z,X))+Math.imul(D,J)|0,a=Math.imul(D,X),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(B,Q)|0,a=a+Math.imul(B,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(j,rt)|0,a=a+Math.imul(j,nt)|0,n=n+Math.imul(x,at)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(P,at)|0,a=a+Math.imul(P,ft)|0,n=n+Math.imul(S,st)|0,i=(i=i+Math.imul(S,ct)|0)+Math.imul(k,st)|0,a=a+Math.imul(k,ct)|0,n=n+Math.imul(E,dt)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(I,dt)|0,a=a+Math.imul(I,ht)|0;var Lt=(c+(n=n+Math.imul(g,bt)|0)|0)+((8191&(i=(i=i+Math.imul(g,pt)|0)+Math.imul(w,bt)|0))<<13)|0;c=((a=a+Math.imul(w,pt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(z,Q),i=(i=Math.imul(z,tt))+Math.imul(D,Q)|0,a=Math.imul(D,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(B,rt)|0,a=a+Math.imul(B,nt)|0,n=n+Math.imul(R,at)|0,i=(i=i+Math.imul(R,ft)|0)+Math.imul(j,at)|0,a=a+Math.imul(j,ft)|0,n=n+Math.imul(x,st)|0,i=(i=i+Math.imul(x,ct)|0)+Math.imul(P,st)|0,a=a+Math.imul(P,ct)|0,n=n+Math.imul(S,dt)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(k,dt)|0,a=a+Math.imul(k,ht)|0;var xt=(c+(n=n+Math.imul(E,bt)|0)|0)+((8191&(i=(i=i+Math.imul(E,pt)|0)+Math.imul(I,bt)|0))<<13)|0;c=((a=a+Math.imul(I,pt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(z,rt),i=(i=Math.imul(z,nt))+Math.imul(D,rt)|0,a=Math.imul(D,nt),n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(B,at)|0,a=a+Math.imul(B,ft)|0,n=n+Math.imul(R,st)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(j,st)|0,a=a+Math.imul(j,ct)|0,n=n+Math.imul(x,dt)|0,i=(i=i+Math.imul(x,ht)|0)+Math.imul(P,dt)|0,a=a+Math.imul(P,ht)|0;var Pt=(c+(n=n+Math.imul(S,bt)|0)|0)+((8191&(i=(i=i+Math.imul(S,pt)|0)+Math.imul(k,bt)|0))<<13)|0;c=((a=a+Math.imul(k,pt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(z,at),i=(i=Math.imul(z,ft))+Math.imul(D,at)|0,a=Math.imul(D,ft),n=n+Math.imul(C,st)|0,i=(i=i+Math.imul(C,ct)|0)+Math.imul(B,st)|0,a=a+Math.imul(B,ct)|0,n=n+Math.imul(R,dt)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(j,dt)|0,a=a+Math.imul(j,ht)|0;var Tt=(c+(n=n+Math.imul(x,bt)|0)|0)+((8191&(i=(i=i+Math.imul(x,pt)|0)+Math.imul(P,bt)|0))<<13)|0;c=((a=a+Math.imul(P,pt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(z,st),i=(i=Math.imul(z,ct))+Math.imul(D,st)|0,a=Math.imul(D,ct),n=n+Math.imul(C,dt)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(B,dt)|0,a=a+Math.imul(B,ht)|0;var Rt=(c+(n=n+Math.imul(R,bt)|0)|0)+((8191&(i=(i=i+Math.imul(R,pt)|0)+Math.imul(j,bt)|0))<<13)|0;c=((a=a+Math.imul(j,pt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(z,dt),i=(i=Math.imul(z,ht))+Math.imul(D,dt)|0,a=Math.imul(D,ht);var jt=(c+(n=n+Math.imul(C,bt)|0)|0)+((8191&(i=(i=i+Math.imul(C,pt)|0)+Math.imul(B,bt)|0))<<13)|0;c=((a=a+Math.imul(B,pt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ot=(c+(n=Math.imul(z,bt))|0)+((8191&(i=(i=Math.imul(z,pt))+Math.imul(D,bt)|0))<<13)|0;return c=((a=Math.imul(D,pt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,s[0]=vt,s[1]=_t,s[2]=yt,s[3]=mt,s[4]=gt,s[5]=wt,s[6]=At,s[7]=Et,s[8]=It,s[9]=Mt,s[10]=St,s[11]=kt,s[12]=Lt,s[13]=xt,s[14]=Pt,s[15]=Tt,s[16]=Rt,s[17]=jt,s[18]=Ot,0!==c&&(s[19]=c,r.length++),r};function l(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(h=d),i.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?h(this,t,e):r<63?d(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,f&=67108863}r.words[a]=o,n=f,f=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):l(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=i.prototype._countBits(t)-1,n=0;n>=1;return n},b.prototype.permute=function(t,e,r,n,i,a){for(var f=0;f>>=1)i++;return 1<>>=13,n[2*f+1]=8191&a,a>>>=13;for(f=2*e;f>=26,e+=i/67108864|0,e+=a>>>26,this.words[n]=67108863&a}return 0!==e&&(this.words[n]=e,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new i(1);for(var r=this,n=0;n=0);var e,n=t%26,i=(t-n)/26,a=67108863>>>26-n<<26-n;if(0!==n){var f=0;for(e=0;e>>26-n}f&&(this.words[e]=f,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var a=t%26,f=Math.min((t-a)/26,this.length),o=67108863^67108863>>>a<f)for(this.length-=f,c=0;c=0&&(0!==u||c>=i);c--){var d=0|this.words[c];this.words[c]=u<<26-a|d>>>a,u=d&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<=0);var e=t%26,n=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(s/67108864|0),this.words[i+n]=67108863&a}for(;i>26,this.words[i+n]=67108863&a;if(0===o)return this.strip();for(r(-1===o),o=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},i.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),a=t,f=0|a.words[a.length-1];0!==(r=26-this._countBits(f))&&(a=a.ushln(r),n.iushln(r),f=0|a.words[a.length-1]);var o,s=n.length-a.length;if("mod"!==e){(o=new i(null)).length=s+1,o.words=new Array(o.length);for(var c=0;c=0;d--){var h=67108864*(0|n.words[a.length+d])+(0|n.words[a.length+d-1]);for(h=Math.min(h/f|0,67108863),n._ishlnsubmul(a,h,d);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(a,1,d),n.isZero()||(n.negative^=1);o&&(o.words[d]=h)}return o&&o.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:o||null,mod:n}},i.prototype.divmod=function(t,e,n){return r(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(o=this.neg().divmod(t,e),"mod"!==e&&(a=o.div.neg()),"div"!==e&&(f=o.mod.neg(),n&&0!==f.negative&&f.iadd(t)),{div:a,mod:f}):0===this.negative&&0!==t.negative?(o=this.divmod(t.neg(),e),"mod"!==e&&(a=o.div.neg()),{div:a,mod:o.mod}):0!=(this.negative&t.negative)?(o=this.neg().divmod(t.neg(),e),"div"!==e&&(f=o.mod.neg(),n&&0!==f.negative&&f.isub(t)),{div:o.div,mod:f}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e);var a,f,o},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(e*n+(0|this.words[i]))%t;return n},i.prototype.idivn=function(t){r(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var a=new i(1),f=new i(0),o=new i(0),s=new i(1),c=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++c;for(var u=n.clone(),d=e.clone();!e.isZero();){for(var h=0,l=1;0==(e.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(a.isOdd()||f.isOdd())&&(a.iadd(u),f.isub(d)),a.iushrn(1),f.iushrn(1);for(var b=0,p=1;0==(n.words[0]&p)&&b<26;++b,p<<=1);if(b>0)for(n.iushrn(b);b-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(u),s.isub(d)),o.iushrn(1),s.iushrn(1);e.cmp(n)>=0?(e.isub(n),a.isub(o),f.isub(s)):(n.isub(e),o.isub(a),s.isub(f))}return{a:o,b:s,gcd:n.iushln(c)}},i.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var a,f=new i(1),o=new i(0),s=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,u=1;0==(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)f.isOdd()&&f.iadd(s),f.iushrn(1);for(var d=0,h=1;0==(n.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(n.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);e.cmp(n)>=0?(e.isub(n),f.isub(o)):(n.isub(e),o.isub(f))}return(a=0===e.cmpn(1)?f:o).cmpn(0)<0&&a.iadd(t),a},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<>>26,o&=67108863,this.words[f]=o}return 0!==a&&(this.words[f]=a,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)e=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new A(t)},i.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var p={k256:null,p224:null,p192:null,p25519:null};function _(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function m(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function g(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){A.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}_.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},_.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},_.prototype.split=function(t,e){t.iushrn(this.n,0,e)},_.prototype.imulK=function(t){return t.imul(this.k)},n(y,_),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(p[t])return p[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new m;else if("p192"===t)e=new g;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return p[t]=e,e},A.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},A.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},A.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},A.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},A.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},A.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},A.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},A.prototype.isqr=function(t){return this.imul(t,t.clone())},A.prototype.sqr=function(t){return this.mul(t,t)},A.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var n=this.m.add(new i(1)).iushrn(2);return this.pow(t,n)}for(var a=this.m.subn(1),f=0;!a.isZero()&&0===a.andln(1);)f++,a.iushrn(1);r(!a.isZero());var o=new i(1).toRed(this),s=o.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);0!==this.pow(u,c).cmp(s);)u.redIAdd(s);for(var d=this.pow(u,a),h=this.pow(t,a.addn(1).iushrn(1)),l=this.pow(t,a),b=f;0!==l.cmp(o);){for(var p=l,v=0;0!==p.cmp(o);v++)p=p.redSqr();r(v=0;n--){for(var c=e.words[n],u=s-1;u>=0;u--){var d=c>>u&1;a!==r[0]&&(a=this.sqr(a)),0!==d||0!==f?(f<<=1,f|=d,(4===++o||0===n&&0===u)&&(a=this.mul(a,r[f]),o=0,f=0)):o=0}s=26}return a},A.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},A.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new E(t)},n(E,A),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),f=a;return a.cmp(this.m)>=0?f=a.isub(this.m):a.cmpn(0)<0&&(f=a.iadd(this.m)),f._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,p.d)})),Me="lib/elliptic.js",Se=["lib"],ke={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",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},Le={type:"git",url:"git@github.com:indutny/elliptic"},xe=["EC","Elliptic","curve","Cryptography"],Pe="Fedor Indutny ",Te={url:"https://github.com/indutny/elliptic/issues"},Re="https://github.com/indutny/elliptic",je={brfs:"^1.4.3",coveralls:"^3.0.8",grunt:"^1.0.4","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":"^9.0.1",istanbul:"^0.4.2",jscs:"^3.0.7",jshint:"^2.10.3",mocha:"^6.2.2"},Oe={"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"},Ce={name:"elliptic",version:"6.5.2",description:"EC cryptography",main:Me,files:Se,scripts:ke,repository:Le,keywords:xe,author:Pe,license:"MIT",bugs:Te,homepage:Re,devDependencies:je,dependencies:Oe},Be=Object.freeze({__proto__:null,name:"elliptic",version:"6.5.2",description:"EC cryptography",main:Me,files:Se,scripts:ke,repository:Le,keywords:xe,author:Pe,license:"MIT",bugs:Te,homepage:Re,devDependencies:je,dependencies:Oe,default:Ce}),Ne=ze;function ze(t,e){if(!t)throw new Error(e||"Assertion failed")}ze.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var De,Ke=Object(p.b)((function(t,e){var r=e;function n(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",r=0;r>8,f=255&i;a?r.push(a,f):r.push(f)}return r},r.zero2=n,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}})),Ve=Object(p.b)((function(t,e){var r=e;r.assert=Ne,r.toArray=Ke.toArray,r.zero2=Ke.zero2,r.toHex=Ke.toHex,r.encode=Ke.encode,r.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-s:s,a.isubn(o)):o=0,n[f]=o,a.iushrn(1)}return n},r.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0;t.cmpn(-n)>0||e.cmpn(-i)>0;){var a,f,o,s=t.andln(3)+n&3,c=e.andln(3)+i&3;3===s&&(s=-1),3===c&&(c=-1),a=0==(1&s)?0:3!==(o=t.andln(7)+n&7)&&5!==o||2!==c?s:-s,r[0].push(a),f=0==(1&c)?0:3!==(o=e.andln(7)+i&7)&&5!==o||2!==s?c:-c,r[1].push(f),2*n===a+1&&(n=1-n),2*i===f+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r},r.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(t){return"string"==typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new Ie(t,"hex","le")}})),Ue=function(t){return De||(De=new qe(null)),De.generate(t)};function qe(t){this.rand=t}var Ye=qe;if(qe.prototype.generate=function(t){return this._rand(t)},qe.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Je=Ze;function Xe(t,e){this.curve=t,this.type=e,this.precomputed=null}Ze.prototype.point=function(){throw new Error("Not implemented")},Ze.prototype.validate=function(){throw new Error("Not implemented")},Ze.prototype._fixedNafMul=function(t,e){We(t.precomputed);var r=t._getDoubles(),n=He(e,1,this._bitLength),i=(1<=f;e--)o=(o<<1)+n[e];a.push(o)}for(var s=this.jpoint(null,null,null),c=this.jpoint(null,null,null),u=i;u>0;u--){for(f=0;f=0;o--){for(e=0;o>=0&&0===a[o];o--)e++;if(o>=0&&e++,f=f.dblp(e),o<0)break;var s=a[o];We(0!==s),f="affine"===t.type?s>0?f.mixedAdd(i[s-1>>1]):f.mixedAdd(i[-s-1>>1].neg()):s>0?f.add(i[s-1>>1]):f.add(i[-s-1>>1].neg())}return"affine"===t.type?f.toP():f},Ze.prototype._wnafMulAdd=function(t,e,r,n,i){for(var a=this._wnafT1,f=this._wnafT2,o=this._wnafT3,s=0,c=0;c=1;c-=2){var d=c-1,h=c;if(1===a[d]&&1===a[h]){var l=[e[d],null,null,e[h]];0===e[d].y.cmp(e[h].y)?(l[1]=e[d].add(e[h]),l[2]=e[d].toJ().mixedAdd(e[h].neg())):0===e[d].y.cmp(e[h].y.redNeg())?(l[1]=e[d].toJ().mixedAdd(e[h]),l[2]=e[d].add(e[h].neg())):(l[1]=e[d].toJ().mixedAdd(e[h]),l[2]=e[d].toJ().mixedAdd(e[h].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],p=Ge(r[d],r[h]);s=Math.max(p[0].length,s),o[d]=new Array(s),o[h]=new Array(s);for(var v=0;v=0;c--){for(var w=0;c>=0;){var A=!0;for(v=0;v=0&&w++,m=m.dblp(w),c<0)break;for(v=0;v0?E=f[v][I-1>>1]:I<0&&(E=f[v][-I-1>>1].neg()),m="affine"===E.type?m.mixedAdd(E):m.add(E))}}for(c=0;c=Math.ceil((t.bitLength()+1)/e.step)},Xe.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(a=e,f=r),n.negative&&(n=n.neg(),i=i.neg()),a.negative&&(a=a.neg(),f=f.neg()),[{a:n,b:i},{a:a,b:f}]},Qe.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),a=r.b.neg().mul(t).divRound(this.n),f=i.mul(r.a),o=a.mul(n.a),s=i.mul(r.b),c=a.mul(n.b);return{k1:t.sub(f).sub(o),k2:s.add(c).neg()}},Qe.prototype.pointFromX=function(t,e){(t=new Ie(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(e&&!i||!e&&i)&&(n=n.redNeg()),this.point(t,n)},Qe.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},Qe.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,a=0;a":""},er.prototype.isInfinity=function(){return this.inf},er.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},er.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),a=i.redSqr().redISub(this.x.redAdd(this.x)),f=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,f)},er.prototype.getX=function(){return this.x.fromRed()},er.prototype.getY=function(){return this.y.fromRed()},er.prototype.mul=function(t){return t=new Ie(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},er.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},er.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},er.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},er.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},er.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},m(rr,Je.BasePoint),Qe.prototype.jpoint=function(t,e,r){return new rr(this,t,e,r)},rr.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},rr.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},rr.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),a=this.y.redMul(e.redMul(t.z)),f=t.y.redMul(r.redMul(this.z)),o=n.redSub(i),s=a.redSub(f);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),d=n.redMul(c),h=s.redSqr().redIAdd(u).redISub(d).redISub(d),l=s.redMul(d.redISub(h)).redISub(a.redMul(u)),b=this.z.redMul(t.z).redMul(o);return this.curve.jpoint(h,l,b)},rr.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,a=t.y.redMul(e).redMul(this.z),f=r.redSub(n),o=i.redSub(a);if(0===f.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var s=f.redSqr(),c=s.redMul(f),u=r.redMul(s),d=o.redSqr().redIAdd(c).redISub(u).redISub(u),h=o.redMul(u.redISub(d)).redISub(i.redMul(c)),l=this.z.redMul(f);return this.curve.jpoint(d,h,l)},rr.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},rr.prototype.inspect=function(){return this.isInfinity()?"":""},rr.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},m(nr,Je);var ir=nr;function ar(t,e,r){Je.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Ie(e,16),this.z=new Ie(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}nr.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},m(ar,Je.BasePoint),nr.prototype.decodePoint=function(t,e){return this.point(Ve.toArray(t,e),1)},nr.prototype.point=function(t,e){return new ar(this,t,e)},nr.prototype.pointFromJSON=function(t){return ar.fromJSON(this,t)},ar.prototype.precompute=function(){},ar.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},ar.fromJSON=function(t,e){return new ar(t,e[0],e[1]||t.one)},ar.prototype.inspect=function(){return this.isInfinity()?"":""},ar.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},ar.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},ar.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},ar.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),a=t.x.redSub(t.z).redMul(r),f=i.redMul(n),o=e.z.redMul(a.redAdd(f).redSqr()),s=e.x.redMul(a.redISub(f).redSqr());return this.curve.point(o,s)},ar.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var a=i.length-1;a>=0;a--)0===i[a]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},ar.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},ar.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},ar.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},ar.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},ar.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var fr=Ve.assert;function or(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,Je.call(this,"edwards",t),this.a=new Ie(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Ie(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Ie(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),fr(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}m(or,Je);var sr=or;function cr(t,e,r,n,i){Je.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Ie(e,16),this.y=new Ie(r,16),this.z=n?new Ie(n,16):this.curve.one,this.t=i&&new Ie(i,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}or.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},or.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},or.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},or.prototype.pointFromX=function(t,e){(t=new Ie(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(i.redInvm()),f=a.redSqrt();if(0!==f.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var o=f.fromRed().isOdd();return(e&&!o||!e&&o)&&(f=f.redNeg()),this.point(t,f)},or.prototype.pointFromY=function(t,e){(t=new Ie(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(i.redInvm());if(0===a.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var f=a.redSqrt();if(0!==f.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return f.fromRed().isOdd()!==e&&(f=f.redNeg()),this.point(f,t)},or.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},m(cr,Je.BasePoint),or.prototype.pointFromJSON=function(t){return cr.fromJSON(this,t)},or.prototype.point=function(t,e,r,n){return new cr(this,t,e,r,n)},cr.fromJSON=function(t,e){return new cr(t,e[0],e[1],e[2])},cr.prototype.inspect=function(){return this.isInfinity()?"":""},cr.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},cr.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),a=n.redAdd(e),f=a.redSub(r),o=n.redSub(e),s=i.redMul(f),c=a.redMul(o),u=i.redMul(o),d=f.redMul(a);return this.curve.point(s,c,d,u)},cr.prototype._projDbl=function(){var t,e,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var f=(c=this.curve._mulA(i)).redAdd(a);if(this.zOne)t=n.redSub(i).redSub(a).redMul(f.redSub(this.curve.two)),e=f.redMul(c.redSub(a)),r=f.redSqr().redSub(f).redSub(f);else{var o=this.z.redSqr(),s=f.redSub(o).redISub(o);t=n.redSub(i).redISub(a).redMul(s),e=f.redMul(c.redSub(a)),r=f.redMul(s)}}else{var c=i.redAdd(a);o=this.curve._mulC(this.z).redSqr(),s=c.redSub(o).redSub(o),t=this.curve._mulC(n.redISub(c)).redMul(s),e=this.curve._mulC(c).redMul(i.redISub(a)),r=c.redMul(s)}return this.curve.point(t,e,r)},cr.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},cr.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),a=r.redSub(e),f=i.redSub(n),o=i.redAdd(n),s=r.redAdd(e),c=a.redMul(f),u=o.redMul(s),d=a.redMul(s),h=f.redMul(o);return this.curve.point(c,u,h,d)},cr.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),a=this.x.redMul(t.x),f=this.y.redMul(t.y),o=this.curve.d.redMul(a).redMul(f),s=i.redSub(o),c=i.redAdd(o),u=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(a).redISub(f),d=n.redMul(s).redMul(u);return this.curve.twisted?(e=n.redMul(c).redMul(f.redSub(this.curve._mulA(a))),r=s.redMul(c)):(e=n.redMul(c).redMul(f.redSub(a)),r=this.curve._mulC(s).redMul(c)),this.curve.point(d,e,r)},cr.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},cr.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},cr.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},cr.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},cr.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},cr.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},cr.prototype.getX=function(){return this.normalize(),this.x.fromRed()},cr.prototype.getY=function(){return this.normalize(),this.y.fromRed()},cr.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},cr.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},cr.prototype.toP=cr.prototype.normalize,cr.prototype.mixedAdd=cr.prototype.add;var ur=Object(p.b)((function(t,e){var r=e;r.base=Je,r.short=tr,r.mont=ir,r.edwards=sr}));function dr(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function hr(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function lr(t){return 1===t.length?"0"+t:t}function br(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}var pr={inherits:m,toArray:function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i>6|192,r[n++]=63&a|128):dr(t,i)?(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i>>0}return a},split32:function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r},rotr32:function(t,e){return t>>>e|t<<32-e},rotl32:function(t,e){return t<>>32-e},sum32:function(t,e){return t+e>>>0},sum32_3:function(t,e,r){return t+e+r>>>0},sum32_4:function(t,e,r,n){return t+e+r+n>>>0},sum32_5:function(t,e,r,n,i){return t+e+r+n+i>>>0},sum64:function(t,e,r,n){var i=t[e],a=n+t[e+1]>>>0,f=(a>>0,t[e+1]=a},sum64_hi:function(t,e,r,n){return(e+n>>>0>>0},sum64_lo:function(t,e,r,n){return e+n>>>0},sum64_4_hi:function(t,e,r,n,i,a,f,o){var s=0,c=e;return s+=(c=c+n>>>0)>>0)>>0)>>0},sum64_4_lo:function(t,e,r,n,i,a,f,o){return e+n+a+o>>>0},sum64_5_hi:function(t,e,r,n,i,a,f,o,s,c){var u=0,d=e;return u+=(d=d+n>>>0)>>0)>>0)>>0)>>0},sum64_5_lo:function(t,e,r,n,i,a,f,o,s,c){return e+n+a+o+c>>>0},rotr64_hi:function(t,e,r){return(e<<32-r|t>>>r)>>>0},rotr64_lo:function(t,e,r){return(t<<32-r|e>>>r)>>>0},shr64_hi:function(t,e,r){return t>>>r},shr64_lo:function(t,e,r){return(t<<32-r|e>>>r)>>>0}};function vr(){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 _r=vr;vr.prototype.update=function(t,e){if(t=pr.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=pr.join32(t,0,t.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a>>3},xr=function(t){return mr(t,17)^mr(t,19)^t>>>10},Pr=pr.rotl32,Tr=pr.sum32,Rr=pr.sum32_5,jr=Er,Or=yr.BlockHash,Cr=[1518500249,1859775393,2400959708,3395469782];function Br(){if(!(this instanceof Br))return new Br;Or.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}pr.inherits(Br,Or);var Nr=Br;Br.blockSize=512,Br.outSize=160,Br.hmacStrength=80,Br.padLength=64,Br.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;nthis.blockSize&&(t=(new this.Hash).update(t).digest()),Ne(t.length<=this.blockSize);for(var e=t.length;e=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var Xn=Jn;Jn.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);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(t.concat(r||[])),this._reseed=1},Jn.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=Ke.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var ei=Ve.assert;function ri(t,e){if(t instanceof ri)return t;this._importDER(t,e)||(ei(t.r&&t.s,"Signature without r or s"),this.r=new Ie(t.r,16),this.s=new Ie(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var ni=ri;function ii(){this.place=0}function ai(t,e){var r=t[e.place++];if(!(128&r))return r;for(var n=15&r,i=0,a=0,f=e.place;a>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}ri.prototype._importDER=function(t,e){t=Ve.toArray(t,e);var r=new ii;if(48!==t[r.place++])return!1;if(ai(t,r)+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var n=ai(t,r),i=t.slice(r.place,n+r.place);if(r.place+=n,2!==t[r.place++])return!1;var a=ai(t,r);if(t.length!==a+r.place)return!1;var f=t.slice(r.place,a+r.place);return 0===i[0]&&128&i[1]&&(i=i.slice(1)),0===f[0]&&128&f[1]&&(f=f.slice(1)),this.r=new Ie(i),this.s=new Ie(f),this.recoveryParam=null,!0},ri.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=fi(e),r=fi(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];oi(n,e.length),(n=n.concat(e)).push(2),oi(n,r.length);var i=n.concat(r),a=[48];return oi(a,i.length),a=a.concat(i),Ve.encode(a,t)};var si=Ve.assert;function ci(t){if(!(this instanceof ci))return new ci(t);"string"==typeof t&&(si(Zn.hasOwnProperty(t),"Unknown curve "+t),t=Zn[t]),t instanceof Zn.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var ui=ci;ci.prototype.keyPair=function(t){return new ti(this,t)},ci.prototype.keyFromPrivate=function(t,e){return ti.fromPrivate(this,t,e)},ci.prototype.keyFromPublic=function(t,e){return ti.fromPublic(this,t,e)},ci.prototype.genKeyPair=function(t){t||(t={});for(var e=new Xn({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||Ue(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new Ie(2));;){var i=new Ie(e.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},ci.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},ci.prototype.sign=function(t,e,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new Ie(t,16));for(var i=this.n.byteLength(),a=e.getPrivate().toArray("be",i),f=t.toArray("be",i),o=new Xn({hash:this.hash,entropy:a,nonce:f,pers:n.pers,persEnc:n.persEnc||"utf8"}),s=this.n.sub(new Ie(1)),c=0;;c++){var u=n.k?n.k(c):new Ie(o.generate(this.n.byteLength()));if(!((u=this._truncateToN(u,!0)).cmpn(1)<=0||u.cmp(s)>=0)){var d=this.g.mul(u);if(!d.isInfinity()){var h=d.getX(),l=h.umod(this.n);if(0!==l.cmpn(0)){var b=u.invm(this.n).mul(l.mul(e.getPrivate()).iadd(t));if(0!==(b=b.umod(this.n)).cmpn(0)){var p=(d.getY().isOdd()?1:0)|(0!==h.cmp(l)?2:0);return n.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),p^=1),new ni({r:l,s:b,recoveryParam:p})}}}}}},ci.prototype.verify=function(t,e,r,n){t=this._truncateToN(new Ie(t,16)),r=this.keyFromPublic(r,n);var i=(e=new ni(e,"hex")).r,a=e.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var f,o=a.invm(this.n),s=o.mul(t).umod(this.n),c=o.mul(i).umod(this.n);return this.curve._maxwellTrick?!(f=this.g.jmulAdd(s,r.getPublic(),c)).isInfinity()&&f.eqXToP(i):!(f=this.g.mulAdd(s,r.getPublic(),c)).isInfinity()&&0===f.getX().umod(this.n).cmp(i)},ci.prototype.recoverPubKey=function(t,e,r,n){si((3&r)===r,"The recovery param is more than two bits"),e=new ni(e,n);var i=this.n,a=new Ie(t),f=e.r,o=e.s,s=1&r,c=r>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");f=c?this.curve.pointFromX(f.add(this.curve.n),s):this.curve.pointFromX(f,s);var u=e.r.invm(i),d=i.sub(a).mul(u).umod(i),h=o.mul(u).umod(i);return this.g.mulAdd(d,f,h)},ci.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new ni(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(t,e,i)}catch(t){continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var di=Ve.assert,hi=Ve.parseBytes,li=Ve.cachedProperty;function bi(t,e){this.eddsa=t,this._secret=hi(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=hi(e.pub)}bi.fromPublic=function(t,e){return e instanceof bi?e:new bi(t,{pub:e})},bi.fromSecret=function(t,e){return e instanceof bi?e:new bi(t,{secret:e})},bi.prototype.secret=function(){return this._secret},li(bi,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),li(bi,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),li(bi,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),li(bi,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),li(bi,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),li(bi,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),bi.prototype.sign=function(t){return di(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},bi.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},bi.prototype.getSecret=function(t){return di(this._secret,"KeyPair is public only"),Ve.encode(this.secret(),t)},bi.prototype.getPublic=function(t){return Ve.encode(this.pubBytes(),t)};var pi=bi,vi=Ve.assert,_i=Ve.cachedProperty,yi=Ve.parseBytes;function mi(t,e){this.eddsa=t,"object"!=typeof e&&(e=yi(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),vi(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof Ie&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}_i(mi,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),_i(mi,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),_i(mi,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),_i(mi,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),mi.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},mi.prototype.toHex=function(){return Ve.encode(this.toBytes(),"hex").toUpperCase()};var gi=mi,wi=Ve.assert,Ai=Ve.parseBytes;function Ei(t){if(wi("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof Ei))return new Ei(t);t=Zn[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=Gn.sha512}var Ii=Ei;Ei.prototype.sign=function(t,e){t=Ai(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),a=this.encodePoint(i),f=this.hashInt(a,r.pubBytes(),t).mul(r.priv()),o=n.add(f).umod(this.curve.n);return this.makeSignature({R:i,S:o,Rencoded:a})},Ei.prototype.verify=function(t,e,r){t=Ai(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),a=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(a)},Ei.prototype.hashInt=function(){for(var t=this.hash(),e=0;e=0)return null;var a=(r=r.toRed(i.red)).redSqr().redIMul(r).redIAdd(i.b).redSqrt();return 3===t!==a.isOdd()&&(a=a.redNeg()),n.keyPair({pub:{x:r,y:a}})}(e,t.slice(1,33));case 4:case 6:case 7:return 65!==t.length?null:function(t,e,r){var a=new Ie(e),f=new Ie(r);if(a.cmp(i.p)>=0||f.cmp(i.p)>=0)return null;if(a=a.toRed(i.red),f=f.toRed(i.red),(6===t||7===t)&&f.isOdd()!==(7===t))return null;var o=a.redSqr().redIMul(a);return f.redSqr().redISub(o.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:a,y:f}}):null}(e,t.slice(1,33),t.slice(33,65));default:return null}}e.privateKeyVerify=function(t){var e=new Ie(t);return e.cmp(i.n)<0&&!e.isZero()},e.privateKeyExport=function(t,e){var a=new Ie(t);if(a.cmp(i.n)>=0||a.isZero())throw new Error(q.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return r.from(n.keyFromPrivate(t).getPublic(e,!0))},e.privateKeyNegate=function(t){var e=new Ie(t);return e.isZero()?r.alloc(32):i.n.sub(e).umod(i.n).toArrayLike(r,"be",32)},e.privateKeyModInverse=function(t){var e=new Ie(t);if(e.cmp(i.n)>=0||e.isZero())throw new Error(q.EC_PRIVATE_KEY_RANGE_INVALID);return e.invm(i.n).toArrayLike(r,"be",32)},e.privateKeyTweakAdd=function(t,e){var n=new Ie(e);if(n.cmp(i.n)>=0)throw new Error(q.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(n.iadd(new Ie(t)),n.cmp(i.n)>=0&&n.isub(i.n),n.isZero())throw new Error(q.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return n.toArrayLike(r,"be",32)},e.privateKeyTweakMul=function(t,e){var n=new Ie(e);if(n.cmp(i.n)>=0||n.isZero())throw new Error(q.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);return n.imul(new Ie(t)),n.cmp(i.n)&&(n=n.umod(i.n)),n.toArrayLike(r,"be",32)},e.publicKeyCreate=function(t,e){var a=new Ie(t);if(a.cmp(i.n)>=0||a.isZero())throw new Error(q.EC_PUBLIC_KEY_CREATE_FAIL);return r.from(n.keyFromPrivate(t).getPublic(e,!0))},e.publicKeyConvert=function(t,e){var n=a(t);if(null===n)throw new Error(q.EC_PUBLIC_KEY_PARSE_FAIL);return r.from(n.getPublic(e,!0))},e.publicKeyVerify=function(t){return null!==a(t)},e.publicKeyTweakAdd=function(t,e,n){var f=a(t);if(null===f)throw new Error(q.EC_PUBLIC_KEY_PARSE_FAIL);if((e=new Ie(e)).cmp(i.n)>=0)throw new Error(q.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);var o=i.g.mul(e).add(f.pub);if(o.isInfinity())throw new Error(q.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return r.from(o.encode(!0,n))},e.publicKeyTweakMul=function(t,e,n){var f=a(t);if(null===f)throw new Error(q.EC_PUBLIC_KEY_PARSE_FAIL);if((e=new Ie(e)).cmp(i.n)>=0||e.isZero())throw new Error(q.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return r.from(f.pub.mul(e).encode(!0,n))},e.publicKeyCombine=function(t,e){for(var n=new Array(t.length),i=0;i=0||a.cmp(i.n)>=0)throw new Error(q.ECDSA_SIGNATURE_PARSE_FAIL);var f=r.from(t);return 1===a.cmp(n.nh)&&i.n.sub(a).toArrayLike(r,"be",32).copy(f,32),f},e.signatureExport=function(t){var e=t.slice(0,32),r=t.slice(32,64);if(new Ie(e).cmp(i.n)>=0||new Ie(r).cmp(i.n)>=0)throw new Error(q.ECDSA_SIGNATURE_PARSE_FAIL);return{r:e,s:r}},e.signatureImport=function(t){var e=new Ie(t.r);e.cmp(i.n)>=0&&(e=new Ie(0));var n=new Ie(t.s);return n.cmp(i.n)>=0&&(n=new Ie(0)),r.concat([e.toArrayLike(r,"be",32),n.toArrayLike(r,"be",32)])},e.sign=function(t,e,a,f){if("function"==typeof a){var o=a;a=function(n){var i=o(t,e,null,f,n);if(!r.isBuffer(i)||32!==i.length)throw new Error(q.ECDSA_SIGN_FAIL);return new Ie(i)}}var s=new Ie(e);if(s.cmp(i.n)>=0||s.isZero())throw new Error(q.ECDSA_SIGN_FAIL);var c=n.sign(t,e,{canonical:!0,k:a,pers:f});return{signature:r.concat([c.r.toArrayLike(r,"be",32),c.s.toArrayLike(r,"be",32)]),recovery:c.recoveryParam}},e.verify=function(t,e,r){var f={r:e.slice(0,32),s:e.slice(32,64)},o=new Ie(f.r),s=new Ie(f.s);if(o.cmp(i.n)>=0||s.cmp(i.n)>=0)throw new Error(q.ECDSA_SIGNATURE_PARSE_FAIL);if(1===s.cmp(n.nh)||o.isZero()||s.isZero())return!1;var c=a(r);if(null===c)throw new Error(q.EC_PUBLIC_KEY_PARSE_FAIL);return n.verify(t,f,{x:c.pub.x,y:c.pub.y})},e.recover=function(t,e,a,f){var o={r:e.slice(0,32),s:e.slice(32,64)},s=new Ie(o.r),c=new Ie(o.s);if(s.cmp(i.n)>=0||c.cmp(i.n)>=0)throw new Error(q.ECDSA_SIGNATURE_PARSE_FAIL);try{if(s.isZero()||c.isZero())throw new Error;var u=n.recoverPubKey(t,o,a);return r.from(u.encode(!0,f))}catch(t){throw new Error(q.ECDSA_RECOVER_FAIL)}},e.ecdh=function(t,r){var n=e.ecdhUnsafe(t,r,!0);return Ee("sha256").update(n).digest()},e.ecdhUnsafe=function(t,e,n){var f=a(t);if(null===f)throw new Error(q.EC_PUBLIC_KEY_PARSE_FAIL);var o=new Ie(e);if(o.cmp(i.n)>=0||o.isZero())throw new Error(q.ECDH_FAIL);return r.from(f.pub.mul(o).encode(!0,n))}})),xi=(Li.privateKeyVerify,Li.privateKeyExport,Li.privateKeyNegate,Li.privateKeyModInverse,Li.privateKeyTweakAdd,Li.privateKeyTweakMul,Li.publicKeyCreate,Li.publicKeyConvert,Li.publicKeyVerify,Li.publicKeyTweakAdd,Li.publicKeyTweakMul,Li.publicKeyCombine,Li.signatureNormalize,Li.signatureExport,Li.signatureImport,Li.sign,Li.verify,Li.recover,Li.ecdh,Li.ecdhUnsafe,Mi=Li,{privateKeyVerify:function(t){return P(t,q.EC_PRIVATE_KEY_TYPE_INVALID),32===t.length&&Mi.privateKeyVerify(t)},privateKeyExport:function(t,e){return P(t,q.EC_PRIVATE_KEY_TYPE_INVALID),T(t,32,q.EC_PRIVATE_KEY_LENGTH_INVALID),e=Y(e,!0),function(t,e,r){var n=N.from(r?z:D);return t.copy(n,r?8:9),e.copy(n,r?181:214),n}(t,Mi.privateKeyExport(t,e),e)},privateKeyImport:function(t){if(P(t,q.EC_PRIVATE_KEY_TYPE_INVALID),(t=function(t){var e=t.length,r=0;if(!(e2||e1?t[r+n-2]<<8:0);if(!(e<(r+=n)+i||e32||e1&&0===e[n]&&!(128&e[n+1]);--r,++n);for(var i=N.concat([N.from([0]),t.s]),a=33,f=0;a>1&&0===i[f]&&!(128&i[f+1]);--a,++f);return B(e.slice(n),i.slice(f))}(Mi.signatureExport(t))},signatureImport:function(t){P(t,q.ECDSA_SIGNATURE_TYPE_INVALID),j(t,q.ECDSA_SIGNATURE_LENGTH_INVALID);var e=function(t){var e=N.alloc(32,0),r=N.alloc(32,0);try{var n=C(t);if(33===n.r.length&&0===n.r[0]&&(n.r=n.r.slice(1)),n.r.length>32)throw new Error("R length is too long");if(33===n.s.length&&0===n.s[0]&&(n.s=n.s.slice(1)),n.s.length>32)throw new Error("S length is too long")}catch(t){return}return n.r.copy(e,32-n.r.length),n.s.copy(r,32-n.s.length),{r:e,s:r}}(t);if(e)return Mi.signatureImport(e);throw new Error(q.ECDSA_SIGNATURE_PARSE_DER_FAIL)},signatureImportLax:function(t){P(t,q.ECDSA_SIGNATURE_TYPE_INVALID),j(t,q.ECDSA_SIGNATURE_LENGTH_INVALID);var e=function(t){var e=N.alloc(32,0),r=N.alloc(32,0),n=t.length,i=0;if(48===t[i++]){var a=t[i++];if(!(128&a&&(i+=a-128)>n)&&2===t[i++]){var f=t[i++];if(128&f){if(i+(a=f-128)>n)return;for(;a>0&&0===t[i];i+=1,a-=1);for(f=0;a>0;i+=1,a-=1)f=(f<<8)+t[i]}if(!(f>n-i)){var o=i;if(i+=f,2===t[i++]){var s=t[i++];if(128&s){if(i+(a=s-128)>n)return;for(;a>0&&0===t[i];i+=1,a-=1);for(s=0;a>0;i+=1,a-=1)s=(s<<8)+t[i]}if(!(s>n-i)){var c=i;for(i+=s;f>0&&0===t[o];f-=1,o+=1);if(!(f>32)){var u=t.slice(o,o+f);for(u.copy(e,32-u.length);s>0&&0===t[c];s-=1,c+=1);if(!(s>32)){var d=t.slice(c,c+s);return d.copy(r,32-d.length),{r:e,s:r}}}}}}}}}(t);if(e)return Mi.signatureImport(e);throw new Error(q.ECDSA_SIGNATURE_PARSE_DER_FAIL)},sign:function(t,e,r){P(t,q.MSG32_TYPE_INVALID),T(t,32,q.MSG32_LENGTH_INVALID),P(e,q.EC_PRIVATE_KEY_TYPE_INVALID),T(e,32,q.EC_PRIVATE_KEY_LENGTH_INVALID);var n=null,i=null;return void 0!==r&&(function(t,e){if("[object Object]"!==x.call(t))throw TypeError(e)}(r,q.OPTIONS_TYPE_INVALID),void 0!==r.data&&(P(r.data,q.OPTIONS_DATA_TYPE_INVALID),T(r.data,32,q.OPTIONS_DATA_LENGTH_INVALID),n=r.data),void 0!==r.noncefn&&(function(t,e){if("[object Function]"!==x.call(t))throw TypeError(e)}(r.noncefn,q.OPTIONS_NONCEFN_TYPE_INVALID),i=r.noncefn)),Mi.sign(t,e,i,n)},verify:function(t,e,r){return P(t,q.MSG32_TYPE_INVALID),T(t,32,q.MSG32_LENGTH_INVALID),P(e,q.ECDSA_SIGNATURE_TYPE_INVALID),T(e,64,q.ECDSA_SIGNATURE_LENGTH_INVALID),P(r,q.EC_PUBLIC_KEY_TYPE_INVALID),R(r,33,65,q.EC_PUBLIC_KEY_LENGTH_INVALID),Mi.verify(t,e,r)},recover:function(t,e,r,n){return P(t,q.MSG32_TYPE_INVALID),T(t,32,q.MSG32_LENGTH_INVALID),P(e,q.ECDSA_SIGNATURE_TYPE_INVALID),T(e,64,q.ECDSA_SIGNATURE_LENGTH_INVALID),function(t,e){if("[object Number]"!==x.call(t))throw TypeError(e)}(r,q.RECOVERY_ID_TYPE_INVALID),function(t,e,r,n){if(t<=e||t>=r)throw RangeError(n)}(r,-1,4,q.RECOVERY_ID_VALUE_INVALID),n=Y(n,!0),Mi.recover(t,e,r,n)},ecdh:function(t,e){return P(t,q.EC_PUBLIC_KEY_TYPE_INVALID),R(t,33,65,q.EC_PUBLIC_KEY_LENGTH_INVALID),P(e,q.EC_PRIVATE_KEY_TYPE_INVALID),T(e,32,q.EC_PRIVATE_KEY_LENGTH_INVALID),Mi.ecdh(t,e)},ecdhUnsafe:function(t,e,r){return P(t,q.EC_PUBLIC_KEY_TYPE_INVALID),R(t,33,65,q.EC_PUBLIC_KEY_LENGTH_INVALID),P(e,q.EC_PRIVATE_KEY_TYPE_INVALID),T(e,32,q.EC_PRIVATE_KEY_LENGTH_INVALID),r=Y(r,!0),Mi.ecdhUnsafe(t,e,r)}}),Pi=Object(p.b)((function(e,r){function n(t,e){if("00"===t.slice(0,2))throw new Error("invalid RLP: extra zeros");return parseInt(t,e)}function i(e,r){if(e<56)return t.from([e+r]);var n=f(e),i=f(r+55+n.length/2);return t.from(i+n,"hex")}function a(t){return"0x"===t.slice(0,2)}function f(t){if(t<0)throw new Error("Invalid integer as argument, must be unsigned!");var e=t.toString(16);return e.length%2?"0"+e:e}function o(e){if(!t.isBuffer(e)){if("string"==typeof e)return a(e)?t.from((n="string"!=typeof(i=e)?i:a(i)?i.slice(2):i).length%2?"0"+n:n,"hex"):t.from(e);if("number"==typeof e)return e?(r=f(e),t.from(r,"hex")):t.from([]);if(null==e)return t.from([]);if(e instanceof Uint8Array)return t.from(e);if(Ie.isBN(e))return t.from(e.toArray());throw new Error("invalid type")}var r,n,i;return e}Object.defineProperty(r,"__esModule",{value:!0}),r.encode=function e(r){if(Array.isArray(r)){for(var n=[],a=0;ar.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(o=r.slice(a,d)).length)throw new Error("invalid rlp, List has a invalid length");for(;o.length;)s=e(o),c.push(s.data),o=s.remainder;return{data:c,remainder:r.slice(d)}}(o(e));if(r)return i;if(0!==i.remainder.length)throw new Error("invalid remainder");return i.data},r.getLength=function(e){if(!e||0===e.length)return t.from([]);var r=o(e),i=r[0];if(i<=127)return r.length;if(i<=183)return i-127;if(i<=191)return i-182;if(i<=247)return i-191;var a=i-246;return a+n(r.slice(1,a).toString("hex"),16)}}));Object(p.c)(Pi),Pi.encode,Pi.decode,Pi.getLength;var Ti=function(t){if("string"!=typeof t)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof t+", while checking isHexPrefixed.");return"0x"===t.slice(0,2)},Ri=function(t){return"string"!=typeof t?t:Ti(t)?t.slice(2):t};function ji(t){var e=t;if("string"!=typeof e)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof e+", while padToEven.");return e.length%2&&(e="0"+e),e}function Oi(t){return"0x"+t.toString(16)}var Ci={arrayContainsArray:function(t,e,r){if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof t+"'");if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof e+"'");return e[Boolean(r)?"some":"every"]((function(e){return t.indexOf(e)>=0}))},intToBuffer:function(e){var r=Oi(e);return new t(ji(r.slice(2)),"hex")},getBinarySize:function(e){if("string"!=typeof e)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof e+"'.");return t.byteLength(e,"utf8")},isHexPrefixed:Ti,stripHexPrefix:Ri,padToEven:ji,intToHex:Oi,fromAscii:function(t){for(var e="",r=0;r0&&"0"===r.toString();)r=(t=t.slice(1))[0];return t},e.toBuffer=function(t){if(!n.isBuffer(t))if(Array.isArray(t))t=n.from(t);else if("string"==typeof t)t=e.isHexString(t)?n.from(e.padToEven(e.stripHexPrefix(t)),"hex"):n.from(t);else if("number"==typeof t)t=e.intToBuffer(t);else if(null==t)t=n.allocUnsafe(0);else if(Ie.isBN(t))t=t.toArrayLike(n);else{if(!t.toArray)throw new Error("invalid type");t=n.from(t.toArray())}return t},e.bufferToInt=function(t){return new Ie(e.toBuffer(t)).toNumber()},e.bufferToHex=function(t){return"0x"+(t=e.toBuffer(t)).toString("hex")},e.fromSigned=function(t){return new Ie(t).fromTwos(256)},e.toUnsigned=function(t){return n.from(t.toTwos(256).toArray())},e.keccak=function(t,r){return t=e.toBuffer(t),r||(r=256),L("keccak"+r).update(t).digest()},e.keccak256=function(t){return e.keccak(t)},e.sha3=e.keccak,e.sha256=function(t){return t=e.toBuffer(t),Ee("sha256").update(t).digest()},e.ripemd160=function(t,r){t=e.toBuffer(t);var n=Ee("rmd160").update(t).digest();return!0===r?e.setLength(n,32):n},e.rlphash=function(t){return e.keccak(Pi.encode(t))},e.isValidPrivate=function(t){return xi.privateKeyVerify(t)},e.isValidPublic=function(t,e){return 64===t.length?xi.publicKeyVerify(n.concat([n.from([4]),t])):!!e&&xi.publicKeyVerify(t)},e.pubToAddress=e.publicToAddress=function(t,r){return t=e.toBuffer(t),r&&64!==t.length&&(t=xi.publicKeyConvert(t,!1).slice(1)),Object(_.b)(64===t.length),e.keccak(t).slice(-20)};var i=e.privateToPublic=function(t){return t=e.toBuffer(t),xi.publicKeyCreate(t,!1).slice(1)};e.importPublic=function(t){return 64!==(t=e.toBuffer(t)).length&&(t=xi.publicKeyConvert(t,!1).slice(1)),t},e.ecsign=function(t,e){var r=xi.sign(t,e),n={};return n.r=r.signature.slice(0,32),n.s=r.signature.slice(32,64),n.v=r.recovery+27,n},e.hashPersonalMessage=function(t){var r=e.toBuffer("\x19Ethereum Signed Message:\n"+t.length.toString());return e.keccak(n.concat([r,t]))},e.ecrecover=function(t,r,i,a){var f=n.concat([e.setLength(i,32),e.setLength(a,32)],64),o=r-27;if(0!==o&&1!==o)throw new Error("Invalid signature v value");var s=xi.recover(t,f,o);return xi.publicKeyConvert(s,!1).slice(1)},e.toRpcSig=function(t,r,i){if(27!==t&&28!==t)throw new Error("Invalid recovery id");return e.bufferToHex(n.concat([e.setLengthLeft(r,32),e.setLengthLeft(i,32),e.toBuffer(t-27)]))},e.fromRpcSig=function(t){if(65!==(t=e.toBuffer(t)).length)throw new Error("Invalid signature length");var r=t[64];return r<27&&(r+=27),{v:r,r:t.slice(0,32),s:t.slice(32,64)}},e.privateToAddress=function(t){return e.publicToAddress(i(t))},e.isValidAddress=function(t){return/^0x[0-9a-fA-F]{40}$/.test(t)},e.isZeroAddress=function(t){return e.zeroAddress()===e.addHexPrefix(t)},e.toChecksumAddress=function(t){t=e.stripHexPrefix(t).toLowerCase();for(var r=e.keccak(t).toString("hex"),n="0x",i=0;i=8?n+=t[i].toUpperCase():n+=t[i];return n},e.isValidChecksumAddress=function(t){return e.isValidAddress(t)&&e.toChecksumAddress(t)===t},e.generateAddress=function(t,r){return t=e.toBuffer(t),r=(r=new Ie(r)).isZero()?null:n.from(r.toArray()),e.rlphash([t,r]).slice(-20)},e.isPrecompiled=function(t){var r=e.unpad(t);return 1===r.length&&r[0]>=1&&r[0]<=8},e.addHexPrefix=function(t){return"string"!=typeof t||e.isHexPrefixed(t)?t:"0x"+t},e.isValidSignature=function(t,e,r,n){var i=new Ie("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),a=new Ie("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===e.length&&32===r.length&&(27===t||28===t)&&(e=new Ie(e),r=new Ie(r),!(e.isZero()||e.gt(a)||r.isZero()||r.gt(a))&&(!1!==n||1!==new Ie(r).cmp(i)))},e.baToJSON=function(t){if(n.isBuffer(t))return"0x"+t.toString("hex");if(t instanceof Array){for(var r=[],i=0;i=a.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===a.length||!r.length||Object(_.b)(r.length===a.length,"The field "+r.name+" must have byte length of "+r.length),t.raw[i]=a}t._fields.push(r.name),Object.defineProperty(t,r.name,{enumerable:!0,configurable:!0,get:a,set:f}),r.default&&(t[r.name]=r.default),r.alias&&Object.defineProperty(t,r.alias,{enumerable:!1,configurable:!0,set:f,get:a})})),a)if("string"==typeof a&&(a=n.from(e.stripHexPrefix(a),"hex")),n.isBuffer(a)&&(a=Pi.decode(a)),Array.isArray(a)){if(a.length>t._fields.length)throw new Error("wrong number of fields in data");a.forEach((function(r,n){t[t._fields[n]]=e.toBuffer(r)}))}else{if("object"!==(void 0===a?"undefined":r(a)))throw new Error("invalid data");var f=Object.keys(a);i.forEach((function(e){-1!==f.indexOf(e.name)&&(t[e.name]=a[e.name]),-1!==f.indexOf(e.alias)&&(t[e.alias]=a[e.alias])}))}}})),Ni=(Bi.MAX_INTEGER,Bi.TWO_POW256,Bi.KECCAK256_NULL_S,Bi.SHA3_NULL_S,Bi.KECCAK256_NULL,Bi.SHA3_NULL,Bi.KECCAK256_RLP_ARRAY_S,Bi.SHA3_RLP_ARRAY_S,Bi.KECCAK256_RLP_ARRAY,Bi.SHA3_RLP_ARRAY,Bi.KECCAK256_RLP_S,Bi.SHA3_RLP_S,Bi.KECCAK256_RLP,Bi.SHA3_RLP,Bi.BN,Bi.rlp,Bi.secp256k1,Bi.zeros,Bi.zeroAddress,Bi.setLengthLeft,Bi.setLength,Bi.setLengthRight,Bi.unpad,Bi.stripZeros,Bi.toBuffer,Bi.bufferToInt,Bi.bufferToHex,Bi.fromSigned,Bi.toUnsigned,Bi.keccak,Bi.keccak256,Bi.sha3,Bi.sha256,Bi.ripemd160,Bi.rlphash,Bi.isValidPrivate,Bi.isValidPublic,Bi.pubToAddress,Bi.publicToAddress,Bi.privateToPublic,Bi.importPublic,Bi.ecsign,Bi.hashPersonalMessage,Bi.ecrecover,Bi.toRpcSig,Bi.fromRpcSig,Bi.privateToAddress,Bi.isValidAddress),zi=(Bi.isZeroAddress,Bi.toChecksumAddress,Bi.isValidChecksumAddress,Bi.generateAddress,Bi.isPrecompiled,Bi.addHexPrefix),Di=(Bi.isValidSignature,Bi.baToJSON,Bi.defineProperties,function(){for(var t={},e=0;e0&&f.length>i&&!f.warned){f.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+f.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=t,s.type=e,s.count=f.length,o=s,console&&console.warn&&console.warn(o)}return t}function ia(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function aa(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=ia.bind(n);return i.listener=r,n.wrapFn=i,i}function fa(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(a=e[0]),a instanceof Error)throw a;var f=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw f.context=a,f}var o=i[t];if(void 0===o)return!1;if("function"==typeof o)Ji(o,this,e);else{var s=o.length,c=sa(o,s);for(r=0;r=0;a--)if(r[a]===e||r[a].listener===e){f=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},$i.prototype.listeners=function(t){return fa(this,t,!0)},$i.prototype.rawListeners=function(t){return fa(this,t,!1)},$i.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):oa.call(t,e)},$i.prototype.listenerCount=oa,$i.prototype.eventNames=function(){return this._eventsCount>0?Wi(this._events):[]};var ca="object"==typeof Reflect?Reflect:null,ua=ca&&"function"==typeof ca.apply?ca.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)},da=ha;function ha(){Qi.call(this)}function la(t,e,r){try{ua(t,e,r)}catch(t){setTimeout((function(){throw t}))}}function ba(t,e){for(var r=new Array(e),n=0;n0&&(a=e[0]),a instanceof Error)throw a;var f=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw f.context=a,f}var o=i[t];if(void 0===o)return!1;if("function"==typeof o)la(o,this,e);else{var s=o.length,c=ba(o,s);for(r=0;r0&&void 0!==arguments[0]?arguments[0]:{};if(Object(s.a)(this,r),!n.provider)throw new Error("PollingBlockTracker - no provider specified.");var i=n.pollingInterval||2e4,a=n.retryTimeout||i/10,f=void 0===n.keepEventLoopActive||n.keepEventLoopActive,o=n.setSkipCacheFlag||!1;return(t=e.call(this,Object.assign({blockResetDuration:i},n)))._provider=n.provider,t._pollingInterval=i,t._retryTimeout=a,t._keepEventLoopActive=f,t._setSkipCacheFlag=o,t}return Object(c.a)(r,[{key:"checkForLatestBlock",value:function(){var t=Object(o.a)(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._updateLatestBlock();case 2:return t.next=4,this.getLatestBlock();case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"_start",value:function(){var t=this;this._performSync().catch((function(e){return t.emit("error",e)}))}},{key:"_performSync",value:function(){var t=Object(o.a)(f.a.mark((function t(){var e;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._isRunning){t.next=16;break}return t.prev=1,t.next=4,this._updateLatestBlock();case 4:return t.next=6,ma(this._pollingInterval,!this._keepEventLoopActive);case 6:t.next=14;break;case 8:t.prev=8,t.t0=t.catch(1),e=new Error("PollingBlockTracker - encountered an error while attempting to update latest block:\n".concat(t.t0.stack));try{this.emit("error",e)}catch(Mi){console.error(e)}return t.next=14,ma(this._retryTimeout,!this._keepEventLoopActive);case 14:t.next=0;break;case 16:case"end":return t.stop()}}),t,this,[[1,8]])})));return function(){return t.apply(this,arguments)}}()},{key:"_updateLatestBlock",value:function(){var t=Object(o.a)(f.a.mark((function t(){var e;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._fetchLatestBlock();case 2:e=t.sent,this._newPotentialLatest(e);case 4:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"_fetchLatestBlock",value:function(){var t=Object(o.a)(f.a.mark((function t(){var e,r,n=this;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e={jsonrpc:"2.0",id:1,method:"eth_blockNumber",params:[]},this._setSkipCacheFlag&&(e.skipCache=!0),t.next=4,Ui((function(t){return n._provider.sendAsync(e,t)}))();case 4:if(!(r=t.sent).error){t.next=7;break}throw new Error("PollingBlockTracker - encountered error fetching block:\n".concat(r.error));case 7:return t.abrupt("return",r.result);case 8:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()}]),r}(function(t){Object(l.a)(r,t);var e=Object(b.a)(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(s.a)(this,r),(t=e.call(this))._blockResetDuration=n.blockResetDuration||2e4,t._blockResetTimeout,t._currentBlock=null,t._isRunning=!1,t._onNewListener=t._onNewListener.bind(Object(u.a)(t)),t._onRemoveListener=t._onRemoveListener.bind(Object(u.a)(t)),t._resetCurrentBlock=t._resetCurrentBlock.bind(Object(u.a)(t)),t._setupInternalEvents(),t}return Object(c.a)(r,[{key:"isRunning",value:function(){return this._isRunning}},{key:"getCurrentBlock",value:function(){return this._currentBlock}},{key:"getLatestBlock",value:function(){var t=Object(o.a)(f.a.mark((function t(){var e=this;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._currentBlock){t.next=2;break}return t.abrupt("return",this._currentBlock);case 2:return t.next=4,new Promise((function(t){return e.once("latest",t)}));case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"removeAllListeners",value:function(t){t?Object(d.a)(Object(h.a)(r.prototype),"removeAllListeners",this).call(this,t):Object(d.a)(Object(h.a)(r.prototype),"removeAllListeners",this).call(this),this._setupInternalEvents(),this._onRemoveListener()}},{key:"_start",value:function(){}},{key:"_end",value:function(){}},{key:"_setupInternalEvents",value:function(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}},{key:"_onNewListener",value:function(t,e){va.includes(t)&&this._maybeStart()}},{key:"_onRemoveListener",value:function(t,e){this._getBlockTrackerEventCount()>0||this._maybeEnd()}},{key:"_maybeStart",value:function(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),this._start())}},{key:"_maybeEnd",value:function(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),this._end())}},{key:"_getBlockTrackerEventCount",value:function(){var t=this;return va.map((function(e){return t.listenerCount(e)})).reduce(pa)}},{key:"_newPotentialLatest",value:function(t){var e=this._currentBlock;e&&_a(t)<=_a(e)||this._setCurrentBlock(t)}},{key:"_setCurrentBlock",value:function(t){var e=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:e,newBlock:t})}},{key:"_setupBlockResetTimeout",value:function(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}},{key:"_cancelBlockResetTimeout",value:function(){clearTimeout(this._blockResetTimeout)}},{key:"_resetCurrentBlock",value:function(){this._currentBlock=null}}]),r}(da));function ma(t,e){return new Promise((function(r){var n=setTimeout(r,t);n.unref&&e&&n.unref()}))}var ga="object"==typeof p.d&&p.d&&p.d.Object===Object&&p.d,wa="object"==typeof self&&self&&self.Object===Object&&self,Aa=ga||wa||Function("return this")(),Ea=Aa.Symbol,Ia=Object.prototype,Ma=Ia.hasOwnProperty,Sa=Ia.toString,ka=Ea?Ea.toStringTag:void 0,La=Object.prototype.toString,xa=Ea?Ea.toStringTag:void 0,Pa=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":xa&&xa in Object(t)?function(t){var e=Ma.call(t,ka),r=t[ka];try{t[ka]=void 0;var n=!0}catch(t){}var i=Sa.call(t);return n&&(e?t[ka]=r:delete t[ka]),i}(t):function(t){return La.call(t)}(t)},Ta=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},Ra=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},ja=function(t){return null!=t&&Ra(t.length)&&!function(t){if(!Ta(t))return!1;var e=Pa(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}(t)},Oa=Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={},t.exports=e.default}));Object(p.c)(Oa);var Ca=function(){},Ba=Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return function(){if(null!==t){var e=t;t=null,e.apply(this,arguments)}}},t.exports=e.default}));Object(p.c)(Ba);var Na=Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return r&&t[r]&&t[r]()};var r="function"==typeof Symbol&&Symbol.iterator;t.exports=e.default}));Object(p.c)(Na);var za=function(t){return null!=t&&"object"==typeof t},Da=function(t){return za(t)&&"[object Arguments]"==Pa(t)},Ka=Object.prototype,Va=Ka.hasOwnProperty,Ua=Ka.propertyIsEnumerable,qa=Da(function(){return arguments}())?Da:function(t){return za(t)&&Va.call(t,"callee")&&!Ua.call(t,"callee")},Ya=Array.isArray,Fa=function(){return!1},Ha=Object(p.b)((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,i=n&&n.exports===r?Aa.Buffer:void 0,a=(i?i.isBuffer:void 0)||Fa;t.exports=a})),Ga=/^(?:0|[1-9]\d*)$/,Wa=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&Ga.test(t))&&t>-1&&t%1==0&&t2&&(n=(0,i.default)(arguments,1)),o[e]=n,r(t)}))}),(function(t){f(t,o)}))};var r=f(Ca),n=f(ja),i=f(uf),a=f(bf);function f(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default}));Object(p.c)(Mf);var Sf=Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){(0,n.default)(r.default,t,e)};var r=i(_f),n=i(Mf);function i(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default}));Object(p.c)(Sf);var kf=Object(p.b)((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.MAX_INTEGER=new Ie("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),r.TWO_POW256=new Ie("10000000000000000000000000000000000000000000000000000000000000000",16),r.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",r.KECCAK256_NULL=t.from(r.KECCAK256_NULL_S,"hex"),r.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",r.KECCAK256_RLP_ARRAY=t.from(r.KECCAK256_RLP_ARRAY_S,"hex"),r.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",r.KECCAK256_RLP=t.from(r.KECCAK256_RLP_S,"hex")}));Object(p.c)(kf),kf.MAX_INTEGER,kf.TWO_POW256,kf.KECCAK256_NULL_S,kf.KECCAK256_NULL,kf.KECCAK256_RLP_ARRAY_S,kf.KECCAK256_RLP_ARRAY,kf.KECCAK256_RLP_S,kf.KECCAK256_RLP;var Lf=Object(p.b)((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.zeros=function(e){return t.allocUnsafe(e).fill(0)},r.setLengthLeft=function(t,e,n){void 0===n&&(n=!1);var i=r.zeros(e);return t=r.toBuffer(t),n?t.length0&&"0"===e.toString();)e=(t=t.slice(1))[0];return t},r.stripZeros=r.unpad,r.toBuffer=function(e){if(!t.isBuffer(e))if(Array.isArray(e))e=t.from(e);else if("string"==typeof e){if(!Ci.isHexString(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+e);e=t.from(Ci.padToEven(Ci.stripHexPrefix(e)),"hex")}else if("number"==typeof e)e=Ci.intToBuffer(e);else if(null==e)e=t.allocUnsafe(0);else if(Ie.isBN(e))e=e.toArrayLike(t);else{if(!e.toArray)throw new Error("invalid type");e=t.from(e.toArray())}return e},r.bufferToInt=function(t){return new Ie(r.toBuffer(t)).toNumber()},r.bufferToHex=function(t){return"0x"+(t=r.toBuffer(t)).toString("hex")},r.fromSigned=function(t){return new Ie(t).fromTwos(256)},r.toUnsigned=function(e){return t.from(e.toTwos(256).toArray())},r.addHexPrefix=function(t){return"string"!=typeof t||Ci.isHexPrefixed(t)?t:"0x"+t},r.baToJSON=function(e){if(t.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var n=[],i=0;i>>31),l=d^(a<<1|i>>>31),b=t[0]^h,p=t[1]^l,v=t[10]^h,_=t[11]^l,y=t[20]^h,m=t[21]^l,g=t[30]^h,w=t[31]^l,A=t[40]^h,E=t[41]^l;h=r^(f<<1|o>>>31),l=n^(o<<1|f>>>31);var I=t[2]^h,M=t[3]^l,S=t[12]^h,k=t[13]^l,L=t[22]^h,x=t[23]^l,P=t[32]^h,T=t[33]^l,R=t[42]^h,j=t[43]^l;h=i^(s<<1|c>>>31),l=a^(c<<1|s>>>31);var O=t[4]^h,C=t[5]^l,B=t[14]^h,N=t[15]^l,z=t[24]^h,D=t[25]^l,K=t[34]^h,V=t[35]^l,U=t[44]^h,q=t[45]^l;h=f^(u<<1|d>>>31),l=o^(d<<1|u>>>31);var Y=t[6]^h,F=t[7]^l,H=t[16]^h,G=t[17]^l,W=t[26]^h,Z=t[27]^l,J=t[36]^h,X=t[37]^l,$=t[46]^h,Q=t[47]^l;h=s^(r<<1|n>>>31),l=c^(n<<1|r>>>31);var tt=t[8]^h,et=t[9]^l,rt=t[18]^h,nt=t[19]^l,it=t[28]^h,at=t[29]^l,ft=t[38]^h,ot=t[39]^l,st=t[48]^h,ct=t[49]^l,ut=b,dt=p,ht=_<<4|v>>>28,lt=v<<4|_>>>28,bt=y<<3|m>>>29,pt=m<<3|y>>>29,vt=w<<9|g>>>23,_t=g<<9|w>>>23,yt=A<<18|E>>>14,mt=E<<18|A>>>14,gt=I<<1|M>>>31,wt=M<<1|I>>>31,At=k<<12|S>>>20,Et=S<<12|k>>>20,It=L<<10|x>>>22,Mt=x<<10|L>>>22,St=T<<13|P>>>19,kt=P<<13|T>>>19,Lt=R<<2|j>>>30,xt=j<<2|R>>>30,Pt=C<<30|O>>>2,Tt=O<<30|C>>>2,Rt=B<<6|N>>>26,jt=N<<6|B>>>26,Ot=D<<11|z>>>21,Ct=z<<11|D>>>21,Bt=K<<15|V>>>17,Nt=V<<15|K>>>17,zt=q<<29|U>>>3,Dt=U<<29|q>>>3,Kt=Y<<28|F>>>4,Vt=F<<28|Y>>>4,Ut=G<<23|H>>>9,qt=H<<23|G>>>9,Yt=W<<25|Z>>>7,Ft=Z<<25|W>>>7,Ht=J<<21|X>>>11,Gt=X<<21|J>>>11,Wt=Q<<24|$>>>8,Zt=$<<24|Q>>>8,Jt=tt<<27|et>>>5,Xt=et<<27|tt>>>5,$t=rt<<20|nt>>>12,Qt=nt<<20|rt>>>12,te=at<<7|it>>>25,ee=it<<7|at>>>25,re=ft<<8|ot>>>24,ne=ot<<8|ft>>>24,ie=st<<14|ct>>>18,ae=ct<<14|st>>>18;t[0]=ut^~At&Ot,t[1]=dt^~Et&Ct,t[10]=Kt^~$t&bt,t[11]=Vt^~Qt&pt,t[20]=gt^~Rt&Yt,t[21]=wt^~jt&Ft,t[30]=Jt^~ht&It,t[31]=Xt^~lt&Mt,t[40]=Pt^~Ut&te,t[41]=Tt^~qt&ee,t[2]=At^~Ot&Ht,t[3]=Et^~Ct&Gt,t[12]=$t^~bt&St,t[13]=Qt^~pt&kt,t[22]=Rt^~Yt&re,t[23]=jt^~Ft&ne,t[32]=ht^~It&Bt,t[33]=lt^~Mt&Nt,t[42]=Ut^~te&vt,t[43]=qt^~ee&_t,t[4]=Ot^~Ht&ie,t[5]=Ct^~Gt&ae,t[14]=bt^~St&zt,t[15]=pt^~kt&Dt,t[24]=Yt^~re&yt,t[25]=Ft^~ne&mt,t[34]=It^~Bt&Wt,t[35]=Mt^~Nt&Zt,t[44]=te^~vt&Lt,t[45]=ee^~_t&xt,t[6]=Ht^~ie&ut,t[7]=Gt^~ae&dt,t[16]=St^~zt&Kt,t[17]=kt^~Dt&Vt,t[26]=re^~yt>,t[27]=ne^~mt&wt,t[36]=Bt^~Wt&Jt,t[37]=Nt^~Zt&Xt,t[46]=vt^~Lt&Pt,t[47]=_t^~xt&Tt,t[8]=ie^~ut&At,t[9]=ae^~dt&Et,t[18]=zt^~Kt&$t,t[19]=Dt^~Vt&Qt,t[28]=yt^~gt&Rt,t[29]=mt^~wt&jt,t[38]=Wt^~Jt&ht,t[39]=Zt^~Xt<,t[48]=Lt^~Pt&Ut,t[49]=xt^~Tt&qt,t[0]^=jf[2*e],t[1]^=jf[2*e+1]}},Cf=y.Buffer;function Bf(){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}Bf.prototype.initialize=function(t,e){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1},Bf.prototype.absorb=function(t){for(var e=0;e>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(Of(this.state),this.count=0);return e},Bf.prototype.copy=function(t){for(var e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var Nf=function(t){var e=function(t){function e(e,r,n,i,a){Pf.call(this,a),this._rate=e,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=i,this._options=a,this._state=new t,this._state.initialize(e,r),this._finalized=!1}return m(e,Pf),e.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},e.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},e.prototype.update=function(t,e){if(!xf.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return xf.isBuffer(t)||(t=xf.from(t,e)),this._state.absorb(t),this},e.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var e=this._state.squeeze(this._hashBitLength/8);return void 0!==t&&(e=e.toString(t)),this._resetState(),e},e.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},e.prototype._clone=function(){var t=new e(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t},e}(t),r=function(t){function e(e,r,n,i){Rf.call(this,i),this._rate=e,this._capacity=r,this._delimitedSuffix=n,this._options=i,this._state=new t,this._state.initialize(e,r),this._finalized=!1}return m(e,Rf),e.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},e.prototype._flush=function(){},e.prototype._read=function(t){this.push(this.squeeze(t))},e.prototype.update=function(t,e){if(!Tf.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Tf.isBuffer(t)||(t=Tf.from(t,e)),this._state.absorb(t),this},e.prototype.squeeze=function(t,e){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(t);return void 0!==e&&(r=r.toString(e)),r},e.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},e.prototype._clone=function(){var t=new e(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t},e}(t);return function(t,n){switch("string"==typeof t?t.toLowerCase():t){case"keccak224":return new e(1152,448,null,224,n);case"keccak256":return new e(1088,512,null,256,n);case"keccak384":return new e(832,768,null,384,n);case"keccak512":return new e(576,1024,null,512,n);case"sha3-224":return new e(1152,448,6,224,n);case"sha3-256":return new e(1088,512,6,256,n);case"sha3-384":return new e(832,768,6,384,n);case"sha3-512":return new e(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+t)}}}(Bf),zf=Object(p.b)((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.keccak=function(e,r){return void 0===r&&(r=256),e="string"!=typeof e||Ci.isHexString(e)?Lf.toBuffer(e):t.from(e,"utf8"),r||(r=256),Nf("keccak"+r).update(e).digest()},r.keccak256=function(t){return r.keccak(t)},r.sha256=function(t){return t=Lf.toBuffer(t),Ee("sha256").update(t).digest()},r.ripemd160=function(t,e){t=Lf.toBuffer(t);var r=Ee("rmd160").update(t).digest();return!0===e?Lf.setLength(r,32):r},r.rlphash=function(t){return r.keccak(Pi.encode(t))}}));Object(p.c)(zf),zf.keccak,zf.keccak256,zf.sha256,zf.ripemd160,zf.rlphash;var Df=Object(p.b)((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.zeroAddress=function(){var t=Lf.zeros(20);return Lf.bufferToHex(t)},r.isValidAddress=function(t){return/^0x[0-9a-fA-F]{40}$/.test(t)},r.isZeroAddress=function(t){return r.zeroAddress()===Lf.addHexPrefix(t)},r.toChecksumAddress=function(t,e){t=Ci.stripHexPrefix(t).toLowerCase();for(var r=void 0!==e?e.toString()+"0x":"",n=zf.keccak(r+t).toString("hex"),i="0x",a=0;a=8?i+=t[a].toUpperCase():i+=t[a];return i},r.isValidChecksumAddress=function(t,e){return r.isValidAddress(t)&&r.toChecksumAddress(t,e)===t},r.generateAddress=function(e,r){e=Lf.toBuffer(e);var n=new Ie(r);return n.isZero()?zf.rlphash([e,null]).slice(-20):zf.rlphash([e,t.from(n.toArray())]).slice(-20)},r.generateAddress2=function(e,r,n){var i=Lf.toBuffer(e),a=Lf.toBuffer(r),f=Lf.toBuffer(n);return Object(_.b)(20===i.length),Object(_.b)(32===a.length),zf.keccak256(t.concat([t.from("ff","hex"),i,a,zf.keccak256(f)])).slice(-20)},r.isPrecompiled=function(t){var e=Lf.unpad(t);return 1===e.length&&e[0]>=1&&e[0]<=8},r.isValidPrivate=function(t){return xi.privateKeyVerify(t)},r.isValidPublic=function(e,r){return void 0===r&&(r=!1),64===e.length?xi.publicKeyVerify(t.concat([t.from([4]),e])):!!r&&xi.publicKeyVerify(e)},r.pubToAddress=function(t,e){return void 0===e&&(e=!1),t=Lf.toBuffer(t),e&&64!==t.length&&(t=xi.publicKeyConvert(t,!1).slice(1)),Object(_.b)(64===t.length),zf.keccak(t).slice(-20)},r.publicToAddress=r.pubToAddress,r.privateToAddress=function(t){return r.publicToAddress(r.privateToPublic(t))},r.privateToPublic=function(t){return t=Lf.toBuffer(t),xi.publicKeyCreate(t,!1).slice(1)},r.importPublic=function(t){return 64!==(t=Lf.toBuffer(t)).length&&(t=xi.publicKeyConvert(t,!1).slice(1)),t}}));Object(p.c)(Df),Df.zeroAddress,Df.isValidAddress,Df.isZeroAddress,Df.toChecksumAddress,Df.isValidChecksumAddress,Df.generateAddress,Df.generateAddress2,Df.isPrecompiled,Df.isValidPrivate,Df.isValidPublic,Df.pubToAddress,Df.publicToAddress,Df.privateToAddress,Df.privateToPublic,Df.importPublic;var Kf=Object(p.b)((function(e,r){function n(t,e){return e?t-(2*e+35):t-27}function i(t){return 0===t||1===t}Object.defineProperty(r,"__esModule",{value:!0}),r.ecsign=function(t,e,r){var n=xi.sign(t,e),i=n.recovery;return{r:n.signature.slice(0,32),s:n.signature.slice(32,64),v:r?i+(2*r+35):i+27}},r.ecrecover=function(e,r,a,f,o){var s=t.concat([Lf.setLength(a,32),Lf.setLength(f,32)],64),c=n(r,o);if(!i(c))throw new Error("Invalid signature v value");var u=xi.recover(e,s,c);return xi.publicKeyConvert(u,!1).slice(1)},r.toRpcSig=function(e,r,a,f){if(!i(n(e,f)))throw new Error("Invalid signature v value");return Lf.bufferToHex(t.concat([Lf.setLengthLeft(r,32),Lf.setLengthLeft(a,32),Lf.toBuffer(e)]))},r.fromRpcSig=function(t){var e=Lf.toBuffer(t);if(65!==e.length)throw new Error("Invalid signature length");var r=e[64];return r<27&&(r+=27),{v:r,r:e.slice(0,32),s:e.slice(32,64)}},r.isValidSignature=function(t,e,r,a,f){void 0===a&&(a=!0);var o=new Ie("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),s=new Ie("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==e.length||32!==r.length)return!1;if(!i(n(t,f)))return!1;var c=new Ie(e),u=new Ie(r);return!(c.isZero()||c.gt(s)||u.isZero()||u.gt(s))&&(!a||1!==u.cmp(o))},r.hashPersonalMessage=function(e){var r=t.from("\x19Ethereum Signed Message:\n"+e.length.toString(),"utf-8");return zf.keccak(t.concat([r,e]))}}));Object(p.c)(Kf),Kf.ecsign,Kf.ecrecover,Kf.toRpcSig,Kf.fromRpcSig,Kf.isValidSignature,Kf.hashPersonalMessage;var Vf=Object(p.b)((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.defineProperties=function(e,r,n){if(e.raw=[],e._fields=[],e.toJSON=function(t){if(void 0===t&&(t=!1),t){var r={};return e._fields.forEach((function(t){r[t]="0x"+e[t].toString("hex")})),r}return Lf.baToJSON(e.raw)},e.serialize=function(){return Pi.encode(e.raw)},r.forEach((function(r,n){function i(){return e.raw[n]}function a(i){"00"!==(i=Lf.toBuffer(i)).toString("hex")||r.allowZero||(i=t.allocUnsafe(0)),r.allowLess&&r.length?(i=Lf.stripZeros(i),Object(_.b)(r.length>=i.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===i.length||!r.length||Object(_.b)(r.length===i.length,"The field "+r.name+" must have byte length of "+r.length),e.raw[n]=i}e._fields.push(r.name),Object.defineProperty(e,r.name,{enumerable:!0,configurable:!0,get:i,set:a}),r.default&&(e[r.name]=r.default),r.alias&&Object.defineProperty(e,r.alias,{enumerable:!1,configurable:!0,set:a,get:i})})),n)if("string"==typeof n&&(n=t.from(Ci.stripHexPrefix(n),"hex")),t.isBuffer(n)&&(n=Pi.decode(n)),Array.isArray(n)){if(n.length>e._fields.length)throw new Error("wrong number of fields in data");n.forEach((function(t,r){e[e._fields[r]]=Lf.toBuffer(t)}))}else{if("object"!=typeof n)throw new Error("invalid data");var i=Object.keys(n);r.forEach((function(t){-1!==i.indexOf(t.name)&&(e[t.name]=n[t.name]),-1!==i.indexOf(t.alias)&&(e[t.alias]=n[t.alias])}))}}}));Object(p.c)(Vf),Vf.defineProperties;var Uf=Object(p.b)((function(t,e){function r(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),e.secp256k1=xi,e.BN=Ie,e.rlp=Pi,Object.assign(e,Ci),r(kf),r(Df),r(zf),r(Kf),r(Lf),r(Vf)}));Object(p.c)(Uf),Uf.secp256k1,Uf.BN,Uf.rlp;var qf=function(){};function Yf(t){return t.startsWith("int[")?"int256"+t.slice(3):"int"===t?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):"uint"===t?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):"fixed"===t?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):"ufixed"===t?"ufixed128x128":t}function Ff(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function Hf(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function Gf(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?""===e[2]?"dynamic":parseInt(e[2],10):null}function Wf(t){var e=typeof t;if("string"===e)return Uf.isHexPrefixed(t)?new Ie(Uf.stripHexPrefix(t),16):new Ie(t,10);if("number"===e)return new Ie(t);if(t.toArray)return t;throw new Error("Argument is not a number")}function Zf(t){var e=/^(\w+)\((.*)\)$/.exec(t);if(3!==e.length)throw new Error("Invalid method signature");var r=/^(.+)\):\((.+)$/.exec(e[2]);if(null!==r&&3===r.length)return{method:e[1],args:r[1].split(","),retargs:r[2].split(",")};var n=e[2].split(",");return 1===n.length&&""===n[0]&&(n=[]),{method:e[1],args:n}}function Jf(e,r){var n,i,a,f;if("address"===e)return Jf("uint160",Wf(r));if("bool"===e)return Jf("uint8",r?1:0);if("string"===e)return Jf("bytes",t.from(r,"utf8"));if(to(e)){if(void 0===r.length)throw new Error("Not an array?");if("dynamic"!==(n=Gf(e))&&0!==n&&r.length>n)throw new Error("Elements exceed array size: "+n);for(f in a=[],e=e.slice(0,e.lastIndexOf("[")),"string"==typeof r&&(r=JSON.parse(r)),r)a.push(Jf(e,r[f]));if("dynamic"===n){var o=Jf("uint256",r.length);a.unshift(o)}return t.concat(a)}if("bytes"===e)return r=t.from(r),a=t.concat([Jf("uint256",r.length),r]),r.length%32!=0&&(a=t.concat([a,Uf.zeros(32-r.length%32)])),a;if(e.startsWith("bytes")){if((n=Ff(e))<1||n>32)throw new Error("Invalid bytes width: "+n);return Uf.setLengthRight(r,32)}if(e.startsWith("uint")){if((n=Ff(e))%8||n<8||n>256)throw new Error("Invalid uint width: "+n);if((i=Wf(r)).bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+i.bitLength());if(i<0)throw new Error("Supplied uint is negative");return i.toArrayLike(t,"be",32)}if(e.startsWith("int")){if((n=Ff(e))%8||n<8||n>256)throw new Error("Invalid int width: "+n);if((i=Wf(r)).bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+i.bitLength());return i.toTwos(256).toArrayLike(t,"be",32)}if(e.startsWith("ufixed")){if(n=Hf(e),(i=Wf(r))<0)throw new Error("Supplied ufixed is negative");return Jf("uint256",i.mul(new Ie(2).pow(new Ie(n[1]))))}if(e.startsWith("fixed"))return n=Hf(e),Jf("int256",Wf(r).mul(new Ie(2).pow(new Ie(n[1]))));throw new Error("Unsupported or invalid type: "+e)}function Xf(e,r,n){var i,a,f,o;if("string"==typeof e&&(e=$f(e)),"address"===e.name)return Xf(e.rawType,r,n).toArrayLike(t,"be",20).toString("hex");if("bool"===e.name)return Xf(e.rawType,r,n).toString()===new Ie(1).toString();if("string"===e.name){var s=Xf(e.rawType,r,n);return t.from(s,"utf8").toString()}if(e.isArray){for(f=[],i=e.size,"dynamic"===e.size&&(n=Xf("uint256",r,n).toNumber(),i=Xf("uint256",r,n).toNumber(),n+=32),o=0;oe.size)throw new Error("Decoded int exceeds width: "+e.size+" vs "+a.bitLength());return a}if(e.name.startsWith("int")){if((a=new Ie(r.slice(n,n+32),16,"be").fromTwos(256)).bitLength()>e.size)throw new Error("Decoded uint exceeds width: "+e.size+" vs "+a.bitLength());return a}if(e.name.startsWith("ufixed")){if(i=new Ie(2).pow(new Ie(e.size[1])),!(a=Xf("uint256",r,n)).mod(i).isZero())throw new Error("Decimals not supported yet");return a.div(i)}if(e.name.startsWith("fixed")){if(i=new Ie(2).pow(new Ie(e.size[1])),!(a=Xf("int256",r,n)).mod(i).isZero())throw new Error("Decimals not supported yet");return a.div(i)}throw new Error("Unsupported or invalid type: "+e.name)}function $f(t){var e,r,n;if(to(t)){e=Gf(t);var i=t.slice(0,t.lastIndexOf("["));return i=$f(i),{isArray:!0,name:t,size:e,memoryUsage:"dynamic"===e?32:i.memoryUsage*e,subArray:i}}switch(t){case"address":n="uint160";break;case"bool":n="uint8";break;case"string":n="bytes"}if(r={rawType:n,name:t,memoryUsage:32},t.startsWith("bytes")&&"bytes"!==t||t.startsWith("uint")||t.startsWith("int")?r.size=Ff(t):(t.startsWith("ufixed")||t.startsWith("fixed"))&&(r.size=Hf(t)),t.startsWith("bytes")&&"bytes"!==t&&(r.size<1||r.size>32))throw new Error("Invalid bytes width: "+r.size);if((t.startsWith("uint")||t.startsWith("int"))&&(r.size%8||r.size<8||r.size>256))throw new Error("Invalid int/uint width: "+r.size);return r}function Qf(t){return"string"===t||"bytes"===t||"dynamic"===Gf(t)}function to(t){return t.lastIndexOf("]")===t.length-1}function eo(t,e){return t.startsWith("address")||t.startsWith("bytes")?"0x"+e.toString("hex"):e.toString()}qf.eventID=function(e,r){var n=e+"("+r.map(Yf).join(",")+")";return Uf.keccak256(t.from(n))},qf.methodID=function(t,e){return qf.eventID(t,e).slice(0,4)},qf.rawEncode=function(e,r){var n=[],i=[],a=0;e.forEach((function(t){if(to(t)){var e=Gf(t);a+="dynamic"!==e?32*e:32}else a+=32}));for(var f=0;fo)throw new Error("Elements exceed array size: "+o)}var s=r.map((function(t){return qf.solidityHexValue(f,t,256)}));return t.concat(s)}if("bytes"===e)return r;if("string"===e)return t.from(r,"utf8");if("bool"===e){n=n||8;var c=Array(n/4).join("0");return t.from(r?c+"1":c+"0","hex")}if("address"===e){var u=20;return n&&(u=n/8),Uf.setLengthLeft(r,u)}if(e.startsWith("bytes")){if((i=Ff(e))<1||i>32)throw new Error("Invalid bytes width: "+i);return Uf.setLengthRight(r,i)}if(e.startsWith("uint")){if((i=Ff(e))%8||i<8||i>256)throw new Error("Invalid uint width: "+i);if((a=Wf(r)).bitLength()>i)throw new Error("Supplied uint exceeds width: "+i+" vs "+a.bitLength());return n=n||i,a.toArrayLike(t,"be",n/8)}if(e.startsWith("int")){if((i=Ff(e))%8||i<8||i>256)throw new Error("Invalid int width: "+i);if((a=Wf(r)).bitLength()>i)throw new Error("Supplied int exceeds width: "+i+" vs "+a.bitLength());return n=n||i,a.toTwos(i).toArrayLike(t,"be",n/8)}throw new Error("Unsupported or invalid type: "+e)},qf.solidityPack=function(e,r){if(e.length!==r.length)throw new Error("Number of types are not matching the values");for(var n=[],i=0;i="0"&&e<="9";)a+=t[f]-"0",f++;n=f-1,r.push(a)}else if("i"===i)r.push("int256");else{if("a"!==i)throw new Error("Unsupported or invalid type: "+i);r.push("int256[]")}}return r},qf.toSerpent=function(t){for(var e=[],r=0;r=2&&("function"==typeof arguments[1]?r.task=arguments[1]:r.n=arguments[1]);var n=r.task;if(r.task=function(){n(e.leave)},e.current+r.n-t>e.capacity)return 1===t&&(e.current--,e.firstHere=!1),e.queue.push(r);e.current+=r.n-t,r.task(e.leave),1===t&&(e.firstHere=!1)},leave:function(t){if(t=t||1,e.current-=t,e.queue.length){var n=e.queue[0];n.n+e.current>e.capacity||(e.queue.shift(),e.current+=n.n,r(n.task))}else if(e.current<0)throw new Error("leave called too many times.")},available:function(t){return t=t||1,e.current+t<=e.capacity}};return e}})),co=function(t){return function(e,r,n,i){var a=t[e.method];return void 0===a?n():"function"==typeof a?a(e,r,n,i):(r.result=a,void i())}},uo=Object.prototype.toString,ho="function"==typeof n?n:function(){var t=[].slice.apply(arguments);t.splice(1,0,0),setTimeout.apply(null,t)},lo=function(t){if(e=t.then,"[object Function]"!==uo.call(e))throw new TypeError("Expected a promise");var e;return function(e){t.then((function(t){ho(e,null,t)}),(function(t){ho(e,t)}))}},bo=function(t){return function(e,r,n,i){var a=null,s=t(e,r,Object(o.a)(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=new Promise((function(t){n((function(e){return t(e)}))})),t.next=3,a;case 3:return t.abrupt("return",void t.sent);case 4:case"end":return t.stop()}}),t)}))));lo(s)((function(t){a?lo(a)((function(e,r){if(e)return console.error(e),i(e);r(t)})):i(t)}))}},po=function(){function t(e){Object(s.a)(this,t),this.tasks=[],this.count=e}return Object(c.a)(t,[{key:"sched",value:function(){if(this.count>0&&this.tasks.length>0){this.count--;var t=this.tasks.shift();if(void 0===t)throw"Unexpected undefined value in tasks list";t()}}},{key:"acquire",value:function(){var t=this;return new Promise((function(e,r){t.tasks.push((function(){var r=!1;e((function(){r||(r=!0,t.count++,t.sched())}))})),i&&i.nextTick?i.nextTick(t.sched.bind(t)):n(t.sched.bind(t))}))}},{key:"use",value:function(t){return this.acquire().then((function(e){return t().then((function(t){return e(),t})).catch((function(t){throw e(),t}))}))}}]),t}(),vo={Semaphore:po,Mutex:function(t){Object(l.a)(r,t);var e=Object(b.a)(r);function r(){return Object(s.a)(this,r),e.call(this,1)}return r}(po)},_o=function(t){Object(l.a)(r,t);var e=Object(b.a)(r);function r(){var t;return Object(s.a)(this,r),(t=e.call(this)).updates=[],t}return Object(c.a)(r,[{key:"initialize",value:function(){var t=Object(o.a)(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()},{key:"update",value:function(){var t=Object(o.a)(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error("BaseFilter - no update method specified");case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()},{key:"addResults",value:function(t){var e=this;this.updates=this.updates.concat(t),t.forEach((function(t){return e.emit("update",t)}))}},{key:"addInitialResults",value:function(t){}},{key:"getChangesAndClear",value:function(){var t=this.updates;return this.updates=[],t}}]),r}(da),yo=function(){for(var t=arguments.length,e=new Array(t),r=0;r=ko(t.blockNumber))return!1;if(Po(this.params.toBlock)&&ko(this.params.toBlock)<=ko(t.blockNumber))return!1;var e=t.address&&t.address.toLowerCase();return!(this.params.address&&e&&!this.params.address.includes(e))&&this.params.topics.every((function(e,r){var n=t.topics[r];if(!n)return!1;n=n.toLowerCase();var i=Array.isArray(e)?e:[e];return!!i.includes(null)||(i=i.map((function(t){return t.toLowerCase()}))).includes(n)}))}}]),r}(function(t){Object(l.a)(r,t);var e=Object(b.a)(r);function r(){var t;return Object(s.a)(this,r),(t=e.call(this)).allResults=[],t}return Object(c.a)(r,[{key:"update",value:function(){var t=Object(o.a)(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error("BaseFilterWithHistory - no update method specified");case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()},{key:"addResults",value:function(t){this.allResults=this.allResults.concat(t),Object(d.a)(Object(h.a)(r.prototype),"addResults",this).call(this,t)}},{key:"addInitialResults",value:function(t){this.allResults=this.allResults.concat(t),Object(d.a)(Object(h.a)(r.prototype),"addInitialResults",this).call(this,t)}},{key:"getAllResults",value:function(){return this.allResults}}]),r}(_o)),Ro=function(){var t=Object(o.a)(f.a.mark((function t(e){var r,n,i,a,o,s;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.provider,n=e.fromBlock,i=e.toBlock,n||(n=i),a=jo(n),o=jo(i),s=Array(o-a+1).fill().map((function(t,e){return a+e})).map(Oo),t.next=5,Promise.all(s.map((function(t){return function(t,e,r){return new Promise((function(e,n){t.sendAsync({id:1,jsonrpc:"2.0",method:"eth_getBlockByNumber",params:r},(function(t,r){if(t)return n(t);e(r.result)}))}))}(r,0,[t,!1])})));case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();function jo(t){return null==t?t:Number.parseInt(t,16)}function Oo(t){return null==t?t:"0x"+t.toString(16)}var Co=go,Bo=function(t){Object(l.a)(r,t);var e=Object(b.a)(r);function r(t){var n,i=t.provider;t.params;return Object(s.a)(this,r),(n=e.call(this)).type="block",n.provider=i,n}return Object(c.a)(r,[{key:"update",value:function(){var t=Object(o.a)(f.a.mark((function t(e){var r,n,i,a,o;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.oldBlock,n=e.newBlock,i=n,a=Co(r),t.next=5,Ro({provider:this.provider,fromBlock:a,toBlock:i});case 5:o=t.sent.map((function(t){return t.hash})),this.addResults(o);case 7:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()}]),r}(_o),No=Object(p.b)((function(t,e){var r="[object Arguments]",n="[object Map]",i="[object Object]",a="[object Set]",f=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/,s=/^\./,c=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,u=/\\(\\)?/g,d=/^\[object .+?Constructor\]$/,h=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[r]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l["[object Function]"]=l[n]=l["[object Number]"]=l[i]=l["[object RegExp]"]=l[a]=l["[object String]"]=l["[object WeakMap]"]=!1;var b="object"==typeof p.d&&p.d&&p.d.Object===Object&&p.d,v="object"==typeof self&&self&&self.Object===Object&&self,_=b||v||Function("return this")(),y=e&&!e.nodeType&&e,m=y&&t&&!t.nodeType&&t,g=m&&m.exports===y&&b.process,w=function(){try{return g&&g.binding("util")}catch(t){}}(),A=w&&w.isTypedArray;function E(t,e){for(var r=-1,n=t?t.length:0,i=Array(n);++r-1},st.prototype.set=function(t,e){var r=this.__data__,n=ht(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},ct.prototype.clear=function(){this.__data__={hash:new ot,map:new(W||st),string:new ot}},ct.prototype.delete=function(t){return At(this,t).delete(t)},ct.prototype.get=function(t){return At(this,t).get(t)},ct.prototype.has=function(t){return At(this,t).has(t)},ct.prototype.set=function(t,e){return At(this,t).set(t,e),this},ut.prototype.add=ut.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},ut.prototype.has=function(t){return this.__data__.has(t)},dt.prototype.clear=function(){this.__data__=new st},dt.prototype.delete=function(t){return this.__data__.delete(t)},dt.prototype.get=function(t){return this.__data__.get(t)},dt.prototype.has=function(t){return this.__data__.has(t)},dt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof st){var n=r.__data__;if(!W||n.length<199)return n.push([t,e]),this;r=this.__data__=new ct(n)}return r.set(t,e),this};var lt,bt=(lt=function(t,e){return t&&pt(t,e,Yt)},function(t,e){if(null==t)return t;if(!Nt(t))return lt(t,e);for(var r=t.length,n=-1,i=Object(t);++no))return!1;var c=a.get(t);if(c&&a.get(e))return c==e;var u=-1,d=!0,h=1&i?new ut:void 0;for(a.set(t,e),a.set(e,t);++u-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991}function Kt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Vt(t){return!!t&&"object"==typeof t}function Ut(t){return"symbol"==typeof t||Vt(t)&&"[object Symbol]"==D.call(t)}var qt=A?function(t){return function(e){return t(e)}}(A):function(t){return Vt(t)&&Dt(t.length)&&!!l[D.call(t)]};function Yt(t){return Nt(t)?function(t,e){var r=Bt(t)||Ct(t)?function(t,e){for(var r=-1,n=Array(t);++r0&&n(s)?r>1?t(s,r-1,n,i,a):I(a,s):i||(a[a.length]=s)}return a}(function(t,e){return(Bt(t)?E:mt)(t,function(t){return"function"==typeof t?t:null==t?Ft:"object"==typeof t?Bt(t)?function(t,e){return kt(t)&&Lt(e)?xt(Tt(t),e):function(r){var n=function(t,e,r){var n=null==t?void 0:vt(t,e);return void 0===n?void 0:n}(r,t);return void 0===n&&n===e?function(t,e){return null!=t&&function(t,e,r){for(var n,i=-1,a=(e=kt(e,t)?[e]:gt(e)).length;++i0?e.on("sync",u):r>0&&0===n&&e.removeListener("sync",u)}};function Yo(t){return Fo(Object(o.a)(f.a.mark((function e(){var r,n=arguments;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.apply(void 0,n);case 2:return r=e.sent,e.abrupt("return",Vo(r.id));case 4:case"end":return e.stop()}}),e)}))))}function Fo(t){return bo(function(){var e=Object(o.a)(f.a.mark((function e(r,n){var i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.apply(null,r.params);case 2:i=e.sent,n.result=i;case 4:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}())}function Ho(t,e){var r=[];for(var n in t)r.push(t[n]);return r}var Go=Ao,Wo=go,Zo=function(t){var e=t.blockTracker,r=t.provider,n={},i=qo({blockTracker:e,provider:r}),a=!1,s=new da,c=co({eth_subscribe:bo(function(){var t=Object(o.a)(f.a.mark((function t(s,c){var d,h,l,b,p;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!a){t.next=2;break}throw new Error("SubscriptionManager - attempting to use after destroying");case 2:d=s.params[0],h=Go(16),t.t0=d,t.next="newHeads"===t.t0?6:"logs"===t.t0?8:14;break;case 6:return l=function(t){var n=t.subId,i={type:d,destroy:function(){var t=Object(o.a)(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.removeListener("sync",i.update);case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),update:function(){var t=Object(o.a)(f.a.mark((function t(e){var i,a,o,s;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.oldBlock,a=e.newBlock,o=a,s=Wo(i),t.next=4,Ro({provider:r,fromBlock:s,toBlock:o});case 4:t.sent.map(Jo).forEach((function(t){u(n,t)}));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()};return e.on("sync",i.update),i}({subId:h}),t.abrupt("break",15);case 8:return b=s.params[1],t.next=11,i.newLogFilter(b);case 11:return p=t.sent,l=function(t){var e=t.subId,r=t.filter;return r.on("update",(function(t){return u(e,t)})),{type:d,destroy:function(){var t=Object(o.a)(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.uninstallFilter(r.idHex);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()}}({subId:h,filter:p}),t.abrupt("break",15);case 14:throw new Error('SubscriptionManager - unsupported subscription type "'.concat(d,'"'));case 15:return t.abrupt("return",(n[h]=l,void(c.result=h)));case 16:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()),eth_unsubscribe:bo(function(){var t=Object(o.a)(f.a.mark((function t(e,r){var i,o;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!a){t.next=2;break}throw new Error("SubscriptionManager - attempting to use after destroying");case 2:if(i=e.params[0],o=n[i]){t.next=5;break}return t.abrupt("return",void(r.result=!1));case 5:return delete n[i],t.next=8,o.destroy();case 8:r.result=!0;case 9:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}())});return c.destroy=function(){for(var t in s.removeAllListeners(),n)n[t].destroy(),delete n[t];a=!0},{events:s,middleware:c};function u(t,e){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:t,result:e}})}};function Jo(t){return{hash:t.hash,parentHash:t.parentHash,sha3Uncles:t.sha3Uncles,miner:t.miner,stateRoot:t.stateRoot,transactionsRoot:t.transactionsRoot,receiptsRoot:t.receiptsRoot,logsBloom:t.logsBloom,difficulty:t.difficulty,number:t.number,gasLimit:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}}).call(this,r(52).Buffer,r(451).setImmediate,r(90))}}]); \ No newline at end of file diff --git a/static/js/10.920cd77d.chunk.js b/bridge/static/js/10.38a242e1.chunk.js similarity index 99% rename from static/js/10.920cd77d.chunk.js rename to bridge/static/js/10.38a242e1.chunk.js index 9d78f6b..1480593 100644 --- a/static/js/10.920cd77d.chunk.js +++ b/bridge/static/js/10.38a242e1.chunk.js @@ -1,2 +1,2 @@ -/*! For license information please see 10.920cd77d.chunk.js.LICENSE.txt */ -(this.webpackJsonpbridge=this.webpackJsonpbridge||[]).push([[10],{718:function(e,t,r){"use strict";r.r(t),function(e,n,i){r.d(t,"__moduleExports",(function(){return kg}));var o=r(186),a=r(22),s=r(83),c=r(55),u=r(48),f=r(32),h=r(33),d=r(21),l=r(30),p=r(38),b=r(36),v=r(101),g=r(12),m=r.n(g),y=r(712),A=(r(0),r(328),r(73),r(52),r(735)),w=(r(372),r(371),r(734)),E=(r(724),r(10),r(448),r(111),r(759)),S=r(163),M=r.n(S),k=r(187),R=r.n(k),O=r(873),x=r.n(O),I=function(e,t){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},_=function(){return(_=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function T(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function L(e){return this instanceof L?(this.v=e,this):new L(e)}var B=Object.freeze({__proto__:null,__extends:function(e,t){function r(){this.constructor=e}I(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},get __assign(){return _},__rest:function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},__param:function(e,t){return function(r,n){t(r,n,e)}},__metadata:function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__awaiter:function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(a,s)}c((n=n.apply(e,t||[])).next())}))},__generator:function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1||s(e,t)}))})}function s(e,t){try{!function(e){e.value instanceof L?Promise.resolve(e.value.v).then(c,u):f(o[0][2],e)}(i[e](t))}catch(e){f(o[0][3],e)}}function c(e){s("next",e)}function u(e){s("throw",e)}function f(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}},__asyncDelegator:function(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:L(e[n](t)),done:"return"===n}:i?i(t):t}:i}},__asyncValues:function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=C(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,i,(t=e[r](t)).done,t.value)}))}}},__makeTemplateObject:function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},__importStar:function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t},__importDefault:function(e){return e&&e.__esModule?e:{default:e}},__classPrivateFieldGet:function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)},__classPrivateFieldSet:function(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}}),N=Object(y.b)((function(e,t){function r(e){var t=void 0;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function n(e){var t=r(e);if(!t)throw new Error("".concat(e," is not defined in Window"));return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getFromWindow=r,t.getFromWindowOrThrow=n,t.getDocumentOrThrow=function(){return n("document")},t.getDocument=function(){return r("document")},t.getNavigatorOrThrow=function(){return n("navigator")},t.getNavigator=function(){return r("navigator")},t.getLocationOrThrow=function(){return n("location")},t.getLocation=function(){return r("location")},t.getCryptoOrThrow=function(){return n("crypto")},t.getCrypto=function(){return r("crypto")},t.getLocalStorageOrThrow=function(){return n("localStorage")},t.getLocalStorage=function(){return r("localStorage")}}));Object(y.c)(N),N.getFromWindow,N.getFromWindowOrThrow,N.getDocumentOrThrow,N.getDocument,N.getNavigatorOrThrow,N.getNavigator,N.getLocationOrThrow,N.getLocation,N.getCryptoOrThrow,N.getCrypto,N.getLocalStorageOrThrow,N.getLocalStorage;var P=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getWindowMetadata=function(){var e,t;try{e=N.getDocumentOrThrow(),t=N.getLocationOrThrow()}catch(e){return null}function r(){for(var t=arguments.length,r=new Array(t),n=0;n-1){var s=o.getAttribute("href");if(s)if(-1===s.toLowerCase().indexOf("https:")&&-1===s.toLowerCase().indexOf("http:")&&0!==s.indexOf("//")){var c=t.protocol+"//"+t.host;if(0===s.indexOf("/"))c+=s;else{var u=t.pathname.split("/");u.pop(),c+=u.join("/")+"/"+s}n.push(c)}else if(0===s.indexOf("//")){var f=t.protocol+s;n.push(f)}else n.push(s)}}return n}(),name:n}}}));Object(y.c)(P),P.getWindowMetadata;var j=Object(y.b)((function(e,t){function r(e){var t=void 0;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function n(e){var t=r(e);if(!t)throw new Error("".concat(e," is not defined in Window"));return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getFromWindow=r,t.getFromWindowOrThrow=n,t.getDocumentOrThrow=function(){return n("document")},t.getDocument=function(){return r("document")},t.getNavigatorOrThrow=function(){return n("navigator")},t.getNavigator=function(){return r("navigator")},t.getLocationOrThrow=function(){return n("location")},t.getLocation=function(){return r("location")},t.getCryptoOrThrow=function(){return n("crypto")},t.getCrypto=function(){return r("crypto")},t.getLocalStorageOrThrow=function(){return n("localStorage")},t.getLocalStorage=function(){return r("localStorage")}}));Object(y.c)(j),j.getFromWindow,j.getFromWindowOrThrow,j.getDocumentOrThrow,j.getDocument,j.getNavigatorOrThrow,j.getNavigator,j.getLocationOrThrow,j.getLocation,j.getCryptoOrThrow,j.getCrypto,j.getLocalStorageOrThrow,j.getLocalStorage;var D=Object(y.b)((function(t,r){var n=y.d&&y.d.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function s(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},i.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=a(e,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==t&&(i=a(e,t,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,c=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var c=["","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"],u=[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],f=[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];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,h=67108863&c,d=Math.min(u,t.length-1),l=Math.max(0,u-e.length+1);l<=d;l++){var p=u-l|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[l])+h)/67108864|0,h=67108863&a}r.words[u]=0|h,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?c[6-h.length]+h+n:h+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var d=u[e],l=f[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(e);n=(p=p.idivn(l)).isZero()?b+n:c[d-b.length]+b+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===t,u=new e(o),f=this.clone();if(c){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),u[s]=a;for(;s=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},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,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},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,l=0|a[1],p=8191&l,b=l>>>13,v=0|a[2],g=8191&v,m=v>>>13,y=0|a[3],A=8191&y,w=y>>>13,E=0|a[4],S=8191&E,M=E>>>13,k=0|a[5],R=8191&k,O=k>>>13,x=0|a[6],I=8191&x,_=x>>>13,C=0|a[7],T=8191&C,L=C>>>13,B=0|a[8],N=8191&B,P=B>>>13,j=0|a[9],D=8191&j,H=j>>>13,z=0|s[0],G=8191&z,F=z>>>13,W=0|s[1],Y=8191&W,U=W>>>13,K=0|s[2],V=8191&K,Z=K>>>13,q=0|s[3],X=8191&q,J=q>>>13,Q=0|s[4],$=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],he=8191&fe,de=fe>>>13,le=0|s[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ve=(u+(n=Math.imul(h,G))|0)+((8191&(i=(i=Math.imul(h,F))+Math.imul(d,G)|0))<<13)|0;u=((o=Math.imul(d,F))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(p,G),i=(i=Math.imul(p,F))+Math.imul(b,G)|0,o=Math.imul(b,F);var ge=(u+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,U)|0)+Math.imul(d,Y)|0))<<13)|0;u=((o=o+Math.imul(d,U)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,G),i=(i=Math.imul(g,F))+Math.imul(m,G)|0,o=Math.imul(m,F),n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,U)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,U)|0;var me=(u+(n=n+Math.imul(h,V)|0)|0)+((8191&(i=(i=i+Math.imul(h,Z)|0)+Math.imul(d,V)|0))<<13)|0;u=((o=o+Math.imul(d,Z)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(A,G),i=(i=Math.imul(A,F))+Math.imul(w,G)|0,o=Math.imul(w,F),n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,U)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,U)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,Z)|0;var ye=(u+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(d,X)|0))<<13)|0;u=((o=o+Math.imul(d,J)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(S,G),i=(i=Math.imul(S,F))+Math.imul(M,G)|0,o=Math.imul(M,F),n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,U)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,U)|0,n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,Z)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,J)|0;var Ae=(u+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(d,$)|0))<<13)|0;u=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(R,G),i=(i=Math.imul(R,F))+Math.imul(O,G)|0,o=Math.imul(O,F),n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,U)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,U)|0,n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,Z)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,ee)|0;var we=(u+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(d,re)|0))<<13)|0;u=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(I,G),i=(i=Math.imul(I,F))+Math.imul(_,G)|0,o=Math.imul(_,F),n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,U)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,U)|0,n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,Z)|0,n=n+Math.imul(A,X)|0,i=(i=i+Math.imul(A,J)|0)+Math.imul(w,X)|0,o=o+Math.imul(w,J)|0,n=n+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0;var Ee=(u+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ae)|0)+Math.imul(d,oe)|0))<<13)|0;u=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(T,G),i=(i=Math.imul(T,F))+Math.imul(L,G)|0,o=Math.imul(L,F),n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,U)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,U)|0,n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,J)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(w,$)|0,o=o+Math.imul(w,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0;var Se=(u+(n=n+Math.imul(h,ce)|0)|0)+((8191&(i=(i=i+Math.imul(h,ue)|0)+Math.imul(d,ce)|0))<<13)|0;u=((o=o+Math.imul(d,ue)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(N,G),i=(i=Math.imul(N,F))+Math.imul(P,G)|0,o=Math.imul(P,F),n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,U)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,U)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,J)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0;var Me=(u+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(d,he)|0))<<13)|0;u=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,G),i=(i=Math.imul(D,F))+Math.imul(H,G)|0,o=Math.imul(H,F),n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,U)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,U)|0,n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,Z)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,n=n+Math.imul(g,ce)|0,i=(i=i+Math.imul(g,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(b,he)|0,o=o+Math.imul(b,de)|0;var ke=(u+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,be)|0)+Math.imul(d,pe)|0))<<13)|0;u=((o=o+Math.imul(d,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,Y),i=(i=Math.imul(D,U))+Math.imul(H,Y)|0,o=Math.imul(H,U),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,n=n+Math.imul(A,ce)|0,i=(i=i+Math.imul(A,ue)|0)+Math.imul(w,ce)|0,o=o+Math.imul(w,ue)|0,n=n+Math.imul(g,he)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(m,he)|0,o=o+Math.imul(m,de)|0;var Re=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,V),i=(i=Math.imul(D,Z))+Math.imul(H,V)|0,o=Math.imul(H,Z),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,J)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(S,ce)|0,i=(i=i+Math.imul(S,ue)|0)+Math.imul(M,ce)|0,o=o+Math.imul(M,ue)|0,n=n+Math.imul(A,he)|0,i=(i=i+Math.imul(A,de)|0)+Math.imul(w,he)|0,o=o+Math.imul(w,de)|0;var Oe=(u+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,be)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,X),i=(i=Math.imul(D,J))+Math.imul(H,X)|0,o=Math.imul(H,J),n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(L,re)|0,o=o+Math.imul(L,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,n=n+Math.imul(S,he)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(M,he)|0,o=o+Math.imul(M,de)|0;var xe=(u+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,be)|0)+Math.imul(w,pe)|0))<<13)|0;u=((o=o+Math.imul(w,be)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,ee))+Math.imul(H,$)|0,o=Math.imul(H,ee),n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,n=n+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,ue)|0)+Math.imul(_,ce)|0,o=o+Math.imul(_,ue)|0,n=n+Math.imul(R,he)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(O,he)|0,o=o+Math.imul(O,de)|0;var Ie=(u+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,be)|0)+Math.imul(M,pe)|0))<<13)|0;u=((o=o+Math.imul(M,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(H,re)|0,o=Math.imul(H,ne),n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,n=n+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,ue)|0)+Math.imul(L,ce)|0,o=o+Math.imul(L,ue)|0,n=n+Math.imul(I,he)|0,i=(i=i+Math.imul(I,de)|0)+Math.imul(_,he)|0,o=o+Math.imul(_,de)|0;var _e=(u+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,be)|0)+Math.imul(O,pe)|0))<<13)|0;u=((o=o+Math.imul(O,be)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,ae))+Math.imul(H,oe)|0,o=Math.imul(H,ae),n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(P,ce)|0,o=o+Math.imul(P,ue)|0,n=n+Math.imul(T,he)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(L,he)|0,o=o+Math.imul(L,de)|0;var Ce=(u+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,be)|0)+Math.imul(_,pe)|0))<<13)|0;u=((o=o+Math.imul(_,be)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(D,ce),i=(i=Math.imul(D,ue))+Math.imul(H,ce)|0,o=Math.imul(H,ue),n=n+Math.imul(N,he)|0,i=(i=i+Math.imul(N,de)|0)+Math.imul(P,he)|0,o=o+Math.imul(P,de)|0;var Te=(u+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,be)|0)+Math.imul(L,pe)|0))<<13)|0;u=((o=o+Math.imul(L,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,he),i=(i=Math.imul(D,de))+Math.imul(H,he)|0,o=Math.imul(H,de);var Le=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,be)|0)+Math.imul(P,pe)|0))<<13)|0;u=((o=o+Math.imul(P,be)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863;var Be=(u+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,be))+Math.imul(H,pe)|0))<<13)|0;return u=((o=Math.imul(H,be))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,c[0]=ve,c[1]=ge,c[2]=me,c[3]=ye,c[4]=Ae,c[5]=we,c[6]=Ee,c[7]=Se,c[8]=Me,c[9]=ke,c[10]=Re,c[11]=Oe,c[12]=xe,c[13]=Ie,c[14]=_e,c[15]=Ce,c[16]=Te,c[17]=Le,c[18]=Be,0!==u&&(c[19]=u,r.length++),r};function l(e,t,r){return(new p).mulp(e,t,r)}function p(e,t){this.x=e,this.y=t}Math.imul||(d=h),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?d(this,e,t):r<63?h(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):l(this,e,t)},p.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n>=1;return n},p.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==f||u>=i);u--){var h=0|this.words[u];this.words[u]=f<<26-o|h>>>o,f=h&s}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!==(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,c=n.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;h--){var d=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(o,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var f=n.clone(),h=t.clone();!t.isZero();){for(var d=0,l=1;0==(t.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(f),a.isub(h)),o.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(n.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(f),c.isub(h)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,f=1;0==(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var h=0,d=1;0==(n.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(n.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new E(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function m(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function y(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},n(g,v),g.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},g.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new g;else if("p224"===e)t=new m;else if("p192"===e)t=new y;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return b[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var h=this.pow(f,o),d=this.pow(e,o.addn(1).iushrn(1)),l=this.pow(e,o),p=a;0!==l.cmp(s);){for(var b=l,v=0;0!==b.cmp(s);v++)b=b.redSqr();r(v=0;n--){for(var u=t.words[n],f=c-1;f>=0;f--){var h=u>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===n&&0===f)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}c=26}return o},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},n(S,E),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,y.d)})),F=U;U.strict=K,U.loose=V;var W=Object.prototype.toString,Y={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function U(e){return K(e)||V(e)}function K(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function V(e){return Y[W.call(e)]}var Z=F.strict,q=function(e){if(Z(e)){var t=n.from(e.buffer);return e.byteLength!==e.buffer.byteLength&&(t=t.slice(e.byteOffset,e.byteOffset+e.byteLength)),t}return n.from(e)},X=Object(y.b)((function(e,t){var r=y.d&&y.d.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(G),o=r(F),a=r(q);function s(e){return new Uint8Array(e)}function c(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.toString("hex");return t?M(r):r}function u(e){return e.toString("utf8")}function f(e){return p(c(e))}function h(e){return a.default(e)}function d(e){return n.from(S(e),"hex")}function l(e){return s(d(e))}function p(e){return new i.default(S(e),"hex").toNumber()}function b(e){return n.from(e,"utf8")}function v(e,t){var r=S(k(new i.default(e).toString(16)));return t?M(r):r}function g(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}function m(e){return n.isBuffer(e)}function A(e){return o.default.strict(e)&&!m(e)}function w(e){return!A(e)&&!m(e)&&void 0!==e.byteLength}function E(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"0",i=t-e.length,o=e;if(i>0){var a=n.repeat(i);o=r?a+e:e+a}return o}function S(e){return e.replace(/^0x/,"")}function M(e){return e.startsWith("0x")?e:"0x".concat(e)}function k(e){return(e=(e=S(e)).length%2!=0?"0"+e:e)&&(e=M(e)),e}t.bufferToArray=s,t.bufferToHex=c,t.bufferToUtf8=u,t.bufferToNumber=f,t.arrayToBuffer=h,t.arrayToHex=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return c(h(e),t)},t.arrayToUtf8=function(e){return u(h(e))},t.arrayToNumber=function(e){return f(h(e))},t.hexToBuffer=d,t.hexToArray=l,t.hexToUtf8=function(e){return u(d(e))},t.hexToNumber=p,t.utf8ToBuffer=b,t.utf8ToArray=function(e){return s(b(e))},t.utf8ToHex=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return c(b(e),t)},t.utf8ToNumber=function(e){return new i.default(e,10).toNumber()},t.numberToBuffer=function(e){return d(v(e))},t.numberToArray=function(e){return l(v(e))},t.numberToHex=v,t.numberToUtf8=function(e){return new i.default(e).toString()},t.isHexString=g,t.isBuffer=m,t.isTypedArray=A,t.isArrayBuffer=w,t.getType=function(e){return m(e)?"buffer":A(e)?"typed-array":w(e)?"array-buffer":Array.isArray(e)?"array":typeof e},t.getEncoding=function(e){return g(e)?"hex":"utf8"},t.concatBuffers=function(){for(var e=arguments.length,t=new Array(e),r=0;r0&&(e=e.slice(r)),e},t.trimRight=function(e,t){return e.slice(0,t)},t.padLeft=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0";return E(e,t,!0,r)},t.padRight=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0";return E(e,t,!1,r)},t.removeHexPrefix=S,t.addHexPrefix=M,t.sanitizeHex=k,t.removeHexLeadingZeros=function(e){var t=e.startsWith("0x");return e=(e=S(e)).startsWith("0")?e.substring(1):e,t?M(e):e}}));Object(y.c)(X),X.bufferToArray,X.bufferToHex,X.bufferToUtf8,X.bufferToNumber,X.arrayToBuffer,X.arrayToHex,X.arrayToUtf8,X.arrayToNumber,X.hexToBuffer,X.hexToArray,X.hexToUtf8,X.hexToNumber,X.utf8ToBuffer,X.utf8ToArray,X.utf8ToHex,X.utf8ToNumber,X.numberToBuffer,X.numberToArray,X.numberToHex,X.numberToUtf8,X.isHexString,X.isBuffer,X.isTypedArray,X.isArrayBuffer,X.getType,X.getEncoding,X.concatBuffers,X.trimLeft,X.trimRight,X.padLeft,X.padRight,X.removeHexPrefix,X.addHexPrefix,X.sanitizeHex,X.removeHexLeadingZeros;var J=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=B.__importStar(X);t.convertArrayBufferToBuffer=function(e){return r.arrayToBuffer(new Uint8Array(e))},t.convertArrayBufferToUtf8=function(e){return r.arrayToUtf8(new Uint8Array(e))},t.convertArrayBufferToHex=function(e,t){return r.arrayToHex(new Uint8Array(e),!t)},t.convertArrayBufferToNumber=function(e){return r.arrayToNumber(new Uint8Array(e))},t.concatArrayBuffers=function(){for(var e=arguments.length,t=new Array(e),n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function L(e,t,r){T.call(this,e,t,r)}T.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(r);if(null===e)throw new Error(r);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||s&&ArrayBuffer.isView(e)))throw new Error(r);t=!0}for(var i,o,a=this.blocks,c=this.byteCount,u=e.length,h=this.blockCount,d=0,l=this.s;d>2]|=e[d]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[i>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=c){for(this.start=i-c,this.block=a[h],i=0;i>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},T.prototype.encodeString=function(e){var t,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(r);if(null===e)throw new Error(r);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||s&&ArrayBuffer.isView(e)))throw new Error(r);t=!0}var i=0,o=e.length;if(t)i=o;else for(var a=0;a=57344?i+=3:(c=65536+((1023&c)<<10|1023&e.charCodeAt(++a)),i+=4)}return i+=this.encode(8*i),this.update(e),i},T.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+c[15&e]+c[e>>12&15]+c[e>>8&15]+c[e>>20&15]+c[e>>16&15]+c[e>>28&15]+c[e>>24&15];a%t==0&&(B(r),o=0)}return i&&(e=r[o],s+=c[e>>4&15]+c[15&e],i>1&&(s+=c[e>>12&15]+c[e>>8&15]),i>2&&(s+=c[e>>20&15]+c[e>>16&15])),s},T.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var c=new Uint32Array(e);a>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;s%r==0&&B(n)}return o&&(e=s<<2,t=n[a],c[e]=255&t,o>1&&(c[e+1]=t>>8&255),o>2&&(c[e+2]=t>>16&255)),c},L.prototype=new T,L.prototype.finalize=function(){return this.encode(this.outputBits,!0),T.prototype.finalize.call(this)};var B=function(e){var t,r,n,i,o,a,s,c,u,f,d,l,p,b,v,g,m,y,A,w,E,S,M,k,R,O,x,I,_,C,T,L,B,N,P,j,D,H,z,G,F,W,Y,U,K,V,Z,q,X,J,Q,$,ee,te,re,ne,ie,oe,ae,se,ce,ue,fe;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],f=e[6]^e[16]^e[26]^e[36]^e[46],d=e[7]^e[17]^e[27]^e[37]^e[47],t=(l=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(c<<1|u>>>31),r=o^(u<<1|c>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(f<<1|d>>>31),r=s^(d<<1|f>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=c^(l<<1|p>>>31),r=u^(p<<1|l>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=f^(i<<1|o>>>31),r=d^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,b=e[0],v=e[1],V=e[11]<<4|e[10]>>>28,Z=e[10]<<4|e[11]>>>28,I=e[20]<<3|e[21]>>>29,_=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,W=e[40]<<18|e[41]>>>14,Y=e[41]<<18|e[40]>>>14,N=e[2]<<1|e[3]>>>31,P=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,m=e[12]<<12|e[13]>>>20,q=e[22]<<10|e[23]>>>22,X=e[23]<<10|e[22]>>>22,C=e[33]<<13|e[32]>>>19,T=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,j=e[14]<<6|e[15]>>>26,D=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,A=e[24]<<11|e[25]>>>21,J=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,L=e[45]<<29|e[44]>>>3,B=e[44]<<29|e[45]>>>3,k=e[6]<<28|e[7]>>>4,R=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,H=e[26]<<25|e[27]>>>7,z=e[27]<<25|e[26]>>>7,w=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,U=e[8]<<27|e[9]>>>5,K=e[9]<<27|e[8]>>>5,O=e[18]<<20|e[19]>>>12,x=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,G=e[38]<<8|e[39]>>>24,F=e[39]<<8|e[38]>>>24,S=e[48]<<14|e[49]>>>18,M=e[49]<<14|e[48]>>>18,e[0]=b^~g&y,e[1]=v^~m&A,e[10]=k^~O&I,e[11]=R^~x&_,e[20]=N^~j&H,e[21]=P^~D&z,e[30]=U^~V&q,e[31]=K^~Z&X,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=g^~y&w,e[3]=m^~A&E,e[12]=O^~I&C,e[13]=x^~_&T,e[22]=j^~H&G,e[23]=D^~z&F,e[32]=V^~q&J,e[33]=Z^~X&Q,e[42]=ne^~oe&se,e[43]=ie^~ae&ce,e[4]=y^~w&S,e[5]=A^~E&M,e[14]=I^~C&L,e[15]=_^~T&B,e[24]=H^~G&W,e[25]=z^~F&Y,e[34]=q^~J&$,e[35]=X^~Q&ee,e[44]=oe^~se&ue,e[45]=ae^~ce&fe,e[6]=w^~S&b,e[7]=E^~M&v,e[16]=C^~L&k,e[17]=T^~B&R,e[26]=G^~W&N,e[27]=F^~Y&P,e[36]=J^~$&U,e[37]=Q^~ee&K,e[46]=se^~ue&te,e[47]=ce^~fe&re,e[8]=S^~b&g,e[9]=M^~v&m,e[18]=L^~k&O,e[19]=B^~R&x,e[28]=W^~N&j,e[29]=Y^~P&D,e[38]=$^~U&V,e[39]=ee^~K&Z,e[48]=ue^~te&ne,e[49]=fe^~re&ie,e[0]^=h[n],e[1]^=h[n+1]};if(a)t.exports=M;else for(R=0;R7?r+=e[n].toUpperCase():r+=e[n];return X.addHexPrefix(r)}Object.defineProperty(t,"__esModule",{value:!0}),t.toChecksumAddress=r,t.isValidAddress=function(e){return!!e&&"0x"===e.toLowerCase().substring(0,2)&&!!/^(0x)?[0-9a-f]{40}$/i.test(e)&&(!(!/^(0x)?[0-9a-f]{40}$/.test(e)&&!/^(0x)?[0-9A-F]{40}$/.test(e))||e===r(e))},t.parsePersonalSign=function(e){return re.isEmptyArray(e)||re.isHexString(e[0])||(e[0]=J.convertUtf8ToHex(e[0])),e},t.parseTransactionData=function(e){if(void 0===e.from||!t.isValidAddress(e.from))throw new Error("Transaction object must include a valid 'from' value.");function r(e){var t=e;return("number"==typeof e||"string"==typeof e&&!re.isEmptyString(e))&&(re.isHexString(e)?"string"==typeof e&&(t=te.sanitizeHex(e)):t=J.convertNumberToHex(e)),"string"==typeof t&&(t=te.removeHexLeadingZeros(t)),t}var n={from:te.sanitizeHex(e.from),to:void 0===e.to?"":te.sanitizeHex(e.to),gasPrice:void 0===e.gasPrice?"":r(e.gasPrice),gas:void 0===e.gas?void 0===e.gasLimit?"":r(e.gasLimit):r(e.gas),value:void 0===e.value?"":r(e.value),nonce:void 0===e.nonce?"":r(e.nonce),data:void 0===e.data?"":te.sanitizeHex(e.data)||"0x"},i=["gasPrice","gas","value","nonce"];return Object.keys(n).forEach((function(e){!n[e].trim().length&&i.includes(e)&&delete n[e]})),n}}));Object(y.c)(ne),ne.toChecksumAddress,ne.isValidAddress,ne.parsePersonalSign,ne.parseTransactionData;var ie=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.setLocal=function(e,t){var r=te.safeJsonStringify(t),n=H.getLocalStorage();n&&n.setItem(e,r)},t.getLocal=function(e){var t=null,r=H.getLocalStorage();return r&&(t=r.getItem(e)),te.safeJsonParse(t)},t.removeLocal=function(e){var t=H.getLocalStorage();t&&t.removeItem(e)}}));Object(y.c)(ie),ie.setLocal,ie.getLocal,ie.removeLocal;var oe=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.promisify=function(e,t){var r=this;return function(){for(var n=arguments.length,i=new Array(n),o=0;o-1?r.split(e.arrayFormatSeparator).map((function(t){return i(t,e)})):null===r?r:i(r,e);n[t]=o};default:return function(e,t,r){void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t),o=Object.create(null);if("string"!=typeof e)return o;if(!(e=e.trim().replace(/^[?#&]/,"")))return o;var a,c=Object(v.a)(e.split("&"));try{for(c.s();!(a=c.n()).done;){var u=a.value,f=fe(t.decode?u.replace(/\+/g," "):u,"="),h=Object(b.a)(f,2),d=h[0],l=h[1];l=void 0===l?null:["comma","separator"].includes(t.arrayFormat)?l:i(l,t),n(i(d,t),l,o)}}catch(S){c.e(S)}finally{c.f()}for(var p=0,g=Object.keys(o);p0})).join("&")},t.parseUrl=function(e,t){t=Object.assign({decode:!0},t);var r=fe(e,"#"),n=Object(b.a)(r,2),o=n[0],s=n[1];return Object.assign({url:o.split("?")[0]||"",query:c(a(e),t)},t&&t.parseFragmentIdentifier&&s?{fragmentIdentifier:i(s,t)}:{})},t.stringifyUrl=function(e,r){r=Object.assign({encode:!0,strict:!0},r);var i=o(e.url).split("?")[0]||"",a=t.extract(e.url),s=t.parse(a,{sort:!1}),c=Object.assign(s,e.query),u=t.stringify(c,r);u&&(u="?".concat(u));var f=function(e){var t="",r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(f="#".concat(n(e.fragmentIdentifier,r))),"".concat(i).concat(u).concat(f)}})),de=(he.extract,he.parse,he.stringify,he.parseUrl,he.stringifyUrl,Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=B.__importStar(he);function n(e){return r.parse(e)}function i(e){return r.stringify(e)}t.getQueryString=function(e){var t=-1!==e.indexOf("?")?e.indexOf("?"):void 0;return void 0!==t?e.substr(t):""},t.appendToQueryString=function(e,t){var r=n(e);return i(r=Object.assign(Object.assign({},r),t))},t.parseQueryString=n,t.formatQueryString=i})));Object(y.c)(de),de.getQueryString,de.appendToQueryString,de.parseQueryString,de.formatQueryString;var le=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isWalletConnectSession=function(e){return void 0!==e.bridge},t.parseWalletConnectUri=function(e){var t=e.indexOf(":"),r=-1!==e.indexOf("?")?e.indexOf("?"):void 0,n=e.substring(0,t),i=function(e){var t=e.split("@");return{handshakeTopic:t[0],version:parseInt(t[1],10)}}(e.substring(t+1,r)),o=function(e){var t=de.parseQueryString(e);return{key:t.key||"",bridge:t.bridge||""}}(void 0!==r?e.substr(r):"");return Object.assign(Object.assign({protocol:n},i),o)}}));Object(y.c)(le),le.isWalletConnectSession,le.parseWalletConnectUri;var pe=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),B.__exportStar(H,t),B.__exportStar(z,t),B.__exportStar(J,t),B.__exportStar(ne,t),B.__exportStar(ie,t),B.__exportStar(te,t),B.__exportStar(oe,t),B.__exportStar(le,t),B.__exportStar(de,t),B.__exportStar(re,t)}));Object(y.c)(pe);var be=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){function e(){var t=this;Object(d.a)(this,e),this._eventEmitters=[],"undefined"!=typeof window&&void 0!==window.addEventListener&&(window.addEventListener("online",(function(){return t.trigger("online")})),window.addEventListener("offline",(function(){return t.trigger("offline")})))}return Object(l.a)(e,[{key:"on",value:function(e,t){this._eventEmitters.push({event:e,callback:t})}},{key:"trigger",value:function(e){var t=[];e&&(t=this._eventEmitters.filter((function(t){return t.event===e}))),t.forEach((function(e){e.callback()}))}}]),e}()}));Object(y.c)(be);var ve=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")},ge=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=B.__importDefault(be),n=void 0!==y.d.WebSocket?y.d.WebSocket:ve;t.default=function(){function e(t){var n=this;if(Object(d.a)(this,e),this._queue=[],this._events=[],this._subscriptions=[],this._initiating=!1,this._url="",this._netMonitor=null,this._socket=null,this._nextSocket=null,this._subscriptions=t.subscriptions||[],this._netMonitor=t.netMonitor||new r.default,!t.url||"string"!=typeof t.url)throw new Error("Missing or invalid WebSocket url");this._url=t.url,this._netMonitor.on("online",(function(){return n._socketCreate()}))}return Object(l.a)(e,[{key:"readyState",get:function(){return this._socket?this._socket.readyState:-1},set:function(e){}},{key:"connecting",get:function(){return 0===this.readyState},set:function(e){}},{key:"connected",get:function(){return 1===this.readyState},set:function(e){}},{key:"closing",get:function(){return 2===this.readyState},set:function(e){}},{key:"closed",get:function(){return 3===this.readyState},set:function(e){}},{key:"open",value:function(){this._socketCreate()}},{key:"close",value:function(){this._socketClose()}},{key:"send",value:function(e,t,r){if(!t||"string"!=typeof t)throw new Error("Missing or invalid topic field");this._socketSend({topic:t,type:"pub",payload:e,silent:!!r})}},{key:"subscribe",value:function(e){this._socketSend({topic:e,type:"sub",payload:"",silent:!0})}},{key:"on",value:function(e,t){this._events.push({event:e,callback:t})}},{key:"_socketCreate",value:function(){var e=this;if(!this._initiating){this._initiating=!0;var t=this._url.startsWith("https")?this._url.replace("https","wss"):this._url.startsWith("http")?this._url.replace("http","ws"):this._url;if(this._nextSocket=new n(t),!this._nextSocket)throw new Error("Failed to create socket");this._nextSocket.onmessage=function(t){return e._socketReceive(t)},this._nextSocket.onopen=function(){return e._socketOpen()}}}},{key:"_socketOpen",value:function(){this._socketClose(),this._initiating=!1,this._socket=this._nextSocket,this._nextSocket=null,this._queueSubscriptions(),this._pushQueue()}},{key:"_socketClose",value:function(){this._socket&&(this._socket.onclose=function(){},this._socket.close())}},{key:"_socketSend",value:function(e){var t=JSON.stringify(e);this._socket&&1===this._socket.readyState?this._socket.send(t):(this._setToQueue(e),this._socketCreate())}},{key:"_socketReceive",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r,n;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.prev=0,r=JSON.parse(e.data),t.next=7;break;case 4:return t.prev=4,t.t0=t.catch(0),t.abrupt("return");case 7:this._socketSend({topic:r.topic,type:"ack",payload:"",silent:!0}),this._socket&&1===this._socket.readyState&&(n=this._events.filter((function(e){return"message"===e.event})))&&n.length&&n.forEach((function(e){return e.callback(r)}));case 8:case"end":return t.stop()}}),t,this,[[0,4]])})))}},{key:"_queueSubscriptions",value:function(){var e=this;this._subscriptions.forEach((function(t){return e._queue.push({topic:t,type:"sub",payload:"",silent:!0})})),this._subscriptions=[]}},{key:"_setToQueue",value:function(e){this._queue.push(e)}},{key:"_pushQueue",value:function(){var e=this;this._queue.forEach((function(t){return e._socketSend(t)})),this._queue=[]}}]),e}()}));Object(y.c)(ge);var me=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.ERROR_SESSION_CONNECTED="Session currently connected",t.ERROR_SESSION_DISCONNECTED="Session currently disconnected",t.ERROR_SESSION_REJECTED="Session Rejected",t.ERROR_MISSING_JSON_RPC="Missing JSON RPC response",t.ERROR_MISSING_RESULT='JSON-RPC success response must include "result" field',t.ERROR_MISSING_ERROR='JSON-RPC error response must include "error" field',t.ERROR_MISSING_METHOD='JSON RPC request must have valid "method" value',t.ERROR_MISSING_ID='JSON RPC request must have valid "id" value',t.ERROR_MISSING_REQUIRED="Missing one of the required parameters: bridge / uri / session",t.ERROR_INVALID_RESPONSE="JSON RPC response format is invalid",t.ERROR_INVALID_URI="URI format is invalid",t.ERROR_QRCODE_MODAL_NOT_PROVIDED="QRCode Modal not provided",t.ERROR_QRCODE_MODAL_USER_CLOSED="User close QRCode Modal"}));Object(y.c)(me),me.ERROR_SESSION_CONNECTED,me.ERROR_SESSION_DISCONNECTED,me.ERROR_SESSION_REJECTED,me.ERROR_MISSING_JSON_RPC,me.ERROR_MISSING_RESULT,me.ERROR_MISSING_ERROR,me.ERROR_MISSING_METHOD,me.ERROR_MISSING_ID,me.ERROR_MISSING_REQUIRED,me.ERROR_INVALID_RESPONSE,me.ERROR_INVALID_URI,me.ERROR_QRCODE_MODAL_NOT_PROVIDED,me.ERROR_QRCODE_MODAL_USER_CLOSED;var ye=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){function e(){Object(d.a)(this,e),this._eventEmitters=[]}return Object(l.a)(e,[{key:"subscribe",value:function(e){this._eventEmitters.push(e)}},{key:"trigger",value:function(e){var t,r=[];(t=pe.isJsonRpcRequest(e)?e.method:pe.isJsonRpcResponseSuccess(e)||pe.isJsonRpcResponseError(e)?"response:".concat(e.id):pe.isInternalEvent(e)?e.event:"")&&(r=this._eventEmitters.filter((function(e){return e.event===t}))),r&&r.length||pe.isReservedEvent(t)||pe.isInternalEvent(t)||(r=this._eventEmitters.filter((function(e){return"call_request"===e.event}))),r.forEach((function(t){if(pe.isJsonRpcResponseError(e)){var r=new Error(e.error.message);t.callback(r,null)}else t.callback(null,e)}))}}]),e}()}));Object(y.c)(ye);var Ae=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){function e(){Object(d.a)(this,e),this.storageId="walletconnect"}return Object(l.a)(e,[{key:"getSession",value:function(){var e=null,t=pe.getLocal(this.storageId);return t&&pe.isWalletConnectSession(t)&&(e=t),e}},{key:"setSession",value:function(e){return pe.setLocal(this.storageId,e),e}},{key:"removeSession",value:function(){pe.removeLocal(this.storageId)}}]),e}()}));Object(y.c)(Ae);var we=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=B.__importDefault(ge),n=B.__importDefault(ye),i=B.__importDefault(Ae);t.default=function(){function e(t){if(Object(d.a)(this,e),this.protocol="wc",this.version=1,this._bridge="",this._key=null,this._clientId="",this._clientMeta=null,this._peerId="",this._peerMeta=null,this._handshakeId=0,this._handshakeTopic="",this._connected=!1,this._accounts=[],this._chainId=0,this._networkId=0,this._rpcUrl="",this._eventManager=new n.default,this._clientMeta=pe.getClientMeta()||t.connectorOpts.clientMeta||null,this._cryptoLib=t.cryptoLib,this._sessionStorage=t.sessionStorage||new i.default,this._qrcodeModal=t.connectorOpts.qrcodeModal,this._qrcodeModalOptions=t.connectorOpts.qrcodeModalOptions,!t.connectorOpts.bridge&&!t.connectorOpts.uri&&!t.connectorOpts.session)throw new Error(me.ERROR_MISSING_REQUIRED);t.connectorOpts.bridge&&(this.bridge=t.connectorOpts.bridge),t.connectorOpts.uri&&(this.uri=t.connectorOpts.uri);var o=t.connectorOpts.session||this._getStorageSession();o&&(this.session=o),this.handshakeId&&this._subscribeToSessionResponse(this.handshakeId,"Session request rejected"),this._transport=t.transport||new r.default({url:this.bridge,subscriptions:[this.clientId]}),this._subscribeToInternalEvents(),this._initTransport(),t.connectorOpts.uri&&this._subscribeToSessionRequest(),t.pushServerOpts&&this._registerPushServer(t.pushServerOpts)}return Object(l.a)(e,[{key:"bridge",get:function(){return this._bridge},set:function(e){e&&(this._bridge=e)}},{key:"key",get:function(){return this._key?pe.convertArrayBufferToHex(this._key,!0):""},set:function(e){if(e){var t=pe.convertHexToArrayBuffer(e);this._key=t}}},{key:"clientId",get:function(){var e=this._clientId;return e||(e=this._clientId=pe.uuid()),this._clientId},set:function(e){e&&(this._clientId=e)}},{key:"peerId",get:function(){return this._peerId},set:function(e){e&&(this._peerId=e)}},{key:"clientMeta",get:function(){var e=this._clientMeta;return e||(e=this._clientMeta=pe.getClientMeta()),e},set:function(e){}},{key:"peerMeta",get:function(){return this._peerMeta},set:function(e){this._peerMeta=e}},{key:"handshakeTopic",get:function(){return this._handshakeTopic},set:function(e){e&&(this._handshakeTopic=e)}},{key:"handshakeId",get:function(){return this._handshakeId},set:function(e){e&&(this._handshakeId=e)}},{key:"uri",get:function(){return this._formatUri()},set:function(e){if(e){var t=this._parseUri(e),r=t.handshakeTopic,n=t.bridge,i=t.key;this.handshakeTopic=r,this.bridge=n,this.key=i}}},{key:"chainId",get:function(){return this._chainId},set:function(e){this._chainId=e}},{key:"networkId",get:function(){return this._networkId},set:function(e){this._networkId=e}},{key:"accounts",get:function(){return this._accounts},set:function(e){this._accounts=e}},{key:"rpcUrl",get:function(){return this._rpcUrl},set:function(e){this._rpcUrl=e}},{key:"connected",get:function(){return this._connected},set:function(e){}},{key:"pending",get:function(){return!!this._handshakeTopic},set:function(e){}},{key:"session",get:function(){return{connected:this.connected,accounts:this.accounts,chainId:this.chainId,bridge:this.bridge,key:this.key,clientId:this.clientId,clientMeta:this.clientMeta,peerId:this.peerId,peerMeta:this.peerMeta,handshakeId:this.handshakeId,handshakeTopic:this.handshakeTopic}},set:function(e){e&&(this._connected=e.connected,this.accounts=e.accounts,this.chainId=e.chainId,this.bridge=e.bridge,this.key=e.key,this.clientId=e.clientId,this.clientMeta=e.clientMeta,this.peerId=e.peerId,this.peerMeta=e.peerMeta,this.handshakeId=e.handshakeId,this.handshakeTopic=e.handshakeTopic)}},{key:"on",value:function(e,t){var r={event:e,callback:t};this._eventManager.subscribe(r)}},{key:"createInstantRequest",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r,n,i,o=this;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._generateKey();case 2:return this._key=t.sent,r=this._formatRequest({method:"wc_instantRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,request:this._formatRequest(e)}]}),this.handshakeId=r.id,this.handshakeTopic=pe.uuid(),this._eventManager.trigger({event:"display_uri",params:[this.uri]}),this.on("modal_closed",(function(){throw new Error(me.ERROR_QRCODE_MODAL_USER_CLOSED)})),n=function(){o.killSession()},t.prev=6,t.next=9,this._sendCallRequest(r);case 9:return i=t.sent,t.abrupt("return",(i&&n(),i));case 13:throw t.prev=13,t.t0=t.catch(6),n(),t.t0;case 16:case"end":return t.stop()}}),t,this,[[6,13]])})))}},{key:"connect",value:function(e){var t=this;if(!this._qrcodeModal)throw new Error(me.ERROR_QRCODE_MODAL_NOT_PROVIDED);return new Promise((function(r,n){return B.__awaiter(t,void 0,void 0,m.a.mark((function t(){return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.connected&&r({chainId:this.chainId,accounts:this.accounts}),this.connected){t.next=9;break}return t.prev=1,t.next=4,this.createSession(e);case 4:t.next=9;break;case 6:t.prev=6,t.t0=t.catch(1),n(t.t0);case 9:this.on("modal_closed",(function(){return n(new Error(me.ERROR_QRCODE_MODAL_USER_CLOSED))})),this.on("connect",(function(e,t){if(e)return n(e);r(t.params[0])}));case 10:case"end":return t.stop()}}),t,this,[[1,6]])})))}))}},{key:"createSession",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._connected){t.next=2;break}throw new Error(me.ERROR_SESSION_CONNECTED);case 2:if(!this.pending){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,this._generateKey();case 6:this._key=t.sent,r=this._formatRequest({method:"wc_sessionRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,chainId:e&&e.chainId?e.chainId:null}]}),this.handshakeId=r.id,this.handshakeTopic=pe.uuid(),this._sendSessionRequest(r,"Session update rejected",{topic:this.handshakeTopic}),this._eventManager.trigger({event:"display_uri",params:[this.uri]});case 9:case"end":return t.stop()}}),t,this)})))}},{key:"approveSession",value:function(e){if(this._connected)throw new Error(me.ERROR_SESSION_CONNECTED);this.chainId=e.chainId,this.accounts=e.accounts,this.networkId=e.networkId||0,this.rpcUrl=e.rpcUrl||"";var t={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl,peerId:this.clientId,peerMeta:this.clientMeta},r={id:this.handshakeId,jsonrpc:"2.0",result:t};this._sendResponse(r),this._connected=!0,this._setStorageSession(),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})}},{key:"rejectSession",value:function(e){if(this._connected)throw new Error(me.ERROR_SESSION_CONNECTED);var t=e&&e.message?e.message:me.ERROR_SESSION_REJECTED,r=this._formatResponse({id:this.handshakeId,error:{message:t}});this._sendResponse(r),this._connected=!1,this._eventManager.trigger({event:"disconnect",params:[{message:t}]}),this._removeStorageSession()}},{key:"updateSession",value:function(e){if(!this._connected)throw new Error(me.ERROR_SESSION_DISCONNECTED);this.chainId=e.chainId,this.accounts=e.accounts,this.networkId=e.networkId||0,this.rpcUrl=e.rpcUrl||"";var t={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl},r=this._formatRequest({method:"wc_sessionUpdate",params:[t]});this._sendSessionRequest(r,"Session update rejected"),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]}),this._manageStorageSession()}},{key:"killSession",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r,n;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e?e.message:"Session Disconnected",n=this._formatRequest({method:"wc_sessionUpdate",params:[{approved:!1,chainId:null,networkId:null,accounts:null}]}),t.next=3,this._sendRequest(n);case 3:this._handleSessionDisconnect(r);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"sendTransaction",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r,n;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._connected){t.next=2;break}throw new Error(me.ERROR_SESSION_DISCONNECTED);case 2:return r=pe.parseTransactionData(e),n=this._formatRequest({method:"eth_sendTransaction",params:[r]}),t.next=5,this._sendCallRequest(n);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"signTransaction",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r,n;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._connected){t.next=2;break}throw new Error(me.ERROR_SESSION_DISCONNECTED);case 2:return r=pe.parseTransactionData(e),n=this._formatRequest({method:"eth_signTransaction",params:[r]}),t.next=5,this._sendCallRequest(n);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"signMessage",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._connected){t.next=2;break}throw new Error(me.ERROR_SESSION_DISCONNECTED);case 2:return r=this._formatRequest({method:"eth_sign",params:e}),t.next=5,this._sendCallRequest(r);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"signPersonalMessage",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._connected){t.next=2;break}throw new Error(me.ERROR_SESSION_DISCONNECTED);case 2:return e=pe.parsePersonalSign(e),r=this._formatRequest({method:"personal_sign",params:e}),t.next=6,this._sendCallRequest(r);case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t,this)})))}},{key:"signTypedData",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._connected){t.next=2;break}throw new Error(me.ERROR_SESSION_DISCONNECTED);case 2:return r=this._formatRequest({method:"eth_signTypedData",params:e}),t.next=5,this._sendCallRequest(r);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"updateChain",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._connected){t.next=2;break}throw new Error("Session currently disconnected");case 2:return r=this._formatRequest({method:"wallet_updateChain",params:[e]}),t.next=5,this._sendCallRequest(r);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"unsafeSend",value:function(e,t){var r=this;return this._sendRequest(e,t),new Promise((function(t,n){r._subscribeToResponse(e.id,(function(e,r){if(e)n(e);else{if(!r)throw new Error(me.ERROR_MISSING_JSON_RPC);t(r)}}))}))}},{key:"sendCustomRequest",value:function(e,t){return B.__awaiter(this,void 0,void 0,m.a.mark((function r(){var n;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(this._connected){r.next=2;break}throw new Error(me.ERROR_SESSION_DISCONNECTED);case 2:r.t0=e.method,r.next="eth_accounts"===r.t0?5:"eth_chainId"===r.t0?6:"eth_sendTransaction"===r.t0||"eth_signTransaction"===r.t0?7:"personal_sign"===r.t0?9:10;break;case 5:return r.abrupt("return",this.accounts);case 6:return r.abrupt("return",pe.convertNumberToHex(this.chainId));case 7:return e.params&&(e.params[0]=pe.parseTransactionData(e.params[0])),r.abrupt("break",10);case 9:e.params&&(e.params=pe.parsePersonalSign(e.params));case 10:return n=this._formatRequest(e),r.next=13,this._sendCallRequest(n,t);case 13:return r.abrupt("return",r.sent);case 14:case"end":return r.stop()}}),r,this)})))}},{key:"approveRequest",value:function(e){if(!pe.isJsonRpcResponseSuccess(e))throw new Error(me.ERROR_MISSING_RESULT);var t=this._formatResponse(e);this._sendResponse(t)}},{key:"rejectRequest",value:function(e){if(!pe.isJsonRpcResponseError(e))throw new Error(me.ERROR_MISSING_ERROR);var t=this._formatResponse(e);this._sendResponse(t)}},{key:"_sendRequest",value:function(e,t){var r,n;return B.__awaiter(this,void 0,void 0,m.a.mark((function i(){var o,a,s,c,u;return m.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return o=this._formatRequest(e),i.next=3,this._encrypt(o);case 3:a=i.sent,s=void 0!==(null===(r=t)||void 0===r?void 0:r.topic)?t.topic:this.peerId,c=JSON.stringify(a),u=void 0!==(null===(n=t)||void 0===n?void 0:n.forcePushNotification)?!t.forcePushNotification:pe.isSilentPayload(o),this._transport.send(c,s,u);case 8:case"end":return i.stop()}}),i,this)})))}},{key:"_sendResponse",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r,n,i;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._encrypt(e);case 2:r=t.sent,n=this.peerId,i=JSON.stringify(r),this._transport.send(i,n,!0);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"_sendSessionRequest",value:function(e,t,r){return B.__awaiter(this,void 0,void 0,m.a.mark((function n(){return m.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:this._sendRequest(e,r),this._subscribeToSessionResponse(e.id,t);case 1:case"end":return n.stop()}}),n,this)})))}},{key:"_sendCallRequest",value:function(e,t){if(this._sendRequest(e,t),pe.isMobile()&&pe.signingMethods.includes(e.method)){var r=pe.getLocal(pe.mobileLinkChoiceKey);r&&(window.location.href=r.href)}return this._subscribeToCallResponse(e.id)}},{key:"_formatRequest",value:function(e){if(void 0===e.method)throw new Error(me.ERROR_MISSING_METHOD);return{id:void 0===e.id?pe.payloadId():e.id,jsonrpc:"2.0",method:e.method,params:void 0===e.params?[]:e.params}}},{key:"_formatResponse",value:function(e){if(void 0===e.id)throw new Error(me.ERROR_MISSING_ID);var t={id:e.id,jsonrpc:"2.0"};if(pe.isJsonRpcResponseError(e)){var r=pe.formatRpcError(e.error);return Object.assign(Object.assign(Object.assign({},t),e),{error:r})}if(pe.isJsonRpcResponseSuccess(e))return Object.assign(Object.assign({},t),e);throw new Error(me.ERROR_INVALID_RESPONSE)}},{key:"_handleSessionDisconnect",value:function(e){var t=e||"Session Disconnected";this._connected||(this._qrcodeModal&&this._qrcodeModal.close(),pe.removeLocal(pe.mobileLinkChoiceKey)),this._connected&&(this._connected=!1),this._eventManager.trigger({event:"disconnect",params:[{message:t}]}),this._removeStorageSession(),this._transport.close()}},{key:"_handleSessionResponse",value:function(e,t){t&&t.approved?(this._connected?(t.chainId&&(this.chainId=t.chainId),t.accounts&&(this.accounts=t.accounts),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]})):(this._connected=!0,t.chainId&&(this.chainId=t.chainId),t.accounts&&(this.accounts=t.accounts),t.peerId&&!this.peerId&&(this.peerId=t.peerId),t.peerMeta&&!this.peerMeta&&(this.peerMeta=t.peerMeta),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})),this._manageStorageSession()):this._handleSessionDisconnect(e)}},{key:"_handleIncomingMessages",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r,n;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if([this.clientId,this.handshakeTopic].includes(e.topic)){t.next=2;break}return t.abrupt("return");case 2:t.prev=2,r=JSON.parse(e.payload),t.next=9;break;case 6:return t.prev=6,t.t0=t.catch(2),t.abrupt("return");case 9:return t.next=11,this._decrypt(r);case 11:(n=t.sent)&&this._eventManager.trigger(n);case 13:case"end":return t.stop()}}),t,this,[[2,6]])})))}},{key:"_subscribeToSessionRequest",value:function(){this._transport.subscribe(this.handshakeTopic)}},{key:"_subscribeToResponse",value:function(e,t){this.on("response:".concat(e),t)}},{key:"_subscribeToSessionResponse",value:function(e,t){var r=this;this._subscribeToResponse(e,(function(e,n){e?r._handleSessionResponse(e.message):n.result?r._handleSessionResponse(t,n.result):n.error&&n.error.message?r._handleSessionResponse(n.error.message):r._handleSessionResponse(t)}))}},{key:"_subscribeToCallResponse",value:function(e){var t=this;return new Promise((function(r,n){t._subscribeToResponse(e,(function(e,t){e?n(e):t.result?r(t.result):t.error&&t.error.message?n(new Error(t.error.message)):n(new Error(me.ERROR_INVALID_RESPONSE))}))}))}},{key:"_subscribeToInternalEvents",value:function(){var e=this;this.on("display_uri",(function(){e._qrcodeModal&&e._qrcodeModal.open(e.uri,(function(){e._eventManager.trigger({event:"modal_closed",params:[]})}),e._qrcodeModalOptions)})),this.on("connect",(function(){e._qrcodeModal&&e._qrcodeModal.close()})),this.on("wc_sessionRequest",(function(t,r){t&&e._eventManager.trigger({event:"error",params:[{code:"SESSION_REQUEST_ERROR",message:t.toString()}]}),e.handshakeId=r.id,e.peerId=r.params[0].peerId,e.peerMeta=r.params[0].peerMeta;var n=Object.assign(Object.assign({},r),{method:"session_request"});e._eventManager.trigger(n)})),this.on("wc_sessionUpdate",(function(t,r){t&&e._handleSessionResponse(t.message),e._handleSessionResponse("Session disconnected",r.params[0])}))}},{key:"_initTransport",value:function(){var e=this;this._transport.on("message",(function(t){return e._handleIncomingMessages(t)})),this._transport.on("open",(function(){return e._eventManager.trigger({event:"transport_open",params:[]})})),this._transport.on("close",(function(){return e._eventManager.trigger({event:"transport_close",params:[]})})),this._transport.open()}},{key:"_formatUri",value:function(){return"".concat(this.protocol,":").concat(this.handshakeTopic,"@").concat(this.version,"?bridge=").concat(encodeURIComponent(this.bridge),"&key=").concat(this.key)}},{key:"_parseUri",value:function(e){var t=pe.parseWalletConnectUri(e);if(t.protocol===this.protocol){if(!t.handshakeTopic)throw Error("Invalid or missing handshakeTopic parameter value");var r=t.handshakeTopic;if(!t.bridge)throw Error("Invalid or missing bridge url parameter value");var n=decodeURIComponent(t.bridge);if(!t.key)throw Error("Invalid or missing kkey parameter value");return{handshakeTopic:r,bridge:n,key:t.key}}throw new Error(me.ERROR_INVALID_URI)}},{key:"_generateKey",value:function(){return B.__awaiter(this,void 0,void 0,m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._cryptoLib){e.next=4;break}return e.next=3,this._cryptoLib.generateKey();case 3:return e.abrupt("return",e.sent);case 4:return e.abrupt("return",null);case 5:case"end":return e.stop()}}),e,this)})))}},{key:"_encrypt",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this._key,!this._cryptoLib||!r){t.next=5;break}return t.next=4,this._cryptoLib.encrypt(e,r);case 4:return t.abrupt("return",t.sent);case 5:return t.abrupt("return",null);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"_decrypt",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this._key,!this._cryptoLib||!r){t.next=5;break}return t.next=4,this._cryptoLib.decrypt(e,r);case 4:return t.abrupt("return",t.sent);case 5:return t.abrupt("return",null);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"_getStorageSession",value:function(){var e=null;return this._sessionStorage&&(e=this._sessionStorage.getSession()),e}},{key:"_setStorageSession",value:function(){this._sessionStorage&&this._sessionStorage.setSession(this.session)}},{key:"_removeStorageSession",value:function(){this._sessionStorage&&this._sessionStorage.removeSession()}},{key:"_manageStorageSession",value:function(){this._connected?this._setStorageSession():this._removeStorageSession()}},{key:"_registerPushServer",value:function(e){var t=this;if(!e.url||"string"!=typeof e.url)throw Error("Invalid or missing pushServerOpts.url parameter value");if(!e.type||"string"!=typeof e.type)throw Error("Invalid or missing pushServerOpts.type parameter value");if(!e.token||"string"!=typeof e.token)throw Error("Invalid or missing pushServerOpts.token parameter value");var r={bridge:this.bridge,topic:this.clientId,type:e.type,token:e.token,peerName:"",language:e.language||""};this.on("connect",(function(n,i){return B.__awaiter(t,void 0,void 0,m.a.mark((function t(){var o,a;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n){t.next=2;break}throw n;case 2:return e.peerMeta&&(o=i.params[0].peerMeta.name,r.peerName=o),t.prev=3,t.next=6,fetch("".concat(e.url,"/new"),{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(r)});case 6:return a=t.sent,t.next=9,a.json();case 9:if(t.sent.success){t.next=11;break}throw Error("Failed to register in Push Server");case 11:t.next=16;break;case 13:throw t.prev=13,t.t0=t.catch(3),Error("Failed to register in Push Server");case 16:case"end":return t.stop()}}),t,null,[[3,13]])})))}))}}]),e}()}));Object(y.c)(we);var Ee=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.HEX_ENC="hex",t.UTF8_ENC="utf8",t.ENCRYPT_OP="encrypt",t.DECRYPT_OP="decrypt",t.SIGN_OP="sign",t.VERIFY_OP="verify",t.LENGTH_0=0,t.LENGTH_1=1,t.LENGTH_16=16,t.LENGTH_32=32,t.LENGTH_64=64,t.LENGTH_128=128,t.LENGTH_256=256,t.LENGTH_512=512,t.LENGTH_1024=1024,t.AES_LENGTH=t.LENGTH_256,t.HMAC_LENGTH=t.LENGTH_256,t.AES_BROWSER_ALGO="AES-CBC",t.HMAC_BROWSER_ALGO="SHA-".concat(t.AES_LENGTH),t.HMAC_BROWSER="HMAC",t.SHA256_BROWSER_ALGO="SHA-256",t.SHA512_BROWSER_ALGO="SHA-512",t.AES_NODE_ALGO="aes-".concat(t.AES_LENGTH,"-cbc"),t.HMAC_NODE_ALGO="sha".concat(t.HMAC_LENGTH),t.SHA256_NODE_ALGO="sha256",t.SHA512_NODE_ALGO="sha512",t.RIPEMD160_NODE_ALGO="ripemd160",t.PREFIX_LENGTH=t.LENGTH_1,t.KEY_LENGTH=t.LENGTH_32,t.IV_LENGTH=t.LENGTH_16,t.MAC_LENGTH=t.LENGTH_32,t.DECOMPRESSED_LENGTH=t.LENGTH_64,t.PREFIXED_KEY_LENGTH=t.KEY_LENGTH+t.PREFIX_LENGTH,t.PREFIXED_DECOMPRESSED_LENGTH=t.DECOMPRESSED_LENGTH+t.PREFIX_LENGTH,t.MAX_KEY_LENGTH=t.LENGTH_1024,t.MAX_MSG_LENGTH=t.LENGTH_32,t.EMPTY_BUFFER=n.from(new Uint8Array(t.LENGTH_0)),t.EC_GROUP_ORDER=n.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",t.HEX_ENC),t.ZERO32=n.alloc(t.LENGTH_32,t.LENGTH_0),t.ERROR_BAD_MAC="Bad MAC",t.ERROR_BAD_PRIVATE_KEY="Bad private key",t.ERROR_BAD_PUBLIC_KEY="Bad public key",t.ERROR_EMPTY_MESSAGE="Message should not be empty",t.ERROR_MESSAGE_TOO_LONG="Message is too long"}));Object(y.c)(Ee),Ee.HEX_ENC,Ee.UTF8_ENC,Ee.ENCRYPT_OP,Ee.DECRYPT_OP,Ee.SIGN_OP,Ee.VERIFY_OP,Ee.LENGTH_0,Ee.LENGTH_1,Ee.LENGTH_16,Ee.LENGTH_32,Ee.LENGTH_64,Ee.LENGTH_128,Ee.LENGTH_256,Ee.LENGTH_512,Ee.LENGTH_1024,Ee.AES_LENGTH,Ee.HMAC_LENGTH,Ee.AES_BROWSER_ALGO,Ee.HMAC_BROWSER_ALGO,Ee.HMAC_BROWSER,Ee.SHA256_BROWSER_ALGO,Ee.SHA512_BROWSER_ALGO,Ee.AES_NODE_ALGO,Ee.HMAC_NODE_ALGO,Ee.SHA256_NODE_ALGO,Ee.SHA512_NODE_ALGO,Ee.RIPEMD160_NODE_ALGO,Ee.PREFIX_LENGTH,Ee.KEY_LENGTH,Ee.IV_LENGTH,Ee.MAC_LENGTH,Ee.DECOMPRESSED_LENGTH,Ee.PREFIXED_KEY_LENGTH,Ee.PREFIXED_DECOMPRESSED_LENGTH,Ee.MAX_KEY_LENGTH,Ee.MAX_MSG_LENGTH,Ee.EMPTY_BUFFER,Ee.EC_GROUP_ORDER,Ee.ZERO32,Ee.ERROR_BAD_MAC,Ee.ERROR_BAD_PRIVATE_KEY,Ee.ERROR_BAD_PUBLIC_KEY,Ee.ERROR_EMPTY_MESSAGE,Ee.ERROR_MESSAGE_TOO_LONG;var Se=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(X)}));Object(y.c)(Se);var Me=Object(y.b)((function(e,t){function r(e){return e.length===Ee.KEY_LENGTH||e.length===Ee.PREFIXED_KEY_LENGTH}function i(e){return r(e)?e.length===Ee.PREFIXED_KEY_LENGTH:e.length===Ee.PREFIXED_DECOMPRESSED_LENGTH}function o(e){return Se.hexToNumber(Se.removeHexLeadingZeros(Se.bufferToHex(e)))-27}Object.defineProperty(t,"__esModule",{value:!0}),t.isCompressed=r,t.isDecompressed=function(e){return e.length===Ee.DECOMPRESSED_LENGTH||e.length===Ee.PREFIXED_DECOMPRESSED_LENGTH},t.isPrefixed=i,t.sanitizePublicKey=function(e){return i(e)?e:n.from("04".concat(e.toString("hex")),"hex")},t.exportRecoveryParam=function(e){return Se.hexToBuffer(Se.sanitizeHex((e+27).toString(16)))},t.importRecoveryParam=o,t.splitSignature=function(e){return{r:e.slice(0,32),s:e.slice(32,64),v:e.slice(64,65)}},t.joinSignature=function(e){return Se.concatBuffers(e.r,e.s,e.v)},t.isValidDERSignature=function(e){return Se.bufferToHex(e).startsWith("30")&&e.length>65},t.sanitizeRSVSignature=function(e){return{signature:e.slice(0,64),recovery:o(e.slice(64,65))}}}));Object(y.c)(Me),Me.isCompressed,Me.isDecompressed,Me.isPrefixed,Me.sanitizePublicKey,Me.exportRecoveryParam,Me.importRecoveryParam,Me.splitSignature,Me.joinSignature,Me.isValidDERSignature,Me.sanitizeRSVSignature;var ke=Object(y.b)((function(e,t){function r(e){return n.isBuffer(e)&&32===e.length}Object.defineProperty(t,"__esModule",{value:!0}),t.assert=function(e,t){if(!e)throw new Error(t||"Assertion failed")},t.isScalar=r,t.isValidPrivateKey=function(e){return!!r(e)&&e.compare(Ee.ZERO32)>0&&e.compare(Ee.EC_GROUP_ORDER)<0},t.equalConstTime=function(e,t){if(e.length!==t.length)return!1;for(var r=0,n=0;nEe.MAX_KEY_LENGTH||parseInt(String(e))!==e)}}));Object(y.c)(ke),ke.assert,ke.isScalar,ke.isValidPrivateKey,ke.equalConstTime,ke.isValidKeyLength;var Re=Object(y.b)((function(e,t){function r(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),r(Se),r(Me),r(ke)}));Object(y.c)(Re);var Oe=Object(y.b)((function(e,t){!function(t){function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t255)return!1;return!0}function i(e,t){if(e.buffer&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function o(e){return new Uint8Array(e)}function a(e,t,r,n,i){null==n&&null==i||(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var s,c={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},u=(s="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r>4]+s[15&n])}return t.join("")}}),f={16:10,24:12,32:14},h=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],l=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],p=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],b=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],v=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],g=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],m=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],y=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],A=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],w=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],E=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],S=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],M=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],k=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function R(e){for(var t=[],r=0;r>2,this._Ke[r][t%4]=o[t],this._Kd[e-r][t%4]=o[t];for(var a,s=0,c=i;c>16&255]<<24^d[a>>8&255]<<16^d[255&a]<<8^d[a>>24&255]^h[s]<<24,s+=1,8!=i)for(t=1;t>8&255]<<8^d[a>>16&255]<<16^d[a>>24&255]<<24,t=i/2+1;t>2,l=c%4,this._Ke[u][l]=o[t],this._Kd[e-u][l]=o[t++],c++}for(var u=1;u>24&255]^S[a>>16&255]^M[a>>8&255]^k[255&a]},O.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=R(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var a=1;a>24&255]^b[n[(i+1)%4]>>16&255]^v[n[(i+2)%4]>>8&255]^g[255&n[(i+3)%4]]^this._Ke[a][i];n=r.slice()}var s,c=o(16);for(i=0;i<4;i++)s=this._Ke[t][i],c[4*i]=255&(d[n[i]>>24&255]^s>>24),c[4*i+1]=255&(d[n[(i+1)%4]>>16&255]^s>>16),c[4*i+2]=255&(d[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(d[255&n[(i+3)%4]]^s);return c},O.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=R(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var a=1;a>24&255]^y[n[(i+3)%4]>>16&255]^A[n[(i+2)%4]>>8&255]^w[255&n[(i+1)%4]]^this._Kd[a][i];n=r.slice()}var s,c=o(16);for(i=0;i<4;i++)s=this._Kd[t][i],c[4*i]=255&(l[n[i]>>24&255]^s>>24),c[4*i+1]=255&(l[n[(i+3)%4]>>16&255]^s>>16),c[4*i+2]=255&(l[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(l[255&n[(i+1)%4]]^s);return c};var x=function e(t){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new O(t)};x.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;nNumber.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var t=15;t>=0;--t)this._counter[t]=e%256,e=parseInt(e/256)},T.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},T.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var L=function e(t,r){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",r instanceof T||(r=new T(r)),this._counter=r,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new O(t)};L.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n4294967295)throw new RangeError("requested too many random bytes");var o=r.allocUnsafe(t);if(t>0)if(t>65536)for(var a=0;a=e.length)&&56320==(64512&e.charCodeAt(t+1))}function Be(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function Ne(e){return 1===e.length?"0"+e:e}function Pe(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}var je={inherits:Te,toArray:function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,r[n++]=63&o|128):Le(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i>>0}return o},split32:function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},rotr32:function(e,t){return e>>>t|e<<32-t},rotl32:function(e,t){return e<>>32-t},sum32:function(e,t){return e+t>>>0},sum32_3:function(e,t,r){return e+t+r>>>0},sum32_4:function(e,t,r,n){return e+t+r+n>>>0},sum32_5:function(e,t,r,n,i){return e+t+r+n+i>>>0},sum64:function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o>>0,e[t+1]=o},sum64_hi:function(e,t,r,n){return(t+n>>>0>>0},sum64_lo:function(e,t,r,n){return t+n>>>0},sum64_4_hi:function(e,t,r,n,i,o,a,s){var c=0,u=t;return c+=(u=u+n>>>0)>>0)>>0)>>0},sum64_4_lo:function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},sum64_5_hi:function(e,t,r,n,i,o,a,s,c,u){var f=0,h=t;return f+=(h=h+n>>>0)>>0)>>0)>>0)>>0},sum64_5_lo:function(e,t,r,n,i,o,a,s,c,u){return t+n+o+s+u>>>0},rotr64_hi:function(e,t,r){return(t<<32-r|e>>>r)>>>0},rotr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0},shr64_hi:function(e,t,r){return e>>>r},shr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0}};function De(){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 He=De;De.prototype.update=function(e,t){if(e=je.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=je.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o>>3},Je=function(e){return Ge(e,17)^Ge(e,19)^e>>>10},Qe=je.rotl32,$e=je.sum32,et=je.sum32_5,tt=Ue,rt=ze.BlockHash,nt=[1518500249,1859775393,2400959708,3395469782];function it(){if(!(this instanceof it))return new it;rt.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}je.inherits(it,rt);var ot=it;it.blockSize=512,it.outSize=160,it.hmacStrength=80,it.padLength=64,it.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),_e(e.length<=this.blockSize);for(var t=e.length;t1&&void 0!==arguments[1]?arguments[1]:Ee.AES_BROWSER_ALGO;return r(this,void 0,void 0,m.a.mark((function r(){var n,i,a;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=o(),i=t===Ee.AES_BROWSER_ALGO?{length:Ee.AES_LENGTH,name:Ee.AES_BROWSER_ALGO}:{hash:{name:Ee.HMAC_BROWSER_ALGO},name:Ee.HMAC_BROWSER},a=t===Ee.AES_BROWSER_ALGO?[Ee.ENCRYPT_OP,Ee.DECRYPT_OP]:[Ee.SIGN_OP,Ee.VERIFY_OP],r.next=3,n.importKey("raw",e,i,!0,a);case 3:return r.abrupt("return",r.sent);case 4:case"end":return r.stop()}}),r)})))}Object.defineProperty(t,"__esModule",{value:!0}),t.getBrowerCrypto=i,t.getSubtleCrypto=o,t.browserRandomBytes=function(e){var t=i();return void 0!==t.getRandomValues?Re.arrayToBuffer(t.getRandomValues(new Uint8Array(e))):vr.fallbackRandomBytes(e)},t.browserImportKey=a,t.browserAesEncrypt=function(e,t,i){return r(this,void 0,void 0,m.a.mark((function r(){var s,c,u;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return s=o(),r.next=3,a(t,Ee.AES_BROWSER_ALGO);case 3:return c=r.sent,r.next=6,s.encrypt({iv:e,name:Ee.AES_BROWSER_ALGO},c,i);case 6:return u=r.sent,r.abrupt("return",n.from(u));case 8:case"end":return r.stop()}}),r)})))},t.browserAesDecrypt=function(e,t,i){return r(this,void 0,void 0,m.a.mark((function r(){var s,c,u;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return s=o(),r.next=3,a(t,Ee.AES_BROWSER_ALGO);case 3:return c=r.sent,r.next=6,s.decrypt({iv:e,name:Ee.AES_BROWSER_ALGO},c,i);case 6:return u=r.sent,r.abrupt("return",n.from(u));case 8:case"end":return r.stop()}}),r)})))},t.browserHmacSha256Sign=function(e,t){return r(this,void 0,void 0,m.a.mark((function r(){var i,s,c;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=o(),r.next=3,a(e,Ee.HMAC_BROWSER);case 3:return s=r.sent,r.next=6,i.sign({length:Ee.HMAC_LENGTH,name:Ee.HMAC_BROWSER},s,t);case 6:return c=r.sent,r.abrupt("return",n.from(c));case 8:case"end":return r.stop()}}),r)})))},t.browserHmacSha512Sign=function(e,t){return r(this,void 0,void 0,m.a.mark((function r(){var i,s,c;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=o(),r.next=3,a(e,Ee.HMAC_BROWSER);case 3:return s=r.sent,r.next=6,i.sign({length:Ee.LENGTH_512,name:Ee.HMAC_BROWSER},s,t);case 6:return c=r.sent,r.abrupt("return",n.from(c));case 8:case"end":return r.stop()}}),r)})))},t.browserSha256=function(e){return r(this,void 0,void 0,m.a.mark((function t(){var r,i;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o(),t.next=3,r.digest({name:Ee.SHA256_BROWSER_ALGO},e);case 3:return i=t.sent,t.abrupt("return",n.from(i));case 5:case"end":return t.stop()}}),t)})))},t.browserSha512=function(e){return r(this,void 0,void 0,m.a.mark((function t(){var r,i;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o(),t.next=3,r.digest({name:Ee.SHA512_BROWSER_ALGO},e);case 3:return i=t.sent,t.abrupt("return",n.from(i));case 5:case"end":return t.stop()}}),t)})))}}));Object(y.c)(gr),gr.getBrowerCrypto,gr.getSubtleCrypto,gr.browserRandomBytes,gr.browserImportKey,gr.browserAesEncrypt,gr.browserAesDecrypt,gr.browserHmacSha256Sign,gr.browserHmacSha512Sign,gr.browserSha256,gr.browserSha512;var mr=Object(y.b)((function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.isBrowser=function(){return!!gr.getBrowerCrypto()&&!!gr.getSubtleCrypto()},r.isNode=function(){return"undefined"!=typeof e&&void 0!==e.versions&&void 0!==e.versions.node}}));Object(y.c)(mr),mr.isBrowser,mr.isNode;var yr=Object(y.b)((function(e,t){var r=y.d&&y.d.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(A.c);t.nodeRandomBytes=function(e){return i.default.randomBytes(e)},t.nodeAesEncrypt=function(e,t,r){var n=i.default.createCipheriv(Ee.AES_NODE_ALGO,t,e);return Re.concatBuffers(n.update(r),n.final())},t.nodeAesDecrypt=function(e,t,r){var n=i.default.createDecipheriv(Ee.AES_NODE_ALGO,t,e);return Re.concatBuffers(n.update(r),n.final())},t.nodeHmacSha256Sign=function(e,t){return i.default.createHmac(Ee.HMAC_NODE_ALGO,n.from(e)).update(t).digest()},t.nodeHmacSha512Sign=function(e,t){return i.default.createHmac(Ee.SHA512_NODE_ALGO,n.from(e)).update(t).digest()},t.nodeSha256=function(e){return i.default.createHash(Ee.SHA256_NODE_ALGO).update(e).digest()},t.nodeSha512=function(e){return i.default.createHash(Ee.SHA512_NODE_ALGO).update(e).digest()},t.nodeRipemd160=function(e){return i.default.createHash(Ee.RIPEMD160_NODE_ALGO).update(e).digest()}}));Object(y.c)(yr),yr.nodeRandomBytes,yr.nodeAesEncrypt,yr.nodeAesDecrypt,yr.nodeHmacSha256Sign,yr.nodeHmacSha512Sign,yr.nodeSha256,yr.nodeSha512,yr.nodeRipemd160;var Ar=Object(y.b)((function(e,t){var r=y.d&&y.d.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(a,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.aesCbcEncrypt=function(e,t,n){return r(this,void 0,void 0,m.a.mark((function r(){var i;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!mr.isBrowser()){r.next=6;break}return r.next=3,gr.browserAesEncrypt(e,t,n);case 3:r.t0=r.sent,r.next=7;break;case 6:r.t0=mr.isNode()?yr.nodeAesEncrypt(e,t,n):vr.fallbackAesEncrypt(e,t,n);case 7:return i=r.t0,r.abrupt("return",i);case 9:case"end":return r.stop()}}),r)})))},t.aesCbcDecrypt=function(e,t,n){return r(this,void 0,void 0,m.a.mark((function r(){var i;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!mr.isBrowser()){r.next=6;break}return r.next=3,gr.browserAesDecrypt(e,t,n);case 3:r.t0=r.sent,r.next=7;break;case 6:r.t0=mr.isNode()?yr.nodeAesDecrypt(e,t,n):vr.fallbackAesDecrypt(e,t,n);case 7:return i=r.t0,r.abrupt("return",i);case 9:case"end":return r.stop()}}),r)})))},t.aesCbcEncryptSync=function(e,t,r){return mr.isNode()?yr.nodeAesEncrypt(e,t,r):vr.fallbackAesEncrypt(e,t,r)},t.aesCbcDecryptSync=function(e,t,r){return mr.isNode()?yr.nodeAesDecrypt(e,t,r):vr.fallbackAesDecrypt(e,t,r)}}));Object(y.c)(Ar),Ar.aesCbcEncrypt,Ar.aesCbcDecrypt,Ar.aesCbcEncryptSync,Ar.aesCbcDecryptSync;var wr=Object.prototype.toString,Er=function(e,t){if(!n.isBuffer(e))throw TypeError(t)},Sr=function(e,t,r){if(e.length!==t)throw RangeError(r)},Mr=function(e,t,r,n){if(e.length!==t&&e.length!==r)throw RangeError(n)},kr=function(e,t){if(0===e.length)throw RangeError(t)},Rr=xe.Buffer,Or=function(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");var t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");var r=e[5+t];if(0===r)throw new Error("S length is zero");if(6+t+r!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(r>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}},xr=function(e,t){var r=e.length,n=t.length;if(0===r)throw new Error("R length is zero");if(0===n)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(n>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&t[0])throw new Error("S value is negative");if(r>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(n>1&&0===t[0]&&!(128&t[1]))throw new Error("S value excessively padded");var i=Rr.allocUnsafe(6+r+n);return i[0]=48,i[1]=i.length-2,i[2]=2,i[3]=e.length,e.copy(i,4),i[4+r]=2,i[5+r]=t.length,t.copy(i,6+r),i},Ir=xe.Buffer,_r=Ir.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]),Cr=Ir.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]),Tr="scalar was invalid (zero or overflow)",Lr="nonce generation function failed or private key is invalid",Br={COMPRESSED_TYPE_INVALID:"compressed should be a boolean",EC_PRIVATE_KEY_TYPE_INVALID:"private key should be a Buffer",EC_PRIVATE_KEY_LENGTH_INVALID:"private key length is invalid",EC_PRIVATE_KEY_RANGE_INVALID:"private key range is invalid",EC_PRIVATE_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting private key is invalid",EC_PRIVATE_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PRIVATE_KEY_EXPORT_DER_FAIL:"couldn't export to DER format",EC_PRIVATE_KEY_IMPORT_DER_FAIL:"couldn't import from DER format",EC_PUBLIC_KEYS_TYPE_INVALID:"public keys should be an Array",EC_PUBLIC_KEYS_LENGTH_INVALID:"public keys Array should have at least 1 element",EC_PUBLIC_KEY_TYPE_INVALID:"public key should be a Buffer",EC_PUBLIC_KEY_LENGTH_INVALID:"public key length is invalid",EC_PUBLIC_KEY_PARSE_FAIL:"the public key could not be parsed or is invalid",EC_PUBLIC_KEY_CREATE_FAIL:"private was invalid, try again",EC_PUBLIC_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting public key is invalid",EC_PUBLIC_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PUBLIC_KEY_COMBINE_FAIL:"the sum of the public keys is not valid",ECDH_FAIL:Tr,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:Lr,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"},Nr=Object(y.f)(Object.freeze({__proto__:null,COMPRESSED_TYPE_INVALID:"compressed should be a boolean",EC_PRIVATE_KEY_TYPE_INVALID:"private key should be a Buffer",EC_PRIVATE_KEY_LENGTH_INVALID:"private key length is invalid",EC_PRIVATE_KEY_RANGE_INVALID:"private key range is invalid",EC_PRIVATE_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting private key is invalid",EC_PRIVATE_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PRIVATE_KEY_EXPORT_DER_FAIL:"couldn't export to DER format",EC_PRIVATE_KEY_IMPORT_DER_FAIL:"couldn't import from DER format",EC_PUBLIC_KEYS_TYPE_INVALID:"public keys should be an Array",EC_PUBLIC_KEYS_LENGTH_INVALID:"public keys Array should have at least 1 element",EC_PUBLIC_KEY_TYPE_INVALID:"public key should be a Buffer",EC_PUBLIC_KEY_LENGTH_INVALID:"public key length is invalid",EC_PUBLIC_KEY_PARSE_FAIL:"the public key could not be parsed or is invalid",EC_PUBLIC_KEY_CREATE_FAIL:"private was invalid, try again",EC_PUBLIC_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting public key is invalid",EC_PUBLIC_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PUBLIC_KEY_COMBINE_FAIL:"the sum of the public keys is not valid",ECDH_FAIL:Tr,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:Lr,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",default:Br}));function Pr(e,t){return void 0===e?t:(function(e,t){if("[object Boolean]"!==wr.call(e))throw TypeError(t)}(e,Nr.COMPRESSED_TYPE_INVALID),e)}var jr=y.g.EventEmitter;function Dr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Hr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zr(e,t){for(var r=0;r0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return Gr.alloc(0);for(var t=Gr.allocUnsafe(e>>>0),r=this.head,n=0;r;)Yr(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=Gr.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:Wr,value:function(e,t){return Fr(this,function(e){for(var t=1;t2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}$r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),$r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,i;if("string"==typeof t&&function(e,t,r){return e.substr(0,t.length)===t}(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))i="The ".concat(e," ").concat(n," ").concat(en(t,"type"));else{var o=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+".".length>e.length)&&-1!==e.indexOf(".",r)}(e)?"property":"argument";i='The "'.concat(e,'" ').concat(o," ").concat(n," ").concat(en(t,"type"))}return i+". Received type ".concat(typeof r)}),TypeError),$r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),$r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),$r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),$r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),$r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),$r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),$r("ERR_STREAM_WRITE_AFTER_END","write after end"),$r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),$r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),$r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");var tn={codes:Qr},rn=tn.codes.ERR_INVALID_OPT_VALUE,nn=function(e,t,r,n){var i=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,n,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new rn(n?r:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384};function on(e){try{if(!y.d.localStorage)return!1}catch(e){return!1}var t=y.d.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}var an,sn=Rn;function cn(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(void 0),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}Rn.WritableState=kn;var un,fn=function(e,t){if(on("noDeprecation"))return e;var r=!1;return function(){if(!r){if(on("throwDeprecation"))throw new Error(t);on("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}},hn=A.a.Buffer,dn=y.d.Uint8Array||function(){},ln=nn,pn=tn.codes,bn=pn.ERR_INVALID_ARG_TYPE,vn=pn.ERR_METHOD_NOT_IMPLEMENTED,gn=pn.ERR_MULTIPLE_CALLBACK,mn=pn.ERR_STREAM_CANNOT_PIPE,yn=pn.ERR_STREAM_DESTROYED,An=pn.ERR_STREAM_NULL_VALUES,wn=pn.ERR_STREAM_WRITE_AFTER_END,En=pn.ERR_UNKNOWN_ENCODING,Sn=Jr;function Mn(){}function kn(t,r,n){an=an||Bn,t=t||{},"boolean"!=typeof n&&(n=r instanceof an),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=ln(this,t,"writableHighWaterMark",n),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=!1===t.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,r){var n=t._writableState,i=n.sync,o=n.writecb;if("function"!=typeof o)throw new gn;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),r)!function(t,r,n,i,o){--r.pendingcb,n?(e.nextTick(o,i),e.nextTick(Tn,t,r),t._writableState.errorEmitted=!0,Sn(t,i)):(o(i),t._writableState.errorEmitted=!0,Sn(t,i),Tn(t,r))}(t,n,i,r,o);else{var a=_n(n)||t.destroyed;a||n.corked||n.bufferProcessing||!n.bufferedRequest||In(t,n),i?e.nextTick(xn,t,n,a,o):xn(t,n,a,o)}}(r,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new cn(this)}function Rn(e){var t=this instanceof(an=an||Bn);if(!t&&!un.call(Rn,this))return new Rn(e);this._writableState=new kn(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),jr.call(this)}function On(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new yn("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function xn(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),Tn(e,t)}function In(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)i[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;i.allBuffers=s,On(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new cn(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,u=r.encoding,f=r.callback;if(On(e,t,!1,t.objectMode?1:c.length,c,u,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function _n(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function Cn(e,t){e._final((function(r){t.pendingcb--,r&&Sn(e,r),t.prefinished=!0,e.emit("prefinish"),Tn(e,t)}))}function Tn(t,r){var n=_n(r);if(n&&(function(t,r){r.prefinished||r.finalCalled||("function"!=typeof t._final||r.destroyed?(r.prefinished=!0,t.emit("prefinish")):(r.pendingcb++,r.finalCalled=!0,e.nextTick(Cn,t,r)))}(t,r),0===r.pendingcb&&(r.finished=!0,t.emit("finish"),r.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return n}Te(Rn,jr),kn.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(kn.prototype,"buffer",{get:fn((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(yc){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(un=Function.prototype[Symbol.hasInstance],Object.defineProperty(Rn,Symbol.hasInstance,{value:function(e){return!!un.call(this,e)||this===Rn&&e&&e._writableState instanceof kn}})):un=function(e){return e instanceof this},Rn.prototype.pipe=function(){Sn(this,new mn)},Rn.prototype.write=function(t,r,n){var i,o=this._writableState,a=!1,s=!o.objectMode&&(i=t,hn.isBuffer(i)||i instanceof dn);return s&&!hn.isBuffer(t)&&(t=function(e){return hn.from(e)}(t)),"function"==typeof r&&(n=r,r=null),s?r="buffer":r||(r=o.defaultEncoding),"function"!=typeof n&&(n=Mn),o.ending?function(t,r){var n=new wn;Sn(t,n),e.nextTick(r,n)}(this,n):(s||function(t,r,n,i){var o;return null===n?o=new An:"string"==typeof n||r.objectMode||(o=new bn("chunk",["string","Buffer"],n)),!o||(Sn(t,o),e.nextTick(i,o),!1)}(this,o,t,n))&&(o.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=hn.from(t,r)),t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var c=t.length-1))throw new En(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(Rn.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(Rn.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Rn.prototype._write=function(e,t,r){r(new vn("_write()"))},Rn.prototype._writev=null,Rn.prototype.end=function(t,r,n){var i=this._writableState;return"function"==typeof t?(n=t,t=null,r=null):"function"==typeof r&&(n=r,r=null),null!=t&&this.write(t,r),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,r,n){r.ending=!0,Tn(t,r),n&&(r.finished?e.nextTick(n):t.once("finish",n)),r.ended=!0,t.writable=!1}(this,i,n),this},Object.defineProperty(Rn.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(Rn.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),Rn.prototype.destroy=qr,Rn.prototype._undestroy=Xr,Rn.prototype._destroy=function(e,t){t(e)};var Ln=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t},Bn=Dn;Te(Dn,Ai);for(var Nn=Ln(sn.prototype),Pn=0;Pn>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function Kn(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function Vn(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function Zn(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function qn(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function Xn(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Jn(e){return e.toString(this.encoding)}function Qn(e){return e&&e.length?this.write(e):""}Yn.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},Yn.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};var $n={StringDecoder:Wn},ei=tn.codes.ERR_STREAM_PREMATURE_CLOSE;function ti(){}var ri,ni=function e(t,r,n){if("function"==typeof r)return e(t,null,r);r||(r={}),n=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===Si.prototype||(t=function(e){return Si.from(e)}(t)),n)a.endEmitted?Bi(e,new Li):Hi(e,a,t,!0);else if(a.ended)Bi(e,new Ci);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?Hi(e,a,t,!1):Wi(e,a)):Hi(e,a,t,!1)}else n||(a.reading=!1,Wi(e,a));return!a.ended&&(a.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function Gi(t){var r=t._readableState;wi("emitReadable",r.needReadable,r.emittedReadable),r.needReadable=!1,r.emittedReadable||(wi("emitReadable",r.flowing),r.emittedReadable=!0,e.nextTick(Fi,t))}function Fi(e){var t=e._readableState;wi("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,Zi(e)}function Wi(t,r){r.readingMore||(r.readingMore=!0,e.nextTick(Yi,t,r))}function Yi(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function Ki(e){wi("readable nexttick read 0"),e.read(0)}function Vi(e,t){wi("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),Zi(e),t.flowing&&!t.reading&&e.read(0)}function Zi(e){var t=e._readableState;for(wi("flow",t.flowing);t.flowing&&null!==e.read(););}function qi(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function Xi(t){var r=t._readableState;wi("endReadable",r.endEmitted),r.endEmitted||(r.ended=!0,e.nextTick(Ji,r,t))}function Ji(e,t){if(wi("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function Qi(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return wi("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?Xi(this):Gi(this),null;if(0===(e=zi(e,t))&&t.ended)return 0===t.length&&Xi(this),null;var n,i=t.needReadable;return wi("need readable",i),(0===t.length||t.length-e0?qi(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&Xi(this)),null!==n&&this.emit("data",n),n},ji.prototype._read=function(e){Bi(this,new Ti("_read()"))},ji.prototype.pipe=function(t,r){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,wi("pipe count=%d opts=%j",i.pipesCount,r);var o=r&&!1===r.end||t===e.stdout||t===e.stderr?l:a;function a(){wi("onend"),t.end()}i.endEmitted?e.nextTick(o):n.once("end",o),t.on("unpipe",(function e(r,o){wi("onunpipe"),r===n&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,wi("cleanup"),t.removeListener("close",h),t.removeListener("finish",d),t.removeListener("drain",s),t.removeListener("error",f),t.removeListener("unpipe",e),n.removeListener("end",a),n.removeListener("end",l),n.removeListener("data",u),c=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||s())}));var s=function(e){return function(){var t=e._readableState;wi("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&Ei(e,"data")&&(t.flowing=!0,Zi(e))}}(n);t.on("drain",s);var c=!1;function u(e){wi("ondata");var r=t.write(e);wi("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==Qi(i.pipes,t))&&!c&&(wi("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function f(e){wi("onerror",e),l(),t.removeListener("error",f),0===Ei(t,"error")&&Bi(t,e)}function h(){t.removeListener("finish",d),l()}function d(){wi("onfinish"),t.removeListener("close",h),l()}function l(){wi("unpipe"),n.unpipe(t)}return n.on("data",u),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(t,"error",f),t.once("close",h),t.once("finish",d),t.emit("pipe",n),i.flowing||(wi("pipe resume"),n.resume()),t},ji.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,wi("on readable",i.length,i.reading),i.length?Gi(this):i.reading||e.nextTick(Ki,this))),n},ji.prototype.addListener=ji.prototype.on,ji.prototype.removeListener=function(t,r){var n=jr.prototype.removeListener.call(this,t,r);return"readable"===t&&e.nextTick(Ui,this),n},ji.prototype.removeAllListeners=function(t){var r=jr.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||e.nextTick(Ui,this),r},ji.prototype.resume=function(){var t=this._readableState;return t.flowing||(wi("resume"),t.flowing=!t.readableListening,function(t,r){r.resumeScheduled||(r.resumeScheduled=!0,e.nextTick(Vi,t,r))}(this,t)),t.paused=!1,this},ji.prototype.pause=function(){return wi("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(wi("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},ji.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(wi("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){wi("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o0,(function(e){n||(n=e),e&&o.forEach(mo),a||(o.forEach(mo),i(n))}))}));return t.reduce(yo)},Eo=Object(y.b)((function(e,t){(t=e.exports=Ai).Stream=t,t.Readable=t,t.Writable=sn,t.Duplex=Bn,t.Transform=$i,t.PassThrough=fo,t.finished=ni,t.pipeline=wo})),So=(Eo.Stream,Eo.Readable,Eo.Writable,Eo.Duplex,Eo.Transform,Eo.PassThrough,Eo.finished,Eo.pipeline,xe.Buffer),Mo=Eo.Transform;function ko(e){Mo.call(this),this._block=So.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}Te(ko,Mo),ko.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},ko.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},ko.prototype.update=function(e,t){if(function(e,t){if(!So.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");So.isBuffer(e)||(e=So.from(e,t));for(var r=this._block,n=0;this._blockOffset+e.length-n>=this._blockSize;){for(var i=this._blockOffset;i0;++o)this._length[o]+=a,(a=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*a);return this},ko.prototype._update=function(){throw new Error("_update is not implemented")},ko.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},ko.prototype._digest=function(){throw new Error("_digest is not implemented")};var Ro=ko,Oo=xe.Buffer,xo=new Array(16);function Io(){Ro.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function _o(e,t){return e<>>32-t}function Co(e,t,r,n,i,o,a){return _o(e+(t&r|~t&n)+i+o|0,a)+t|0}function To(e,t,r,n,i,o,a){return _o(e+(t&n|r&~n)+i+o|0,a)+t|0}function Lo(e,t,r,n,i,o,a){return _o(e+(t^r^n)+i+o|0,a)+t|0}function Bo(e,t,r,n,i,o,a){return _o(e+(r^(t|~n))+i+o|0,a)+t|0}Te(Io,Ro),Io.prototype._update=function(){for(var e=xo,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=Co(r,n,i,o,e[0],3614090360,7),o=Co(o,r,n,i,e[1],3905402710,12),i=Co(i,o,r,n,e[2],606105819,17),n=Co(n,i,o,r,e[3],3250441966,22),r=Co(r,n,i,o,e[4],4118548399,7),o=Co(o,r,n,i,e[5],1200080426,12),i=Co(i,o,r,n,e[6],2821735955,17),n=Co(n,i,o,r,e[7],4249261313,22),r=Co(r,n,i,o,e[8],1770035416,7),o=Co(o,r,n,i,e[9],2336552879,12),i=Co(i,o,r,n,e[10],4294925233,17),n=Co(n,i,o,r,e[11],2304563134,22),r=Co(r,n,i,o,e[12],1804603682,7),o=Co(o,r,n,i,e[13],4254626195,12),i=Co(i,o,r,n,e[14],2792965006,17),r=To(r,n=Co(n,i,o,r,e[15],1236535329,22),i,o,e[1],4129170786,5),o=To(o,r,n,i,e[6],3225465664,9),i=To(i,o,r,n,e[11],643717713,14),n=To(n,i,o,r,e[0],3921069994,20),r=To(r,n,i,o,e[5],3593408605,5),o=To(o,r,n,i,e[10],38016083,9),i=To(i,o,r,n,e[15],3634488961,14),n=To(n,i,o,r,e[4],3889429448,20),r=To(r,n,i,o,e[9],568446438,5),o=To(o,r,n,i,e[14],3275163606,9),i=To(i,o,r,n,e[3],4107603335,14),n=To(n,i,o,r,e[8],1163531501,20),r=To(r,n,i,o,e[13],2850285829,5),o=To(o,r,n,i,e[2],4243563512,9),i=To(i,o,r,n,e[7],1735328473,14),r=Lo(r,n=To(n,i,o,r,e[12],2368359562,20),i,o,e[5],4294588738,4),o=Lo(o,r,n,i,e[8],2272392833,11),i=Lo(i,o,r,n,e[11],1839030562,16),n=Lo(n,i,o,r,e[14],4259657740,23),r=Lo(r,n,i,o,e[1],2763975236,4),o=Lo(o,r,n,i,e[4],1272893353,11),i=Lo(i,o,r,n,e[7],4139469664,16),n=Lo(n,i,o,r,e[10],3200236656,23),r=Lo(r,n,i,o,e[13],681279174,4),o=Lo(o,r,n,i,e[0],3936430074,11),i=Lo(i,o,r,n,e[3],3572445317,16),n=Lo(n,i,o,r,e[6],76029189,23),r=Lo(r,n,i,o,e[9],3654602809,4),o=Lo(o,r,n,i,e[12],3873151461,11),i=Lo(i,o,r,n,e[15],530742520,16),r=Bo(r,n=Lo(n,i,o,r,e[2],3299628645,23),i,o,e[0],4096336452,6),o=Bo(o,r,n,i,e[7],1126891415,10),i=Bo(i,o,r,n,e[14],2878612391,15),n=Bo(n,i,o,r,e[5],4237533241,21),r=Bo(r,n,i,o,e[12],1700485571,6),o=Bo(o,r,n,i,e[3],2399980690,10),i=Bo(i,o,r,n,e[10],4293915773,15),n=Bo(n,i,o,r,e[1],2240044497,21),r=Bo(r,n,i,o,e[8],1873313359,6),o=Bo(o,r,n,i,e[15],4264355552,10),i=Bo(i,o,r,n,e[6],2734768916,15),n=Bo(n,i,o,r,e[13],1309151649,21),r=Bo(r,n,i,o,e[4],4149444226,6),o=Bo(o,r,n,i,e[11],3174756917,10),i=Bo(i,o,r,n,e[2],718787259,15),n=Bo(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},Io.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 e=Oo.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e};var No=Io,Po=A.a.Buffer,jo=new Array(16),Do=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Ho=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],zo=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Go=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],Fo=[0,1518500249,1859775393,2400959708,2840853838],Wo=[1352829926,1548603684,1836072691,2053994217,0];function Yo(){Ro.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function Uo(e,t){return e<>>32-t}function Ko(e,t,r,n,i,o,a,s){return Uo(e+(t^r^n)+o+a|0,s)+i|0}function Vo(e,t,r,n,i,o,a,s){return Uo(e+(t&r|~t&n)+o+a|0,s)+i|0}function Zo(e,t,r,n,i,o,a,s){return Uo(e+((t|~r)^n)+o+a|0,s)+i|0}function qo(e,t,r,n,i,o,a,s){return Uo(e+(t&n|r&~n)+o+a|0,s)+i|0}function Xo(e,t,r,n,i,o,a,s){return Uo(e+(t^(r|~n))+o+a|0,s)+i|0}Te(Yo,Ro),Yo.prototype._update=function(){for(var e=jo,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,a=0|this._e,s=0|this._a,c=0|this._b,u=0|this._c,f=0|this._d,h=0|this._e,d=0;d<80;d+=1){var l,p;d<16?(l=Ko(r,n,i,o,a,e[Do[d]],Fo[0],zo[d]),p=Xo(s,c,u,f,h,e[Ho[d]],Wo[0],Go[d])):d<32?(l=Vo(r,n,i,o,a,e[Do[d]],Fo[1],zo[d]),p=qo(s,c,u,f,h,e[Ho[d]],Wo[1],Go[d])):d<48?(l=Zo(r,n,i,o,a,e[Do[d]],Fo[2],zo[d]),p=Zo(s,c,u,f,h,e[Ho[d]],Wo[2],Go[d])):d<64?(l=qo(r,n,i,o,a,e[Do[d]],Fo[3],zo[d]),p=Vo(s,c,u,f,h,e[Ho[d]],Wo[3],Go[d])):(l=Xo(r,n,i,o,a,e[Do[d]],Fo[4],zo[d]),p=Ko(s,c,u,f,h,e[Ho[d]],Wo[4],Go[d])),r=a,a=o,o=Uo(i,10),i=n,n=l,s=h,h=f,f=Uo(u,10),u=c,c=p}var b=this._b+i+f|0;this._b=this._c+o+h|0,this._c=this._d+a+s|0,this._d=this._e+r+c|0,this._e=this._a+n+u|0,this._a=b},Yo.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 e=Po.alloc?Po.alloc(20):new Po(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e};var Jo=Yo,Qo=xe.Buffer;function $o(e,t){this._block=Qo.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}$o.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=Qo.from(e,t));for(var r=this._block,n=this._blockSize,i=e.length,o=this._len,a=0;a=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},$o.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var ea=$o,ta=xe.Buffer,ra=[1518500249,1859775393,-1894007588,-899497514],na=new Array(80);function ia(){this.init(),this._w=na,ea.call(this,64,56)}function oa(e){return e<<30|e>>>2}function aa(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}Te(ia,ea),ia.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},ia.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,c=0;c<16;++c)r[c]=e.readInt32BE(4*c);for(;c<80;++c)r[c]=r[c-3]^r[c-8]^r[c-14]^r[c-16];for(var u=0;u<80;++u){var f=~~(u/20),h=0|((t=n)<<5|t>>>27)+aa(f,i,o,a)+s+r[u]+ra[f];s=a,a=o,o=oa(i),i=n,n=h}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},ia.prototype._hash=function(){var e=ta.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var sa=ia,ca=xe.Buffer,ua=[1518500249,1859775393,-1894007588,-899497514],fa=new Array(80);function ha(){this.init(),this._w=fa,ea.call(this,64,56)}function da(e){return e<<5|e>>>27}function la(e){return e<<30|e>>>2}function pa(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}Te(ha,ea),ha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},ha.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,c=0;c<16;++c)r[c]=e.readInt32BE(4*c);for(;c<80;++c)r[c]=(t=r[c-3]^r[c-8]^r[c-14]^r[c-16])<<1|t>>>31;for(var u=0;u<80;++u){var f=~~(u/20),h=da(n)+pa(f,i,o,a)+s+r[u]+ua[f]|0;s=a,a=o,o=la(i),i=n,n=h}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},ha.prototype._hash=function(){var e=ca.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var ba=ha,va=xe.Buffer,ga=[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],ma=new Array(64);function ya(){this.init(),this._w=ma,ea.call(this,64,56)}function Aa(e,t,r){return r^e&(t^r)}function wa(e,t,r){return e&t|r&(e|t)}function Ea(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function Sa(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function Ma(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function ka(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Te(ya,ea),ya.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},ya.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,a=0|this._e,s=0|this._f,c=0|this._g,u=0|this._h,f=0;f<16;++f)t[f]=e.readInt32BE(4*f);for(;f<64;++f)t[f]=ka(t[f-2])+t[f-7]+Ma(t[f-15])+t[f-16]|0;for(var h=0;h<64;++h){var d=u+Sa(a)+Aa(a,s,c)+ga[h]+t[h]|0,l=Ea(r)+wa(r,n,i)|0;u=c,c=s,s=a,a=o+d|0,o=i,i=n,n=r,r=d+l|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0,this._f=s+this._f|0,this._g=c+this._g|0,this._h=u+this._h|0},ya.prototype._hash=function(){var e=va.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var Ra=ya,Oa=xe.Buffer,xa=new Array(64);function Ia(){this.init(),this._w=xa,ea.call(this,64,56)}Te(Ia,Ra),Ia.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},Ia.prototype._hash=function(){var e=Oa.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var _a=Ia,Ca=xe.Buffer,Ta=[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],La=new Array(160);function Ba(){this.init(),this._w=La,ea.call(this,128,112)}function Na(e,t,r){return r^e&(t^r)}function Pa(e,t,r){return e&t|r&(e|t)}function ja(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function Da(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Ha(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function za(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Ga(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Fa(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function Wa(e,t){return e>>>0>>0?1:0}Te(Ba,ea),Ba.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},Ba.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,a=0|this._eh,s=0|this._fh,c=0|this._gh,u=0|this._hh,f=0|this._al,h=0|this._bl,d=0|this._cl,l=0|this._dl,p=0|this._el,b=0|this._fl,v=0|this._gl,g=0|this._hl,m=0;m<32;m+=2)t[m]=e.readInt32BE(4*m),t[m+1]=e.readInt32BE(4*m+4);for(;m<160;m+=2){var y=t[m-30],A=t[m-30+1],w=Ha(y,A),E=za(A,y),S=Ga(y=t[m-4],A=t[m-4+1]),M=Fa(A,y),k=t[m-14],R=t[m-14+1],O=t[m-32],x=t[m-32+1],I=E+R|0,_=w+k+Wa(I,E)|0;_=(_=_+S+Wa(I=I+M|0,M)|0)+O+Wa(I=I+x|0,x)|0,t[m]=_,t[m+1]=I}for(var C=0;C<160;C+=2){_=t[C],I=t[C+1];var T=Pa(r,n,i),L=Pa(f,h,d),B=ja(r,f),N=ja(f,r),P=Da(a,p),j=Da(p,a),D=Ta[C],H=Ta[C+1],z=Na(a,s,c),G=Na(p,b,v),F=g+j|0,W=u+P+Wa(F,g)|0;W=(W=(W=W+z+Wa(F=F+G|0,G)|0)+D+Wa(F=F+H|0,H)|0)+_+Wa(F=F+I|0,I)|0;var Y=N+L|0,U=B+T+Wa(Y,N)|0;u=c,g=v,c=s,v=b,s=a,b=p,a=o+W+Wa(p=l+F|0,l)|0,o=i,l=d,i=n,d=h,n=r,h=f,r=W+U+Wa(f=F+Y|0,F)|0}this._al=this._al+f|0,this._bl=this._bl+h|0,this._cl=this._cl+d|0,this._dl=this._dl+l|0,this._el=this._el+p|0,this._fl=this._fl+b|0,this._gl=this._gl+v|0,this._hl=this._hl+g|0,this._ah=this._ah+r+Wa(this._al,f)|0,this._bh=this._bh+n+Wa(this._bl,h)|0,this._ch=this._ch+i+Wa(this._cl,d)|0,this._dh=this._dh+o+Wa(this._dl,l)|0,this._eh=this._eh+a+Wa(this._el,p)|0,this._fh=this._fh+s+Wa(this._fl,b)|0,this._gh=this._gh+c+Wa(this._gl,v)|0,this._hh=this._hh+u+Wa(this._hl,g)|0},Ba.prototype._hash=function(){var e=Ca.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var Ya=Ba,Ua=xe.Buffer,Ka=new Array(160);function Va(){this.init(),this._w=Ka,ea.call(this,128,112)}Te(Va,Ya),Va.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},Va.prototype._hash=function(){var e=Ua.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var Za=Va,qa=Object(y.b)((function(e){var t=e.exports=function(e){e=e.toLowerCase();var r=t[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};t.sha=sa,t.sha1=ba,t.sha224=_a,t.sha256=Ra,t.sha384=Za,t.sha512=Ya})),Xa=xe.Buffer,Ja=A.b.Transform,Qa=w.a.StringDecoder;function $a(e){Ja.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}Te($a,Ja),$a.prototype.update=function(e,t,r){"string"==typeof e&&(e=Xa.from(e,t));var n=this._update(e);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},$a.prototype.setAutoPadding=function(){},$a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},$a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},$a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},$a.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},$a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},$a.prototype._finalOrDigest=function(e){var t=this.__final()||Xa.alloc(0);return e&&(t=this._toString(t,e,!0)),t},$a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new Qa(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n};var es=$a;function ts(e){es.call(this,"digest"),this._hash=e}Te(ts,es),ts.prototype._update=function(e){this._hash.update(e)},ts.prototype._final=function(){return this._hash.digest()};var rs,ns=function(e){return"md5"===(e=e.toLowerCase())?new No:"rmd160"===e||"ripemd160"===e?new Jo:new ts(qa(e))},is=Object(y.b)((function(e){!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o=A.a.Buffer}catch(e){}function a(e,t,r){for(var n=0,i=Math.min(e.length,r),o=t;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function s(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},i.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=a(e,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==t&&(i=a(e,t,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,c=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var c=["","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"],u=[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],f=[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];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,h=67108863&c,d=Math.min(u,t.length-1),l=Math.max(0,u-e.length+1);l<=d;l++){var p=u-l|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[l])+h)/67108864|0,h=67108863&a}r.words[u]=0|h,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?c[6-h.length]+h+n:h+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var d=u[e],l=f[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(e);n=(p=p.idivn(l)).isZero()?b+n:c[d-b.length]+b+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===t,u=new e(o),f=this.clone();if(c){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),u[s]=a;for(;s=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},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,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},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,l=0|a[1],p=8191&l,b=l>>>13,v=0|a[2],g=8191&v,m=v>>>13,y=0|a[3],A=8191&y,w=y>>>13,E=0|a[4],S=8191&E,M=E>>>13,k=0|a[5],R=8191&k,O=k>>>13,x=0|a[6],I=8191&x,_=x>>>13,C=0|a[7],T=8191&C,L=C>>>13,B=0|a[8],N=8191&B,P=B>>>13,j=0|a[9],D=8191&j,H=j>>>13,z=0|s[0],G=8191&z,F=z>>>13,W=0|s[1],Y=8191&W,U=W>>>13,K=0|s[2],V=8191&K,Z=K>>>13,q=0|s[3],X=8191&q,J=q>>>13,Q=0|s[4],$=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],he=8191&fe,de=fe>>>13,le=0|s[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ve=(u+(n=Math.imul(h,G))|0)+((8191&(i=(i=Math.imul(h,F))+Math.imul(d,G)|0))<<13)|0;u=((o=Math.imul(d,F))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(p,G),i=(i=Math.imul(p,F))+Math.imul(b,G)|0,o=Math.imul(b,F);var ge=(u+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,U)|0)+Math.imul(d,Y)|0))<<13)|0;u=((o=o+Math.imul(d,U)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,G),i=(i=Math.imul(g,F))+Math.imul(m,G)|0,o=Math.imul(m,F),n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,U)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,U)|0;var me=(u+(n=n+Math.imul(h,V)|0)|0)+((8191&(i=(i=i+Math.imul(h,Z)|0)+Math.imul(d,V)|0))<<13)|0;u=((o=o+Math.imul(d,Z)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(A,G),i=(i=Math.imul(A,F))+Math.imul(w,G)|0,o=Math.imul(w,F),n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,U)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,U)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,Z)|0;var ye=(u+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(d,X)|0))<<13)|0;u=((o=o+Math.imul(d,J)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(S,G),i=(i=Math.imul(S,F))+Math.imul(M,G)|0,o=Math.imul(M,F),n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,U)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,U)|0,n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,Z)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,J)|0;var Ae=(u+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(d,$)|0))<<13)|0;u=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(R,G),i=(i=Math.imul(R,F))+Math.imul(O,G)|0,o=Math.imul(O,F),n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,U)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,U)|0,n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,Z)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,ee)|0;var we=(u+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(d,re)|0))<<13)|0;u=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(I,G),i=(i=Math.imul(I,F))+Math.imul(_,G)|0,o=Math.imul(_,F),n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,U)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,U)|0,n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,Z)|0,n=n+Math.imul(A,X)|0,i=(i=i+Math.imul(A,J)|0)+Math.imul(w,X)|0,o=o+Math.imul(w,J)|0,n=n+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0;var Ee=(u+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ae)|0)+Math.imul(d,oe)|0))<<13)|0;u=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(T,G),i=(i=Math.imul(T,F))+Math.imul(L,G)|0,o=Math.imul(L,F),n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,U)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,U)|0,n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,J)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(w,$)|0,o=o+Math.imul(w,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0;var Se=(u+(n=n+Math.imul(h,ce)|0)|0)+((8191&(i=(i=i+Math.imul(h,ue)|0)+Math.imul(d,ce)|0))<<13)|0;u=((o=o+Math.imul(d,ue)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(N,G),i=(i=Math.imul(N,F))+Math.imul(P,G)|0,o=Math.imul(P,F),n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,U)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,U)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,J)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0;var Me=(u+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(d,he)|0))<<13)|0;u=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,G),i=(i=Math.imul(D,F))+Math.imul(H,G)|0,o=Math.imul(H,F),n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,U)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,U)|0,n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,Z)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,n=n+Math.imul(g,ce)|0,i=(i=i+Math.imul(g,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(b,he)|0,o=o+Math.imul(b,de)|0;var ke=(u+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,be)|0)+Math.imul(d,pe)|0))<<13)|0;u=((o=o+Math.imul(d,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,Y),i=(i=Math.imul(D,U))+Math.imul(H,Y)|0,o=Math.imul(H,U),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,n=n+Math.imul(A,ce)|0,i=(i=i+Math.imul(A,ue)|0)+Math.imul(w,ce)|0,o=o+Math.imul(w,ue)|0,n=n+Math.imul(g,he)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(m,he)|0,o=o+Math.imul(m,de)|0;var Re=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,V),i=(i=Math.imul(D,Z))+Math.imul(H,V)|0,o=Math.imul(H,Z),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,J)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(S,ce)|0,i=(i=i+Math.imul(S,ue)|0)+Math.imul(M,ce)|0,o=o+Math.imul(M,ue)|0,n=n+Math.imul(A,he)|0,i=(i=i+Math.imul(A,de)|0)+Math.imul(w,he)|0,o=o+Math.imul(w,de)|0;var Oe=(u+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,be)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,X),i=(i=Math.imul(D,J))+Math.imul(H,X)|0,o=Math.imul(H,J),n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(L,re)|0,o=o+Math.imul(L,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,n=n+Math.imul(S,he)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(M,he)|0,o=o+Math.imul(M,de)|0;var xe=(u+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,be)|0)+Math.imul(w,pe)|0))<<13)|0;u=((o=o+Math.imul(w,be)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,ee))+Math.imul(H,$)|0,o=Math.imul(H,ee),n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,n=n+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,ue)|0)+Math.imul(_,ce)|0,o=o+Math.imul(_,ue)|0,n=n+Math.imul(R,he)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(O,he)|0,o=o+Math.imul(O,de)|0;var Ie=(u+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,be)|0)+Math.imul(M,pe)|0))<<13)|0;u=((o=o+Math.imul(M,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(H,re)|0,o=Math.imul(H,ne),n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,n=n+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,ue)|0)+Math.imul(L,ce)|0,o=o+Math.imul(L,ue)|0,n=n+Math.imul(I,he)|0,i=(i=i+Math.imul(I,de)|0)+Math.imul(_,he)|0,o=o+Math.imul(_,de)|0;var _e=(u+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,be)|0)+Math.imul(O,pe)|0))<<13)|0;u=((o=o+Math.imul(O,be)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,ae))+Math.imul(H,oe)|0,o=Math.imul(H,ae),n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(P,ce)|0,o=o+Math.imul(P,ue)|0,n=n+Math.imul(T,he)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(L,he)|0,o=o+Math.imul(L,de)|0;var Ce=(u+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,be)|0)+Math.imul(_,pe)|0))<<13)|0;u=((o=o+Math.imul(_,be)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(D,ce),i=(i=Math.imul(D,ue))+Math.imul(H,ce)|0,o=Math.imul(H,ue),n=n+Math.imul(N,he)|0,i=(i=i+Math.imul(N,de)|0)+Math.imul(P,he)|0,o=o+Math.imul(P,de)|0;var Te=(u+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,be)|0)+Math.imul(L,pe)|0))<<13)|0;u=((o=o+Math.imul(L,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,he),i=(i=Math.imul(D,de))+Math.imul(H,he)|0,o=Math.imul(H,de);var Le=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,be)|0)+Math.imul(P,pe)|0))<<13)|0;u=((o=o+Math.imul(P,be)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863;var Be=(u+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,be))+Math.imul(H,pe)|0))<<13)|0;return u=((o=Math.imul(H,be))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,c[0]=ve,c[1]=ge,c[2]=me,c[3]=ye,c[4]=Ae,c[5]=we,c[6]=Ee,c[7]=Se,c[8]=Me,c[9]=ke,c[10]=Re,c[11]=Oe,c[12]=xe,c[13]=Ie,c[14]=_e,c[15]=Ce,c[16]=Te,c[17]=Le,c[18]=Be,0!==u&&(c[19]=u,r.length++),r};function l(e,t,r){return(new p).mulp(e,t,r)}function p(e,t){this.x=e,this.y=t}Math.imul||(d=h),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?d(this,e,t):r<63?h(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):l(this,e,t)},p.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n>=1;return n},p.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==f||u>=i);u--){var h=0|this.words[u];this.words[u]=f<<26-o|h>>>o,f=h&s}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!==(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,c=n.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;h--){var d=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(o,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var f=n.clone(),h=t.clone();!t.isZero();){for(var d=0,l=1;0==(t.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(f),a.isub(h)),o.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(n.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(f),c.isub(h)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,f=1;0==(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var h=0,d=1;0==(n.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(n.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new E(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function m(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function y(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},n(g,v),g.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},g.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new g;else if("p224"===e)t=new m;else if("p192"===e)t=new y;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return b[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var h=this.pow(f,o),d=this.pow(e,o.addn(1).iushrn(1)),l=this.pow(e,o),p=a;0!==l.cmp(s);){for(var b=l,v=0;0!==b.cmp(s);v++)b=b.redSqr();r(v=0;n--){for(var u=t.words[n],f=c-1;f>=0;f--){var h=u>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===n&&0===f)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}c=26}return o},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},n(S,E),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,y.d)})),os="lib/elliptic.js",as=["lib"],ss={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",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},cs={type:"git",url:"git@github.com:indutny/elliptic"},us=["EC","Elliptic","curve","Cryptography"],fs="Fedor Indutny ",hs={url:"https://github.com/indutny/elliptic/issues"},ds="https://github.com/indutny/elliptic",ls={brfs:"^1.4.3",coveralls:"^3.0.8",grunt:"^1.0.4","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":"^9.0.1",istanbul:"^0.4.2",jscs:"^3.0.7",jshint:"^2.10.3",mocha:"^6.2.2"},ps={"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"},bs={name:"elliptic",version:"6.5.3",description:"EC cryptography",main:os,files:as,scripts:ss,repository:cs,keywords:us,author:fs,license:"MIT",bugs:hs,homepage:ds,devDependencies:ls,dependencies:ps},vs=Object.freeze({__proto__:null,name:"elliptic",version:"6.5.3",description:"EC cryptography",main:os,files:as,scripts:ss,repository:cs,keywords:us,author:fs,license:"MIT",bugs:hs,homepage:ds,devDependencies:ls,dependencies:ps,default:bs}),gs=Object(y.b)((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),ms=Object(y.b)((function(e,t){var r=t;r.assert=_e,r.toArray=gs.toArray,r.zero2=gs.zero2,r.toHex=gs.toHex,r.encode=gs.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-c:c,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n=0,i=0;e.cmpn(-n)>0||t.cmpn(-i)>0;){var o,a,s,c=e.andln(3)+n&3,u=t.andln(3)+i&3;3===c&&(c=-1),3===u&&(u=-1),o=0==(1&c)?0:3!==(s=e.andln(7)+n&7)&&5!==s||2!==u?c:-c,r[0].push(o),a=0==(1&u)?0:3!==(s=t.andln(7)+i&7)&&5!==s||2!==c?u:-u,r[1].push(a),2*n===o+1&&(n=1-n),2*i===a+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new is(e,"hex","le")}})),ys=function(e){return rs||(rs=new As(null)),rs.generate(e)};function As(e){this.rand=e}var ws=As;if(As.prototype.generate=function(e){return this._rand(e)},As.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Os=Rs;function xs(e,t){this.curve=e,this.type=t,this.precomputed=null}Rs.prototype.point=function(){throw new Error("Not implemented")},Rs.prototype.validate=function(){throw new Error("Not implemented")},Rs.prototype._fixedNafMul=function(e,t){ks(e.precomputed);var r=e._getDoubles(),n=Ss(t,1,this._bitLength),i=(1<=a;t--)s=(s<<1)+n[t];o.push(s)}for(var c=this.jpoint(null,null,null),u=this.jpoint(null,null,null),f=i;f>0;f--){for(a=0;a=0;s--){for(t=0;s>=0&&0===o[s];s--)t++;if(s>=0&&t++,a=a.dblp(t),s<0)break;var c=o[s];ks(0!==c),a="affine"===e.type?c>0?a.mixedAdd(i[c-1>>1]):a.mixedAdd(i[-c-1>>1].neg()):c>0?a.add(i[c-1>>1]):a.add(i[-c-1>>1].neg())}return"affine"===e.type?a.toP():a},Rs.prototype._wnafMulAdd=function(e,t,r,n,i){for(var o=this._wnafT1,a=this._wnafT2,s=this._wnafT3,c=0,u=0;u=1;u-=2){var h=u-1,d=u;if(1===o[h]&&1===o[d]){var l=[t[h],null,null,t[d]];0===t[h].y.cmp(t[d].y)?(l[1]=t[h].add(t[d]),l[2]=t[h].toJ().mixedAdd(t[d].neg())):0===t[h].y.cmp(t[d].y.redNeg())?(l[1]=t[h].toJ().mixedAdd(t[d]),l[2]=t[h].add(t[d].neg())):(l[1]=t[h].toJ().mixedAdd(t[d]),l[2]=t[h].toJ().mixedAdd(t[d].neg()));var p=[-3,-1,-5,-7,0,7,5,1,3],b=Ms(r[h],r[d]);c=Math.max(b[0].length,c),s[h]=new Array(c),s[d]=new Array(c);for(var v=0;v=0;u--){for(var w=0;u>=0;){var E=!0;for(v=0;v=0&&w++,y=y.dblp(w),u<0)break;for(v=0;v0?S=a[v][M-1>>1]:M<0&&(S=a[v][-M-1>>1].neg()),y="affine"===S.type?y.mixedAdd(S):y.add(S))}}for(u=0;u=Math.ceil((e.bitLength()+1)/t.step)},xs.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(o=t,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},_s.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},_s.prototype.pointFromX=function(e,t){(e=new is(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},_s.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},_s.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},Ts.prototype.isInfinity=function(){return this.inf},Ts.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},Ts.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},Ts.prototype.getX=function(){return this.x.fromRed()},Ts.prototype.getY=function(){return this.y.fromRed()},Ts.prototype.mul=function(e){return e=new is(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},Ts.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},Ts.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},Ts.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},Ts.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},Ts.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Te(Ls,Os.BasePoint),_s.prototype.jpoint=function(e,t,r){return new Ls(this,e,t,r)},Ls.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},Ls.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Ls.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),f=u.redMul(s),h=n.redMul(u),d=c.redSqr().redIAdd(f).redISub(h).redISub(h),l=c.redMul(h.redISub(d)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,l,p)},Ls.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),f=r.redMul(c),h=s.redSqr().redIAdd(u).redISub(f).redISub(f),d=s.redMul(f.redISub(h)).redISub(i.redMul(u)),l=this.z.redMul(a);return this.curve.jpoint(h,d,l)},Ls.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},Ls.prototype.inspect=function(){return this.isInfinity()?"":""},Ls.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Te(Bs,Os);var Ns=Bs;function Ps(e,t,r){Os.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new is(t,16),this.z=new is(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}Bs.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},Te(Ps,Os.BasePoint),Bs.prototype.decodePoint=function(e,t){return this.point(ms.toArray(e,t),1)},Bs.prototype.point=function(e,t){return new Ps(this,e,t)},Bs.prototype.pointFromJSON=function(e){return Ps.fromJSON(this,e)},Ps.prototype.precompute=function(){},Ps.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Ps.fromJSON=function(e,t){return new Ps(e,t[0],t[1]||e.one)},Ps.prototype.inspect=function(){return this.isInfinity()?"":""},Ps.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Ps.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},Ps.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Ps.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),c=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,c)},Ps.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},Ps.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Ps.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Ps.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},Ps.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Ps.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var js=ms.assert;function Ds(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,Os.call(this,"edwards",e),this.a=new is(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new is(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new is(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),js(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}Te(Ds,Os);var Hs=Ds;function zs(e,t,r,n,i){Os.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new is(t,16),this.y=new is(r,16),this.z=n?new is(n,16):this.curve.one,this.t=i&&new is(i,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}Ds.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},Ds.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},Ds.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},Ds.prototype.pointFromX=function(e,t){(e=new is(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=n.redMul(i.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var s=a.fromRed().isOdd();return(t&&!s||!t&&s)&&(a=a.redNeg()),this.point(e,a)},Ds.prototype.pointFromY=function(e,t){(e=new is(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=n.redMul(i.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},Ds.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},Te(zs,Os.BasePoint),Ds.prototype.pointFromJSON=function(e){return zs.fromJSON(this,e)},Ds.prototype.point=function(e,t,r,n){return new zs(this,e,t,r,n)},zs.fromJSON=function(e,t){return new zs(e,t[0],t[1],t[2])},zs.prototype.inspect=function(){return this.isInfinity()?"":""},zs.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},zs.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),c=i.redMul(a),u=o.redMul(s),f=i.redMul(s),h=a.redMul(o);return this.curve.point(c,u,h,f)},zs.prototype._projDbl=function(){var e,t,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(u=this.curve._mulA(i)).redAdd(o);if(this.zOne)e=n.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(u.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),c=a.redSub(s).redISub(s);e=n.redSub(i).redISub(o).redMul(c),t=a.redMul(u.redSub(o)),r=a.redMul(c)}}else{var u=i.redAdd(o);s=this.curve._mulC(this.z).redSqr(),c=u.redSub(s).redSub(s),e=this.curve._mulC(n.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(i.redISub(o)),r=u.redMul(c)}return this.curve.point(e,t,r)},zs.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},zs.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),c=r.redAdd(t),u=o.redMul(a),f=s.redMul(c),h=o.redMul(c),d=a.redMul(s);return this.curve.point(u,f,d,h)},zs.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),c=i.redSub(s),u=i.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),h=n.redMul(c).redMul(f);return this.curve.twisted?(t=n.redMul(u).redMul(a.redSub(this.curve._mulA(o))),r=c.redMul(u)):(t=n.redMul(u).redMul(a.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(h,t,r)},zs.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},zs.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},zs.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},zs.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},zs.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},zs.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},zs.prototype.getX=function(){return this.normalize(),this.x.fromRed()},zs.prototype.getY=function(){return this.normalize(),this.y.fromRed()},zs.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},zs.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},zs.prototype.toP=zs.prototype.normalize,zs.prototype.mixedAdd=zs.prototype.add;var Gs=Object(y.b)((function(e,t){var r=t;r.base=Os,r.short=Cs,r.mont=Ns,r.edwards=Hs})),Fs={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}},Ws=Object(y.b)((function(e,t){var r,n=t,i=ms.assert;function o(e){"short"===e.type?this.curve=new Gs.short(e):"edwards"===e.type?this.curve=new Gs.edwards(e):this.curve=new Gs.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,a("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:pr.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:pr.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:pr.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:pr.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"]}),a("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:pr.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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:pr.sha256,gRed:!1,g:["9"]}),a("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:pr.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=Fs}catch(e){r=void 0}a("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:pr.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Ys(e){if(!(this instanceof Ys))return new Ys(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=gs.toArray(e.entropy,e.entropyEnc||"hex"),r=gs.toArray(e.nonce,e.nonceEnc||"hex"),n=gs.toArray(e.pers,e.persEnc||"hex");_e(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var Us=Ys;Ys.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);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(e.concat(r||[])),this._reseed=1},Ys.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=gs.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var qs=ms.assert;function Xs(e,t){if(e instanceof Xs)return e;this._importDER(e,t)||(qs(e.r&&e.s,"Signature without r or s"),this.r=new is(e.r,16),this.s=new is(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var Js=Xs;function Qs(){this.place=0}function $s(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o>>=0;return!(i<=127)&&(t.place=a,i)}function ec(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}Xs.prototype._importDER=function(e,t){e=ms.toArray(e,t);var r=new Qs;if(48!==e[r.place++])return!1;var n=$s(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=$s(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=$s(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new is(o),this.s=new is(s),this.recoveryParam=null,!0},Xs.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=ec(t),r=ec(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];tc(n,t.length),(n=n.concat(t)).push(2),tc(n,r.length);var i=n.concat(r),o=[48];return tc(o,i.length),o=o.concat(i),ms.encode(o,e)};var rc=ms.assert;function nc(e){if(!(this instanceof nc))return new nc(e);"string"==typeof e&&(rc(Ws.hasOwnProperty(e),"Unknown curve "+e),e=Ws[e]),e instanceof Ws.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var ic=nc;nc.prototype.keyPair=function(e){return new Zs(this,e)},nc.prototype.keyFromPrivate=function(e,t){return Zs.fromPrivate(this,e,t)},nc.prototype.keyFromPublic=function(e,t){return Zs.fromPublic(this,e,t)},nc.prototype.genKeyPair=function(e){e||(e={});for(var t=new Us({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||ys(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new is(2));;){var i=new is(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},nc.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},nc.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new is(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new Us({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new is(1)),u=0;;u++){var f=n.k?n.k(u):new is(s.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(c)>=0)){var h=this.g.mul(f);if(!h.isInfinity()){var d=h.getX(),l=d.umod(this.n);if(0!==l.cmpn(0)){var p=f.invm(this.n).mul(l.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var b=(h.getY().isOdd()?1:0)|(0!==d.cmp(l)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),b^=1),new Js({r:l,s:p,recoveryParam:b})}}}}}},nc.prototype.verify=function(e,t,r,n){e=this._truncateToN(new is(e,16)),r=this.keyFromPublic(r,n);var i=(t=new Js(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),c=s.mul(e).umod(this.n),u=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},nc.prototype.recoverPubKey=function(e,t,r,n){rc((3&r)===r,"The recovery param is more than two bits"),t=new Js(t,n);var i=this.n,o=new is(e),a=t.r,s=t.s,c=1&r,u=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var f=t.r.invm(i),h=i.sub(o).mul(f).umod(i),d=s.mul(f).umod(i);return this.g.mulAdd(h,a,d)},nc.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new Js(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var oc=ms.assert,ac=ms.parseBytes,sc=ms.cachedProperty;function cc(e,t){this.eddsa=e,this._secret=ac(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=ac(t.pub)}cc.fromPublic=function(e,t){return t instanceof cc?t:new cc(e,{pub:t})},cc.fromSecret=function(e,t){return t instanceof cc?t:new cc(e,{secret:t})},cc.prototype.secret=function(){return this._secret},sc(cc,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),sc(cc,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),sc(cc,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),sc(cc,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),sc(cc,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),sc(cc,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),cc.prototype.sign=function(e){return oc(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},cc.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},cc.prototype.getSecret=function(e){return oc(this._secret,"KeyPair is public only"),ms.encode(this.secret(),e)},cc.prototype.getPublic=function(e){return ms.encode(this.pubBytes(),e)};var uc=cc,fc=ms.assert,hc=ms.cachedProperty,dc=ms.parseBytes;function lc(e,t){this.eddsa=e,"object"!=typeof t&&(t=dc(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),fc(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof is&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}hc(lc,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),hc(lc,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),hc(lc,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),hc(lc,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),lc.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},lc.prototype.toHex=function(){return ms.encode(this.toBytes(),"hex").toUpperCase()};var pc=lc,bc=ms.assert,vc=ms.parseBytes;function gc(e){if(bc("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof gc))return new gc(e);e=Ws[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=pr.sha512}var mc=gc;gc.prototype.sign=function(e,t){e=vc(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),s=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:o})},gc.prototype.verify=function(e,t,r){e=vc(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},gc.prototype.hashInt=function(){for(var e=this.hash(),t=0;t=0)return null;var o=(r=r.toRed(i.red)).redSqr().redIMul(r).redIAdd(i.b).redSqrt();return 3===e!==o.isOdd()&&(o=o.redNeg()),n.keyPair({pub:{x:r,y:o}})}(t,e.slice(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,t,r){var o=new is(t),a=new is(r);if(o.cmp(i.p)>=0||a.cmp(i.p)>=0)return null;if(o=o.toRed(i.red),a=a.toRed(i.red),(6===e||7===e)&&a.isOdd()!==(7===e))return null;var s=o.redSqr().redIMul(o);return a.redSqr().redISub(s.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:o,y:a}}):null}(t,e.slice(1,33),e.slice(33,65));default:return null}}t.privateKeyVerify=function(e){var t=new is(e);return t.cmp(i.n)<0&&!t.isZero()},t.privateKeyExport=function(e,t){var o=new is(e);if(o.cmp(i.n)>=0||o.isZero())throw new Error(Nr.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return r.from(n.keyFromPrivate(e).getPublic(t,!0))},t.privateKeyNegate=function(e){var t=new is(e);return t.isZero()?r.alloc(32):i.n.sub(t).umod(i.n).toArrayLike(r,"be",32)},t.privateKeyModInverse=function(e){var t=new is(e);if(t.cmp(i.n)>=0||t.isZero())throw new Error(Nr.EC_PRIVATE_KEY_RANGE_INVALID);return t.invm(i.n).toArrayLike(r,"be",32)},t.privateKeyTweakAdd=function(e,t){var n=new is(t);if(n.cmp(i.n)>=0)throw new Error(Nr.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(n.iadd(new is(e)),n.cmp(i.n)>=0&&n.isub(i.n),n.isZero())throw new Error(Nr.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return n.toArrayLike(r,"be",32)},t.privateKeyTweakMul=function(e,t){var n=new is(t);if(n.cmp(i.n)>=0||n.isZero())throw new Error(Nr.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);return n.imul(new is(e)),n.cmp(i.n)&&(n=n.umod(i.n)),n.toArrayLike(r,"be",32)},t.publicKeyCreate=function(e,t){var o=new is(e);if(o.cmp(i.n)>=0||o.isZero())throw new Error(Nr.EC_PUBLIC_KEY_CREATE_FAIL);return r.from(n.keyFromPrivate(e).getPublic(t,!0))},t.publicKeyConvert=function(e,t){var n=o(e);if(null===n)throw new Error(Nr.EC_PUBLIC_KEY_PARSE_FAIL);return r.from(n.getPublic(t,!0))},t.publicKeyVerify=function(e){return null!==o(e)},t.publicKeyTweakAdd=function(e,t,n){var a=o(e);if(null===a)throw new Error(Nr.EC_PUBLIC_KEY_PARSE_FAIL);if((t=new is(t)).cmp(i.n)>=0)throw new Error(Nr.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);var s=i.g.mul(t).add(a.pub);if(s.isInfinity())throw new Error(Nr.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return r.from(s.encode(!0,n))},t.publicKeyTweakMul=function(e,t,n){var a=o(e);if(null===a)throw new Error(Nr.EC_PUBLIC_KEY_PARSE_FAIL);if((t=new is(t)).cmp(i.n)>=0||t.isZero())throw new Error(Nr.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return r.from(a.pub.mul(t).encode(!0,n))},t.publicKeyCombine=function(e,t){for(var n=new Array(e.length),i=0;i=0||o.cmp(i.n)>=0)throw new Error(Nr.ECDSA_SIGNATURE_PARSE_FAIL);var a=r.from(e);return 1===o.cmp(n.nh)&&i.n.sub(o).toArrayLike(r,"be",32).copy(a,32),a},t.signatureExport=function(e){var t=e.slice(0,32),r=e.slice(32,64);if(new is(t).cmp(i.n)>=0||new is(r).cmp(i.n)>=0)throw new Error(Nr.ECDSA_SIGNATURE_PARSE_FAIL);return{r:t,s:r}},t.signatureImport=function(e){var t=new is(e.r);t.cmp(i.n)>=0&&(t=new is(0));var n=new is(e.s);return n.cmp(i.n)>=0&&(n=new is(0)),r.concat([t.toArrayLike(r,"be",32),n.toArrayLike(r,"be",32)])},t.sign=function(e,t,o,a){if("function"==typeof o){var s=o;o=function(n){var i=s(e,t,null,a,n);if(!r.isBuffer(i)||32!==i.length)throw new Error(Nr.ECDSA_SIGN_FAIL);return new is(i)}}var c=new is(t);if(c.cmp(i.n)>=0||c.isZero())throw new Error(Nr.ECDSA_SIGN_FAIL);var u=n.sign(e,t,{canonical:!0,k:o,pers:a});return{signature:r.concat([u.r.toArrayLike(r,"be",32),u.s.toArrayLike(r,"be",32)]),recovery:u.recoveryParam}},t.verify=function(e,t,r){var a={r:t.slice(0,32),s:t.slice(32,64)},s=new is(a.r),c=new is(a.s);if(s.cmp(i.n)>=0||c.cmp(i.n)>=0)throw new Error(Nr.ECDSA_SIGNATURE_PARSE_FAIL);if(1===c.cmp(n.nh)||s.isZero()||c.isZero())return!1;var u=o(r);if(null===u)throw new Error(Nr.EC_PUBLIC_KEY_PARSE_FAIL);return n.verify(e,a,{x:u.pub.x,y:u.pub.y})},t.recover=function(e,t,o,a){var s={r:t.slice(0,32),s:t.slice(32,64)},c=new is(s.r),u=new is(s.s);if(c.cmp(i.n)>=0||u.cmp(i.n)>=0)throw new Error(Nr.ECDSA_SIGNATURE_PARSE_FAIL);try{if(c.isZero()||u.isZero())throw new Error;var f=n.recoverPubKey(e,s,o);return r.from(f.encode(!0,a))}catch(e){throw new Error(Nr.ECDSA_RECOVER_FAIL)}},t.ecdh=function(e,r){var n=t.ecdhUnsafe(e,r,!0);return ns("sha256").update(n).digest()},t.ecdhUnsafe=function(e,t,n){var a=o(e);if(null===a)throw new Error(Nr.EC_PUBLIC_KEY_PARSE_FAIL);var s=new is(t);if(s.cmp(i.n)>=0||s.isZero())throw new Error(Nr.ECDH_FAIL);return r.from(a.pub.mul(s).encode(!0,n))}})),Sc=(Ec.privateKeyVerify,Ec.privateKeyExport,Ec.privateKeyNegate,Ec.privateKeyModInverse,Ec.privateKeyTweakAdd,Ec.privateKeyTweakMul,Ec.publicKeyCreate,Ec.publicKeyConvert,Ec.publicKeyVerify,Ec.publicKeyTweakAdd,Ec.publicKeyTweakMul,Ec.publicKeyCombine,Ec.signatureNormalize,Ec.signatureExport,Ec.signatureImport,Ec.sign,Ec.verify,Ec.recover,Ec.ecdh,Ec.ecdhUnsafe,yc=Ec,{privateKeyVerify:function(e){return Er(e,Nr.EC_PRIVATE_KEY_TYPE_INVALID),32===e.length&&yc.privateKeyVerify(e)},privateKeyExport:function(e,t){return Er(e,Nr.EC_PRIVATE_KEY_TYPE_INVALID),Sr(e,32,Nr.EC_PRIVATE_KEY_LENGTH_INVALID),t=Pr(t,!0),function(e,t,r){var n=Ir.from(r?_r:Cr);return e.copy(n,r?8:9),t.copy(n,r?181:214),n}(e,yc.privateKeyExport(e,t),t)},privateKeyImport:function(e){if(Er(e,Nr.EC_PRIVATE_KEY_TYPE_INVALID),(e=function(e){var t=e.length,r=0;if(!(t2||t1?e[r+n-2]<<8:0);if(!(t<(r+=n)+i||t32||t1&&0===t[n]&&!(128&t[n+1]);--r,++n);for(var i=Ir.concat([Ir.from([0]),e.s]),o=33,a=0;o>1&&0===i[a]&&!(128&i[a+1]);--o,++a);return xr(t.slice(n),i.slice(a))}(yc.signatureExport(e))},signatureImport:function(e){Er(e,Nr.ECDSA_SIGNATURE_TYPE_INVALID),kr(e,Nr.ECDSA_SIGNATURE_LENGTH_INVALID);var t=function(e){var t=Ir.alloc(32,0),r=Ir.alloc(32,0);try{var n=Or(e);if(33===n.r.length&&0===n.r[0]&&(n.r=n.r.slice(1)),n.r.length>32)throw new Error("R length is too long");if(33===n.s.length&&0===n.s[0]&&(n.s=n.s.slice(1)),n.s.length>32)throw new Error("S length is too long")}catch(e){return}return n.r.copy(t,32-n.r.length),n.s.copy(r,32-n.s.length),{r:t,s:r}}(e);if(t)return yc.signatureImport(t);throw new Error(Nr.ECDSA_SIGNATURE_PARSE_DER_FAIL)},signatureImportLax:function(e){Er(e,Nr.ECDSA_SIGNATURE_TYPE_INVALID),kr(e,Nr.ECDSA_SIGNATURE_LENGTH_INVALID);var t=function(e){var t=Ir.alloc(32,0),r=Ir.alloc(32,0),n=e.length,i=0;if(48===e[i++]){var o=e[i++];if(!(128&o&&(i+=o-128)>n)&&2===e[i++]){var a=e[i++];if(128&a){if(i+(o=a-128)>n)return;for(;o>0&&0===e[i];i+=1,o-=1);for(a=0;o>0;i+=1,o-=1)a=(a<<8)+e[i]}if(!(a>n-i)){var s=i;if(i+=a,2===e[i++]){var c=e[i++];if(128&c){if(i+(o=c-128)>n)return;for(;o>0&&0===e[i];i+=1,o-=1);for(c=0;o>0;i+=1,o-=1)c=(c<<8)+e[i]}if(!(c>n-i)){var u=i;for(i+=c;a>0&&0===e[s];a-=1,s+=1);if(!(a>32)){var f=e.slice(s,s+a);for(f.copy(t,32-f.length);c>0&&0===e[u];c-=1,u+=1);if(!(c>32)){var h=e.slice(u,u+c);return h.copy(r,32-h.length),{r:t,s:r}}}}}}}}}(e);if(t)return yc.signatureImport(t);throw new Error(Nr.ECDSA_SIGNATURE_PARSE_DER_FAIL)},sign:function(e,t,r){Er(e,Nr.MSG32_TYPE_INVALID),Sr(e,32,Nr.MSG32_LENGTH_INVALID),Er(t,Nr.EC_PRIVATE_KEY_TYPE_INVALID),Sr(t,32,Nr.EC_PRIVATE_KEY_LENGTH_INVALID);var n=null,i=null;return void 0!==r&&(function(e,t){if("[object Object]"!==wr.call(e))throw TypeError(t)}(r,Nr.OPTIONS_TYPE_INVALID),void 0!==r.data&&(Er(r.data,Nr.OPTIONS_DATA_TYPE_INVALID),Sr(r.data,32,Nr.OPTIONS_DATA_LENGTH_INVALID),n=r.data),void 0!==r.noncefn&&(function(e,t){if("[object Function]"!==wr.call(e))throw TypeError(t)}(r.noncefn,Nr.OPTIONS_NONCEFN_TYPE_INVALID),i=r.noncefn)),yc.sign(e,t,i,n)},verify:function(e,t,r){return Er(e,Nr.MSG32_TYPE_INVALID),Sr(e,32,Nr.MSG32_LENGTH_INVALID),Er(t,Nr.ECDSA_SIGNATURE_TYPE_INVALID),Sr(t,64,Nr.ECDSA_SIGNATURE_LENGTH_INVALID),Er(r,Nr.EC_PUBLIC_KEY_TYPE_INVALID),Mr(r,33,65,Nr.EC_PUBLIC_KEY_LENGTH_INVALID),yc.verify(e,t,r)},recover:function(e,t,r,n){return Er(e,Nr.MSG32_TYPE_INVALID),Sr(e,32,Nr.MSG32_LENGTH_INVALID),Er(t,Nr.ECDSA_SIGNATURE_TYPE_INVALID),Sr(t,64,Nr.ECDSA_SIGNATURE_LENGTH_INVALID),function(e,t){if("[object Number]"!==wr.call(e))throw TypeError(t)}(r,Nr.RECOVERY_ID_TYPE_INVALID),function(e,t,r,n){if(e<=t||e>=r)throw RangeError(n)}(r,-1,4,Nr.RECOVERY_ID_VALUE_INVALID),n=Pr(n,!0),yc.recover(e,t,r,n)},ecdh:function(e,t){return Er(e,Nr.EC_PUBLIC_KEY_TYPE_INVALID),Mr(e,33,65,Nr.EC_PUBLIC_KEY_LENGTH_INVALID),Er(t,Nr.EC_PRIVATE_KEY_TYPE_INVALID),Sr(t,32,Nr.EC_PRIVATE_KEY_LENGTH_INVALID),yc.ecdh(e,t)},ecdhUnsafe:function(e,t,r){return Er(e,Nr.EC_PUBLIC_KEY_TYPE_INVALID),Mr(e,33,65,Nr.EC_PUBLIC_KEY_LENGTH_INVALID),Er(t,Nr.EC_PRIVATE_KEY_TYPE_INVALID),Sr(t,32,Nr.EC_PRIVATE_KEY_LENGTH_INVALID),r=Pr(r,!0),yc.ecdhUnsafe(e,t,r)}}),Mc=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=function(e){if(!Re.isValidKeyLength(e))throw new Error("randomBytes - invalid key length: ".concat(e));return mr.isBrowser()?gr.browserRandomBytes(e):mr.isNode()?yr.nodeRandomBytes(e):vr.fallbackRandomBytes(e)}}));Object(y.c)(Mc),Mc.randomBytes;var kc=Object(y.b)((function(e,t){var r=y.d&&y.d.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var n=r(Sc);function i(e){return t.secp256k1.privateKeyVerify(e)}function o(e){return t.secp256k1.signatureExport(e)}function a(e){return t.secp256k1.signatureImport(e)}t.secp256k1=n,t.secp256k1Compress=function(e){return e=Re.sanitizePublicKey(e),t.secp256k1.publicKeyConvert(e,!0)},t.secp256k1Decompress=function(e){return e=Re.sanitizePublicKey(e),t.secp256k1.publicKeyConvert(e,!1)},t.secp256k1GeneratePrivate=function(){for(var e=Mc.randomBytes(Ee.KEY_LENGTH);!i(e);)e=Mc.randomBytes(Ee.KEY_LENGTH);return e},t.secp256k1VerifyPrivateKey=i,t.secp256k1GetPublic=function(e){return t.secp256k1.publicKeyCreate(e,!1)},t.secp256k1GetPublicCompressed=function(e){return t.secp256k1.publicKeyCreate(e,!0)},t.secp256k1SignatureExport=o,t.secp256k1SignatureImport=a,t.secp256k1Sign=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=t.secp256k1.sign(e,r),a=i.signature,s=i.recovery;return n?Re.concatBuffers(a,Re.exportRecoveryParam(s)):o(a)},t.secp256k1Recover=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Re.isValidDERSignature(e))throw new Error("Cannot recover from DER signatures");var i=Re.sanitizeRSVSignature(e),o=i.signature,a=i.recovery;return t.secp256k1.recover(r,o,a,n)},t.secp256k1Verify=function(e,r,n){return Re.isValidDERSignature(e)&&(e=a(e)),e=Re.sanitizeRSVSignature(e).signature,t.secp256k1.verify(r,e,n)},t.secp256k1Derive=function(e,r,n){var i=t.secp256k1.ecdhUnsafe(e,r,n);return Re.trimLeft(i,Ee.KEY_LENGTH)}}));Object(y.c)(kc),kc.secp256k1,kc.secp256k1Compress,kc.secp256k1Decompress,kc.secp256k1GeneratePrivate,kc.secp256k1VerifyPrivateKey,kc.secp256k1GetPublic,kc.secp256k1GetPublicCompressed,kc.secp256k1SignatureExport,kc.secp256k1SignatureImport,kc.secp256k1Sign,kc.secp256k1Recover,kc.secp256k1Verify,kc.secp256k1Derive;var Rc=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=new wc.ec("secp256k1");function i(e){return Re.isValidPrivateKey(e)}function o(e){return Js.Signature({r:e.slice(0,32),s:e.slice(32,64),recoveryParam:Re.importRecoveryParam(e.slice(64,65))}).toDER()}t.ellipticCompress=function(e){e=Re.sanitizePublicKey(e);var t=r.keyFromPublic(e).getPublic().encode(Ee.HEX_ENC,!0);return Re.hexToBuffer(t)},t.ellipticDecompress=function(e){e=Re.sanitizePublicKey(e);var t=r.keyFromPublic(e).getPublic().encode(Ee.HEX_ENC,!1);return Re.hexToBuffer(t)},t.ellipticGeneratePrivate=function(){for(var e=Mc.randomBytes(Ee.KEY_LENGTH);!i(e);)e=Mc.randomBytes(Ee.KEY_LENGTH);return e},t.ellipticVerifyPrivateKey=i,t.ellipticGetPublic=function(e){var t=r.keyFromPrivate(e).getPublic(!1,Ee.HEX_ENC);return Re.hexToBuffer(t)},t.ellipticGetPublicCompressed=function(e){var t=r.keyFromPrivate(e).getPublic(!0,Ee.HEX_ENC);return Re.hexToBuffer(t)},t.ellipticDerive=function(e,t){var i=r.keyFromPrivate(t),o=r.keyFromPublic(e),a=i.derive(o.getPublic());return n.from(a.toArray())},t.ellipticSignatureExport=o,t.ellipticSign=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=r.sign(e,t,{canonical:!0});return i?Re.concatBuffers(Re.hexToBuffer(Re.sanitizeHex(o.r.toString(16))),Re.hexToBuffer(Re.sanitizeHex(o.s.toString(16))),Re.exportRecoveryParam(o.recoveryParam||0)):n.from(o.toDER())},t.ellipticRecover=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Re.isValidDERSignature(e))throw new Error("Cannot recover from DER signatures");var i=Re.splitSignature(e),o=Re.importRecoveryParam(i.v),a=r.recoverPubKey(t,{r:Re.removeHexLeadingZeros(Re.bufferToHex(i.r)),s:Re.removeHexLeadingZeros(Re.bufferToHex(i.s)),recoveryParam:o},o).encode(Ee.HEX_ENC,n);return Re.hexToBuffer(a)},t.ellipticVerify=function(e,t,n){return Re.isValidDERSignature||(e=o(e)),r.verify(t,e,n)}}));Object(y.c)(Rc),Rc.ellipticCompress,Rc.ellipticDecompress,Rc.ellipticGeneratePrivate,Rc.ellipticVerifyPrivateKey,Rc.ellipticGetPublic,Rc.ellipticGetPublicCompressed,Rc.ellipticDerive,Rc.ellipticSignatureExport,Rc.ellipticSign,Rc.ellipticRecover,Rc.ellipticVerify;var Oc=Object(y.b)((function(e,t){function r(){return mr.isNode()?kc.secp256k1GeneratePrivate():Rc.ellipticGeneratePrivate()}function n(e){Re.assert(e.length===Ee.KEY_LENGTH,Ee.ERROR_BAD_PRIVATE_KEY),Re.assert(Re.isValidPrivateKey(e),Ee.ERROR_BAD_PRIVATE_KEY)}function i(e){Re.assert(e.length===Ee.PREFIXED_DECOMPRESSED_LENGTH||e.length===Ee.PREFIXED_KEY_LENGTH,Ee.ERROR_BAD_PUBLIC_KEY),e.length===Ee.PREFIXED_DECOMPRESSED_LENGTH&&Re.assert(4===e[0],Ee.ERROR_BAD_PUBLIC_KEY),e.length===Ee.PREFIXED_KEY_LENGTH&&Re.assert(2===e[0]||3===e[0],Ee.ERROR_BAD_PUBLIC_KEY)}function o(e){Re.assert(e.length>0,Ee.ERROR_EMPTY_MESSAGE),Re.assert(e.length<=Ee.MAX_MSG_LENGTH,Ee.ERROR_MESSAGE_TOO_LONG)}function a(e){return n(e),mr.isNode()?kc.secp256k1GetPublic(e):Rc.ellipticGetPublic(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.generatePrivate=r,t.checkPrivateKey=n,t.checkPublicKey=i,t.checkMessage=o,t.compress=function(e){return Re.isCompressed(e)?e:mr.isNode()?kc.secp256k1Compress(e):Rc.ellipticCompress(e)},t.decompress=function(e){return Re.isDecompressed(e)?e:mr.isNode()?kc.secp256k1Decompress(e):Rc.ellipticDecompress(e)},t.getPublic=a,t.getPublicCompressed=function(e){return n(e),mr.isNode()?kc.secp256k1GetPublicCompressed(e):Rc.ellipticGetPublicCompressed(e)},t.generateKeyPair=function(){var e=r();return{privateKey:e,publicKey:a(e)}},t.signatureExport=function(e){return mr.isNode()?kc.secp256k1SignatureExport(e):Rc.ellipticSignatureExport(e)},t.sign=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return n(e),o(t),mr.isNode()?kc.secp256k1Sign(t,e,r):Rc.ellipticSign(t,e,r)},t.recover=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return o(e),mr.isNode()?kc.secp256k1Recover(t,e,r):Rc.ellipticRecover(t,e,r)},t.verify=function(e,t,r){if(i(e),o(t),mr.isNode()?kc.secp256k1Verify(r,t,e):Rc.ellipticVerify(r,t,e))return null;throw new Error("Bad signature")}}));Object(y.c)(Oc),Oc.generatePrivate,Oc.checkPrivateKey,Oc.checkPublicKey,Oc.checkMessage,Oc.compress,Oc.decompress,Oc.getPublic,Oc.getPublicCompressed,Oc.generateKeyPair,Oc.signatureExport,Oc.sign,Oc.recover,Oc.verify;var xc=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.derive=function(e,t){return Oc.checkPrivateKey(e),Oc.checkPublicKey(t),mr.isNode()?kc.secp256k1Derive(t,e):Rc.ellipticDerive(t,e)}}));Object(y.c)(xc),xc.derive;var Ic=Object(y.b)((function(e,t){var r=y.d&&y.d.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(a,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.hmacSha256Sign=function(e,t){return r(this,void 0,void 0,m.a.mark((function r(){var n;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!mr.isBrowser()){r.next=6;break}return r.next=3,gr.browserHmacSha256Sign(e,t);case 3:r.t0=r.sent,r.next=7;break;case 6:r.t0=mr.isNode()?yr.nodeHmacSha256Sign(e,t):vr.fallbackHmacSha256Sign(e,t);case 7:return n=r.t0,r.abrupt("return",n);case 9:case"end":return r.stop()}}),r)})))},t.hmacSha256Verify=function(e,t,n){return r(this,void 0,void 0,m.a.mark((function r(){var i,o,a,s;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!mr.isBrowser()){r.next=7;break}return r.next=3,gr.browserHmacSha256Sign(e,t);case 3:o=r.sent,i=Re.equalConstTime(o,n),r.next=8;break;case 7:mr.isNode()?(a=yr.nodeHmacSha256Sign(e,t),i=Re.equalConstTime(a,n)):(s=vr.fallbackHmacSha256Sign(e,t),i=Re.equalConstTime(s,n));case 8:return r.abrupt("return",i);case 9:case"end":return r.stop()}}),r)})))},t.hmacSha512Sign=function(e,t){return r(this,void 0,void 0,m.a.mark((function r(){var n;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!mr.isBrowser()){r.next=6;break}return r.next=3,gr.browserHmacSha512Sign(e,t);case 3:r.t0=r.sent,r.next=7;break;case 6:r.t0=mr.isNode()?yr.nodeHmacSha512Sign(e,t):vr.fallbackHmacSha512Sign(e,t);case 7:return n=r.t0,r.abrupt("return",n);case 9:case"end":return r.stop()}}),r)})))},t.hmacSha512Verify=function(e,t,n){return r(this,void 0,void 0,m.a.mark((function r(){var i,o,a;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return mr.isNode()?(o=yr.nodeHmacSha512Sign(e,t),i=Re.equalConstTime(o,n)):(a=vr.fallbackHmacSha512Sign(e,t),i=Re.equalConstTime(a,n)),r.abrupt("return",i);case 2:case"end":return r.stop()}}),r)})))},t.hmacSha256SignSync=function(e,t){return mr.isNode()?yr.nodeHmacSha256Sign(e,t):vr.fallbackHmacSha256Sign(e,t)},t.hmacSha256VerifySync=function(e,t,r){var n;if(mr.isNode()){var i=yr.nodeHmacSha256Sign(e,t);n=Re.equalConstTime(i,r)}else{var o=vr.fallbackHmacSha256Sign(e,t);n=Re.equalConstTime(o,r)}return n},t.hmacSha512SignSync=function(e,t){return mr.isNode()?yr.nodeHmacSha512Sign(e,t):vr.fallbackHmacSha512Sign(e,t)},t.hmacSha512VerifySync=function(e,t,r){var n;if(mr.isNode()){var i=yr.nodeHmacSha512Sign(e,t);n=Re.equalConstTime(i,r)}else{var o=vr.fallbackHmacSha512Sign(e,t);n=Re.equalConstTime(o,r)}return n}}));Object(y.c)(Ic),Ic.hmacSha256Sign,Ic.hmacSha256Verify,Ic.hmacSha512Sign,Ic.hmacSha512Verify,Ic.hmacSha256SignSync,Ic.hmacSha256VerifySync,Ic.hmacSha512SignSync,Ic.hmacSha512VerifySync;var _c=Object(y.b)((function(e,t){var r=y.d&&y.d.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(a,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=function(e){return r(this,void 0,void 0,m.a.mark((function t(){var r;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=Ee.EMPTY_BUFFER,!mr.isBrowser()){t.next=7;break}return t.next=4,gr.browserSha256(e);case 4:t.t0=t.sent,t.next=8;break;case 7:t.t0=mr.isNode()?yr.nodeSha256(e):vr.fallbackSha256(e);case 8:return r=t.t0,t.abrupt("return",r);case 10:case"end":return t.stop()}}),t)})))},t.sha512=function(e){return r(this,void 0,void 0,m.a.mark((function t(){var r;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=Ee.EMPTY_BUFFER,!mr.isBrowser()){t.next=7;break}return t.next=4,gr.browserSha512(e);case 4:t.t0=t.sent,t.next=8;break;case 7:t.t0=mr.isNode()?yr.nodeSha512(e):vr.fallbackSha512(e);case 8:return r=t.t0,t.abrupt("return",r);case 10:case"end":return t.stop()}}),t)})))},t.ripemd160=function(e){return r(this,void 0,void 0,m.a.mark((function t(){return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ee.EMPTY_BUFFER,t.abrupt("return",mr.isNode()?yr.nodeRipemd160(e):vr.fallbackRipemd160(e));case 2:case"end":return t.stop()}}),t)})))},t.sha256Sync=function(e){Ee.EMPTY_BUFFER;return mr.isNode()?yr.nodeSha256(e):vr.fallbackSha256(e)},t.sha512Sync=function(e){Ee.EMPTY_BUFFER;return mr.isNode()?yr.nodeSha512(e):vr.fallbackSha512(e)},t.ripemd160Sync=function(e){Ee.EMPTY_BUFFER;return mr.isNode()?yr.nodeRipemd160(e):vr.fallbackRipemd160(e)}}));Object(y.c)(_c),_c.sha256,_c.sha512,_c.ripemd160,_c.sha256Sync,_c.sha512Sync,_c.ripemd160Sync;var Cc=Object(y.b)((function(e,t){var r=y.d&&y.d.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(a,s)}c((n=n.apply(e,t||[])).next())}))};function i(e,t){return t=Oc.decompress(t),xc.derive(e,t)}function o(e){return n.from(e.slice(Ee.LENGTH_0,Ee.KEY_LENGTH))}function a(e){return n.from(e.slice(Ee.KEY_LENGTH))}function s(e,t){return r(this,void 0,void 0,m.a.mark((function r(){var n,s;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=i(e,t),r.next=3,_c.sha512(n);case 3:return s=r.sent,r.abrupt("return",{encryptionKey:o(s),macKey:a(s)});case 5:case"end":return r.stop()}}),r)})))}function c(e,t){var r=i(e,t),n=_c.sha512Sync(r);return{encryptionKey:o(n),macKey:a(n)}}function u(e){for(var t,r,n=(null===(t=e)||void 0===t?void 0:t.ephemPrivateKey)||Mc.randomBytes(Ee.KEY_LENGTH);!Re.isValidPrivateKey(n);)n=(null===(r=e)||void 0===r?void 0:r.ephemPrivateKey)||Mc.randomBytes(Ee.KEY_LENGTH);return{ephemPrivateKey:n,ephemPublicKey:Oc.getPublic(n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.encrypt=function(e,t,n){var i;return r(this,void 0,void 0,m.a.mark((function r(){var o,a,c,f,h,d,l,p,b;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return o=u(n),a=o.ephemPrivateKey,c=o.ephemPublicKey,r.next=5,s(a,e);case 5:return f=r.sent,h=f.encryptionKey,d=f.macKey,l=(null===(i=n)||void 0===i?void 0:i.iv)||Mc.randomBytes(Ee.IV_LENGTH),r.next=11,Ar.aesCbcEncrypt(l,h,t);case 11:return p=r.sent,b=Re.concatBuffers(l,c,p),r.t0=l,r.t1=c,r.t2=p,r.next=18,Ic.hmacSha256Sign(d,b);case 18:return r.t3=r.sent,r.abrupt("return",{iv:r.t0,ephemPublicKey:r.t1,ciphertext:r.t2,mac:r.t3});case 20:case"end":return r.stop()}}),r)})))},t.decrypt=function(e,t){return r(this,void 0,void 0,m.a.mark((function r(){var n,i,o,a,c,u,f,h,d;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=t.ephemPublicKey,i=t.iv,o=t.mac,a=t.ciphertext,r.next=6,s(e,n);case 6:return c=r.sent,u=c.encryptionKey,f=c.macKey,h=Re.concatBuffers(i,n,a),r.next=12,Ic.hmacSha256Verify(f,h,o);case 12:return d=r.sent,Re.assert(d,Ee.ERROR_BAD_MAC),r.next=16,Ar.aesCbcDecrypt(t.iv,u,t.ciphertext);case 16:return r.abrupt("return",r.sent);case 17:case"end":return r.stop()}}),r)})))},t.encryptSync=function(e,t,r){var n,i=u(r),o=i.ephemPrivateKey,a=i.ephemPublicKey,s=c(o,e),f=s.encryptionKey,h=s.macKey,d=(null===(n=r)||void 0===n?void 0:n.iv)||Mc.randomBytes(Ee.IV_LENGTH),l=Ar.aesCbcEncryptSync(d,f,t),p=Re.concatBuffers(d,a,l);return{iv:d,ephemPublicKey:a,ciphertext:l,mac:Ic.hmacSha256SignSync(h,p)}},t.decryptSync=function(e,t){return r(this,void 0,void 0,m.a.mark((function r(){var n,i,o,a,s,u,f,h,d;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=t.ephemPublicKey,i=t.iv,o=t.mac,a=t.ciphertext,s=c(e,n),u=s.encryptionKey,f=s.macKey,h=Re.concatBuffers(i,n,a),d=Ic.hmacSha256VerifySync(f,h,o),r.abrupt("return",(Re.assert(d,Ee.ERROR_BAD_MAC),Ar.aesCbcDecryptSync(t.iv,u,t.ciphertext)));case 2:case"end":return r.stop()}}),r)})))},t.serialize=function(e){var t=Oc.compress(e.ephemPublicKey);return Re.concatBuffers(e.iv,t,e.mac,e.ciphertext)},t.deserialize=function(e){var t=Ee.LENGTH_0,r=t+Ee.IV_LENGTH,n=r+Ee.PREFIXED_KEY_LENGTH,i=n+Ee.MAC_LENGTH,o=e.length;return{iv:e.slice(t,r),ephemPublicKey:Oc.decompress(e.slice(r,n)),mac:e.slice(n,i),ciphertext:e.slice(i,o)}}}));Object(y.c)(Cc),Cc.encrypt,Cc.decrypt,Cc.encryptSync,Cc.decryptSync,Cc.serialize,Cc.deserialize;var Tc=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.sha3=function(e){return Re.hexToBuffer(Q.sha3_256(e))},t.keccak256=function(e){return Re.hexToBuffer(Q.keccak_256(e))}}));Object(y.c)(Tc),Tc.sha3,Tc.keccak256;var Lc=Object(y.b)((function(e,t){function r(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),r(Ee),r(Re),r(Ar),r(xc),r(Oc),r(Cc),r(Ic),r(Mc),r(_c),r(Tc)}));Object(y.c)(Lc);var Bc=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=B.__importStar(Lc);function n(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var n,i;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=(e||256)/8,i=r.randomBytes(n),t.abrupt("return",pe.convertBufferToArrayBuffer(i));case 2:case"end":return t.stop()}}),t)})))}function i(e,t){return B.__awaiter(this,void 0,void 0,m.a.mark((function n(){var i,o,a,s,c,u,f;return m.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=pe.convertHexToBuffer(e.data),o=pe.convertHexToBuffer(e.iv),a=pe.convertHexToBuffer(e.hmac),s=pe.convertBufferToHex(a,!0),c=pe.concatBuffers(i,o),n.next=7,r.hmacSha256Sign(t,c);case 7:return u=n.sent,f=pe.convertBufferToHex(u,!0),n.abrupt("return",pe.removeHexPrefix(s)===pe.removeHexPrefix(f));case 10:case"end":return n.stop()}}),n)})))}t.generateKey=n,t.verifyHmac=i,t.encrypt=function(e,t,i){return B.__awaiter(this,void 0,void 0,m.a.mark((function o(){var a,s,c,u,f,h,d,l,p,b;return m.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(a=pe.convertArrayBufferToBuffer(t),o.t0=i,o.t0){o.next=6;break}return o.next=5,n(128);case 5:o.t0=o.sent;case 6:return s=o.t0,c=pe.convertArrayBufferToBuffer(s),u=pe.convertBufferToHex(c,!0),f=JSON.stringify(e),h=pe.convertUtf8ToBuffer(f),o.next=13,r.aesCbcEncrypt(c,a,h);case 13:return d=o.sent,l=pe.convertBufferToHex(d,!0),p=pe.concatBuffers(d,c),o.next=18,r.hmacSha256Sign(a,p);case 18:return b=o.sent,o.abrupt("return",{data:l,hmac:pe.convertBufferToHex(b,!0),iv:u});case 20:case"end":return o.stop()}}),o)})))},t.decrypt=function(e,t){return B.__awaiter(this,void 0,void 0,m.a.mark((function n(){var o,a,s,c,u,f;return m.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(o=pe.convertArrayBufferToBuffer(t)){n.next=3;break}throw new Error("Missing key: required for decryption");case 3:return n.next=5,i(e,o);case 5:if(n.sent){n.next=7;break}return n.abrupt("return",null);case 7:return a=pe.convertHexToBuffer(e.data),s=pe.convertHexToBuffer(e.iv),n.next=11,r.aesCbcDecrypt(s,o,a);case 11:c=n.sent,u=pe.convertBufferToUtf8(c),n.prev=13,f=JSON.parse(u),n.next=20;break;case 17:return n.prev=17,n.t0=n.catch(13),n.abrupt("return",null);case 20:return n.abrupt("return",f);case 21:case"end":return n.stop()}}),n,null,[[13,17]])})))}}));Object(y.c)(Bc),Bc.generateKey,Bc.verifyHmac,Bc.encrypt,Bc.decrypt;var Nc=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=B.__importDefault(we),n=B.__importStar(Bc),i=function(e){Object(f.a)(r,e);var t=Object(h.a)(r);function r(e,i){return Object(d.a)(this,r),t.call(this,{cryptoLib:n,connectorOpts:e,pushServerOpts:i})}return r}(r.default);t.default=i}));Object(y.c)(Nc);var Pc=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then},jc={}.toString,Dc=Array.isArray||function(e){return"[object Array]"==jc.call(e)};zc.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}();var Hc=zc.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function zc(e,t,r){return zc.TYPED_ARRAY_SUPPORT||this instanceof zc?"number"==typeof e?Wc(this,e):function(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(r<0||t.byteLength=Hc)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Hc.toString(16)+" bytes");return 0|e}function Fc(e,t){var r;return zc.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(t)).__proto__=zc.prototype:(null===(r=e)&&(r=new zc(t)),r.length=t),r}function Wc(e,t){var r=Fc(e,t<0?0:0|Gc(t));if(!zc.TYPED_ARRAY_SUPPORT)for(var n=0;n55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Kc(e){return zc.isBuffer(e)?e.length:"undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)?e.byteLength:("string"!=typeof e&&(e=""+e),0===e.length?0:Uc(e).length)}zc.TYPED_ARRAY_SUPPORT&&(zc.prototype.__proto__=Uint8Array.prototype,zc.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&zc[Symbol.species]===zc&&Object.defineProperty(zc,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),zc.prototype.write=function(e,t,r){void 0===t||void 0===r&&"string"==typeof t?(r=this.length,t=0):isFinite(t)&&(t|=0,isFinite(r)?r|=0:r=void 0);var n=this.length-t;if((void 0===r||r>n)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");return function(e,t,r,n){return function(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}(Uc(t,e.length-r),e,r,n)}(this,e,t,r)},zc.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!zc.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},Qc=function(e){return Xc[e]},$c=function(e){for(var t=0;0!==e;)t++,e>>>=1;return t},eu=function(){return void 0!==Vc},tu=function(e){return Vc(e)},ru=Object(y.b)((function(e,t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return r}}}));function nu(){this.buffer=[],this.length=0}ru.L,ru.M,ru.Q,ru.H,ru.isValid,nu.prototype={get:function(e){var t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(var r=0;r>>t-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var iu=nu;function ou(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=Zc(e*e),this.reservedBit=Zc(e*e)}ou.prototype.set=function(e,t,r,n){var i=e*this.size+t;this.data[i]=r,n&&(this.reservedBit[i]=!0)},ou.prototype.get=function(e,t){return this.data[e*this.size+t]},ou.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},ou.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var au=ou,su=Object(y.b)((function(e,t){var r=Jc;t.getRowColCoords=function(e){if(1===e)return[];for(var t=Math.floor(e/7)+2,n=r(e),i=145===n?26:2*Math.ceil((n-13)/(2*t-2)),o=[n-7],a=1;a=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){for(var t=e.size,r=0,n=0,i=0,o=null,a=null,s=0;s=5&&(r+=n-5+3),o=u,n=1),(u=e.get(c,s))===a?i++:(i>=5&&(r+=i-5+3),a=u,i=1)}n>=5&&(r+=n-5+3),i>=5&&(r+=i-5+3)}return r},t.getPenaltyN2=function(e){for(var t=e.size,r=0,n=0;n=10&&(1488===n||93===n)&&r++,i=i<<1&2047|e.get(a,o),a>=10&&(1488===i||93===i)&&r++}return 40*r},t.getPenaltyN4=function(e){for(var t=0,r=e.data.length,n=0;n=0;){for(var n=r[0],i=0;i0){var o=Zc(this.degree);return n.copy(o,i),o}return n};var Au=yu,wu=function(e){return!isNaN(e)&&e>=1&&e<=40},Eu="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",Su="(?:(?![A-Z0-9 $%*+\\-./:]|"+(Eu=Eu.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+",Mu=new RegExp(Eu,"g"),ku=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Ru=new RegExp(Su,"g"),Ou=new RegExp("[0-9]+","g"),xu=new RegExp("[A-Z $%*+\\-./:]+","g"),Iu=new RegExp("^"+Eu+"$"),_u=new RegExp("^[0-9]+$"),Cu=new RegExp("^[A-Z0-9 $%*+\\-./:]+$"),Tu={KANJI:Mu,BYTE_KANJI:ku,BYTE:Ru,NUMERIC:Ou,ALPHANUMERIC:xu,testKanji:function(e){return Iu.test(e)},testNumeric:function(e){return _u.test(e)},testAlphanumeric:function(e){return Cu.test(e)}},Lu=Object(y.b)((function(e,t){t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!wu(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return Tu.testNumeric(e)?t.NUMERIC:Tu.testAlphanumeric(e)?t.ALPHANUMERIC:Tu.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return r}}})),Bu=(Lu.NUMERIC,Lu.ALPHANUMERIC,Lu.BYTE,Lu.KANJI,Lu.MIXED,Lu.getCharCountIndicator,Lu.getBestModeForData,Lu.isValid,Object(y.b)((function(e,t){var r=$c(7973);function n(e,t){return Lu.getCharCountIndicator(e,t)+4}function i(e,t){var r=0;return e.forEach((function(e){var i=n(e.mode,t);r+=i+e.getBitsLength()})),r}t.from=function(e,t){return wu(e)?parseInt(e,10):t},t.getCapacity=function(e,t,r){if(!wu(e))throw new Error("Invalid QR Code version");void 0===r&&(r=Lu.BYTE);var i=8*(Qc(e)-du(e,t));if(r===Lu.MIXED)return i;var o=i-n(r,e);switch(r){case Lu.NUMERIC:return Math.floor(o/10*3);case Lu.ALPHANUMERIC:return Math.floor(o/11*2);case Lu.KANJI:return Math.floor(o/13);case Lu.BYTE:default:return Math.floor(o/8)}},t.getBestVersionForData=function(e,r){var n,o=ru.from(r,ru.M);if(Dc(e)){if(e.length>1)return function(e,r){for(var n=1;n<=40;n++)if(i(e,n)<=t.getCapacity(n,r,Lu.MIXED))return n}(e,o);if(0===e.length)return 1;n=e[0]}else n=e;return function(e,r,n){for(var i=1;i<=40;i++)if(r<=t.getCapacity(i,n,e))return i}(n.mode,n.getLength(),o)},t.getEncodedBits=function(e){if(!wu(e)||e<7)throw new Error("Invalid QR Code version");for(var t=e<<12;$c(t)-r>=0;)t^=7973<<$c(t)-r;return e<<12|t}}))),Nu=(Bu.getCapacity,Bu.getBestVersionForData,Bu.getEncodedBits,$c(1335));function Pu(e){this.mode=Lu.NUMERIC,this.data=e.toString()}Pu.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},Pu.prototype.getLength=function(){return this.data.length},Pu.prototype.getBitsLength=function(){return Pu.getBitsLength(this.data.length)},Pu.prototype.write=function(e){var t,r,n;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),n=parseInt(r,10),e.put(n,10);var i=this.data.length-t;i>0&&(r=this.data.substr(t),n=parseInt(r,10),e.put(n,3*i+1))};var ju=Pu,Du=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Hu(e){this.mode=Lu.ALPHANUMERIC,this.data=e}Hu.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},Hu.prototype.getLength=function(){return this.data.length},Hu.prototype.getBitsLength=function(){return Hu.getBitsLength(this.data.length)},Hu.prototype.write=function(e){var t;for(t=0;t+2<=this.data.length;t+=2){var r=45*Du.indexOf(this.data[t]);r+=Du.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(Du.indexOf(this.data[t]),6)};var zu=Hu;function Gu(e){this.mode=Lu.BYTE,this.data=qc(e)}Gu.getBitsLength=function(e){return 8*e},Gu.prototype.getLength=function(){return this.data.length},Gu.prototype.getBitsLength=function(){return Gu.getBitsLength(this.data.length)},Gu.prototype.write=function(e){for(var t=0,r=this.data.length;t=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13)}};var Yu=Wu,Uu=Object(y.b)((function(e){var t={single_source_shortest_paths:function(e,r,n){var i={},o={};o[r]=0;var a,s,c,u,f,h,d,l=t.PriorityQueue.make();for(l.push(r,0);!l.empty();)for(c in s=(a=l.pop()).value,u=a.cost,f=e[s]||{})f.hasOwnProperty(c)&&(h=u+f[c],d=o[c],(void 0===o[c]||d>h)&&(o[c]=h,l.push(c,h),i[c]=s));if(void 0!==n&&void 0===o[n]){var p=["Could not find a path from ",r," to ",n,"."].join("");throw new Error(p)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],n=t;n;)r.push(n),e[n],n=e[n];return r.reverse(),r},find_path:function(e,r,n){var i=t.single_source_shortest_paths(e,r,n);return t.extract_shortest_path_from_predecessor_list(i,n)},PriorityQueue:{make:function(e){var r,n=t.PriorityQueue,i={};for(r in e=e||{},n)n.hasOwnProperty(r)&&(i[r]=n[r]);return i.queue=[],i.sorter=e.sorter||n.default_sorter,i},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t})),Ku=Object(y.b)((function(e,t){function r(e){return unescape(encodeURIComponent(e)).length}function n(e,t,r){for(var n,i=[];null!==(n=e.exec(r));)i.push({data:n[0],index:n.index,mode:t,length:n[0].length});return i}function i(e){var t,r,i=n(Tu.NUMERIC,Lu.NUMERIC,e),o=n(Tu.ALPHANUMERIC,Lu.ALPHANUMERIC,e);return eu()?(t=n(Tu.BYTE,Lu.BYTE,e),r=n(Tu.KANJI,Lu.KANJI,e)):(t=n(Tu.BYTE_KANJI,Lu.BYTE,e),r=[]),i.concat(o,t,r).sort((function(e,t){return e.index-t.index})).map((function(e){return{data:e.data,mode:e.mode,length:e.length}}))}function o(e,t){switch(t){case Lu.NUMERIC:return ju.getBitsLength(e);case Lu.ALPHANUMERIC:return zu.getBitsLength(e);case Lu.KANJI:return Yu.getBitsLength(e);case Lu.BYTE:return Fu.getBitsLength(e)}}function a(e,t){var r,n=Lu.getBestModeForData(e);if((r=Lu.from(t,n))!==Lu.BYTE&&r.bit=0?e[e.length-1]:null;return r&&r.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)}),[])}(c))},t.rawSplit=function(e){return t.fromArray(i(e,eu()))}}));function Vu(e,t,r){var n,i,o=e.size,a=function(e,t){for(var r=e.bit<<3|t,n=r<<10;$c(n)-Nu>=0;)n^=1335<<$c(n)-Nu;return 21522^(r<<10|n)}(t,r);for(n=0;n<15;n++)i=1==(a>>n&1),n<6?e.set(n,8,i,!0):n<8?e.set(n+1,8,i,!0):e.set(o-15+n,8,i,!0),n<8?e.set(8,o-n-1,i,!0):n<9?e.set(8,15-n-1+1,i,!0):e.set(8,15-n-1,i,!0);e.set(o-8,8,1,!0)}function Zu(e,t,r){var n=new iu;r.forEach((function(t){n.put(t.mode.bit,4),n.put(t.getLength(),Lu.getCharCountIndicator(t.mode,e)),t.write(n)}));var i=8*(Qc(e)-du(e,t));for(n.getLengthInBits()+4<=i&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(0);for(var o=(i-n.getLengthInBits())/8,a=0;a=0&&s<=6&&(0===c||6===c)||c>=0&&c<=6&&(0===s||6===s)||s>=2&&s<=4&&c>=2&&c<=4?e.set(o+s,a+c,!0,!0):e.set(o+s,a+c,!1,!0))}(f,t),function(e){for(var t=e.size,r=8;r=7&&function(e,t){for(var r,n,i,o=e.size,a=Bu.getEncodedBits(t),s=0;s<18;s++)r=Math.floor(s/3),n=s%3+o-8-3,i=1==(a>>s&1),e.set(r,n,i,!0),e.set(n,r,i,!0)}(f,t),function(e,t){for(var r=e.size,n=-1,i=r-1,o=7,a=0,s=r-1;s>0;s-=2)for(6===s&&s--;;){for(var c=0;c<2;c++)if(!e.isReserved(i,s-c)){var u=!1;a>>o&1)),e.set(i,s-c,u),-1===--o&&(a++,o=7)}if((i+=n)<0||r<=i){i-=n,n=-n;break}}}(f,c),isNaN(n)&&(n=uu.getBestMask(f,Vu.bind(null,f,r))),uu.applyMask(n,f),Vu(f,r,n),{modules:f,version:t,errorCorrectionLevel:r,maskPattern:n,segments:i}}Ku.fromArray,Ku.fromString,Ku.rawSplit;var Xu=function(e,t){if(void 0===e||""===e)throw new Error("No input text");var r,n,i=ru.M;return void 0!==t&&(i=ru.from(t.errorCorrectionLevel,ru.M),r=Bu.from(t.version),n=uu.from(t.maskPattern),t.toSJISFunc&&function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');Vc=e}(t.toSJISFunc)),qu(e,r,i,n)},Ju=Object(y.b)((function(e,t){function r(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");var t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map((function(e){return[e,e]})))),6===t.length&&t.push("F","F");var r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});var t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,n=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:n,scale:n?4:i,margin:t,color:{dark:r(e.color.dark||"#000000ff"),light:r(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,r){var n=t.getScale(e,r);return Math.floor((e+2*r.margin)*n)},t.qrToImageData=function(e,r,n){for(var i=r.modules.size,o=r.modules.data,a=t.getScale(i,n),s=Math.floor((i+2*n.margin)*a),c=n.margin*a,u=[n.color.light,n.color.dark],f=0;f=c&&h>=c&&f':"",c="0&&c>0&&e[s-1]||(n+=o?ef("M",c+r,.5+u+r):ef("m",i,0),i=0,o=!1),c+1',u='viewBox="0 0 '+a+" "+a+'"',f=''+s+c+"\n";return"function"==typeof r&&r(null,f),f}(e,r)}))},hf={},df=[],lf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function pf(e,t){for(var r in t)e[r]=t[r];return e}function bf(e){var t=e.parentNode;t&&t.removeChild(e)}function vf(e,t,r){var n,i=arguments,o={};for(n in t)"key"!==n&&"ref"!==n&&(o[n]=t[n]);if(arguments.length>3)for(r=[r],n=3;n2&&(t.children=df.slice.call(arguments,2)),r={},t)"key"!==n&&"ref"!==n&&(r[n]=t[n]);return gf(e.type,r,t.key||e.key,t.ref||e.ref,null)}rf={__e:function(e,t){for(var r,n;t=t.__;)if((r=t.__c)&&!r.__)try{if(r.constructor&&null!=r.constructor.getDerivedStateFromError&&(n=!0,r.setState(r.constructor.getDerivedStateFromError(e))),null!=r.componentDidCatch&&(n=!0,r.componentDidCatch(e)),n)return Ef(r.__E=r)}catch(t){e=t}throw e}},yf.prototype.setState=function(e,t){var r;r=this.__s!==this.state?this.__s:this.__s=pf({},this.state),"function"==typeof e&&(e=e(r,this.props)),e&&pf(r,e),null!=e&&this.__v&&(t&&this.__h.push(t),Ef(this))},yf.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ef(this))},yf.prototype.render=mf,nf=[],of=0,af="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,cf=hf,uf=0;var Pf,jf,Df,Hf=0,zf=[],Gf=rf.__r,Ff=rf.diffed,Wf=rf.__c,Yf=rf.unmount;function Uf(e,t){rf.__h&&rf.__h(jf,e,Hf||t),Hf=0;var r=jf.__H||(jf.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Kf(e,t,r){var n=Uf(Pf++,2);return n.__c||(n.__c=jf,n.__=[r?r(t):$f(void 0,t),function(t){var r=e(n.__[0],t);n.__[0]!==r&&(n.__[0]=r,n.__c.setState({}))}]),n.__}function Vf(e,t){var r=Uf(Pf++,4);!rf.__s&&Qf(r.__H,t)&&(r.__=e,r.__H=t,jf.__h.push(r))}function Zf(e,t){var r=Uf(Pf++,7);return Qf(r.__H,t)?(r.__H=t,r.__h=e,r.__=e()):r.__}function qf(){zf.some((function(e){if(e.__P)try{e.__H.__h.forEach(Xf),e.__H.__h.forEach(Jf),e.__H.__h=[]}catch(t){return e.__H.__h=[],rf.__e(t,e.__v),!0}})),zf=[]}function Xf(e){e.t&&e.t()}function Jf(e){var t=e.__();"function"==typeof t&&(e.t=t)}function Qf(e,t){return!e||t.some((function(t,r){return t!==e[r]}))}function $f(e,t){return"function"==typeof t?t(e):t}function eh(e,t){for(var r in t)e[r]=t[r];return e}function th(e,t){for(var r in e)if("__source"!==r&&!(r in t))return!0;for(var n in t)if("__source"!==n&&e[n]!==t[n])return!0;return!1}rf.__r=function(e){Gf&&Gf(e),Pf=0,(jf=e.__c).__H&&(jf.__H.__h.forEach(Xf),jf.__H.__h.forEach(Jf),jf.__H.__h=[])},rf.diffed=function(e){Ff&&Ff(e);var t=e.__c;if(t){var r=t.__H;r&&r.__h.length&&(1!==zf.push(t)&&Df===rf.requestAnimationFrame||((Df=rf.requestAnimationFrame)||function(e){var t,r=function(){clearTimeout(n),cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);"undefined"!=typeof window&&(t=requestAnimationFrame(r))})(qf))}},rf.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Xf),e.__h=e.__h.filter((function(e){return!e.__||Jf(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],rf.__e(r,e.__v)}})),Wf&&Wf(e,t)},rf.unmount=function(e){Yf&&Yf(e);var t=e.__c;if(t){var r=t.__H;if(r)try{r.__.forEach((function(e){return e.t&&e.t()}))}catch(e){rf.__e(e,t.__v)}}};var rh=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).isPureReactComponent=!0,r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.prototype.shouldComponentUpdate=function(e,t){return th(this.props,e)||th(this.state,t)},n}(yf),nh=rf.__b;rf.__b=function(e){e.type&&e.type.t&&e.ref&&(e.props.ref=e.ref,e.ref=null),nh&&nh(e)};var ih=function(e,t){return e?kf(e).reduce((function(e,r,n){return e.concat(t(r,n))}),[]):null},oh={map:ih,forEach:ih,count:function(e){return e?kf(e).length:0},only:function(e){if(1!==(e=kf(e)).length)throw new Error("Children.only() expects only one child.");return e[0]},toArray:kf},ah=rf.__e;function sh(e){return e&&((e=eh({},e)).__c=null,e.__k=e.__k&&e.__k.map(sh)),e}function ch(){this.__u=0,this.o=null,this.__b=null}function uh(e){var t=e.__.__c;return t&&t.u&&t.u(e)}function fh(){this.i=null,this.l=null}rf.__e=function(e,t,r){if(e.then)for(var n,i=t;i=i.__;)if((n=i.__c)&&n.__c)return n.__c(e,t.__c);ah(e,t,r)},(ch.prototype=new yf).__c=function(e,t){var r=this;null==r.o&&(r.o=[]),r.o.push(t);var n=uh(r.__v),i=!1,o=function(){i||(i=!0,n?n(a):a())};t.__c=t.componentWillUnmount,t.componentWillUnmount=function(){o(),t.__c&&t.__c()};var a=function(){var e;if(!--r.__u)for(r.__v.__k[0]=r.state.u,r.setState({u:r.__b=null});e=r.o.pop();)e.forceUpdate()};r.__u++||r.setState({u:r.__b=r.__v.__k[0]}),e.then(o,o)},ch.prototype.render=function(e,t){return this.__b&&(this.__v.__k[0]=sh(this.__b),this.__b=null),[vf(yf,null,t.u?null:e.children),t.u&&e.fallback]};var hh=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]8?2.5:2.7)+"vw"},className:"walletconnect-connect__button__text"},n))}function _h(e){var t=e.href.split("?")[0];pe.setLocal(pe.mobileLinkChoiceKey,Object.assign({},e,{href:t}))}function Ch(e){var t=pe.isIOS(),r=function(e){var t=Rh;return e&&e.mobileLinks&&e.mobileLinks.length&&(t=e.mobileLinks.map((function(e){return function(e){return Rh.filter((function(t){return t.name.toLowerCase().includes(e)}))[0]}(e)}))),t}(e.qrcodeModalOptions),n=Sh.useState(!1),i=n[0],o=n[1],a=r.length>5,s=r.length>12;return Sh.createElement("div",null,Sh.createElement("p",{id:"walletconnect-qrcode-text",className:"walletconnect-qrcode__text"},t?e.text.choose_preferred_wallet:e.text.connect_mobile_wallet),Sh.createElement("div",{className:"walletconnect-connect__buttons__wrapper"+(t?a?"__wrap":"":"__android")},t?r.map((function(t,r){var n=t.color,o=t.name,s=t.shortName,c=t.logo,u=function(e,t){var r=encodeURIComponent(e);return t.universalLink?t.universalLink+"/wc?uri="+r:t.deepLink?t.deepLink+(t.deepLink.endsWith(":")?"//":"/")+"wc?uri="+r:""}(e.uri,t),f=Sh.useCallback((function(){_h({name:o,href:u})}),[]);if(!(r>11)||i)return a?Sh.createElement(Ih,{color:n,href:u,name:s,logo:c,onClick:f}):Sh.createElement(xh,{color:n,href:u,name:o,logo:c,onClick:f})})):Sh.createElement(Oh,{name:e.text.connect,color:"rgb(64, 153, 255)",href:e.uri,onClick:Sh.useCallback((function(){_h({name:"Unknown",href:e.uri})}),[])})),!(!t||!s)&&Sh.createElement("div",{className:"walletconnect-modal__footer"},Sh.createElement("a",{onClick:function(){return o(!i)}},i?e.text.show_less:e.text.show_more)))}function Th(e){var t=!!e.message.trim();return Sh.createElement("div",{className:"walletconnect-qrcode__notification"+(t?" notification__show":"")},e.message)}function Lh(e){var t=Sh.useState(""),r=t[0],n=t[1],i=Sh.useState(""),o=i[0],a=i[1];return Sh.useEffect((function(){try{return Promise.resolve(function(e){try{var t="";return Promise.resolve(Mh.toString(e,{margin:0,type:"svg"})).then((function(e){return"string"==typeof e&&(t=e.replace("=0)return this._url=this._parseUrl(t.headers.location),this._method="GET",this._loweredHeaders["content-type"]&&(delete this._headers[this._loweredHeaders["content-type"]],delete this._loweredHeaders["content-type"]),null!=this._headers["Content-Type"]&&delete this._headers["Content-Type"],delete this._headers["Content-Length"],this.upload._reset(),this._finalizeHeaders(),void this._sendHxxpRequest();this._response=t,this._response.on("data",(function(e){return n._onHttpResponseData(t,e)})),this._response.on("end",(function(){return n._onHttpResponseEnd(t)})),this._response.on("close",(function(){return n._onHttpResponseClose(t)})),this.responseUrl=this._url.href.split("#")[0],this.status=t.statusCode,this.statusText=M.a.STATUS_CODES[this.status],this._parseResponseHeaders(t);var i=this._responseHeaders["content-length"]||"";this._totalBytes=+i,this._lengthComputable=!!i,this._setReadyState(r.HEADERS_RECEIVED)}},r.prototype._onHttpResponseData=function(e,t){this._response===e&&(this._responseParts.push(new n(t)),this._loadedBytes+=t.length,this.readyState!==r.LOADING&&this._setReadyState(r.LOADING),this._dispatchProgress("progress"))},r.prototype._onHttpResponseEnd=function(e){this._response===e&&(this._parseResponse(),this._request=null,this._response=null,this._setReadyState(r.DONE),this._dispatchProgress("load"),this._dispatchProgress("loadend"))},r.prototype._onHttpResponseClose=function(e){if(this._response===e){var t=this._request;this._setError(),t.abort(),this._setReadyState(r.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend")}},r.prototype._onHttpTimeout=function(e){this._request===e&&(this._setError(),e.abort(),this._setReadyState(r.DONE),this._dispatchProgress("timeout"),this._dispatchProgress("loadend"))},r.prototype._onHttpRequestError=function(e,t){this._request===e&&(this._setError(),e.abort(),this._setReadyState(r.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend"))},r.prototype._dispatchProgress=function(e){var t=new r.ProgressEvent(e);t.lengthComputable=this._lengthComputable,t.loaded=this._loadedBytes,t.total=this._totalBytes,this.dispatchEvent(t)},r.prototype._setError=function(){this._request=null,this._response=null,this._responseHeaders=null,this._responseParts=null},r.prototype._parseUrl=function(e,t,r){var n=null==this.nodejsBaseUrl?e:E.a.resolve(this.nodejsBaseUrl,e),i=E.a.parse(n,!1,!0);i.hash=null;var o=(i.auth||"").split(":"),a=o[0],s=o[1];return(a||s||t||r)&&(i.auth=(t||a||"")+":"+(r||s||"")),i},r.prototype._parseResponseHeaders=function(e){for(var t in this._responseHeaders={},e.headers){var r=t.toLowerCase();this._privateHeaders[r]||(this._responseHeaders[r]=e.headers[t])}null!=this._mimeOverride&&(this._responseHeaders["content-type"]=this._mimeOverride)},r.prototype._parseResponse=function(){var e=n.concat(this._responseParts);switch(this._responseParts=null,this.responseType){case"json":this.responseText=null;try{this.response=JSON.parse(e.toString("utf-8"))}catch(e){this.response=null}return;case"buffer":return this.responseText=null,void(this.response=e);case"arraybuffer":this.responseText=null;for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),i=0;i2&&void 0!==arguments[2]?arguments[2]:-1;return{error:{message:t,code:r},id:e.id,jsonrpc:e.jsonrpc}}},{key:"send",value:function(e,t){var n=this;return new Promise((function(i){if("eth_subscribe"===e.method){var o=n.formatError(e,"Subscriptions are not supported by this HTTP endpoint");return n.emit("error",o),i(o)}var a=new r,s=!1,c=function(r,o){if(!s)if(a.abort(),s=!0,t)t(r,o);else{var c=e.id,u=e.jsonrpc,f=r?{id:c,jsonrpc:u,error:{message:r.message,code:r.code}}:{id:c,jsonrpc:u,result:o};n.emit("payload",f),i(f)}};a.open("POST",n.url,!0),a.setRequestHeader("Content-Type","application/json"),a.timeout=6e4,a.onerror=c,a.ontimeout=c,a.onreadystatechange=function(){if(4===a.readyState)try{var t=JSON.parse(a.responseText);c(t.error,t.result)}catch(e){c(e)}},a.send(JSON.stringify(e))}))}}]),n}(y.g.EventEmitter);t.default=n}));Object(y.c)(Vh);var Zh=xe.Buffer,qh=A.b.Transform,Xh=xe.Buffer,Jh=A.b.Transform,Qh=[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],$h=function(e){for(var t=0;t<24;++t){var r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],o=e[3]^e[13]^e[23]^e[33]^e[43],a=e[4]^e[14]^e[24]^e[34]^e[44],s=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],h=e[9]^e[19]^e[29]^e[39]^e[49],d=f^(i<<1|o>>>31),l=h^(o<<1|i>>>31),p=e[0]^d,b=e[1]^l,v=e[10]^d,g=e[11]^l,m=e[20]^d,y=e[21]^l,A=e[30]^d,w=e[31]^l,E=e[40]^d,S=e[41]^l;d=r^(a<<1|s>>>31),l=n^(s<<1|a>>>31);var M=e[2]^d,k=e[3]^l,R=e[12]^d,O=e[13]^l,x=e[22]^d,I=e[23]^l,_=e[32]^d,C=e[33]^l,T=e[42]^d,L=e[43]^l;d=i^(c<<1|u>>>31),l=o^(u<<1|c>>>31);var B=e[4]^d,N=e[5]^l,P=e[14]^d,j=e[15]^l,D=e[24]^d,H=e[25]^l,z=e[34]^d,G=e[35]^l,F=e[44]^d,W=e[45]^l;d=a^(f<<1|h>>>31),l=s^(h<<1|f>>>31);var Y=e[6]^d,U=e[7]^l,K=e[16]^d,V=e[17]^l,Z=e[26]^d,q=e[27]^l,X=e[36]^d,J=e[37]^l,Q=e[46]^d,$=e[47]^l;d=c^(r<<1|n>>>31),l=u^(n<<1|r>>>31);var ee=e[8]^d,te=e[9]^l,re=e[18]^d,ne=e[19]^l,ie=e[28]^d,oe=e[29]^l,ae=e[38]^d,se=e[39]^l,ce=e[48]^d,ue=e[49]^l,fe=p,he=b,de=g<<4|v>>>28,le=v<<4|g>>>28,pe=m<<3|y>>>29,be=y<<3|m>>>29,ve=w<<9|A>>>23,ge=A<<9|w>>>23,me=E<<18|S>>>14,ye=S<<18|E>>>14,Ae=M<<1|k>>>31,we=k<<1|M>>>31,Ee=O<<12|R>>>20,Se=R<<12|O>>>20,Me=x<<10|I>>>22,ke=I<<10|x>>>22,Re=C<<13|_>>>19,Oe=_<<13|C>>>19,xe=T<<2|L>>>30,Ie=L<<2|T>>>30,_e=N<<30|B>>>2,Ce=B<<30|N>>>2,Te=P<<6|j>>>26,Le=j<<6|P>>>26,Be=H<<11|D>>>21,Ne=D<<11|H>>>21,Pe=z<<15|G>>>17,je=G<<15|z>>>17,De=W<<29|F>>>3,He=F<<29|W>>>3,ze=Y<<28|U>>>4,Ge=U<<28|Y>>>4,Fe=V<<23|K>>>9,We=K<<23|V>>>9,Ye=Z<<25|q>>>7,Ue=q<<25|Z>>>7,Ke=X<<21|J>>>11,Ve=J<<21|X>>>11,Ze=$<<24|Q>>>8,qe=Q<<24|$>>>8,Xe=ee<<27|te>>>5,Je=te<<27|ee>>>5,Qe=re<<20|ne>>>12,$e=ne<<20|re>>>12,et=oe<<7|ie>>>25,tt=ie<<7|oe>>>25,rt=ae<<8|se>>>24,nt=se<<8|ae>>>24,it=ce<<14|ue>>>18,ot=ue<<14|ce>>>18;e[0]=fe^~Ee&Be,e[1]=he^~Se&Ne,e[10]=ze^~Qe&pe,e[11]=Ge^~$e&be,e[20]=Ae^~Te&Ye,e[21]=we^~Le&Ue,e[30]=Xe^~de&Me,e[31]=Je^~le&ke,e[40]=_e^~Fe&et,e[41]=Ce^~We&tt,e[2]=Ee^~Be&Ke,e[3]=Se^~Ne&Ve,e[12]=Qe^~pe&Re,e[13]=$e^~be&Oe,e[22]=Te^~Ye&rt,e[23]=Le^~Ue&nt,e[32]=de^~Me&Pe,e[33]=le^~ke&je,e[42]=Fe^~et&ve,e[43]=We^~tt&ge,e[4]=Be^~Ke&it,e[5]=Ne^~Ve&ot,e[14]=pe^~Re&De,e[15]=be^~Oe&He,e[24]=Ye^~rt&me,e[25]=Ue^~nt&ye,e[34]=Me^~Pe&Ze,e[35]=ke^~je&qe,e[44]=et^~ve&xe,e[45]=tt^~ge&Ie,e[6]=Ke^~it&fe,e[7]=Ve^~ot&he,e[16]=Re^~De&ze,e[17]=Oe^~He&Ge,e[26]=rt^~me&Ae,e[27]=nt^~ye&we,e[36]=Pe^~Ze&Xe,e[37]=je^~qe&Je,e[46]=ve^~xe&_e,e[47]=ge^~Ie&Ce,e[8]=it^~fe&Ee,e[9]=ot^~he&Se,e[18]=De^~ze&Qe,e[19]=He^~Ge&$e,e[28]=me^~Ae&Te,e[29]=ye^~we&Le,e[38]=Ze^~Xe&de,e[39]=qe^~Je&le,e[48]=xe^~_e&Fe,e[49]=Ie^~Ce&We,e[0]^=Qh[2*t],e[1]^=Qh[2*t+1]}},ed=xe.Buffer;function td(){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}td.prototype.initialize=function(e,t){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},td.prototype.absorb=function(e){for(var t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&($h(this.state),this.count=0);return t},td.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var rd=function(e){var t=function(e){function t(t,r,n,i,o){qh.call(this,o),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=i,this._options=o,this._state=new e,this._state.initialize(t,r),this._finalized=!1}return Te(t,qh),t.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},t.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},t.prototype.update=function(e,t){if(!Zh.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Zh.isBuffer(e)||(e=Zh.from(e,t)),this._state.absorb(e),this},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}(e),r=function(e){function t(t,r,n,i){Jh.call(this,i),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._options=i,this._state=new e,this._state.initialize(t,r),this._finalized=!1}return Te(t,Jh),t.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},t.prototype._flush=function(){},t.prototype._read=function(e){this.push(this.squeeze(e))},t.prototype.update=function(e,t){if(!Xh.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Xh.isBuffer(e)||(e=Xh.from(e,t)),this._state.absorb(e),this},t.prototype.squeeze=function(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}(e);return function(e,n){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new t(1152,448,null,224,n);case"keccak256":return new t(1088,512,null,256,n);case"keccak384":return new t(832,768,null,384,n);case"keccak512":return new t(576,1024,null,512,n);case"sha3-224":return new t(1152,448,6,224,n);case"sha3-256":return new t(1088,512,6,256,n);case"sha3-384":return new t(832,768,6,384,n);case"sha3-512":return new t(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+e)}}}(td),nd=Object(y.b)((function(e,t){function r(e,t){if("00"===e.slice(0,2))throw new Error("invalid RLP: extra zeros");return parseInt(e,t)}function i(e,t){if(e<56)return n.from([e+t]);var r=a(e),i=a(t+55+r.length/2);return n.from(i+r,"hex")}function o(e){return"0x"===e.slice(0,2)}function a(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");var t=e.toString(16);return t.length%2?"0"+t:t}function s(e){if(!n.isBuffer(e)){if("string"==typeof e)return o(e)?n.from(function(e){return e.length%2?"0"+e:e}(function(e){return"string"!=typeof e?e:o(e)?e.slice(2):e}(e)),"hex"):n.from(e);if("number"==typeof e||"bigint"==typeof e)return e?(t=a(e),n.from(t,"hex")):n.from([]);if(null==e)return n.from([]);if(e instanceof Uint8Array)return n.from(e);if(is.isBN(e))return n.from(e.toArray());throw new Error("invalid type")}var t;return e}Object.defineProperty(t,"__esModule",{value:!0}),t.getLength=t.decode=t.encode=void 0,t.encode=function e(t){if(Array.isArray(t)){for(var r=[],o=0;ot.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(s=t.slice(o,h)).length)throw new Error("invalid rlp, List has a invalid length");for(;s.length;)c=e(s),u.push(c.data),s=c.remainder;return{data:u,remainder:t.slice(h)}}(s(e));if(t)return i;if(0!==i.remainder.length)throw new Error("invalid remainder");return i.data},t.getLength=function(e){if(!e||0===e.length)return n.from([]);var t=s(e),i=t[0];if(i<=127)return t.length;if(i<=183)return i-127;if(i<=191)return i-182;if(i<=247)return i-191;var o=i-246;return o+r(t.slice(1,o).toString("hex"),16)}}));Object(y.c)(nd),nd.getLength,nd.decode,nd.encode;var id=function(e){if("string"!=typeof e)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof e+", while checking isHexPrefixed.");return"0x"===e.slice(0,2)},od=function(e){return"string"!=typeof e?e:id(e)?e.slice(2):e};function ad(e){var t=e;if("string"!=typeof t)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof t+", while padToEven.");return t.length%2&&(t="0"+t),t}function sd(e){return"0x"+e.toString(16)}var cd={arrayContainsArray:function(e,t,r){if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof e+"'");if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof t+"'");return t[Boolean(r)?"some":"every"]((function(t){return e.indexOf(t)>=0}))},intToBuffer:function(e){var t=sd(e);return new n(ad(t.slice(2)),"hex")},getBinarySize:function(e){if("string"!=typeof e)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof e+"'.");return n.byteLength(e,"utf8")},isHexPrefixed:id,stripHexPrefix:od,padToEven:ad,intToHex:sd,fromAscii:function(e){for(var t="",r=0;r0&&"0"===r.toString();)r=(e=e.slice(1))[0];return e},t.toBuffer=function(e){if(!n.isBuffer(e))if(Array.isArray(e))e=n.from(e);else if("string"==typeof e)e=t.isHexString(e)?n.from(t.padToEven(t.stripHexPrefix(e)),"hex"):n.from(e);else if("number"==typeof e)e=t.intToBuffer(e);else if(null==e)e=n.allocUnsafe(0);else if(is.isBN(e))e=e.toArrayLike(n);else{if(!e.toArray)throw new Error("invalid type");e=n.from(e.toArray())}return e},t.bufferToInt=function(e){return new is(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new is(e).fromTwos(256)},t.toUnsigned=function(e){return n.from(e.toTwos(256).toArray())},t.keccak=function(e,r){return e=t.toBuffer(e),r||(r=256),rd("keccak"+r).update(e).digest()},t.keccak256=function(e){return t.keccak(e)},t.sha3=t.keccak,t.sha256=function(e){return e=t.toBuffer(e),ns("sha256").update(e).digest()},t.ripemd160=function(e,r){e=t.toBuffer(e);var n=ns("rmd160").update(e).digest();return!0===r?t.setLength(n,32):n},t.rlphash=function(e){return t.keccak(nd.encode(e))},t.isValidPrivate=function(e){return Sc.privateKeyVerify(e)},t.isValidPublic=function(e,t){return 64===e.length?Sc.publicKeyVerify(n.concat([n.from([4]),e])):!!t&&Sc.publicKeyVerify(e)},t.pubToAddress=t.publicToAddress=function(e,r){return e=t.toBuffer(e),r&&64!==e.length&&(e=Sc.publicKeyConvert(e,!1).slice(1)),Object(w.b)(64===e.length),t.keccak(e).slice(-20)};var i=t.privateToPublic=function(e){return e=t.toBuffer(e),Sc.publicKeyCreate(e,!1).slice(1)};t.importPublic=function(e){return 64!==(e=t.toBuffer(e)).length&&(e=Sc.publicKeyConvert(e,!1).slice(1)),e},t.ecsign=function(e,t){var r=Sc.sign(e,t),n={};return n.r=r.signature.slice(0,32),n.s=r.signature.slice(32,64),n.v=r.recovery+27,n},t.hashPersonalMessage=function(e){var r=t.toBuffer("\x19Ethereum Signed Message:\n"+e.length.toString());return t.keccak(n.concat([r,e]))},t.ecrecover=function(e,r,i,o){var a=n.concat([t.setLength(i,32),t.setLength(o,32)],64),s=r-27;if(0!==s&&1!==s)throw new Error("Invalid signature v value");var c=Sc.recover(e,a,s);return Sc.publicKeyConvert(c,!1).slice(1)},t.toRpcSig=function(e,r,i){if(27!==e&&28!==e)throw new Error("Invalid recovery id");return t.bufferToHex(n.concat([t.setLengthLeft(r,32),t.setLengthLeft(i,32),t.toBuffer(e-27)]))},t.fromRpcSig=function(e){if(65!==(e=t.toBuffer(e)).length)throw new Error("Invalid signature length");var r=e[64];return r<27&&(r+=27),{v:r,r:e.slice(0,32),s:e.slice(32,64)}},t.privateToAddress=function(e){return t.publicToAddress(i(e))},t.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)},t.isZeroAddress=function(e){return t.zeroAddress()===t.addHexPrefix(e)},t.toChecksumAddress=function(e){e=t.stripHexPrefix(e).toLowerCase();for(var r=t.keccak(e).toString("hex"),n="0x",i=0;i=8?n+=e[i].toUpperCase():n+=e[i];return n},t.isValidChecksumAddress=function(e){return t.isValidAddress(e)&&t.toChecksumAddress(e)===e},t.generateAddress=function(e,r){return e=t.toBuffer(e),r=(r=new is(r)).isZero()?null:n.from(r.toArray()),t.rlphash([e,r]).slice(-20)},t.isPrecompiled=function(e){var r=t.unpad(e);return 1===r.length&&r[0]>=1&&r[0]<=8},t.addHexPrefix=function(e){return"string"!=typeof e||t.isHexPrefixed(e)?e:"0x"+e},t.isValidSignature=function(e,t,r,n){var i=new is("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),o=new is("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===t.length&&32===r.length&&(27===e||28===e)&&(t=new is(t),r=new is(r),!(t.isZero()||t.gt(o)||r.isZero()||r.gt(o))&&(!1!==n||1!==new is(r).cmp(i)))},t.baToJSON=function(e){if(n.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var r=[],i=0;i=o.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===o.length||!r.length||Object(w.b)(r.length===o.length,"The field "+r.name+" must have byte length of "+r.length),e.raw[i]=o}e._fields.push(r.name),Object.defineProperty(e,r.name,{enumerable:!0,configurable:!0,get:o,set:a}),r.default&&(e[r.name]=r.default),r.alias&&Object.defineProperty(e,r.alias,{enumerable:!1,configurable:!0,set:a,get:o})})),o)if("string"==typeof o&&(o=n.from(t.stripHexPrefix(o),"hex")),n.isBuffer(o)&&(o=nd.decode(o)),Array.isArray(o)){if(o.length>e._fields.length)throw new Error("wrong number of fields in data");o.forEach((function(r,n){e[e._fields[n]]=t.toBuffer(r)}))}else{if("object"!==(void 0===o?"undefined":r(o)))throw new Error("invalid data");var a=Object.keys(o);i.forEach((function(t){-1!==a.indexOf(t.name)&&(e[t.name]=o[t.name]),-1!==a.indexOf(t.alias)&&(e[t.alias]=o[t.alias])}))}}}));ud.MAX_INTEGER,ud.TWO_POW256,ud.KECCAK256_NULL_S,ud.SHA3_NULL_S,ud.KECCAK256_NULL,ud.SHA3_NULL,ud.KECCAK256_RLP_ARRAY_S,ud.SHA3_RLP_ARRAY_S,ud.KECCAK256_RLP_ARRAY,ud.SHA3_RLP_ARRAY,ud.KECCAK256_RLP_S,ud.SHA3_RLP_S,ud.KECCAK256_RLP,ud.SHA3_RLP,ud.BN,ud.rlp,ud.secp256k1,ud.zeros,ud.zeroAddress,ud.setLengthLeft,ud.setLength,ud.setLengthRight,ud.unpad,ud.stripZeros,ud.toBuffer,ud.bufferToInt,ud.bufferToHex,ud.fromSigned,ud.toUnsigned,ud.keccak,ud.keccak256,ud.sha3,ud.sha256,ud.ripemd160,ud.rlphash,ud.isValidPrivate,ud.isValidPublic,ud.pubToAddress,ud.publicToAddress,ud.privateToPublic,ud.importPublic,ud.ecsign,ud.hashPersonalMessage,ud.ecrecover,ud.toRpcSig,ud.fromRpcSig,ud.privateToAddress,ud.isValidAddress,ud.isZeroAddress,ud.toChecksumAddress,ud.isValidChecksumAddress,ud.generateAddress,ud.isPrecompiled,ud.addHexPrefix,ud.isValidSignature,ud.baToJSON,ud.defineProperties;var fd=function(e,t){return function(){for(var r=this,n=t.promiseModule,i=new Array(arguments.length),o=0;o0&&a.length>i&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,s=c,console&&console.warn&&console.warn(s)}return e}function Id(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=Id.bind(n);return i.listener=r,n.wrapFn=i,i}function Cd(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)wd(s,this,t);else{var c=s.length,u=Ld(s,c);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},Sd.prototype.listeners=function(e){return Cd(this,e,!0)},Sd.prototype.rawListeners=function(e){return Cd(this,e,!1)},Sd.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):Td.call(e,t)},Sd.prototype.listenerCount=Td,Sd.prototype.eventNames=function(){return this._eventsCount>0?yd(this._events):[]};var Bd="object"==typeof Reflect?Reflect:null,Nd=Bd&&"function"==typeof Bd.apply?Bd.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)},Pd=jd;function jd(){Md.call(this)}function Dd(e,t,r){try{Nd(e,t,r)}catch(e){setTimeout((function(){throw e}))}}function Hd(e,t){for(var r=new Array(t),n=0;n0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)Dd(s,this,t);else{var c=s.length,u=Hd(s,c);for(r=0;r0&&void 0!==arguments[0]?arguments[0]:{};if(Object(d.a)(this,r),!n.provider)throw new Error("PollingBlockTracker - no provider specified.");var i=n.pollingInterval||2e4,o=n.retryTimeout||i/10,a=void 0===n.keepEventLoopActive||n.keepEventLoopActive,s=n.setSkipCacheFlag||!1;return(e=t.call(this,Object.assign({blockResetDuration:i},n)))._provider=n.provider,e._pollingInterval=i,e._retryTimeout=o,e._keepEventLoopActive=a,e._setSkipCacheFlag=s,e}return Object(l.a)(r,[{key:"checkForLatestBlock",value:function(){var e=Object(a.a)(m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._updateLatestBlock();case 2:return e.next=4,this.getLatestBlock();case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_start",value:function(){var e=this;this._performSync().catch((function(t){return e.emit("error",t)}))}},{key:"_performSync",value:function(){var e=Object(a.a)(m.a.mark((function e(){var t;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isRunning){e.next=16;break}return e.prev=1,e.next=4,this._updateLatestBlock();case 4:return e.next=6,Yd(this._pollingInterval,!this._keepEventLoopActive);case 6:e.next=14;break;case 8:e.prev=8,e.t0=e.catch(1),t=new Error("PollingBlockTracker - encountered an error while attempting to update latest block:\n".concat(e.t0.stack));try{this.emit("error",t)}catch(yc){console.error(t)}return e.next=14,Yd(this._retryTimeout,!this._keepEventLoopActive);case 14:e.next=0;break;case 16:case"end":return e.stop()}}),e,this,[[1,8]])})));return function(){return e.apply(this,arguments)}}()},{key:"_updateLatestBlock",value:function(){var e=Object(a.a)(m.a.mark((function e(){var t;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._fetchLatestBlock();case 2:t=e.sent,this._newPotentialLatest(t);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_fetchLatestBlock",value:function(){var e=Object(a.a)(m.a.mark((function e(){var t,r,n=this;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={jsonrpc:"2.0",id:1,method:"eth_blockNumber",params:[]},this._setSkipCacheFlag&&(t.skipCache=!0),e.next=4,hd((function(e){return n._provider.sendAsync(t,e)}))();case 4:if(!(r=e.sent).error){e.next=7;break}throw new Error("PollingBlockTracker - encountered error fetching block:\n".concat(r.error));case 7:return e.abrupt("return",r.result);case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),r}(function(e){Object(f.a)(r,e);var t=Object(h.a)(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(d.a)(this,r),(e=t.call(this))._blockResetDuration=n.blockResetDuration||2e4,e._blockResetTimeout,e._currentBlock=null,e._isRunning=!1,e._onNewListener=e._onNewListener.bind(Object(s.a)(e)),e._onRemoveListener=e._onRemoveListener.bind(Object(s.a)(e)),e._resetCurrentBlock=e._resetCurrentBlock.bind(Object(s.a)(e)),e._setupInternalEvents(),e}return Object(l.a)(r,[{key:"isRunning",value:function(){return this._isRunning}},{key:"getCurrentBlock",value:function(){return this._currentBlock}},{key:"getLatestBlock",value:function(){var e=Object(a.a)(m.a.mark((function e(){var t=this;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._currentBlock){e.next=2;break}return e.abrupt("return",this._currentBlock);case 2:return e.next=4,new Promise((function(e){return t.once("latest",e)}));case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"removeAllListeners",value:function(e){e?Object(c.a)(Object(u.a)(r.prototype),"removeAllListeners",this).call(this,e):Object(c.a)(Object(u.a)(r.prototype),"removeAllListeners",this).call(this),this._setupInternalEvents(),this._onRemoveListener()}},{key:"_start",value:function(){}},{key:"_end",value:function(){}},{key:"_setupInternalEvents",value:function(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}},{key:"_onNewListener",value:function(e,t){Gd.includes(e)&&this._maybeStart()}},{key:"_onRemoveListener",value:function(e,t){this._getBlockTrackerEventCount()>0||this._maybeEnd()}},{key:"_maybeStart",value:function(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),this._start())}},{key:"_maybeEnd",value:function(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),this._end())}},{key:"_getBlockTrackerEventCount",value:function(){var e=this;return Gd.map((function(t){return e.listenerCount(t)})).reduce(zd)}},{key:"_newPotentialLatest",value:function(e){var t=this._currentBlock;t&&Fd(e)<=Fd(t)||this._setCurrentBlock(e)}},{key:"_setCurrentBlock",value:function(e){var t=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:t,newBlock:e})}},{key:"_setupBlockResetTimeout",value:function(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}},{key:"_cancelBlockResetTimeout",value:function(){clearTimeout(this._blockResetTimeout)}},{key:"_resetCurrentBlock",value:function(){this._currentBlock=null}}]),r}(Pd));function Yd(e,t){return new Promise((function(r){var n=setTimeout(r,e);n.unref&&t&&n.unref()}))}var Ud="object"==typeof y.d&&y.d&&y.d.Object===Object&&y.d,Kd="object"==typeof self&&self&&self.Object===Object&&self,Vd=Ud||Kd||Function("return this")(),Zd=Vd.Symbol,qd=Object.prototype,Xd=qd.hasOwnProperty,Jd=qd.toString,Qd=Zd?Zd.toStringTag:void 0,$d=Object.prototype.toString,el=Zd?Zd.toStringTag:void 0,tl=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":el&&el in Object(e)?function(e){var t=Xd.call(e,Qd),r=e[Qd];try{e[Qd]=void 0;var n=!0}catch(e){}var i=Jd.call(e);return n&&(t?e[Qd]=r:delete e[Qd]),i}(e):function(e){return $d.call(e)}(e)},rl=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},nl=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},il=function(e){return null!=e&&nl(e.length)&&!function(e){if(!rl(e))return!1;var t=tl(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)},ol=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={},e.exports=t.default}));Object(y.c)(ol);var al=function(){},sl=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(){if(null!==e){var t=e;e=null,t.apply(this,arguments)}}},e.exports=t.default}));Object(y.c)(sl);var cl=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return r&&e[r]&&e[r]()};var r="function"==typeof Symbol&&Symbol.iterator;e.exports=t.default}));Object(y.c)(cl);var ul=function(e){return null!=e&&"object"==typeof e},fl=function(e){return ul(e)&&"[object Arguments]"==tl(e)},hl=Object.prototype,dl=hl.hasOwnProperty,ll=hl.propertyIsEnumerable,pl=fl(function(){return arguments}())?fl:function(e){return ul(e)&&dl.call(e,"callee")&&!ll.call(e,"callee")},bl=Array.isArray,vl=function(){return!1},gl=Object(y.b)((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,i=n&&n.exports===r?Vd.Buffer:void 0,o=(i?i.isBuffer:void 0)||vl;e.exports=o})),ml=/^(?:0|[1-9]\d*)$/,yl=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&ml.test(e))&&e>-1&&e%1==0&&e="0"&&$l<="9";)t+=$l,ip();if("."===$l)for(t+=".";ip()&&$l>="0"&&$l<="9";)t+=$l;if("e"===$l||"E"===$l)for(t+=$l,ip(),"-"!==$l&&"+"!==$l||(t+=$l,ip());$l>="0"&&$l<="9";)t+=$l,ip();if(e=+t,isFinite(e))return e;np("Bad number")},ap=function(){var e,t,r,n="";if('"'===$l)for(;ip();){if('"'===$l)return ip(),n;if("\\"===$l)if(ip(),"u"===$l){for(r=0,t=0;t<4&&(e=parseInt(ip(),16),isFinite(e));t+=1)r=16*r+e;n+=String.fromCharCode(r)}else{if("string"!=typeof rp[$l])break;n+=rp[$l]}else n+=$l}np("Bad string")},sp=function(){for(;$l&&$l<=" ";)ip()};tp=function(){switch(sp(),$l){case"{":return function(){var e,t={};if("{"===$l){if(ip("{"),sp(),"}"===$l)return ip("}"),t;for(;$l;){if(e=ap(),sp(),ip(":"),Object.hasOwnProperty.call(t,e)&&np('Duplicate key "'+e+'"'),t[e]=tp(),sp(),"}"===$l)return ip("}"),t;ip(","),sp()}}np("Bad object")}();case"[":return function(){var e=[];if("["===$l){if(ip("["),sp(),"]"===$l)return ip("]"),e;for(;$l;){if(e.push(tp()),sp(),"]"===$l)return ip("]"),e;ip(","),sp()}}np("Bad array")}();case'"':return ap();case"-":return op();default:return $l>="0"&&$l<="9"?op():function(){switch($l){case"t":return ip("t"),ip("r"),ip("u"),ip("e"),!0;case"f":return ip("f"),ip("a"),ip("l"),ip("s"),ip("e"),!1;case"n":return ip("n"),ip("u"),ip("l"),ip("l"),null}np("Unexpected '"+$l+"'")}()}};var cp,up,fp,hp=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,dp={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function lp(e){return hp.lastIndex=0,hp.test(e)?'"'+e.replace(hp,(function(e){var t=dp[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}var pp="undefined"!=typeof JSON?JSON:{parse:function(e,t){var r;return ep=e,Ql=0,$l=" ",r=tp(),sp(),$l&&np("Syntax error"),"function"==typeof t?function e(r,n){var i,o,a=r[n];if(a&&"object"==typeof a)for(i in a)Object.prototype.hasOwnProperty.call(a,i)&&(void 0!==(o=e(a,i))?a[i]=o:delete a[i]);return t.call(r,n,a)}({"":r},""):r},stringify:function(e,t,r){var n;if(cp="",up="","number"==typeof r)for(n=0;n0?(n--,void setTimeout((function(){i()}),1e3)):void t(null,null)}},wp.prototype._getBlockByNumber=function(e,t){var r=gp({method:"eth_getBlockByNumber",params:[e,!1],skipCache:!0});this._handleAsync(r,(function(e,r){return e?t(e):t(null,r.result)}))},wp.prototype._handleAsync=function(e,t){var r=this,n=-1,i=null,o=null,a=[];function s(r,n){o=r,i=n,Vl(a,(function(e,t){e?e(o,i,t):t()}),(function(){var r={id:e.id,jsonrpc:e.jsonrpc,result:i};null!=o?(r.error={message:o.stack||o.message||o,code:-32e3},t(o,r)):t(null,r)}))}!function t(i){if(n+=1,a.unshift(i),n>=r._providers.length)s(new Error('Request for method "'+e.method+'" not handled by any subprovider. Please check your subprovider configuration to ensure this method is handled.'));else try{r._providers[n].handleRequest(e,t,s)}catch(e){s(e)}}()},wp.prototype._setCurrentBlock=function(e){this.currentBlock=e,this.emit("block",e)};var Ep=Sp;function Sp(){}Sp.prototype.setEngine=function(e){var t=this;t.engine||(t.engine=e,e.on("block",(function(e){t.currentBlock=e})),e.on("start",(function(){t.start()})),e.on("stop",(function(){t.stop()})))},Sp.prototype.handleRequest=function(e,t,r){throw new Error("Subproviders should override `handleRequest`.")},Sp.prototype.emitPayload=function(e,t){this.engine.sendAsync(gp(e),t)},Sp.prototype.stop=function(){},Sp.prototype.start=function(){};var Mp=function(e){Object(f.a)(r,e);var t=Object(h.a)(r);function r(e){var n;if(Object(d.a)(this,r),n=t.call(this),!e)throw new Error("JsonRpcEngineMiddlewareSubprovider - no constructorFn specified");return n._constructorFn=e,Object(o.a)(n)}return Object(l.a)(r,[{key:"setEngine",value:function(e){if(this.middleware)throw new Error("JsonRpcEngineMiddlewareSubprovider - subprovider added to engine twice");var t=e._blockTracker,r=this._constructorFn({engine:e,provider:e,blockTracker:t});if(!r)throw new Error("JsonRpcEngineMiddlewareSubprovider - _constructorFn did not return middleware");if("function"!=typeof r)throw new Error("JsonRpcEngineMiddlewareSubprovider - specified middleware is not a function");this.middleware=r}},{key:"handleRequest",value:function(e,t,r){var n={id:e.id};this.middleware(e,n,(function(e){t((function(t,r,i){t?(delete n.result,n.error={message:t.message||t}):n.result=r,e?e(i):i()}))}),(function(e){if(e)return r(e);r(null,n.result)}))}}]),r}(Ep),kp={cacheIdentifierForPayload:function(e,t){var r=t?Op(e):e.params;return Rp(e)?e.method+":"+function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r=t.space||"";"number"==typeof r&&(r=Array(r+1).join(" "));var n="boolean"==typeof t.cycles&&t.cycles,i=t.replacer||function(e,t){return t},o=t.cmp&&function(e){return function(t){return function(r,n){var i={key:r,value:t[r]},o={key:n,value:t[n]};return e(i,o)}}}(t.cmp),a=[];return function e(t,s,c,u){var f=r?"\n"+new Array(u+1).join(r):"",h=r?": ":":";if(c&&c.toJSON&&"function"==typeof c.toJSON&&(c=c.toJSON()),void 0!==(c=i.call(t,s,c))){if("object"!=typeof c||null===c)return pp.stringify(c);if(bp(c)){for(var d=[],l=0;l=e.params.length?null:e.params[t]},paramsWithoutBlockTag:Op,blockTagParamIndex:xp,cacheTypeForPayload:Ip};function Rp(e){return"never"!==Ip(e)}function Op(e){var t=xp(e);return t>=e.params.length?e.params:"eth_getBlockByNumber"===e.method?e.params.slice(1):e.params.slice(0,t)}function xp(e){switch(e.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":return 1;case"eth_getBlockByNumber":return 0;default:return}}function Ip(e){switch(e.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":case"test_permaCache":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":case"test_forkCache":return"fork";case"eth_gasPrice":case"eth_blockNumber":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"test_blockCache":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":case"test_neverCache":return"never"}}var _p=Object.prototype.toString,Cp="function"==typeof i?i:function(){var e=[].slice.apply(arguments);e.splice(1,0,0),setTimeout.apply(null,e)},Tp=function(e){if(!function(e){return"[object Function]"===_p.call(e)}(e.then))throw new TypeError("Expected a promise");return function(t){e.then((function(e){Cp(t,null,e)}),(function(e){Cp(t,e)}))}},Lp=function(e){return function(t,r,n,i){var o=null,s=e(t,r,Object(a.a)(m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=new Promise((function(e){n((function(t){return e(t)}))})),e.next=3,o;case 3:return e.abrupt("return",void e.sent);case 4:case"end":return e.stop()}}),e)}))));Tp(s)((function(e){o?Tp(o)((function(t,r){if(t)return console.error(t),i(t);r(e)})):i(e)}))}},Bp=[void 0,null,""],Np=function(){function e(){Object(d.a)(this,e),this.cache={}}return Object(l.a)(e,[{key:"getBlockCacheForPayload",value:function(e,t){var r=Number.parseInt(t,16),n=this.cache[r];if(!n){var i={};this.cache[r]=i,n=i}return n}},{key:"get",value:function(){var e=Object(a.a)(m.a.mark((function e(t,r){var n;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=this.getBlockCacheForPayload(t,r))){e.next=3;break}return e.abrupt("return",n[kp.cacheIdentifierForPayload(t,!0)]);case 3:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"set",value:function(){var e=Object(a.a)(m.a.mark((function e(t,r,n){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.canCacheResult(t,n)&&(this.getBlockCacheForPayload(t,r)[kp.cacheIdentifierForPayload(t,!0)]=n);case 1:case"end":return e.stop()}}),e,this)})));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"canCacheRequest",value:function(e){return!!kp.canCache(e)&&"pending"!==kp.blockTagForPayload(e)}},{key:"canCacheResult",value:function(e,t){if(!Bp.includes(t))return!!(!["eth_getTransactionByHash","eth_getTransactionReceipt"].includes(e.method)||t&&t.blockHash&&"0x0000000000000000000000000000000000000000000000000000000000000000"!==t.blockHash)}},{key:"clearBefore",value:function(e){var t=this,r=Number.parseInt(e,16);Object.keys(t.cache).map(Number).filter((function(e){return e0&&void 0!==arguments[0]?arguments[0]:{},t=e.blockTracker;if(!t)throw new Error("createBlockCacheMiddleware - No BlockTracker specified");var r=new Np,n={perma:r,block:r,fork:r};return Lp(function(){var e=Object(a.a)(m.a.mark((function e(i,o,a){var s,c,u,f,h,d;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!i.skipCache){e.next=2;break}return e.abrupt("return",a());case 2:if(s=kp.cacheTypeForPayload(i),c=n[s]){e.next=5;break}return e.abrupt("return",a());case 5:if(c.canCacheRequest(i)){e.next=7;break}return e.abrupt("return",a());case 7:if((f=kp.blockTagForPayload(i))||(f="latest"),"earliest"!==f){e.next=12;break}u="0x00",e.next=20;break;case 12:if("latest"!==f){e.next=19;break}return e.next=15,t.getLatestBlock();case 15:h=e.sent,r.clearBefore(h),u=h,e.next=20;break;case 19:u=f;case 20:return e.next=22,c.get(i,u);case 22:if(void 0!==(d=e.sent)){e.next=30;break}return e.next=26,a();case 26:return e.next=28,c.set(i,u,o.result);case 28:e.next=31;break;case 30:o.result=d;case 31:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}())}(Object.assign({blockTracker:r},e))}))}return r}(Mp),jp=w.c.inherits,Dp=Hp;function Hp(e){e=e||{},this.staticResponses=e}jp(Hp,Ep),Hp.prototype.handleRequest=function(e,t,r){var n=this.staticResponses[e.method];"function"==typeof n?n(e,t,r):void 0!==n?setTimeout((function(){return r(null,n)})):t()};var zp=function(){function t(e){Object(d.a)(this,t),this.tasks=[],this.count=e}return Object(l.a)(t,[{key:"sched",value:function(){if(this.count>0&&this.tasks.length>0){this.count--;var e=this.tasks.shift();if(void 0===e)throw"Unexpected undefined value in tasks list";e()}}},{key:"acquire",value:function(){var t=this;return new Promise((function(r,n){t.tasks.push((function(){var e=!1;r((function(){e||(e=!0,t.count++,t.sched())}))})),e&&e.nextTick?e.nextTick(t.sched.bind(t)):i(t.sched.bind(t))}))}},{key:"use",value:function(e){return this.acquire().then((function(t){return e().then((function(e){return t(),e})).catch((function(e){throw t(),e}))}))}}]),t}(),Gp={Semaphore:zp,Mutex:function(e){Object(f.a)(r,e);var t=Object(h.a)(r);function r(){return Object(d.a)(this,r),t.call(this,1)}return r}(zp)},Fp=function(e){return function(t,r,n,i){var o=e[t.method];return void 0===o?n():"function"==typeof o?o(t,r,n,i):(r.result=o,void i())}},Wp=function(e){Object(f.a)(r,e);var t=Object(h.a)(r);function r(){var e;return Object(d.a)(this,r),(e=t.call(this)).updates=[],e}return Object(l.a)(r,[{key:"initialize",value:function(){var e=Object(a.a)(m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"update",value:function(){var e=Object(a.a)(m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("BaseFilter - no update method specified");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"addResults",value:function(e){var t=this;this.updates=this.updates.concat(e),e.forEach((function(e){return t.emit("update",e)}))}},{key:"addInitialResults",value:function(e){}},{key:"getChangesAndClear",value:function(){var e=this.updates;return this.updates=[],e}}]),r}(Pd),Yp=function(){for(var e=arguments.length,t=new Array(e),r=0;r=$p(e.blockNumber))return!1;if(rb(this.params.toBlock)&&$p(this.params.toBlock)<=$p(e.blockNumber))return!1;var t=e.address&&e.address.toLowerCase();return!(this.params.address&&t&&!this.params.address.includes(t))&&this.params.topics.every((function(t,r){var n=e.topics[r];if(!n)return!1;n=n.toLowerCase();var i=Array.isArray(t)?t:[t];return!!i.includes(null)||(i=i.map((function(e){return e.toLowerCase()}))).includes(n)}))}}]),r}(function(e){Object(f.a)(r,e);var t=Object(h.a)(r);function r(){var e;return Object(d.a)(this,r),(e=t.call(this)).allResults=[],e}return Object(l.a)(r,[{key:"update",value:function(){var e=Object(a.a)(m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("BaseFilterWithHistory - no update method specified");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"addResults",value:function(e){this.allResults=this.allResults.concat(e),Object(c.a)(Object(u.a)(r.prototype),"addResults",this).call(this,e)}},{key:"addInitialResults",value:function(e){this.allResults=this.allResults.concat(e),Object(c.a)(Object(u.a)(r.prototype),"addInitialResults",this).call(this,e)}},{key:"getAllResults",value:function(){return this.allResults}}]),r}(Wp)),ib=function(){var e=Object(a.a)(m.a.mark((function e(t){var r,n,i,o,a,s;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.provider,n=t.fromBlock,i=t.toBlock,n||(n=i),o=ob(n),a=ob(i),s=Array(a-o+1).fill().map((function(e,t){return o+t})).map(ab),e.next=5,Promise.all(s.map((function(e){return function(e,t,r){return new Promise((function(t,n){e.sendAsync({id:1,jsonrpc:"2.0",method:"eth_getBlockByNumber",params:r},(function(e,r){if(e)return n(e);t(r.result)}))}))}(r,0,[e,!1])})));case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function ob(e){return null==e?e:Number.parseInt(e,16)}function ab(e){return null==e?e:"0x"+e.toString(16)}var sb=Kp,cb=function(e){Object(f.a)(r,e);var t=Object(h.a)(r);function r(e){var n,i=e.provider;e.params;return Object(d.a)(this,r),(n=t.call(this)).type="block",n.provider=i,n}return Object(l.a)(r,[{key:"update",value:function(){var e=Object(a.a)(m.a.mark((function e(t){var r,n,i,o,a;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.oldBlock,n=t.newBlock,i=n,o=sb(r),e.next=5,ib({provider:this.provider,fromBlock:o,toBlock:i});case 5:a=e.sent.map((function(e){return e.hash})),this.addResults(a);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),r}(Wp),ub=Object(y.b)((function(e,t){var r="[object Arguments]",n="[object Map]",i="[object Object]",o="[object Set]",a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/,c=/^\./,u=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,f=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,d=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[r]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l["[object Function]"]=l[n]=l["[object Number]"]=l[i]=l["[object RegExp]"]=l[o]=l["[object String]"]=l["[object WeakMap]"]=!1;var p="object"==typeof y.d&&y.d&&y.d.Object===Object&&y.d,b="object"==typeof self&&self&&self.Object===Object&&self,v=p||b||Function("return this")(),g=t&&!t.nodeType&&t,m=g&&e&&!e.nodeType&&e,A=m&&m.exports===g&&p.process,w=function(){try{return A&&A.binding("util")}catch(e){}}(),E=w&&w.isTypedArray;function S(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r-1},ce.prototype.set=function(e,t){var r=this.__data__,n=de(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},ue.prototype.clear=function(){this.__data__={hash:new se,map:new(Z||ce),string:new se}},ue.prototype.delete=function(e){return Ee(this,e).delete(e)},ue.prototype.get=function(e){return Ee(this,e).get(e)},ue.prototype.has=function(e){return Ee(this,e).has(e)},ue.prototype.set=function(e,t){return Ee(this,e).set(e,t),this},fe.prototype.add=fe.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},fe.prototype.has=function(e){return this.__data__.has(e)},he.prototype.clear=function(){this.__data__=new ce},he.prototype.delete=function(e){return this.__data__.delete(e)},he.prototype.get=function(e){return this.__data__.get(e)},he.prototype.has=function(e){return this.__data__.has(e)},he.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ce){var n=r.__data__;if(!Z||n.length<199)return n.push([e,t]),this;r=this.__data__=new ue(n)}return r.set(e,t),this};var le,pe=(le=function(e,t){return e&&be(e,t,Ye)},function(e,t){if(null==e)return e;if(!je(e))return le(e,t);for(var r=e.length,n=-1,i=Object(e);++ns))return!1;var u=o.get(e);if(u&&o.get(t))return u==t;var f=-1,h=!0,d=1&i?new fe:void 0;for(o.set(e,t),o.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991}function ze(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ge(e){return!!e&&"object"==typeof e}function Fe(e){return"symbol"==typeof e||Ge(e)&&"[object Symbol]"==H.call(e)}var We=E?function(e){return function(t){return e(t)}}(E):function(e){return Ge(e)&&He(e.length)&&!!l[H.call(e)]};function Ye(e){return je(e)?function(e,t){var r=Pe(e)||Ne(e)?function(e,t){for(var r=-1,n=Array(e);++r0&&n(c)?r>1?e(c,r-1,n,i,o):M(o,c):i||(o[o.length]=c)}return o}(function(e,t){return(Pe(e)?S:ye)(e,function(e){return"function"==typeof e?e:null==e?Ue:"object"==typeof e?Pe(e)?function(e,t){return Oe(e)&&xe(t)?Ie(Ce(e),t):function(r){var n=function(e,t,r){var n=null==e?void 0:ve(e,t);return void 0===n?void 0:n}(r,e);return void 0===n&&n===t?function(e,t){return null!=e&&function(e,t,r){for(var n,i=-1,o=(t=Oe(t,e)?[t]:Ae(t)).length;++i0?t.on("sync",u):r>0&&0===n&&t.removeListener("sync",u)}};function vb(e){return gb(Object(a.a)(m.a.mark((function t(){var r,n=arguments;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.apply(void 0,n);case 2:return r=t.sent,t.abrupt("return",lb(r.id));case 4:case"end":return t.stop()}}),t)}))))}function gb(e){return Lp(function(){var t=Object(a.a)(m.a.mark((function t(r,n){var i;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.apply(null,r.params);case 2:i=t.sent,n.result=i;case 4:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}())}function mb(e,t){var r=[];for(var n in e)r.push(e[n]);return r}var yb=function(e){Object(f.a)(r,e);var t=Object(h.a)(r);function r(){return Object(d.a)(this,r),t.call(this,(function(e){var t=e.blockTracker,r=e.provider;e.engine;return bb({blockTracker:t,provider:r})}))}return r}(Mp),Ab=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(t=(0,i.default)(t||n.default),!(0,r.default)(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var c=0;function u(t){var r=(0,s.default)(e[c++]);t.push((0,a.default)(f)),r.apply(null,t)}function f(r){if(r||c===e.length)return t.apply(null,arguments);u((0,o.default)(arguments,1))}u([])};var r=c(bl),n=c(al),i=c(sl),o=c(Bl),a=c(Tl),s=c(Dl);function c(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}));Object(y.c)(Ab);var wb=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,a){a=a||r.default;var s=(0,n.default)(t)?[]:{};e(t,(function(e,t,r){(0,o.default)(e)((function(e,n){arguments.length>2&&(n=(0,i.default)(arguments,1)),s[t]=n,r(e)}))}),(function(e){a(e,s)}))};var r=a(al),n=a(il),i=a(Bl),o=a(Dl);function a(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}));Object(y.c)(wb);var Eb=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,n.default)(r.default,e,t)};var r=i(Gl),n=i(wb);function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}));Object(y.c)(Eb);var Sb=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_INTEGER=new is("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new is("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.KECCAK256_NULL=n.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=n.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=n.from(t.KECCAK256_RLP_S,"hex")}));Object(y.c)(Sb),Sb.MAX_INTEGER,Sb.TWO_POW256,Sb.KECCAK256_NULL_S,Sb.KECCAK256_NULL,Sb.KECCAK256_RLP_ARRAY_S,Sb.KECCAK256_RLP_ARRAY,Sb.KECCAK256_RLP_S,Sb.KECCAK256_RLP;var Mb=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.zeros=function(e){return n.allocUnsafe(e).fill(0)},t.setLengthLeft=function(e,r,n){void 0===n&&(n=!1);var i=t.zeros(r);return e=t.toBuffer(e),n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e},t.stripZeros=t.unpad,t.toBuffer=function(e){if(!n.isBuffer(e))if(Array.isArray(e))e=n.from(e);else if("string"==typeof e){if(!cd.isHexString(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+e);e=n.from(cd.padToEven(cd.stripHexPrefix(e)),"hex")}else if("number"==typeof e)e=cd.intToBuffer(e);else if(null==e)e=n.allocUnsafe(0);else if(is.isBN(e))e=e.toArrayLike(n);else{if(!e.toArray)throw new Error("invalid type");e=n.from(e.toArray())}return e},t.bufferToInt=function(e){return new is(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new is(e).fromTwos(256)},t.toUnsigned=function(e){return n.from(e.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!=typeof e||cd.isHexPrefixed(e)?e:"0x"+e},t.baToJSON=function(e){if(n.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var r=[],i=0;i>>31),l=h^(o<<1|i>>>31),p=e[0]^d,b=e[1]^l,v=e[10]^d,g=e[11]^l,m=e[20]^d,y=e[21]^l,A=e[30]^d,w=e[31]^l,E=e[40]^d,S=e[41]^l;d=r^(a<<1|s>>>31),l=n^(s<<1|a>>>31);var M=e[2]^d,k=e[3]^l,R=e[12]^d,O=e[13]^l,x=e[22]^d,I=e[23]^l,_=e[32]^d,C=e[33]^l,T=e[42]^d,L=e[43]^l;d=i^(c<<1|u>>>31),l=o^(u<<1|c>>>31);var B=e[4]^d,N=e[5]^l,P=e[14]^d,j=e[15]^l,D=e[24]^d,H=e[25]^l,z=e[34]^d,G=e[35]^l,F=e[44]^d,W=e[45]^l;d=a^(f<<1|h>>>31),l=s^(h<<1|f>>>31);var Y=e[6]^d,U=e[7]^l,K=e[16]^d,V=e[17]^l,Z=e[26]^d,q=e[27]^l,X=e[36]^d,J=e[37]^l,Q=e[46]^d,$=e[47]^l;d=c^(r<<1|n>>>31),l=u^(n<<1|r>>>31);var ee=e[8]^d,te=e[9]^l,re=e[18]^d,ne=e[19]^l,ie=e[28]^d,oe=e[29]^l,ae=e[38]^d,se=e[39]^l,ce=e[48]^d,ue=e[49]^l,fe=p,he=b,de=g<<4|v>>>28,le=v<<4|g>>>28,pe=m<<3|y>>>29,be=y<<3|m>>>29,ve=w<<9|A>>>23,ge=A<<9|w>>>23,me=E<<18|S>>>14,ye=S<<18|E>>>14,Ae=M<<1|k>>>31,we=k<<1|M>>>31,Ee=O<<12|R>>>20,Se=R<<12|O>>>20,Me=x<<10|I>>>22,ke=I<<10|x>>>22,Re=C<<13|_>>>19,Oe=_<<13|C>>>19,xe=T<<2|L>>>30,Ie=L<<2|T>>>30,_e=N<<30|B>>>2,Ce=B<<30|N>>>2,Te=P<<6|j>>>26,Le=j<<6|P>>>26,Be=H<<11|D>>>21,Ne=D<<11|H>>>21,Pe=z<<15|G>>>17,je=G<<15|z>>>17,De=W<<29|F>>>3,He=F<<29|W>>>3,ze=Y<<28|U>>>4,Ge=U<<28|Y>>>4,Fe=V<<23|K>>>9,We=K<<23|V>>>9,Ye=Z<<25|q>>>7,Ue=q<<25|Z>>>7,Ke=X<<21|J>>>11,Ve=J<<21|X>>>11,Ze=$<<24|Q>>>8,qe=Q<<24|$>>>8,Xe=ee<<27|te>>>5,Je=te<<27|ee>>>5,Qe=re<<20|ne>>>12,$e=ne<<20|re>>>12,et=oe<<7|ie>>>25,tt=ie<<7|oe>>>25,rt=ae<<8|se>>>24,nt=se<<8|ae>>>24,it=ce<<14|ue>>>18,ot=ue<<14|ce>>>18;e[0]=fe^~Ee&Be,e[1]=he^~Se&Ne,e[10]=ze^~Qe&pe,e[11]=Ge^~$e&be,e[20]=Ae^~Te&Ye,e[21]=we^~Le&Ue,e[30]=Xe^~de&Me,e[31]=Je^~le&ke,e[40]=_e^~Fe&et,e[41]=Ce^~We&tt,e[2]=Ee^~Be&Ke,e[3]=Se^~Ne&Ve,e[12]=Qe^~pe&Re,e[13]=$e^~be&Oe,e[22]=Te^~Ye&rt,e[23]=Le^~Ue&nt,e[32]=de^~Me&Pe,e[33]=le^~ke&je,e[42]=Fe^~et&ve,e[43]=We^~tt&ge,e[4]=Be^~Ke&it,e[5]=Ne^~Ve&ot,e[14]=pe^~Re&De,e[15]=be^~Oe&He,e[24]=Ye^~rt&me,e[25]=Ue^~nt&ye,e[34]=Me^~Pe&Ze,e[35]=ke^~je&qe,e[44]=et^~ve&xe,e[45]=tt^~ge&Ie,e[6]=Ke^~it&fe,e[7]=Ve^~ot&he,e[16]=Re^~De&ze,e[17]=Oe^~He&Ge,e[26]=rt^~me&Ae,e[27]=nt^~ye&we,e[36]=Pe^~Ze&Xe,e[37]=je^~qe&Je,e[46]=ve^~xe&_e,e[47]=ge^~Ie&Ce,e[8]=it^~fe&Ee,e[9]=ot^~he&Se,e[18]=De^~ze&Qe,e[19]=He^~Ge&$e,e[28]=me^~Ae&Te,e[29]=ye^~we&Le,e[38]=Ze^~Xe&de,e[39]=qe^~Je&le,e[48]=xe^~_e&Fe,e[49]=Ie^~Ce&We,e[0]^=Ib[2*t],e[1]^=Ib[2*t+1]}},Cb=xe.Buffer;function Tb(){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}Tb.prototype.initialize=function(e,t){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},Tb.prototype.absorb=function(e){for(var t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(_b(this.state),this.count=0);return t},Tb.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var Lb=function(e){var t=function(e){function t(t,r,n,i,o){Rb.call(this,o),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=i,this._options=o,this._state=new e,this._state.initialize(t,r),this._finalized=!1}return Te(t,Rb),t.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},t.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},t.prototype.update=function(e,t){if(!kb.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return kb.isBuffer(e)||(e=kb.from(e,t)),this._state.absorb(e),this},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}(e),r=function(e){function t(t,r,n,i){xb.call(this,i),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._options=i,this._state=new e,this._state.initialize(t,r),this._finalized=!1}return Te(t,xb),t.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},t.prototype._flush=function(){},t.prototype._read=function(e){this.push(this.squeeze(e))},t.prototype.update=function(e,t){if(!Ob.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Ob.isBuffer(e)||(e=Ob.from(e,t)),this._state.absorb(e),this},t.prototype.squeeze=function(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}(e);return function(e,n){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new t(1152,448,null,224,n);case"keccak256":return new t(1088,512,null,256,n);case"keccak384":return new t(832,768,null,384,n);case"keccak512":return new t(576,1024,null,512,n);case"sha3-224":return new t(1152,448,6,224,n);case"sha3-256":return new t(1088,512,6,256,n);case"sha3-384":return new t(832,768,6,384,n);case"sha3-512":return new t(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+e)}}}(Tb),Bb=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.keccak=function(e,t){return void 0===t&&(t=256),e="string"!=typeof e||cd.isHexString(e)?Mb.toBuffer(e):n.from(e,"utf8"),t||(t=256),Lb("keccak"+t).update(e).digest()},t.keccak256=function(e){return t.keccak(e)},t.sha256=function(e){return e=Mb.toBuffer(e),ns("sha256").update(e).digest()},t.ripemd160=function(e,t){e=Mb.toBuffer(e);var r=ns("rmd160").update(e).digest();return!0===t?Mb.setLength(r,32):r},t.rlphash=function(e){return t.keccak(nd.encode(e))}}));Object(y.c)(Bb),Bb.keccak,Bb.keccak256,Bb.sha256,Bb.ripemd160,Bb.rlphash;var Nb=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.zeroAddress=function(){var e=Mb.zeros(20);return Mb.bufferToHex(e)},t.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)},t.isZeroAddress=function(e){return t.zeroAddress()===Mb.addHexPrefix(e)},t.toChecksumAddress=function(e,t){e=cd.stripHexPrefix(e).toLowerCase();for(var r=void 0!==t?t.toString()+"0x":"",n=Bb.keccak(r+e).toString("hex"),i="0x",o=0;o=8?i+=e[o].toUpperCase():i+=e[o];return i},t.isValidChecksumAddress=function(e,r){return t.isValidAddress(e)&&t.toChecksumAddress(e,r)===e},t.generateAddress=function(e,t){e=Mb.toBuffer(e);var r=new is(t);return r.isZero()?Bb.rlphash([e,null]).slice(-20):Bb.rlphash([e,n.from(r.toArray())]).slice(-20)},t.generateAddress2=function(e,t,r){var i=Mb.toBuffer(e),o=Mb.toBuffer(t),a=Mb.toBuffer(r);return Object(w.b)(20===i.length),Object(w.b)(32===o.length),Bb.keccak256(n.concat([n.from("ff","hex"),i,o,Bb.keccak256(a)])).slice(-20)},t.isPrecompiled=function(e){var t=Mb.unpad(e);return 1===t.length&&t[0]>=1&&t[0]<=8},t.isValidPrivate=function(e){return Sc.privateKeyVerify(e)},t.isValidPublic=function(e,t){return void 0===t&&(t=!1),64===e.length?Sc.publicKeyVerify(n.concat([n.from([4]),e])):!!t&&Sc.publicKeyVerify(e)},t.pubToAddress=function(e,t){return void 0===t&&(t=!1),e=Mb.toBuffer(e),t&&64!==e.length&&(e=Sc.publicKeyConvert(e,!1).slice(1)),Object(w.b)(64===e.length),Bb.keccak(e).slice(-20)},t.publicToAddress=t.pubToAddress,t.privateToAddress=function(e){return t.publicToAddress(t.privateToPublic(e))},t.privateToPublic=function(e){return e=Mb.toBuffer(e),Sc.publicKeyCreate(e,!1).slice(1)},t.importPublic=function(e){return 64!==(e=Mb.toBuffer(e)).length&&(e=Sc.publicKeyConvert(e,!1).slice(1)),e}}));Object(y.c)(Nb),Nb.zeroAddress,Nb.isValidAddress,Nb.isZeroAddress,Nb.toChecksumAddress,Nb.isValidChecksumAddress,Nb.generateAddress,Nb.generateAddress2,Nb.isPrecompiled,Nb.isValidPrivate,Nb.isValidPublic,Nb.pubToAddress,Nb.publicToAddress,Nb.privateToAddress,Nb.privateToPublic,Nb.importPublic;var Pb=Object(y.b)((function(e,t){function r(e,t){return t?e-(2*t+35):e-27}function i(e){return 0===e||1===e}Object.defineProperty(t,"__esModule",{value:!0}),t.ecsign=function(e,t,r){var n=Sc.sign(e,t),i=n.recovery;return{r:n.signature.slice(0,32),s:n.signature.slice(32,64),v:r?i+(2*r+35):i+27}},t.ecrecover=function(e,t,o,a,s){var c=n.concat([Mb.setLength(o,32),Mb.setLength(a,32)],64),u=r(t,s);if(!i(u))throw new Error("Invalid signature v value");var f=Sc.recover(e,c,u);return Sc.publicKeyConvert(f,!1).slice(1)},t.toRpcSig=function(e,t,o,a){if(!i(r(e,a)))throw new Error("Invalid signature v value");return Mb.bufferToHex(n.concat([Mb.setLengthLeft(t,32),Mb.setLengthLeft(o,32),Mb.toBuffer(e)]))},t.fromRpcSig=function(e){var t=Mb.toBuffer(e);if(65!==t.length)throw new Error("Invalid signature length");var r=t[64];return r<27&&(r+=27),{v:r,r:t.slice(0,32),s:t.slice(32,64)}},t.isValidSignature=function(e,t,n,o,a){void 0===o&&(o=!0);var s=new is("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),c=new is("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==n.length)return!1;if(!i(r(e,a)))return!1;var u=new is(t),f=new is(n);return!(u.isZero()||u.gt(c)||f.isZero()||f.gt(c))&&(!o||1!==f.cmp(s))},t.hashPersonalMessage=function(e){var t=n.from("\x19Ethereum Signed Message:\n"+e.length.toString(),"utf-8");return Bb.keccak(n.concat([t,e]))}}));Object(y.c)(Pb),Pb.ecsign,Pb.ecrecover,Pb.toRpcSig,Pb.fromRpcSig,Pb.isValidSignature,Pb.hashPersonalMessage;var jb=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.defineProperties=function(e,t,r){if(e.raw=[],e._fields=[],e.toJSON=function(t){if(void 0===t&&(t=!1),t){var r={};return e._fields.forEach((function(t){r[t]="0x"+e[t].toString("hex")})),r}return Mb.baToJSON(e.raw)},e.serialize=function(){return nd.encode(e.raw)},t.forEach((function(t,r){function i(){return e.raw[r]}function o(i){"00"!==(i=Mb.toBuffer(i)).toString("hex")||t.allowZero||(i=n.allocUnsafe(0)),t.allowLess&&t.length?(i=Mb.stripZeros(i),Object(w.b)(t.length>=i.length,"The field "+t.name+" must not have more "+t.length+" bytes")):t.allowZero&&0===i.length||!t.length||Object(w.b)(t.length===i.length,"The field "+t.name+" must have byte length of "+t.length),e.raw[r]=i}e._fields.push(t.name),Object.defineProperty(e,t.name,{enumerable:!0,configurable:!0,get:i,set:o}),t.default&&(e[t.name]=t.default),t.alias&&Object.defineProperty(e,t.alias,{enumerable:!1,configurable:!0,set:o,get:i})})),r)if("string"==typeof r&&(r=n.from(cd.stripHexPrefix(r),"hex")),n.isBuffer(r)&&(r=nd.decode(r)),Array.isArray(r)){if(r.length>e._fields.length)throw new Error("wrong number of fields in data");r.forEach((function(t,r){e[e._fields[r]]=Mb.toBuffer(t)}))}else{if("object"!=typeof r)throw new Error("invalid data");var i=Object.keys(r);t.forEach((function(t){-1!==i.indexOf(t.name)&&(e[t.name]=r[t.name]),-1!==i.indexOf(t.alias)&&(e[t.alias]=r[t.alias])}))}}}));Object(y.c)(jb),jb.defineProperties;var Db=Object(y.b)((function(e,t){function r(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),t.secp256k1=Sc,t.BN=is,t.rlp=nd,Object.assign(t,cd),r(Sb),r(Nb),r(Bb),r(Pb),r(Mb),r(jb)}));Object(y.c)(Db),Db.secp256k1,Db.BN,Db.rlp;var Hb=function(){};function zb(e){return e.startsWith("int[")?"int256"+e.slice(3):"int"===e?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):"uint"===e?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):"fixed"===e?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):"ufixed"===e?"ufixed128x128":e}function Gb(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function Fb(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function Wb(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?""===t[2]?"dynamic":parseInt(t[2],10):null}function Yb(e){var t=typeof e;if("string"===t)return Db.isHexPrefixed(e)?new is(Db.stripHexPrefix(e),16):new is(e,10);if("number"===t)return new is(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function Ub(e){var t=/^(\w+)\((.*)\)$/.exec(e);if(3!==t.length)throw new Error("Invalid method signature");var r=/^(.+)\):\((.+)$/.exec(t[2]);if(null!==r&&3===r.length)return{method:t[1],args:r[1].split(","),retargs:r[2].split(",")};var n=t[2].split(",");return 1===n.length&&""===n[0]&&(n=[]),{method:t[1],args:n}}function Kb(e,t){var r,i,o,a;if("address"===e)return Kb("uint160",Yb(t));if("bool"===e)return Kb("uint8",t?1:0);if("string"===e)return Kb("bytes",n.from(t,"utf8"));if(Xb(e)){if(void 0===t.length)throw new Error("Not an array?");if("dynamic"!==(r=Wb(e))&&0!==r&&t.length>r)throw new Error("Elements exceed array size: "+r);for(a in o=[],e=e.slice(0,e.lastIndexOf("[")),"string"==typeof t&&(t=JSON.parse(t)),t)o.push(Kb(e,t[a]));if("dynamic"===r){var s=Kb("uint256",t.length);o.unshift(s)}return n.concat(o)}if("bytes"===e)return t=n.from(t),o=n.concat([Kb("uint256",t.length),t]),t.length%32!=0&&(o=n.concat([o,Db.zeros(32-t.length%32)])),o;if(e.startsWith("bytes")){if((r=Gb(e))<1||r>32)throw new Error("Invalid bytes width: "+r);return Db.setLengthRight(t,32)}if(e.startsWith("uint")){if((r=Gb(e))%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if((i=Yb(t)).bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+i.bitLength());if(i<0)throw new Error("Supplied uint is negative");return i.toArrayLike(n,"be",32)}if(e.startsWith("int")){if((r=Gb(e))%8||r<8||r>256)throw new Error("Invalid int width: "+r);if((i=Yb(t)).bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+i.bitLength());return i.toTwos(256).toArrayLike(n,"be",32)}if(e.startsWith("ufixed")){if(r=Fb(e),(i=Yb(t))<0)throw new Error("Supplied ufixed is negative");return Kb("uint256",i.mul(new is(2).pow(new is(r[1]))))}if(e.startsWith("fixed"))return r=Fb(e),Kb("int256",Yb(t).mul(new is(2).pow(new is(r[1]))));throw new Error("Unsupported or invalid type: "+e)}function Vb(e,t,r){var i,o,a,s;if("string"==typeof e&&(e=Zb(e)),"address"===e.name)return Vb(e.rawType,t,r).toArrayLike(n,"be",20).toString("hex");if("bool"===e.name)return Vb(e.rawType,t,r).toString()===new is(1).toString();if("string"===e.name){var c=Vb(e.rawType,t,r);return n.from(c,"utf8").toString()}if(e.isArray){for(a=[],i=e.size,"dynamic"===e.size&&(r=Vb("uint256",t,r).toNumber(),i=Vb("uint256",t,r).toNumber(),r+=32),s=0;se.size)throw new Error("Decoded int exceeds width: "+e.size+" vs "+o.bitLength());return o}if(e.name.startsWith("int")){if((o=new is(t.slice(r,r+32),16,"be").fromTwos(256)).bitLength()>e.size)throw new Error("Decoded uint exceeds width: "+e.size+" vs "+o.bitLength());return o}if(e.name.startsWith("ufixed")){if(i=new is(2).pow(new is(e.size[1])),!(o=Vb("uint256",t,r)).mod(i).isZero())throw new Error("Decimals not supported yet");return o.div(i)}if(e.name.startsWith("fixed")){if(i=new is(2).pow(new is(e.size[1])),!(o=Vb("int256",t,r)).mod(i).isZero())throw new Error("Decimals not supported yet");return o.div(i)}throw new Error("Unsupported or invalid type: "+e.name)}function Zb(e){var t,r,n;if(Xb(e)){t=Wb(e);var i=e.slice(0,e.lastIndexOf("["));return i=Zb(i),{isArray:!0,name:e,size:t,memoryUsage:"dynamic"===t?32:i.memoryUsage*t,subArray:i}}switch(e){case"address":n="uint160";break;case"bool":n="uint8";break;case"string":n="bytes"}if(r={rawType:n,name:e,memoryUsage:32},e.startsWith("bytes")&&"bytes"!==e||e.startsWith("uint")||e.startsWith("int")?r.size=Gb(e):(e.startsWith("ufixed")||e.startsWith("fixed"))&&(r.size=Fb(e)),e.startsWith("bytes")&&"bytes"!==e&&(r.size<1||r.size>32))throw new Error("Invalid bytes width: "+r.size);if((e.startsWith("uint")||e.startsWith("int"))&&(r.size%8||r.size<8||r.size>256))throw new Error("Invalid int/uint width: "+r.size);return r}function qb(e){return"string"===e||"bytes"===e||"dynamic"===Wb(e)}function Xb(e){return e.lastIndexOf("]")===e.length-1}function Jb(e,t){return e.startsWith("address")||e.startsWith("bytes")?"0x"+t.toString("hex"):t.toString()}function Qb(e){return e>="0"&&e<="9"}Hb.eventID=function(e,t){var r=e+"("+t.map(zb).join(",")+")";return Db.keccak256(n.from(r))},Hb.methodID=function(e,t){return Hb.eventID(e,t).slice(0,4)},Hb.rawEncode=function(e,t){var r=[],i=[],o=0;e.forEach((function(e){if(Xb(e)){var t=Wb(e);o+="dynamic"!==t?32*t:32}else o+=32}));for(var a=0;as)throw new Error("Elements exceed array size: "+s)}var c=t.map((function(e){return Hb.solidityHexValue(a,e,256)}));return n.concat(c)}if("bytes"===e)return t;if("string"===e)return n.from(t,"utf8");if("bool"===e){r=r||8;var u=Array(r/4).join("0");return n.from(t?u+"1":u+"0","hex")}if("address"===e){var f=20;return r&&(f=r/8),Db.setLengthLeft(t,f)}if(e.startsWith("bytes")){if((i=Gb(e))<1||i>32)throw new Error("Invalid bytes width: "+i);return Db.setLengthRight(t,i)}if(e.startsWith("uint")){if((i=Gb(e))%8||i<8||i>256)throw new Error("Invalid uint width: "+i);if((o=Yb(t)).bitLength()>i)throw new Error("Supplied uint exceeds width: "+i+" vs "+o.bitLength());return r=r||i,o.toArrayLike(n,"be",r/8)}if(e.startsWith("int")){if((i=Gb(e))%8||i<8||i>256)throw new Error("Invalid int width: "+i);if((o=Yb(t)).bitLength()>i)throw new Error("Supplied int exceeds width: "+i+" vs "+o.bitLength());return r=r||i,o.toTwos(i).toArrayLike(n,"be",r/8)}throw new Error("Unsupported or invalid type: "+e)},Hb.solidityPack=function(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r=[],i=0;i=2&&("function"==typeof arguments[1]?r.task=arguments[1]:r.n=arguments[1]);var n=r.task;if(r.task=function(){n(t.leave)},t.current+r.n-e>t.capacity)return 1===e&&(t.current--,t.firstHere=!1),t.queue.push(r);t.current+=r.n-e,r.task(t.leave),1===e&&(t.firstHere=!1)},leave:function(e){if(e=e||1,t.current-=e,t.queue.length){var r=t.queue[0];r.n+t.current>t.capacity||(t.queue.shift(),t.current+=r.n,n(r.task))}else if(t.current<0)throw new Error("leave called too many times.")},available:function(e){return e=e||1,t.current+e<=t.capacity}};return t}})),tv=w.c.inherits,rv=/^[0-9A-Fa-f]+$/g,nv=iv;function iv(e){this.nonceLock=ev(1),e.getAccounts&&(this.getAccounts=e.getAccounts),e.processTransaction&&(this.processTransaction=e.processTransaction),e.processMessage&&(this.processMessage=e.processMessage),e.processPersonalMessage&&(this.processPersonalMessage=e.processPersonalMessage),e.processTypedMessage&&(this.processTypedMessage=e.processTypedMessage),this.approveTransaction=e.approveTransaction||this.autoApprove,this.approveMessage=e.approveMessage||this.autoApprove,this.approvePersonalMessage=e.approvePersonalMessage||this.autoApprove,this.approveDecryptMessage=e.approveDecryptMessage||this.autoApprove,this.approveEncryptionPublicKey=e.approveEncryptionPublicKey||this.autoApprove,this.approveTypedMessage=e.approveTypedMessage||this.autoApprove,e.signTransaction&&(this.signTransaction=e.signTransaction||uv("signTransaction")),e.signMessage&&(this.signMessage=e.signMessage||uv("signMessage")),e.signPersonalMessage&&(this.signPersonalMessage=e.signPersonalMessage||uv("signPersonalMessage")),e.decryptMessage&&(this.decryptMessage=e.decryptMessage||uv("decryptMessage")),e.encryptionPublicKey&&(this.encryptionPublicKey=e.encryptionPublicKey||uv("encryptionPublicKey")),e.signTypedMessage&&(this.signTypedMessage=e.signTypedMessage||uv("signTypedMessage")),e.recoverPersonalSignature&&(this.recoverPersonalSignature=e.recoverPersonalSignature),e.publishTransaction&&(this.publishTransaction=e.publishTransaction),this.estimateGas=e.estimateGas||this.estimateGas,this.getGasPrice=e.getGasPrice||this.getGasPrice}function ov(e){return e.toLowerCase()}function av(e){var t=ud.addHexPrefix(e);return ud.isValidAddress(t)}function sv(e){var t=ud.addHexPrefix(e);return!ud.isValidAddress(t)&&cv(e)}function cv(e){return"string"==typeof e&&"0x"===e.slice(0,2)&&e.slice(2).match(rv)}function uv(e){return function(t,r){r(new Error('ProviderEngine - HookedWalletSubprovider - Must provide "'+e+'" fn in constructor options'))}}tv(iv,Ep),iv.prototype.handleRequest=function(e,t,r){var n,i,o,a,s,c=this;switch(c._parityRequests={},c._parityRequestCount=0,e.method){case"eth_coinbase":return void c.getAccounts((function(e,t){if(e)return r(e);var n=t[0]||null;r(null,n)}));case"eth_accounts":return void c.getAccounts((function(e,t){if(e)return r(e);r(null,t)}));case"eth_sendTransaction":return n=e.params[0],void Ab([function(e){return c.validateTransaction(n,e)},function(e){return c.processTransaction(n,e)}],r);case"eth_signTransaction":return n=e.params[0],void Ab([function(e){return c.validateTransaction(n,e)},function(e){return c.processSignTransaction(n,e)}],r);case"eth_sign":return s=e.params[0],a=e.params[1],o=e.params[2]||{},i=dd(o,{from:s,data:a}),void Ab([function(e){return c.validateMessage(i,e)},function(e){return c.processMessage(i,e)}],r);case"personal_sign":return function(){var t=e.params[0];if(sv(e.params[1])&&av(t)){"[message, address]. This was previously handled incorrectly, ","and has been corrected automatically. ","Please switch this param order for smooth behavior in the future.",console.warn("The eth_personalSign method requires params ordered [message, address]. This was previously handled incorrectly, and has been corrected automatically. Please switch this param order for smooth behavior in the future."),s=e.params[0],a=e.params[1]}else a=e.params[0],s=e.params[1];o=e.params[2]||{},i=dd(o,{from:s,data:a}),Ab([function(e){return c.validatePersonalMessage(i,e)},function(e){return c.processPersonalMessage(i,e)}],r)}();case"eth_decryptMessage":return function(){var t=e.params[0];if(sv(e.params[1])&&av(t)){"[message, address]. This was previously handled incorrectly, ","and has been corrected automatically. ","Please switch this param order for smooth behavior in the future.",console.warn("The eth_decryptMessage method requires params ordered [message, address]. This was previously handled incorrectly, and has been corrected automatically. Please switch this param order for smooth behavior in the future."),s=e.params[0],a=e.params[1]}else a=e.params[0],s=e.params[1];o=e.params[2]||{},i=dd(o,{from:s,data:a}),Ab([function(e){return c.validateDecryptMessage(i,e)},function(e){return c.processDecryptMessage(i,e)}],r)}();case"encryption_public_key":return function(){var t=e.params[0];Ab([function(e){return c.validateEncryptionPublicKey(t,e)},function(e){return c.processEncryptionPublicKey(t,e)}],r)}();case"personal_ecRecover":return function(){a=e.params[0];var t=e.params[1];o=e.params[2]||{},i=dd(o,{sig:t,data:a}),c.recoverPersonalSignature(i,r)}();case"eth_signTypedData":case"eth_signTypedData_v3":case"eth_signTypedData_v4":return function(){var t=e.params[0],n=e.params[1];av(t)?(s=t,a=n):(a=t,s=n),o=e.params[2]||{},i=dd(o,{from:s,data:a}),Ab([function(e){return c.validateTypedMessage(i,e)},function(e){return c.processTypedMessage(i,e)}],r)}();case"parity_postTransaction":return n=e.params[0],void c.parityPostTransaction(n,r);case"parity_postSign":return s=e.params[0],a=e.params[1],void c.parityPostSign(s,a,r);case"parity_checkRequest":return function(){var t=e.params[0];c.parityCheckRequest(t,r)}();case"parity_defaultAccount":return void c.getAccounts((function(e,t){if(e)return r(e);var n=t[0]||null;r(null,n)}));default:return void t()}},iv.prototype.getAccounts=function(e){e(null,[])},iv.prototype.processTransaction=function(e,t){var r=this;Ab([function(t){return r.approveTransaction(e,t)},function(e,t){return r.checkApproval("transaction",e,t)},function(t){return r.finalizeAndSubmitTx(e,t)}],t)},iv.prototype.processSignTransaction=function(e,t){var r=this;Ab([function(t){return r.approveTransaction(e,t)},function(e,t){return r.checkApproval("transaction",e,t)},function(t){return r.finalizeTx(e,t)}],t)},iv.prototype.processMessage=function(e,t){var r=this;Ab([function(t){return r.approveMessage(e,t)},function(e,t){return r.checkApproval("message",e,t)},function(t){return r.signMessage(e,t)}],t)},iv.prototype.processPersonalMessage=function(e,t){var r=this;Ab([function(t){return r.approvePersonalMessage(e,t)},function(e,t){return r.checkApproval("message",e,t)},function(t){return r.signPersonalMessage(e,t)}],t)},iv.prototype.processDecryptMessage=function(e,t){var r=this;Ab([function(t){return r.approveDecryptMessage(e,t)},function(e,t){return r.checkApproval("decryptMessage",e,t)},function(t){return r.decryptMessage(e,t)}],t)},iv.prototype.processEncryptionPublicKey=function(e,t){var r=this;Ab([function(t){return r.approveEncryptionPublicKey(e,t)},function(e,t){return r.checkApproval("encryptionPublicKey",e,t)},function(t){return r.encryptionPublicKey(e,t)}],t)},iv.prototype.processTypedMessage=function(e,t){var r=this;Ab([function(t){return r.approveTypedMessage(e,t)},function(e,t){return r.checkApproval("message",e,t)},function(t){return r.signTypedMessage(e,t)}],t)},iv.prototype.autoApprove=function(e,t){t(null,!0)},iv.prototype.checkApproval=function(e,t,r){r(t?null:new Error("User denied "+e+" signature."))},iv.prototype.parityPostTransaction=function(e,t){var r=this,n="0x".concat(r._parityRequestCount.toString(16));r._parityRequestCount++,r.emitPayload({method:"eth_sendTransaction",params:[e]},(function(e,t){if(e)r._parityRequests[n]={error:e};else{var i=t.result;r._parityRequests[n]=i}})),t(null,n)},iv.prototype.parityPostSign=function(e,t,r){var n=this,i="0x".concat(n._parityRequestCount.toString(16));n._parityRequestCount++,n.emitPayload({method:"eth_sign",params:[e,t]},(function(e,t){if(e)n._parityRequests[i]={error:e};else{var r=t.result;n._parityRequests[i]=r}})),r(null,i)},iv.prototype.parityCheckRequest=function(e,t){var r=this._parityRequests[e]||null;return r?r.error?t(r.error):void t(null,r):t(null,null)},iv.prototype.recoverPersonalSignature=function(e,t){var r;try{r=$b(e)}catch(e){return t(e)}t(null,r)},iv.prototype.validateTransaction=function(e,t){if(void 0===e.from)return t(new Error("Undefined address - from address required to sign transaction."));this.validateSender(e.from,(function(r,n){return r?t(r):n?void t():t(new Error('Unknown address - unable to sign transaction for this address: "'.concat(e.from,'"')))}))},iv.prototype.validateMessage=function(e,t){if(void 0===e.from)return t(new Error("Undefined address - from address required to sign message."));this.validateSender(e.from,(function(r,n){return r?t(r):n?void t():t(new Error('Unknown address - unable to sign message for this address: "'.concat(e.from,'"')))}))},iv.prototype.validatePersonalMessage=function(e,t){return void 0===e.from?t(new Error("Undefined address - from address required to sign personal message.")):void 0===e.data?t(new Error("Undefined message - message required to sign personal message.")):cv(e.data)?void this.validateSender(e.from,(function(r,n){return r?t(r):n?void t():t(new Error('Unknown address - unable to sign message for this address: "'.concat(e.from,'"')))})):t(new Error("HookedWalletSubprovider - validateMessage - message was not encoded as hex."))},iv.prototype.validateDecryptMessage=function(e,t){return void 0===e.from?t(new Error("Undefined address - from address required to decrypt message.")):void 0===e.data?t(new Error("Undefined message - message required to decrypt message.")):cv(e.data)?void this.validateSender(e.from,(function(r,n){return r?t(r):n?void t():t(new Error('Unknown address - unable to decrypt message for this address: "'.concat(e.from,'"')))})):t(new Error("HookedWalletSubprovider - validateDecryptMessage - message was not encoded as hex."))},iv.prototype.validateEncryptionPublicKey=function(e,t){this.validateSender(e,(function(r,n){return r?t(r):n?void t():t(new Error('Unknown address - unable to obtain encryption public key for this address: "'.concat(e,'"')))}))},iv.prototype.validateTypedMessage=function(e,t){return void 0===e.from?t(new Error("Undefined address - from address required to sign typed data.")):void 0===e.data?t(new Error("Undefined data - message required to sign typed data.")):void this.validateSender(e.from,(function(r,n){return r?t(r):n?void t():t(new Error('Unknown address - unable to sign message for this address: "'.concat(e.from,'"')))}))},iv.prototype.validateSender=function(e,t){if(!e)return t(null,!1);this.getAccounts((function(r,n){if(r)return t(r);var i=-1!==n.map(ov).indexOf(e.toLowerCase());t(null,i)}))},iv.prototype.finalizeAndSubmitTx=function(e,t){var r=this;r.nonceLock.take((function(){Ab([r.fillInTxExtras.bind(r,e),r.signTransaction.bind(r),r.publishTransaction.bind(r)],(function(e,n){if(r.nonceLock.leave(),e)return t(e);t(null,n)}))}))},iv.prototype.finalizeTx=function(e,t){var r=this;r.nonceLock.take((function(){Ab([r.fillInTxExtras.bind(r,e),r.signTransaction.bind(r)],(function(n,i){if(r.nonceLock.leave(),n)return t(n);t(null,{raw:i,tx:e})}))}))},iv.prototype.publishTransaction=function(e,t){this.emitPayload({method:"eth_sendRawTransaction",params:[e]},(function(e,r){if(e)return t(e);t(null,r.result)}))},iv.prototype.estimateGas=function(e,t){!function(e,t,r){e.sendAsync(gp({method:"eth_estimateGas",params:[t]}),(function(e,t){if(e)return"no contract code at given address"===e.message?r(null,"0xcf08"):r(e);r(null,t.result)}))}(this.engine,e,t)},iv.prototype.getGasPrice=function(e){this.emitPayload({method:"eth_gasPrice",params:[]},(function(t,r){if(t)return e(t);e(null,r.result)}))},iv.prototype.fillInTxExtras=function(e,t){var r=this,n=e.from,i={};void 0===e.gasPrice&&(i.gasPrice=r.getGasPrice.bind(r)),void 0===e.nonce&&(i.nonce=r.emitPayload.bind(r,{method:"eth_getTransactionCount",params:[n,"pending"]})),void 0===e.gas&&(i.gas=r.estimateGas.bind(r,function(e){return{from:e.from,to:e.to,value:e.value,data:e.data,gas:e.gas,gasPrice:e.gasPrice,nonce:e.nonce}}(e))),Eb(i,(function(r,n){if(r)return t(r);var i={};n.gasPrice&&(i.gasPrice=n.gasPrice),n.nonce&&(i.nonce=n.nonce.result),n.gas&&(i.gas=n.gas),t(null,dd(e,i))}))};var fv={v:5e3,d:"Gas limit of the Genesis block."},hv={v:17179869184,d:"Difficulty of the Genesis block."},dv={v:"0x0000000000000042",d:"the geneis nonce"},lv={v:"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa",d:"extra data "},pv={v:"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3",d:"genesis hash"},bv={v:"0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544",d:"the genesis state root"},vv={v:5e3,d:"Minimum the gas limit may ever be."},gv={v:1024,d:"The bound divisor of the gas limit, used in update calculations."},mv={v:131072,d:"The minimum that the difficulty may ever be."},yv={v:2048,d:"The bound divisor of the difficulty, used in the update calculations."},Av={v:13,d:"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not."},wv={v:32,d:"Maximum size extra data may be after Genesis."},Ev={v:3e4,d:"Duration between proof-of-work epochs."},Sv={v:1024,d:"Maximum size of VM stack allowed."},Mv={v:1024,d:"Maximum depth of call/create stack."},kv={v:[0,2,3,5,8,10,20],d:"Once per operation, for a selection of them."},Rv={v:10,d:"Once per EXP instuction."},Ov={v:10,d:"Times ceil(log256(exponent)) for the EXP instruction."},xv={v:30,d:"Once per SHA3 operation."},Iv={v:6,d:"Once per word of the SHA3 operation's data."},_v={v:50,d:"Once per SLOAD operation."},Cv={v:2e4,d:"Once per SSTORE operation if the zeroness changes from zero."},Tv={v:5e3,d:"Once per SSTORE operation if the zeroness does not change from zero."},Lv={v:15e3,d:"Once per SSTORE operation if the zeroness changes to zero."},Bv={v:1,d:"Refunded gas, once per SSTORE operation if the zeroness changes to zero."},Nv={v:375,d:"Per LOG* operation."},Pv={v:8,d:"Per byte in a LOG* operation's data."},jv={v:375,d:"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas."},Dv={v:32e3,d:"Once per CREATE operation & contract-creation transaction."},Hv={v:40,d:"Once per CALL operation & message call transaction."},zv={v:2300,d:"Free gas given at beginning of call."},Gv={v:9e3,d:"Paid for CALL when the value transfor is non-zero."},Fv={v:25e3,d:"Paid for CALL when the destination address didn't exist prior."},Wv={v:24e3,d:"Refunded following a suicide operation."},Yv={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."},Uv={v:512,d:"Divisor for the quadratic particle of the memory cost equation."},Kv={v:200,d:""},Vv={v:21e3,d:"Per transaction. NOTE: Not payable on data of calls between transactions."},Zv={v:32e3,d:"the cost of creating a contract via tx"},qv={v:4,d:"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions."},Xv={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."},Jv={v:3,d:"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added."},Qv={v:3e3,d:""},$v={v:60,d:""},eg={v:12,d:""},tg={v:600,d:""},rg={v:120,d:""},ng={v:15,d:""},ig={v:3,d:""},og={v:"5000000000000000000",d:"the amount a miner get rewarded for mining a block"},ag={v:"625000000000000000",d:"The amount of wei a miner of an uncle block gets for being inculded in the blockchain"},sg={v:"156250000000000000",d:"the amount a miner gets for inculding a uncle"},cg={v:115e4,d:"the block that the Homestead fork started at"},ug={v:2463e3,d:"the block that the Homestead Reprice (EIP150) fork started at"},fg={v:1e5,d:"Exponential difficulty timebomb period"},hg={v:2},dg={genesisGasLimit:fv,genesisDifficulty:hv,genesisNonce:dv,genesisExtraData:lv,genesisHash:pv,genesisStateRoot:bv,minGasLimit:vv,gasLimitBoundDivisor:gv,minimumDifficulty:mv,difficultyBoundDivisor:yv,durationLimit:Av,maximumExtraDataSize:wv,epochDuration:Ev,stackLimit:Sv,callCreateDepth:Mv,tierStepGas:kv,expGas:Rv,expByteGas:Ov,sha3Gas:xv,sha3WordGas:Iv,sloadGas:_v,sstoreSetGas:Cv,sstoreResetGas:Tv,sstoreRefundGas:Lv,jumpdestGas:Bv,logGas:Nv,logDataGas:Pv,logTopicGas:jv,createGas:Dv,callGas:Hv,callStipend:zv,callValueTransferGas:Gv,callNewAccountGas:Fv,suicideRefundGas:Wv,memoryGas:Yv,quadCoeffDiv:Uv,createDataGas:Kv,txGas:Vv,txCreation:Zv,txDataZeroGas:qv,txDataNonZeroGas:Xv,copyGas:Jv,ecrecoverGas:Qv,sha256Gas:$v,sha256WordGas:eg,ripemd160Gas:tg,ripemd160WordGas:rg,identityGas:ng,identityWordGas:ig,minerReward:og,ommerReward:ag,niblingReward:sg,homeSteadForkNumber:cg,homesteadRepriceForkNumber:ug,timebombPeriod:fg,freeBlockPeriod:hg},lg=Object(y.f)(Object.freeze({__proto__:null,genesisGasLimit:fv,genesisDifficulty:hv,genesisNonce:dv,genesisExtraData:lv,genesisHash:pv,genesisStateRoot:bv,minGasLimit:vv,gasLimitBoundDivisor:gv,minimumDifficulty:mv,difficultyBoundDivisor:yv,durationLimit:Av,maximumExtraDataSize:wv,epochDuration:Ev,stackLimit:Sv,callCreateDepth:Mv,tierStepGas:kv,expGas:Rv,expByteGas:Ov,sha3Gas:xv,sha3WordGas:Iv,sloadGas:_v,sstoreSetGas:Cv,sstoreResetGas:Tv,sstoreRefundGas:Lv,jumpdestGas:Bv,logGas:Nv,logDataGas:Pv,logTopicGas:jv,createGas:Dv,callGas:Hv,callStipend:zv,callValueTransferGas:Gv,callNewAccountGas:Fv,suicideRefundGas:Wv,memoryGas:Yv,quadCoeffDiv:Uv,createDataGas:Kv,txGas:Vv,txCreation:Zv,txDataZeroGas:qv,txDataNonZeroGas:Xv,copyGas:Jv,ecrecoverGas:Qv,sha256Gas:$v,sha256WordGas:eg,ripemd160Gas:tg,ripemd160WordGas:rg,identityGas:ng,identityWordGas:ig,minerReward:og,ommerReward:ag,niblingReward:sg,homeSteadForkNumber:cg,homesteadRepriceForkNumber:ug,timebombPeriod:fg,freeBlockPeriod:hg,default:dg})),pg=ud.BN,bg=new pg("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),vg=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=t||{};var r=[{name:"nonce",length:32,allowLess:!0,default:new n([])},{name:"gasPrice",length:32,allowLess:!0,default:new n([])},{name:"gasLimit",alias:"gas",length:32,allowLess:!0,default:new n([])},{name:"to",allowZero:!0,length:20,default:new n([])},{name:"value",length:32,allowLess:!0,default:new n([])},{name:"data",alias:"input",allowZero:!0,default:new n([])},{name:"v",allowZero:!0,default:new n([28])},{name:"r",length:32,allowZero:!0,allowLess:!0,default:new n([])},{name:"s",length:32,allowZero:!0,allowLess:!0,default:new n([])}];ud.defineProperties(this,r,t),Object.defineProperty(this,"from",{enumerable:!0,configurable:!0,get:this.getSenderAddress.bind(this)});var i=ud.bufferToInt(this.v),o=Math.floor((i-35)/2);o<0&&(o=0),this._chainId=o||t.chainId||0,this._homestead=!0}return e.prototype.toCreationAddress=function(){return""===this.to.toString("hex")},e.prototype.hash=function(e){void 0===e&&(e=!0);var t=void 0;if(e)t=this.raw;else if(this._chainId>0){var r=this.raw.slice();this.v=this._chainId,this.r=0,this.s=0,t=this.raw,this.raw=r}else t=this.raw.slice(0,6);return ud.rlphash(t)},e.prototype.getChainId=function(){return this._chainId},e.prototype.getSenderAddress=function(){if(this._from)return this._from;var e=this.getSenderPublicKey();return this._from=ud.publicToAddress(e),this._from},e.prototype.getSenderPublicKey=function(){if(!(this._senderPubKey&&this._senderPubKey.length||this.verifySignature()))throw new Error("Invalid Signature");return this._senderPubKey},e.prototype.verifySignature=function(){var e=this.hash(!1);if(this._homestead&&1===new pg(this.s).cmp(bg))return!1;try{var t=ud.bufferToInt(this.v);this._chainId>0&&(t-=2*this._chainId+8),this._senderPubKey=ud.ecrecover(e,t,this.r,this.s)}catch(e){return!1}return!!this._senderPubKey},e.prototype.sign=function(e){var t=this.hash(!1),r=ud.ecsign(t,e);this._chainId>0&&(r.v+=2*this._chainId+8),Object.assign(this,r)},e.prototype.getDataFee=function(){for(var e=this.raw[5],t=new pg(0),r=0;r0&&t.push(["gas limit is too low. Need at least "+this.getBaseFee()]),void 0===e||!1===e?0===t.length:t.join(" ")},e}(),gg=w.c.inherits,mg=function(e){var t=function(e){switch(e.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":return 1;case"eth_getBlockByNumber":return 0;default:return}}(e);return t>=e.params.length?null:e.params[t]},yg=Ag;function Ag(e){this.nonceCache={}}gg(Ag,Ep),Ag.prototype.handleRequest=function(e,t,r){var i=this;switch(e.method){case"eth_getTransactionCount":var o=mg(e),a=e.params[0].toLowerCase(),s=i.nonceCache[a];return void("pending"===o?s?r(null,s):t((function(e,t,r){if(e)return r();void 0===i.nonceCache[a]&&(i.nonceCache[a]=t),r()})):t());case"eth_sendRawTransaction":return void t((function(t,r,o){if(t)return o();var a=e.params[0],s=(ud.stripHexPrefix(a),n.from(ud.stripHexPrefix(a),"hex"),new vg(n.from(ud.stripHexPrefix(a),"hex"))),c="0x"+s.getSenderAddress().toString("hex").toLowerCase(),u=ud.bufferToInt(s.nonce),f=(++u).toString(16);f.length%2&&(f="0"+f),f="0x"+f,i.nonceCache[c]=f,o()}));case"evm_revert":return i.nonceCache={},void t();default:return void t()}};var wg=Zp,Eg=Kp;function Sg(e){return{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}var Mg=function(e){Object(f.a)(r,e);var t=Object(h.a)(r);function r(){return Object(d.a)(this,r),t.call(this,(function(e){var t=e.blockTracker,r=e.provider,n=e.engine,i=function(e){var t=e.blockTracker,r=e.provider,n={},i=bb({blockTracker:t,provider:r}),o=!1,s=new Pd,c=Fp({eth_subscribe:Lp(function(){var e=Object(a.a)(m.a.mark((function e(s,c){var f,h,d,l,p;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o){e.next=2;break}throw new Error("SubscriptionManager - attempting to use after destroying");case 2:f=s.params[0],h=wg(16),e.t0=f,e.next="newHeads"===e.t0?6:"logs"===e.t0?8:14;break;case 6:return d=function(e){var n=e.subId,i={type:f,destroy:function(){var e=Object(a.a)(m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.removeListener("sync",i.update);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),update:function(){var e=Object(a.a)(m.a.mark((function e(t){var i,o,a,s;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.oldBlock,o=t.newBlock,a=o,s=Eg(i),e.next=4,ib({provider:r,fromBlock:s,toBlock:a});case 4:e.sent.map(Sg).forEach((function(e){u(n,e)}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()};return t.on("sync",i.update),i}({subId:h}),e.abrupt("break",15);case 8:return l=s.params[1],e.next=11,i.newLogFilter(l);case 11:return p=e.sent,d=function(e){var t=e.subId,r=e.filter;return r.on("update",(function(e){return u(t,e)})),{type:f,destroy:function(){var e=Object(a.a)(m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.uninstallFilter(r.idHex);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}}({subId:h,filter:p}),e.abrupt("break",15);case 14:throw new Error('SubscriptionManager - unsupported subscription type "'.concat(f,'"'));case 15:return e.abrupt("return",(n[h]=d,void(c.result=h)));case 16:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()),eth_unsubscribe:Lp(function(){var e=Object(a.a)(m.a.mark((function e(t,r){var i,a;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o){e.next=2;break}throw new Error("SubscriptionManager - attempting to use after destroying");case 2:if(i=t.params[0],a=n[i]){e.next=5;break}return e.abrupt("return",void(r.result=!1));case 5:return delete n[i],e.next=8,a.destroy();case 8:r.result=!0;case 9:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}())});return c.destroy=function(){for(var e in s.removeAllListeners(),n)n[e].destroy(),delete n[e];o=!0},{events:s,middleware:c};function u(e,t){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:e,result:t}})}}({blockTracker:t,provider:r}),o=i.events,s=i.middleware;return o.on("notification",(function(e){return n.emit("data",null,e)})),s}))}return r}(Mp),kg=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=B.__importDefault(Nc),n=B.__importDefault(Hh),i=B.__importDefault(Vh);t.default=function(e){Object(f.a)(a,e);var t=Object(h.a)(a);function a(e){var i;if(Object(d.a)(this,a),(i=t.call(this,{pollingInterval:e.pollingInterval||8e3})).bridge="https://bridge.walletconnect.org",i.qrcode=!0,i.qrcodeModalOptions=void 0,i.rpc=null,i.infuraId="",i.http=null,i.isConnecting=!1,i.connected=!1,i.connectCallbacks=[],i.accounts=[],i.chainId=1,i.networkId=1,i.rpcUrl="",i.bridge=e.connector?e.connector.bridge:e.bridge||"https://bridge.walletconnect.org",i.qrcode=void 0===e.qrcode||!1!==e.qrcode,i.qrcodeModalOptions=e.qrcodeModalOptions,i.wc=e.connector||new r.default({bridge:i.bridge,qrcodeModal:i.qrcode?n.default:void 0,qrcodeModalOptions:i.qrcodeModalOptions}),i.rpc=e.rpc||null,!(i.rpc||e.infuraId&&"string"==typeof e.infuraId&&e.infuraId.trim()))throw new Error("Missing one of the required parameters: rpc or infuraId");return i.infuraId=e.infuraId||"",i.chainId=void 0!==e.chainId?e.chainId:1,i.networkId=i.chainId,i.updateRpcUrl(i.chainId),i.addProvider(new Dp({eth_hashrate:"0x00",eth_mining:!1,eth_syncing:!0,net_listening:!0,web3_clientVersion:"WalletConnect/v1.x.x/javascript"})),i.addProvider(new Pp),i.addProvider(new Mg),i.addProvider(new yb),i.addProvider(new yg),i.addProvider(new nv({getAccounts:function(e){return B.__awaiter(Object(s.a)(i),void 0,void 0,m.a.mark((function t(){var r;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.getWalletConnector();case 3:(r=t.sent.accounts)&&r.length?e(null,r):e(new Error("Failed to get accounts")),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),e(t.t0);case 10:case"end":return t.stop()}}),t,this,[[0,7]])})))},processMessage:function(e,t){return B.__awaiter(Object(s.a)(i),void 0,void 0,m.a.mark((function r(){var n,i;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.getWalletConnector();case 3:return n=r.sent,r.next=6,n.signMessage([e.from,e.data]);case 6:i=r.sent,t(null,i),r.next=13;break;case 10:r.prev=10,r.t0=r.catch(0),t(r.t0);case 13:case"end":return r.stop()}}),r,this,[[0,10]])})))},processPersonalMessage:function(e,t){return B.__awaiter(Object(s.a)(i),void 0,void 0,m.a.mark((function r(){var n,i;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.getWalletConnector();case 3:return n=r.sent,r.next=6,n.signPersonalMessage([e.data,e.from]);case 6:i=r.sent,t(null,i),r.next=13;break;case 10:r.prev=10,r.t0=r.catch(0),t(r.t0);case 13:case"end":return r.stop()}}),r,this,[[0,10]])})))},processSignTransaction:function(e,t){return B.__awaiter(Object(s.a)(i),void 0,void 0,m.a.mark((function r(){var n,i;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.getWalletConnector();case 3:return n=r.sent,r.next=6,n.signTransaction(e);case 6:i=r.sent,t(null,i),r.next=13;break;case 10:r.prev=10,r.t0=r.catch(0),t(r.t0);case 13:case"end":return r.stop()}}),r,this,[[0,10]])})))},processTransaction:function(e,t){return B.__awaiter(Object(s.a)(i),void 0,void 0,m.a.mark((function r(){var n,i;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.getWalletConnector();case 3:return n=r.sent,r.next=6,n.sendTransaction(e);case 6:i=r.sent,t(null,i),r.next=13;break;case 10:r.prev=10,r.t0=r.catch(0),t(r.t0);case 13:case"end":return r.stop()}}),r,this,[[0,10]])})))},processTypedMessage:function(e,t){return B.__awaiter(Object(s.a)(i),void 0,void 0,m.a.mark((function r(){var n,i;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.getWalletConnector();case 3:return n=r.sent,r.next=6,n.signTypedData([e.from,e.data]);case 6:i=r.sent,t(null,i),r.next=13;break;case 10:r.prev=10,r.t0=r.catch(0),t(r.t0);case 13:case"end":return r.stop()}}),r,this,[[0,10]])})))}})),i.addProvider({handleRequest:function(e,t,r){return B.__awaiter(Object(s.a)(i),void 0,void 0,m.a.mark((function t(){var n,i;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.handleRequest(e);case 3:n=t.sent,i=n.result,r(null,i),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),r(t.t0);case 11:case"end":return t.stop()}}),t,this,[[0,8]])})))},setEngine:function(e){return e}}),Object(o.a)(i)}return Object(l.a)(a,[{key:"isWalletConnect",get:function(){return!0}},{key:"connector",get:function(){return this.wc}},{key:"walletMeta",get:function(){return this.wc.peerMeta}},{key:"enable",value:function(){return B.__awaiter(this,void 0,void 0,m.a.mark((function e(){var t;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getWalletConnector();case 2:if(!(t=e.sent)){e.next=5;break}return e.abrupt("return",(this.start(),this.subscribeWalletConnector(),t.accounts));case 5:throw new Error("Failed to connect to WalleConnect");case 6:case"end":return e.stop()}}),e,this)})))}},{key:"request",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.send(e));case 1:case"end":return t.stop()}}),t,this)})))}},{key:"send",value:function(e,t){return B.__awaiter(this,void 0,void 0,m.a.mark((function r(){var n,i;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("string"!=typeof e){r.next=4;break}return n=e,i=t,r.abrupt("return",("personal_sign"===n&&(i=pe.parsePersonalSign(i)),this.sendAsyncPromise(n,i)));case 4:if("personal_sign"===(e=Object.assign({id:pe.payloadId(),jsonrpc:"2.0"},e)).method&&(e.params=pe.parsePersonalSign(e.params)),t){r.next=6;break}return r.abrupt("return",this.sendAsyncPromise(e.method,e.params));case 6:this.sendAsync(e,t);case 7:case"end":return r.stop()}}),r,this)})))}},{key:"onConnect",value:function(e){this.connectCallbacks.push(e)}},{key:"triggerConnect",value:function(e){this.connectCallbacks&&this.connectCallbacks.length&&this.connectCallbacks.forEach((function(t){return t(e)}))}},{key:"disconnect",value:function(){return B.__awaiter(this,void 0,void 0,m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.close();case 1:case"end":return e.stop()}}),e,this)})))}},{key:"close",value:function(){return B.__awaiter(this,void 0,void 0,m.a.mark((function e(){var t;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getWalletConnector({disableSessionCreation:!0});case 2:return t=e.sent,e.next=5,t.killSession();case 5:return e.next=7,this.onDisconnect();case 7:case"end":return e.stop()}}),e,this)})))}},{key:"handleRequest",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r,n,i;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n=null,t.next=4,this.getWalletConnector();case 4:i=t.sent,t.t0=e.method,t.next="wc_killSession"===t.t0?8:"eth_accounts"===t.t0?12:"eth_coinbase"===t.t0?14:"eth_chainId"===t.t0?16:"net_version"===t.t0?18:"eth_uninstallFilter"===t.t0?20:22;break;case 8:return t.next=10,this.close();case 10:return n=null,t.abrupt("break",25);case 12:return n=i.accounts,t.abrupt("break",25);case 14:return n=i.accounts[0],t.abrupt("break",25);case 16:return n=i.chainId,t.abrupt("break",25);case 18:return n=i.networkId||i.chainId,t.abrupt("break",25);case 20:return this.sendAsync(e,(function(e){return e})),n=!0,t.abrupt("break",25);case 22:return t.next=24,this.handleOtherRequests(e);case 24:r=t.sent;case 25:return t.abrupt("return",r||this.formatResponse(e,n));case 28:throw t.prev=28,t.t1=t.catch(0),this.emit("error",t.t1),t.t1;case 31:case"end":return t.stop()}}),t,this,[[0,28]])})))}},{key:"handleOtherRequests",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r,n;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(pe.signingMethods.includes(e.method)||!e.method.startsWith("eth_")){t.next=2;break}return t.abrupt("return",this.handleReadRequests(e));case 2:return t.next=4,this.getWalletConnector();case 4:return r=t.sent,t.next=7,r.sendCustomRequest(e);case 7:return n=t.sent,t.abrupt("return",this.formatResponse(e,n));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"handleReadRequests",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.http){t.next=3;break}throw r=new Error("HTTP Connection not available"),this.emit("error",r),r;case 3:return t.abrupt("return",this.http.send(e));case 4:case"end":return t.stop()}}),t,this)})))}},{key:"formatResponse",value:function(e,t){return{id:e.id,jsonrpc:e.jsonrpc,result:t}}},{key:"getWalletConnector",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.disableSessionCreation,n=void 0!==r&&r;return new Promise((function(t,r){var i=e.wc;if(e.isConnecting)e.onConnect((function(e){return t(e)}));else if(i.connected||n)e.connected||(e.connected=!0,e.updateState(i.session)),t(i);else{e.isConnecting=!0;var o=e.chainId?{chainId:e.chainId}:void 0;i.on("modal_closed",(function(){r(new Error("User closed modal"))})),i.createSession(o).then((function(){i.on("connect",(function(n,o){if(n)return e.isConnecting=!1,r(n);e.isConnecting=!1,e.connected=!0,o&&e.updateState(o.params[0]),e.emit("connect"),e.triggerConnect(i),t(i)}))})).catch((function(t){e.isConnecting=!1,r(t)}))}}))}},{key:"subscribeWalletConnector",value:function(){return B.__awaiter(this,void 0,void 0,m.a.mark((function e(){var t,r=this;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getWalletConnector();case 2:(t=e.sent).on("disconnect",(function(e){e?r.emit("error",e):r.onDisconnect()})),t.on("session_update",(function(e,t){e?r.emit("error",e):r.updateState(t.params[0])}));case 4:case"end":return e.stop()}}),e,this)})))}},{key:"onDisconnect",value:function(){return B.__awaiter(this,void 0,void 0,m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.stop();case 2:this.emit("close",1e3,"Connection closed"),this.emit("disconnect",1e3,"Connection disconnected");case 4:case"end":return e.stop()}}),e,this)})))}},{key:"updateState",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r,n,i,o;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e.accounts,n=e.chainId,i=e.networkId,o=e.rpcUrl,(!this.accounts||r&&this.accounts!==r)&&(this.accounts=r,this.emit("accountsChanged",r)),(!this.chainId||n&&this.chainId!==n)&&(this.chainId=n,this.emit("chainChanged",n)),(!this.networkId||i&&this.networkId!==i)&&(this.networkId=i,this.emit("networkChanged",i)),this.updateRpcUrl(this.chainId,o||"");case 2:case"end":return t.stop()}}),t,this)})))}},{key:"updateRpcUrl",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r={1:"mainnet",3:"ropsten",4:"rinkeby",5:"goerli",42:"kovan"}[e];t||(this.rpc&&this.rpc[e]?t=this.rpc[e]:r&&(t="https://".concat(r,".infura.io/v3/").concat(this.infuraId))),t?(this.rpcUrl=t,this.updateHttpConnection()):this.emit("error",new Error("No RPC Url available for chainId: ".concat(e)))}},{key:"updateHttpConnection",value:function(){var e=this;this.rpcUrl&&(this.http=new i.default(this.rpcUrl),this.http.on("payload",(function(t){return e.emit("payload",t)})),this.http.on("error",(function(t){return e.emit("error",t)})))}},{key:"sendAsyncPromise",value:function(e,t){var r=this;return new Promise((function(n,i){r.sendAsync({id:pe.payloadId(),jsonrpc:"2.0",method:e,params:t||[]},(function(e,t){e?i(e):n(t.result)}))}))}}]),a}(Ap)})),Rg=Object(y.c)(kg);t.default=Rg}.call(this,r(90),r(52).Buffer,r(449).setImmediate)},734:function(e,t,r){"use strict";var n=r(371),i=r.n(n);r.d(t,"a",(function(){return i.a}));var o=r(10),a=r.n(o);r.d(t,"b",(function(){return a.a}));var s=r(448),c=r.n(s);r.d(t,"c",(function(){return c.a}))},759:function(e,t,r){"use strict";var n=r(111),i=r.n(n);r.d(t,"a",(function(){return i.a}))},873:function(e,t){t.endianness=function(){return"LE"},t.hostname=function(){return"undefined"!==typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"undefined"!==typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"}}}]); \ No newline at end of file +/*! For license information please see 10.38a242e1.chunk.js.LICENSE.txt */ +(this.webpackJsonpbridge=this.webpackJsonpbridge||[]).push([[10],{720:function(e,t,r){"use strict";r.r(t),function(e,n,i){r.d(t,"__moduleExports",(function(){return kg}));var o=r(187),a=r(22),s=r(83),c=r(55),u=r(48),f=r(32),h=r(33),d=r(21),l=r(30),p=r(38),b=r(36),v=r(101),g=r(11),m=r.n(g),y=r(714),A=(r(0),r(330),r(73),r(52),r(737)),w=(r(374),r(373),r(736)),E=(r(726),r(10),r(450),r(110),r(761)),S=r(165),M=r.n(S),k=r(188),R=r.n(k),O=r(875),x=r.n(O),I=function(e,t){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},_=function(){return(_=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function T(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function L(e){return this instanceof L?(this.v=e,this):new L(e)}var B=Object.freeze({__proto__:null,__extends:function(e,t){function r(){this.constructor=e}I(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},get __assign(){return _},__rest:function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},__param:function(e,t){return function(r,n){t(r,n,e)}},__metadata:function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__awaiter:function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(a,s)}c((n=n.apply(e,t||[])).next())}))},__generator:function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1||s(e,t)}))})}function s(e,t){try{!function(e){e.value instanceof L?Promise.resolve(e.value.v).then(c,u):f(o[0][2],e)}(i[e](t))}catch(e){f(o[0][3],e)}}function c(e){s("next",e)}function u(e){s("throw",e)}function f(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}},__asyncDelegator:function(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:L(e[n](t)),done:"return"===n}:i?i(t):t}:i}},__asyncValues:function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=C(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,i,(t=e[r](t)).done,t.value)}))}}},__makeTemplateObject:function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},__importStar:function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t},__importDefault:function(e){return e&&e.__esModule?e:{default:e}},__classPrivateFieldGet:function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)},__classPrivateFieldSet:function(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}}),N=Object(y.b)((function(e,t){function r(e){var t=void 0;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function n(e){var t=r(e);if(!t)throw new Error("".concat(e," is not defined in Window"));return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getFromWindow=r,t.getFromWindowOrThrow=n,t.getDocumentOrThrow=function(){return n("document")},t.getDocument=function(){return r("document")},t.getNavigatorOrThrow=function(){return n("navigator")},t.getNavigator=function(){return r("navigator")},t.getLocationOrThrow=function(){return n("location")},t.getLocation=function(){return r("location")},t.getCryptoOrThrow=function(){return n("crypto")},t.getCrypto=function(){return r("crypto")},t.getLocalStorageOrThrow=function(){return n("localStorage")},t.getLocalStorage=function(){return r("localStorage")}}));Object(y.c)(N),N.getFromWindow,N.getFromWindowOrThrow,N.getDocumentOrThrow,N.getDocument,N.getNavigatorOrThrow,N.getNavigator,N.getLocationOrThrow,N.getLocation,N.getCryptoOrThrow,N.getCrypto,N.getLocalStorageOrThrow,N.getLocalStorage;var P=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getWindowMetadata=function(){var e,t;try{e=N.getDocumentOrThrow(),t=N.getLocationOrThrow()}catch(e){return null}function r(){for(var t=arguments.length,r=new Array(t),n=0;n-1){var s=o.getAttribute("href");if(s)if(-1===s.toLowerCase().indexOf("https:")&&-1===s.toLowerCase().indexOf("http:")&&0!==s.indexOf("//")){var c=t.protocol+"//"+t.host;if(0===s.indexOf("/"))c+=s;else{var u=t.pathname.split("/");u.pop(),c+=u.join("/")+"/"+s}n.push(c)}else if(0===s.indexOf("//")){var f=t.protocol+s;n.push(f)}else n.push(s)}}return n}(),name:n}}}));Object(y.c)(P),P.getWindowMetadata;var j=Object(y.b)((function(e,t){function r(e){var t=void 0;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function n(e){var t=r(e);if(!t)throw new Error("".concat(e," is not defined in Window"));return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getFromWindow=r,t.getFromWindowOrThrow=n,t.getDocumentOrThrow=function(){return n("document")},t.getDocument=function(){return r("document")},t.getNavigatorOrThrow=function(){return n("navigator")},t.getNavigator=function(){return r("navigator")},t.getLocationOrThrow=function(){return n("location")},t.getLocation=function(){return r("location")},t.getCryptoOrThrow=function(){return n("crypto")},t.getCrypto=function(){return r("crypto")},t.getLocalStorageOrThrow=function(){return n("localStorage")},t.getLocalStorage=function(){return r("localStorage")}}));Object(y.c)(j),j.getFromWindow,j.getFromWindowOrThrow,j.getDocumentOrThrow,j.getDocument,j.getNavigatorOrThrow,j.getNavigator,j.getLocationOrThrow,j.getLocation,j.getCryptoOrThrow,j.getCrypto,j.getLocalStorageOrThrow,j.getLocalStorage;var D=Object(y.b)((function(t,r){var n=y.d&&y.d.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function s(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},i.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=a(e,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==t&&(i=a(e,t,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,c=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var c=["","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"],u=[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],f=[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];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,h=67108863&c,d=Math.min(u,t.length-1),l=Math.max(0,u-e.length+1);l<=d;l++){var p=u-l|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[l])+h)/67108864|0,h=67108863&a}r.words[u]=0|h,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?c[6-h.length]+h+n:h+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var d=u[e],l=f[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(e);n=(p=p.idivn(l)).isZero()?b+n:c[d-b.length]+b+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===t,u=new e(o),f=this.clone();if(c){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),u[s]=a;for(;s=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},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,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},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,l=0|a[1],p=8191&l,b=l>>>13,v=0|a[2],g=8191&v,m=v>>>13,y=0|a[3],A=8191&y,w=y>>>13,E=0|a[4],S=8191&E,M=E>>>13,k=0|a[5],R=8191&k,O=k>>>13,x=0|a[6],I=8191&x,_=x>>>13,C=0|a[7],T=8191&C,L=C>>>13,B=0|a[8],N=8191&B,P=B>>>13,j=0|a[9],D=8191&j,H=j>>>13,z=0|s[0],G=8191&z,F=z>>>13,W=0|s[1],Y=8191&W,U=W>>>13,K=0|s[2],V=8191&K,Z=K>>>13,q=0|s[3],X=8191&q,J=q>>>13,Q=0|s[4],$=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],he=8191&fe,de=fe>>>13,le=0|s[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ve=(u+(n=Math.imul(h,G))|0)+((8191&(i=(i=Math.imul(h,F))+Math.imul(d,G)|0))<<13)|0;u=((o=Math.imul(d,F))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(p,G),i=(i=Math.imul(p,F))+Math.imul(b,G)|0,o=Math.imul(b,F);var ge=(u+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,U)|0)+Math.imul(d,Y)|0))<<13)|0;u=((o=o+Math.imul(d,U)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,G),i=(i=Math.imul(g,F))+Math.imul(m,G)|0,o=Math.imul(m,F),n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,U)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,U)|0;var me=(u+(n=n+Math.imul(h,V)|0)|0)+((8191&(i=(i=i+Math.imul(h,Z)|0)+Math.imul(d,V)|0))<<13)|0;u=((o=o+Math.imul(d,Z)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(A,G),i=(i=Math.imul(A,F))+Math.imul(w,G)|0,o=Math.imul(w,F),n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,U)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,U)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,Z)|0;var ye=(u+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(d,X)|0))<<13)|0;u=((o=o+Math.imul(d,J)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(S,G),i=(i=Math.imul(S,F))+Math.imul(M,G)|0,o=Math.imul(M,F),n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,U)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,U)|0,n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,Z)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,J)|0;var Ae=(u+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(d,$)|0))<<13)|0;u=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(R,G),i=(i=Math.imul(R,F))+Math.imul(O,G)|0,o=Math.imul(O,F),n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,U)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,U)|0,n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,Z)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,ee)|0;var we=(u+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(d,re)|0))<<13)|0;u=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(I,G),i=(i=Math.imul(I,F))+Math.imul(_,G)|0,o=Math.imul(_,F),n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,U)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,U)|0,n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,Z)|0,n=n+Math.imul(A,X)|0,i=(i=i+Math.imul(A,J)|0)+Math.imul(w,X)|0,o=o+Math.imul(w,J)|0,n=n+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0;var Ee=(u+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ae)|0)+Math.imul(d,oe)|0))<<13)|0;u=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(T,G),i=(i=Math.imul(T,F))+Math.imul(L,G)|0,o=Math.imul(L,F),n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,U)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,U)|0,n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,J)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(w,$)|0,o=o+Math.imul(w,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0;var Se=(u+(n=n+Math.imul(h,ce)|0)|0)+((8191&(i=(i=i+Math.imul(h,ue)|0)+Math.imul(d,ce)|0))<<13)|0;u=((o=o+Math.imul(d,ue)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(N,G),i=(i=Math.imul(N,F))+Math.imul(P,G)|0,o=Math.imul(P,F),n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,U)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,U)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,J)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0;var Me=(u+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(d,he)|0))<<13)|0;u=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,G),i=(i=Math.imul(D,F))+Math.imul(H,G)|0,o=Math.imul(H,F),n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,U)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,U)|0,n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,Z)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,n=n+Math.imul(g,ce)|0,i=(i=i+Math.imul(g,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(b,he)|0,o=o+Math.imul(b,de)|0;var ke=(u+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,be)|0)+Math.imul(d,pe)|0))<<13)|0;u=((o=o+Math.imul(d,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,Y),i=(i=Math.imul(D,U))+Math.imul(H,Y)|0,o=Math.imul(H,U),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,n=n+Math.imul(A,ce)|0,i=(i=i+Math.imul(A,ue)|0)+Math.imul(w,ce)|0,o=o+Math.imul(w,ue)|0,n=n+Math.imul(g,he)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(m,he)|0,o=o+Math.imul(m,de)|0;var Re=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,V),i=(i=Math.imul(D,Z))+Math.imul(H,V)|0,o=Math.imul(H,Z),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,J)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(S,ce)|0,i=(i=i+Math.imul(S,ue)|0)+Math.imul(M,ce)|0,o=o+Math.imul(M,ue)|0,n=n+Math.imul(A,he)|0,i=(i=i+Math.imul(A,de)|0)+Math.imul(w,he)|0,o=o+Math.imul(w,de)|0;var Oe=(u+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,be)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,X),i=(i=Math.imul(D,J))+Math.imul(H,X)|0,o=Math.imul(H,J),n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(L,re)|0,o=o+Math.imul(L,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,n=n+Math.imul(S,he)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(M,he)|0,o=o+Math.imul(M,de)|0;var xe=(u+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,be)|0)+Math.imul(w,pe)|0))<<13)|0;u=((o=o+Math.imul(w,be)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,ee))+Math.imul(H,$)|0,o=Math.imul(H,ee),n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,n=n+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,ue)|0)+Math.imul(_,ce)|0,o=o+Math.imul(_,ue)|0,n=n+Math.imul(R,he)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(O,he)|0,o=o+Math.imul(O,de)|0;var Ie=(u+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,be)|0)+Math.imul(M,pe)|0))<<13)|0;u=((o=o+Math.imul(M,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(H,re)|0,o=Math.imul(H,ne),n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,n=n+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,ue)|0)+Math.imul(L,ce)|0,o=o+Math.imul(L,ue)|0,n=n+Math.imul(I,he)|0,i=(i=i+Math.imul(I,de)|0)+Math.imul(_,he)|0,o=o+Math.imul(_,de)|0;var _e=(u+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,be)|0)+Math.imul(O,pe)|0))<<13)|0;u=((o=o+Math.imul(O,be)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,ae))+Math.imul(H,oe)|0,o=Math.imul(H,ae),n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(P,ce)|0,o=o+Math.imul(P,ue)|0,n=n+Math.imul(T,he)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(L,he)|0,o=o+Math.imul(L,de)|0;var Ce=(u+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,be)|0)+Math.imul(_,pe)|0))<<13)|0;u=((o=o+Math.imul(_,be)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(D,ce),i=(i=Math.imul(D,ue))+Math.imul(H,ce)|0,o=Math.imul(H,ue),n=n+Math.imul(N,he)|0,i=(i=i+Math.imul(N,de)|0)+Math.imul(P,he)|0,o=o+Math.imul(P,de)|0;var Te=(u+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,be)|0)+Math.imul(L,pe)|0))<<13)|0;u=((o=o+Math.imul(L,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,he),i=(i=Math.imul(D,de))+Math.imul(H,he)|0,o=Math.imul(H,de);var Le=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,be)|0)+Math.imul(P,pe)|0))<<13)|0;u=((o=o+Math.imul(P,be)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863;var Be=(u+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,be))+Math.imul(H,pe)|0))<<13)|0;return u=((o=Math.imul(H,be))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,c[0]=ve,c[1]=ge,c[2]=me,c[3]=ye,c[4]=Ae,c[5]=we,c[6]=Ee,c[7]=Se,c[8]=Me,c[9]=ke,c[10]=Re,c[11]=Oe,c[12]=xe,c[13]=Ie,c[14]=_e,c[15]=Ce,c[16]=Te,c[17]=Le,c[18]=Be,0!==u&&(c[19]=u,r.length++),r};function l(e,t,r){return(new p).mulp(e,t,r)}function p(e,t){this.x=e,this.y=t}Math.imul||(d=h),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?d(this,e,t):r<63?h(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):l(this,e,t)},p.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n>=1;return n},p.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==f||u>=i);u--){var h=0|this.words[u];this.words[u]=f<<26-o|h>>>o,f=h&s}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!==(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,c=n.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;h--){var d=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(o,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var f=n.clone(),h=t.clone();!t.isZero();){for(var d=0,l=1;0==(t.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(f),a.isub(h)),o.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(n.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(f),c.isub(h)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,f=1;0==(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var h=0,d=1;0==(n.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(n.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new E(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function m(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function y(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},n(g,v),g.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},g.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new g;else if("p224"===e)t=new m;else if("p192"===e)t=new y;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return b[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var h=this.pow(f,o),d=this.pow(e,o.addn(1).iushrn(1)),l=this.pow(e,o),p=a;0!==l.cmp(s);){for(var b=l,v=0;0!==b.cmp(s);v++)b=b.redSqr();r(v=0;n--){for(var u=t.words[n],f=c-1;f>=0;f--){var h=u>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===n&&0===f)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}c=26}return o},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},n(S,E),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,y.d)})),F=U;U.strict=K,U.loose=V;var W=Object.prototype.toString,Y={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function U(e){return K(e)||V(e)}function K(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function V(e){return Y[W.call(e)]}var Z=F.strict,q=function(e){if(Z(e)){var t=n.from(e.buffer);return e.byteLength!==e.buffer.byteLength&&(t=t.slice(e.byteOffset,e.byteOffset+e.byteLength)),t}return n.from(e)},X=Object(y.b)((function(e,t){var r=y.d&&y.d.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(G),o=r(F),a=r(q);function s(e){return new Uint8Array(e)}function c(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.toString("hex");return t?M(r):r}function u(e){return e.toString("utf8")}function f(e){return p(c(e))}function h(e){return a.default(e)}function d(e){return n.from(S(e),"hex")}function l(e){return s(d(e))}function p(e){return new i.default(S(e),"hex").toNumber()}function b(e){return n.from(e,"utf8")}function v(e,t){var r=S(k(new i.default(e).toString(16)));return t?M(r):r}function g(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}function m(e){return n.isBuffer(e)}function A(e){return o.default.strict(e)&&!m(e)}function w(e){return!A(e)&&!m(e)&&void 0!==e.byteLength}function E(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"0",i=t-e.length,o=e;if(i>0){var a=n.repeat(i);o=r?a+e:e+a}return o}function S(e){return e.replace(/^0x/,"")}function M(e){return e.startsWith("0x")?e:"0x".concat(e)}function k(e){return(e=(e=S(e)).length%2!=0?"0"+e:e)&&(e=M(e)),e}t.bufferToArray=s,t.bufferToHex=c,t.bufferToUtf8=u,t.bufferToNumber=f,t.arrayToBuffer=h,t.arrayToHex=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return c(h(e),t)},t.arrayToUtf8=function(e){return u(h(e))},t.arrayToNumber=function(e){return f(h(e))},t.hexToBuffer=d,t.hexToArray=l,t.hexToUtf8=function(e){return u(d(e))},t.hexToNumber=p,t.utf8ToBuffer=b,t.utf8ToArray=function(e){return s(b(e))},t.utf8ToHex=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return c(b(e),t)},t.utf8ToNumber=function(e){return new i.default(e,10).toNumber()},t.numberToBuffer=function(e){return d(v(e))},t.numberToArray=function(e){return l(v(e))},t.numberToHex=v,t.numberToUtf8=function(e){return new i.default(e).toString()},t.isHexString=g,t.isBuffer=m,t.isTypedArray=A,t.isArrayBuffer=w,t.getType=function(e){return m(e)?"buffer":A(e)?"typed-array":w(e)?"array-buffer":Array.isArray(e)?"array":typeof e},t.getEncoding=function(e){return g(e)?"hex":"utf8"},t.concatBuffers=function(){for(var e=arguments.length,t=new Array(e),r=0;r0&&(e=e.slice(r)),e},t.trimRight=function(e,t){return e.slice(0,t)},t.padLeft=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0";return E(e,t,!0,r)},t.padRight=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0";return E(e,t,!1,r)},t.removeHexPrefix=S,t.addHexPrefix=M,t.sanitizeHex=k,t.removeHexLeadingZeros=function(e){var t=e.startsWith("0x");return e=(e=S(e)).startsWith("0")?e.substring(1):e,t?M(e):e}}));Object(y.c)(X),X.bufferToArray,X.bufferToHex,X.bufferToUtf8,X.bufferToNumber,X.arrayToBuffer,X.arrayToHex,X.arrayToUtf8,X.arrayToNumber,X.hexToBuffer,X.hexToArray,X.hexToUtf8,X.hexToNumber,X.utf8ToBuffer,X.utf8ToArray,X.utf8ToHex,X.utf8ToNumber,X.numberToBuffer,X.numberToArray,X.numberToHex,X.numberToUtf8,X.isHexString,X.isBuffer,X.isTypedArray,X.isArrayBuffer,X.getType,X.getEncoding,X.concatBuffers,X.trimLeft,X.trimRight,X.padLeft,X.padRight,X.removeHexPrefix,X.addHexPrefix,X.sanitizeHex,X.removeHexLeadingZeros;var J=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=B.__importStar(X);t.convertArrayBufferToBuffer=function(e){return r.arrayToBuffer(new Uint8Array(e))},t.convertArrayBufferToUtf8=function(e){return r.arrayToUtf8(new Uint8Array(e))},t.convertArrayBufferToHex=function(e,t){return r.arrayToHex(new Uint8Array(e),!t)},t.convertArrayBufferToNumber=function(e){return r.arrayToNumber(new Uint8Array(e))},t.concatArrayBuffers=function(){for(var e=arguments.length,t=new Array(e),n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function L(e,t,r){T.call(this,e,t,r)}T.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(r);if(null===e)throw new Error(r);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||s&&ArrayBuffer.isView(e)))throw new Error(r);t=!0}for(var i,o,a=this.blocks,c=this.byteCount,u=e.length,h=this.blockCount,d=0,l=this.s;d>2]|=e[d]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[i>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=c){for(this.start=i-c,this.block=a[h],i=0;i>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},T.prototype.encodeString=function(e){var t,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(r);if(null===e)throw new Error(r);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||s&&ArrayBuffer.isView(e)))throw new Error(r);t=!0}var i=0,o=e.length;if(t)i=o;else for(var a=0;a=57344?i+=3:(c=65536+((1023&c)<<10|1023&e.charCodeAt(++a)),i+=4)}return i+=this.encode(8*i),this.update(e),i},T.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+c[15&e]+c[e>>12&15]+c[e>>8&15]+c[e>>20&15]+c[e>>16&15]+c[e>>28&15]+c[e>>24&15];a%t==0&&(B(r),o=0)}return i&&(e=r[o],s+=c[e>>4&15]+c[15&e],i>1&&(s+=c[e>>12&15]+c[e>>8&15]),i>2&&(s+=c[e>>20&15]+c[e>>16&15])),s},T.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var c=new Uint32Array(e);a>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;s%r==0&&B(n)}return o&&(e=s<<2,t=n[a],c[e]=255&t,o>1&&(c[e+1]=t>>8&255),o>2&&(c[e+2]=t>>16&255)),c},L.prototype=new T,L.prototype.finalize=function(){return this.encode(this.outputBits,!0),T.prototype.finalize.call(this)};var B=function(e){var t,r,n,i,o,a,s,c,u,f,d,l,p,b,v,g,m,y,A,w,E,S,M,k,R,O,x,I,_,C,T,L,B,N,P,j,D,H,z,G,F,W,Y,U,K,V,Z,q,X,J,Q,$,ee,te,re,ne,ie,oe,ae,se,ce,ue,fe;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],f=e[6]^e[16]^e[26]^e[36]^e[46],d=e[7]^e[17]^e[27]^e[37]^e[47],t=(l=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(c<<1|u>>>31),r=o^(u<<1|c>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(f<<1|d>>>31),r=s^(d<<1|f>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=c^(l<<1|p>>>31),r=u^(p<<1|l>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=f^(i<<1|o>>>31),r=d^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,b=e[0],v=e[1],V=e[11]<<4|e[10]>>>28,Z=e[10]<<4|e[11]>>>28,I=e[20]<<3|e[21]>>>29,_=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,W=e[40]<<18|e[41]>>>14,Y=e[41]<<18|e[40]>>>14,N=e[2]<<1|e[3]>>>31,P=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,m=e[12]<<12|e[13]>>>20,q=e[22]<<10|e[23]>>>22,X=e[23]<<10|e[22]>>>22,C=e[33]<<13|e[32]>>>19,T=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,j=e[14]<<6|e[15]>>>26,D=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,A=e[24]<<11|e[25]>>>21,J=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,L=e[45]<<29|e[44]>>>3,B=e[44]<<29|e[45]>>>3,k=e[6]<<28|e[7]>>>4,R=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,H=e[26]<<25|e[27]>>>7,z=e[27]<<25|e[26]>>>7,w=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,U=e[8]<<27|e[9]>>>5,K=e[9]<<27|e[8]>>>5,O=e[18]<<20|e[19]>>>12,x=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,G=e[38]<<8|e[39]>>>24,F=e[39]<<8|e[38]>>>24,S=e[48]<<14|e[49]>>>18,M=e[49]<<14|e[48]>>>18,e[0]=b^~g&y,e[1]=v^~m&A,e[10]=k^~O&I,e[11]=R^~x&_,e[20]=N^~j&H,e[21]=P^~D&z,e[30]=U^~V&q,e[31]=K^~Z&X,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=g^~y&w,e[3]=m^~A&E,e[12]=O^~I&C,e[13]=x^~_&T,e[22]=j^~H&G,e[23]=D^~z&F,e[32]=V^~q&J,e[33]=Z^~X&Q,e[42]=ne^~oe&se,e[43]=ie^~ae&ce,e[4]=y^~w&S,e[5]=A^~E&M,e[14]=I^~C&L,e[15]=_^~T&B,e[24]=H^~G&W,e[25]=z^~F&Y,e[34]=q^~J&$,e[35]=X^~Q&ee,e[44]=oe^~se&ue,e[45]=ae^~ce&fe,e[6]=w^~S&b,e[7]=E^~M&v,e[16]=C^~L&k,e[17]=T^~B&R,e[26]=G^~W&N,e[27]=F^~Y&P,e[36]=J^~$&U,e[37]=Q^~ee&K,e[46]=se^~ue&te,e[47]=ce^~fe&re,e[8]=S^~b&g,e[9]=M^~v&m,e[18]=L^~k&O,e[19]=B^~R&x,e[28]=W^~N&j,e[29]=Y^~P&D,e[38]=$^~U&V,e[39]=ee^~K&Z,e[48]=ue^~te&ne,e[49]=fe^~re&ie,e[0]^=h[n],e[1]^=h[n+1]};if(a)t.exports=M;else for(R=0;R7?r+=e[n].toUpperCase():r+=e[n];return X.addHexPrefix(r)}Object.defineProperty(t,"__esModule",{value:!0}),t.toChecksumAddress=r,t.isValidAddress=function(e){return!!e&&"0x"===e.toLowerCase().substring(0,2)&&!!/^(0x)?[0-9a-f]{40}$/i.test(e)&&(!(!/^(0x)?[0-9a-f]{40}$/.test(e)&&!/^(0x)?[0-9A-F]{40}$/.test(e))||e===r(e))},t.parsePersonalSign=function(e){return re.isEmptyArray(e)||re.isHexString(e[0])||(e[0]=J.convertUtf8ToHex(e[0])),e},t.parseTransactionData=function(e){if(void 0===e.from||!t.isValidAddress(e.from))throw new Error("Transaction object must include a valid 'from' value.");function r(e){var t=e;return("number"==typeof e||"string"==typeof e&&!re.isEmptyString(e))&&(re.isHexString(e)?"string"==typeof e&&(t=te.sanitizeHex(e)):t=J.convertNumberToHex(e)),"string"==typeof t&&(t=te.removeHexLeadingZeros(t)),t}var n={from:te.sanitizeHex(e.from),to:void 0===e.to?"":te.sanitizeHex(e.to),gasPrice:void 0===e.gasPrice?"":r(e.gasPrice),gas:void 0===e.gas?void 0===e.gasLimit?"":r(e.gasLimit):r(e.gas),value:void 0===e.value?"":r(e.value),nonce:void 0===e.nonce?"":r(e.nonce),data:void 0===e.data?"":te.sanitizeHex(e.data)||"0x"},i=["gasPrice","gas","value","nonce"];return Object.keys(n).forEach((function(e){!n[e].trim().length&&i.includes(e)&&delete n[e]})),n}}));Object(y.c)(ne),ne.toChecksumAddress,ne.isValidAddress,ne.parsePersonalSign,ne.parseTransactionData;var ie=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.setLocal=function(e,t){var r=te.safeJsonStringify(t),n=H.getLocalStorage();n&&n.setItem(e,r)},t.getLocal=function(e){var t=null,r=H.getLocalStorage();return r&&(t=r.getItem(e)),te.safeJsonParse(t)},t.removeLocal=function(e){var t=H.getLocalStorage();t&&t.removeItem(e)}}));Object(y.c)(ie),ie.setLocal,ie.getLocal,ie.removeLocal;var oe=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.promisify=function(e,t){var r=this;return function(){for(var n=arguments.length,i=new Array(n),o=0;o-1?r.split(e.arrayFormatSeparator).map((function(t){return i(t,e)})):null===r?r:i(r,e);n[t]=o};default:return function(e,t,r){void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t),o=Object.create(null);if("string"!=typeof e)return o;if(!(e=e.trim().replace(/^[?#&]/,"")))return o;var a,c=Object(v.a)(e.split("&"));try{for(c.s();!(a=c.n()).done;){var u=a.value,f=fe(t.decode?u.replace(/\+/g," "):u,"="),h=Object(b.a)(f,2),d=h[0],l=h[1];l=void 0===l?null:["comma","separator"].includes(t.arrayFormat)?l:i(l,t),n(i(d,t),l,o)}}catch(S){c.e(S)}finally{c.f()}for(var p=0,g=Object.keys(o);p0})).join("&")},t.parseUrl=function(e,t){t=Object.assign({decode:!0},t);var r=fe(e,"#"),n=Object(b.a)(r,2),o=n[0],s=n[1];return Object.assign({url:o.split("?")[0]||"",query:c(a(e),t)},t&&t.parseFragmentIdentifier&&s?{fragmentIdentifier:i(s,t)}:{})},t.stringifyUrl=function(e,r){r=Object.assign({encode:!0,strict:!0},r);var i=o(e.url).split("?")[0]||"",a=t.extract(e.url),s=t.parse(a,{sort:!1}),c=Object.assign(s,e.query),u=t.stringify(c,r);u&&(u="?".concat(u));var f=function(e){var t="",r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(f="#".concat(n(e.fragmentIdentifier,r))),"".concat(i).concat(u).concat(f)}})),de=(he.extract,he.parse,he.stringify,he.parseUrl,he.stringifyUrl,Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=B.__importStar(he);function n(e){return r.parse(e)}function i(e){return r.stringify(e)}t.getQueryString=function(e){var t=-1!==e.indexOf("?")?e.indexOf("?"):void 0;return void 0!==t?e.substr(t):""},t.appendToQueryString=function(e,t){var r=n(e);return i(r=Object.assign(Object.assign({},r),t))},t.parseQueryString=n,t.formatQueryString=i})));Object(y.c)(de),de.getQueryString,de.appendToQueryString,de.parseQueryString,de.formatQueryString;var le=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isWalletConnectSession=function(e){return void 0!==e.bridge},t.parseWalletConnectUri=function(e){var t=e.indexOf(":"),r=-1!==e.indexOf("?")?e.indexOf("?"):void 0,n=e.substring(0,t),i=function(e){var t=e.split("@");return{handshakeTopic:t[0],version:parseInt(t[1],10)}}(e.substring(t+1,r)),o=function(e){var t=de.parseQueryString(e);return{key:t.key||"",bridge:t.bridge||""}}(void 0!==r?e.substr(r):"");return Object.assign(Object.assign({protocol:n},i),o)}}));Object(y.c)(le),le.isWalletConnectSession,le.parseWalletConnectUri;var pe=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),B.__exportStar(H,t),B.__exportStar(z,t),B.__exportStar(J,t),B.__exportStar(ne,t),B.__exportStar(ie,t),B.__exportStar(te,t),B.__exportStar(oe,t),B.__exportStar(le,t),B.__exportStar(de,t),B.__exportStar(re,t)}));Object(y.c)(pe);var be=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){function e(){var t=this;Object(d.a)(this,e),this._eventEmitters=[],"undefined"!=typeof window&&void 0!==window.addEventListener&&(window.addEventListener("online",(function(){return t.trigger("online")})),window.addEventListener("offline",(function(){return t.trigger("offline")})))}return Object(l.a)(e,[{key:"on",value:function(e,t){this._eventEmitters.push({event:e,callback:t})}},{key:"trigger",value:function(e){var t=[];e&&(t=this._eventEmitters.filter((function(t){return t.event===e}))),t.forEach((function(e){e.callback()}))}}]),e}()}));Object(y.c)(be);var ve=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")},ge=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=B.__importDefault(be),n=void 0!==y.d.WebSocket?y.d.WebSocket:ve;t.default=function(){function e(t){var n=this;if(Object(d.a)(this,e),this._queue=[],this._events=[],this._subscriptions=[],this._initiating=!1,this._url="",this._netMonitor=null,this._socket=null,this._nextSocket=null,this._subscriptions=t.subscriptions||[],this._netMonitor=t.netMonitor||new r.default,!t.url||"string"!=typeof t.url)throw new Error("Missing or invalid WebSocket url");this._url=t.url,this._netMonitor.on("online",(function(){return n._socketCreate()}))}return Object(l.a)(e,[{key:"readyState",get:function(){return this._socket?this._socket.readyState:-1},set:function(e){}},{key:"connecting",get:function(){return 0===this.readyState},set:function(e){}},{key:"connected",get:function(){return 1===this.readyState},set:function(e){}},{key:"closing",get:function(){return 2===this.readyState},set:function(e){}},{key:"closed",get:function(){return 3===this.readyState},set:function(e){}},{key:"open",value:function(){this._socketCreate()}},{key:"close",value:function(){this._socketClose()}},{key:"send",value:function(e,t,r){if(!t||"string"!=typeof t)throw new Error("Missing or invalid topic field");this._socketSend({topic:t,type:"pub",payload:e,silent:!!r})}},{key:"subscribe",value:function(e){this._socketSend({topic:e,type:"sub",payload:"",silent:!0})}},{key:"on",value:function(e,t){this._events.push({event:e,callback:t})}},{key:"_socketCreate",value:function(){var e=this;if(!this._initiating){this._initiating=!0;var t=this._url.startsWith("https")?this._url.replace("https","wss"):this._url.startsWith("http")?this._url.replace("http","ws"):this._url;if(this._nextSocket=new n(t),!this._nextSocket)throw new Error("Failed to create socket");this._nextSocket.onmessage=function(t){return e._socketReceive(t)},this._nextSocket.onopen=function(){return e._socketOpen()}}}},{key:"_socketOpen",value:function(){this._socketClose(),this._initiating=!1,this._socket=this._nextSocket,this._nextSocket=null,this._queueSubscriptions(),this._pushQueue()}},{key:"_socketClose",value:function(){this._socket&&(this._socket.onclose=function(){},this._socket.close())}},{key:"_socketSend",value:function(e){var t=JSON.stringify(e);this._socket&&1===this._socket.readyState?this._socket.send(t):(this._setToQueue(e),this._socketCreate())}},{key:"_socketReceive",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r,n;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.prev=0,r=JSON.parse(e.data),t.next=7;break;case 4:return t.prev=4,t.t0=t.catch(0),t.abrupt("return");case 7:this._socketSend({topic:r.topic,type:"ack",payload:"",silent:!0}),this._socket&&1===this._socket.readyState&&(n=this._events.filter((function(e){return"message"===e.event})))&&n.length&&n.forEach((function(e){return e.callback(r)}));case 8:case"end":return t.stop()}}),t,this,[[0,4]])})))}},{key:"_queueSubscriptions",value:function(){var e=this;this._subscriptions.forEach((function(t){return e._queue.push({topic:t,type:"sub",payload:"",silent:!0})})),this._subscriptions=[]}},{key:"_setToQueue",value:function(e){this._queue.push(e)}},{key:"_pushQueue",value:function(){var e=this;this._queue.forEach((function(t){return e._socketSend(t)})),this._queue=[]}}]),e}()}));Object(y.c)(ge);var me=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.ERROR_SESSION_CONNECTED="Session currently connected",t.ERROR_SESSION_DISCONNECTED="Session currently disconnected",t.ERROR_SESSION_REJECTED="Session Rejected",t.ERROR_MISSING_JSON_RPC="Missing JSON RPC response",t.ERROR_MISSING_RESULT='JSON-RPC success response must include "result" field',t.ERROR_MISSING_ERROR='JSON-RPC error response must include "error" field',t.ERROR_MISSING_METHOD='JSON RPC request must have valid "method" value',t.ERROR_MISSING_ID='JSON RPC request must have valid "id" value',t.ERROR_MISSING_REQUIRED="Missing one of the required parameters: bridge / uri / session",t.ERROR_INVALID_RESPONSE="JSON RPC response format is invalid",t.ERROR_INVALID_URI="URI format is invalid",t.ERROR_QRCODE_MODAL_NOT_PROVIDED="QRCode Modal not provided",t.ERROR_QRCODE_MODAL_USER_CLOSED="User close QRCode Modal"}));Object(y.c)(me),me.ERROR_SESSION_CONNECTED,me.ERROR_SESSION_DISCONNECTED,me.ERROR_SESSION_REJECTED,me.ERROR_MISSING_JSON_RPC,me.ERROR_MISSING_RESULT,me.ERROR_MISSING_ERROR,me.ERROR_MISSING_METHOD,me.ERROR_MISSING_ID,me.ERROR_MISSING_REQUIRED,me.ERROR_INVALID_RESPONSE,me.ERROR_INVALID_URI,me.ERROR_QRCODE_MODAL_NOT_PROVIDED,me.ERROR_QRCODE_MODAL_USER_CLOSED;var ye=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){function e(){Object(d.a)(this,e),this._eventEmitters=[]}return Object(l.a)(e,[{key:"subscribe",value:function(e){this._eventEmitters.push(e)}},{key:"trigger",value:function(e){var t,r=[];(t=pe.isJsonRpcRequest(e)?e.method:pe.isJsonRpcResponseSuccess(e)||pe.isJsonRpcResponseError(e)?"response:".concat(e.id):pe.isInternalEvent(e)?e.event:"")&&(r=this._eventEmitters.filter((function(e){return e.event===t}))),r&&r.length||pe.isReservedEvent(t)||pe.isInternalEvent(t)||(r=this._eventEmitters.filter((function(e){return"call_request"===e.event}))),r.forEach((function(t){if(pe.isJsonRpcResponseError(e)){var r=new Error(e.error.message);t.callback(r,null)}else t.callback(null,e)}))}}]),e}()}));Object(y.c)(ye);var Ae=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){function e(){Object(d.a)(this,e),this.storageId="walletconnect"}return Object(l.a)(e,[{key:"getSession",value:function(){var e=null,t=pe.getLocal(this.storageId);return t&&pe.isWalletConnectSession(t)&&(e=t),e}},{key:"setSession",value:function(e){return pe.setLocal(this.storageId,e),e}},{key:"removeSession",value:function(){pe.removeLocal(this.storageId)}}]),e}()}));Object(y.c)(Ae);var we=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=B.__importDefault(ge),n=B.__importDefault(ye),i=B.__importDefault(Ae);t.default=function(){function e(t){if(Object(d.a)(this,e),this.protocol="wc",this.version=1,this._bridge="",this._key=null,this._clientId="",this._clientMeta=null,this._peerId="",this._peerMeta=null,this._handshakeId=0,this._handshakeTopic="",this._connected=!1,this._accounts=[],this._chainId=0,this._networkId=0,this._rpcUrl="",this._eventManager=new n.default,this._clientMeta=pe.getClientMeta()||t.connectorOpts.clientMeta||null,this._cryptoLib=t.cryptoLib,this._sessionStorage=t.sessionStorage||new i.default,this._qrcodeModal=t.connectorOpts.qrcodeModal,this._qrcodeModalOptions=t.connectorOpts.qrcodeModalOptions,!t.connectorOpts.bridge&&!t.connectorOpts.uri&&!t.connectorOpts.session)throw new Error(me.ERROR_MISSING_REQUIRED);t.connectorOpts.bridge&&(this.bridge=t.connectorOpts.bridge),t.connectorOpts.uri&&(this.uri=t.connectorOpts.uri);var o=t.connectorOpts.session||this._getStorageSession();o&&(this.session=o),this.handshakeId&&this._subscribeToSessionResponse(this.handshakeId,"Session request rejected"),this._transport=t.transport||new r.default({url:this.bridge,subscriptions:[this.clientId]}),this._subscribeToInternalEvents(),this._initTransport(),t.connectorOpts.uri&&this._subscribeToSessionRequest(),t.pushServerOpts&&this._registerPushServer(t.pushServerOpts)}return Object(l.a)(e,[{key:"bridge",get:function(){return this._bridge},set:function(e){e&&(this._bridge=e)}},{key:"key",get:function(){return this._key?pe.convertArrayBufferToHex(this._key,!0):""},set:function(e){if(e){var t=pe.convertHexToArrayBuffer(e);this._key=t}}},{key:"clientId",get:function(){var e=this._clientId;return e||(e=this._clientId=pe.uuid()),this._clientId},set:function(e){e&&(this._clientId=e)}},{key:"peerId",get:function(){return this._peerId},set:function(e){e&&(this._peerId=e)}},{key:"clientMeta",get:function(){var e=this._clientMeta;return e||(e=this._clientMeta=pe.getClientMeta()),e},set:function(e){}},{key:"peerMeta",get:function(){return this._peerMeta},set:function(e){this._peerMeta=e}},{key:"handshakeTopic",get:function(){return this._handshakeTopic},set:function(e){e&&(this._handshakeTopic=e)}},{key:"handshakeId",get:function(){return this._handshakeId},set:function(e){e&&(this._handshakeId=e)}},{key:"uri",get:function(){return this._formatUri()},set:function(e){if(e){var t=this._parseUri(e),r=t.handshakeTopic,n=t.bridge,i=t.key;this.handshakeTopic=r,this.bridge=n,this.key=i}}},{key:"chainId",get:function(){return this._chainId},set:function(e){this._chainId=e}},{key:"networkId",get:function(){return this._networkId},set:function(e){this._networkId=e}},{key:"accounts",get:function(){return this._accounts},set:function(e){this._accounts=e}},{key:"rpcUrl",get:function(){return this._rpcUrl},set:function(e){this._rpcUrl=e}},{key:"connected",get:function(){return this._connected},set:function(e){}},{key:"pending",get:function(){return!!this._handshakeTopic},set:function(e){}},{key:"session",get:function(){return{connected:this.connected,accounts:this.accounts,chainId:this.chainId,bridge:this.bridge,key:this.key,clientId:this.clientId,clientMeta:this.clientMeta,peerId:this.peerId,peerMeta:this.peerMeta,handshakeId:this.handshakeId,handshakeTopic:this.handshakeTopic}},set:function(e){e&&(this._connected=e.connected,this.accounts=e.accounts,this.chainId=e.chainId,this.bridge=e.bridge,this.key=e.key,this.clientId=e.clientId,this.clientMeta=e.clientMeta,this.peerId=e.peerId,this.peerMeta=e.peerMeta,this.handshakeId=e.handshakeId,this.handshakeTopic=e.handshakeTopic)}},{key:"on",value:function(e,t){var r={event:e,callback:t};this._eventManager.subscribe(r)}},{key:"createInstantRequest",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r,n,i,o=this;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._generateKey();case 2:return this._key=t.sent,r=this._formatRequest({method:"wc_instantRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,request:this._formatRequest(e)}]}),this.handshakeId=r.id,this.handshakeTopic=pe.uuid(),this._eventManager.trigger({event:"display_uri",params:[this.uri]}),this.on("modal_closed",(function(){throw new Error(me.ERROR_QRCODE_MODAL_USER_CLOSED)})),n=function(){o.killSession()},t.prev=6,t.next=9,this._sendCallRequest(r);case 9:return i=t.sent,t.abrupt("return",(i&&n(),i));case 13:throw t.prev=13,t.t0=t.catch(6),n(),t.t0;case 16:case"end":return t.stop()}}),t,this,[[6,13]])})))}},{key:"connect",value:function(e){var t=this;if(!this._qrcodeModal)throw new Error(me.ERROR_QRCODE_MODAL_NOT_PROVIDED);return new Promise((function(r,n){return B.__awaiter(t,void 0,void 0,m.a.mark((function t(){return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.connected&&r({chainId:this.chainId,accounts:this.accounts}),this.connected){t.next=9;break}return t.prev=1,t.next=4,this.createSession(e);case 4:t.next=9;break;case 6:t.prev=6,t.t0=t.catch(1),n(t.t0);case 9:this.on("modal_closed",(function(){return n(new Error(me.ERROR_QRCODE_MODAL_USER_CLOSED))})),this.on("connect",(function(e,t){if(e)return n(e);r(t.params[0])}));case 10:case"end":return t.stop()}}),t,this,[[1,6]])})))}))}},{key:"createSession",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._connected){t.next=2;break}throw new Error(me.ERROR_SESSION_CONNECTED);case 2:if(!this.pending){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,this._generateKey();case 6:this._key=t.sent,r=this._formatRequest({method:"wc_sessionRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,chainId:e&&e.chainId?e.chainId:null}]}),this.handshakeId=r.id,this.handshakeTopic=pe.uuid(),this._sendSessionRequest(r,"Session update rejected",{topic:this.handshakeTopic}),this._eventManager.trigger({event:"display_uri",params:[this.uri]});case 9:case"end":return t.stop()}}),t,this)})))}},{key:"approveSession",value:function(e){if(this._connected)throw new Error(me.ERROR_SESSION_CONNECTED);this.chainId=e.chainId,this.accounts=e.accounts,this.networkId=e.networkId||0,this.rpcUrl=e.rpcUrl||"";var t={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl,peerId:this.clientId,peerMeta:this.clientMeta},r={id:this.handshakeId,jsonrpc:"2.0",result:t};this._sendResponse(r),this._connected=!0,this._setStorageSession(),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})}},{key:"rejectSession",value:function(e){if(this._connected)throw new Error(me.ERROR_SESSION_CONNECTED);var t=e&&e.message?e.message:me.ERROR_SESSION_REJECTED,r=this._formatResponse({id:this.handshakeId,error:{message:t}});this._sendResponse(r),this._connected=!1,this._eventManager.trigger({event:"disconnect",params:[{message:t}]}),this._removeStorageSession()}},{key:"updateSession",value:function(e){if(!this._connected)throw new Error(me.ERROR_SESSION_DISCONNECTED);this.chainId=e.chainId,this.accounts=e.accounts,this.networkId=e.networkId||0,this.rpcUrl=e.rpcUrl||"";var t={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl},r=this._formatRequest({method:"wc_sessionUpdate",params:[t]});this._sendSessionRequest(r,"Session update rejected"),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]}),this._manageStorageSession()}},{key:"killSession",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r,n;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e?e.message:"Session Disconnected",n=this._formatRequest({method:"wc_sessionUpdate",params:[{approved:!1,chainId:null,networkId:null,accounts:null}]}),t.next=3,this._sendRequest(n);case 3:this._handleSessionDisconnect(r);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"sendTransaction",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r,n;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._connected){t.next=2;break}throw new Error(me.ERROR_SESSION_DISCONNECTED);case 2:return r=pe.parseTransactionData(e),n=this._formatRequest({method:"eth_sendTransaction",params:[r]}),t.next=5,this._sendCallRequest(n);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"signTransaction",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r,n;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._connected){t.next=2;break}throw new Error(me.ERROR_SESSION_DISCONNECTED);case 2:return r=pe.parseTransactionData(e),n=this._formatRequest({method:"eth_signTransaction",params:[r]}),t.next=5,this._sendCallRequest(n);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"signMessage",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._connected){t.next=2;break}throw new Error(me.ERROR_SESSION_DISCONNECTED);case 2:return r=this._formatRequest({method:"eth_sign",params:e}),t.next=5,this._sendCallRequest(r);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"signPersonalMessage",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._connected){t.next=2;break}throw new Error(me.ERROR_SESSION_DISCONNECTED);case 2:return e=pe.parsePersonalSign(e),r=this._formatRequest({method:"personal_sign",params:e}),t.next=6,this._sendCallRequest(r);case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t,this)})))}},{key:"signTypedData",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._connected){t.next=2;break}throw new Error(me.ERROR_SESSION_DISCONNECTED);case 2:return r=this._formatRequest({method:"eth_signTypedData",params:e}),t.next=5,this._sendCallRequest(r);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"updateChain",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._connected){t.next=2;break}throw new Error("Session currently disconnected");case 2:return r=this._formatRequest({method:"wallet_updateChain",params:[e]}),t.next=5,this._sendCallRequest(r);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"unsafeSend",value:function(e,t){var r=this;return this._sendRequest(e,t),new Promise((function(t,n){r._subscribeToResponse(e.id,(function(e,r){if(e)n(e);else{if(!r)throw new Error(me.ERROR_MISSING_JSON_RPC);t(r)}}))}))}},{key:"sendCustomRequest",value:function(e,t){return B.__awaiter(this,void 0,void 0,m.a.mark((function r(){var n;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(this._connected){r.next=2;break}throw new Error(me.ERROR_SESSION_DISCONNECTED);case 2:r.t0=e.method,r.next="eth_accounts"===r.t0?5:"eth_chainId"===r.t0?6:"eth_sendTransaction"===r.t0||"eth_signTransaction"===r.t0?7:"personal_sign"===r.t0?9:10;break;case 5:return r.abrupt("return",this.accounts);case 6:return r.abrupt("return",pe.convertNumberToHex(this.chainId));case 7:return e.params&&(e.params[0]=pe.parseTransactionData(e.params[0])),r.abrupt("break",10);case 9:e.params&&(e.params=pe.parsePersonalSign(e.params));case 10:return n=this._formatRequest(e),r.next=13,this._sendCallRequest(n,t);case 13:return r.abrupt("return",r.sent);case 14:case"end":return r.stop()}}),r,this)})))}},{key:"approveRequest",value:function(e){if(!pe.isJsonRpcResponseSuccess(e))throw new Error(me.ERROR_MISSING_RESULT);var t=this._formatResponse(e);this._sendResponse(t)}},{key:"rejectRequest",value:function(e){if(!pe.isJsonRpcResponseError(e))throw new Error(me.ERROR_MISSING_ERROR);var t=this._formatResponse(e);this._sendResponse(t)}},{key:"_sendRequest",value:function(e,t){var r,n;return B.__awaiter(this,void 0,void 0,m.a.mark((function i(){var o,a,s,c,u;return m.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return o=this._formatRequest(e),i.next=3,this._encrypt(o);case 3:a=i.sent,s=void 0!==(null===(r=t)||void 0===r?void 0:r.topic)?t.topic:this.peerId,c=JSON.stringify(a),u=void 0!==(null===(n=t)||void 0===n?void 0:n.forcePushNotification)?!t.forcePushNotification:pe.isSilentPayload(o),this._transport.send(c,s,u);case 8:case"end":return i.stop()}}),i,this)})))}},{key:"_sendResponse",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r,n,i;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._encrypt(e);case 2:r=t.sent,n=this.peerId,i=JSON.stringify(r),this._transport.send(i,n,!0);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"_sendSessionRequest",value:function(e,t,r){return B.__awaiter(this,void 0,void 0,m.a.mark((function n(){return m.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:this._sendRequest(e,r),this._subscribeToSessionResponse(e.id,t);case 1:case"end":return n.stop()}}),n,this)})))}},{key:"_sendCallRequest",value:function(e,t){if(this._sendRequest(e,t),pe.isMobile()&&pe.signingMethods.includes(e.method)){var r=pe.getLocal(pe.mobileLinkChoiceKey);r&&(window.location.href=r.href)}return this._subscribeToCallResponse(e.id)}},{key:"_formatRequest",value:function(e){if(void 0===e.method)throw new Error(me.ERROR_MISSING_METHOD);return{id:void 0===e.id?pe.payloadId():e.id,jsonrpc:"2.0",method:e.method,params:void 0===e.params?[]:e.params}}},{key:"_formatResponse",value:function(e){if(void 0===e.id)throw new Error(me.ERROR_MISSING_ID);var t={id:e.id,jsonrpc:"2.0"};if(pe.isJsonRpcResponseError(e)){var r=pe.formatRpcError(e.error);return Object.assign(Object.assign(Object.assign({},t),e),{error:r})}if(pe.isJsonRpcResponseSuccess(e))return Object.assign(Object.assign({},t),e);throw new Error(me.ERROR_INVALID_RESPONSE)}},{key:"_handleSessionDisconnect",value:function(e){var t=e||"Session Disconnected";this._connected||(this._qrcodeModal&&this._qrcodeModal.close(),pe.removeLocal(pe.mobileLinkChoiceKey)),this._connected&&(this._connected=!1),this._eventManager.trigger({event:"disconnect",params:[{message:t}]}),this._removeStorageSession(),this._transport.close()}},{key:"_handleSessionResponse",value:function(e,t){t&&t.approved?(this._connected?(t.chainId&&(this.chainId=t.chainId),t.accounts&&(this.accounts=t.accounts),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]})):(this._connected=!0,t.chainId&&(this.chainId=t.chainId),t.accounts&&(this.accounts=t.accounts),t.peerId&&!this.peerId&&(this.peerId=t.peerId),t.peerMeta&&!this.peerMeta&&(this.peerMeta=t.peerMeta),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})),this._manageStorageSession()):this._handleSessionDisconnect(e)}},{key:"_handleIncomingMessages",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r,n;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if([this.clientId,this.handshakeTopic].includes(e.topic)){t.next=2;break}return t.abrupt("return");case 2:t.prev=2,r=JSON.parse(e.payload),t.next=9;break;case 6:return t.prev=6,t.t0=t.catch(2),t.abrupt("return");case 9:return t.next=11,this._decrypt(r);case 11:(n=t.sent)&&this._eventManager.trigger(n);case 13:case"end":return t.stop()}}),t,this,[[2,6]])})))}},{key:"_subscribeToSessionRequest",value:function(){this._transport.subscribe(this.handshakeTopic)}},{key:"_subscribeToResponse",value:function(e,t){this.on("response:".concat(e),t)}},{key:"_subscribeToSessionResponse",value:function(e,t){var r=this;this._subscribeToResponse(e,(function(e,n){e?r._handleSessionResponse(e.message):n.result?r._handleSessionResponse(t,n.result):n.error&&n.error.message?r._handleSessionResponse(n.error.message):r._handleSessionResponse(t)}))}},{key:"_subscribeToCallResponse",value:function(e){var t=this;return new Promise((function(r,n){t._subscribeToResponse(e,(function(e,t){e?n(e):t.result?r(t.result):t.error&&t.error.message?n(new Error(t.error.message)):n(new Error(me.ERROR_INVALID_RESPONSE))}))}))}},{key:"_subscribeToInternalEvents",value:function(){var e=this;this.on("display_uri",(function(){e._qrcodeModal&&e._qrcodeModal.open(e.uri,(function(){e._eventManager.trigger({event:"modal_closed",params:[]})}),e._qrcodeModalOptions)})),this.on("connect",(function(){e._qrcodeModal&&e._qrcodeModal.close()})),this.on("wc_sessionRequest",(function(t,r){t&&e._eventManager.trigger({event:"error",params:[{code:"SESSION_REQUEST_ERROR",message:t.toString()}]}),e.handshakeId=r.id,e.peerId=r.params[0].peerId,e.peerMeta=r.params[0].peerMeta;var n=Object.assign(Object.assign({},r),{method:"session_request"});e._eventManager.trigger(n)})),this.on("wc_sessionUpdate",(function(t,r){t&&e._handleSessionResponse(t.message),e._handleSessionResponse("Session disconnected",r.params[0])}))}},{key:"_initTransport",value:function(){var e=this;this._transport.on("message",(function(t){return e._handleIncomingMessages(t)})),this._transport.on("open",(function(){return e._eventManager.trigger({event:"transport_open",params:[]})})),this._transport.on("close",(function(){return e._eventManager.trigger({event:"transport_close",params:[]})})),this._transport.open()}},{key:"_formatUri",value:function(){return"".concat(this.protocol,":").concat(this.handshakeTopic,"@").concat(this.version,"?bridge=").concat(encodeURIComponent(this.bridge),"&key=").concat(this.key)}},{key:"_parseUri",value:function(e){var t=pe.parseWalletConnectUri(e);if(t.protocol===this.protocol){if(!t.handshakeTopic)throw Error("Invalid or missing handshakeTopic parameter value");var r=t.handshakeTopic;if(!t.bridge)throw Error("Invalid or missing bridge url parameter value");var n=decodeURIComponent(t.bridge);if(!t.key)throw Error("Invalid or missing kkey parameter value");return{handshakeTopic:r,bridge:n,key:t.key}}throw new Error(me.ERROR_INVALID_URI)}},{key:"_generateKey",value:function(){return B.__awaiter(this,void 0,void 0,m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._cryptoLib){e.next=4;break}return e.next=3,this._cryptoLib.generateKey();case 3:return e.abrupt("return",e.sent);case 4:return e.abrupt("return",null);case 5:case"end":return e.stop()}}),e,this)})))}},{key:"_encrypt",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this._key,!this._cryptoLib||!r){t.next=5;break}return t.next=4,this._cryptoLib.encrypt(e,r);case 4:return t.abrupt("return",t.sent);case 5:return t.abrupt("return",null);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"_decrypt",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this._key,!this._cryptoLib||!r){t.next=5;break}return t.next=4,this._cryptoLib.decrypt(e,r);case 4:return t.abrupt("return",t.sent);case 5:return t.abrupt("return",null);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"_getStorageSession",value:function(){var e=null;return this._sessionStorage&&(e=this._sessionStorage.getSession()),e}},{key:"_setStorageSession",value:function(){this._sessionStorage&&this._sessionStorage.setSession(this.session)}},{key:"_removeStorageSession",value:function(){this._sessionStorage&&this._sessionStorage.removeSession()}},{key:"_manageStorageSession",value:function(){this._connected?this._setStorageSession():this._removeStorageSession()}},{key:"_registerPushServer",value:function(e){var t=this;if(!e.url||"string"!=typeof e.url)throw Error("Invalid or missing pushServerOpts.url parameter value");if(!e.type||"string"!=typeof e.type)throw Error("Invalid or missing pushServerOpts.type parameter value");if(!e.token||"string"!=typeof e.token)throw Error("Invalid or missing pushServerOpts.token parameter value");var r={bridge:this.bridge,topic:this.clientId,type:e.type,token:e.token,peerName:"",language:e.language||""};this.on("connect",(function(n,i){return B.__awaiter(t,void 0,void 0,m.a.mark((function t(){var o,a;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n){t.next=2;break}throw n;case 2:return e.peerMeta&&(o=i.params[0].peerMeta.name,r.peerName=o),t.prev=3,t.next=6,fetch("".concat(e.url,"/new"),{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(r)});case 6:return a=t.sent,t.next=9,a.json();case 9:if(t.sent.success){t.next=11;break}throw Error("Failed to register in Push Server");case 11:t.next=16;break;case 13:throw t.prev=13,t.t0=t.catch(3),Error("Failed to register in Push Server");case 16:case"end":return t.stop()}}),t,null,[[3,13]])})))}))}}]),e}()}));Object(y.c)(we);var Ee=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.HEX_ENC="hex",t.UTF8_ENC="utf8",t.ENCRYPT_OP="encrypt",t.DECRYPT_OP="decrypt",t.SIGN_OP="sign",t.VERIFY_OP="verify",t.LENGTH_0=0,t.LENGTH_1=1,t.LENGTH_16=16,t.LENGTH_32=32,t.LENGTH_64=64,t.LENGTH_128=128,t.LENGTH_256=256,t.LENGTH_512=512,t.LENGTH_1024=1024,t.AES_LENGTH=t.LENGTH_256,t.HMAC_LENGTH=t.LENGTH_256,t.AES_BROWSER_ALGO="AES-CBC",t.HMAC_BROWSER_ALGO="SHA-".concat(t.AES_LENGTH),t.HMAC_BROWSER="HMAC",t.SHA256_BROWSER_ALGO="SHA-256",t.SHA512_BROWSER_ALGO="SHA-512",t.AES_NODE_ALGO="aes-".concat(t.AES_LENGTH,"-cbc"),t.HMAC_NODE_ALGO="sha".concat(t.HMAC_LENGTH),t.SHA256_NODE_ALGO="sha256",t.SHA512_NODE_ALGO="sha512",t.RIPEMD160_NODE_ALGO="ripemd160",t.PREFIX_LENGTH=t.LENGTH_1,t.KEY_LENGTH=t.LENGTH_32,t.IV_LENGTH=t.LENGTH_16,t.MAC_LENGTH=t.LENGTH_32,t.DECOMPRESSED_LENGTH=t.LENGTH_64,t.PREFIXED_KEY_LENGTH=t.KEY_LENGTH+t.PREFIX_LENGTH,t.PREFIXED_DECOMPRESSED_LENGTH=t.DECOMPRESSED_LENGTH+t.PREFIX_LENGTH,t.MAX_KEY_LENGTH=t.LENGTH_1024,t.MAX_MSG_LENGTH=t.LENGTH_32,t.EMPTY_BUFFER=n.from(new Uint8Array(t.LENGTH_0)),t.EC_GROUP_ORDER=n.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",t.HEX_ENC),t.ZERO32=n.alloc(t.LENGTH_32,t.LENGTH_0),t.ERROR_BAD_MAC="Bad MAC",t.ERROR_BAD_PRIVATE_KEY="Bad private key",t.ERROR_BAD_PUBLIC_KEY="Bad public key",t.ERROR_EMPTY_MESSAGE="Message should not be empty",t.ERROR_MESSAGE_TOO_LONG="Message is too long"}));Object(y.c)(Ee),Ee.HEX_ENC,Ee.UTF8_ENC,Ee.ENCRYPT_OP,Ee.DECRYPT_OP,Ee.SIGN_OP,Ee.VERIFY_OP,Ee.LENGTH_0,Ee.LENGTH_1,Ee.LENGTH_16,Ee.LENGTH_32,Ee.LENGTH_64,Ee.LENGTH_128,Ee.LENGTH_256,Ee.LENGTH_512,Ee.LENGTH_1024,Ee.AES_LENGTH,Ee.HMAC_LENGTH,Ee.AES_BROWSER_ALGO,Ee.HMAC_BROWSER_ALGO,Ee.HMAC_BROWSER,Ee.SHA256_BROWSER_ALGO,Ee.SHA512_BROWSER_ALGO,Ee.AES_NODE_ALGO,Ee.HMAC_NODE_ALGO,Ee.SHA256_NODE_ALGO,Ee.SHA512_NODE_ALGO,Ee.RIPEMD160_NODE_ALGO,Ee.PREFIX_LENGTH,Ee.KEY_LENGTH,Ee.IV_LENGTH,Ee.MAC_LENGTH,Ee.DECOMPRESSED_LENGTH,Ee.PREFIXED_KEY_LENGTH,Ee.PREFIXED_DECOMPRESSED_LENGTH,Ee.MAX_KEY_LENGTH,Ee.MAX_MSG_LENGTH,Ee.EMPTY_BUFFER,Ee.EC_GROUP_ORDER,Ee.ZERO32,Ee.ERROR_BAD_MAC,Ee.ERROR_BAD_PRIVATE_KEY,Ee.ERROR_BAD_PUBLIC_KEY,Ee.ERROR_EMPTY_MESSAGE,Ee.ERROR_MESSAGE_TOO_LONG;var Se=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(X)}));Object(y.c)(Se);var Me=Object(y.b)((function(e,t){function r(e){return e.length===Ee.KEY_LENGTH||e.length===Ee.PREFIXED_KEY_LENGTH}function i(e){return r(e)?e.length===Ee.PREFIXED_KEY_LENGTH:e.length===Ee.PREFIXED_DECOMPRESSED_LENGTH}function o(e){return Se.hexToNumber(Se.removeHexLeadingZeros(Se.bufferToHex(e)))-27}Object.defineProperty(t,"__esModule",{value:!0}),t.isCompressed=r,t.isDecompressed=function(e){return e.length===Ee.DECOMPRESSED_LENGTH||e.length===Ee.PREFIXED_DECOMPRESSED_LENGTH},t.isPrefixed=i,t.sanitizePublicKey=function(e){return i(e)?e:n.from("04".concat(e.toString("hex")),"hex")},t.exportRecoveryParam=function(e){return Se.hexToBuffer(Se.sanitizeHex((e+27).toString(16)))},t.importRecoveryParam=o,t.splitSignature=function(e){return{r:e.slice(0,32),s:e.slice(32,64),v:e.slice(64,65)}},t.joinSignature=function(e){return Se.concatBuffers(e.r,e.s,e.v)},t.isValidDERSignature=function(e){return Se.bufferToHex(e).startsWith("30")&&e.length>65},t.sanitizeRSVSignature=function(e){return{signature:e.slice(0,64),recovery:o(e.slice(64,65))}}}));Object(y.c)(Me),Me.isCompressed,Me.isDecompressed,Me.isPrefixed,Me.sanitizePublicKey,Me.exportRecoveryParam,Me.importRecoveryParam,Me.splitSignature,Me.joinSignature,Me.isValidDERSignature,Me.sanitizeRSVSignature;var ke=Object(y.b)((function(e,t){function r(e){return n.isBuffer(e)&&32===e.length}Object.defineProperty(t,"__esModule",{value:!0}),t.assert=function(e,t){if(!e)throw new Error(t||"Assertion failed")},t.isScalar=r,t.isValidPrivateKey=function(e){return!!r(e)&&e.compare(Ee.ZERO32)>0&&e.compare(Ee.EC_GROUP_ORDER)<0},t.equalConstTime=function(e,t){if(e.length!==t.length)return!1;for(var r=0,n=0;nEe.MAX_KEY_LENGTH||parseInt(String(e))!==e)}}));Object(y.c)(ke),ke.assert,ke.isScalar,ke.isValidPrivateKey,ke.equalConstTime,ke.isValidKeyLength;var Re=Object(y.b)((function(e,t){function r(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),r(Se),r(Me),r(ke)}));Object(y.c)(Re);var Oe=Object(y.b)((function(e,t){!function(t){function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t255)return!1;return!0}function i(e,t){if(e.buffer&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function o(e){return new Uint8Array(e)}function a(e,t,r,n,i){null==n&&null==i||(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var s,c={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},u=(s="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r>4]+s[15&n])}return t.join("")}}),f={16:10,24:12,32:14},h=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],l=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],p=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],b=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],v=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],g=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],m=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],y=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],A=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],w=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],E=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],S=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],M=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],k=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function R(e){for(var t=[],r=0;r>2,this._Ke[r][t%4]=o[t],this._Kd[e-r][t%4]=o[t];for(var a,s=0,c=i;c>16&255]<<24^d[a>>8&255]<<16^d[255&a]<<8^d[a>>24&255]^h[s]<<24,s+=1,8!=i)for(t=1;t>8&255]<<8^d[a>>16&255]<<16^d[a>>24&255]<<24,t=i/2+1;t>2,l=c%4,this._Ke[u][l]=o[t],this._Kd[e-u][l]=o[t++],c++}for(var u=1;u>24&255]^S[a>>16&255]^M[a>>8&255]^k[255&a]},O.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=R(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var a=1;a>24&255]^b[n[(i+1)%4]>>16&255]^v[n[(i+2)%4]>>8&255]^g[255&n[(i+3)%4]]^this._Ke[a][i];n=r.slice()}var s,c=o(16);for(i=0;i<4;i++)s=this._Ke[t][i],c[4*i]=255&(d[n[i]>>24&255]^s>>24),c[4*i+1]=255&(d[n[(i+1)%4]>>16&255]^s>>16),c[4*i+2]=255&(d[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(d[255&n[(i+3)%4]]^s);return c},O.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=R(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var a=1;a>24&255]^y[n[(i+3)%4]>>16&255]^A[n[(i+2)%4]>>8&255]^w[255&n[(i+1)%4]]^this._Kd[a][i];n=r.slice()}var s,c=o(16);for(i=0;i<4;i++)s=this._Kd[t][i],c[4*i]=255&(l[n[i]>>24&255]^s>>24),c[4*i+1]=255&(l[n[(i+3)%4]>>16&255]^s>>16),c[4*i+2]=255&(l[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(l[255&n[(i+1)%4]]^s);return c};var x=function e(t){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new O(t)};x.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;nNumber.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var t=15;t>=0;--t)this._counter[t]=e%256,e=parseInt(e/256)},T.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},T.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var L=function e(t,r){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",r instanceof T||(r=new T(r)),this._counter=r,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new O(t)};L.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n4294967295)throw new RangeError("requested too many random bytes");var o=r.allocUnsafe(t);if(t>0)if(t>65536)for(var a=0;a=e.length)&&56320==(64512&e.charCodeAt(t+1))}function Be(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function Ne(e){return 1===e.length?"0"+e:e}function Pe(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}var je={inherits:Te,toArray:function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,r[n++]=63&o|128):Le(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i>>0}return o},split32:function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},rotr32:function(e,t){return e>>>t|e<<32-t},rotl32:function(e,t){return e<>>32-t},sum32:function(e,t){return e+t>>>0},sum32_3:function(e,t,r){return e+t+r>>>0},sum32_4:function(e,t,r,n){return e+t+r+n>>>0},sum32_5:function(e,t,r,n,i){return e+t+r+n+i>>>0},sum64:function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o>>0,e[t+1]=o},sum64_hi:function(e,t,r,n){return(t+n>>>0>>0},sum64_lo:function(e,t,r,n){return t+n>>>0},sum64_4_hi:function(e,t,r,n,i,o,a,s){var c=0,u=t;return c+=(u=u+n>>>0)>>0)>>0)>>0},sum64_4_lo:function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},sum64_5_hi:function(e,t,r,n,i,o,a,s,c,u){var f=0,h=t;return f+=(h=h+n>>>0)>>0)>>0)>>0)>>0},sum64_5_lo:function(e,t,r,n,i,o,a,s,c,u){return t+n+o+s+u>>>0},rotr64_hi:function(e,t,r){return(t<<32-r|e>>>r)>>>0},rotr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0},shr64_hi:function(e,t,r){return e>>>r},shr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0}};function De(){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 He=De;De.prototype.update=function(e,t){if(e=je.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=je.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o>>3},Je=function(e){return Ge(e,17)^Ge(e,19)^e>>>10},Qe=je.rotl32,$e=je.sum32,et=je.sum32_5,tt=Ue,rt=ze.BlockHash,nt=[1518500249,1859775393,2400959708,3395469782];function it(){if(!(this instanceof it))return new it;rt.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}je.inherits(it,rt);var ot=it;it.blockSize=512,it.outSize=160,it.hmacStrength=80,it.padLength=64,it.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),_e(e.length<=this.blockSize);for(var t=e.length;t1&&void 0!==arguments[1]?arguments[1]:Ee.AES_BROWSER_ALGO;return r(this,void 0,void 0,m.a.mark((function r(){var n,i,a;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=o(),i=t===Ee.AES_BROWSER_ALGO?{length:Ee.AES_LENGTH,name:Ee.AES_BROWSER_ALGO}:{hash:{name:Ee.HMAC_BROWSER_ALGO},name:Ee.HMAC_BROWSER},a=t===Ee.AES_BROWSER_ALGO?[Ee.ENCRYPT_OP,Ee.DECRYPT_OP]:[Ee.SIGN_OP,Ee.VERIFY_OP],r.next=3,n.importKey("raw",e,i,!0,a);case 3:return r.abrupt("return",r.sent);case 4:case"end":return r.stop()}}),r)})))}Object.defineProperty(t,"__esModule",{value:!0}),t.getBrowerCrypto=i,t.getSubtleCrypto=o,t.browserRandomBytes=function(e){var t=i();return void 0!==t.getRandomValues?Re.arrayToBuffer(t.getRandomValues(new Uint8Array(e))):vr.fallbackRandomBytes(e)},t.browserImportKey=a,t.browserAesEncrypt=function(e,t,i){return r(this,void 0,void 0,m.a.mark((function r(){var s,c,u;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return s=o(),r.next=3,a(t,Ee.AES_BROWSER_ALGO);case 3:return c=r.sent,r.next=6,s.encrypt({iv:e,name:Ee.AES_BROWSER_ALGO},c,i);case 6:return u=r.sent,r.abrupt("return",n.from(u));case 8:case"end":return r.stop()}}),r)})))},t.browserAesDecrypt=function(e,t,i){return r(this,void 0,void 0,m.a.mark((function r(){var s,c,u;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return s=o(),r.next=3,a(t,Ee.AES_BROWSER_ALGO);case 3:return c=r.sent,r.next=6,s.decrypt({iv:e,name:Ee.AES_BROWSER_ALGO},c,i);case 6:return u=r.sent,r.abrupt("return",n.from(u));case 8:case"end":return r.stop()}}),r)})))},t.browserHmacSha256Sign=function(e,t){return r(this,void 0,void 0,m.a.mark((function r(){var i,s,c;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=o(),r.next=3,a(e,Ee.HMAC_BROWSER);case 3:return s=r.sent,r.next=6,i.sign({length:Ee.HMAC_LENGTH,name:Ee.HMAC_BROWSER},s,t);case 6:return c=r.sent,r.abrupt("return",n.from(c));case 8:case"end":return r.stop()}}),r)})))},t.browserHmacSha512Sign=function(e,t){return r(this,void 0,void 0,m.a.mark((function r(){var i,s,c;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=o(),r.next=3,a(e,Ee.HMAC_BROWSER);case 3:return s=r.sent,r.next=6,i.sign({length:Ee.LENGTH_512,name:Ee.HMAC_BROWSER},s,t);case 6:return c=r.sent,r.abrupt("return",n.from(c));case 8:case"end":return r.stop()}}),r)})))},t.browserSha256=function(e){return r(this,void 0,void 0,m.a.mark((function t(){var r,i;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o(),t.next=3,r.digest({name:Ee.SHA256_BROWSER_ALGO},e);case 3:return i=t.sent,t.abrupt("return",n.from(i));case 5:case"end":return t.stop()}}),t)})))},t.browserSha512=function(e){return r(this,void 0,void 0,m.a.mark((function t(){var r,i;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o(),t.next=3,r.digest({name:Ee.SHA512_BROWSER_ALGO},e);case 3:return i=t.sent,t.abrupt("return",n.from(i));case 5:case"end":return t.stop()}}),t)})))}}));Object(y.c)(gr),gr.getBrowerCrypto,gr.getSubtleCrypto,gr.browserRandomBytes,gr.browserImportKey,gr.browserAesEncrypt,gr.browserAesDecrypt,gr.browserHmacSha256Sign,gr.browserHmacSha512Sign,gr.browserSha256,gr.browserSha512;var mr=Object(y.b)((function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.isBrowser=function(){return!!gr.getBrowerCrypto()&&!!gr.getSubtleCrypto()},r.isNode=function(){return"undefined"!=typeof e&&void 0!==e.versions&&void 0!==e.versions.node}}));Object(y.c)(mr),mr.isBrowser,mr.isNode;var yr=Object(y.b)((function(e,t){var r=y.d&&y.d.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(A.c);t.nodeRandomBytes=function(e){return i.default.randomBytes(e)},t.nodeAesEncrypt=function(e,t,r){var n=i.default.createCipheriv(Ee.AES_NODE_ALGO,t,e);return Re.concatBuffers(n.update(r),n.final())},t.nodeAesDecrypt=function(e,t,r){var n=i.default.createDecipheriv(Ee.AES_NODE_ALGO,t,e);return Re.concatBuffers(n.update(r),n.final())},t.nodeHmacSha256Sign=function(e,t){return i.default.createHmac(Ee.HMAC_NODE_ALGO,n.from(e)).update(t).digest()},t.nodeHmacSha512Sign=function(e,t){return i.default.createHmac(Ee.SHA512_NODE_ALGO,n.from(e)).update(t).digest()},t.nodeSha256=function(e){return i.default.createHash(Ee.SHA256_NODE_ALGO).update(e).digest()},t.nodeSha512=function(e){return i.default.createHash(Ee.SHA512_NODE_ALGO).update(e).digest()},t.nodeRipemd160=function(e){return i.default.createHash(Ee.RIPEMD160_NODE_ALGO).update(e).digest()}}));Object(y.c)(yr),yr.nodeRandomBytes,yr.nodeAesEncrypt,yr.nodeAesDecrypt,yr.nodeHmacSha256Sign,yr.nodeHmacSha512Sign,yr.nodeSha256,yr.nodeSha512,yr.nodeRipemd160;var Ar=Object(y.b)((function(e,t){var r=y.d&&y.d.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(a,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.aesCbcEncrypt=function(e,t,n){return r(this,void 0,void 0,m.a.mark((function r(){var i;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!mr.isBrowser()){r.next=6;break}return r.next=3,gr.browserAesEncrypt(e,t,n);case 3:r.t0=r.sent,r.next=7;break;case 6:r.t0=mr.isNode()?yr.nodeAesEncrypt(e,t,n):vr.fallbackAesEncrypt(e,t,n);case 7:return i=r.t0,r.abrupt("return",i);case 9:case"end":return r.stop()}}),r)})))},t.aesCbcDecrypt=function(e,t,n){return r(this,void 0,void 0,m.a.mark((function r(){var i;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!mr.isBrowser()){r.next=6;break}return r.next=3,gr.browserAesDecrypt(e,t,n);case 3:r.t0=r.sent,r.next=7;break;case 6:r.t0=mr.isNode()?yr.nodeAesDecrypt(e,t,n):vr.fallbackAesDecrypt(e,t,n);case 7:return i=r.t0,r.abrupt("return",i);case 9:case"end":return r.stop()}}),r)})))},t.aesCbcEncryptSync=function(e,t,r){return mr.isNode()?yr.nodeAesEncrypt(e,t,r):vr.fallbackAesEncrypt(e,t,r)},t.aesCbcDecryptSync=function(e,t,r){return mr.isNode()?yr.nodeAesDecrypt(e,t,r):vr.fallbackAesDecrypt(e,t,r)}}));Object(y.c)(Ar),Ar.aesCbcEncrypt,Ar.aesCbcDecrypt,Ar.aesCbcEncryptSync,Ar.aesCbcDecryptSync;var wr=Object.prototype.toString,Er=function(e,t){if(!n.isBuffer(e))throw TypeError(t)},Sr=function(e,t,r){if(e.length!==t)throw RangeError(r)},Mr=function(e,t,r,n){if(e.length!==t&&e.length!==r)throw RangeError(n)},kr=function(e,t){if(0===e.length)throw RangeError(t)},Rr=xe.Buffer,Or=function(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");var t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");var r=e[5+t];if(0===r)throw new Error("S length is zero");if(6+t+r!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(r>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}},xr=function(e,t){var r=e.length,n=t.length;if(0===r)throw new Error("R length is zero");if(0===n)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(n>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&t[0])throw new Error("S value is negative");if(r>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(n>1&&0===t[0]&&!(128&t[1]))throw new Error("S value excessively padded");var i=Rr.allocUnsafe(6+r+n);return i[0]=48,i[1]=i.length-2,i[2]=2,i[3]=e.length,e.copy(i,4),i[4+r]=2,i[5+r]=t.length,t.copy(i,6+r),i},Ir=xe.Buffer,_r=Ir.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]),Cr=Ir.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]),Tr="scalar was invalid (zero or overflow)",Lr="nonce generation function failed or private key is invalid",Br={COMPRESSED_TYPE_INVALID:"compressed should be a boolean",EC_PRIVATE_KEY_TYPE_INVALID:"private key should be a Buffer",EC_PRIVATE_KEY_LENGTH_INVALID:"private key length is invalid",EC_PRIVATE_KEY_RANGE_INVALID:"private key range is invalid",EC_PRIVATE_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting private key is invalid",EC_PRIVATE_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PRIVATE_KEY_EXPORT_DER_FAIL:"couldn't export to DER format",EC_PRIVATE_KEY_IMPORT_DER_FAIL:"couldn't import from DER format",EC_PUBLIC_KEYS_TYPE_INVALID:"public keys should be an Array",EC_PUBLIC_KEYS_LENGTH_INVALID:"public keys Array should have at least 1 element",EC_PUBLIC_KEY_TYPE_INVALID:"public key should be a Buffer",EC_PUBLIC_KEY_LENGTH_INVALID:"public key length is invalid",EC_PUBLIC_KEY_PARSE_FAIL:"the public key could not be parsed or is invalid",EC_PUBLIC_KEY_CREATE_FAIL:"private was invalid, try again",EC_PUBLIC_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting public key is invalid",EC_PUBLIC_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PUBLIC_KEY_COMBINE_FAIL:"the sum of the public keys is not valid",ECDH_FAIL:Tr,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:Lr,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"},Nr=Object(y.f)(Object.freeze({__proto__:null,COMPRESSED_TYPE_INVALID:"compressed should be a boolean",EC_PRIVATE_KEY_TYPE_INVALID:"private key should be a Buffer",EC_PRIVATE_KEY_LENGTH_INVALID:"private key length is invalid",EC_PRIVATE_KEY_RANGE_INVALID:"private key range is invalid",EC_PRIVATE_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting private key is invalid",EC_PRIVATE_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PRIVATE_KEY_EXPORT_DER_FAIL:"couldn't export to DER format",EC_PRIVATE_KEY_IMPORT_DER_FAIL:"couldn't import from DER format",EC_PUBLIC_KEYS_TYPE_INVALID:"public keys should be an Array",EC_PUBLIC_KEYS_LENGTH_INVALID:"public keys Array should have at least 1 element",EC_PUBLIC_KEY_TYPE_INVALID:"public key should be a Buffer",EC_PUBLIC_KEY_LENGTH_INVALID:"public key length is invalid",EC_PUBLIC_KEY_PARSE_FAIL:"the public key could not be parsed or is invalid",EC_PUBLIC_KEY_CREATE_FAIL:"private was invalid, try again",EC_PUBLIC_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting public key is invalid",EC_PUBLIC_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PUBLIC_KEY_COMBINE_FAIL:"the sum of the public keys is not valid",ECDH_FAIL:Tr,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:Lr,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",default:Br}));function Pr(e,t){return void 0===e?t:(function(e,t){if("[object Boolean]"!==wr.call(e))throw TypeError(t)}(e,Nr.COMPRESSED_TYPE_INVALID),e)}var jr=y.g.EventEmitter;function Dr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Hr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zr(e,t){for(var r=0;r0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return Gr.alloc(0);for(var t=Gr.allocUnsafe(e>>>0),r=this.head,n=0;r;)Yr(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=Gr.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:Wr,value:function(e,t){return Fr(this,function(e){for(var t=1;t2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}$r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),$r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,i;if("string"==typeof t&&function(e,t,r){return e.substr(0,t.length)===t}(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))i="The ".concat(e," ").concat(n," ").concat(en(t,"type"));else{var o=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+".".length>e.length)&&-1!==e.indexOf(".",r)}(e)?"property":"argument";i='The "'.concat(e,'" ').concat(o," ").concat(n," ").concat(en(t,"type"))}return i+". Received type ".concat(typeof r)}),TypeError),$r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),$r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),$r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),$r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),$r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),$r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),$r("ERR_STREAM_WRITE_AFTER_END","write after end"),$r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),$r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),$r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");var tn={codes:Qr},rn=tn.codes.ERR_INVALID_OPT_VALUE,nn=function(e,t,r,n){var i=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,n,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new rn(n?r:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384};function on(e){try{if(!y.d.localStorage)return!1}catch(e){return!1}var t=y.d.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}var an,sn=Rn;function cn(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(void 0),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}Rn.WritableState=kn;var un,fn=function(e,t){if(on("noDeprecation"))return e;var r=!1;return function(){if(!r){if(on("throwDeprecation"))throw new Error(t);on("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}},hn=A.a.Buffer,dn=y.d.Uint8Array||function(){},ln=nn,pn=tn.codes,bn=pn.ERR_INVALID_ARG_TYPE,vn=pn.ERR_METHOD_NOT_IMPLEMENTED,gn=pn.ERR_MULTIPLE_CALLBACK,mn=pn.ERR_STREAM_CANNOT_PIPE,yn=pn.ERR_STREAM_DESTROYED,An=pn.ERR_STREAM_NULL_VALUES,wn=pn.ERR_STREAM_WRITE_AFTER_END,En=pn.ERR_UNKNOWN_ENCODING,Sn=Jr;function Mn(){}function kn(t,r,n){an=an||Bn,t=t||{},"boolean"!=typeof n&&(n=r instanceof an),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=ln(this,t,"writableHighWaterMark",n),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=!1===t.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,r){var n=t._writableState,i=n.sync,o=n.writecb;if("function"!=typeof o)throw new gn;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),r)!function(t,r,n,i,o){--r.pendingcb,n?(e.nextTick(o,i),e.nextTick(Tn,t,r),t._writableState.errorEmitted=!0,Sn(t,i)):(o(i),t._writableState.errorEmitted=!0,Sn(t,i),Tn(t,r))}(t,n,i,r,o);else{var a=_n(n)||t.destroyed;a||n.corked||n.bufferProcessing||!n.bufferedRequest||In(t,n),i?e.nextTick(xn,t,n,a,o):xn(t,n,a,o)}}(r,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new cn(this)}function Rn(e){var t=this instanceof(an=an||Bn);if(!t&&!un.call(Rn,this))return new Rn(e);this._writableState=new kn(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),jr.call(this)}function On(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new yn("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function xn(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),Tn(e,t)}function In(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)i[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;i.allBuffers=s,On(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new cn(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,u=r.encoding,f=r.callback;if(On(e,t,!1,t.objectMode?1:c.length,c,u,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function _n(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function Cn(e,t){e._final((function(r){t.pendingcb--,r&&Sn(e,r),t.prefinished=!0,e.emit("prefinish"),Tn(e,t)}))}function Tn(t,r){var n=_n(r);if(n&&(function(t,r){r.prefinished||r.finalCalled||("function"!=typeof t._final||r.destroyed?(r.prefinished=!0,t.emit("prefinish")):(r.pendingcb++,r.finalCalled=!0,e.nextTick(Cn,t,r)))}(t,r),0===r.pendingcb&&(r.finished=!0,t.emit("finish"),r.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return n}Te(Rn,jr),kn.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(kn.prototype,"buffer",{get:fn((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(yc){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(un=Function.prototype[Symbol.hasInstance],Object.defineProperty(Rn,Symbol.hasInstance,{value:function(e){return!!un.call(this,e)||this===Rn&&e&&e._writableState instanceof kn}})):un=function(e){return e instanceof this},Rn.prototype.pipe=function(){Sn(this,new mn)},Rn.prototype.write=function(t,r,n){var i,o=this._writableState,a=!1,s=!o.objectMode&&(i=t,hn.isBuffer(i)||i instanceof dn);return s&&!hn.isBuffer(t)&&(t=function(e){return hn.from(e)}(t)),"function"==typeof r&&(n=r,r=null),s?r="buffer":r||(r=o.defaultEncoding),"function"!=typeof n&&(n=Mn),o.ending?function(t,r){var n=new wn;Sn(t,n),e.nextTick(r,n)}(this,n):(s||function(t,r,n,i){var o;return null===n?o=new An:"string"==typeof n||r.objectMode||(o=new bn("chunk",["string","Buffer"],n)),!o||(Sn(t,o),e.nextTick(i,o),!1)}(this,o,t,n))&&(o.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=hn.from(t,r)),t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var c=t.length-1))throw new En(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(Rn.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(Rn.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Rn.prototype._write=function(e,t,r){r(new vn("_write()"))},Rn.prototype._writev=null,Rn.prototype.end=function(t,r,n){var i=this._writableState;return"function"==typeof t?(n=t,t=null,r=null):"function"==typeof r&&(n=r,r=null),null!=t&&this.write(t,r),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,r,n){r.ending=!0,Tn(t,r),n&&(r.finished?e.nextTick(n):t.once("finish",n)),r.ended=!0,t.writable=!1}(this,i,n),this},Object.defineProperty(Rn.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(Rn.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),Rn.prototype.destroy=qr,Rn.prototype._undestroy=Xr,Rn.prototype._destroy=function(e,t){t(e)};var Ln=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t},Bn=Dn;Te(Dn,Ai);for(var Nn=Ln(sn.prototype),Pn=0;Pn>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function Kn(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function Vn(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function Zn(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function qn(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function Xn(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Jn(e){return e.toString(this.encoding)}function Qn(e){return e&&e.length?this.write(e):""}Yn.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},Yn.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};var $n={StringDecoder:Wn},ei=tn.codes.ERR_STREAM_PREMATURE_CLOSE;function ti(){}var ri,ni=function e(t,r,n){if("function"==typeof r)return e(t,null,r);r||(r={}),n=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===Si.prototype||(t=function(e){return Si.from(e)}(t)),n)a.endEmitted?Bi(e,new Li):Hi(e,a,t,!0);else if(a.ended)Bi(e,new Ci);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?Hi(e,a,t,!1):Wi(e,a)):Hi(e,a,t,!1)}else n||(a.reading=!1,Wi(e,a));return!a.ended&&(a.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function Gi(t){var r=t._readableState;wi("emitReadable",r.needReadable,r.emittedReadable),r.needReadable=!1,r.emittedReadable||(wi("emitReadable",r.flowing),r.emittedReadable=!0,e.nextTick(Fi,t))}function Fi(e){var t=e._readableState;wi("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,Zi(e)}function Wi(t,r){r.readingMore||(r.readingMore=!0,e.nextTick(Yi,t,r))}function Yi(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function Ki(e){wi("readable nexttick read 0"),e.read(0)}function Vi(e,t){wi("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),Zi(e),t.flowing&&!t.reading&&e.read(0)}function Zi(e){var t=e._readableState;for(wi("flow",t.flowing);t.flowing&&null!==e.read(););}function qi(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function Xi(t){var r=t._readableState;wi("endReadable",r.endEmitted),r.endEmitted||(r.ended=!0,e.nextTick(Ji,r,t))}function Ji(e,t){if(wi("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function Qi(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return wi("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?Xi(this):Gi(this),null;if(0===(e=zi(e,t))&&t.ended)return 0===t.length&&Xi(this),null;var n,i=t.needReadable;return wi("need readable",i),(0===t.length||t.length-e0?qi(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&Xi(this)),null!==n&&this.emit("data",n),n},ji.prototype._read=function(e){Bi(this,new Ti("_read()"))},ji.prototype.pipe=function(t,r){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,wi("pipe count=%d opts=%j",i.pipesCount,r);var o=r&&!1===r.end||t===e.stdout||t===e.stderr?l:a;function a(){wi("onend"),t.end()}i.endEmitted?e.nextTick(o):n.once("end",o),t.on("unpipe",(function e(r,o){wi("onunpipe"),r===n&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,wi("cleanup"),t.removeListener("close",h),t.removeListener("finish",d),t.removeListener("drain",s),t.removeListener("error",f),t.removeListener("unpipe",e),n.removeListener("end",a),n.removeListener("end",l),n.removeListener("data",u),c=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||s())}));var s=function(e){return function(){var t=e._readableState;wi("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&Ei(e,"data")&&(t.flowing=!0,Zi(e))}}(n);t.on("drain",s);var c=!1;function u(e){wi("ondata");var r=t.write(e);wi("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==Qi(i.pipes,t))&&!c&&(wi("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function f(e){wi("onerror",e),l(),t.removeListener("error",f),0===Ei(t,"error")&&Bi(t,e)}function h(){t.removeListener("finish",d),l()}function d(){wi("onfinish"),t.removeListener("close",h),l()}function l(){wi("unpipe"),n.unpipe(t)}return n.on("data",u),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(t,"error",f),t.once("close",h),t.once("finish",d),t.emit("pipe",n),i.flowing||(wi("pipe resume"),n.resume()),t},ji.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,wi("on readable",i.length,i.reading),i.length?Gi(this):i.reading||e.nextTick(Ki,this))),n},ji.prototype.addListener=ji.prototype.on,ji.prototype.removeListener=function(t,r){var n=jr.prototype.removeListener.call(this,t,r);return"readable"===t&&e.nextTick(Ui,this),n},ji.prototype.removeAllListeners=function(t){var r=jr.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||e.nextTick(Ui,this),r},ji.prototype.resume=function(){var t=this._readableState;return t.flowing||(wi("resume"),t.flowing=!t.readableListening,function(t,r){r.resumeScheduled||(r.resumeScheduled=!0,e.nextTick(Vi,t,r))}(this,t)),t.paused=!1,this},ji.prototype.pause=function(){return wi("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(wi("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},ji.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(wi("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){wi("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o0,(function(e){n||(n=e),e&&o.forEach(mo),a||(o.forEach(mo),i(n))}))}));return t.reduce(yo)},Eo=Object(y.b)((function(e,t){(t=e.exports=Ai).Stream=t,t.Readable=t,t.Writable=sn,t.Duplex=Bn,t.Transform=$i,t.PassThrough=fo,t.finished=ni,t.pipeline=wo})),So=(Eo.Stream,Eo.Readable,Eo.Writable,Eo.Duplex,Eo.Transform,Eo.PassThrough,Eo.finished,Eo.pipeline,xe.Buffer),Mo=Eo.Transform;function ko(e){Mo.call(this),this._block=So.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}Te(ko,Mo),ko.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},ko.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},ko.prototype.update=function(e,t){if(function(e,t){if(!So.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");So.isBuffer(e)||(e=So.from(e,t));for(var r=this._block,n=0;this._blockOffset+e.length-n>=this._blockSize;){for(var i=this._blockOffset;i0;++o)this._length[o]+=a,(a=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*a);return this},ko.prototype._update=function(){throw new Error("_update is not implemented")},ko.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},ko.prototype._digest=function(){throw new Error("_digest is not implemented")};var Ro=ko,Oo=xe.Buffer,xo=new Array(16);function Io(){Ro.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function _o(e,t){return e<>>32-t}function Co(e,t,r,n,i,o,a){return _o(e+(t&r|~t&n)+i+o|0,a)+t|0}function To(e,t,r,n,i,o,a){return _o(e+(t&n|r&~n)+i+o|0,a)+t|0}function Lo(e,t,r,n,i,o,a){return _o(e+(t^r^n)+i+o|0,a)+t|0}function Bo(e,t,r,n,i,o,a){return _o(e+(r^(t|~n))+i+o|0,a)+t|0}Te(Io,Ro),Io.prototype._update=function(){for(var e=xo,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=Co(r,n,i,o,e[0],3614090360,7),o=Co(o,r,n,i,e[1],3905402710,12),i=Co(i,o,r,n,e[2],606105819,17),n=Co(n,i,o,r,e[3],3250441966,22),r=Co(r,n,i,o,e[4],4118548399,7),o=Co(o,r,n,i,e[5],1200080426,12),i=Co(i,o,r,n,e[6],2821735955,17),n=Co(n,i,o,r,e[7],4249261313,22),r=Co(r,n,i,o,e[8],1770035416,7),o=Co(o,r,n,i,e[9],2336552879,12),i=Co(i,o,r,n,e[10],4294925233,17),n=Co(n,i,o,r,e[11],2304563134,22),r=Co(r,n,i,o,e[12],1804603682,7),o=Co(o,r,n,i,e[13],4254626195,12),i=Co(i,o,r,n,e[14],2792965006,17),r=To(r,n=Co(n,i,o,r,e[15],1236535329,22),i,o,e[1],4129170786,5),o=To(o,r,n,i,e[6],3225465664,9),i=To(i,o,r,n,e[11],643717713,14),n=To(n,i,o,r,e[0],3921069994,20),r=To(r,n,i,o,e[5],3593408605,5),o=To(o,r,n,i,e[10],38016083,9),i=To(i,o,r,n,e[15],3634488961,14),n=To(n,i,o,r,e[4],3889429448,20),r=To(r,n,i,o,e[9],568446438,5),o=To(o,r,n,i,e[14],3275163606,9),i=To(i,o,r,n,e[3],4107603335,14),n=To(n,i,o,r,e[8],1163531501,20),r=To(r,n,i,o,e[13],2850285829,5),o=To(o,r,n,i,e[2],4243563512,9),i=To(i,o,r,n,e[7],1735328473,14),r=Lo(r,n=To(n,i,o,r,e[12],2368359562,20),i,o,e[5],4294588738,4),o=Lo(o,r,n,i,e[8],2272392833,11),i=Lo(i,o,r,n,e[11],1839030562,16),n=Lo(n,i,o,r,e[14],4259657740,23),r=Lo(r,n,i,o,e[1],2763975236,4),o=Lo(o,r,n,i,e[4],1272893353,11),i=Lo(i,o,r,n,e[7],4139469664,16),n=Lo(n,i,o,r,e[10],3200236656,23),r=Lo(r,n,i,o,e[13],681279174,4),o=Lo(o,r,n,i,e[0],3936430074,11),i=Lo(i,o,r,n,e[3],3572445317,16),n=Lo(n,i,o,r,e[6],76029189,23),r=Lo(r,n,i,o,e[9],3654602809,4),o=Lo(o,r,n,i,e[12],3873151461,11),i=Lo(i,o,r,n,e[15],530742520,16),r=Bo(r,n=Lo(n,i,o,r,e[2],3299628645,23),i,o,e[0],4096336452,6),o=Bo(o,r,n,i,e[7],1126891415,10),i=Bo(i,o,r,n,e[14],2878612391,15),n=Bo(n,i,o,r,e[5],4237533241,21),r=Bo(r,n,i,o,e[12],1700485571,6),o=Bo(o,r,n,i,e[3],2399980690,10),i=Bo(i,o,r,n,e[10],4293915773,15),n=Bo(n,i,o,r,e[1],2240044497,21),r=Bo(r,n,i,o,e[8],1873313359,6),o=Bo(o,r,n,i,e[15],4264355552,10),i=Bo(i,o,r,n,e[6],2734768916,15),n=Bo(n,i,o,r,e[13],1309151649,21),r=Bo(r,n,i,o,e[4],4149444226,6),o=Bo(o,r,n,i,e[11],3174756917,10),i=Bo(i,o,r,n,e[2],718787259,15),n=Bo(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},Io.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 e=Oo.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e};var No=Io,Po=A.a.Buffer,jo=new Array(16),Do=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Ho=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],zo=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Go=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],Fo=[0,1518500249,1859775393,2400959708,2840853838],Wo=[1352829926,1548603684,1836072691,2053994217,0];function Yo(){Ro.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function Uo(e,t){return e<>>32-t}function Ko(e,t,r,n,i,o,a,s){return Uo(e+(t^r^n)+o+a|0,s)+i|0}function Vo(e,t,r,n,i,o,a,s){return Uo(e+(t&r|~t&n)+o+a|0,s)+i|0}function Zo(e,t,r,n,i,o,a,s){return Uo(e+((t|~r)^n)+o+a|0,s)+i|0}function qo(e,t,r,n,i,o,a,s){return Uo(e+(t&n|r&~n)+o+a|0,s)+i|0}function Xo(e,t,r,n,i,o,a,s){return Uo(e+(t^(r|~n))+o+a|0,s)+i|0}Te(Yo,Ro),Yo.prototype._update=function(){for(var e=jo,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,a=0|this._e,s=0|this._a,c=0|this._b,u=0|this._c,f=0|this._d,h=0|this._e,d=0;d<80;d+=1){var l,p;d<16?(l=Ko(r,n,i,o,a,e[Do[d]],Fo[0],zo[d]),p=Xo(s,c,u,f,h,e[Ho[d]],Wo[0],Go[d])):d<32?(l=Vo(r,n,i,o,a,e[Do[d]],Fo[1],zo[d]),p=qo(s,c,u,f,h,e[Ho[d]],Wo[1],Go[d])):d<48?(l=Zo(r,n,i,o,a,e[Do[d]],Fo[2],zo[d]),p=Zo(s,c,u,f,h,e[Ho[d]],Wo[2],Go[d])):d<64?(l=qo(r,n,i,o,a,e[Do[d]],Fo[3],zo[d]),p=Vo(s,c,u,f,h,e[Ho[d]],Wo[3],Go[d])):(l=Xo(r,n,i,o,a,e[Do[d]],Fo[4],zo[d]),p=Ko(s,c,u,f,h,e[Ho[d]],Wo[4],Go[d])),r=a,a=o,o=Uo(i,10),i=n,n=l,s=h,h=f,f=Uo(u,10),u=c,c=p}var b=this._b+i+f|0;this._b=this._c+o+h|0,this._c=this._d+a+s|0,this._d=this._e+r+c|0,this._e=this._a+n+u|0,this._a=b},Yo.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 e=Po.alloc?Po.alloc(20):new Po(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e};var Jo=Yo,Qo=xe.Buffer;function $o(e,t){this._block=Qo.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}$o.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=Qo.from(e,t));for(var r=this._block,n=this._blockSize,i=e.length,o=this._len,a=0;a=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},$o.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var ea=$o,ta=xe.Buffer,ra=[1518500249,1859775393,-1894007588,-899497514],na=new Array(80);function ia(){this.init(),this._w=na,ea.call(this,64,56)}function oa(e){return e<<30|e>>>2}function aa(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}Te(ia,ea),ia.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},ia.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,c=0;c<16;++c)r[c]=e.readInt32BE(4*c);for(;c<80;++c)r[c]=r[c-3]^r[c-8]^r[c-14]^r[c-16];for(var u=0;u<80;++u){var f=~~(u/20),h=0|((t=n)<<5|t>>>27)+aa(f,i,o,a)+s+r[u]+ra[f];s=a,a=o,o=oa(i),i=n,n=h}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},ia.prototype._hash=function(){var e=ta.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var sa=ia,ca=xe.Buffer,ua=[1518500249,1859775393,-1894007588,-899497514],fa=new Array(80);function ha(){this.init(),this._w=fa,ea.call(this,64,56)}function da(e){return e<<5|e>>>27}function la(e){return e<<30|e>>>2}function pa(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}Te(ha,ea),ha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},ha.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,c=0;c<16;++c)r[c]=e.readInt32BE(4*c);for(;c<80;++c)r[c]=(t=r[c-3]^r[c-8]^r[c-14]^r[c-16])<<1|t>>>31;for(var u=0;u<80;++u){var f=~~(u/20),h=da(n)+pa(f,i,o,a)+s+r[u]+ua[f]|0;s=a,a=o,o=la(i),i=n,n=h}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},ha.prototype._hash=function(){var e=ca.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var ba=ha,va=xe.Buffer,ga=[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],ma=new Array(64);function ya(){this.init(),this._w=ma,ea.call(this,64,56)}function Aa(e,t,r){return r^e&(t^r)}function wa(e,t,r){return e&t|r&(e|t)}function Ea(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function Sa(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function Ma(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function ka(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Te(ya,ea),ya.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},ya.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,a=0|this._e,s=0|this._f,c=0|this._g,u=0|this._h,f=0;f<16;++f)t[f]=e.readInt32BE(4*f);for(;f<64;++f)t[f]=ka(t[f-2])+t[f-7]+Ma(t[f-15])+t[f-16]|0;for(var h=0;h<64;++h){var d=u+Sa(a)+Aa(a,s,c)+ga[h]+t[h]|0,l=Ea(r)+wa(r,n,i)|0;u=c,c=s,s=a,a=o+d|0,o=i,i=n,n=r,r=d+l|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0,this._f=s+this._f|0,this._g=c+this._g|0,this._h=u+this._h|0},ya.prototype._hash=function(){var e=va.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var Ra=ya,Oa=xe.Buffer,xa=new Array(64);function Ia(){this.init(),this._w=xa,ea.call(this,64,56)}Te(Ia,Ra),Ia.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},Ia.prototype._hash=function(){var e=Oa.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var _a=Ia,Ca=xe.Buffer,Ta=[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],La=new Array(160);function Ba(){this.init(),this._w=La,ea.call(this,128,112)}function Na(e,t,r){return r^e&(t^r)}function Pa(e,t,r){return e&t|r&(e|t)}function ja(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function Da(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Ha(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function za(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Ga(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Fa(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function Wa(e,t){return e>>>0>>0?1:0}Te(Ba,ea),Ba.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},Ba.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,a=0|this._eh,s=0|this._fh,c=0|this._gh,u=0|this._hh,f=0|this._al,h=0|this._bl,d=0|this._cl,l=0|this._dl,p=0|this._el,b=0|this._fl,v=0|this._gl,g=0|this._hl,m=0;m<32;m+=2)t[m]=e.readInt32BE(4*m),t[m+1]=e.readInt32BE(4*m+4);for(;m<160;m+=2){var y=t[m-30],A=t[m-30+1],w=Ha(y,A),E=za(A,y),S=Ga(y=t[m-4],A=t[m-4+1]),M=Fa(A,y),k=t[m-14],R=t[m-14+1],O=t[m-32],x=t[m-32+1],I=E+R|0,_=w+k+Wa(I,E)|0;_=(_=_+S+Wa(I=I+M|0,M)|0)+O+Wa(I=I+x|0,x)|0,t[m]=_,t[m+1]=I}for(var C=0;C<160;C+=2){_=t[C],I=t[C+1];var T=Pa(r,n,i),L=Pa(f,h,d),B=ja(r,f),N=ja(f,r),P=Da(a,p),j=Da(p,a),D=Ta[C],H=Ta[C+1],z=Na(a,s,c),G=Na(p,b,v),F=g+j|0,W=u+P+Wa(F,g)|0;W=(W=(W=W+z+Wa(F=F+G|0,G)|0)+D+Wa(F=F+H|0,H)|0)+_+Wa(F=F+I|0,I)|0;var Y=N+L|0,U=B+T+Wa(Y,N)|0;u=c,g=v,c=s,v=b,s=a,b=p,a=o+W+Wa(p=l+F|0,l)|0,o=i,l=d,i=n,d=h,n=r,h=f,r=W+U+Wa(f=F+Y|0,F)|0}this._al=this._al+f|0,this._bl=this._bl+h|0,this._cl=this._cl+d|0,this._dl=this._dl+l|0,this._el=this._el+p|0,this._fl=this._fl+b|0,this._gl=this._gl+v|0,this._hl=this._hl+g|0,this._ah=this._ah+r+Wa(this._al,f)|0,this._bh=this._bh+n+Wa(this._bl,h)|0,this._ch=this._ch+i+Wa(this._cl,d)|0,this._dh=this._dh+o+Wa(this._dl,l)|0,this._eh=this._eh+a+Wa(this._el,p)|0,this._fh=this._fh+s+Wa(this._fl,b)|0,this._gh=this._gh+c+Wa(this._gl,v)|0,this._hh=this._hh+u+Wa(this._hl,g)|0},Ba.prototype._hash=function(){var e=Ca.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var Ya=Ba,Ua=xe.Buffer,Ka=new Array(160);function Va(){this.init(),this._w=Ka,ea.call(this,128,112)}Te(Va,Ya),Va.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},Va.prototype._hash=function(){var e=Ua.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var Za=Va,qa=Object(y.b)((function(e){var t=e.exports=function(e){e=e.toLowerCase();var r=t[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};t.sha=sa,t.sha1=ba,t.sha224=_a,t.sha256=Ra,t.sha384=Za,t.sha512=Ya})),Xa=xe.Buffer,Ja=A.b.Transform,Qa=w.a.StringDecoder;function $a(e){Ja.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}Te($a,Ja),$a.prototype.update=function(e,t,r){"string"==typeof e&&(e=Xa.from(e,t));var n=this._update(e);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},$a.prototype.setAutoPadding=function(){},$a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},$a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},$a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},$a.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},$a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},$a.prototype._finalOrDigest=function(e){var t=this.__final()||Xa.alloc(0);return e&&(t=this._toString(t,e,!0)),t},$a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new Qa(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n};var es=$a;function ts(e){es.call(this,"digest"),this._hash=e}Te(ts,es),ts.prototype._update=function(e){this._hash.update(e)},ts.prototype._final=function(){return this._hash.digest()};var rs,ns=function(e){return"md5"===(e=e.toLowerCase())?new No:"rmd160"===e||"ripemd160"===e?new Jo:new ts(qa(e))},is=Object(y.b)((function(e){!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o=A.a.Buffer}catch(e){}function a(e,t,r){for(var n=0,i=Math.min(e.length,r),o=t;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function s(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},i.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=a(e,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==t&&(i=a(e,t,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,c=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var c=["","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"],u=[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],f=[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];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,h=67108863&c,d=Math.min(u,t.length-1),l=Math.max(0,u-e.length+1);l<=d;l++){var p=u-l|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[l])+h)/67108864|0,h=67108863&a}r.words[u]=0|h,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?c[6-h.length]+h+n:h+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var d=u[e],l=f[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(e);n=(p=p.idivn(l)).isZero()?b+n:c[d-b.length]+b+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===t,u=new e(o),f=this.clone();if(c){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),u[s]=a;for(;s=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},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,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},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,l=0|a[1],p=8191&l,b=l>>>13,v=0|a[2],g=8191&v,m=v>>>13,y=0|a[3],A=8191&y,w=y>>>13,E=0|a[4],S=8191&E,M=E>>>13,k=0|a[5],R=8191&k,O=k>>>13,x=0|a[6],I=8191&x,_=x>>>13,C=0|a[7],T=8191&C,L=C>>>13,B=0|a[8],N=8191&B,P=B>>>13,j=0|a[9],D=8191&j,H=j>>>13,z=0|s[0],G=8191&z,F=z>>>13,W=0|s[1],Y=8191&W,U=W>>>13,K=0|s[2],V=8191&K,Z=K>>>13,q=0|s[3],X=8191&q,J=q>>>13,Q=0|s[4],$=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],he=8191&fe,de=fe>>>13,le=0|s[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ve=(u+(n=Math.imul(h,G))|0)+((8191&(i=(i=Math.imul(h,F))+Math.imul(d,G)|0))<<13)|0;u=((o=Math.imul(d,F))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(p,G),i=(i=Math.imul(p,F))+Math.imul(b,G)|0,o=Math.imul(b,F);var ge=(u+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,U)|0)+Math.imul(d,Y)|0))<<13)|0;u=((o=o+Math.imul(d,U)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,G),i=(i=Math.imul(g,F))+Math.imul(m,G)|0,o=Math.imul(m,F),n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,U)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,U)|0;var me=(u+(n=n+Math.imul(h,V)|0)|0)+((8191&(i=(i=i+Math.imul(h,Z)|0)+Math.imul(d,V)|0))<<13)|0;u=((o=o+Math.imul(d,Z)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(A,G),i=(i=Math.imul(A,F))+Math.imul(w,G)|0,o=Math.imul(w,F),n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,U)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,U)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,Z)|0;var ye=(u+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(d,X)|0))<<13)|0;u=((o=o+Math.imul(d,J)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(S,G),i=(i=Math.imul(S,F))+Math.imul(M,G)|0,o=Math.imul(M,F),n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,U)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,U)|0,n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,Z)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,J)|0;var Ae=(u+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(d,$)|0))<<13)|0;u=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(R,G),i=(i=Math.imul(R,F))+Math.imul(O,G)|0,o=Math.imul(O,F),n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,U)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,U)|0,n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,Z)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,ee)|0;var we=(u+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(d,re)|0))<<13)|0;u=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(I,G),i=(i=Math.imul(I,F))+Math.imul(_,G)|0,o=Math.imul(_,F),n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,U)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,U)|0,n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,Z)|0,n=n+Math.imul(A,X)|0,i=(i=i+Math.imul(A,J)|0)+Math.imul(w,X)|0,o=o+Math.imul(w,J)|0,n=n+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0;var Ee=(u+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ae)|0)+Math.imul(d,oe)|0))<<13)|0;u=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(T,G),i=(i=Math.imul(T,F))+Math.imul(L,G)|0,o=Math.imul(L,F),n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,U)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,U)|0,n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,J)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(w,$)|0,o=o+Math.imul(w,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0;var Se=(u+(n=n+Math.imul(h,ce)|0)|0)+((8191&(i=(i=i+Math.imul(h,ue)|0)+Math.imul(d,ce)|0))<<13)|0;u=((o=o+Math.imul(d,ue)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(N,G),i=(i=Math.imul(N,F))+Math.imul(P,G)|0,o=Math.imul(P,F),n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,U)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,U)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,J)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0;var Me=(u+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(d,he)|0))<<13)|0;u=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,G),i=(i=Math.imul(D,F))+Math.imul(H,G)|0,o=Math.imul(H,F),n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,U)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,U)|0,n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,Z)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,n=n+Math.imul(g,ce)|0,i=(i=i+Math.imul(g,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(b,he)|0,o=o+Math.imul(b,de)|0;var ke=(u+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,be)|0)+Math.imul(d,pe)|0))<<13)|0;u=((o=o+Math.imul(d,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,Y),i=(i=Math.imul(D,U))+Math.imul(H,Y)|0,o=Math.imul(H,U),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,n=n+Math.imul(A,ce)|0,i=(i=i+Math.imul(A,ue)|0)+Math.imul(w,ce)|0,o=o+Math.imul(w,ue)|0,n=n+Math.imul(g,he)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(m,he)|0,o=o+Math.imul(m,de)|0;var Re=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,V),i=(i=Math.imul(D,Z))+Math.imul(H,V)|0,o=Math.imul(H,Z),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,J)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(S,ce)|0,i=(i=i+Math.imul(S,ue)|0)+Math.imul(M,ce)|0,o=o+Math.imul(M,ue)|0,n=n+Math.imul(A,he)|0,i=(i=i+Math.imul(A,de)|0)+Math.imul(w,he)|0,o=o+Math.imul(w,de)|0;var Oe=(u+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,be)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,X),i=(i=Math.imul(D,J))+Math.imul(H,X)|0,o=Math.imul(H,J),n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(L,re)|0,o=o+Math.imul(L,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,n=n+Math.imul(S,he)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(M,he)|0,o=o+Math.imul(M,de)|0;var xe=(u+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,be)|0)+Math.imul(w,pe)|0))<<13)|0;u=((o=o+Math.imul(w,be)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,ee))+Math.imul(H,$)|0,o=Math.imul(H,ee),n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,n=n+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,ue)|0)+Math.imul(_,ce)|0,o=o+Math.imul(_,ue)|0,n=n+Math.imul(R,he)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(O,he)|0,o=o+Math.imul(O,de)|0;var Ie=(u+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,be)|0)+Math.imul(M,pe)|0))<<13)|0;u=((o=o+Math.imul(M,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(H,re)|0,o=Math.imul(H,ne),n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,n=n+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,ue)|0)+Math.imul(L,ce)|0,o=o+Math.imul(L,ue)|0,n=n+Math.imul(I,he)|0,i=(i=i+Math.imul(I,de)|0)+Math.imul(_,he)|0,o=o+Math.imul(_,de)|0;var _e=(u+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,be)|0)+Math.imul(O,pe)|0))<<13)|0;u=((o=o+Math.imul(O,be)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,ae))+Math.imul(H,oe)|0,o=Math.imul(H,ae),n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(P,ce)|0,o=o+Math.imul(P,ue)|0,n=n+Math.imul(T,he)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(L,he)|0,o=o+Math.imul(L,de)|0;var Ce=(u+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,be)|0)+Math.imul(_,pe)|0))<<13)|0;u=((o=o+Math.imul(_,be)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(D,ce),i=(i=Math.imul(D,ue))+Math.imul(H,ce)|0,o=Math.imul(H,ue),n=n+Math.imul(N,he)|0,i=(i=i+Math.imul(N,de)|0)+Math.imul(P,he)|0,o=o+Math.imul(P,de)|0;var Te=(u+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,be)|0)+Math.imul(L,pe)|0))<<13)|0;u=((o=o+Math.imul(L,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,he),i=(i=Math.imul(D,de))+Math.imul(H,he)|0,o=Math.imul(H,de);var Le=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,be)|0)+Math.imul(P,pe)|0))<<13)|0;u=((o=o+Math.imul(P,be)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863;var Be=(u+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,be))+Math.imul(H,pe)|0))<<13)|0;return u=((o=Math.imul(H,be))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,c[0]=ve,c[1]=ge,c[2]=me,c[3]=ye,c[4]=Ae,c[5]=we,c[6]=Ee,c[7]=Se,c[8]=Me,c[9]=ke,c[10]=Re,c[11]=Oe,c[12]=xe,c[13]=Ie,c[14]=_e,c[15]=Ce,c[16]=Te,c[17]=Le,c[18]=Be,0!==u&&(c[19]=u,r.length++),r};function l(e,t,r){return(new p).mulp(e,t,r)}function p(e,t){this.x=e,this.y=t}Math.imul||(d=h),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?d(this,e,t):r<63?h(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):l(this,e,t)},p.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n>=1;return n},p.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==f||u>=i);u--){var h=0|this.words[u];this.words[u]=f<<26-o|h>>>o,f=h&s}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!==(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,c=n.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;h--){var d=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(o,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var f=n.clone(),h=t.clone();!t.isZero();){for(var d=0,l=1;0==(t.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(f),a.isub(h)),o.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(n.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(f),c.isub(h)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,f=1;0==(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var h=0,d=1;0==(n.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(n.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new E(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function m(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function y(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},n(g,v),g.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},g.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new g;else if("p224"===e)t=new m;else if("p192"===e)t=new y;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return b[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var h=this.pow(f,o),d=this.pow(e,o.addn(1).iushrn(1)),l=this.pow(e,o),p=a;0!==l.cmp(s);){for(var b=l,v=0;0!==b.cmp(s);v++)b=b.redSqr();r(v=0;n--){for(var u=t.words[n],f=c-1;f>=0;f--){var h=u>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===n&&0===f)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}c=26}return o},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},n(S,E),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,y.d)})),os="lib/elliptic.js",as=["lib"],ss={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",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},cs={type:"git",url:"git@github.com:indutny/elliptic"},us=["EC","Elliptic","curve","Cryptography"],fs="Fedor Indutny ",hs={url:"https://github.com/indutny/elliptic/issues"},ds="https://github.com/indutny/elliptic",ls={brfs:"^1.4.3",coveralls:"^3.0.8",grunt:"^1.0.4","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":"^9.0.1",istanbul:"^0.4.2",jscs:"^3.0.7",jshint:"^2.10.3",mocha:"^6.2.2"},ps={"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"},bs={name:"elliptic",version:"6.5.3",description:"EC cryptography",main:os,files:as,scripts:ss,repository:cs,keywords:us,author:fs,license:"MIT",bugs:hs,homepage:ds,devDependencies:ls,dependencies:ps},vs=Object.freeze({__proto__:null,name:"elliptic",version:"6.5.3",description:"EC cryptography",main:os,files:as,scripts:ss,repository:cs,keywords:us,author:fs,license:"MIT",bugs:hs,homepage:ds,devDependencies:ls,dependencies:ps,default:bs}),gs=Object(y.b)((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),ms=Object(y.b)((function(e,t){var r=t;r.assert=_e,r.toArray=gs.toArray,r.zero2=gs.zero2,r.toHex=gs.toHex,r.encode=gs.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-c:c,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n=0,i=0;e.cmpn(-n)>0||t.cmpn(-i)>0;){var o,a,s,c=e.andln(3)+n&3,u=t.andln(3)+i&3;3===c&&(c=-1),3===u&&(u=-1),o=0==(1&c)?0:3!==(s=e.andln(7)+n&7)&&5!==s||2!==u?c:-c,r[0].push(o),a=0==(1&u)?0:3!==(s=t.andln(7)+i&7)&&5!==s||2!==c?u:-u,r[1].push(a),2*n===o+1&&(n=1-n),2*i===a+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new is(e,"hex","le")}})),ys=function(e){return rs||(rs=new As(null)),rs.generate(e)};function As(e){this.rand=e}var ws=As;if(As.prototype.generate=function(e){return this._rand(e)},As.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Os=Rs;function xs(e,t){this.curve=e,this.type=t,this.precomputed=null}Rs.prototype.point=function(){throw new Error("Not implemented")},Rs.prototype.validate=function(){throw new Error("Not implemented")},Rs.prototype._fixedNafMul=function(e,t){ks(e.precomputed);var r=e._getDoubles(),n=Ss(t,1,this._bitLength),i=(1<=a;t--)s=(s<<1)+n[t];o.push(s)}for(var c=this.jpoint(null,null,null),u=this.jpoint(null,null,null),f=i;f>0;f--){for(a=0;a=0;s--){for(t=0;s>=0&&0===o[s];s--)t++;if(s>=0&&t++,a=a.dblp(t),s<0)break;var c=o[s];ks(0!==c),a="affine"===e.type?c>0?a.mixedAdd(i[c-1>>1]):a.mixedAdd(i[-c-1>>1].neg()):c>0?a.add(i[c-1>>1]):a.add(i[-c-1>>1].neg())}return"affine"===e.type?a.toP():a},Rs.prototype._wnafMulAdd=function(e,t,r,n,i){for(var o=this._wnafT1,a=this._wnafT2,s=this._wnafT3,c=0,u=0;u=1;u-=2){var h=u-1,d=u;if(1===o[h]&&1===o[d]){var l=[t[h],null,null,t[d]];0===t[h].y.cmp(t[d].y)?(l[1]=t[h].add(t[d]),l[2]=t[h].toJ().mixedAdd(t[d].neg())):0===t[h].y.cmp(t[d].y.redNeg())?(l[1]=t[h].toJ().mixedAdd(t[d]),l[2]=t[h].add(t[d].neg())):(l[1]=t[h].toJ().mixedAdd(t[d]),l[2]=t[h].toJ().mixedAdd(t[d].neg()));var p=[-3,-1,-5,-7,0,7,5,1,3],b=Ms(r[h],r[d]);c=Math.max(b[0].length,c),s[h]=new Array(c),s[d]=new Array(c);for(var v=0;v=0;u--){for(var w=0;u>=0;){var E=!0;for(v=0;v=0&&w++,y=y.dblp(w),u<0)break;for(v=0;v0?S=a[v][M-1>>1]:M<0&&(S=a[v][-M-1>>1].neg()),y="affine"===S.type?y.mixedAdd(S):y.add(S))}}for(u=0;u=Math.ceil((e.bitLength()+1)/t.step)},xs.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(o=t,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},_s.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},_s.prototype.pointFromX=function(e,t){(e=new is(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},_s.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},_s.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},Ts.prototype.isInfinity=function(){return this.inf},Ts.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},Ts.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},Ts.prototype.getX=function(){return this.x.fromRed()},Ts.prototype.getY=function(){return this.y.fromRed()},Ts.prototype.mul=function(e){return e=new is(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},Ts.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},Ts.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},Ts.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},Ts.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},Ts.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Te(Ls,Os.BasePoint),_s.prototype.jpoint=function(e,t,r){return new Ls(this,e,t,r)},Ls.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},Ls.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Ls.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),f=u.redMul(s),h=n.redMul(u),d=c.redSqr().redIAdd(f).redISub(h).redISub(h),l=c.redMul(h.redISub(d)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,l,p)},Ls.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),f=r.redMul(c),h=s.redSqr().redIAdd(u).redISub(f).redISub(f),d=s.redMul(f.redISub(h)).redISub(i.redMul(u)),l=this.z.redMul(a);return this.curve.jpoint(h,d,l)},Ls.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},Ls.prototype.inspect=function(){return this.isInfinity()?"":""},Ls.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Te(Bs,Os);var Ns=Bs;function Ps(e,t,r){Os.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new is(t,16),this.z=new is(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}Bs.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},Te(Ps,Os.BasePoint),Bs.prototype.decodePoint=function(e,t){return this.point(ms.toArray(e,t),1)},Bs.prototype.point=function(e,t){return new Ps(this,e,t)},Bs.prototype.pointFromJSON=function(e){return Ps.fromJSON(this,e)},Ps.prototype.precompute=function(){},Ps.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Ps.fromJSON=function(e,t){return new Ps(e,t[0],t[1]||e.one)},Ps.prototype.inspect=function(){return this.isInfinity()?"":""},Ps.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Ps.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},Ps.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Ps.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),c=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,c)},Ps.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},Ps.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Ps.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Ps.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},Ps.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Ps.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var js=ms.assert;function Ds(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,Os.call(this,"edwards",e),this.a=new is(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new is(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new is(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),js(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}Te(Ds,Os);var Hs=Ds;function zs(e,t,r,n,i){Os.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new is(t,16),this.y=new is(r,16),this.z=n?new is(n,16):this.curve.one,this.t=i&&new is(i,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}Ds.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},Ds.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},Ds.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},Ds.prototype.pointFromX=function(e,t){(e=new is(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=n.redMul(i.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var s=a.fromRed().isOdd();return(t&&!s||!t&&s)&&(a=a.redNeg()),this.point(e,a)},Ds.prototype.pointFromY=function(e,t){(e=new is(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=n.redMul(i.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},Ds.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},Te(zs,Os.BasePoint),Ds.prototype.pointFromJSON=function(e){return zs.fromJSON(this,e)},Ds.prototype.point=function(e,t,r,n){return new zs(this,e,t,r,n)},zs.fromJSON=function(e,t){return new zs(e,t[0],t[1],t[2])},zs.prototype.inspect=function(){return this.isInfinity()?"":""},zs.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},zs.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),c=i.redMul(a),u=o.redMul(s),f=i.redMul(s),h=a.redMul(o);return this.curve.point(c,u,h,f)},zs.prototype._projDbl=function(){var e,t,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(u=this.curve._mulA(i)).redAdd(o);if(this.zOne)e=n.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(u.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),c=a.redSub(s).redISub(s);e=n.redSub(i).redISub(o).redMul(c),t=a.redMul(u.redSub(o)),r=a.redMul(c)}}else{var u=i.redAdd(o);s=this.curve._mulC(this.z).redSqr(),c=u.redSub(s).redSub(s),e=this.curve._mulC(n.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(i.redISub(o)),r=u.redMul(c)}return this.curve.point(e,t,r)},zs.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},zs.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),c=r.redAdd(t),u=o.redMul(a),f=s.redMul(c),h=o.redMul(c),d=a.redMul(s);return this.curve.point(u,f,d,h)},zs.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),c=i.redSub(s),u=i.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),h=n.redMul(c).redMul(f);return this.curve.twisted?(t=n.redMul(u).redMul(a.redSub(this.curve._mulA(o))),r=c.redMul(u)):(t=n.redMul(u).redMul(a.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(h,t,r)},zs.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},zs.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},zs.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},zs.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},zs.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},zs.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},zs.prototype.getX=function(){return this.normalize(),this.x.fromRed()},zs.prototype.getY=function(){return this.normalize(),this.y.fromRed()},zs.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},zs.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},zs.prototype.toP=zs.prototype.normalize,zs.prototype.mixedAdd=zs.prototype.add;var Gs=Object(y.b)((function(e,t){var r=t;r.base=Os,r.short=Cs,r.mont=Ns,r.edwards=Hs})),Fs={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}},Ws=Object(y.b)((function(e,t){var r,n=t,i=ms.assert;function o(e){"short"===e.type?this.curve=new Gs.short(e):"edwards"===e.type?this.curve=new Gs.edwards(e):this.curve=new Gs.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,a("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:pr.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:pr.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:pr.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:pr.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"]}),a("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:pr.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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:pr.sha256,gRed:!1,g:["9"]}),a("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:pr.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=Fs}catch(e){r=void 0}a("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:pr.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Ys(e){if(!(this instanceof Ys))return new Ys(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=gs.toArray(e.entropy,e.entropyEnc||"hex"),r=gs.toArray(e.nonce,e.nonceEnc||"hex"),n=gs.toArray(e.pers,e.persEnc||"hex");_e(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var Us=Ys;Ys.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);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(e.concat(r||[])),this._reseed=1},Ys.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=gs.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var qs=ms.assert;function Xs(e,t){if(e instanceof Xs)return e;this._importDER(e,t)||(qs(e.r&&e.s,"Signature without r or s"),this.r=new is(e.r,16),this.s=new is(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var Js=Xs;function Qs(){this.place=0}function $s(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o>>=0;return!(i<=127)&&(t.place=a,i)}function ec(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}Xs.prototype._importDER=function(e,t){e=ms.toArray(e,t);var r=new Qs;if(48!==e[r.place++])return!1;var n=$s(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=$s(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=$s(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new is(o),this.s=new is(s),this.recoveryParam=null,!0},Xs.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=ec(t),r=ec(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];tc(n,t.length),(n=n.concat(t)).push(2),tc(n,r.length);var i=n.concat(r),o=[48];return tc(o,i.length),o=o.concat(i),ms.encode(o,e)};var rc=ms.assert;function nc(e){if(!(this instanceof nc))return new nc(e);"string"==typeof e&&(rc(Ws.hasOwnProperty(e),"Unknown curve "+e),e=Ws[e]),e instanceof Ws.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var ic=nc;nc.prototype.keyPair=function(e){return new Zs(this,e)},nc.prototype.keyFromPrivate=function(e,t){return Zs.fromPrivate(this,e,t)},nc.prototype.keyFromPublic=function(e,t){return Zs.fromPublic(this,e,t)},nc.prototype.genKeyPair=function(e){e||(e={});for(var t=new Us({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||ys(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new is(2));;){var i=new is(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},nc.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},nc.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new is(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new Us({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new is(1)),u=0;;u++){var f=n.k?n.k(u):new is(s.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(c)>=0)){var h=this.g.mul(f);if(!h.isInfinity()){var d=h.getX(),l=d.umod(this.n);if(0!==l.cmpn(0)){var p=f.invm(this.n).mul(l.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var b=(h.getY().isOdd()?1:0)|(0!==d.cmp(l)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),b^=1),new Js({r:l,s:p,recoveryParam:b})}}}}}},nc.prototype.verify=function(e,t,r,n){e=this._truncateToN(new is(e,16)),r=this.keyFromPublic(r,n);var i=(t=new Js(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),c=s.mul(e).umod(this.n),u=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},nc.prototype.recoverPubKey=function(e,t,r,n){rc((3&r)===r,"The recovery param is more than two bits"),t=new Js(t,n);var i=this.n,o=new is(e),a=t.r,s=t.s,c=1&r,u=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var f=t.r.invm(i),h=i.sub(o).mul(f).umod(i),d=s.mul(f).umod(i);return this.g.mulAdd(h,a,d)},nc.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new Js(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var oc=ms.assert,ac=ms.parseBytes,sc=ms.cachedProperty;function cc(e,t){this.eddsa=e,this._secret=ac(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=ac(t.pub)}cc.fromPublic=function(e,t){return t instanceof cc?t:new cc(e,{pub:t})},cc.fromSecret=function(e,t){return t instanceof cc?t:new cc(e,{secret:t})},cc.prototype.secret=function(){return this._secret},sc(cc,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),sc(cc,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),sc(cc,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),sc(cc,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),sc(cc,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),sc(cc,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),cc.prototype.sign=function(e){return oc(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},cc.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},cc.prototype.getSecret=function(e){return oc(this._secret,"KeyPair is public only"),ms.encode(this.secret(),e)},cc.prototype.getPublic=function(e){return ms.encode(this.pubBytes(),e)};var uc=cc,fc=ms.assert,hc=ms.cachedProperty,dc=ms.parseBytes;function lc(e,t){this.eddsa=e,"object"!=typeof t&&(t=dc(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),fc(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof is&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}hc(lc,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),hc(lc,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),hc(lc,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),hc(lc,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),lc.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},lc.prototype.toHex=function(){return ms.encode(this.toBytes(),"hex").toUpperCase()};var pc=lc,bc=ms.assert,vc=ms.parseBytes;function gc(e){if(bc("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof gc))return new gc(e);e=Ws[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=pr.sha512}var mc=gc;gc.prototype.sign=function(e,t){e=vc(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),s=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:o})},gc.prototype.verify=function(e,t,r){e=vc(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},gc.prototype.hashInt=function(){for(var e=this.hash(),t=0;t=0)return null;var o=(r=r.toRed(i.red)).redSqr().redIMul(r).redIAdd(i.b).redSqrt();return 3===e!==o.isOdd()&&(o=o.redNeg()),n.keyPair({pub:{x:r,y:o}})}(t,e.slice(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,t,r){var o=new is(t),a=new is(r);if(o.cmp(i.p)>=0||a.cmp(i.p)>=0)return null;if(o=o.toRed(i.red),a=a.toRed(i.red),(6===e||7===e)&&a.isOdd()!==(7===e))return null;var s=o.redSqr().redIMul(o);return a.redSqr().redISub(s.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:o,y:a}}):null}(t,e.slice(1,33),e.slice(33,65));default:return null}}t.privateKeyVerify=function(e){var t=new is(e);return t.cmp(i.n)<0&&!t.isZero()},t.privateKeyExport=function(e,t){var o=new is(e);if(o.cmp(i.n)>=0||o.isZero())throw new Error(Nr.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return r.from(n.keyFromPrivate(e).getPublic(t,!0))},t.privateKeyNegate=function(e){var t=new is(e);return t.isZero()?r.alloc(32):i.n.sub(t).umod(i.n).toArrayLike(r,"be",32)},t.privateKeyModInverse=function(e){var t=new is(e);if(t.cmp(i.n)>=0||t.isZero())throw new Error(Nr.EC_PRIVATE_KEY_RANGE_INVALID);return t.invm(i.n).toArrayLike(r,"be",32)},t.privateKeyTweakAdd=function(e,t){var n=new is(t);if(n.cmp(i.n)>=0)throw new Error(Nr.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(n.iadd(new is(e)),n.cmp(i.n)>=0&&n.isub(i.n),n.isZero())throw new Error(Nr.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return n.toArrayLike(r,"be",32)},t.privateKeyTweakMul=function(e,t){var n=new is(t);if(n.cmp(i.n)>=0||n.isZero())throw new Error(Nr.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);return n.imul(new is(e)),n.cmp(i.n)&&(n=n.umod(i.n)),n.toArrayLike(r,"be",32)},t.publicKeyCreate=function(e,t){var o=new is(e);if(o.cmp(i.n)>=0||o.isZero())throw new Error(Nr.EC_PUBLIC_KEY_CREATE_FAIL);return r.from(n.keyFromPrivate(e).getPublic(t,!0))},t.publicKeyConvert=function(e,t){var n=o(e);if(null===n)throw new Error(Nr.EC_PUBLIC_KEY_PARSE_FAIL);return r.from(n.getPublic(t,!0))},t.publicKeyVerify=function(e){return null!==o(e)},t.publicKeyTweakAdd=function(e,t,n){var a=o(e);if(null===a)throw new Error(Nr.EC_PUBLIC_KEY_PARSE_FAIL);if((t=new is(t)).cmp(i.n)>=0)throw new Error(Nr.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);var s=i.g.mul(t).add(a.pub);if(s.isInfinity())throw new Error(Nr.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return r.from(s.encode(!0,n))},t.publicKeyTweakMul=function(e,t,n){var a=o(e);if(null===a)throw new Error(Nr.EC_PUBLIC_KEY_PARSE_FAIL);if((t=new is(t)).cmp(i.n)>=0||t.isZero())throw new Error(Nr.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return r.from(a.pub.mul(t).encode(!0,n))},t.publicKeyCombine=function(e,t){for(var n=new Array(e.length),i=0;i=0||o.cmp(i.n)>=0)throw new Error(Nr.ECDSA_SIGNATURE_PARSE_FAIL);var a=r.from(e);return 1===o.cmp(n.nh)&&i.n.sub(o).toArrayLike(r,"be",32).copy(a,32),a},t.signatureExport=function(e){var t=e.slice(0,32),r=e.slice(32,64);if(new is(t).cmp(i.n)>=0||new is(r).cmp(i.n)>=0)throw new Error(Nr.ECDSA_SIGNATURE_PARSE_FAIL);return{r:t,s:r}},t.signatureImport=function(e){var t=new is(e.r);t.cmp(i.n)>=0&&(t=new is(0));var n=new is(e.s);return n.cmp(i.n)>=0&&(n=new is(0)),r.concat([t.toArrayLike(r,"be",32),n.toArrayLike(r,"be",32)])},t.sign=function(e,t,o,a){if("function"==typeof o){var s=o;o=function(n){var i=s(e,t,null,a,n);if(!r.isBuffer(i)||32!==i.length)throw new Error(Nr.ECDSA_SIGN_FAIL);return new is(i)}}var c=new is(t);if(c.cmp(i.n)>=0||c.isZero())throw new Error(Nr.ECDSA_SIGN_FAIL);var u=n.sign(e,t,{canonical:!0,k:o,pers:a});return{signature:r.concat([u.r.toArrayLike(r,"be",32),u.s.toArrayLike(r,"be",32)]),recovery:u.recoveryParam}},t.verify=function(e,t,r){var a={r:t.slice(0,32),s:t.slice(32,64)},s=new is(a.r),c=new is(a.s);if(s.cmp(i.n)>=0||c.cmp(i.n)>=0)throw new Error(Nr.ECDSA_SIGNATURE_PARSE_FAIL);if(1===c.cmp(n.nh)||s.isZero()||c.isZero())return!1;var u=o(r);if(null===u)throw new Error(Nr.EC_PUBLIC_KEY_PARSE_FAIL);return n.verify(e,a,{x:u.pub.x,y:u.pub.y})},t.recover=function(e,t,o,a){var s={r:t.slice(0,32),s:t.slice(32,64)},c=new is(s.r),u=new is(s.s);if(c.cmp(i.n)>=0||u.cmp(i.n)>=0)throw new Error(Nr.ECDSA_SIGNATURE_PARSE_FAIL);try{if(c.isZero()||u.isZero())throw new Error;var f=n.recoverPubKey(e,s,o);return r.from(f.encode(!0,a))}catch(e){throw new Error(Nr.ECDSA_RECOVER_FAIL)}},t.ecdh=function(e,r){var n=t.ecdhUnsafe(e,r,!0);return ns("sha256").update(n).digest()},t.ecdhUnsafe=function(e,t,n){var a=o(e);if(null===a)throw new Error(Nr.EC_PUBLIC_KEY_PARSE_FAIL);var s=new is(t);if(s.cmp(i.n)>=0||s.isZero())throw new Error(Nr.ECDH_FAIL);return r.from(a.pub.mul(s).encode(!0,n))}})),Sc=(Ec.privateKeyVerify,Ec.privateKeyExport,Ec.privateKeyNegate,Ec.privateKeyModInverse,Ec.privateKeyTweakAdd,Ec.privateKeyTweakMul,Ec.publicKeyCreate,Ec.publicKeyConvert,Ec.publicKeyVerify,Ec.publicKeyTweakAdd,Ec.publicKeyTweakMul,Ec.publicKeyCombine,Ec.signatureNormalize,Ec.signatureExport,Ec.signatureImport,Ec.sign,Ec.verify,Ec.recover,Ec.ecdh,Ec.ecdhUnsafe,yc=Ec,{privateKeyVerify:function(e){return Er(e,Nr.EC_PRIVATE_KEY_TYPE_INVALID),32===e.length&&yc.privateKeyVerify(e)},privateKeyExport:function(e,t){return Er(e,Nr.EC_PRIVATE_KEY_TYPE_INVALID),Sr(e,32,Nr.EC_PRIVATE_KEY_LENGTH_INVALID),t=Pr(t,!0),function(e,t,r){var n=Ir.from(r?_r:Cr);return e.copy(n,r?8:9),t.copy(n,r?181:214),n}(e,yc.privateKeyExport(e,t),t)},privateKeyImport:function(e){if(Er(e,Nr.EC_PRIVATE_KEY_TYPE_INVALID),(e=function(e){var t=e.length,r=0;if(!(t2||t1?e[r+n-2]<<8:0);if(!(t<(r+=n)+i||t32||t1&&0===t[n]&&!(128&t[n+1]);--r,++n);for(var i=Ir.concat([Ir.from([0]),e.s]),o=33,a=0;o>1&&0===i[a]&&!(128&i[a+1]);--o,++a);return xr(t.slice(n),i.slice(a))}(yc.signatureExport(e))},signatureImport:function(e){Er(e,Nr.ECDSA_SIGNATURE_TYPE_INVALID),kr(e,Nr.ECDSA_SIGNATURE_LENGTH_INVALID);var t=function(e){var t=Ir.alloc(32,0),r=Ir.alloc(32,0);try{var n=Or(e);if(33===n.r.length&&0===n.r[0]&&(n.r=n.r.slice(1)),n.r.length>32)throw new Error("R length is too long");if(33===n.s.length&&0===n.s[0]&&(n.s=n.s.slice(1)),n.s.length>32)throw new Error("S length is too long")}catch(e){return}return n.r.copy(t,32-n.r.length),n.s.copy(r,32-n.s.length),{r:t,s:r}}(e);if(t)return yc.signatureImport(t);throw new Error(Nr.ECDSA_SIGNATURE_PARSE_DER_FAIL)},signatureImportLax:function(e){Er(e,Nr.ECDSA_SIGNATURE_TYPE_INVALID),kr(e,Nr.ECDSA_SIGNATURE_LENGTH_INVALID);var t=function(e){var t=Ir.alloc(32,0),r=Ir.alloc(32,0),n=e.length,i=0;if(48===e[i++]){var o=e[i++];if(!(128&o&&(i+=o-128)>n)&&2===e[i++]){var a=e[i++];if(128&a){if(i+(o=a-128)>n)return;for(;o>0&&0===e[i];i+=1,o-=1);for(a=0;o>0;i+=1,o-=1)a=(a<<8)+e[i]}if(!(a>n-i)){var s=i;if(i+=a,2===e[i++]){var c=e[i++];if(128&c){if(i+(o=c-128)>n)return;for(;o>0&&0===e[i];i+=1,o-=1);for(c=0;o>0;i+=1,o-=1)c=(c<<8)+e[i]}if(!(c>n-i)){var u=i;for(i+=c;a>0&&0===e[s];a-=1,s+=1);if(!(a>32)){var f=e.slice(s,s+a);for(f.copy(t,32-f.length);c>0&&0===e[u];c-=1,u+=1);if(!(c>32)){var h=e.slice(u,u+c);return h.copy(r,32-h.length),{r:t,s:r}}}}}}}}}(e);if(t)return yc.signatureImport(t);throw new Error(Nr.ECDSA_SIGNATURE_PARSE_DER_FAIL)},sign:function(e,t,r){Er(e,Nr.MSG32_TYPE_INVALID),Sr(e,32,Nr.MSG32_LENGTH_INVALID),Er(t,Nr.EC_PRIVATE_KEY_TYPE_INVALID),Sr(t,32,Nr.EC_PRIVATE_KEY_LENGTH_INVALID);var n=null,i=null;return void 0!==r&&(function(e,t){if("[object Object]"!==wr.call(e))throw TypeError(t)}(r,Nr.OPTIONS_TYPE_INVALID),void 0!==r.data&&(Er(r.data,Nr.OPTIONS_DATA_TYPE_INVALID),Sr(r.data,32,Nr.OPTIONS_DATA_LENGTH_INVALID),n=r.data),void 0!==r.noncefn&&(function(e,t){if("[object Function]"!==wr.call(e))throw TypeError(t)}(r.noncefn,Nr.OPTIONS_NONCEFN_TYPE_INVALID),i=r.noncefn)),yc.sign(e,t,i,n)},verify:function(e,t,r){return Er(e,Nr.MSG32_TYPE_INVALID),Sr(e,32,Nr.MSG32_LENGTH_INVALID),Er(t,Nr.ECDSA_SIGNATURE_TYPE_INVALID),Sr(t,64,Nr.ECDSA_SIGNATURE_LENGTH_INVALID),Er(r,Nr.EC_PUBLIC_KEY_TYPE_INVALID),Mr(r,33,65,Nr.EC_PUBLIC_KEY_LENGTH_INVALID),yc.verify(e,t,r)},recover:function(e,t,r,n){return Er(e,Nr.MSG32_TYPE_INVALID),Sr(e,32,Nr.MSG32_LENGTH_INVALID),Er(t,Nr.ECDSA_SIGNATURE_TYPE_INVALID),Sr(t,64,Nr.ECDSA_SIGNATURE_LENGTH_INVALID),function(e,t){if("[object Number]"!==wr.call(e))throw TypeError(t)}(r,Nr.RECOVERY_ID_TYPE_INVALID),function(e,t,r,n){if(e<=t||e>=r)throw RangeError(n)}(r,-1,4,Nr.RECOVERY_ID_VALUE_INVALID),n=Pr(n,!0),yc.recover(e,t,r,n)},ecdh:function(e,t){return Er(e,Nr.EC_PUBLIC_KEY_TYPE_INVALID),Mr(e,33,65,Nr.EC_PUBLIC_KEY_LENGTH_INVALID),Er(t,Nr.EC_PRIVATE_KEY_TYPE_INVALID),Sr(t,32,Nr.EC_PRIVATE_KEY_LENGTH_INVALID),yc.ecdh(e,t)},ecdhUnsafe:function(e,t,r){return Er(e,Nr.EC_PUBLIC_KEY_TYPE_INVALID),Mr(e,33,65,Nr.EC_PUBLIC_KEY_LENGTH_INVALID),Er(t,Nr.EC_PRIVATE_KEY_TYPE_INVALID),Sr(t,32,Nr.EC_PRIVATE_KEY_LENGTH_INVALID),r=Pr(r,!0),yc.ecdhUnsafe(e,t,r)}}),Mc=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=function(e){if(!Re.isValidKeyLength(e))throw new Error("randomBytes - invalid key length: ".concat(e));return mr.isBrowser()?gr.browserRandomBytes(e):mr.isNode()?yr.nodeRandomBytes(e):vr.fallbackRandomBytes(e)}}));Object(y.c)(Mc),Mc.randomBytes;var kc=Object(y.b)((function(e,t){var r=y.d&&y.d.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var n=r(Sc);function i(e){return t.secp256k1.privateKeyVerify(e)}function o(e){return t.secp256k1.signatureExport(e)}function a(e){return t.secp256k1.signatureImport(e)}t.secp256k1=n,t.secp256k1Compress=function(e){return e=Re.sanitizePublicKey(e),t.secp256k1.publicKeyConvert(e,!0)},t.secp256k1Decompress=function(e){return e=Re.sanitizePublicKey(e),t.secp256k1.publicKeyConvert(e,!1)},t.secp256k1GeneratePrivate=function(){for(var e=Mc.randomBytes(Ee.KEY_LENGTH);!i(e);)e=Mc.randomBytes(Ee.KEY_LENGTH);return e},t.secp256k1VerifyPrivateKey=i,t.secp256k1GetPublic=function(e){return t.secp256k1.publicKeyCreate(e,!1)},t.secp256k1GetPublicCompressed=function(e){return t.secp256k1.publicKeyCreate(e,!0)},t.secp256k1SignatureExport=o,t.secp256k1SignatureImport=a,t.secp256k1Sign=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=t.secp256k1.sign(e,r),a=i.signature,s=i.recovery;return n?Re.concatBuffers(a,Re.exportRecoveryParam(s)):o(a)},t.secp256k1Recover=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Re.isValidDERSignature(e))throw new Error("Cannot recover from DER signatures");var i=Re.sanitizeRSVSignature(e),o=i.signature,a=i.recovery;return t.secp256k1.recover(r,o,a,n)},t.secp256k1Verify=function(e,r,n){return Re.isValidDERSignature(e)&&(e=a(e)),e=Re.sanitizeRSVSignature(e).signature,t.secp256k1.verify(r,e,n)},t.secp256k1Derive=function(e,r,n){var i=t.secp256k1.ecdhUnsafe(e,r,n);return Re.trimLeft(i,Ee.KEY_LENGTH)}}));Object(y.c)(kc),kc.secp256k1,kc.secp256k1Compress,kc.secp256k1Decompress,kc.secp256k1GeneratePrivate,kc.secp256k1VerifyPrivateKey,kc.secp256k1GetPublic,kc.secp256k1GetPublicCompressed,kc.secp256k1SignatureExport,kc.secp256k1SignatureImport,kc.secp256k1Sign,kc.secp256k1Recover,kc.secp256k1Verify,kc.secp256k1Derive;var Rc=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=new wc.ec("secp256k1");function i(e){return Re.isValidPrivateKey(e)}function o(e){return Js.Signature({r:e.slice(0,32),s:e.slice(32,64),recoveryParam:Re.importRecoveryParam(e.slice(64,65))}).toDER()}t.ellipticCompress=function(e){e=Re.sanitizePublicKey(e);var t=r.keyFromPublic(e).getPublic().encode(Ee.HEX_ENC,!0);return Re.hexToBuffer(t)},t.ellipticDecompress=function(e){e=Re.sanitizePublicKey(e);var t=r.keyFromPublic(e).getPublic().encode(Ee.HEX_ENC,!1);return Re.hexToBuffer(t)},t.ellipticGeneratePrivate=function(){for(var e=Mc.randomBytes(Ee.KEY_LENGTH);!i(e);)e=Mc.randomBytes(Ee.KEY_LENGTH);return e},t.ellipticVerifyPrivateKey=i,t.ellipticGetPublic=function(e){var t=r.keyFromPrivate(e).getPublic(!1,Ee.HEX_ENC);return Re.hexToBuffer(t)},t.ellipticGetPublicCompressed=function(e){var t=r.keyFromPrivate(e).getPublic(!0,Ee.HEX_ENC);return Re.hexToBuffer(t)},t.ellipticDerive=function(e,t){var i=r.keyFromPrivate(t),o=r.keyFromPublic(e),a=i.derive(o.getPublic());return n.from(a.toArray())},t.ellipticSignatureExport=o,t.ellipticSign=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=r.sign(e,t,{canonical:!0});return i?Re.concatBuffers(Re.hexToBuffer(Re.sanitizeHex(o.r.toString(16))),Re.hexToBuffer(Re.sanitizeHex(o.s.toString(16))),Re.exportRecoveryParam(o.recoveryParam||0)):n.from(o.toDER())},t.ellipticRecover=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Re.isValidDERSignature(e))throw new Error("Cannot recover from DER signatures");var i=Re.splitSignature(e),o=Re.importRecoveryParam(i.v),a=r.recoverPubKey(t,{r:Re.removeHexLeadingZeros(Re.bufferToHex(i.r)),s:Re.removeHexLeadingZeros(Re.bufferToHex(i.s)),recoveryParam:o},o).encode(Ee.HEX_ENC,n);return Re.hexToBuffer(a)},t.ellipticVerify=function(e,t,n){return Re.isValidDERSignature||(e=o(e)),r.verify(t,e,n)}}));Object(y.c)(Rc),Rc.ellipticCompress,Rc.ellipticDecompress,Rc.ellipticGeneratePrivate,Rc.ellipticVerifyPrivateKey,Rc.ellipticGetPublic,Rc.ellipticGetPublicCompressed,Rc.ellipticDerive,Rc.ellipticSignatureExport,Rc.ellipticSign,Rc.ellipticRecover,Rc.ellipticVerify;var Oc=Object(y.b)((function(e,t){function r(){return mr.isNode()?kc.secp256k1GeneratePrivate():Rc.ellipticGeneratePrivate()}function n(e){Re.assert(e.length===Ee.KEY_LENGTH,Ee.ERROR_BAD_PRIVATE_KEY),Re.assert(Re.isValidPrivateKey(e),Ee.ERROR_BAD_PRIVATE_KEY)}function i(e){Re.assert(e.length===Ee.PREFIXED_DECOMPRESSED_LENGTH||e.length===Ee.PREFIXED_KEY_LENGTH,Ee.ERROR_BAD_PUBLIC_KEY),e.length===Ee.PREFIXED_DECOMPRESSED_LENGTH&&Re.assert(4===e[0],Ee.ERROR_BAD_PUBLIC_KEY),e.length===Ee.PREFIXED_KEY_LENGTH&&Re.assert(2===e[0]||3===e[0],Ee.ERROR_BAD_PUBLIC_KEY)}function o(e){Re.assert(e.length>0,Ee.ERROR_EMPTY_MESSAGE),Re.assert(e.length<=Ee.MAX_MSG_LENGTH,Ee.ERROR_MESSAGE_TOO_LONG)}function a(e){return n(e),mr.isNode()?kc.secp256k1GetPublic(e):Rc.ellipticGetPublic(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.generatePrivate=r,t.checkPrivateKey=n,t.checkPublicKey=i,t.checkMessage=o,t.compress=function(e){return Re.isCompressed(e)?e:mr.isNode()?kc.secp256k1Compress(e):Rc.ellipticCompress(e)},t.decompress=function(e){return Re.isDecompressed(e)?e:mr.isNode()?kc.secp256k1Decompress(e):Rc.ellipticDecompress(e)},t.getPublic=a,t.getPublicCompressed=function(e){return n(e),mr.isNode()?kc.secp256k1GetPublicCompressed(e):Rc.ellipticGetPublicCompressed(e)},t.generateKeyPair=function(){var e=r();return{privateKey:e,publicKey:a(e)}},t.signatureExport=function(e){return mr.isNode()?kc.secp256k1SignatureExport(e):Rc.ellipticSignatureExport(e)},t.sign=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return n(e),o(t),mr.isNode()?kc.secp256k1Sign(t,e,r):Rc.ellipticSign(t,e,r)},t.recover=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return o(e),mr.isNode()?kc.secp256k1Recover(t,e,r):Rc.ellipticRecover(t,e,r)},t.verify=function(e,t,r){if(i(e),o(t),mr.isNode()?kc.secp256k1Verify(r,t,e):Rc.ellipticVerify(r,t,e))return null;throw new Error("Bad signature")}}));Object(y.c)(Oc),Oc.generatePrivate,Oc.checkPrivateKey,Oc.checkPublicKey,Oc.checkMessage,Oc.compress,Oc.decompress,Oc.getPublic,Oc.getPublicCompressed,Oc.generateKeyPair,Oc.signatureExport,Oc.sign,Oc.recover,Oc.verify;var xc=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.derive=function(e,t){return Oc.checkPrivateKey(e),Oc.checkPublicKey(t),mr.isNode()?kc.secp256k1Derive(t,e):Rc.ellipticDerive(t,e)}}));Object(y.c)(xc),xc.derive;var Ic=Object(y.b)((function(e,t){var r=y.d&&y.d.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(a,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.hmacSha256Sign=function(e,t){return r(this,void 0,void 0,m.a.mark((function r(){var n;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!mr.isBrowser()){r.next=6;break}return r.next=3,gr.browserHmacSha256Sign(e,t);case 3:r.t0=r.sent,r.next=7;break;case 6:r.t0=mr.isNode()?yr.nodeHmacSha256Sign(e,t):vr.fallbackHmacSha256Sign(e,t);case 7:return n=r.t0,r.abrupt("return",n);case 9:case"end":return r.stop()}}),r)})))},t.hmacSha256Verify=function(e,t,n){return r(this,void 0,void 0,m.a.mark((function r(){var i,o,a,s;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!mr.isBrowser()){r.next=7;break}return r.next=3,gr.browserHmacSha256Sign(e,t);case 3:o=r.sent,i=Re.equalConstTime(o,n),r.next=8;break;case 7:mr.isNode()?(a=yr.nodeHmacSha256Sign(e,t),i=Re.equalConstTime(a,n)):(s=vr.fallbackHmacSha256Sign(e,t),i=Re.equalConstTime(s,n));case 8:return r.abrupt("return",i);case 9:case"end":return r.stop()}}),r)})))},t.hmacSha512Sign=function(e,t){return r(this,void 0,void 0,m.a.mark((function r(){var n;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!mr.isBrowser()){r.next=6;break}return r.next=3,gr.browserHmacSha512Sign(e,t);case 3:r.t0=r.sent,r.next=7;break;case 6:r.t0=mr.isNode()?yr.nodeHmacSha512Sign(e,t):vr.fallbackHmacSha512Sign(e,t);case 7:return n=r.t0,r.abrupt("return",n);case 9:case"end":return r.stop()}}),r)})))},t.hmacSha512Verify=function(e,t,n){return r(this,void 0,void 0,m.a.mark((function r(){var i,o,a;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return mr.isNode()?(o=yr.nodeHmacSha512Sign(e,t),i=Re.equalConstTime(o,n)):(a=vr.fallbackHmacSha512Sign(e,t),i=Re.equalConstTime(a,n)),r.abrupt("return",i);case 2:case"end":return r.stop()}}),r)})))},t.hmacSha256SignSync=function(e,t){return mr.isNode()?yr.nodeHmacSha256Sign(e,t):vr.fallbackHmacSha256Sign(e,t)},t.hmacSha256VerifySync=function(e,t,r){var n;if(mr.isNode()){var i=yr.nodeHmacSha256Sign(e,t);n=Re.equalConstTime(i,r)}else{var o=vr.fallbackHmacSha256Sign(e,t);n=Re.equalConstTime(o,r)}return n},t.hmacSha512SignSync=function(e,t){return mr.isNode()?yr.nodeHmacSha512Sign(e,t):vr.fallbackHmacSha512Sign(e,t)},t.hmacSha512VerifySync=function(e,t,r){var n;if(mr.isNode()){var i=yr.nodeHmacSha512Sign(e,t);n=Re.equalConstTime(i,r)}else{var o=vr.fallbackHmacSha512Sign(e,t);n=Re.equalConstTime(o,r)}return n}}));Object(y.c)(Ic),Ic.hmacSha256Sign,Ic.hmacSha256Verify,Ic.hmacSha512Sign,Ic.hmacSha512Verify,Ic.hmacSha256SignSync,Ic.hmacSha256VerifySync,Ic.hmacSha512SignSync,Ic.hmacSha512VerifySync;var _c=Object(y.b)((function(e,t){var r=y.d&&y.d.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(a,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=function(e){return r(this,void 0,void 0,m.a.mark((function t(){var r;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=Ee.EMPTY_BUFFER,!mr.isBrowser()){t.next=7;break}return t.next=4,gr.browserSha256(e);case 4:t.t0=t.sent,t.next=8;break;case 7:t.t0=mr.isNode()?yr.nodeSha256(e):vr.fallbackSha256(e);case 8:return r=t.t0,t.abrupt("return",r);case 10:case"end":return t.stop()}}),t)})))},t.sha512=function(e){return r(this,void 0,void 0,m.a.mark((function t(){var r;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=Ee.EMPTY_BUFFER,!mr.isBrowser()){t.next=7;break}return t.next=4,gr.browserSha512(e);case 4:t.t0=t.sent,t.next=8;break;case 7:t.t0=mr.isNode()?yr.nodeSha512(e):vr.fallbackSha512(e);case 8:return r=t.t0,t.abrupt("return",r);case 10:case"end":return t.stop()}}),t)})))},t.ripemd160=function(e){return r(this,void 0,void 0,m.a.mark((function t(){return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ee.EMPTY_BUFFER,t.abrupt("return",mr.isNode()?yr.nodeRipemd160(e):vr.fallbackRipemd160(e));case 2:case"end":return t.stop()}}),t)})))},t.sha256Sync=function(e){Ee.EMPTY_BUFFER;return mr.isNode()?yr.nodeSha256(e):vr.fallbackSha256(e)},t.sha512Sync=function(e){Ee.EMPTY_BUFFER;return mr.isNode()?yr.nodeSha512(e):vr.fallbackSha512(e)},t.ripemd160Sync=function(e){Ee.EMPTY_BUFFER;return mr.isNode()?yr.nodeRipemd160(e):vr.fallbackRipemd160(e)}}));Object(y.c)(_c),_c.sha256,_c.sha512,_c.ripemd160,_c.sha256Sync,_c.sha512Sync,_c.ripemd160Sync;var Cc=Object(y.b)((function(e,t){var r=y.d&&y.d.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(a,s)}c((n=n.apply(e,t||[])).next())}))};function i(e,t){return t=Oc.decompress(t),xc.derive(e,t)}function o(e){return n.from(e.slice(Ee.LENGTH_0,Ee.KEY_LENGTH))}function a(e){return n.from(e.slice(Ee.KEY_LENGTH))}function s(e,t){return r(this,void 0,void 0,m.a.mark((function r(){var n,s;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=i(e,t),r.next=3,_c.sha512(n);case 3:return s=r.sent,r.abrupt("return",{encryptionKey:o(s),macKey:a(s)});case 5:case"end":return r.stop()}}),r)})))}function c(e,t){var r=i(e,t),n=_c.sha512Sync(r);return{encryptionKey:o(n),macKey:a(n)}}function u(e){for(var t,r,n=(null===(t=e)||void 0===t?void 0:t.ephemPrivateKey)||Mc.randomBytes(Ee.KEY_LENGTH);!Re.isValidPrivateKey(n);)n=(null===(r=e)||void 0===r?void 0:r.ephemPrivateKey)||Mc.randomBytes(Ee.KEY_LENGTH);return{ephemPrivateKey:n,ephemPublicKey:Oc.getPublic(n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.encrypt=function(e,t,n){var i;return r(this,void 0,void 0,m.a.mark((function r(){var o,a,c,f,h,d,l,p,b;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return o=u(n),a=o.ephemPrivateKey,c=o.ephemPublicKey,r.next=5,s(a,e);case 5:return f=r.sent,h=f.encryptionKey,d=f.macKey,l=(null===(i=n)||void 0===i?void 0:i.iv)||Mc.randomBytes(Ee.IV_LENGTH),r.next=11,Ar.aesCbcEncrypt(l,h,t);case 11:return p=r.sent,b=Re.concatBuffers(l,c,p),r.t0=l,r.t1=c,r.t2=p,r.next=18,Ic.hmacSha256Sign(d,b);case 18:return r.t3=r.sent,r.abrupt("return",{iv:r.t0,ephemPublicKey:r.t1,ciphertext:r.t2,mac:r.t3});case 20:case"end":return r.stop()}}),r)})))},t.decrypt=function(e,t){return r(this,void 0,void 0,m.a.mark((function r(){var n,i,o,a,c,u,f,h,d;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=t.ephemPublicKey,i=t.iv,o=t.mac,a=t.ciphertext,r.next=6,s(e,n);case 6:return c=r.sent,u=c.encryptionKey,f=c.macKey,h=Re.concatBuffers(i,n,a),r.next=12,Ic.hmacSha256Verify(f,h,o);case 12:return d=r.sent,Re.assert(d,Ee.ERROR_BAD_MAC),r.next=16,Ar.aesCbcDecrypt(t.iv,u,t.ciphertext);case 16:return r.abrupt("return",r.sent);case 17:case"end":return r.stop()}}),r)})))},t.encryptSync=function(e,t,r){var n,i=u(r),o=i.ephemPrivateKey,a=i.ephemPublicKey,s=c(o,e),f=s.encryptionKey,h=s.macKey,d=(null===(n=r)||void 0===n?void 0:n.iv)||Mc.randomBytes(Ee.IV_LENGTH),l=Ar.aesCbcEncryptSync(d,f,t),p=Re.concatBuffers(d,a,l);return{iv:d,ephemPublicKey:a,ciphertext:l,mac:Ic.hmacSha256SignSync(h,p)}},t.decryptSync=function(e,t){return r(this,void 0,void 0,m.a.mark((function r(){var n,i,o,a,s,u,f,h,d;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=t.ephemPublicKey,i=t.iv,o=t.mac,a=t.ciphertext,s=c(e,n),u=s.encryptionKey,f=s.macKey,h=Re.concatBuffers(i,n,a),d=Ic.hmacSha256VerifySync(f,h,o),r.abrupt("return",(Re.assert(d,Ee.ERROR_BAD_MAC),Ar.aesCbcDecryptSync(t.iv,u,t.ciphertext)));case 2:case"end":return r.stop()}}),r)})))},t.serialize=function(e){var t=Oc.compress(e.ephemPublicKey);return Re.concatBuffers(e.iv,t,e.mac,e.ciphertext)},t.deserialize=function(e){var t=Ee.LENGTH_0,r=t+Ee.IV_LENGTH,n=r+Ee.PREFIXED_KEY_LENGTH,i=n+Ee.MAC_LENGTH,o=e.length;return{iv:e.slice(t,r),ephemPublicKey:Oc.decompress(e.slice(r,n)),mac:e.slice(n,i),ciphertext:e.slice(i,o)}}}));Object(y.c)(Cc),Cc.encrypt,Cc.decrypt,Cc.encryptSync,Cc.decryptSync,Cc.serialize,Cc.deserialize;var Tc=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.sha3=function(e){return Re.hexToBuffer(Q.sha3_256(e))},t.keccak256=function(e){return Re.hexToBuffer(Q.keccak_256(e))}}));Object(y.c)(Tc),Tc.sha3,Tc.keccak256;var Lc=Object(y.b)((function(e,t){function r(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),r(Ee),r(Re),r(Ar),r(xc),r(Oc),r(Cc),r(Ic),r(Mc),r(_c),r(Tc)}));Object(y.c)(Lc);var Bc=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=B.__importStar(Lc);function n(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var n,i;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=(e||256)/8,i=r.randomBytes(n),t.abrupt("return",pe.convertBufferToArrayBuffer(i));case 2:case"end":return t.stop()}}),t)})))}function i(e,t){return B.__awaiter(this,void 0,void 0,m.a.mark((function n(){var i,o,a,s,c,u,f;return m.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=pe.convertHexToBuffer(e.data),o=pe.convertHexToBuffer(e.iv),a=pe.convertHexToBuffer(e.hmac),s=pe.convertBufferToHex(a,!0),c=pe.concatBuffers(i,o),n.next=7,r.hmacSha256Sign(t,c);case 7:return u=n.sent,f=pe.convertBufferToHex(u,!0),n.abrupt("return",pe.removeHexPrefix(s)===pe.removeHexPrefix(f));case 10:case"end":return n.stop()}}),n)})))}t.generateKey=n,t.verifyHmac=i,t.encrypt=function(e,t,i){return B.__awaiter(this,void 0,void 0,m.a.mark((function o(){var a,s,c,u,f,h,d,l,p,b;return m.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(a=pe.convertArrayBufferToBuffer(t),o.t0=i,o.t0){o.next=6;break}return o.next=5,n(128);case 5:o.t0=o.sent;case 6:return s=o.t0,c=pe.convertArrayBufferToBuffer(s),u=pe.convertBufferToHex(c,!0),f=JSON.stringify(e),h=pe.convertUtf8ToBuffer(f),o.next=13,r.aesCbcEncrypt(c,a,h);case 13:return d=o.sent,l=pe.convertBufferToHex(d,!0),p=pe.concatBuffers(d,c),o.next=18,r.hmacSha256Sign(a,p);case 18:return b=o.sent,o.abrupt("return",{data:l,hmac:pe.convertBufferToHex(b,!0),iv:u});case 20:case"end":return o.stop()}}),o)})))},t.decrypt=function(e,t){return B.__awaiter(this,void 0,void 0,m.a.mark((function n(){var o,a,s,c,u,f;return m.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(o=pe.convertArrayBufferToBuffer(t)){n.next=3;break}throw new Error("Missing key: required for decryption");case 3:return n.next=5,i(e,o);case 5:if(n.sent){n.next=7;break}return n.abrupt("return",null);case 7:return a=pe.convertHexToBuffer(e.data),s=pe.convertHexToBuffer(e.iv),n.next=11,r.aesCbcDecrypt(s,o,a);case 11:c=n.sent,u=pe.convertBufferToUtf8(c),n.prev=13,f=JSON.parse(u),n.next=20;break;case 17:return n.prev=17,n.t0=n.catch(13),n.abrupt("return",null);case 20:return n.abrupt("return",f);case 21:case"end":return n.stop()}}),n,null,[[13,17]])})))}}));Object(y.c)(Bc),Bc.generateKey,Bc.verifyHmac,Bc.encrypt,Bc.decrypt;var Nc=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=B.__importDefault(we),n=B.__importStar(Bc),i=function(e){Object(f.a)(r,e);var t=Object(h.a)(r);function r(e,i){return Object(d.a)(this,r),t.call(this,{cryptoLib:n,connectorOpts:e,pushServerOpts:i})}return r}(r.default);t.default=i}));Object(y.c)(Nc);var Pc=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then},jc={}.toString,Dc=Array.isArray||function(e){return"[object Array]"==jc.call(e)};zc.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}();var Hc=zc.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function zc(e,t,r){return zc.TYPED_ARRAY_SUPPORT||this instanceof zc?"number"==typeof e?Wc(this,e):function(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(r<0||t.byteLength=Hc)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Hc.toString(16)+" bytes");return 0|e}function Fc(e,t){var r;return zc.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(t)).__proto__=zc.prototype:(null===(r=e)&&(r=new zc(t)),r.length=t),r}function Wc(e,t){var r=Fc(e,t<0?0:0|Gc(t));if(!zc.TYPED_ARRAY_SUPPORT)for(var n=0;n55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Kc(e){return zc.isBuffer(e)?e.length:"undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)?e.byteLength:("string"!=typeof e&&(e=""+e),0===e.length?0:Uc(e).length)}zc.TYPED_ARRAY_SUPPORT&&(zc.prototype.__proto__=Uint8Array.prototype,zc.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&zc[Symbol.species]===zc&&Object.defineProperty(zc,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),zc.prototype.write=function(e,t,r){void 0===t||void 0===r&&"string"==typeof t?(r=this.length,t=0):isFinite(t)&&(t|=0,isFinite(r)?r|=0:r=void 0);var n=this.length-t;if((void 0===r||r>n)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");return function(e,t,r,n){return function(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}(Uc(t,e.length-r),e,r,n)}(this,e,t,r)},zc.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!zc.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},Qc=function(e){return Xc[e]},$c=function(e){for(var t=0;0!==e;)t++,e>>>=1;return t},eu=function(){return void 0!==Vc},tu=function(e){return Vc(e)},ru=Object(y.b)((function(e,t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return r}}}));function nu(){this.buffer=[],this.length=0}ru.L,ru.M,ru.Q,ru.H,ru.isValid,nu.prototype={get:function(e){var t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(var r=0;r>>t-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var iu=nu;function ou(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=Zc(e*e),this.reservedBit=Zc(e*e)}ou.prototype.set=function(e,t,r,n){var i=e*this.size+t;this.data[i]=r,n&&(this.reservedBit[i]=!0)},ou.prototype.get=function(e,t){return this.data[e*this.size+t]},ou.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},ou.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var au=ou,su=Object(y.b)((function(e,t){var r=Jc;t.getRowColCoords=function(e){if(1===e)return[];for(var t=Math.floor(e/7)+2,n=r(e),i=145===n?26:2*Math.ceil((n-13)/(2*t-2)),o=[n-7],a=1;a=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){for(var t=e.size,r=0,n=0,i=0,o=null,a=null,s=0;s=5&&(r+=n-5+3),o=u,n=1),(u=e.get(c,s))===a?i++:(i>=5&&(r+=i-5+3),a=u,i=1)}n>=5&&(r+=n-5+3),i>=5&&(r+=i-5+3)}return r},t.getPenaltyN2=function(e){for(var t=e.size,r=0,n=0;n=10&&(1488===n||93===n)&&r++,i=i<<1&2047|e.get(a,o),a>=10&&(1488===i||93===i)&&r++}return 40*r},t.getPenaltyN4=function(e){for(var t=0,r=e.data.length,n=0;n=0;){for(var n=r[0],i=0;i0){var o=Zc(this.degree);return n.copy(o,i),o}return n};var Au=yu,wu=function(e){return!isNaN(e)&&e>=1&&e<=40},Eu="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",Su="(?:(?![A-Z0-9 $%*+\\-./:]|"+(Eu=Eu.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+",Mu=new RegExp(Eu,"g"),ku=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Ru=new RegExp(Su,"g"),Ou=new RegExp("[0-9]+","g"),xu=new RegExp("[A-Z $%*+\\-./:]+","g"),Iu=new RegExp("^"+Eu+"$"),_u=new RegExp("^[0-9]+$"),Cu=new RegExp("^[A-Z0-9 $%*+\\-./:]+$"),Tu={KANJI:Mu,BYTE_KANJI:ku,BYTE:Ru,NUMERIC:Ou,ALPHANUMERIC:xu,testKanji:function(e){return Iu.test(e)},testNumeric:function(e){return _u.test(e)},testAlphanumeric:function(e){return Cu.test(e)}},Lu=Object(y.b)((function(e,t){t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!wu(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return Tu.testNumeric(e)?t.NUMERIC:Tu.testAlphanumeric(e)?t.ALPHANUMERIC:Tu.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return r}}})),Bu=(Lu.NUMERIC,Lu.ALPHANUMERIC,Lu.BYTE,Lu.KANJI,Lu.MIXED,Lu.getCharCountIndicator,Lu.getBestModeForData,Lu.isValid,Object(y.b)((function(e,t){var r=$c(7973);function n(e,t){return Lu.getCharCountIndicator(e,t)+4}function i(e,t){var r=0;return e.forEach((function(e){var i=n(e.mode,t);r+=i+e.getBitsLength()})),r}t.from=function(e,t){return wu(e)?parseInt(e,10):t},t.getCapacity=function(e,t,r){if(!wu(e))throw new Error("Invalid QR Code version");void 0===r&&(r=Lu.BYTE);var i=8*(Qc(e)-du(e,t));if(r===Lu.MIXED)return i;var o=i-n(r,e);switch(r){case Lu.NUMERIC:return Math.floor(o/10*3);case Lu.ALPHANUMERIC:return Math.floor(o/11*2);case Lu.KANJI:return Math.floor(o/13);case Lu.BYTE:default:return Math.floor(o/8)}},t.getBestVersionForData=function(e,r){var n,o=ru.from(r,ru.M);if(Dc(e)){if(e.length>1)return function(e,r){for(var n=1;n<=40;n++)if(i(e,n)<=t.getCapacity(n,r,Lu.MIXED))return n}(e,o);if(0===e.length)return 1;n=e[0]}else n=e;return function(e,r,n){for(var i=1;i<=40;i++)if(r<=t.getCapacity(i,n,e))return i}(n.mode,n.getLength(),o)},t.getEncodedBits=function(e){if(!wu(e)||e<7)throw new Error("Invalid QR Code version");for(var t=e<<12;$c(t)-r>=0;)t^=7973<<$c(t)-r;return e<<12|t}}))),Nu=(Bu.getCapacity,Bu.getBestVersionForData,Bu.getEncodedBits,$c(1335));function Pu(e){this.mode=Lu.NUMERIC,this.data=e.toString()}Pu.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},Pu.prototype.getLength=function(){return this.data.length},Pu.prototype.getBitsLength=function(){return Pu.getBitsLength(this.data.length)},Pu.prototype.write=function(e){var t,r,n;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),n=parseInt(r,10),e.put(n,10);var i=this.data.length-t;i>0&&(r=this.data.substr(t),n=parseInt(r,10),e.put(n,3*i+1))};var ju=Pu,Du=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Hu(e){this.mode=Lu.ALPHANUMERIC,this.data=e}Hu.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},Hu.prototype.getLength=function(){return this.data.length},Hu.prototype.getBitsLength=function(){return Hu.getBitsLength(this.data.length)},Hu.prototype.write=function(e){var t;for(t=0;t+2<=this.data.length;t+=2){var r=45*Du.indexOf(this.data[t]);r+=Du.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(Du.indexOf(this.data[t]),6)};var zu=Hu;function Gu(e){this.mode=Lu.BYTE,this.data=qc(e)}Gu.getBitsLength=function(e){return 8*e},Gu.prototype.getLength=function(){return this.data.length},Gu.prototype.getBitsLength=function(){return Gu.getBitsLength(this.data.length)},Gu.prototype.write=function(e){for(var t=0,r=this.data.length;t=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13)}};var Yu=Wu,Uu=Object(y.b)((function(e){var t={single_source_shortest_paths:function(e,r,n){var i={},o={};o[r]=0;var a,s,c,u,f,h,d,l=t.PriorityQueue.make();for(l.push(r,0);!l.empty();)for(c in s=(a=l.pop()).value,u=a.cost,f=e[s]||{})f.hasOwnProperty(c)&&(h=u+f[c],d=o[c],(void 0===o[c]||d>h)&&(o[c]=h,l.push(c,h),i[c]=s));if(void 0!==n&&void 0===o[n]){var p=["Could not find a path from ",r," to ",n,"."].join("");throw new Error(p)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],n=t;n;)r.push(n),e[n],n=e[n];return r.reverse(),r},find_path:function(e,r,n){var i=t.single_source_shortest_paths(e,r,n);return t.extract_shortest_path_from_predecessor_list(i,n)},PriorityQueue:{make:function(e){var r,n=t.PriorityQueue,i={};for(r in e=e||{},n)n.hasOwnProperty(r)&&(i[r]=n[r]);return i.queue=[],i.sorter=e.sorter||n.default_sorter,i},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t})),Ku=Object(y.b)((function(e,t){function r(e){return unescape(encodeURIComponent(e)).length}function n(e,t,r){for(var n,i=[];null!==(n=e.exec(r));)i.push({data:n[0],index:n.index,mode:t,length:n[0].length});return i}function i(e){var t,r,i=n(Tu.NUMERIC,Lu.NUMERIC,e),o=n(Tu.ALPHANUMERIC,Lu.ALPHANUMERIC,e);return eu()?(t=n(Tu.BYTE,Lu.BYTE,e),r=n(Tu.KANJI,Lu.KANJI,e)):(t=n(Tu.BYTE_KANJI,Lu.BYTE,e),r=[]),i.concat(o,t,r).sort((function(e,t){return e.index-t.index})).map((function(e){return{data:e.data,mode:e.mode,length:e.length}}))}function o(e,t){switch(t){case Lu.NUMERIC:return ju.getBitsLength(e);case Lu.ALPHANUMERIC:return zu.getBitsLength(e);case Lu.KANJI:return Yu.getBitsLength(e);case Lu.BYTE:return Fu.getBitsLength(e)}}function a(e,t){var r,n=Lu.getBestModeForData(e);if((r=Lu.from(t,n))!==Lu.BYTE&&r.bit=0?e[e.length-1]:null;return r&&r.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)}),[])}(c))},t.rawSplit=function(e){return t.fromArray(i(e,eu()))}}));function Vu(e,t,r){var n,i,o=e.size,a=function(e,t){for(var r=e.bit<<3|t,n=r<<10;$c(n)-Nu>=0;)n^=1335<<$c(n)-Nu;return 21522^(r<<10|n)}(t,r);for(n=0;n<15;n++)i=1==(a>>n&1),n<6?e.set(n,8,i,!0):n<8?e.set(n+1,8,i,!0):e.set(o-15+n,8,i,!0),n<8?e.set(8,o-n-1,i,!0):n<9?e.set(8,15-n-1+1,i,!0):e.set(8,15-n-1,i,!0);e.set(o-8,8,1,!0)}function Zu(e,t,r){var n=new iu;r.forEach((function(t){n.put(t.mode.bit,4),n.put(t.getLength(),Lu.getCharCountIndicator(t.mode,e)),t.write(n)}));var i=8*(Qc(e)-du(e,t));for(n.getLengthInBits()+4<=i&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(0);for(var o=(i-n.getLengthInBits())/8,a=0;a=0&&s<=6&&(0===c||6===c)||c>=0&&c<=6&&(0===s||6===s)||s>=2&&s<=4&&c>=2&&c<=4?e.set(o+s,a+c,!0,!0):e.set(o+s,a+c,!1,!0))}(f,t),function(e){for(var t=e.size,r=8;r=7&&function(e,t){for(var r,n,i,o=e.size,a=Bu.getEncodedBits(t),s=0;s<18;s++)r=Math.floor(s/3),n=s%3+o-8-3,i=1==(a>>s&1),e.set(r,n,i,!0),e.set(n,r,i,!0)}(f,t),function(e,t){for(var r=e.size,n=-1,i=r-1,o=7,a=0,s=r-1;s>0;s-=2)for(6===s&&s--;;){for(var c=0;c<2;c++)if(!e.isReserved(i,s-c)){var u=!1;a>>o&1)),e.set(i,s-c,u),-1===--o&&(a++,o=7)}if((i+=n)<0||r<=i){i-=n,n=-n;break}}}(f,c),isNaN(n)&&(n=uu.getBestMask(f,Vu.bind(null,f,r))),uu.applyMask(n,f),Vu(f,r,n),{modules:f,version:t,errorCorrectionLevel:r,maskPattern:n,segments:i}}Ku.fromArray,Ku.fromString,Ku.rawSplit;var Xu=function(e,t){if(void 0===e||""===e)throw new Error("No input text");var r,n,i=ru.M;return void 0!==t&&(i=ru.from(t.errorCorrectionLevel,ru.M),r=Bu.from(t.version),n=uu.from(t.maskPattern),t.toSJISFunc&&function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');Vc=e}(t.toSJISFunc)),qu(e,r,i,n)},Ju=Object(y.b)((function(e,t){function r(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");var t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map((function(e){return[e,e]})))),6===t.length&&t.push("F","F");var r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});var t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,n=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:n,scale:n?4:i,margin:t,color:{dark:r(e.color.dark||"#000000ff"),light:r(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,r){var n=t.getScale(e,r);return Math.floor((e+2*r.margin)*n)},t.qrToImageData=function(e,r,n){for(var i=r.modules.size,o=r.modules.data,a=t.getScale(i,n),s=Math.floor((i+2*n.margin)*a),c=n.margin*a,u=[n.color.light,n.color.dark],f=0;f=c&&h>=c&&f':"",c="0&&c>0&&e[s-1]||(n+=o?ef("M",c+r,.5+u+r):ef("m",i,0),i=0,o=!1),c+1',u='viewBox="0 0 '+a+" "+a+'"',f=''+s+c+"\n";return"function"==typeof r&&r(null,f),f}(e,r)}))},hf={},df=[],lf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function pf(e,t){for(var r in t)e[r]=t[r];return e}function bf(e){var t=e.parentNode;t&&t.removeChild(e)}function vf(e,t,r){var n,i=arguments,o={};for(n in t)"key"!==n&&"ref"!==n&&(o[n]=t[n]);if(arguments.length>3)for(r=[r],n=3;n2&&(t.children=df.slice.call(arguments,2)),r={},t)"key"!==n&&"ref"!==n&&(r[n]=t[n]);return gf(e.type,r,t.key||e.key,t.ref||e.ref,null)}rf={__e:function(e,t){for(var r,n;t=t.__;)if((r=t.__c)&&!r.__)try{if(r.constructor&&null!=r.constructor.getDerivedStateFromError&&(n=!0,r.setState(r.constructor.getDerivedStateFromError(e))),null!=r.componentDidCatch&&(n=!0,r.componentDidCatch(e)),n)return Ef(r.__E=r)}catch(t){e=t}throw e}},yf.prototype.setState=function(e,t){var r;r=this.__s!==this.state?this.__s:this.__s=pf({},this.state),"function"==typeof e&&(e=e(r,this.props)),e&&pf(r,e),null!=e&&this.__v&&(t&&this.__h.push(t),Ef(this))},yf.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ef(this))},yf.prototype.render=mf,nf=[],of=0,af="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,cf=hf,uf=0;var Pf,jf,Df,Hf=0,zf=[],Gf=rf.__r,Ff=rf.diffed,Wf=rf.__c,Yf=rf.unmount;function Uf(e,t){rf.__h&&rf.__h(jf,e,Hf||t),Hf=0;var r=jf.__H||(jf.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Kf(e,t,r){var n=Uf(Pf++,2);return n.__c||(n.__c=jf,n.__=[r?r(t):$f(void 0,t),function(t){var r=e(n.__[0],t);n.__[0]!==r&&(n.__[0]=r,n.__c.setState({}))}]),n.__}function Vf(e,t){var r=Uf(Pf++,4);!rf.__s&&Qf(r.__H,t)&&(r.__=e,r.__H=t,jf.__h.push(r))}function Zf(e,t){var r=Uf(Pf++,7);return Qf(r.__H,t)?(r.__H=t,r.__h=e,r.__=e()):r.__}function qf(){zf.some((function(e){if(e.__P)try{e.__H.__h.forEach(Xf),e.__H.__h.forEach(Jf),e.__H.__h=[]}catch(t){return e.__H.__h=[],rf.__e(t,e.__v),!0}})),zf=[]}function Xf(e){e.t&&e.t()}function Jf(e){var t=e.__();"function"==typeof t&&(e.t=t)}function Qf(e,t){return!e||t.some((function(t,r){return t!==e[r]}))}function $f(e,t){return"function"==typeof t?t(e):t}function eh(e,t){for(var r in t)e[r]=t[r];return e}function th(e,t){for(var r in e)if("__source"!==r&&!(r in t))return!0;for(var n in t)if("__source"!==n&&e[n]!==t[n])return!0;return!1}rf.__r=function(e){Gf&&Gf(e),Pf=0,(jf=e.__c).__H&&(jf.__H.__h.forEach(Xf),jf.__H.__h.forEach(Jf),jf.__H.__h=[])},rf.diffed=function(e){Ff&&Ff(e);var t=e.__c;if(t){var r=t.__H;r&&r.__h.length&&(1!==zf.push(t)&&Df===rf.requestAnimationFrame||((Df=rf.requestAnimationFrame)||function(e){var t,r=function(){clearTimeout(n),cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);"undefined"!=typeof window&&(t=requestAnimationFrame(r))})(qf))}},rf.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Xf),e.__h=e.__h.filter((function(e){return!e.__||Jf(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],rf.__e(r,e.__v)}})),Wf&&Wf(e,t)},rf.unmount=function(e){Yf&&Yf(e);var t=e.__c;if(t){var r=t.__H;if(r)try{r.__.forEach((function(e){return e.t&&e.t()}))}catch(e){rf.__e(e,t.__v)}}};var rh=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).isPureReactComponent=!0,r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.prototype.shouldComponentUpdate=function(e,t){return th(this.props,e)||th(this.state,t)},n}(yf),nh=rf.__b;rf.__b=function(e){e.type&&e.type.t&&e.ref&&(e.props.ref=e.ref,e.ref=null),nh&&nh(e)};var ih=function(e,t){return e?kf(e).reduce((function(e,r,n){return e.concat(t(r,n))}),[]):null},oh={map:ih,forEach:ih,count:function(e){return e?kf(e).length:0},only:function(e){if(1!==(e=kf(e)).length)throw new Error("Children.only() expects only one child.");return e[0]},toArray:kf},ah=rf.__e;function sh(e){return e&&((e=eh({},e)).__c=null,e.__k=e.__k&&e.__k.map(sh)),e}function ch(){this.__u=0,this.o=null,this.__b=null}function uh(e){var t=e.__.__c;return t&&t.u&&t.u(e)}function fh(){this.i=null,this.l=null}rf.__e=function(e,t,r){if(e.then)for(var n,i=t;i=i.__;)if((n=i.__c)&&n.__c)return n.__c(e,t.__c);ah(e,t,r)},(ch.prototype=new yf).__c=function(e,t){var r=this;null==r.o&&(r.o=[]),r.o.push(t);var n=uh(r.__v),i=!1,o=function(){i||(i=!0,n?n(a):a())};t.__c=t.componentWillUnmount,t.componentWillUnmount=function(){o(),t.__c&&t.__c()};var a=function(){var e;if(!--r.__u)for(r.__v.__k[0]=r.state.u,r.setState({u:r.__b=null});e=r.o.pop();)e.forceUpdate()};r.__u++||r.setState({u:r.__b=r.__v.__k[0]}),e.then(o,o)},ch.prototype.render=function(e,t){return this.__b&&(this.__v.__k[0]=sh(this.__b),this.__b=null),[vf(yf,null,t.u?null:e.children),t.u&&e.fallback]};var hh=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]8?2.5:2.7)+"vw"},className:"walletconnect-connect__button__text"},n))}function _h(e){var t=e.href.split("?")[0];pe.setLocal(pe.mobileLinkChoiceKey,Object.assign({},e,{href:t}))}function Ch(e){var t=pe.isIOS(),r=function(e){var t=Rh;return e&&e.mobileLinks&&e.mobileLinks.length&&(t=e.mobileLinks.map((function(e){return function(e){return Rh.filter((function(t){return t.name.toLowerCase().includes(e)}))[0]}(e)}))),t}(e.qrcodeModalOptions),n=Sh.useState(!1),i=n[0],o=n[1],a=r.length>5,s=r.length>12;return Sh.createElement("div",null,Sh.createElement("p",{id:"walletconnect-qrcode-text",className:"walletconnect-qrcode__text"},t?e.text.choose_preferred_wallet:e.text.connect_mobile_wallet),Sh.createElement("div",{className:"walletconnect-connect__buttons__wrapper"+(t?a?"__wrap":"":"__android")},t?r.map((function(t,r){var n=t.color,o=t.name,s=t.shortName,c=t.logo,u=function(e,t){var r=encodeURIComponent(e);return t.universalLink?t.universalLink+"/wc?uri="+r:t.deepLink?t.deepLink+(t.deepLink.endsWith(":")?"//":"/")+"wc?uri="+r:""}(e.uri,t),f=Sh.useCallback((function(){_h({name:o,href:u})}),[]);if(!(r>11)||i)return a?Sh.createElement(Ih,{color:n,href:u,name:s,logo:c,onClick:f}):Sh.createElement(xh,{color:n,href:u,name:o,logo:c,onClick:f})})):Sh.createElement(Oh,{name:e.text.connect,color:"rgb(64, 153, 255)",href:e.uri,onClick:Sh.useCallback((function(){_h({name:"Unknown",href:e.uri})}),[])})),!(!t||!s)&&Sh.createElement("div",{className:"walletconnect-modal__footer"},Sh.createElement("a",{onClick:function(){return o(!i)}},i?e.text.show_less:e.text.show_more)))}function Th(e){var t=!!e.message.trim();return Sh.createElement("div",{className:"walletconnect-qrcode__notification"+(t?" notification__show":"")},e.message)}function Lh(e){var t=Sh.useState(""),r=t[0],n=t[1],i=Sh.useState(""),o=i[0],a=i[1];return Sh.useEffect((function(){try{return Promise.resolve(function(e){try{var t="";return Promise.resolve(Mh.toString(e,{margin:0,type:"svg"})).then((function(e){return"string"==typeof e&&(t=e.replace("=0)return this._url=this._parseUrl(t.headers.location),this._method="GET",this._loweredHeaders["content-type"]&&(delete this._headers[this._loweredHeaders["content-type"]],delete this._loweredHeaders["content-type"]),null!=this._headers["Content-Type"]&&delete this._headers["Content-Type"],delete this._headers["Content-Length"],this.upload._reset(),this._finalizeHeaders(),void this._sendHxxpRequest();this._response=t,this._response.on("data",(function(e){return n._onHttpResponseData(t,e)})),this._response.on("end",(function(){return n._onHttpResponseEnd(t)})),this._response.on("close",(function(){return n._onHttpResponseClose(t)})),this.responseUrl=this._url.href.split("#")[0],this.status=t.statusCode,this.statusText=M.a.STATUS_CODES[this.status],this._parseResponseHeaders(t);var i=this._responseHeaders["content-length"]||"";this._totalBytes=+i,this._lengthComputable=!!i,this._setReadyState(r.HEADERS_RECEIVED)}},r.prototype._onHttpResponseData=function(e,t){this._response===e&&(this._responseParts.push(new n(t)),this._loadedBytes+=t.length,this.readyState!==r.LOADING&&this._setReadyState(r.LOADING),this._dispatchProgress("progress"))},r.prototype._onHttpResponseEnd=function(e){this._response===e&&(this._parseResponse(),this._request=null,this._response=null,this._setReadyState(r.DONE),this._dispatchProgress("load"),this._dispatchProgress("loadend"))},r.prototype._onHttpResponseClose=function(e){if(this._response===e){var t=this._request;this._setError(),t.abort(),this._setReadyState(r.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend")}},r.prototype._onHttpTimeout=function(e){this._request===e&&(this._setError(),e.abort(),this._setReadyState(r.DONE),this._dispatchProgress("timeout"),this._dispatchProgress("loadend"))},r.prototype._onHttpRequestError=function(e,t){this._request===e&&(this._setError(),e.abort(),this._setReadyState(r.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend"))},r.prototype._dispatchProgress=function(e){var t=new r.ProgressEvent(e);t.lengthComputable=this._lengthComputable,t.loaded=this._loadedBytes,t.total=this._totalBytes,this.dispatchEvent(t)},r.prototype._setError=function(){this._request=null,this._response=null,this._responseHeaders=null,this._responseParts=null},r.prototype._parseUrl=function(e,t,r){var n=null==this.nodejsBaseUrl?e:E.a.resolve(this.nodejsBaseUrl,e),i=E.a.parse(n,!1,!0);i.hash=null;var o=(i.auth||"").split(":"),a=o[0],s=o[1];return(a||s||t||r)&&(i.auth=(t||a||"")+":"+(r||s||"")),i},r.prototype._parseResponseHeaders=function(e){for(var t in this._responseHeaders={},e.headers){var r=t.toLowerCase();this._privateHeaders[r]||(this._responseHeaders[r]=e.headers[t])}null!=this._mimeOverride&&(this._responseHeaders["content-type"]=this._mimeOverride)},r.prototype._parseResponse=function(){var e=n.concat(this._responseParts);switch(this._responseParts=null,this.responseType){case"json":this.responseText=null;try{this.response=JSON.parse(e.toString("utf-8"))}catch(e){this.response=null}return;case"buffer":return this.responseText=null,void(this.response=e);case"arraybuffer":this.responseText=null;for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),i=0;i2&&void 0!==arguments[2]?arguments[2]:-1;return{error:{message:t,code:r},id:e.id,jsonrpc:e.jsonrpc}}},{key:"send",value:function(e,t){var n=this;return new Promise((function(i){if("eth_subscribe"===e.method){var o=n.formatError(e,"Subscriptions are not supported by this HTTP endpoint");return n.emit("error",o),i(o)}var a=new r,s=!1,c=function(r,o){if(!s)if(a.abort(),s=!0,t)t(r,o);else{var c=e.id,u=e.jsonrpc,f=r?{id:c,jsonrpc:u,error:{message:r.message,code:r.code}}:{id:c,jsonrpc:u,result:o};n.emit("payload",f),i(f)}};a.open("POST",n.url,!0),a.setRequestHeader("Content-Type","application/json"),a.timeout=6e4,a.onerror=c,a.ontimeout=c,a.onreadystatechange=function(){if(4===a.readyState)try{var t=JSON.parse(a.responseText);c(t.error,t.result)}catch(e){c(e)}},a.send(JSON.stringify(e))}))}}]),n}(y.g.EventEmitter);t.default=n}));Object(y.c)(Vh);var Zh=xe.Buffer,qh=A.b.Transform,Xh=xe.Buffer,Jh=A.b.Transform,Qh=[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],$h=function(e){for(var t=0;t<24;++t){var r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],o=e[3]^e[13]^e[23]^e[33]^e[43],a=e[4]^e[14]^e[24]^e[34]^e[44],s=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],h=e[9]^e[19]^e[29]^e[39]^e[49],d=f^(i<<1|o>>>31),l=h^(o<<1|i>>>31),p=e[0]^d,b=e[1]^l,v=e[10]^d,g=e[11]^l,m=e[20]^d,y=e[21]^l,A=e[30]^d,w=e[31]^l,E=e[40]^d,S=e[41]^l;d=r^(a<<1|s>>>31),l=n^(s<<1|a>>>31);var M=e[2]^d,k=e[3]^l,R=e[12]^d,O=e[13]^l,x=e[22]^d,I=e[23]^l,_=e[32]^d,C=e[33]^l,T=e[42]^d,L=e[43]^l;d=i^(c<<1|u>>>31),l=o^(u<<1|c>>>31);var B=e[4]^d,N=e[5]^l,P=e[14]^d,j=e[15]^l,D=e[24]^d,H=e[25]^l,z=e[34]^d,G=e[35]^l,F=e[44]^d,W=e[45]^l;d=a^(f<<1|h>>>31),l=s^(h<<1|f>>>31);var Y=e[6]^d,U=e[7]^l,K=e[16]^d,V=e[17]^l,Z=e[26]^d,q=e[27]^l,X=e[36]^d,J=e[37]^l,Q=e[46]^d,$=e[47]^l;d=c^(r<<1|n>>>31),l=u^(n<<1|r>>>31);var ee=e[8]^d,te=e[9]^l,re=e[18]^d,ne=e[19]^l,ie=e[28]^d,oe=e[29]^l,ae=e[38]^d,se=e[39]^l,ce=e[48]^d,ue=e[49]^l,fe=p,he=b,de=g<<4|v>>>28,le=v<<4|g>>>28,pe=m<<3|y>>>29,be=y<<3|m>>>29,ve=w<<9|A>>>23,ge=A<<9|w>>>23,me=E<<18|S>>>14,ye=S<<18|E>>>14,Ae=M<<1|k>>>31,we=k<<1|M>>>31,Ee=O<<12|R>>>20,Se=R<<12|O>>>20,Me=x<<10|I>>>22,ke=I<<10|x>>>22,Re=C<<13|_>>>19,Oe=_<<13|C>>>19,xe=T<<2|L>>>30,Ie=L<<2|T>>>30,_e=N<<30|B>>>2,Ce=B<<30|N>>>2,Te=P<<6|j>>>26,Le=j<<6|P>>>26,Be=H<<11|D>>>21,Ne=D<<11|H>>>21,Pe=z<<15|G>>>17,je=G<<15|z>>>17,De=W<<29|F>>>3,He=F<<29|W>>>3,ze=Y<<28|U>>>4,Ge=U<<28|Y>>>4,Fe=V<<23|K>>>9,We=K<<23|V>>>9,Ye=Z<<25|q>>>7,Ue=q<<25|Z>>>7,Ke=X<<21|J>>>11,Ve=J<<21|X>>>11,Ze=$<<24|Q>>>8,qe=Q<<24|$>>>8,Xe=ee<<27|te>>>5,Je=te<<27|ee>>>5,Qe=re<<20|ne>>>12,$e=ne<<20|re>>>12,et=oe<<7|ie>>>25,tt=ie<<7|oe>>>25,rt=ae<<8|se>>>24,nt=se<<8|ae>>>24,it=ce<<14|ue>>>18,ot=ue<<14|ce>>>18;e[0]=fe^~Ee&Be,e[1]=he^~Se&Ne,e[10]=ze^~Qe&pe,e[11]=Ge^~$e&be,e[20]=Ae^~Te&Ye,e[21]=we^~Le&Ue,e[30]=Xe^~de&Me,e[31]=Je^~le&ke,e[40]=_e^~Fe&et,e[41]=Ce^~We&tt,e[2]=Ee^~Be&Ke,e[3]=Se^~Ne&Ve,e[12]=Qe^~pe&Re,e[13]=$e^~be&Oe,e[22]=Te^~Ye&rt,e[23]=Le^~Ue&nt,e[32]=de^~Me&Pe,e[33]=le^~ke&je,e[42]=Fe^~et&ve,e[43]=We^~tt&ge,e[4]=Be^~Ke&it,e[5]=Ne^~Ve&ot,e[14]=pe^~Re&De,e[15]=be^~Oe&He,e[24]=Ye^~rt&me,e[25]=Ue^~nt&ye,e[34]=Me^~Pe&Ze,e[35]=ke^~je&qe,e[44]=et^~ve&xe,e[45]=tt^~ge&Ie,e[6]=Ke^~it&fe,e[7]=Ve^~ot&he,e[16]=Re^~De&ze,e[17]=Oe^~He&Ge,e[26]=rt^~me&Ae,e[27]=nt^~ye&we,e[36]=Pe^~Ze&Xe,e[37]=je^~qe&Je,e[46]=ve^~xe&_e,e[47]=ge^~Ie&Ce,e[8]=it^~fe&Ee,e[9]=ot^~he&Se,e[18]=De^~ze&Qe,e[19]=He^~Ge&$e,e[28]=me^~Ae&Te,e[29]=ye^~we&Le,e[38]=Ze^~Xe&de,e[39]=qe^~Je&le,e[48]=xe^~_e&Fe,e[49]=Ie^~Ce&We,e[0]^=Qh[2*t],e[1]^=Qh[2*t+1]}},ed=xe.Buffer;function td(){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}td.prototype.initialize=function(e,t){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},td.prototype.absorb=function(e){for(var t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&($h(this.state),this.count=0);return t},td.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var rd=function(e){var t=function(e){function t(t,r,n,i,o){qh.call(this,o),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=i,this._options=o,this._state=new e,this._state.initialize(t,r),this._finalized=!1}return Te(t,qh),t.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},t.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},t.prototype.update=function(e,t){if(!Zh.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Zh.isBuffer(e)||(e=Zh.from(e,t)),this._state.absorb(e),this},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}(e),r=function(e){function t(t,r,n,i){Jh.call(this,i),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._options=i,this._state=new e,this._state.initialize(t,r),this._finalized=!1}return Te(t,Jh),t.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},t.prototype._flush=function(){},t.prototype._read=function(e){this.push(this.squeeze(e))},t.prototype.update=function(e,t){if(!Xh.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Xh.isBuffer(e)||(e=Xh.from(e,t)),this._state.absorb(e),this},t.prototype.squeeze=function(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}(e);return function(e,n){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new t(1152,448,null,224,n);case"keccak256":return new t(1088,512,null,256,n);case"keccak384":return new t(832,768,null,384,n);case"keccak512":return new t(576,1024,null,512,n);case"sha3-224":return new t(1152,448,6,224,n);case"sha3-256":return new t(1088,512,6,256,n);case"sha3-384":return new t(832,768,6,384,n);case"sha3-512":return new t(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+e)}}}(td),nd=Object(y.b)((function(e,t){function r(e,t){if("00"===e.slice(0,2))throw new Error("invalid RLP: extra zeros");return parseInt(e,t)}function i(e,t){if(e<56)return n.from([e+t]);var r=a(e),i=a(t+55+r.length/2);return n.from(i+r,"hex")}function o(e){return"0x"===e.slice(0,2)}function a(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");var t=e.toString(16);return t.length%2?"0"+t:t}function s(e){if(!n.isBuffer(e)){if("string"==typeof e)return o(e)?n.from(function(e){return e.length%2?"0"+e:e}(function(e){return"string"!=typeof e?e:o(e)?e.slice(2):e}(e)),"hex"):n.from(e);if("number"==typeof e||"bigint"==typeof e)return e?(t=a(e),n.from(t,"hex")):n.from([]);if(null==e)return n.from([]);if(e instanceof Uint8Array)return n.from(e);if(is.isBN(e))return n.from(e.toArray());throw new Error("invalid type")}var t;return e}Object.defineProperty(t,"__esModule",{value:!0}),t.getLength=t.decode=t.encode=void 0,t.encode=function e(t){if(Array.isArray(t)){for(var r=[],o=0;ot.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(s=t.slice(o,h)).length)throw new Error("invalid rlp, List has a invalid length");for(;s.length;)c=e(s),u.push(c.data),s=c.remainder;return{data:u,remainder:t.slice(h)}}(s(e));if(t)return i;if(0!==i.remainder.length)throw new Error("invalid remainder");return i.data},t.getLength=function(e){if(!e||0===e.length)return n.from([]);var t=s(e),i=t[0];if(i<=127)return t.length;if(i<=183)return i-127;if(i<=191)return i-182;if(i<=247)return i-191;var o=i-246;return o+r(t.slice(1,o).toString("hex"),16)}}));Object(y.c)(nd),nd.getLength,nd.decode,nd.encode;var id=function(e){if("string"!=typeof e)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof e+", while checking isHexPrefixed.");return"0x"===e.slice(0,2)},od=function(e){return"string"!=typeof e?e:id(e)?e.slice(2):e};function ad(e){var t=e;if("string"!=typeof t)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof t+", while padToEven.");return t.length%2&&(t="0"+t),t}function sd(e){return"0x"+e.toString(16)}var cd={arrayContainsArray:function(e,t,r){if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof e+"'");if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof t+"'");return t[Boolean(r)?"some":"every"]((function(t){return e.indexOf(t)>=0}))},intToBuffer:function(e){var t=sd(e);return new n(ad(t.slice(2)),"hex")},getBinarySize:function(e){if("string"!=typeof e)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof e+"'.");return n.byteLength(e,"utf8")},isHexPrefixed:id,stripHexPrefix:od,padToEven:ad,intToHex:sd,fromAscii:function(e){for(var t="",r=0;r0&&"0"===r.toString();)r=(e=e.slice(1))[0];return e},t.toBuffer=function(e){if(!n.isBuffer(e))if(Array.isArray(e))e=n.from(e);else if("string"==typeof e)e=t.isHexString(e)?n.from(t.padToEven(t.stripHexPrefix(e)),"hex"):n.from(e);else if("number"==typeof e)e=t.intToBuffer(e);else if(null==e)e=n.allocUnsafe(0);else if(is.isBN(e))e=e.toArrayLike(n);else{if(!e.toArray)throw new Error("invalid type");e=n.from(e.toArray())}return e},t.bufferToInt=function(e){return new is(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new is(e).fromTwos(256)},t.toUnsigned=function(e){return n.from(e.toTwos(256).toArray())},t.keccak=function(e,r){return e=t.toBuffer(e),r||(r=256),rd("keccak"+r).update(e).digest()},t.keccak256=function(e){return t.keccak(e)},t.sha3=t.keccak,t.sha256=function(e){return e=t.toBuffer(e),ns("sha256").update(e).digest()},t.ripemd160=function(e,r){e=t.toBuffer(e);var n=ns("rmd160").update(e).digest();return!0===r?t.setLength(n,32):n},t.rlphash=function(e){return t.keccak(nd.encode(e))},t.isValidPrivate=function(e){return Sc.privateKeyVerify(e)},t.isValidPublic=function(e,t){return 64===e.length?Sc.publicKeyVerify(n.concat([n.from([4]),e])):!!t&&Sc.publicKeyVerify(e)},t.pubToAddress=t.publicToAddress=function(e,r){return e=t.toBuffer(e),r&&64!==e.length&&(e=Sc.publicKeyConvert(e,!1).slice(1)),Object(w.b)(64===e.length),t.keccak(e).slice(-20)};var i=t.privateToPublic=function(e){return e=t.toBuffer(e),Sc.publicKeyCreate(e,!1).slice(1)};t.importPublic=function(e){return 64!==(e=t.toBuffer(e)).length&&(e=Sc.publicKeyConvert(e,!1).slice(1)),e},t.ecsign=function(e,t){var r=Sc.sign(e,t),n={};return n.r=r.signature.slice(0,32),n.s=r.signature.slice(32,64),n.v=r.recovery+27,n},t.hashPersonalMessage=function(e){var r=t.toBuffer("\x19Ethereum Signed Message:\n"+e.length.toString());return t.keccak(n.concat([r,e]))},t.ecrecover=function(e,r,i,o){var a=n.concat([t.setLength(i,32),t.setLength(o,32)],64),s=r-27;if(0!==s&&1!==s)throw new Error("Invalid signature v value");var c=Sc.recover(e,a,s);return Sc.publicKeyConvert(c,!1).slice(1)},t.toRpcSig=function(e,r,i){if(27!==e&&28!==e)throw new Error("Invalid recovery id");return t.bufferToHex(n.concat([t.setLengthLeft(r,32),t.setLengthLeft(i,32),t.toBuffer(e-27)]))},t.fromRpcSig=function(e){if(65!==(e=t.toBuffer(e)).length)throw new Error("Invalid signature length");var r=e[64];return r<27&&(r+=27),{v:r,r:e.slice(0,32),s:e.slice(32,64)}},t.privateToAddress=function(e){return t.publicToAddress(i(e))},t.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)},t.isZeroAddress=function(e){return t.zeroAddress()===t.addHexPrefix(e)},t.toChecksumAddress=function(e){e=t.stripHexPrefix(e).toLowerCase();for(var r=t.keccak(e).toString("hex"),n="0x",i=0;i=8?n+=e[i].toUpperCase():n+=e[i];return n},t.isValidChecksumAddress=function(e){return t.isValidAddress(e)&&t.toChecksumAddress(e)===e},t.generateAddress=function(e,r){return e=t.toBuffer(e),r=(r=new is(r)).isZero()?null:n.from(r.toArray()),t.rlphash([e,r]).slice(-20)},t.isPrecompiled=function(e){var r=t.unpad(e);return 1===r.length&&r[0]>=1&&r[0]<=8},t.addHexPrefix=function(e){return"string"!=typeof e||t.isHexPrefixed(e)?e:"0x"+e},t.isValidSignature=function(e,t,r,n){var i=new is("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),o=new is("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===t.length&&32===r.length&&(27===e||28===e)&&(t=new is(t),r=new is(r),!(t.isZero()||t.gt(o)||r.isZero()||r.gt(o))&&(!1!==n||1!==new is(r).cmp(i)))},t.baToJSON=function(e){if(n.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var r=[],i=0;i=o.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===o.length||!r.length||Object(w.b)(r.length===o.length,"The field "+r.name+" must have byte length of "+r.length),e.raw[i]=o}e._fields.push(r.name),Object.defineProperty(e,r.name,{enumerable:!0,configurable:!0,get:o,set:a}),r.default&&(e[r.name]=r.default),r.alias&&Object.defineProperty(e,r.alias,{enumerable:!1,configurable:!0,set:a,get:o})})),o)if("string"==typeof o&&(o=n.from(t.stripHexPrefix(o),"hex")),n.isBuffer(o)&&(o=nd.decode(o)),Array.isArray(o)){if(o.length>e._fields.length)throw new Error("wrong number of fields in data");o.forEach((function(r,n){e[e._fields[n]]=t.toBuffer(r)}))}else{if("object"!==(void 0===o?"undefined":r(o)))throw new Error("invalid data");var a=Object.keys(o);i.forEach((function(t){-1!==a.indexOf(t.name)&&(e[t.name]=o[t.name]),-1!==a.indexOf(t.alias)&&(e[t.alias]=o[t.alias])}))}}}));ud.MAX_INTEGER,ud.TWO_POW256,ud.KECCAK256_NULL_S,ud.SHA3_NULL_S,ud.KECCAK256_NULL,ud.SHA3_NULL,ud.KECCAK256_RLP_ARRAY_S,ud.SHA3_RLP_ARRAY_S,ud.KECCAK256_RLP_ARRAY,ud.SHA3_RLP_ARRAY,ud.KECCAK256_RLP_S,ud.SHA3_RLP_S,ud.KECCAK256_RLP,ud.SHA3_RLP,ud.BN,ud.rlp,ud.secp256k1,ud.zeros,ud.zeroAddress,ud.setLengthLeft,ud.setLength,ud.setLengthRight,ud.unpad,ud.stripZeros,ud.toBuffer,ud.bufferToInt,ud.bufferToHex,ud.fromSigned,ud.toUnsigned,ud.keccak,ud.keccak256,ud.sha3,ud.sha256,ud.ripemd160,ud.rlphash,ud.isValidPrivate,ud.isValidPublic,ud.pubToAddress,ud.publicToAddress,ud.privateToPublic,ud.importPublic,ud.ecsign,ud.hashPersonalMessage,ud.ecrecover,ud.toRpcSig,ud.fromRpcSig,ud.privateToAddress,ud.isValidAddress,ud.isZeroAddress,ud.toChecksumAddress,ud.isValidChecksumAddress,ud.generateAddress,ud.isPrecompiled,ud.addHexPrefix,ud.isValidSignature,ud.baToJSON,ud.defineProperties;var fd=function(e,t){return function(){for(var r=this,n=t.promiseModule,i=new Array(arguments.length),o=0;o0&&a.length>i&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,s=c,console&&console.warn&&console.warn(s)}return e}function Id(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=Id.bind(n);return i.listener=r,n.wrapFn=i,i}function Cd(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)wd(s,this,t);else{var c=s.length,u=Ld(s,c);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},Sd.prototype.listeners=function(e){return Cd(this,e,!0)},Sd.prototype.rawListeners=function(e){return Cd(this,e,!1)},Sd.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):Td.call(e,t)},Sd.prototype.listenerCount=Td,Sd.prototype.eventNames=function(){return this._eventsCount>0?yd(this._events):[]};var Bd="object"==typeof Reflect?Reflect:null,Nd=Bd&&"function"==typeof Bd.apply?Bd.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)},Pd=jd;function jd(){Md.call(this)}function Dd(e,t,r){try{Nd(e,t,r)}catch(e){setTimeout((function(){throw e}))}}function Hd(e,t){for(var r=new Array(t),n=0;n0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)Dd(s,this,t);else{var c=s.length,u=Hd(s,c);for(r=0;r0&&void 0!==arguments[0]?arguments[0]:{};if(Object(d.a)(this,r),!n.provider)throw new Error("PollingBlockTracker - no provider specified.");var i=n.pollingInterval||2e4,o=n.retryTimeout||i/10,a=void 0===n.keepEventLoopActive||n.keepEventLoopActive,s=n.setSkipCacheFlag||!1;return(e=t.call(this,Object.assign({blockResetDuration:i},n)))._provider=n.provider,e._pollingInterval=i,e._retryTimeout=o,e._keepEventLoopActive=a,e._setSkipCacheFlag=s,e}return Object(l.a)(r,[{key:"checkForLatestBlock",value:function(){var e=Object(a.a)(m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._updateLatestBlock();case 2:return e.next=4,this.getLatestBlock();case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_start",value:function(){var e=this;this._performSync().catch((function(t){return e.emit("error",t)}))}},{key:"_performSync",value:function(){var e=Object(a.a)(m.a.mark((function e(){var t;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isRunning){e.next=16;break}return e.prev=1,e.next=4,this._updateLatestBlock();case 4:return e.next=6,Yd(this._pollingInterval,!this._keepEventLoopActive);case 6:e.next=14;break;case 8:e.prev=8,e.t0=e.catch(1),t=new Error("PollingBlockTracker - encountered an error while attempting to update latest block:\n".concat(e.t0.stack));try{this.emit("error",t)}catch(yc){console.error(t)}return e.next=14,Yd(this._retryTimeout,!this._keepEventLoopActive);case 14:e.next=0;break;case 16:case"end":return e.stop()}}),e,this,[[1,8]])})));return function(){return e.apply(this,arguments)}}()},{key:"_updateLatestBlock",value:function(){var e=Object(a.a)(m.a.mark((function e(){var t;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._fetchLatestBlock();case 2:t=e.sent,this._newPotentialLatest(t);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_fetchLatestBlock",value:function(){var e=Object(a.a)(m.a.mark((function e(){var t,r,n=this;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={jsonrpc:"2.0",id:1,method:"eth_blockNumber",params:[]},this._setSkipCacheFlag&&(t.skipCache=!0),e.next=4,hd((function(e){return n._provider.sendAsync(t,e)}))();case 4:if(!(r=e.sent).error){e.next=7;break}throw new Error("PollingBlockTracker - encountered error fetching block:\n".concat(r.error));case 7:return e.abrupt("return",r.result);case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),r}(function(e){Object(f.a)(r,e);var t=Object(h.a)(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(d.a)(this,r),(e=t.call(this))._blockResetDuration=n.blockResetDuration||2e4,e._blockResetTimeout,e._currentBlock=null,e._isRunning=!1,e._onNewListener=e._onNewListener.bind(Object(s.a)(e)),e._onRemoveListener=e._onRemoveListener.bind(Object(s.a)(e)),e._resetCurrentBlock=e._resetCurrentBlock.bind(Object(s.a)(e)),e._setupInternalEvents(),e}return Object(l.a)(r,[{key:"isRunning",value:function(){return this._isRunning}},{key:"getCurrentBlock",value:function(){return this._currentBlock}},{key:"getLatestBlock",value:function(){var e=Object(a.a)(m.a.mark((function e(){var t=this;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._currentBlock){e.next=2;break}return e.abrupt("return",this._currentBlock);case 2:return e.next=4,new Promise((function(e){return t.once("latest",e)}));case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"removeAllListeners",value:function(e){e?Object(c.a)(Object(u.a)(r.prototype),"removeAllListeners",this).call(this,e):Object(c.a)(Object(u.a)(r.prototype),"removeAllListeners",this).call(this),this._setupInternalEvents(),this._onRemoveListener()}},{key:"_start",value:function(){}},{key:"_end",value:function(){}},{key:"_setupInternalEvents",value:function(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}},{key:"_onNewListener",value:function(e,t){Gd.includes(e)&&this._maybeStart()}},{key:"_onRemoveListener",value:function(e,t){this._getBlockTrackerEventCount()>0||this._maybeEnd()}},{key:"_maybeStart",value:function(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),this._start())}},{key:"_maybeEnd",value:function(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),this._end())}},{key:"_getBlockTrackerEventCount",value:function(){var e=this;return Gd.map((function(t){return e.listenerCount(t)})).reduce(zd)}},{key:"_newPotentialLatest",value:function(e){var t=this._currentBlock;t&&Fd(e)<=Fd(t)||this._setCurrentBlock(e)}},{key:"_setCurrentBlock",value:function(e){var t=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:t,newBlock:e})}},{key:"_setupBlockResetTimeout",value:function(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}},{key:"_cancelBlockResetTimeout",value:function(){clearTimeout(this._blockResetTimeout)}},{key:"_resetCurrentBlock",value:function(){this._currentBlock=null}}]),r}(Pd));function Yd(e,t){return new Promise((function(r){var n=setTimeout(r,e);n.unref&&t&&n.unref()}))}var Ud="object"==typeof y.d&&y.d&&y.d.Object===Object&&y.d,Kd="object"==typeof self&&self&&self.Object===Object&&self,Vd=Ud||Kd||Function("return this")(),Zd=Vd.Symbol,qd=Object.prototype,Xd=qd.hasOwnProperty,Jd=qd.toString,Qd=Zd?Zd.toStringTag:void 0,$d=Object.prototype.toString,el=Zd?Zd.toStringTag:void 0,tl=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":el&&el in Object(e)?function(e){var t=Xd.call(e,Qd),r=e[Qd];try{e[Qd]=void 0;var n=!0}catch(e){}var i=Jd.call(e);return n&&(t?e[Qd]=r:delete e[Qd]),i}(e):function(e){return $d.call(e)}(e)},rl=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},nl=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},il=function(e){return null!=e&&nl(e.length)&&!function(e){if(!rl(e))return!1;var t=tl(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)},ol=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={},e.exports=t.default}));Object(y.c)(ol);var al=function(){},sl=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(){if(null!==e){var t=e;e=null,t.apply(this,arguments)}}},e.exports=t.default}));Object(y.c)(sl);var cl=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return r&&e[r]&&e[r]()};var r="function"==typeof Symbol&&Symbol.iterator;e.exports=t.default}));Object(y.c)(cl);var ul=function(e){return null!=e&&"object"==typeof e},fl=function(e){return ul(e)&&"[object Arguments]"==tl(e)},hl=Object.prototype,dl=hl.hasOwnProperty,ll=hl.propertyIsEnumerable,pl=fl(function(){return arguments}())?fl:function(e){return ul(e)&&dl.call(e,"callee")&&!ll.call(e,"callee")},bl=Array.isArray,vl=function(){return!1},gl=Object(y.b)((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,i=n&&n.exports===r?Vd.Buffer:void 0,o=(i?i.isBuffer:void 0)||vl;e.exports=o})),ml=/^(?:0|[1-9]\d*)$/,yl=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&ml.test(e))&&e>-1&&e%1==0&&e="0"&&$l<="9";)t+=$l,ip();if("."===$l)for(t+=".";ip()&&$l>="0"&&$l<="9";)t+=$l;if("e"===$l||"E"===$l)for(t+=$l,ip(),"-"!==$l&&"+"!==$l||(t+=$l,ip());$l>="0"&&$l<="9";)t+=$l,ip();if(e=+t,isFinite(e))return e;np("Bad number")},ap=function(){var e,t,r,n="";if('"'===$l)for(;ip();){if('"'===$l)return ip(),n;if("\\"===$l)if(ip(),"u"===$l){for(r=0,t=0;t<4&&(e=parseInt(ip(),16),isFinite(e));t+=1)r=16*r+e;n+=String.fromCharCode(r)}else{if("string"!=typeof rp[$l])break;n+=rp[$l]}else n+=$l}np("Bad string")},sp=function(){for(;$l&&$l<=" ";)ip()};tp=function(){switch(sp(),$l){case"{":return function(){var e,t={};if("{"===$l){if(ip("{"),sp(),"}"===$l)return ip("}"),t;for(;$l;){if(e=ap(),sp(),ip(":"),Object.hasOwnProperty.call(t,e)&&np('Duplicate key "'+e+'"'),t[e]=tp(),sp(),"}"===$l)return ip("}"),t;ip(","),sp()}}np("Bad object")}();case"[":return function(){var e=[];if("["===$l){if(ip("["),sp(),"]"===$l)return ip("]"),e;for(;$l;){if(e.push(tp()),sp(),"]"===$l)return ip("]"),e;ip(","),sp()}}np("Bad array")}();case'"':return ap();case"-":return op();default:return $l>="0"&&$l<="9"?op():function(){switch($l){case"t":return ip("t"),ip("r"),ip("u"),ip("e"),!0;case"f":return ip("f"),ip("a"),ip("l"),ip("s"),ip("e"),!1;case"n":return ip("n"),ip("u"),ip("l"),ip("l"),null}np("Unexpected '"+$l+"'")}()}};var cp,up,fp,hp=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,dp={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function lp(e){return hp.lastIndex=0,hp.test(e)?'"'+e.replace(hp,(function(e){var t=dp[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}var pp="undefined"!=typeof JSON?JSON:{parse:function(e,t){var r;return ep=e,Ql=0,$l=" ",r=tp(),sp(),$l&&np("Syntax error"),"function"==typeof t?function e(r,n){var i,o,a=r[n];if(a&&"object"==typeof a)for(i in a)Object.prototype.hasOwnProperty.call(a,i)&&(void 0!==(o=e(a,i))?a[i]=o:delete a[i]);return t.call(r,n,a)}({"":r},""):r},stringify:function(e,t,r){var n;if(cp="",up="","number"==typeof r)for(n=0;n0?(n--,void setTimeout((function(){i()}),1e3)):void t(null,null)}},wp.prototype._getBlockByNumber=function(e,t){var r=gp({method:"eth_getBlockByNumber",params:[e,!1],skipCache:!0});this._handleAsync(r,(function(e,r){return e?t(e):t(null,r.result)}))},wp.prototype._handleAsync=function(e,t){var r=this,n=-1,i=null,o=null,a=[];function s(r,n){o=r,i=n,Vl(a,(function(e,t){e?e(o,i,t):t()}),(function(){var r={id:e.id,jsonrpc:e.jsonrpc,result:i};null!=o?(r.error={message:o.stack||o.message||o,code:-32e3},t(o,r)):t(null,r)}))}!function t(i){if(n+=1,a.unshift(i),n>=r._providers.length)s(new Error('Request for method "'+e.method+'" not handled by any subprovider. Please check your subprovider configuration to ensure this method is handled.'));else try{r._providers[n].handleRequest(e,t,s)}catch(e){s(e)}}()},wp.prototype._setCurrentBlock=function(e){this.currentBlock=e,this.emit("block",e)};var Ep=Sp;function Sp(){}Sp.prototype.setEngine=function(e){var t=this;t.engine||(t.engine=e,e.on("block",(function(e){t.currentBlock=e})),e.on("start",(function(){t.start()})),e.on("stop",(function(){t.stop()})))},Sp.prototype.handleRequest=function(e,t,r){throw new Error("Subproviders should override `handleRequest`.")},Sp.prototype.emitPayload=function(e,t){this.engine.sendAsync(gp(e),t)},Sp.prototype.stop=function(){},Sp.prototype.start=function(){};var Mp=function(e){Object(f.a)(r,e);var t=Object(h.a)(r);function r(e){var n;if(Object(d.a)(this,r),n=t.call(this),!e)throw new Error("JsonRpcEngineMiddlewareSubprovider - no constructorFn specified");return n._constructorFn=e,Object(o.a)(n)}return Object(l.a)(r,[{key:"setEngine",value:function(e){if(this.middleware)throw new Error("JsonRpcEngineMiddlewareSubprovider - subprovider added to engine twice");var t=e._blockTracker,r=this._constructorFn({engine:e,provider:e,blockTracker:t});if(!r)throw new Error("JsonRpcEngineMiddlewareSubprovider - _constructorFn did not return middleware");if("function"!=typeof r)throw new Error("JsonRpcEngineMiddlewareSubprovider - specified middleware is not a function");this.middleware=r}},{key:"handleRequest",value:function(e,t,r){var n={id:e.id};this.middleware(e,n,(function(e){t((function(t,r,i){t?(delete n.result,n.error={message:t.message||t}):n.result=r,e?e(i):i()}))}),(function(e){if(e)return r(e);r(null,n.result)}))}}]),r}(Ep),kp={cacheIdentifierForPayload:function(e,t){var r=t?Op(e):e.params;return Rp(e)?e.method+":"+function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r=t.space||"";"number"==typeof r&&(r=Array(r+1).join(" "));var n="boolean"==typeof t.cycles&&t.cycles,i=t.replacer||function(e,t){return t},o=t.cmp&&function(e){return function(t){return function(r,n){var i={key:r,value:t[r]},o={key:n,value:t[n]};return e(i,o)}}}(t.cmp),a=[];return function e(t,s,c,u){var f=r?"\n"+new Array(u+1).join(r):"",h=r?": ":":";if(c&&c.toJSON&&"function"==typeof c.toJSON&&(c=c.toJSON()),void 0!==(c=i.call(t,s,c))){if("object"!=typeof c||null===c)return pp.stringify(c);if(bp(c)){for(var d=[],l=0;l=e.params.length?null:e.params[t]},paramsWithoutBlockTag:Op,blockTagParamIndex:xp,cacheTypeForPayload:Ip};function Rp(e){return"never"!==Ip(e)}function Op(e){var t=xp(e);return t>=e.params.length?e.params:"eth_getBlockByNumber"===e.method?e.params.slice(1):e.params.slice(0,t)}function xp(e){switch(e.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":return 1;case"eth_getBlockByNumber":return 0;default:return}}function Ip(e){switch(e.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":case"test_permaCache":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":case"test_forkCache":return"fork";case"eth_gasPrice":case"eth_blockNumber":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"test_blockCache":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":case"test_neverCache":return"never"}}var _p=Object.prototype.toString,Cp="function"==typeof i?i:function(){var e=[].slice.apply(arguments);e.splice(1,0,0),setTimeout.apply(null,e)},Tp=function(e){if(!function(e){return"[object Function]"===_p.call(e)}(e.then))throw new TypeError("Expected a promise");return function(t){e.then((function(e){Cp(t,null,e)}),(function(e){Cp(t,e)}))}},Lp=function(e){return function(t,r,n,i){var o=null,s=e(t,r,Object(a.a)(m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=new Promise((function(e){n((function(t){return e(t)}))})),e.next=3,o;case 3:return e.abrupt("return",void e.sent);case 4:case"end":return e.stop()}}),e)}))));Tp(s)((function(e){o?Tp(o)((function(t,r){if(t)return console.error(t),i(t);r(e)})):i(e)}))}},Bp=[void 0,null,""],Np=function(){function e(){Object(d.a)(this,e),this.cache={}}return Object(l.a)(e,[{key:"getBlockCacheForPayload",value:function(e,t){var r=Number.parseInt(t,16),n=this.cache[r];if(!n){var i={};this.cache[r]=i,n=i}return n}},{key:"get",value:function(){var e=Object(a.a)(m.a.mark((function e(t,r){var n;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=this.getBlockCacheForPayload(t,r))){e.next=3;break}return e.abrupt("return",n[kp.cacheIdentifierForPayload(t,!0)]);case 3:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"set",value:function(){var e=Object(a.a)(m.a.mark((function e(t,r,n){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.canCacheResult(t,n)&&(this.getBlockCacheForPayload(t,r)[kp.cacheIdentifierForPayload(t,!0)]=n);case 1:case"end":return e.stop()}}),e,this)})));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"canCacheRequest",value:function(e){return!!kp.canCache(e)&&"pending"!==kp.blockTagForPayload(e)}},{key:"canCacheResult",value:function(e,t){if(!Bp.includes(t))return!!(!["eth_getTransactionByHash","eth_getTransactionReceipt"].includes(e.method)||t&&t.blockHash&&"0x0000000000000000000000000000000000000000000000000000000000000000"!==t.blockHash)}},{key:"clearBefore",value:function(e){var t=this,r=Number.parseInt(e,16);Object.keys(t.cache).map(Number).filter((function(e){return e0&&void 0!==arguments[0]?arguments[0]:{},t=e.blockTracker;if(!t)throw new Error("createBlockCacheMiddleware - No BlockTracker specified");var r=new Np,n={perma:r,block:r,fork:r};return Lp(function(){var e=Object(a.a)(m.a.mark((function e(i,o,a){var s,c,u,f,h,d;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!i.skipCache){e.next=2;break}return e.abrupt("return",a());case 2:if(s=kp.cacheTypeForPayload(i),c=n[s]){e.next=5;break}return e.abrupt("return",a());case 5:if(c.canCacheRequest(i)){e.next=7;break}return e.abrupt("return",a());case 7:if((f=kp.blockTagForPayload(i))||(f="latest"),"earliest"!==f){e.next=12;break}u="0x00",e.next=20;break;case 12:if("latest"!==f){e.next=19;break}return e.next=15,t.getLatestBlock();case 15:h=e.sent,r.clearBefore(h),u=h,e.next=20;break;case 19:u=f;case 20:return e.next=22,c.get(i,u);case 22:if(void 0!==(d=e.sent)){e.next=30;break}return e.next=26,a();case 26:return e.next=28,c.set(i,u,o.result);case 28:e.next=31;break;case 30:o.result=d;case 31:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}())}(Object.assign({blockTracker:r},e))}))}return r}(Mp),jp=w.c.inherits,Dp=Hp;function Hp(e){e=e||{},this.staticResponses=e}jp(Hp,Ep),Hp.prototype.handleRequest=function(e,t,r){var n=this.staticResponses[e.method];"function"==typeof n?n(e,t,r):void 0!==n?setTimeout((function(){return r(null,n)})):t()};var zp=function(){function t(e){Object(d.a)(this,t),this.tasks=[],this.count=e}return Object(l.a)(t,[{key:"sched",value:function(){if(this.count>0&&this.tasks.length>0){this.count--;var e=this.tasks.shift();if(void 0===e)throw"Unexpected undefined value in tasks list";e()}}},{key:"acquire",value:function(){var t=this;return new Promise((function(r,n){t.tasks.push((function(){var e=!1;r((function(){e||(e=!0,t.count++,t.sched())}))})),e&&e.nextTick?e.nextTick(t.sched.bind(t)):i(t.sched.bind(t))}))}},{key:"use",value:function(e){return this.acquire().then((function(t){return e().then((function(e){return t(),e})).catch((function(e){throw t(),e}))}))}}]),t}(),Gp={Semaphore:zp,Mutex:function(e){Object(f.a)(r,e);var t=Object(h.a)(r);function r(){return Object(d.a)(this,r),t.call(this,1)}return r}(zp)},Fp=function(e){return function(t,r,n,i){var o=e[t.method];return void 0===o?n():"function"==typeof o?o(t,r,n,i):(r.result=o,void i())}},Wp=function(e){Object(f.a)(r,e);var t=Object(h.a)(r);function r(){var e;return Object(d.a)(this,r),(e=t.call(this)).updates=[],e}return Object(l.a)(r,[{key:"initialize",value:function(){var e=Object(a.a)(m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"update",value:function(){var e=Object(a.a)(m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("BaseFilter - no update method specified");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"addResults",value:function(e){var t=this;this.updates=this.updates.concat(e),e.forEach((function(e){return t.emit("update",e)}))}},{key:"addInitialResults",value:function(e){}},{key:"getChangesAndClear",value:function(){var e=this.updates;return this.updates=[],e}}]),r}(Pd),Yp=function(){for(var e=arguments.length,t=new Array(e),r=0;r=$p(e.blockNumber))return!1;if(rb(this.params.toBlock)&&$p(this.params.toBlock)<=$p(e.blockNumber))return!1;var t=e.address&&e.address.toLowerCase();return!(this.params.address&&t&&!this.params.address.includes(t))&&this.params.topics.every((function(t,r){var n=e.topics[r];if(!n)return!1;n=n.toLowerCase();var i=Array.isArray(t)?t:[t];return!!i.includes(null)||(i=i.map((function(e){return e.toLowerCase()}))).includes(n)}))}}]),r}(function(e){Object(f.a)(r,e);var t=Object(h.a)(r);function r(){var e;return Object(d.a)(this,r),(e=t.call(this)).allResults=[],e}return Object(l.a)(r,[{key:"update",value:function(){var e=Object(a.a)(m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("BaseFilterWithHistory - no update method specified");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"addResults",value:function(e){this.allResults=this.allResults.concat(e),Object(c.a)(Object(u.a)(r.prototype),"addResults",this).call(this,e)}},{key:"addInitialResults",value:function(e){this.allResults=this.allResults.concat(e),Object(c.a)(Object(u.a)(r.prototype),"addInitialResults",this).call(this,e)}},{key:"getAllResults",value:function(){return this.allResults}}]),r}(Wp)),ib=function(){var e=Object(a.a)(m.a.mark((function e(t){var r,n,i,o,a,s;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.provider,n=t.fromBlock,i=t.toBlock,n||(n=i),o=ob(n),a=ob(i),s=Array(a-o+1).fill().map((function(e,t){return o+t})).map(ab),e.next=5,Promise.all(s.map((function(e){return function(e,t,r){return new Promise((function(t,n){e.sendAsync({id:1,jsonrpc:"2.0",method:"eth_getBlockByNumber",params:r},(function(e,r){if(e)return n(e);t(r.result)}))}))}(r,0,[e,!1])})));case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function ob(e){return null==e?e:Number.parseInt(e,16)}function ab(e){return null==e?e:"0x"+e.toString(16)}var sb=Kp,cb=function(e){Object(f.a)(r,e);var t=Object(h.a)(r);function r(e){var n,i=e.provider;e.params;return Object(d.a)(this,r),(n=t.call(this)).type="block",n.provider=i,n}return Object(l.a)(r,[{key:"update",value:function(){var e=Object(a.a)(m.a.mark((function e(t){var r,n,i,o,a;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.oldBlock,n=t.newBlock,i=n,o=sb(r),e.next=5,ib({provider:this.provider,fromBlock:o,toBlock:i});case 5:a=e.sent.map((function(e){return e.hash})),this.addResults(a);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),r}(Wp),ub=Object(y.b)((function(e,t){var r="[object Arguments]",n="[object Map]",i="[object Object]",o="[object Set]",a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/,c=/^\./,u=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,f=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,d=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[r]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l["[object Function]"]=l[n]=l["[object Number]"]=l[i]=l["[object RegExp]"]=l[o]=l["[object String]"]=l["[object WeakMap]"]=!1;var p="object"==typeof y.d&&y.d&&y.d.Object===Object&&y.d,b="object"==typeof self&&self&&self.Object===Object&&self,v=p||b||Function("return this")(),g=t&&!t.nodeType&&t,m=g&&e&&!e.nodeType&&e,A=m&&m.exports===g&&p.process,w=function(){try{return A&&A.binding("util")}catch(e){}}(),E=w&&w.isTypedArray;function S(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r-1},ce.prototype.set=function(e,t){var r=this.__data__,n=de(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},ue.prototype.clear=function(){this.__data__={hash:new se,map:new(Z||ce),string:new se}},ue.prototype.delete=function(e){return Ee(this,e).delete(e)},ue.prototype.get=function(e){return Ee(this,e).get(e)},ue.prototype.has=function(e){return Ee(this,e).has(e)},ue.prototype.set=function(e,t){return Ee(this,e).set(e,t),this},fe.prototype.add=fe.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},fe.prototype.has=function(e){return this.__data__.has(e)},he.prototype.clear=function(){this.__data__=new ce},he.prototype.delete=function(e){return this.__data__.delete(e)},he.prototype.get=function(e){return this.__data__.get(e)},he.prototype.has=function(e){return this.__data__.has(e)},he.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ce){var n=r.__data__;if(!Z||n.length<199)return n.push([e,t]),this;r=this.__data__=new ue(n)}return r.set(e,t),this};var le,pe=(le=function(e,t){return e&&be(e,t,Ye)},function(e,t){if(null==e)return e;if(!je(e))return le(e,t);for(var r=e.length,n=-1,i=Object(e);++ns))return!1;var u=o.get(e);if(u&&o.get(t))return u==t;var f=-1,h=!0,d=1&i?new fe:void 0;for(o.set(e,t),o.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991}function ze(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ge(e){return!!e&&"object"==typeof e}function Fe(e){return"symbol"==typeof e||Ge(e)&&"[object Symbol]"==H.call(e)}var We=E?function(e){return function(t){return e(t)}}(E):function(e){return Ge(e)&&He(e.length)&&!!l[H.call(e)]};function Ye(e){return je(e)?function(e,t){var r=Pe(e)||Ne(e)?function(e,t){for(var r=-1,n=Array(e);++r0&&n(c)?r>1?e(c,r-1,n,i,o):M(o,c):i||(o[o.length]=c)}return o}(function(e,t){return(Pe(e)?S:ye)(e,function(e){return"function"==typeof e?e:null==e?Ue:"object"==typeof e?Pe(e)?function(e,t){return Oe(e)&&xe(t)?Ie(Ce(e),t):function(r){var n=function(e,t,r){var n=null==e?void 0:ve(e,t);return void 0===n?void 0:n}(r,e);return void 0===n&&n===t?function(e,t){return null!=e&&function(e,t,r){for(var n,i=-1,o=(t=Oe(t,e)?[t]:Ae(t)).length;++i0?t.on("sync",u):r>0&&0===n&&t.removeListener("sync",u)}};function vb(e){return gb(Object(a.a)(m.a.mark((function t(){var r,n=arguments;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.apply(void 0,n);case 2:return r=t.sent,t.abrupt("return",lb(r.id));case 4:case"end":return t.stop()}}),t)}))))}function gb(e){return Lp(function(){var t=Object(a.a)(m.a.mark((function t(r,n){var i;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.apply(null,r.params);case 2:i=t.sent,n.result=i;case 4:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}())}function mb(e,t){var r=[];for(var n in e)r.push(e[n]);return r}var yb=function(e){Object(f.a)(r,e);var t=Object(h.a)(r);function r(){return Object(d.a)(this,r),t.call(this,(function(e){var t=e.blockTracker,r=e.provider;e.engine;return bb({blockTracker:t,provider:r})}))}return r}(Mp),Ab=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(t=(0,i.default)(t||n.default),!(0,r.default)(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var c=0;function u(t){var r=(0,s.default)(e[c++]);t.push((0,a.default)(f)),r.apply(null,t)}function f(r){if(r||c===e.length)return t.apply(null,arguments);u((0,o.default)(arguments,1))}u([])};var r=c(bl),n=c(al),i=c(sl),o=c(Bl),a=c(Tl),s=c(Dl);function c(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}));Object(y.c)(Ab);var wb=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,a){a=a||r.default;var s=(0,n.default)(t)?[]:{};e(t,(function(e,t,r){(0,o.default)(e)((function(e,n){arguments.length>2&&(n=(0,i.default)(arguments,1)),s[t]=n,r(e)}))}),(function(e){a(e,s)}))};var r=a(al),n=a(il),i=a(Bl),o=a(Dl);function a(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}));Object(y.c)(wb);var Eb=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,n.default)(r.default,e,t)};var r=i(Gl),n=i(wb);function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}));Object(y.c)(Eb);var Sb=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_INTEGER=new is("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new is("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.KECCAK256_NULL=n.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=n.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=n.from(t.KECCAK256_RLP_S,"hex")}));Object(y.c)(Sb),Sb.MAX_INTEGER,Sb.TWO_POW256,Sb.KECCAK256_NULL_S,Sb.KECCAK256_NULL,Sb.KECCAK256_RLP_ARRAY_S,Sb.KECCAK256_RLP_ARRAY,Sb.KECCAK256_RLP_S,Sb.KECCAK256_RLP;var Mb=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.zeros=function(e){return n.allocUnsafe(e).fill(0)},t.setLengthLeft=function(e,r,n){void 0===n&&(n=!1);var i=t.zeros(r);return e=t.toBuffer(e),n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e},t.stripZeros=t.unpad,t.toBuffer=function(e){if(!n.isBuffer(e))if(Array.isArray(e))e=n.from(e);else if("string"==typeof e){if(!cd.isHexString(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+e);e=n.from(cd.padToEven(cd.stripHexPrefix(e)),"hex")}else if("number"==typeof e)e=cd.intToBuffer(e);else if(null==e)e=n.allocUnsafe(0);else if(is.isBN(e))e=e.toArrayLike(n);else{if(!e.toArray)throw new Error("invalid type");e=n.from(e.toArray())}return e},t.bufferToInt=function(e){return new is(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new is(e).fromTwos(256)},t.toUnsigned=function(e){return n.from(e.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!=typeof e||cd.isHexPrefixed(e)?e:"0x"+e},t.baToJSON=function(e){if(n.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var r=[],i=0;i>>31),l=h^(o<<1|i>>>31),p=e[0]^d,b=e[1]^l,v=e[10]^d,g=e[11]^l,m=e[20]^d,y=e[21]^l,A=e[30]^d,w=e[31]^l,E=e[40]^d,S=e[41]^l;d=r^(a<<1|s>>>31),l=n^(s<<1|a>>>31);var M=e[2]^d,k=e[3]^l,R=e[12]^d,O=e[13]^l,x=e[22]^d,I=e[23]^l,_=e[32]^d,C=e[33]^l,T=e[42]^d,L=e[43]^l;d=i^(c<<1|u>>>31),l=o^(u<<1|c>>>31);var B=e[4]^d,N=e[5]^l,P=e[14]^d,j=e[15]^l,D=e[24]^d,H=e[25]^l,z=e[34]^d,G=e[35]^l,F=e[44]^d,W=e[45]^l;d=a^(f<<1|h>>>31),l=s^(h<<1|f>>>31);var Y=e[6]^d,U=e[7]^l,K=e[16]^d,V=e[17]^l,Z=e[26]^d,q=e[27]^l,X=e[36]^d,J=e[37]^l,Q=e[46]^d,$=e[47]^l;d=c^(r<<1|n>>>31),l=u^(n<<1|r>>>31);var ee=e[8]^d,te=e[9]^l,re=e[18]^d,ne=e[19]^l,ie=e[28]^d,oe=e[29]^l,ae=e[38]^d,se=e[39]^l,ce=e[48]^d,ue=e[49]^l,fe=p,he=b,de=g<<4|v>>>28,le=v<<4|g>>>28,pe=m<<3|y>>>29,be=y<<3|m>>>29,ve=w<<9|A>>>23,ge=A<<9|w>>>23,me=E<<18|S>>>14,ye=S<<18|E>>>14,Ae=M<<1|k>>>31,we=k<<1|M>>>31,Ee=O<<12|R>>>20,Se=R<<12|O>>>20,Me=x<<10|I>>>22,ke=I<<10|x>>>22,Re=C<<13|_>>>19,Oe=_<<13|C>>>19,xe=T<<2|L>>>30,Ie=L<<2|T>>>30,_e=N<<30|B>>>2,Ce=B<<30|N>>>2,Te=P<<6|j>>>26,Le=j<<6|P>>>26,Be=H<<11|D>>>21,Ne=D<<11|H>>>21,Pe=z<<15|G>>>17,je=G<<15|z>>>17,De=W<<29|F>>>3,He=F<<29|W>>>3,ze=Y<<28|U>>>4,Ge=U<<28|Y>>>4,Fe=V<<23|K>>>9,We=K<<23|V>>>9,Ye=Z<<25|q>>>7,Ue=q<<25|Z>>>7,Ke=X<<21|J>>>11,Ve=J<<21|X>>>11,Ze=$<<24|Q>>>8,qe=Q<<24|$>>>8,Xe=ee<<27|te>>>5,Je=te<<27|ee>>>5,Qe=re<<20|ne>>>12,$e=ne<<20|re>>>12,et=oe<<7|ie>>>25,tt=ie<<7|oe>>>25,rt=ae<<8|se>>>24,nt=se<<8|ae>>>24,it=ce<<14|ue>>>18,ot=ue<<14|ce>>>18;e[0]=fe^~Ee&Be,e[1]=he^~Se&Ne,e[10]=ze^~Qe&pe,e[11]=Ge^~$e&be,e[20]=Ae^~Te&Ye,e[21]=we^~Le&Ue,e[30]=Xe^~de&Me,e[31]=Je^~le&ke,e[40]=_e^~Fe&et,e[41]=Ce^~We&tt,e[2]=Ee^~Be&Ke,e[3]=Se^~Ne&Ve,e[12]=Qe^~pe&Re,e[13]=$e^~be&Oe,e[22]=Te^~Ye&rt,e[23]=Le^~Ue&nt,e[32]=de^~Me&Pe,e[33]=le^~ke&je,e[42]=Fe^~et&ve,e[43]=We^~tt&ge,e[4]=Be^~Ke&it,e[5]=Ne^~Ve&ot,e[14]=pe^~Re&De,e[15]=be^~Oe&He,e[24]=Ye^~rt&me,e[25]=Ue^~nt&ye,e[34]=Me^~Pe&Ze,e[35]=ke^~je&qe,e[44]=et^~ve&xe,e[45]=tt^~ge&Ie,e[6]=Ke^~it&fe,e[7]=Ve^~ot&he,e[16]=Re^~De&ze,e[17]=Oe^~He&Ge,e[26]=rt^~me&Ae,e[27]=nt^~ye&we,e[36]=Pe^~Ze&Xe,e[37]=je^~qe&Je,e[46]=ve^~xe&_e,e[47]=ge^~Ie&Ce,e[8]=it^~fe&Ee,e[9]=ot^~he&Se,e[18]=De^~ze&Qe,e[19]=He^~Ge&$e,e[28]=me^~Ae&Te,e[29]=ye^~we&Le,e[38]=Ze^~Xe&de,e[39]=qe^~Je&le,e[48]=xe^~_e&Fe,e[49]=Ie^~Ce&We,e[0]^=Ib[2*t],e[1]^=Ib[2*t+1]}},Cb=xe.Buffer;function Tb(){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}Tb.prototype.initialize=function(e,t){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},Tb.prototype.absorb=function(e){for(var t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(_b(this.state),this.count=0);return t},Tb.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var Lb=function(e){var t=function(e){function t(t,r,n,i,o){Rb.call(this,o),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=i,this._options=o,this._state=new e,this._state.initialize(t,r),this._finalized=!1}return Te(t,Rb),t.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},t.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},t.prototype.update=function(e,t){if(!kb.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return kb.isBuffer(e)||(e=kb.from(e,t)),this._state.absorb(e),this},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}(e),r=function(e){function t(t,r,n,i){xb.call(this,i),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._options=i,this._state=new e,this._state.initialize(t,r),this._finalized=!1}return Te(t,xb),t.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},t.prototype._flush=function(){},t.prototype._read=function(e){this.push(this.squeeze(e))},t.prototype.update=function(e,t){if(!Ob.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Ob.isBuffer(e)||(e=Ob.from(e,t)),this._state.absorb(e),this},t.prototype.squeeze=function(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}(e);return function(e,n){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new t(1152,448,null,224,n);case"keccak256":return new t(1088,512,null,256,n);case"keccak384":return new t(832,768,null,384,n);case"keccak512":return new t(576,1024,null,512,n);case"sha3-224":return new t(1152,448,6,224,n);case"sha3-256":return new t(1088,512,6,256,n);case"sha3-384":return new t(832,768,6,384,n);case"sha3-512":return new t(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+e)}}}(Tb),Bb=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.keccak=function(e,t){return void 0===t&&(t=256),e="string"!=typeof e||cd.isHexString(e)?Mb.toBuffer(e):n.from(e,"utf8"),t||(t=256),Lb("keccak"+t).update(e).digest()},t.keccak256=function(e){return t.keccak(e)},t.sha256=function(e){return e=Mb.toBuffer(e),ns("sha256").update(e).digest()},t.ripemd160=function(e,t){e=Mb.toBuffer(e);var r=ns("rmd160").update(e).digest();return!0===t?Mb.setLength(r,32):r},t.rlphash=function(e){return t.keccak(nd.encode(e))}}));Object(y.c)(Bb),Bb.keccak,Bb.keccak256,Bb.sha256,Bb.ripemd160,Bb.rlphash;var Nb=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.zeroAddress=function(){var e=Mb.zeros(20);return Mb.bufferToHex(e)},t.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)},t.isZeroAddress=function(e){return t.zeroAddress()===Mb.addHexPrefix(e)},t.toChecksumAddress=function(e,t){e=cd.stripHexPrefix(e).toLowerCase();for(var r=void 0!==t?t.toString()+"0x":"",n=Bb.keccak(r+e).toString("hex"),i="0x",o=0;o=8?i+=e[o].toUpperCase():i+=e[o];return i},t.isValidChecksumAddress=function(e,r){return t.isValidAddress(e)&&t.toChecksumAddress(e,r)===e},t.generateAddress=function(e,t){e=Mb.toBuffer(e);var r=new is(t);return r.isZero()?Bb.rlphash([e,null]).slice(-20):Bb.rlphash([e,n.from(r.toArray())]).slice(-20)},t.generateAddress2=function(e,t,r){var i=Mb.toBuffer(e),o=Mb.toBuffer(t),a=Mb.toBuffer(r);return Object(w.b)(20===i.length),Object(w.b)(32===o.length),Bb.keccak256(n.concat([n.from("ff","hex"),i,o,Bb.keccak256(a)])).slice(-20)},t.isPrecompiled=function(e){var t=Mb.unpad(e);return 1===t.length&&t[0]>=1&&t[0]<=8},t.isValidPrivate=function(e){return Sc.privateKeyVerify(e)},t.isValidPublic=function(e,t){return void 0===t&&(t=!1),64===e.length?Sc.publicKeyVerify(n.concat([n.from([4]),e])):!!t&&Sc.publicKeyVerify(e)},t.pubToAddress=function(e,t){return void 0===t&&(t=!1),e=Mb.toBuffer(e),t&&64!==e.length&&(e=Sc.publicKeyConvert(e,!1).slice(1)),Object(w.b)(64===e.length),Bb.keccak(e).slice(-20)},t.publicToAddress=t.pubToAddress,t.privateToAddress=function(e){return t.publicToAddress(t.privateToPublic(e))},t.privateToPublic=function(e){return e=Mb.toBuffer(e),Sc.publicKeyCreate(e,!1).slice(1)},t.importPublic=function(e){return 64!==(e=Mb.toBuffer(e)).length&&(e=Sc.publicKeyConvert(e,!1).slice(1)),e}}));Object(y.c)(Nb),Nb.zeroAddress,Nb.isValidAddress,Nb.isZeroAddress,Nb.toChecksumAddress,Nb.isValidChecksumAddress,Nb.generateAddress,Nb.generateAddress2,Nb.isPrecompiled,Nb.isValidPrivate,Nb.isValidPublic,Nb.pubToAddress,Nb.publicToAddress,Nb.privateToAddress,Nb.privateToPublic,Nb.importPublic;var Pb=Object(y.b)((function(e,t){function r(e,t){return t?e-(2*t+35):e-27}function i(e){return 0===e||1===e}Object.defineProperty(t,"__esModule",{value:!0}),t.ecsign=function(e,t,r){var n=Sc.sign(e,t),i=n.recovery;return{r:n.signature.slice(0,32),s:n.signature.slice(32,64),v:r?i+(2*r+35):i+27}},t.ecrecover=function(e,t,o,a,s){var c=n.concat([Mb.setLength(o,32),Mb.setLength(a,32)],64),u=r(t,s);if(!i(u))throw new Error("Invalid signature v value");var f=Sc.recover(e,c,u);return Sc.publicKeyConvert(f,!1).slice(1)},t.toRpcSig=function(e,t,o,a){if(!i(r(e,a)))throw new Error("Invalid signature v value");return Mb.bufferToHex(n.concat([Mb.setLengthLeft(t,32),Mb.setLengthLeft(o,32),Mb.toBuffer(e)]))},t.fromRpcSig=function(e){var t=Mb.toBuffer(e);if(65!==t.length)throw new Error("Invalid signature length");var r=t[64];return r<27&&(r+=27),{v:r,r:t.slice(0,32),s:t.slice(32,64)}},t.isValidSignature=function(e,t,n,o,a){void 0===o&&(o=!0);var s=new is("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),c=new is("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==n.length)return!1;if(!i(r(e,a)))return!1;var u=new is(t),f=new is(n);return!(u.isZero()||u.gt(c)||f.isZero()||f.gt(c))&&(!o||1!==f.cmp(s))},t.hashPersonalMessage=function(e){var t=n.from("\x19Ethereum Signed Message:\n"+e.length.toString(),"utf-8");return Bb.keccak(n.concat([t,e]))}}));Object(y.c)(Pb),Pb.ecsign,Pb.ecrecover,Pb.toRpcSig,Pb.fromRpcSig,Pb.isValidSignature,Pb.hashPersonalMessage;var jb=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.defineProperties=function(e,t,r){if(e.raw=[],e._fields=[],e.toJSON=function(t){if(void 0===t&&(t=!1),t){var r={};return e._fields.forEach((function(t){r[t]="0x"+e[t].toString("hex")})),r}return Mb.baToJSON(e.raw)},e.serialize=function(){return nd.encode(e.raw)},t.forEach((function(t,r){function i(){return e.raw[r]}function o(i){"00"!==(i=Mb.toBuffer(i)).toString("hex")||t.allowZero||(i=n.allocUnsafe(0)),t.allowLess&&t.length?(i=Mb.stripZeros(i),Object(w.b)(t.length>=i.length,"The field "+t.name+" must not have more "+t.length+" bytes")):t.allowZero&&0===i.length||!t.length||Object(w.b)(t.length===i.length,"The field "+t.name+" must have byte length of "+t.length),e.raw[r]=i}e._fields.push(t.name),Object.defineProperty(e,t.name,{enumerable:!0,configurable:!0,get:i,set:o}),t.default&&(e[t.name]=t.default),t.alias&&Object.defineProperty(e,t.alias,{enumerable:!1,configurable:!0,set:o,get:i})})),r)if("string"==typeof r&&(r=n.from(cd.stripHexPrefix(r),"hex")),n.isBuffer(r)&&(r=nd.decode(r)),Array.isArray(r)){if(r.length>e._fields.length)throw new Error("wrong number of fields in data");r.forEach((function(t,r){e[e._fields[r]]=Mb.toBuffer(t)}))}else{if("object"!=typeof r)throw new Error("invalid data");var i=Object.keys(r);t.forEach((function(t){-1!==i.indexOf(t.name)&&(e[t.name]=r[t.name]),-1!==i.indexOf(t.alias)&&(e[t.alias]=r[t.alias])}))}}}));Object(y.c)(jb),jb.defineProperties;var Db=Object(y.b)((function(e,t){function r(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),t.secp256k1=Sc,t.BN=is,t.rlp=nd,Object.assign(t,cd),r(Sb),r(Nb),r(Bb),r(Pb),r(Mb),r(jb)}));Object(y.c)(Db),Db.secp256k1,Db.BN,Db.rlp;var Hb=function(){};function zb(e){return e.startsWith("int[")?"int256"+e.slice(3):"int"===e?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):"uint"===e?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):"fixed"===e?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):"ufixed"===e?"ufixed128x128":e}function Gb(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function Fb(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function Wb(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?""===t[2]?"dynamic":parseInt(t[2],10):null}function Yb(e){var t=typeof e;if("string"===t)return Db.isHexPrefixed(e)?new is(Db.stripHexPrefix(e),16):new is(e,10);if("number"===t)return new is(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function Ub(e){var t=/^(\w+)\((.*)\)$/.exec(e);if(3!==t.length)throw new Error("Invalid method signature");var r=/^(.+)\):\((.+)$/.exec(t[2]);if(null!==r&&3===r.length)return{method:t[1],args:r[1].split(","),retargs:r[2].split(",")};var n=t[2].split(",");return 1===n.length&&""===n[0]&&(n=[]),{method:t[1],args:n}}function Kb(e,t){var r,i,o,a;if("address"===e)return Kb("uint160",Yb(t));if("bool"===e)return Kb("uint8",t?1:0);if("string"===e)return Kb("bytes",n.from(t,"utf8"));if(Xb(e)){if(void 0===t.length)throw new Error("Not an array?");if("dynamic"!==(r=Wb(e))&&0!==r&&t.length>r)throw new Error("Elements exceed array size: "+r);for(a in o=[],e=e.slice(0,e.lastIndexOf("[")),"string"==typeof t&&(t=JSON.parse(t)),t)o.push(Kb(e,t[a]));if("dynamic"===r){var s=Kb("uint256",t.length);o.unshift(s)}return n.concat(o)}if("bytes"===e)return t=n.from(t),o=n.concat([Kb("uint256",t.length),t]),t.length%32!=0&&(o=n.concat([o,Db.zeros(32-t.length%32)])),o;if(e.startsWith("bytes")){if((r=Gb(e))<1||r>32)throw new Error("Invalid bytes width: "+r);return Db.setLengthRight(t,32)}if(e.startsWith("uint")){if((r=Gb(e))%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if((i=Yb(t)).bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+i.bitLength());if(i<0)throw new Error("Supplied uint is negative");return i.toArrayLike(n,"be",32)}if(e.startsWith("int")){if((r=Gb(e))%8||r<8||r>256)throw new Error("Invalid int width: "+r);if((i=Yb(t)).bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+i.bitLength());return i.toTwos(256).toArrayLike(n,"be",32)}if(e.startsWith("ufixed")){if(r=Fb(e),(i=Yb(t))<0)throw new Error("Supplied ufixed is negative");return Kb("uint256",i.mul(new is(2).pow(new is(r[1]))))}if(e.startsWith("fixed"))return r=Fb(e),Kb("int256",Yb(t).mul(new is(2).pow(new is(r[1]))));throw new Error("Unsupported or invalid type: "+e)}function Vb(e,t,r){var i,o,a,s;if("string"==typeof e&&(e=Zb(e)),"address"===e.name)return Vb(e.rawType,t,r).toArrayLike(n,"be",20).toString("hex");if("bool"===e.name)return Vb(e.rawType,t,r).toString()===new is(1).toString();if("string"===e.name){var c=Vb(e.rawType,t,r);return n.from(c,"utf8").toString()}if(e.isArray){for(a=[],i=e.size,"dynamic"===e.size&&(r=Vb("uint256",t,r).toNumber(),i=Vb("uint256",t,r).toNumber(),r+=32),s=0;se.size)throw new Error("Decoded int exceeds width: "+e.size+" vs "+o.bitLength());return o}if(e.name.startsWith("int")){if((o=new is(t.slice(r,r+32),16,"be").fromTwos(256)).bitLength()>e.size)throw new Error("Decoded uint exceeds width: "+e.size+" vs "+o.bitLength());return o}if(e.name.startsWith("ufixed")){if(i=new is(2).pow(new is(e.size[1])),!(o=Vb("uint256",t,r)).mod(i).isZero())throw new Error("Decimals not supported yet");return o.div(i)}if(e.name.startsWith("fixed")){if(i=new is(2).pow(new is(e.size[1])),!(o=Vb("int256",t,r)).mod(i).isZero())throw new Error("Decimals not supported yet");return o.div(i)}throw new Error("Unsupported or invalid type: "+e.name)}function Zb(e){var t,r,n;if(Xb(e)){t=Wb(e);var i=e.slice(0,e.lastIndexOf("["));return i=Zb(i),{isArray:!0,name:e,size:t,memoryUsage:"dynamic"===t?32:i.memoryUsage*t,subArray:i}}switch(e){case"address":n="uint160";break;case"bool":n="uint8";break;case"string":n="bytes"}if(r={rawType:n,name:e,memoryUsage:32},e.startsWith("bytes")&&"bytes"!==e||e.startsWith("uint")||e.startsWith("int")?r.size=Gb(e):(e.startsWith("ufixed")||e.startsWith("fixed"))&&(r.size=Fb(e)),e.startsWith("bytes")&&"bytes"!==e&&(r.size<1||r.size>32))throw new Error("Invalid bytes width: "+r.size);if((e.startsWith("uint")||e.startsWith("int"))&&(r.size%8||r.size<8||r.size>256))throw new Error("Invalid int/uint width: "+r.size);return r}function qb(e){return"string"===e||"bytes"===e||"dynamic"===Wb(e)}function Xb(e){return e.lastIndexOf("]")===e.length-1}function Jb(e,t){return e.startsWith("address")||e.startsWith("bytes")?"0x"+t.toString("hex"):t.toString()}function Qb(e){return e>="0"&&e<="9"}Hb.eventID=function(e,t){var r=e+"("+t.map(zb).join(",")+")";return Db.keccak256(n.from(r))},Hb.methodID=function(e,t){return Hb.eventID(e,t).slice(0,4)},Hb.rawEncode=function(e,t){var r=[],i=[],o=0;e.forEach((function(e){if(Xb(e)){var t=Wb(e);o+="dynamic"!==t?32*t:32}else o+=32}));for(var a=0;as)throw new Error("Elements exceed array size: "+s)}var c=t.map((function(e){return Hb.solidityHexValue(a,e,256)}));return n.concat(c)}if("bytes"===e)return t;if("string"===e)return n.from(t,"utf8");if("bool"===e){r=r||8;var u=Array(r/4).join("0");return n.from(t?u+"1":u+"0","hex")}if("address"===e){var f=20;return r&&(f=r/8),Db.setLengthLeft(t,f)}if(e.startsWith("bytes")){if((i=Gb(e))<1||i>32)throw new Error("Invalid bytes width: "+i);return Db.setLengthRight(t,i)}if(e.startsWith("uint")){if((i=Gb(e))%8||i<8||i>256)throw new Error("Invalid uint width: "+i);if((o=Yb(t)).bitLength()>i)throw new Error("Supplied uint exceeds width: "+i+" vs "+o.bitLength());return r=r||i,o.toArrayLike(n,"be",r/8)}if(e.startsWith("int")){if((i=Gb(e))%8||i<8||i>256)throw new Error("Invalid int width: "+i);if((o=Yb(t)).bitLength()>i)throw new Error("Supplied int exceeds width: "+i+" vs "+o.bitLength());return r=r||i,o.toTwos(i).toArrayLike(n,"be",r/8)}throw new Error("Unsupported or invalid type: "+e)},Hb.solidityPack=function(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r=[],i=0;i=2&&("function"==typeof arguments[1]?r.task=arguments[1]:r.n=arguments[1]);var n=r.task;if(r.task=function(){n(t.leave)},t.current+r.n-e>t.capacity)return 1===e&&(t.current--,t.firstHere=!1),t.queue.push(r);t.current+=r.n-e,r.task(t.leave),1===e&&(t.firstHere=!1)},leave:function(e){if(e=e||1,t.current-=e,t.queue.length){var r=t.queue[0];r.n+t.current>t.capacity||(t.queue.shift(),t.current+=r.n,n(r.task))}else if(t.current<0)throw new Error("leave called too many times.")},available:function(e){return e=e||1,t.current+e<=t.capacity}};return t}})),tv=w.c.inherits,rv=/^[0-9A-Fa-f]+$/g,nv=iv;function iv(e){this.nonceLock=ev(1),e.getAccounts&&(this.getAccounts=e.getAccounts),e.processTransaction&&(this.processTransaction=e.processTransaction),e.processMessage&&(this.processMessage=e.processMessage),e.processPersonalMessage&&(this.processPersonalMessage=e.processPersonalMessage),e.processTypedMessage&&(this.processTypedMessage=e.processTypedMessage),this.approveTransaction=e.approveTransaction||this.autoApprove,this.approveMessage=e.approveMessage||this.autoApprove,this.approvePersonalMessage=e.approvePersonalMessage||this.autoApprove,this.approveDecryptMessage=e.approveDecryptMessage||this.autoApprove,this.approveEncryptionPublicKey=e.approveEncryptionPublicKey||this.autoApprove,this.approveTypedMessage=e.approveTypedMessage||this.autoApprove,e.signTransaction&&(this.signTransaction=e.signTransaction||uv("signTransaction")),e.signMessage&&(this.signMessage=e.signMessage||uv("signMessage")),e.signPersonalMessage&&(this.signPersonalMessage=e.signPersonalMessage||uv("signPersonalMessage")),e.decryptMessage&&(this.decryptMessage=e.decryptMessage||uv("decryptMessage")),e.encryptionPublicKey&&(this.encryptionPublicKey=e.encryptionPublicKey||uv("encryptionPublicKey")),e.signTypedMessage&&(this.signTypedMessage=e.signTypedMessage||uv("signTypedMessage")),e.recoverPersonalSignature&&(this.recoverPersonalSignature=e.recoverPersonalSignature),e.publishTransaction&&(this.publishTransaction=e.publishTransaction),this.estimateGas=e.estimateGas||this.estimateGas,this.getGasPrice=e.getGasPrice||this.getGasPrice}function ov(e){return e.toLowerCase()}function av(e){var t=ud.addHexPrefix(e);return ud.isValidAddress(t)}function sv(e){var t=ud.addHexPrefix(e);return!ud.isValidAddress(t)&&cv(e)}function cv(e){return"string"==typeof e&&"0x"===e.slice(0,2)&&e.slice(2).match(rv)}function uv(e){return function(t,r){r(new Error('ProviderEngine - HookedWalletSubprovider - Must provide "'+e+'" fn in constructor options'))}}tv(iv,Ep),iv.prototype.handleRequest=function(e,t,r){var n,i,o,a,s,c=this;switch(c._parityRequests={},c._parityRequestCount=0,e.method){case"eth_coinbase":return void c.getAccounts((function(e,t){if(e)return r(e);var n=t[0]||null;r(null,n)}));case"eth_accounts":return void c.getAccounts((function(e,t){if(e)return r(e);r(null,t)}));case"eth_sendTransaction":return n=e.params[0],void Ab([function(e){return c.validateTransaction(n,e)},function(e){return c.processTransaction(n,e)}],r);case"eth_signTransaction":return n=e.params[0],void Ab([function(e){return c.validateTransaction(n,e)},function(e){return c.processSignTransaction(n,e)}],r);case"eth_sign":return s=e.params[0],a=e.params[1],o=e.params[2]||{},i=dd(o,{from:s,data:a}),void Ab([function(e){return c.validateMessage(i,e)},function(e){return c.processMessage(i,e)}],r);case"personal_sign":return function(){var t=e.params[0];if(sv(e.params[1])&&av(t)){"[message, address]. This was previously handled incorrectly, ","and has been corrected automatically. ","Please switch this param order for smooth behavior in the future.",console.warn("The eth_personalSign method requires params ordered [message, address]. This was previously handled incorrectly, and has been corrected automatically. Please switch this param order for smooth behavior in the future."),s=e.params[0],a=e.params[1]}else a=e.params[0],s=e.params[1];o=e.params[2]||{},i=dd(o,{from:s,data:a}),Ab([function(e){return c.validatePersonalMessage(i,e)},function(e){return c.processPersonalMessage(i,e)}],r)}();case"eth_decryptMessage":return function(){var t=e.params[0];if(sv(e.params[1])&&av(t)){"[message, address]. This was previously handled incorrectly, ","and has been corrected automatically. ","Please switch this param order for smooth behavior in the future.",console.warn("The eth_decryptMessage method requires params ordered [message, address]. This was previously handled incorrectly, and has been corrected automatically. Please switch this param order for smooth behavior in the future."),s=e.params[0],a=e.params[1]}else a=e.params[0],s=e.params[1];o=e.params[2]||{},i=dd(o,{from:s,data:a}),Ab([function(e){return c.validateDecryptMessage(i,e)},function(e){return c.processDecryptMessage(i,e)}],r)}();case"encryption_public_key":return function(){var t=e.params[0];Ab([function(e){return c.validateEncryptionPublicKey(t,e)},function(e){return c.processEncryptionPublicKey(t,e)}],r)}();case"personal_ecRecover":return function(){a=e.params[0];var t=e.params[1];o=e.params[2]||{},i=dd(o,{sig:t,data:a}),c.recoverPersonalSignature(i,r)}();case"eth_signTypedData":case"eth_signTypedData_v3":case"eth_signTypedData_v4":return function(){var t=e.params[0],n=e.params[1];av(t)?(s=t,a=n):(a=t,s=n),o=e.params[2]||{},i=dd(o,{from:s,data:a}),Ab([function(e){return c.validateTypedMessage(i,e)},function(e){return c.processTypedMessage(i,e)}],r)}();case"parity_postTransaction":return n=e.params[0],void c.parityPostTransaction(n,r);case"parity_postSign":return s=e.params[0],a=e.params[1],void c.parityPostSign(s,a,r);case"parity_checkRequest":return function(){var t=e.params[0];c.parityCheckRequest(t,r)}();case"parity_defaultAccount":return void c.getAccounts((function(e,t){if(e)return r(e);var n=t[0]||null;r(null,n)}));default:return void t()}},iv.prototype.getAccounts=function(e){e(null,[])},iv.prototype.processTransaction=function(e,t){var r=this;Ab([function(t){return r.approveTransaction(e,t)},function(e,t){return r.checkApproval("transaction",e,t)},function(t){return r.finalizeAndSubmitTx(e,t)}],t)},iv.prototype.processSignTransaction=function(e,t){var r=this;Ab([function(t){return r.approveTransaction(e,t)},function(e,t){return r.checkApproval("transaction",e,t)},function(t){return r.finalizeTx(e,t)}],t)},iv.prototype.processMessage=function(e,t){var r=this;Ab([function(t){return r.approveMessage(e,t)},function(e,t){return r.checkApproval("message",e,t)},function(t){return r.signMessage(e,t)}],t)},iv.prototype.processPersonalMessage=function(e,t){var r=this;Ab([function(t){return r.approvePersonalMessage(e,t)},function(e,t){return r.checkApproval("message",e,t)},function(t){return r.signPersonalMessage(e,t)}],t)},iv.prototype.processDecryptMessage=function(e,t){var r=this;Ab([function(t){return r.approveDecryptMessage(e,t)},function(e,t){return r.checkApproval("decryptMessage",e,t)},function(t){return r.decryptMessage(e,t)}],t)},iv.prototype.processEncryptionPublicKey=function(e,t){var r=this;Ab([function(t){return r.approveEncryptionPublicKey(e,t)},function(e,t){return r.checkApproval("encryptionPublicKey",e,t)},function(t){return r.encryptionPublicKey(e,t)}],t)},iv.prototype.processTypedMessage=function(e,t){var r=this;Ab([function(t){return r.approveTypedMessage(e,t)},function(e,t){return r.checkApproval("message",e,t)},function(t){return r.signTypedMessage(e,t)}],t)},iv.prototype.autoApprove=function(e,t){t(null,!0)},iv.prototype.checkApproval=function(e,t,r){r(t?null:new Error("User denied "+e+" signature."))},iv.prototype.parityPostTransaction=function(e,t){var r=this,n="0x".concat(r._parityRequestCount.toString(16));r._parityRequestCount++,r.emitPayload({method:"eth_sendTransaction",params:[e]},(function(e,t){if(e)r._parityRequests[n]={error:e};else{var i=t.result;r._parityRequests[n]=i}})),t(null,n)},iv.prototype.parityPostSign=function(e,t,r){var n=this,i="0x".concat(n._parityRequestCount.toString(16));n._parityRequestCount++,n.emitPayload({method:"eth_sign",params:[e,t]},(function(e,t){if(e)n._parityRequests[i]={error:e};else{var r=t.result;n._parityRequests[i]=r}})),r(null,i)},iv.prototype.parityCheckRequest=function(e,t){var r=this._parityRequests[e]||null;return r?r.error?t(r.error):void t(null,r):t(null,null)},iv.prototype.recoverPersonalSignature=function(e,t){var r;try{r=$b(e)}catch(e){return t(e)}t(null,r)},iv.prototype.validateTransaction=function(e,t){if(void 0===e.from)return t(new Error("Undefined address - from address required to sign transaction."));this.validateSender(e.from,(function(r,n){return r?t(r):n?void t():t(new Error('Unknown address - unable to sign transaction for this address: "'.concat(e.from,'"')))}))},iv.prototype.validateMessage=function(e,t){if(void 0===e.from)return t(new Error("Undefined address - from address required to sign message."));this.validateSender(e.from,(function(r,n){return r?t(r):n?void t():t(new Error('Unknown address - unable to sign message for this address: "'.concat(e.from,'"')))}))},iv.prototype.validatePersonalMessage=function(e,t){return void 0===e.from?t(new Error("Undefined address - from address required to sign personal message.")):void 0===e.data?t(new Error("Undefined message - message required to sign personal message.")):cv(e.data)?void this.validateSender(e.from,(function(r,n){return r?t(r):n?void t():t(new Error('Unknown address - unable to sign message for this address: "'.concat(e.from,'"')))})):t(new Error("HookedWalletSubprovider - validateMessage - message was not encoded as hex."))},iv.prototype.validateDecryptMessage=function(e,t){return void 0===e.from?t(new Error("Undefined address - from address required to decrypt message.")):void 0===e.data?t(new Error("Undefined message - message required to decrypt message.")):cv(e.data)?void this.validateSender(e.from,(function(r,n){return r?t(r):n?void t():t(new Error('Unknown address - unable to decrypt message for this address: "'.concat(e.from,'"')))})):t(new Error("HookedWalletSubprovider - validateDecryptMessage - message was not encoded as hex."))},iv.prototype.validateEncryptionPublicKey=function(e,t){this.validateSender(e,(function(r,n){return r?t(r):n?void t():t(new Error('Unknown address - unable to obtain encryption public key for this address: "'.concat(e,'"')))}))},iv.prototype.validateTypedMessage=function(e,t){return void 0===e.from?t(new Error("Undefined address - from address required to sign typed data.")):void 0===e.data?t(new Error("Undefined data - message required to sign typed data.")):void this.validateSender(e.from,(function(r,n){return r?t(r):n?void t():t(new Error('Unknown address - unable to sign message for this address: "'.concat(e.from,'"')))}))},iv.prototype.validateSender=function(e,t){if(!e)return t(null,!1);this.getAccounts((function(r,n){if(r)return t(r);var i=-1!==n.map(ov).indexOf(e.toLowerCase());t(null,i)}))},iv.prototype.finalizeAndSubmitTx=function(e,t){var r=this;r.nonceLock.take((function(){Ab([r.fillInTxExtras.bind(r,e),r.signTransaction.bind(r),r.publishTransaction.bind(r)],(function(e,n){if(r.nonceLock.leave(),e)return t(e);t(null,n)}))}))},iv.prototype.finalizeTx=function(e,t){var r=this;r.nonceLock.take((function(){Ab([r.fillInTxExtras.bind(r,e),r.signTransaction.bind(r)],(function(n,i){if(r.nonceLock.leave(),n)return t(n);t(null,{raw:i,tx:e})}))}))},iv.prototype.publishTransaction=function(e,t){this.emitPayload({method:"eth_sendRawTransaction",params:[e]},(function(e,r){if(e)return t(e);t(null,r.result)}))},iv.prototype.estimateGas=function(e,t){!function(e,t,r){e.sendAsync(gp({method:"eth_estimateGas",params:[t]}),(function(e,t){if(e)return"no contract code at given address"===e.message?r(null,"0xcf08"):r(e);r(null,t.result)}))}(this.engine,e,t)},iv.prototype.getGasPrice=function(e){this.emitPayload({method:"eth_gasPrice",params:[]},(function(t,r){if(t)return e(t);e(null,r.result)}))},iv.prototype.fillInTxExtras=function(e,t){var r=this,n=e.from,i={};void 0===e.gasPrice&&(i.gasPrice=r.getGasPrice.bind(r)),void 0===e.nonce&&(i.nonce=r.emitPayload.bind(r,{method:"eth_getTransactionCount",params:[n,"pending"]})),void 0===e.gas&&(i.gas=r.estimateGas.bind(r,function(e){return{from:e.from,to:e.to,value:e.value,data:e.data,gas:e.gas,gasPrice:e.gasPrice,nonce:e.nonce}}(e))),Eb(i,(function(r,n){if(r)return t(r);var i={};n.gasPrice&&(i.gasPrice=n.gasPrice),n.nonce&&(i.nonce=n.nonce.result),n.gas&&(i.gas=n.gas),t(null,dd(e,i))}))};var fv={v:5e3,d:"Gas limit of the Genesis block."},hv={v:17179869184,d:"Difficulty of the Genesis block."},dv={v:"0x0000000000000042",d:"the geneis nonce"},lv={v:"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa",d:"extra data "},pv={v:"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3",d:"genesis hash"},bv={v:"0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544",d:"the genesis state root"},vv={v:5e3,d:"Minimum the gas limit may ever be."},gv={v:1024,d:"The bound divisor of the gas limit, used in update calculations."},mv={v:131072,d:"The minimum that the difficulty may ever be."},yv={v:2048,d:"The bound divisor of the difficulty, used in the update calculations."},Av={v:13,d:"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not."},wv={v:32,d:"Maximum size extra data may be after Genesis."},Ev={v:3e4,d:"Duration between proof-of-work epochs."},Sv={v:1024,d:"Maximum size of VM stack allowed."},Mv={v:1024,d:"Maximum depth of call/create stack."},kv={v:[0,2,3,5,8,10,20],d:"Once per operation, for a selection of them."},Rv={v:10,d:"Once per EXP instuction."},Ov={v:10,d:"Times ceil(log256(exponent)) for the EXP instruction."},xv={v:30,d:"Once per SHA3 operation."},Iv={v:6,d:"Once per word of the SHA3 operation's data."},_v={v:50,d:"Once per SLOAD operation."},Cv={v:2e4,d:"Once per SSTORE operation if the zeroness changes from zero."},Tv={v:5e3,d:"Once per SSTORE operation if the zeroness does not change from zero."},Lv={v:15e3,d:"Once per SSTORE operation if the zeroness changes to zero."},Bv={v:1,d:"Refunded gas, once per SSTORE operation if the zeroness changes to zero."},Nv={v:375,d:"Per LOG* operation."},Pv={v:8,d:"Per byte in a LOG* operation's data."},jv={v:375,d:"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas."},Dv={v:32e3,d:"Once per CREATE operation & contract-creation transaction."},Hv={v:40,d:"Once per CALL operation & message call transaction."},zv={v:2300,d:"Free gas given at beginning of call."},Gv={v:9e3,d:"Paid for CALL when the value transfor is non-zero."},Fv={v:25e3,d:"Paid for CALL when the destination address didn't exist prior."},Wv={v:24e3,d:"Refunded following a suicide operation."},Yv={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."},Uv={v:512,d:"Divisor for the quadratic particle of the memory cost equation."},Kv={v:200,d:""},Vv={v:21e3,d:"Per transaction. NOTE: Not payable on data of calls between transactions."},Zv={v:32e3,d:"the cost of creating a contract via tx"},qv={v:4,d:"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions."},Xv={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."},Jv={v:3,d:"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added."},Qv={v:3e3,d:""},$v={v:60,d:""},eg={v:12,d:""},tg={v:600,d:""},rg={v:120,d:""},ng={v:15,d:""},ig={v:3,d:""},og={v:"5000000000000000000",d:"the amount a miner get rewarded for mining a block"},ag={v:"625000000000000000",d:"The amount of wei a miner of an uncle block gets for being inculded in the blockchain"},sg={v:"156250000000000000",d:"the amount a miner gets for inculding a uncle"},cg={v:115e4,d:"the block that the Homestead fork started at"},ug={v:2463e3,d:"the block that the Homestead Reprice (EIP150) fork started at"},fg={v:1e5,d:"Exponential difficulty timebomb period"},hg={v:2},dg={genesisGasLimit:fv,genesisDifficulty:hv,genesisNonce:dv,genesisExtraData:lv,genesisHash:pv,genesisStateRoot:bv,minGasLimit:vv,gasLimitBoundDivisor:gv,minimumDifficulty:mv,difficultyBoundDivisor:yv,durationLimit:Av,maximumExtraDataSize:wv,epochDuration:Ev,stackLimit:Sv,callCreateDepth:Mv,tierStepGas:kv,expGas:Rv,expByteGas:Ov,sha3Gas:xv,sha3WordGas:Iv,sloadGas:_v,sstoreSetGas:Cv,sstoreResetGas:Tv,sstoreRefundGas:Lv,jumpdestGas:Bv,logGas:Nv,logDataGas:Pv,logTopicGas:jv,createGas:Dv,callGas:Hv,callStipend:zv,callValueTransferGas:Gv,callNewAccountGas:Fv,suicideRefundGas:Wv,memoryGas:Yv,quadCoeffDiv:Uv,createDataGas:Kv,txGas:Vv,txCreation:Zv,txDataZeroGas:qv,txDataNonZeroGas:Xv,copyGas:Jv,ecrecoverGas:Qv,sha256Gas:$v,sha256WordGas:eg,ripemd160Gas:tg,ripemd160WordGas:rg,identityGas:ng,identityWordGas:ig,minerReward:og,ommerReward:ag,niblingReward:sg,homeSteadForkNumber:cg,homesteadRepriceForkNumber:ug,timebombPeriod:fg,freeBlockPeriod:hg},lg=Object(y.f)(Object.freeze({__proto__:null,genesisGasLimit:fv,genesisDifficulty:hv,genesisNonce:dv,genesisExtraData:lv,genesisHash:pv,genesisStateRoot:bv,minGasLimit:vv,gasLimitBoundDivisor:gv,minimumDifficulty:mv,difficultyBoundDivisor:yv,durationLimit:Av,maximumExtraDataSize:wv,epochDuration:Ev,stackLimit:Sv,callCreateDepth:Mv,tierStepGas:kv,expGas:Rv,expByteGas:Ov,sha3Gas:xv,sha3WordGas:Iv,sloadGas:_v,sstoreSetGas:Cv,sstoreResetGas:Tv,sstoreRefundGas:Lv,jumpdestGas:Bv,logGas:Nv,logDataGas:Pv,logTopicGas:jv,createGas:Dv,callGas:Hv,callStipend:zv,callValueTransferGas:Gv,callNewAccountGas:Fv,suicideRefundGas:Wv,memoryGas:Yv,quadCoeffDiv:Uv,createDataGas:Kv,txGas:Vv,txCreation:Zv,txDataZeroGas:qv,txDataNonZeroGas:Xv,copyGas:Jv,ecrecoverGas:Qv,sha256Gas:$v,sha256WordGas:eg,ripemd160Gas:tg,ripemd160WordGas:rg,identityGas:ng,identityWordGas:ig,minerReward:og,ommerReward:ag,niblingReward:sg,homeSteadForkNumber:cg,homesteadRepriceForkNumber:ug,timebombPeriod:fg,freeBlockPeriod:hg,default:dg})),pg=ud.BN,bg=new pg("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),vg=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=t||{};var r=[{name:"nonce",length:32,allowLess:!0,default:new n([])},{name:"gasPrice",length:32,allowLess:!0,default:new n([])},{name:"gasLimit",alias:"gas",length:32,allowLess:!0,default:new n([])},{name:"to",allowZero:!0,length:20,default:new n([])},{name:"value",length:32,allowLess:!0,default:new n([])},{name:"data",alias:"input",allowZero:!0,default:new n([])},{name:"v",allowZero:!0,default:new n([28])},{name:"r",length:32,allowZero:!0,allowLess:!0,default:new n([])},{name:"s",length:32,allowZero:!0,allowLess:!0,default:new n([])}];ud.defineProperties(this,r,t),Object.defineProperty(this,"from",{enumerable:!0,configurable:!0,get:this.getSenderAddress.bind(this)});var i=ud.bufferToInt(this.v),o=Math.floor((i-35)/2);o<0&&(o=0),this._chainId=o||t.chainId||0,this._homestead=!0}return e.prototype.toCreationAddress=function(){return""===this.to.toString("hex")},e.prototype.hash=function(e){void 0===e&&(e=!0);var t=void 0;if(e)t=this.raw;else if(this._chainId>0){var r=this.raw.slice();this.v=this._chainId,this.r=0,this.s=0,t=this.raw,this.raw=r}else t=this.raw.slice(0,6);return ud.rlphash(t)},e.prototype.getChainId=function(){return this._chainId},e.prototype.getSenderAddress=function(){if(this._from)return this._from;var e=this.getSenderPublicKey();return this._from=ud.publicToAddress(e),this._from},e.prototype.getSenderPublicKey=function(){if(!(this._senderPubKey&&this._senderPubKey.length||this.verifySignature()))throw new Error("Invalid Signature");return this._senderPubKey},e.prototype.verifySignature=function(){var e=this.hash(!1);if(this._homestead&&1===new pg(this.s).cmp(bg))return!1;try{var t=ud.bufferToInt(this.v);this._chainId>0&&(t-=2*this._chainId+8),this._senderPubKey=ud.ecrecover(e,t,this.r,this.s)}catch(e){return!1}return!!this._senderPubKey},e.prototype.sign=function(e){var t=this.hash(!1),r=ud.ecsign(t,e);this._chainId>0&&(r.v+=2*this._chainId+8),Object.assign(this,r)},e.prototype.getDataFee=function(){for(var e=this.raw[5],t=new pg(0),r=0;r0&&t.push(["gas limit is too low. Need at least "+this.getBaseFee()]),void 0===e||!1===e?0===t.length:t.join(" ")},e}(),gg=w.c.inherits,mg=function(e){var t=function(e){switch(e.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":return 1;case"eth_getBlockByNumber":return 0;default:return}}(e);return t>=e.params.length?null:e.params[t]},yg=Ag;function Ag(e){this.nonceCache={}}gg(Ag,Ep),Ag.prototype.handleRequest=function(e,t,r){var i=this;switch(e.method){case"eth_getTransactionCount":var o=mg(e),a=e.params[0].toLowerCase(),s=i.nonceCache[a];return void("pending"===o?s?r(null,s):t((function(e,t,r){if(e)return r();void 0===i.nonceCache[a]&&(i.nonceCache[a]=t),r()})):t());case"eth_sendRawTransaction":return void t((function(t,r,o){if(t)return o();var a=e.params[0],s=(ud.stripHexPrefix(a),n.from(ud.stripHexPrefix(a),"hex"),new vg(n.from(ud.stripHexPrefix(a),"hex"))),c="0x"+s.getSenderAddress().toString("hex").toLowerCase(),u=ud.bufferToInt(s.nonce),f=(++u).toString(16);f.length%2&&(f="0"+f),f="0x"+f,i.nonceCache[c]=f,o()}));case"evm_revert":return i.nonceCache={},void t();default:return void t()}};var wg=Zp,Eg=Kp;function Sg(e){return{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}var Mg=function(e){Object(f.a)(r,e);var t=Object(h.a)(r);function r(){return Object(d.a)(this,r),t.call(this,(function(e){var t=e.blockTracker,r=e.provider,n=e.engine,i=function(e){var t=e.blockTracker,r=e.provider,n={},i=bb({blockTracker:t,provider:r}),o=!1,s=new Pd,c=Fp({eth_subscribe:Lp(function(){var e=Object(a.a)(m.a.mark((function e(s,c){var f,h,d,l,p;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o){e.next=2;break}throw new Error("SubscriptionManager - attempting to use after destroying");case 2:f=s.params[0],h=wg(16),e.t0=f,e.next="newHeads"===e.t0?6:"logs"===e.t0?8:14;break;case 6:return d=function(e){var n=e.subId,i={type:f,destroy:function(){var e=Object(a.a)(m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.removeListener("sync",i.update);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),update:function(){var e=Object(a.a)(m.a.mark((function e(t){var i,o,a,s;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.oldBlock,o=t.newBlock,a=o,s=Eg(i),e.next=4,ib({provider:r,fromBlock:s,toBlock:a});case 4:e.sent.map(Sg).forEach((function(e){u(n,e)}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()};return t.on("sync",i.update),i}({subId:h}),e.abrupt("break",15);case 8:return l=s.params[1],e.next=11,i.newLogFilter(l);case 11:return p=e.sent,d=function(e){var t=e.subId,r=e.filter;return r.on("update",(function(e){return u(t,e)})),{type:f,destroy:function(){var e=Object(a.a)(m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.uninstallFilter(r.idHex);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}}({subId:h,filter:p}),e.abrupt("break",15);case 14:throw new Error('SubscriptionManager - unsupported subscription type "'.concat(f,'"'));case 15:return e.abrupt("return",(n[h]=d,void(c.result=h)));case 16:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()),eth_unsubscribe:Lp(function(){var e=Object(a.a)(m.a.mark((function e(t,r){var i,a;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o){e.next=2;break}throw new Error("SubscriptionManager - attempting to use after destroying");case 2:if(i=t.params[0],a=n[i]){e.next=5;break}return e.abrupt("return",void(r.result=!1));case 5:return delete n[i],e.next=8,a.destroy();case 8:r.result=!0;case 9:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}())});return c.destroy=function(){for(var e in s.removeAllListeners(),n)n[e].destroy(),delete n[e];o=!0},{events:s,middleware:c};function u(e,t){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:e,result:t}})}}({blockTracker:t,provider:r}),o=i.events,s=i.middleware;return o.on("notification",(function(e){return n.emit("data",null,e)})),s}))}return r}(Mp),kg=Object(y.b)((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=B.__importDefault(Nc),n=B.__importDefault(Hh),i=B.__importDefault(Vh);t.default=function(e){Object(f.a)(a,e);var t=Object(h.a)(a);function a(e){var i;if(Object(d.a)(this,a),(i=t.call(this,{pollingInterval:e.pollingInterval||8e3})).bridge="https://bridge.walletconnect.org",i.qrcode=!0,i.qrcodeModalOptions=void 0,i.rpc=null,i.infuraId="",i.http=null,i.isConnecting=!1,i.connected=!1,i.connectCallbacks=[],i.accounts=[],i.chainId=1,i.networkId=1,i.rpcUrl="",i.bridge=e.connector?e.connector.bridge:e.bridge||"https://bridge.walletconnect.org",i.qrcode=void 0===e.qrcode||!1!==e.qrcode,i.qrcodeModalOptions=e.qrcodeModalOptions,i.wc=e.connector||new r.default({bridge:i.bridge,qrcodeModal:i.qrcode?n.default:void 0,qrcodeModalOptions:i.qrcodeModalOptions}),i.rpc=e.rpc||null,!(i.rpc||e.infuraId&&"string"==typeof e.infuraId&&e.infuraId.trim()))throw new Error("Missing one of the required parameters: rpc or infuraId");return i.infuraId=e.infuraId||"",i.chainId=void 0!==e.chainId?e.chainId:1,i.networkId=i.chainId,i.updateRpcUrl(i.chainId),i.addProvider(new Dp({eth_hashrate:"0x00",eth_mining:!1,eth_syncing:!0,net_listening:!0,web3_clientVersion:"WalletConnect/v1.x.x/javascript"})),i.addProvider(new Pp),i.addProvider(new Mg),i.addProvider(new yb),i.addProvider(new yg),i.addProvider(new nv({getAccounts:function(e){return B.__awaiter(Object(s.a)(i),void 0,void 0,m.a.mark((function t(){var r;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.getWalletConnector();case 3:(r=t.sent.accounts)&&r.length?e(null,r):e(new Error("Failed to get accounts")),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),e(t.t0);case 10:case"end":return t.stop()}}),t,this,[[0,7]])})))},processMessage:function(e,t){return B.__awaiter(Object(s.a)(i),void 0,void 0,m.a.mark((function r(){var n,i;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.getWalletConnector();case 3:return n=r.sent,r.next=6,n.signMessage([e.from,e.data]);case 6:i=r.sent,t(null,i),r.next=13;break;case 10:r.prev=10,r.t0=r.catch(0),t(r.t0);case 13:case"end":return r.stop()}}),r,this,[[0,10]])})))},processPersonalMessage:function(e,t){return B.__awaiter(Object(s.a)(i),void 0,void 0,m.a.mark((function r(){var n,i;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.getWalletConnector();case 3:return n=r.sent,r.next=6,n.signPersonalMessage([e.data,e.from]);case 6:i=r.sent,t(null,i),r.next=13;break;case 10:r.prev=10,r.t0=r.catch(0),t(r.t0);case 13:case"end":return r.stop()}}),r,this,[[0,10]])})))},processSignTransaction:function(e,t){return B.__awaiter(Object(s.a)(i),void 0,void 0,m.a.mark((function r(){var n,i;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.getWalletConnector();case 3:return n=r.sent,r.next=6,n.signTransaction(e);case 6:i=r.sent,t(null,i),r.next=13;break;case 10:r.prev=10,r.t0=r.catch(0),t(r.t0);case 13:case"end":return r.stop()}}),r,this,[[0,10]])})))},processTransaction:function(e,t){return B.__awaiter(Object(s.a)(i),void 0,void 0,m.a.mark((function r(){var n,i;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.getWalletConnector();case 3:return n=r.sent,r.next=6,n.sendTransaction(e);case 6:i=r.sent,t(null,i),r.next=13;break;case 10:r.prev=10,r.t0=r.catch(0),t(r.t0);case 13:case"end":return r.stop()}}),r,this,[[0,10]])})))},processTypedMessage:function(e,t){return B.__awaiter(Object(s.a)(i),void 0,void 0,m.a.mark((function r(){var n,i;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.getWalletConnector();case 3:return n=r.sent,r.next=6,n.signTypedData([e.from,e.data]);case 6:i=r.sent,t(null,i),r.next=13;break;case 10:r.prev=10,r.t0=r.catch(0),t(r.t0);case 13:case"end":return r.stop()}}),r,this,[[0,10]])})))}})),i.addProvider({handleRequest:function(e,t,r){return B.__awaiter(Object(s.a)(i),void 0,void 0,m.a.mark((function t(){var n,i;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.handleRequest(e);case 3:n=t.sent,i=n.result,r(null,i),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),r(t.t0);case 11:case"end":return t.stop()}}),t,this,[[0,8]])})))},setEngine:function(e){return e}}),Object(o.a)(i)}return Object(l.a)(a,[{key:"isWalletConnect",get:function(){return!0}},{key:"connector",get:function(){return this.wc}},{key:"walletMeta",get:function(){return this.wc.peerMeta}},{key:"enable",value:function(){return B.__awaiter(this,void 0,void 0,m.a.mark((function e(){var t;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getWalletConnector();case 2:if(!(t=e.sent)){e.next=5;break}return e.abrupt("return",(this.start(),this.subscribeWalletConnector(),t.accounts));case 5:throw new Error("Failed to connect to WalleConnect");case 6:case"end":return e.stop()}}),e,this)})))}},{key:"request",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.send(e));case 1:case"end":return t.stop()}}),t,this)})))}},{key:"send",value:function(e,t){return B.__awaiter(this,void 0,void 0,m.a.mark((function r(){var n,i;return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("string"!=typeof e){r.next=4;break}return n=e,i=t,r.abrupt("return",("personal_sign"===n&&(i=pe.parsePersonalSign(i)),this.sendAsyncPromise(n,i)));case 4:if("personal_sign"===(e=Object.assign({id:pe.payloadId(),jsonrpc:"2.0"},e)).method&&(e.params=pe.parsePersonalSign(e.params)),t){r.next=6;break}return r.abrupt("return",this.sendAsyncPromise(e.method,e.params));case 6:this.sendAsync(e,t);case 7:case"end":return r.stop()}}),r,this)})))}},{key:"onConnect",value:function(e){this.connectCallbacks.push(e)}},{key:"triggerConnect",value:function(e){this.connectCallbacks&&this.connectCallbacks.length&&this.connectCallbacks.forEach((function(t){return t(e)}))}},{key:"disconnect",value:function(){return B.__awaiter(this,void 0,void 0,m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.close();case 1:case"end":return e.stop()}}),e,this)})))}},{key:"close",value:function(){return B.__awaiter(this,void 0,void 0,m.a.mark((function e(){var t;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getWalletConnector({disableSessionCreation:!0});case 2:return t=e.sent,e.next=5,t.killSession();case 5:return e.next=7,this.onDisconnect();case 7:case"end":return e.stop()}}),e,this)})))}},{key:"handleRequest",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r,n,i;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n=null,t.next=4,this.getWalletConnector();case 4:i=t.sent,t.t0=e.method,t.next="wc_killSession"===t.t0?8:"eth_accounts"===t.t0?12:"eth_coinbase"===t.t0?14:"eth_chainId"===t.t0?16:"net_version"===t.t0?18:"eth_uninstallFilter"===t.t0?20:22;break;case 8:return t.next=10,this.close();case 10:return n=null,t.abrupt("break",25);case 12:return n=i.accounts,t.abrupt("break",25);case 14:return n=i.accounts[0],t.abrupt("break",25);case 16:return n=i.chainId,t.abrupt("break",25);case 18:return n=i.networkId||i.chainId,t.abrupt("break",25);case 20:return this.sendAsync(e,(function(e){return e})),n=!0,t.abrupt("break",25);case 22:return t.next=24,this.handleOtherRequests(e);case 24:r=t.sent;case 25:return t.abrupt("return",r||this.formatResponse(e,n));case 28:throw t.prev=28,t.t1=t.catch(0),this.emit("error",t.t1),t.t1;case 31:case"end":return t.stop()}}),t,this,[[0,28]])})))}},{key:"handleOtherRequests",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r,n;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(pe.signingMethods.includes(e.method)||!e.method.startsWith("eth_")){t.next=2;break}return t.abrupt("return",this.handleReadRequests(e));case 2:return t.next=4,this.getWalletConnector();case 4:return r=t.sent,t.next=7,r.sendCustomRequest(e);case 7:return n=t.sent,t.abrupt("return",this.formatResponse(e,n));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"handleReadRequests",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.http){t.next=3;break}throw r=new Error("HTTP Connection not available"),this.emit("error",r),r;case 3:return t.abrupt("return",this.http.send(e));case 4:case"end":return t.stop()}}),t,this)})))}},{key:"formatResponse",value:function(e,t){return{id:e.id,jsonrpc:e.jsonrpc,result:t}}},{key:"getWalletConnector",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.disableSessionCreation,n=void 0!==r&&r;return new Promise((function(t,r){var i=e.wc;if(e.isConnecting)e.onConnect((function(e){return t(e)}));else if(i.connected||n)e.connected||(e.connected=!0,e.updateState(i.session)),t(i);else{e.isConnecting=!0;var o=e.chainId?{chainId:e.chainId}:void 0;i.on("modal_closed",(function(){r(new Error("User closed modal"))})),i.createSession(o).then((function(){i.on("connect",(function(n,o){if(n)return e.isConnecting=!1,r(n);e.isConnecting=!1,e.connected=!0,o&&e.updateState(o.params[0]),e.emit("connect"),e.triggerConnect(i),t(i)}))})).catch((function(t){e.isConnecting=!1,r(t)}))}}))}},{key:"subscribeWalletConnector",value:function(){return B.__awaiter(this,void 0,void 0,m.a.mark((function e(){var t,r=this;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getWalletConnector();case 2:(t=e.sent).on("disconnect",(function(e){e?r.emit("error",e):r.onDisconnect()})),t.on("session_update",(function(e,t){e?r.emit("error",e):r.updateState(t.params[0])}));case 4:case"end":return e.stop()}}),e,this)})))}},{key:"onDisconnect",value:function(){return B.__awaiter(this,void 0,void 0,m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.stop();case 2:this.emit("close",1e3,"Connection closed"),this.emit("disconnect",1e3,"Connection disconnected");case 4:case"end":return e.stop()}}),e,this)})))}},{key:"updateState",value:function(e){return B.__awaiter(this,void 0,void 0,m.a.mark((function t(){var r,n,i,o;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e.accounts,n=e.chainId,i=e.networkId,o=e.rpcUrl,(!this.accounts||r&&this.accounts!==r)&&(this.accounts=r,this.emit("accountsChanged",r)),(!this.chainId||n&&this.chainId!==n)&&(this.chainId=n,this.emit("chainChanged",n)),(!this.networkId||i&&this.networkId!==i)&&(this.networkId=i,this.emit("networkChanged",i)),this.updateRpcUrl(this.chainId,o||"");case 2:case"end":return t.stop()}}),t,this)})))}},{key:"updateRpcUrl",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r={1:"mainnet",3:"ropsten",4:"rinkeby",5:"goerli",42:"kovan"}[e];t||(this.rpc&&this.rpc[e]?t=this.rpc[e]:r&&(t="https://".concat(r,".infura.io/v3/").concat(this.infuraId))),t?(this.rpcUrl=t,this.updateHttpConnection()):this.emit("error",new Error("No RPC Url available for chainId: ".concat(e)))}},{key:"updateHttpConnection",value:function(){var e=this;this.rpcUrl&&(this.http=new i.default(this.rpcUrl),this.http.on("payload",(function(t){return e.emit("payload",t)})),this.http.on("error",(function(t){return e.emit("error",t)})))}},{key:"sendAsyncPromise",value:function(e,t){var r=this;return new Promise((function(n,i){r.sendAsync({id:pe.payloadId(),jsonrpc:"2.0",method:e,params:t||[]},(function(e,t){e?i(e):n(t.result)}))}))}}]),a}(Ap)})),Rg=Object(y.c)(kg);t.default=Rg}.call(this,r(90),r(52).Buffer,r(451).setImmediate)},736:function(e,t,r){"use strict";var n=r(373),i=r.n(n);r.d(t,"a",(function(){return i.a}));var o=r(10),a=r.n(o);r.d(t,"b",(function(){return a.a}));var s=r(450),c=r.n(s);r.d(t,"c",(function(){return c.a}))},761:function(e,t,r){"use strict";var n=r(110),i=r.n(n);r.d(t,"a",(function(){return i.a}))},875:function(e,t){t.endianness=function(){return"LE"},t.hostname=function(){return"undefined"!==typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"undefined"!==typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"}}}]); \ No newline at end of file diff --git a/static/js/10.920cd77d.chunk.js.LICENSE.txt b/bridge/static/js/10.38a242e1.chunk.js.LICENSE.txt similarity index 100% rename from static/js/10.920cd77d.chunk.js.LICENSE.txt rename to bridge/static/js/10.38a242e1.chunk.js.LICENSE.txt diff --git a/static/js/11.712bf097.chunk.js b/bridge/static/js/11.711038e8.chunk.js similarity index 99% rename from static/js/11.712bf097.chunk.js rename to bridge/static/js/11.711038e8.chunk.js index fd5266a..7673dc4 100644 --- a/static/js/11.712bf097.chunk.js +++ b/bridge/static/js/11.711038e8.chunk.js @@ -1,2 +1,2 @@ -/*! For license information please see 11.712bf097.chunk.js.LICENSE.txt */ -(this.webpackJsonpbridge=this.webpackJsonpbridge||[]).push([[11],{717:function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"WalletLink",(function(){return cu})),n.d(e,"WalletLinkProvider",(function(){return au})),n.d(e,"__moduleExports",(function(){return su}));var r=n(45),i=n(83),o=n(189),s=n(38),u=n(12),a=n.n(u),c=n(22),l=n(101),h=n(36),f=n(21),d=n(30),p=n(32),b=n(33),v=n(712),m=(n(0),n(328),n(73),n(52),n(735)),y=(n(372),n(724),n(111),n(759)),g=Object(v.b)((function(t){!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function r(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function i(t,e,n){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var o;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{o=m.a.Buffer}catch(t){}function s(t,e,r){for(var i=0,o=Math.min(t.length,r),s=0,u=e;u=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:c,s|=a}return n(!(240&s),"Invalid character in "+t),i}function u(t,e,r,i){for(var o=0,s=0,u=Math.min(t.length,r),a=e;a=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&s"}i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this._strip(),"le"===r&&this._initArray(this.toArray(),e,r)},i.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},i.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this._strip()},i.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=6)i=s(t,n,n+6),this.words[r]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,r++);n+6!==e&&(i=s(t,e,n+6),this.words[r]|=i<>>26-o&4194303),this._strip()},i.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var o=t.length-n,s=o%r,a=Math.min(o,o-s)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for?i.prototype[Symbol.for("nodejs.util.inspect.custom")]=c:i.prototype.inspect=c;var l=["","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"],h=[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],f=[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];function d(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,u=67108863&s,a=s/67108864|0;n.words[0]=u;for(var c=1;c>>26,h=67108863&a,f=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=f;d++){var p=c-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+h)/67108864|0,h=67108863&s}n.words[c]=0|h,a=0|l}return 0!==a?n.words[c]=0|a:n.length--,n._strip()}i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?l[6-a.length]+a+r:a+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=h[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modrn(d).toString(t);r=(p=p.idivn(d)).isZero()?b+r:l[c-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},i.prototype._toArrayLikeLE=function(t,e){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n=0&&(t[n--]=s>>8&255),n>=0&&(t[n--]=s>>16&255),6===o?(n>=0&&(t[n--]=s>>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n>=0)for(t[n--]=r;n>=0;)t[n--]=0},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;nt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(n=this,r=t):(n=t,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=t):(n=t,r=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,b=d>>>13,v=0|s[2],m=8191&v,y=v>>>13,g=0|s[3],w=8191&g,_=g>>>13,k=0|s[4],x=8191&k,S=k>>>13,M=0|s[5],E=8191&M,C=M>>>13,O=0|s[6],N=8191&O,T=O>>>13,j=0|s[7],I=8191&j,A=j>>>13,P=0|s[8],R=8191&P,D=P>>>13,L=0|s[9],B=8191&L,F=L>>>13,W=0|u[0],q=8191&W,U=W>>>13,V=0|u[1],z=8191&V,H=V>>>13,K=0|u[2],J=8191&K,$=K>>>13,G=0|u[3],Y=8191&G,Z=G>>>13,Q=0|u[4],X=8191&Q,tt=Q>>>13,et=0|u[5],nt=8191&et,rt=et>>>13,it=0|u[6],ot=8191&it,st=it>>>13,ut=0|u[7],at=8191&ut,ct=ut>>>13,lt=0|u[8],ht=8191<,ft=lt>>>13,dt=0|u[9],pt=8191&dt,bt=dt>>>13;n.negative=t.negative^e.negative,n.length=19;var vt=(c+(r=Math.imul(h,q))|0)+((8191&(i=(i=Math.imul(h,U))+Math.imul(f,q)|0))<<13)|0;c=((o=Math.imul(f,U))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(p,q),i=(i=Math.imul(p,U))+Math.imul(b,q)|0,o=Math.imul(b,U);var mt=(c+(r=r+Math.imul(h,z)|0)|0)+((8191&(i=(i=i+Math.imul(h,H)|0)+Math.imul(f,z)|0))<<13)|0;c=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(m,q),i=(i=Math.imul(m,U))+Math.imul(y,q)|0,o=Math.imul(y,U),r=r+Math.imul(p,z)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(b,z)|0,o=o+Math.imul(b,H)|0;var yt=(c+(r=r+Math.imul(h,J)|0)|0)+((8191&(i=(i=i+Math.imul(h,$)|0)+Math.imul(f,J)|0))<<13)|0;c=((o=o+Math.imul(f,$)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(w,q),i=(i=Math.imul(w,U))+Math.imul(_,q)|0,o=Math.imul(_,U),r=r+Math.imul(m,z)|0,i=(i=i+Math.imul(m,H)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,H)|0,r=r+Math.imul(p,J)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(b,J)|0,o=o+Math.imul(b,$)|0;var gt=(c+(r=r+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,Z)|0)+Math.imul(f,Y)|0))<<13)|0;c=((o=o+Math.imul(f,Z)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(x,q),i=(i=Math.imul(x,U))+Math.imul(S,q)|0,o=Math.imul(S,U),r=r+Math.imul(w,z)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,H)|0,r=r+Math.imul(m,J)|0,i=(i=i+Math.imul(m,$)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,$)|0,r=r+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,Z)|0;var wt=(c+(r=r+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(E,q),i=(i=Math.imul(E,U))+Math.imul(C,q)|0,o=Math.imul(C,U),r=r+Math.imul(x,z)|0,i=(i=i+Math.imul(x,H)|0)+Math.imul(S,z)|0,o=o+Math.imul(S,H)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,$)|0,r=r+Math.imul(m,Y)|0,i=(i=i+Math.imul(m,Z)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,Z)|0,r=r+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,tt)|0;var _t=(c+(r=r+Math.imul(h,nt)|0)|0)+((8191&(i=(i=i+Math.imul(h,rt)|0)+Math.imul(f,nt)|0))<<13)|0;c=((o=o+Math.imul(f,rt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(N,q),i=(i=Math.imul(N,U))+Math.imul(T,q)|0,o=Math.imul(T,U),r=r+Math.imul(E,z)|0,i=(i=i+Math.imul(E,H)|0)+Math.imul(C,z)|0,o=o+Math.imul(C,H)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,$)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,$)|0,r=r+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,Z)|0,r=r+Math.imul(m,X)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(b,nt)|0,o=o+Math.imul(b,rt)|0;var kt=(c+(r=r+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(f,ot)|0))<<13)|0;c=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(I,q),i=(i=Math.imul(I,U))+Math.imul(A,q)|0,o=Math.imul(A,U),r=r+Math.imul(N,z)|0,i=(i=i+Math.imul(N,H)|0)+Math.imul(T,z)|0,o=o+Math.imul(T,H)|0,r=r+Math.imul(E,J)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(C,J)|0,o=o+Math.imul(C,$)|0,r=r+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,Z)|0,r=r+Math.imul(w,X)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,tt)|0,r=r+Math.imul(m,nt)|0,i=(i=i+Math.imul(m,rt)|0)+Math.imul(y,nt)|0,o=o+Math.imul(y,rt)|0,r=r+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0;var xt=(c+(r=r+Math.imul(h,at)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(f,at)|0))<<13)|0;c=((o=o+Math.imul(f,ct)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(R,q),i=(i=Math.imul(R,U))+Math.imul(D,q)|0,o=Math.imul(D,U),r=r+Math.imul(I,z)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(A,z)|0,o=o+Math.imul(A,H)|0,r=r+Math.imul(N,J)|0,i=(i=i+Math.imul(N,$)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,$)|0,r=r+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,Z)|0,r=r+Math.imul(x,X)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,tt)|0,r=r+Math.imul(w,nt)|0,i=(i=i+Math.imul(w,rt)|0)+Math.imul(_,nt)|0,o=o+Math.imul(_,rt)|0,r=r+Math.imul(m,ot)|0,i=(i=i+Math.imul(m,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,r=r+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(b,at)|0,o=o+Math.imul(b,ct)|0;var St=(c+(r=r+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;c=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(B,q),i=(i=Math.imul(B,U))+Math.imul(F,q)|0,o=Math.imul(F,U),r=r+Math.imul(R,z)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(D,z)|0,o=o+Math.imul(D,H)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(A,J)|0,o=o+Math.imul(A,$)|0,r=r+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,Z)|0,r=r+Math.imul(E,X)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,tt)|0,r=r+Math.imul(x,nt)|0,i=(i=i+Math.imul(x,rt)|0)+Math.imul(S,nt)|0,o=o+Math.imul(S,rt)|0,r=r+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,r=r+Math.imul(m,at)|0,i=(i=i+Math.imul(m,ct)|0)+Math.imul(y,at)|0,o=o+Math.imul(y,ct)|0,r=r+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,ft)|0;var Mt=(c+(r=r+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,bt)|0)+Math.imul(f,pt)|0))<<13)|0;c=((o=o+Math.imul(f,bt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(B,z),i=(i=Math.imul(B,H))+Math.imul(F,z)|0,o=Math.imul(F,H),r=r+Math.imul(R,J)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,$)|0,r=r+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,Z)|0,r=r+Math.imul(N,X)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,tt)|0,r=r+Math.imul(E,nt)|0,i=(i=i+Math.imul(E,rt)|0)+Math.imul(C,nt)|0,o=o+Math.imul(C,rt)|0,r=r+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,r=r+Math.imul(w,at)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,at)|0,o=o+Math.imul(_,ct)|0,r=r+Math.imul(m,ht)|0,i=(i=i+Math.imul(m,ft)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ft)|0;var Et=(c+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;c=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(B,J),i=(i=Math.imul(B,$))+Math.imul(F,J)|0,o=Math.imul(F,$),r=r+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,Z)|0,r=r+Math.imul(I,X)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(N,nt)|0,i=(i=i+Math.imul(N,rt)|0)+Math.imul(T,nt)|0,o=o+Math.imul(T,rt)|0,r=r+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,r=r+Math.imul(x,at)|0,i=(i=i+Math.imul(x,ct)|0)+Math.imul(S,at)|0,o=o+Math.imul(S,ct)|0,r=r+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,ft)|0;var Ct=(c+(r=r+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,bt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,bt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(B,Y),i=(i=Math.imul(B,Z))+Math.imul(F,Y)|0,o=Math.imul(F,Z),r=r+Math.imul(R,X)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(D,X)|0,o=o+Math.imul(D,tt)|0,r=r+Math.imul(I,nt)|0,i=(i=i+Math.imul(I,rt)|0)+Math.imul(A,nt)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(N,ot)|0,i=(i=i+Math.imul(N,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,r=r+Math.imul(E,at)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(C,at)|0,o=o+Math.imul(C,ct)|0,r=r+Math.imul(x,ht)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(S,ht)|0,o=o+Math.imul(S,ft)|0;var Ot=(c+(r=r+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,bt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(B,X),i=(i=Math.imul(B,tt))+Math.imul(F,X)|0,o=Math.imul(F,tt),r=r+Math.imul(R,nt)|0,i=(i=i+Math.imul(R,rt)|0)+Math.imul(D,nt)|0,o=o+Math.imul(D,rt)|0,r=r+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,r=r+Math.imul(N,at)|0,i=(i=i+Math.imul(N,ct)|0)+Math.imul(T,at)|0,o=o+Math.imul(T,ct)|0,r=r+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(C,ht)|0,o=o+Math.imul(C,ft)|0;var Nt=(c+(r=r+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,bt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((o=o+Math.imul(S,bt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(B,nt),i=(i=Math.imul(B,rt))+Math.imul(F,nt)|0,o=Math.imul(F,rt),r=r+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,st)|0,r=r+Math.imul(I,at)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(A,at)|0,o=o+Math.imul(A,ct)|0,r=r+Math.imul(N,ht)|0,i=(i=i+Math.imul(N,ft)|0)+Math.imul(T,ht)|0,o=o+Math.imul(T,ft)|0;var Tt=(c+(r=r+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,bt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(B,ot),i=(i=Math.imul(B,st))+Math.imul(F,ot)|0,o=Math.imul(F,st),r=r+Math.imul(R,at)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(D,at)|0,o=o+Math.imul(D,ct)|0,r=r+Math.imul(I,ht)|0,i=(i=i+Math.imul(I,ft)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ft)|0;var jt=(c+(r=r+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,bt)|0)+Math.imul(T,pt)|0))<<13)|0;c=((o=o+Math.imul(T,bt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,r=Math.imul(B,at),i=(i=Math.imul(B,ct))+Math.imul(F,at)|0,o=Math.imul(F,ct),r=r+Math.imul(R,ht)|0,i=(i=i+Math.imul(R,ft)|0)+Math.imul(D,ht)|0,o=o+Math.imul(D,ft)|0;var It=(c+(r=r+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,bt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((o=o+Math.imul(A,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(B,ht),i=(i=Math.imul(B,ft))+Math.imul(F,ht)|0,o=Math.imul(F,ft);var At=(c+(r=r+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,bt)|0)+Math.imul(D,pt)|0))<<13)|0;c=((o=o+Math.imul(D,bt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863;var Pt=(c+(r=Math.imul(B,pt))|0)+((8191&(i=(i=Math.imul(B,bt))+Math.imul(F,pt)|0))<<13)|0;return c=((o=Math.imul(F,bt))+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,a[0]=vt,a[1]=mt,a[2]=yt,a[3]=gt,a[4]=wt,a[5]=_t,a[6]=kt,a[7]=xt,a[8]=St,a[9]=Mt,a[10]=Et,a[11]=Ct,a[12]=Ot,a[13]=Nt,a[14]=Tt,a[15]=jt,a[16]=It,a[17]=At,a[18]=Pt,0!==c&&(a[19]=c,n.length++),n};function b(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}n.words[o]=u,r=s,s=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function v(t,e,n){return b(t,e,n)}Math.imul||(p=d),i.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?b(this,t,e):v(this,t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),v(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n>>i&1}return e}(t);if(0===e.length)return new i(1);for(var n=this,r=0;r=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<s)for(this.length-=s,c=0;c=0&&(0!==l||c>=i);c--){var h=0|this.words[c];this.words[c]=l<<26-o|h>>>o,l=h&u}return a&&0!==l&&(a.words[a.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(a/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===u)return this._strip();for(n(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),o=t,s=0|o.words[o.length-1];0!==(n=26-this._countBits(s))&&(o=o.ushln(n),r.iushln(n),s=0|o.words[o.length-1]);var u,a=r.length-o.length;if("mod"!==e){(u=new i(null)).length=a+1,u.words=new Array(u.length);for(var c=0;c=0;h--){var f=67108864*(0|r.words[o.length+h])+(0|r.words[o.length+h-1]);for(f=Math.min(f/s|0,67108863),r._ishlnsubmul(o,f,h);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(o,1,h),r.isZero()||(r.negative^=1);u&&(u.words[h]=f)}return u&&u._strip(),r._strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:u||null,mod:r}},i.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(o=u.div.neg()),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(o=u.div.neg()),{div:o,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:u.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modrn(t.words[0]))}:this._wordDiv(t,e);var o,s,u},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},i.prototype.modn=function(t){return this.modrn(t)},i.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),s=new i(0),u=new i(0),a=new i(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(l),s.isub(h)),o.iushrn(1),s.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(u.isOdd()||a.isOdd())&&(u.iadd(l),a.isub(h)),u.iushrn(1),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(u),s.isub(a)):(r.isub(e),u.isub(o),a.isub(s))}return{a:u,b:a,gcd:r.iushln(c)}},i.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,s=new i(1),u=new i(0),a=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(a),s.iushrn(1);for(var h=0,f=1;0==(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)u.isOdd()&&u.iadd(a),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(u)):(r.isub(e),u.isub(s))}return(o=0===e.cmpn(1)?s:u).cmpn(0)<0&&o.iadd(t),o},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var o=e;e=n,n=o}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,u&=67108863,this.words[s]=u}return 0!==o&&(this.words[s]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){ri&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new S(t)},i.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}g.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?n.isub(this.p):n._strip(),n},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},r(w,g),w.prototype.split=function(t,e){for(var n=Math.min(t.length,9),r=0;r>>22,i=o}i>>>=22,t.words[r-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new _;else if("p192"===t)e=new k;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new x}return y[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(a(t,t.umod(this.m)._forceRed(this)),t)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},S.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new i(1)).iushrn(2);return this.pow(t,r)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);n(!o.isZero());var u=new i(1).toRed(this),a=u.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(a);)l.redIAdd(a);for(var h=this.pow(l,o),f=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(u);){for(var b=d,v=0;0!==b.cmp(u);v++)b=b.redSqr();n(v=0;r--){for(var c=e.words[r],l=a-1;l>=0;l--){var h=c>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==h||0!==s?(s<<=1,s|=h,(4===++u||0===r&&0===l)&&(o=this.mul(o,n[s]),u=0,s=0)):u=0}a=26}return o},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new M(t)},r(M,S),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,v.d)})),w=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.OpaqueType=function(){return function(t){return t}},e.HexString=function(t){return t},e.AddressString=function(t){return t},e.BigIntString=function(t){return t},e.IntNumber=function(t){return Math.floor(t)},e.RegExpString=function(t){return t}}));Object(v.c)(w),w.OpaqueType,w.HexString,w.AddressString,w.BigIntString,w.IntNumber,w.RegExpString;var _=Object(v.b)((function(e,n){var r=v.d&&v.d.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var i=r(g),o=/^[0-9]*$/,s=/^[a-f0-9]*$/;function u(t){return t.startsWith("0x")||t.startsWith("0X")}function a(t){return u(t)?t.slice(2):t}function c(t){return u(t)?"0x"+t.slice(2):"0x"+t}function l(t){if("string"!=typeof t)return!1;var e=a(t).toLowerCase();return s.test(e)}function h(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"==typeof t){var n=a(t).toLowerCase();if(s.test(n))return w.HexString(e?"0x"+n:n)}throw new Error('"'.concat(t,'" is not a hexadecimal string'))}function f(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=h(t,!1);return n.length%2==1&&(n=w.HexString("0"+n)),e?w.HexString("0x"+n):n}function d(t){if("number"==typeof t&&Number.isInteger(t))return w.IntNumber(t);if("string"==typeof t){if(o.test(t))return w.IntNumber(Number(t));if(l(t))return w.IntNumber(new i.default(f(t,!1),16).toNumber())}throw new Error("Not an integer: ".concat(t))}function p(t){if(null==t||"function"!=typeof t.constructor)return!1;var e=t.constructor;return"function"==typeof e.config&&"number"==typeof e.EUCLID}n.hexStringFromBuffer=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.toString("hex");return w.HexString(e?"0x"+n:n)},n.bigIntStringFromBN=function(t){return w.BigIntString(t.toString(10))},n.intNumberFromHexString=function(t){return w.IntNumber(new i.default(f(t,!1),16).toNumber())},n.hexStringFromIntNumber=function(t){return w.HexString("0x"+new i.default(t).toString(16))},n.has0xPrefix=u,n.strip0x=a,n.prepend0x=c,n.isHexString=l,n.ensureHexString=h,n.ensureEvenLengthHexString=f,n.ensureAddressString=function(t){if("string"==typeof t){var e=a(t).toLowerCase();if(l(e)&&40===e.length)return w.AddressString(c(e))}throw new Error("Invalid Ethereum address: ".concat(t))},n.ensureBuffer=function(e){if(t.isBuffer(e))return e;if("string"==typeof e){if(l(e)){var n=f(e,!1);return t.from(n,"hex")}return t.from(e,"utf8")}throw new Error("Not binary data: ".concat(e))},n.ensureIntNumber=d,n.ensureRegExpString=function(t){if(t instanceof RegExp)return w.RegExpString(t.toString());throw new Error("Not a RegExp: ".concat(t))},n.ensureBN=function(t){if(null!=t&&(i.default.isBN(t)||p(t)))return new i.default(t.toString(10),10);if("number"==typeof t)return new i.default(d(t));if("string"==typeof t){if(o.test(t))return new i.default(t,10);if(l(t))return new i.default(f(t,!1),16)}throw new Error("Not an integer: ".concat(t))},n.isBigNumber=p,n.range=function(t,e){return Array.from({length:e-t},(function(e,n){return t+n}))},n.getFavicon=function(){var t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),e=document.location,n=e.protocol,r=e.host,i=t?t.getAttribute("href"):null;return!i||i.startsWith("javascript:")?null:i.startsWith("http://")||i.startsWith("https://")||i.startsWith("data:")?i:i.startsWith("//")?n+i:"".concat(n,"//").concat(r).concat(i)}}));Object(v.c)(_),_.hexStringFromBuffer,_.bigIntStringFromBN,_.intNumberFromHexString,_.hexStringFromIntNumber,_.has0xPrefix,_.strip0x,_.prepend0x,_.isHexString,_.ensureHexString,_.ensureEvenLengthHexString,_.ensureAddressString,_.ensureBuffer,_.ensureIntNumber,_.ensureRegExpString,_.ensureBN,_.isBigNumber,_.range,_.getFavicon;var k=m.b.Transform,x=m.b.Transform,S=[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],M=function(t){for(var e=0;e<24;++e){var n=t[0]^t[10]^t[20]^t[30]^t[40],r=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],o=t[3]^t[13]^t[23]^t[33]^t[43],s=t[4]^t[14]^t[24]^t[34]^t[44],u=t[5]^t[15]^t[25]^t[35]^t[45],a=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],l=t[8]^t[18]^t[28]^t[38]^t[48],h=t[9]^t[19]^t[29]^t[39]^t[49],f=l^(i<<1|o>>>31),d=h^(o<<1|i>>>31),p=t[0]^f,b=t[1]^d,v=t[10]^f,m=t[11]^d,y=t[20]^f,g=t[21]^d,w=t[30]^f,_=t[31]^d,k=t[40]^f,x=t[41]^d;f=n^(s<<1|u>>>31),d=r^(u<<1|s>>>31);var M=t[2]^f,E=t[3]^d,C=t[12]^f,O=t[13]^d,N=t[22]^f,T=t[23]^d,j=t[32]^f,I=t[33]^d,A=t[42]^f,P=t[43]^d;f=i^(a<<1|c>>>31),d=o^(c<<1|a>>>31);var R=t[4]^f,D=t[5]^d,L=t[14]^f,B=t[15]^d,F=t[24]^f,W=t[25]^d,q=t[34]^f,U=t[35]^d,V=t[44]^f,z=t[45]^d;f=s^(l<<1|h>>>31),d=u^(h<<1|l>>>31);var H=t[6]^f,K=t[7]^d,J=t[16]^f,$=t[17]^d,G=t[26]^f,Y=t[27]^d,Z=t[36]^f,Q=t[37]^d,X=t[46]^f,tt=t[47]^d;f=a^(n<<1|r>>>31),d=c^(r<<1|n>>>31);var et=t[8]^f,nt=t[9]^d,rt=t[18]^f,it=t[19]^d,ot=t[28]^f,st=t[29]^d,ut=t[38]^f,at=t[39]^d,ct=t[48]^f,lt=t[49]^d,ht=p,ft=b,dt=m<<4|v>>>28,pt=v<<4|m>>>28,bt=y<<3|g>>>29,vt=g<<3|y>>>29,mt=_<<9|w>>>23,yt=w<<9|_>>>23,gt=k<<18|x>>>14,wt=x<<18|k>>>14,_t=M<<1|E>>>31,kt=E<<1|M>>>31,xt=O<<12|C>>>20,St=C<<12|O>>>20,Mt=N<<10|T>>>22,Et=T<<10|N>>>22,Ct=I<<13|j>>>19,Ot=j<<13|I>>>19,Nt=A<<2|P>>>30,Tt=P<<2|A>>>30,jt=D<<30|R>>>2,It=R<<30|D>>>2,At=L<<6|B>>>26,Pt=B<<6|L>>>26,Rt=W<<11|F>>>21,Dt=F<<11|W>>>21,Lt=q<<15|U>>>17,Bt=U<<15|q>>>17,Ft=z<<29|V>>>3,Wt=V<<29|z>>>3,qt=H<<28|K>>>4,Ut=K<<28|H>>>4,Vt=$<<23|J>>>9,zt=J<<23|$>>>9,Ht=G<<25|Y>>>7,Kt=Y<<25|G>>>7,Jt=Z<<21|Q>>>11,$t=Q<<21|Z>>>11,Gt=tt<<24|X>>>8,Yt=X<<24|tt>>>8,Zt=et<<27|nt>>>5,Qt=nt<<27|et>>>5,Xt=rt<<20|it>>>12,te=it<<20|rt>>>12,ee=st<<7|ot>>>25,ne=ot<<7|st>>>25,re=ut<<8|at>>>24,ie=at<<8|ut>>>24,oe=ct<<14|lt>>>18,se=lt<<14|ct>>>18;t[0]=ht^~xt&Rt,t[1]=ft^~St&Dt,t[10]=qt^~Xt&bt,t[11]=Ut^~te&vt,t[20]=_t^~At&Ht,t[21]=kt^~Pt&Kt,t[30]=Zt^~dt&Mt,t[31]=Qt^~pt&Et,t[40]=jt^~Vt&ee,t[41]=It^~zt&ne,t[2]=xt^~Rt&Jt,t[3]=St^~Dt&$t,t[12]=Xt^~bt&Ct,t[13]=te^~vt&Ot,t[22]=At^~Ht&re,t[23]=Pt^~Kt&ie,t[32]=dt^~Mt&Lt,t[33]=pt^~Et&Bt,t[42]=Vt^~ee&mt,t[43]=zt^~ne&yt,t[4]=Rt^~Jt&oe,t[5]=Dt^~$t&se,t[14]=bt^~Ct&Ft,t[15]=vt^~Ot&Wt,t[24]=Ht^~re>,t[25]=Kt^~ie&wt,t[34]=Mt^~Lt&Gt,t[35]=Et^~Bt&Yt,t[44]=ee^~mt&Nt,t[45]=ne^~yt&Tt,t[6]=Jt^~oe&ht,t[7]=$t^~se&ft,t[16]=Ct^~Ft&qt,t[17]=Ot^~Wt&Ut,t[26]=re^~gt&_t,t[27]=ie^~wt&kt,t[36]=Lt^~Gt&Zt,t[37]=Bt^~Yt&Qt,t[46]=mt^~Nt&jt,t[47]=yt^~Tt&It,t[8]=oe^~ht&xt,t[9]=se^~ft&St,t[18]=Ft^~qt&Xt,t[19]=Wt^~Ut&te,t[28]=gt^~_t&At,t[29]=wt^~kt&Pt,t[38]=Gt^~Zt&dt,t[39]=Yt^~Qt&pt,t[48]=Nt^~jt&Vt,t[49]=Tt^~It&zt,t[0]^=S[2*e],t[1]^=S[2*e+1]}};function E(){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}E.prototype.initialize=function(t,e){for(var n=0;n<50;++n)this.state[n]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1},E.prototype.absorb=function(t){for(var e=0;e>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(M(this.state),this.count=0);return n},E.prototype.copy=function(t){for(var e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var C=function(e){var n=function(e){return function(n){Object(p.a)(i,n);var r=Object(b.a)(i);function i(t,n,o,s,u){var a;return Object(f.a)(this,i),(a=r.call(this,u))._rate=t,a._capacity=n,a._delimitedSuffix=o,a._hashBitLength=s,a._options=u,a._state=new e,a._state.initialize(t,n),a._finalized=!1,a}return Object(d.a)(i,[{key:"_transform",value:function(t,e,n){var r=null;try{this.update(t,e)}catch(t){r=t}n(r)}},{key:"_flush",value:function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)}},{key:"update",value:function(e,n){if(!t.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return t.isBuffer(e)||(e=t.from(e,n)),this._state.absorb(e),this}},{key:"digest",value:function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var e=this._state.squeeze(this._hashBitLength/8);return void 0!==t&&(e=e.toString(t)),this._resetState(),e}},{key:"_resetState",value:function(){return this._state.initialize(this._rate,this._capacity),this}},{key:"_clone",value:function(){var t=new i(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}}]),i}(k)}(e),r=function(e){return function(n){Object(p.a)(i,n);var r=Object(b.a)(i);function i(t,n,o,s){var u;return Object(f.a)(this,i),(u=r.call(this,s))._rate=t,u._capacity=n,u._delimitedSuffix=o,u._options=s,u._state=new e,u._state.initialize(t,n),u._finalized=!1,u}return Object(d.a)(i,[{key:"_transform",value:function(t,e,n){var r=null;try{this.update(t,e)}catch(t){r=t}n(r)}},{key:"_flush",value:function(){}},{key:"_read",value:function(t){this.push(this.squeeze(t))}},{key:"update",value:function(e,n){if(!t.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return t.isBuffer(e)||(e=t.from(e,n)),this._state.absorb(e),this}},{key:"squeeze",value:function(t,e){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var n=this._state.squeeze(t);return void 0!==e&&(n=n.toString(e)),n}},{key:"_resetState",value:function(){return this._state.initialize(this._rate,this._capacity),this}},{key:"_clone",value:function(){var t=new i(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}}]),i}(x)}(e);return function(t,e){switch("string"==typeof t?t.toLowerCase():t){case"keccak224":return new n(1152,448,null,224,e);case"keccak256":return new n(1088,512,null,256,e);case"keccak384":return new n(832,768,null,384,e);case"keccak512":return new n(576,1024,null,512,e);case"sha3-224":return new n(1152,448,6,224,e);case"sha3-256":return new n(1088,512,6,256,e);case"sha3-384":return new n(832,768,6,384,e);case"sha3-512":return new n(576,1024,6,512,e);case"shake128":return new r(1344,256,31,e);case"shake256":return new r(1088,512,31,e);default:throw new Error("Invald algorithm: "+t)}}}(E);function O(e){return t.allocUnsafe(e).fill(0)}function N(t,e,n){var r=O(e);return t=T(t),n?t.lengthr)throw new Error("Elements exceed array size: "+r);for(s in o=[],e=e.slice(0,e.lastIndexOf("[")),"string"==typeof n&&(n=JSON.parse(n)),n)o.push(F(e,n[s]));if("dynamic"===r){var u=F("uint256",n.length);o.unshift(u)}return t.concat(o)}if("bytes"===e)return n=new t(n),o=t.concat([F("uint256",n.length),n]),n.length%32!=0&&(o=t.concat([o,A.zeros(32-n.length%32)])),o;if(e.startsWith("bytes")){if((r=R(e))<1||r>32)throw new Error("Invalid bytes width: "+r);return A.setLengthRight(n,32)}if(e.startsWith("uint")){if((r=R(e))%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if((i=B(n)).bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+i.bitLength());if(i<0)throw new Error("Supplied uint is negative");return i.toArrayLike(t,"be",32)}if(e.startsWith("int")){if((r=R(e))%8||r<8||r>256)throw new Error("Invalid int width: "+r);if((i=B(n)).bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+i.bitLength());return i.toTwos(256).toArrayLike(t,"be",32)}if(e.startsWith("ufixed")){if(r=D(e),(i=B(n))<0)throw new Error("Supplied ufixed is negative");return F("uint256",i.mul(new g(2).pow(new g(r[1]))))}if(e.startsWith("fixed"))return r=D(e),F("int256",B(n).mul(new g(2).pow(new g(r[1]))));throw new Error("Unsupported or invalid type: "+e)}function W(t){return"string"===t||"bytes"===t||"dynamic"===L(t)}function q(e,n){if(e.length!==n.length)throw new Error("Number of types are not matching the values");for(var r,i,o=[],s=0;s32)throw new Error("Invalid bytes width: "+r);o.push(A.setLengthRight(a,r))}else if(u.startsWith("uint")){if((r=R(u))%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if((i=B(a)).bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+i.bitLength());o.push(i.toArrayLike(t,"be",r/8))}else{if(!u.startsWith("int"))throw new Error("Unsupported or invalid type: "+u);if((r=R(u))%8||r<8||r>256)throw new Error("Invalid int width: "+r);if((i=B(a)).bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+i.bitLength());o.push(i.toTwos(r).toArrayLike(t,"be",r/8))}}return t.concat(o)}var U=function(e,n){var r=[],i=[],o=32*e.length;for(var s in e){var u=P(e[s]),a=F(u,n[s]);W(u)?(r.push(F("uint256",o)),i.push(a),o+=a.length):r.push(a)}return t.concat(r.concat(i))},V=function(t,e){return A.keccak(q(t,e))},z={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},H={encodeData:function(e,n,r){var i=this,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=["bytes32"],u=[this.hashType(e,r)];if(o){var a,c=function e(n,s,u){if(void 0!==r[s])return["bytes32",null==u?"0x0000000000000000000000000000000000000000000000000000000000000000":A.keccak(i.encodeData(s,u,r,o))];if(void 0===u)throw new Error("missing value for field ".concat(n," of type ").concat(s));if("bytes"===s)return["bytes32",A.keccak(u)];if("string"===s)return"string"==typeof u&&(u=t.from(u,"utf8")),["bytes32",A.keccak(u)];if(s.lastIndexOf("]")===s.length-1){var a=s.slice(0,s.lastIndexOf("[")),c=u.map((function(t){return e(n,a,t)}));return["bytes32",A.keccak(U(c.map((function(t){return Object(h.a)(t,1)[0]})),c.map((function(t){return Object(h.a)(t,2)[1]}))))]}return[s,u]},f=Object(l.a)(r[e]);try{for(f.s();!(a=f.n()).done;){var d=a.value,p=c(d.name,d.type,n[d.name]),b=Object(h.a)(p,2),v=b[0],m=b[1];s.push(v),u.push(m)}}catch(k){f.e(k)}finally{f.f()}}else{var y,g=Object(l.a)(r[e]);try{for(g.s();!(y=g.n()).done;){var w=y.value,_=n[w.name];if(void 0!==_)if("bytes"===w.type)s.push("bytes32"),_=A.keccak(_),u.push(_);else if("string"===w.type)s.push("bytes32"),"string"==typeof _&&(_=t.from(_,"utf8")),_=A.keccak(_),u.push(_);else if(void 0!==r[w.type])s.push("bytes32"),_=A.keccak(this.encodeData(w.type,_,r,o)),u.push(_);else{if(w.type.lastIndexOf("]")===w.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");s.push(w.type),u.push(_)}}}catch(k){g.e(k)}finally{g.f()}}return U(s,u)},encodeType:function(t,e){var n="",r=this.findTypeDependencies(t,e).filter((function(e){return e!==t}));r=[t].concat(r.sort());var i,o=Object(l.a)(r);try{for(o.s();!(i=o.n()).done;){var s=i.value;if(!e[s])throw new Error("No type definition specified: "+s);n+=s+"("+e[s].map((function(t){var e=t.name;return t.type+" "+e})).join(",")+")"}}catch(u){o.e(u)}finally{o.f()}return n},findTypeDependencies:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(t=t.match(/^\w*/)[0],n.includes(t)||void 0===e[t])return n;n.push(t);var r,i=Object(l.a)(e[t]);try{for(i.s();!(r=i.n()).done;){var o,s=r.value,u=Object(l.a)(this.findTypeDependencies(s.type,e,n));try{for(u.s();!(o=u.n()).done;){var a=o.value;!n.includes(a)&&n.push(a)}}catch(c){u.e(c)}finally{u.f()}}}catch(c){i.e(c)}finally{i.f()}return n},hashStruct:function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return A.keccak(this.encodeData(t,e,n,r))},hashType:function(t,e){return A.keccak(this.encodeType(t,e))},sanitizeData:function(t){var e={};for(var n in z.properties)t[n]&&(e[n]=t[n]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.sanitizeData(e),i=[t.from("1901","hex")];return i.push(this.hashStruct("EIP712Domain",r.domain,r.types,n)),"EIP712Domain"!==r.primaryType&&i.push(this.hashStruct(r.primaryType,r.message,r.types,n)),A.keccak(t.concat(i))}},K={TYPED_MESSAGE_SCHEMA:z,TypedDataUtils:H,hashForSignTypedDataLegacy:function(t){return function(t){var e=new Error("Expect argument to be non-empty array");if("object"!=typeof t||!t.length)throw e;var n=t.map((function(t){return"bytes"===t.type?A.toBuffer(t.value):t.value})),r=t.map((function(t){return t.type})),i=t.map((function(t){if(!t.name)throw e;return t.type+" "+t.name}));return V(["bytes32","bytes32"],[V(new Array(t.length).fill("string"),i),V(r,n)])}(t.data)},hashForSignTypedData_v3:function(t){return H.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return H.hash(t.data)}},J=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n={jsonrpc:"2.0",id:0};function r(t){return{fromBlock:o(t.fromBlock),toBlock:o(t.toBlock),addresses:void 0===t.address?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}function i(t){var e={fromBlock:u(t.fromBlock),toBlock:u(t.toBlock),topics:t.topics};return null!==t.addresses&&(e.address=t.addresses),e}function o(t){if(void 0===t||"latest"===t||"pending"===t)return"latest";if("earliest"===t)return w.IntNumber(0);if(_.isHexString(t))return _.intNumberFromHexString(t);throw new Error("Invalid block option: ".concat(t))}function u(t){return"latest"===t?t:_.hexStringFromIntNumber(t)}function l(){return Object.assign(Object.assign({},n),{error:{code:-32e3,message:"filter not found"}})}function h(){return Object.assign(Object.assign({},n),{result:[]})}e.FilterPolyfill=function(){function t(e){Object(f.a)(this,t),this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=w.IntNumber(1),this.provider=e}return Object(d.a)(t,[{key:"newFilter",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var n,i,o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r(e),i=this.makeFilterId(),t.next=4,this.setInitialCursorPosition(i,n.fromBlock);case 4:return o=t.sent,t.abrupt("return",(console.log("Installing new log filter(".concat(i,"):"),n,"initial cursor position:",o),this.logFilters.set(i,n),this.setFilterTimeout(i),_.hexStringFromIntNumber(i)));case 6:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"newBlockFilter",value:function(){var t=Object(c.a)(a.a.mark((function t(){var e,n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.makeFilterId(),t.next=3,this.setInitialCursorPosition(e,"latest");case 3:return n=t.sent,t.abrupt("return",(console.log("Installing new block filter (".concat(e,") with initial cursor position:"),n),this.blockFilters.add(e),this.setFilterTimeout(e),_.hexStringFromIntNumber(e)));case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"newPendingTransactionFilter",value:function(){var t=Object(c.a)(a.a.mark((function t(){var e,n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.makeFilterId(),t.next=3,this.setInitialCursorPosition(e,"latest");case 3:return n=t.sent,t.abrupt("return",(console.log("Installing new block filter (".concat(e,") with initial cursor position:"),n),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),_.hexStringFromIntNumber(e)));case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"uninstallFilter",value:function(t){var e=_.intNumberFromHexString(t);return console.log("Uninstalling filter (".concat(e,")")),this.deleteFilter(e),!0}},{key:"getFilterChanges",value:function(t){var e=_.intNumberFromHexString(t);return this.timeouts.has(e)&&this.setFilterTimeout(e),this.logFilters.has(e)?this.getLogFilterChanges(e):this.blockFilters.has(e)?this.getBlockFilterChanges(e):this.pendingTransactionFilters.has(e)?this.getPendingTransactionFilterChanges(e):Promise.resolve(l())}},{key:"getFilterLogs",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var r,o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=_.intNumberFromHexString(e),o=this.logFilters.get(r),t.abrupt("return",o?this.sendAsyncPromise(Object.assign(Object.assign({},n),{method:"eth_getLogs",params:[i(o)]})):l());case 2:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"makeFilterId",value:function(){return w.IntNumber(++this.nextFilterId)}},{key:"sendAsyncPromise",value:function(t){var e=this;return new Promise((function(n,r){e.provider.sendAsync(t,(function(t,e){return t?r(t):Array.isArray(e)||null==e?r(new Error("unexpected response received: ".concat(JSON.stringify(e)))):void n(e)}))}))}},{key:"deleteFilter",value:function(t){console.log("Deleting filter (".concat(t,")")),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}},{key:"getLogFilterChanges",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var r,o,u,c,f,d,p,b;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.logFilters.get(e),(o=this.cursors.get(e))&&r){t.next=3;break}return t.abrupt("return",l());case 3:return t.next=5,this.getCurrentBlockHeight();case 5:if(u=t.sent,c="latest"===r.toBlock?u:r.toBlock,!(o>u)){t.next=9;break}return t.abrupt("return",h());case 9:if(!(o>r.toBlock)){t.next=11;break}return t.abrupt("return",h());case 11:return console.log("Fetching logs from ".concat(o," to ").concat(c," for filter ").concat(e)),t.next=14,this.sendAsyncPromise(Object.assign(Object.assign({},n),{method:"eth_getLogs",params:[i(Object.assign(Object.assign({},r),{fromBlock:o,toBlock:c}))]}));case 14:return f=t.sent,Array.isArray(f.result)&&(d=f.result.map((function(t){return _.intNumberFromHexString(t.blockNumber||"0x0")})),(p=Math.max.apply(Math,Object(s.a)(d)))&&p>o&&(b=w.IntNumber(p+1),console.log("Moving cursor position for filter (".concat(e,") from ").concat(o," to ").concat(b)),this.cursors.set(e,b))),t.abrupt("return",f);case 17:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"getBlockFilterChanges",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var r,i,o,s,u=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.cursors.get(e)){t.next=3;break}return t.abrupt("return",l());case 3:return t.next=5,this.getCurrentBlockHeight();case 5:if(i=t.sent,!(r>i)){t.next=8;break}return t.abrupt("return",h());case 8:return console.log("Fetching blocks from ".concat(r," to ").concat(i," for filter (").concat(e,")")),t.next=11,Promise.all(_.range(r,i+1).map((function(t){return u.getBlockHashByNumber(w.IntNumber(t))})));case 11:return o=t.sent.filter((function(t){return!!t})),s=w.IntNumber(r+o.length),t.abrupt("return",(console.log("Moving cursor position for filter (".concat(e,") from ").concat(r," to ").concat(s)),this.cursors.set(e,s),Object.assign(Object.assign({},n),{result:o})));case 14:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"getPendingTransactionFilterChanges",value:function(){var t=Object(c.a)(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Promise.resolve(h()));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},{key:"setInitialCursorPosition",value:function(){var t=Object(c.a)(a.a.mark((function t(e,n){var r,i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getCurrentBlockHeight();case 2:return r=t.sent,i="number"==typeof n&&n>r?n:r,t.abrupt("return",(this.cursors.set(e,i),i));case 5:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}()},{key:"setFilterTimeout",value:function(t){var e=this,n=this.timeouts.get(t);n&&window.clearTimeout(n);var r=window.setTimeout((function(){console.log("Filter (".concat(t,") timed out")),e.deleteFilter(t)}),3e5);this.timeouts.set(t,r)}},{key:"getCurrentBlockHeight",value:function(){var t=Object(c.a)(a.a.mark((function t(){var e,r;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sendAsyncPromise(Object.assign(Object.assign({},n),{method:"eth_blockNumber",params:[]}));case 2:return e=t.sent,r=e.result,t.abrupt("return",_.intNumberFromHexString(_.ensureHexString(r)));case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"getBlockHashByNumber",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var r;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sendAsyncPromise(Object.assign(Object.assign({},n),{method:"eth_getBlockByNumber",params:[_.hexStringFromIntNumber(e),!1]}));case 2:return r=t.sent,t.abrupt("return",r.result&&"string"==typeof r.result.hash?_.ensureHexString(r.result.hash):null);case 4:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()}]),t}(),e.filterFromParam=r}));Object(v.c)(J),J.FilterPolyfill,J.filterFromParam;var $=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.eth_accounts="eth_accounts",t.eth_coinbase="eth_coinbase",t.net_version="net_version",t.eth_uninstallFilter="eth_uninstallFilter",t.eth_requestAccounts="eth_requestAccounts",t.eth_sign="eth_sign",t.eth_ecRecover="eth_ecRecover",t.personal_sign="personal_sign",t.personal_ecRecover="personal_ecRecover",t.eth_signTransaction="eth_signTransaction",t.eth_sendRawTransaction="eth_sendRawTransaction",t.eth_sendTransaction="eth_sendTransaction",t.eth_signTypedData_v1="eth_signTypedData_v1",t.eth_signTypedData_v2="eth_signTypedData_v2",t.eth_signTypedData_v3="eth_signTypedData_v3",t.eth_signTypedData_v4="eth_signTypedData_v4",t.eth_signTypedData="eth_signTypedData",t.walletlink_arbitrary="walletlink_arbitrary",t.eth_newFilter="eth_newFilter",t.eth_newBlockFilter="eth_newBlockFilter",t.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",t.eth_getFilterChanges="eth_getFilterChanges",t.eth_getFilterLogs="eth_getFilterLogs"}(e.JSONRPCMethod||(e.JSONRPCMethod={}))}));Object(v.c)($),$.JSONRPCMethod;var G=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.USER_DENIED_REQUEST_ACCOUNTS=4001]="USER_DENIED_REQUEST_ACCOUNTS",t[t.USER_DENIED_CREATE_ACCOUNT=4010]="USER_DENIED_CREATE_ACCOUNT",t[t.UNAUTHORIZED=4100]="UNAUTHORIZED",t[t.UNSUPPORTED_METHOD=4200]="UNSUPPORTED_METHOD",t[t.USER_DENIED_REQUEST_SIGNATURE=-32603]="USER_DENIED_REQUEST_SIGNATURE"}(e.ProviderErrorCode||(e.ProviderErrorCode={}));var n=function(t){Object(p.a)(n,t);var e=Object(b.a)(n);function n(t,r,o){var s;return Object(f.a)(this,n),(s=e.call(this,t||"Provider Error")).code=r,s.data=o,s.name="ProviderError",Object.setPrototypeOf(Object(i.a)(s),n.prototype),s}return n}(Object(o.a)(Error));e.ProviderError=n}));Object(v.c)(G),G.ProviderErrorCode,G.ProviderError;var Y=Object(v.b)((function(e,n){var r=v.d&&v.d.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var i=r(g),o=r(K);n.WalletLinkProvider=function(){function e(t){if(Object(f.a)(this,e),this._filterPolyfill=new J.FilterPolyfill(this),this._addresses=[],this._send=this.send,this._sendAsync=this.sendAsync,!t.relay)throw new Error("realy must be provided");if(!t.jsonRpcUrl)throw new Error("jsonRpcUrl must be provided");this._relay=t.relay,this._chainId=_.ensureIntNumber(t.chainId||1),this._jsonRpcUrl=t.jsonRpcUrl;var n=this._relay.getStorageItem("Addresses");if(n){var r=n.split(" ");""!==r[0]&&(this._addresses=r)}}return Object(d.a)(e,[{key:"selectedAddress",get:function(){return this._addresses[0]||void 0}},{key:"networkVersion",get:function(){return this._chainId.toString(10)}},{key:"isWalletLink",get:function(){return!0}},{key:"host",get:function(){return this._jsonRpcUrl}},{key:"connected",get:function(){return!0}},{key:"isConnected",value:function(){return!0}},{key:"enable",value:function(){var t=Object(c.a)(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(this._addresses.length>0)){t.next=4;break}t.t0=this._addresses,t.next=7;break;case 4:return t.next=6,this._send($.JSONRPCMethod.eth_requestAccounts);case 6:t.t0=t.sent;case 7:return t.abrupt("return",t.t0);case 8:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"close",value:function(){this._relay.resetAndReload()}},{key:"send",value:function(t,e){var n=this;if("string"==typeof t){var r={jsonrpc:"2.0",id:0,method:t,params:Array.isArray(e)?e:void 0!==e?[e]:[]};return this._sendRequestAsync(r).then((function(t){return t.result}))}if("function"==typeof e){var i=t,o=e;return this._sendAsync(i,o)}if(Array.isArray(t))return t.map((function(t){return n._sendRequest(t)}));var s=t;return this._sendRequest(s)}},{key:"sendAsync",value:function(t,e){if("function"!=typeof e)throw new Error("callback is required");if(Array.isArray(t)){var n=e;this._sendMultipleRequestsAsync(t).then((function(t){return n(null,t)})).catch((function(t){return n(t,null)}))}else{var r=e;this._sendRequestAsync(t).then((function(t){return r(null,t)})).catch((function(t){return r(t,null)}))}}},{key:"scanQRCode",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._relay.scanQRCode(_.ensureRegExpString(e));case 2:if("string"==typeof(n=t.sent).result){t.next=5;break}throw new Error("result was not a string");case 5:return t.abrupt("return",n.result);case 6:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"arbitraryRequest",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._relay.arbitraryRequest(e);case 2:if("string"==typeof(n=t.sent).result){t.next=5;break}throw new Error("result was not a string");case 5:return t.abrupt("return",n.result);case 6:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"supportsSubscriptions",value:function(){return!1}},{key:"subscribe",value:function(){throw new Error("Subscriptions are not supported")}},{key:"unsubscribe",value:function(){throw new Error("Subscriptions are not supported")}},{key:"disconnect",value:function(){return!0}},{key:"_sendRequest",value:function(t){var e={jsonrpc:"2.0",id:t.id},n=t.method;if(e.result=this._handleSynchronousMethods(t),void 0===e.result)throw new Error("WalletLink does not support calling ".concat(n," synchronously without ")+"a callback. Please provide a callback parameter to call ".concat(n," ")+"asynchronously.");return e}},{key:"_setAddresses",value:function(t){if(!Array.isArray(t))throw new Error("addresses is not an array");this._addresses=t.map((function(t){return _.ensureAddressString(t)})),this._relay.setStorageItem("Addresses",t.join(" ")),window.dispatchEvent(new CustomEvent("walletlink:addresses",{detail:this._addresses}))}},{key:"_sendRequestAsync",value:function(t){var e=this;return new Promise((function(n,r){try{var i=e._handleSynchronousMethods(t);if(void 0!==i)return n({jsonrpc:"2.0",id:t.id,result:i});var o=e._handleAsynchronousFilterMethods(t);if(void 0!==o)return void o.then((function(e){return n(Object.assign(Object.assign({},e),{id:t.id}))})).catch((function(t){return r(t)}))}catch(t){return r(t)}e._handleAsynchronousMethods(t).then((function(e){return n(Object.assign(Object.assign({},e),{id:t.id}))})).catch((function(t){return r(t)}))}))}},{key:"_sendMultipleRequestsAsync",value:function(t){var e=this;return Promise.all(t.map((function(t){return e._sendRequestAsync(t)})))}},{key:"_handleSynchronousMethods",value:function(t){var e=t.method,n=t.params||[];switch(e){case $.JSONRPCMethod.eth_accounts:return this._eth_accounts();case $.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case $.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(n);case $.JSONRPCMethod.net_version:return this._net_version();default:return}}},{key:"_handleAsynchronousMethods",value:function(t){var e=t.method,n=t.params||[];switch(e){case $.JSONRPCMethod.eth_requestAccounts:return this._eth_requestAccounts();case $.JSONRPCMethod.eth_sign:return this._eth_sign(n);case $.JSONRPCMethod.eth_ecRecover:return this._eth_ecRecover(n);case $.JSONRPCMethod.personal_sign:return this._personal_sign(n);case $.JSONRPCMethod.personal_ecRecover:return this._personal_ecRecover(n);case $.JSONRPCMethod.eth_signTransaction:return this._eth_signTransaction(n);case $.JSONRPCMethod.eth_sendRawTransaction:return this._eth_sendRawTransaction(n);case $.JSONRPCMethod.eth_sendTransaction:return this._eth_sendTransaction(n);case $.JSONRPCMethod.eth_signTypedData_v1:return this._eth_signTypedData_v1(n);case $.JSONRPCMethod.eth_signTypedData_v2:return this._throwUnsupportedMethodError();case $.JSONRPCMethod.eth_signTypedData_v3:return this._eth_signTypedData_v3(n);case $.JSONRPCMethod.eth_signTypedData_v4:case $.JSONRPCMethod.eth_signTypedData:return this._eth_signTypedData_v4(n);case $.JSONRPCMethod.walletlink_arbitrary:return this._walletlink_arbitrary(n)}return window.fetch(this._jsonRpcUrl,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then((function(t){return t.json()})).then((function(t){if(!t)throw new G.ProviderError("unexpected response");var e=t,n=e.error;if(n)throw new G.ProviderError(n.message||"RPC Error",n.code,n.data);return e}))}},{key:"_handleAsynchronousFilterMethods",value:function(t){var e=t.method,n=t.params||[];switch(e){case $.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(n);case $.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case $.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case $.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(n);case $.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(n)}}},{key:"_isKnownAddress",value:function(t){try{var e=_.ensureAddressString(t);return this._addresses.includes(e)}catch(t){}return!1}},{key:"_ensureKnownAddress",value:function(t){if(!this._isKnownAddress(t))throw new Error("Unknown Ethereum address")}},{key:"_prepareTransactionParams",value:function(e){var n=e.from?_.ensureAddressString(e.from):this.selectedAddress;if(!n)throw new Error("Ethereum address is unavailable");return this._ensureKnownAddress(n),{fromAddress:n,toAddress:e.to?_.ensureAddressString(e.to):null,weiValue:null!=e.value?_.ensureBN(e.value):new i.default(0),data:e.data?_.ensureBuffer(e.data):t.alloc(0),nonce:null!=e.nonce?_.ensureIntNumber(e.nonce):null,gasPriceInWei:null!=e.gasPrice?_.ensureBN(e.gasPrice):null,gasLimit:null!=e.gas?_.ensureBN(e.gas):null,chainId:this._chainId}}},{key:"_requireAuthorization",value:function(){if(0===this._addresses.length)throw new G.ProviderError("Unauthorized",G.ProviderErrorCode.UNAUTHORIZED)}},{key:"_throwUnsupportedMethodError",value:function(){throw new G.ProviderError("Unsupported method",G.ProviderErrorCode.UNSUPPORTED_METHOD)}},{key:"_signEthereumMessage",value:function(){var t=Object(c.a)(a.a.mark((function t(e,n,r,i){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._ensureKnownAddress(n),t.prev=1,t.next=4,this._relay.signEthereumMessage(e,n,r,i);case 4:return t.t0=t.sent.result,t.abrupt("return",{jsonrpc:"2.0",id:0,result:t.t0});case 8:if(t.prev=8,t.t1=t.catch(1),"string"!=typeof t.t1.message||!t.t1.message.match(/(denied|rejected)/i)){t.next=12;break}throw new G.ProviderError("User denied message signature",G.ProviderErrorCode.USER_DENIED_REQUEST_SIGNATURE);case 12:throw t.t1;case 13:case"end":return t.stop()}}),t,this,[[1,8]])})));return function(e,n,r,i){return t.apply(this,arguments)}}()},{key:"_ethereumAddressFromSignedMessage",value:function(){var t=Object(c.a)(a.a.mark((function t(e,n,r){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._relay.ethereumAddressFromSignedMessage(e,n,r);case 2:return t.t0=t.sent.result,t.abrupt("return",{jsonrpc:"2.0",id:0,result:t.t0});case 4:case"end":return t.stop()}}),t,this)})));return function(e,n,r){return t.apply(this,arguments)}}()},{key:"_eth_accounts",value:function(){return this._addresses}},{key:"_eth_coinbase",value:function(){return this.selectedAddress||null}},{key:"_net_version",value:function(){return this._chainId.toString(10)}},{key:"_eth_requestAccounts",value:function(){var t=Object(c.a)(a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(this._addresses.length>0)){t.next=2;break}return t.abrupt("return",Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses}));case 2:return t.prev=2,t.next=5,this._relay.requestEthereumAccounts();case 5:e=t.sent,t.next=13;break;case 8:if(t.prev=8,t.t0=t.catch(2),"string"!=typeof t.t0.message||!t.t0.message.match(/(denied|rejected)/i)){t.next=12;break}throw new G.ProviderError("User denied account authorization",G.ProviderErrorCode.USER_DENIED_REQUEST_ACCOUNTS);case 12:throw t.t0;case 13:if(e.result){t.next=15;break}throw new Error("accounts received is empty");case 15:return t.abrupt("return",(this._setAddresses(e.result),{jsonrpc:"2.0",id:0,result:this._addresses}));case 16:case"end":return t.stop()}}),t,this,[[2,8]])})));return function(){return t.apply(this,arguments)}}()},{key:"_eth_sign",value:function(t){this._requireAuthorization();var e=_.ensureAddressString(t[0]),n=_.ensureBuffer(t[1]);return this._signEthereumMessage(n,e,!1)}},{key:"_eth_ecRecover",value:function(t){var e=_.ensureBuffer(t[0]),n=_.ensureBuffer(t[1]);return this._ethereumAddressFromSignedMessage(e,n,!1)}},{key:"_personal_sign",value:function(t){this._requireAuthorization();var e=_.ensureBuffer(t[0]),n=_.ensureAddressString(t[1]);return this._signEthereumMessage(e,n,!0)}},{key:"_personal_ecRecover",value:function(t){var e=_.ensureBuffer(t[0]),n=_.ensureBuffer(t[1]);return this._ethereumAddressFromSignedMessage(e,n,!0)}},{key:"_eth_signTransaction",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._requireAuthorization(),n=this._prepareTransactionParams(e[0]||{}),t.prev=2,t.next=5,this._relay.signEthereumTransaction(n);case 5:return t.t0=t.sent.result,t.abrupt("return",{jsonrpc:"2.0",id:0,result:t.t0});case 9:if(t.prev=9,t.t1=t.catch(2),"string"!=typeof t.t1.message||!t.t1.message.match(/(denied|rejected)/i)){t.next=13;break}throw new G.ProviderError("User denied transaction signature",G.ProviderErrorCode.USER_DENIED_REQUEST_SIGNATURE);case 13:throw t.t1;case 14:case"end":return t.stop()}}),t,this,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()},{key:"_eth_sendRawTransaction",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=_.ensureBuffer(e[0]),t.next=3,this._relay.submitEthereumTransaction(n,this._chainId);case 3:return t.t0=t.sent.result,t.abrupt("return",{jsonrpc:"2.0",id:0,result:t.t0});case 5:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"_eth_sendTransaction",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._requireAuthorization(),n=this._prepareTransactionParams(e[0]||{}),t.prev=2,t.next=5,this._relay.signAndSubmitEthereumTransaction(n);case 5:return t.t0=t.sent.result,t.abrupt("return",{jsonrpc:"2.0",id:0,result:t.t0});case 9:if(t.prev=9,t.t1=t.catch(2),"string"!=typeof t.t1.message||!t.t1.message.match(/(denied|rejected)/i)){t.next=13;break}throw new G.ProviderError("User denied transaction signature",G.ProviderErrorCode.USER_DENIED_REQUEST_SIGNATURE);case 13:throw t.t1;case 14:case"end":return t.stop()}}),t,this,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()},{key:"_eth_signTypedData_v1",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var n,r,i,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._requireAuthorization(),n=e[0],r=_.ensureAddressString(e[1]),this._ensureKnownAddress(r),i=o.default.hashForSignTypedDataLegacy({data:n}),s=JSON.stringify(n,null,2),t.abrupt("return",this._signEthereumMessage(i,r,!1,s));case 5:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"_eth_signTypedData_v3",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var n,r,i,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._requireAuthorization(),n=_.ensureAddressString(e[0]),r=e[1],this._ensureKnownAddress(n),i=o.default.hashForSignTypedData_v3({data:r}),s=JSON.stringify(r,null,2),t.abrupt("return",this._signEthereumMessage(i,n,!1,s));case 5:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"_eth_signTypedData_v4",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var n,r,i,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._requireAuthorization(),n=_.ensureAddressString(e[0]),r=e[1],this._ensureKnownAddress(n),i=o.default.hashForSignTypedData_v4({data:r}),s=JSON.stringify(r,null,2),t.abrupt("return",this._signEthereumMessage(i,n,!1,s));case 5:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"_walletlink_arbitrary",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("string"==typeof(n=e[0])){t.next=3;break}throw new Error("parameter must be a string");case 3:return t.next=5,this.arbitraryRequest(n);case 5:return t.t0=t.sent,t.abrupt("return",{jsonrpc:"2.0",id:0,result:t.t0});case 7:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"_eth_uninstallFilter",value:function(t){var e=_.ensureHexString(t[0]);return this._filterPolyfill.uninstallFilter(e)}},{key:"_eth_newFilter",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e[0],t.next=3,this._filterPolyfill.newFilter(n);case 3:return t.t0=t.sent,t.abrupt("return",{jsonrpc:"2.0",id:0,result:t.t0});case 5:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"_eth_newBlockFilter",value:function(){var t=Object(c.a)(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._filterPolyfill.newBlockFilter();case 2:return t.t0=t.sent,t.abrupt("return",{jsonrpc:"2.0",id:0,result:t.t0});case 4:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"_eth_newPendingTransactionFilter",value:function(){var t=Object(c.a)(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._filterPolyfill.newPendingTransactionFilter();case 2:return t.t0=t.sent,t.abrupt("return",{jsonrpc:"2.0",id:0,result:t.t0});case 4:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"_eth_getFilterChanges",value:function(t){var e=_.ensureHexString(t[0]);return this._filterPolyfill.getFilterChanges(e)}},{key:"_eth_getFilterLogs",value:function(t){var e=_.ensureHexString(t[0]);return this._filterPolyfill.getFilterLogs(e)}}]),e}()}));Object(v.c)(Y),Y.WalletLinkProvider;var Z=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default='.-walletlink-css-reset,.-walletlink-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:transparent;background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;bottom:auto;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;content:normal;counter-increment:none;counter-reset:none;cursor:auto;direction:ltr;display:block;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;left:auto;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;max-height:none;max-width:none;min-height:0;min-width:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";right:auto;tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;top:auto;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;width:auto;word-spacing:normal;z-index:auto;all:initial;all:unset}.-walletlink-css-reset *{box-sizing:border-box;display:initial;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-walletlink-css-reset [class*=container]{margin:0;padding:0}.-walletlink-css-reset style{display:none}'}));Object(v.c)(Z);var Q=Object(v.b)((function(t,e){var n=v.d&&v.d.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(Z);e.injectCssReset=function(){var t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(r.default)),document.documentElement.appendChild(t)}}));Object(v.c)(Q),Q.injectCssReset;var X=Object(v.b)((function(t,e){var n;function r(t,e,r){if(!r||typeof r.value!==n.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+e+"> is not a method!");return{configurable:n.boolTrue,get:function(){var t=r.value.bind(this);return Object.defineProperty(this,e,{value:t,configurable:n.boolTrue,writable:n.boolTrue}),t}}}Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.typeOfFunction="function",t.boolTrue=!0}(n||(n={})),e.bind=r,e.default=r}));Object(v.c)(X),X.bind;var tt=function(t,e){return(tt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function et(t,e){function n(){this.constructor=t}tt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function nt(t){return"function"==typeof t}var rt=!1,it={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack,rt=t},get useDeprecatedSynchronousErrorHandling(){return rt}};function ot(t){setTimeout((function(){throw t}),0)}var st={closed:!0,next:function(t){},error:function(t){if(it.useDeprecatedSynchronousErrorHandling)throw t;ot(t)},complete:function(){}},ut=Array.isArray||function(t){return t&&"number"==typeof t.length};function at(t){return null!==t&&"object"==typeof t}var ct=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}(),lt=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}return t.prototype.unsubscribe=function(){var e;if(!this.closed){var n=this._parentOrParents,r=this._unsubscribe,i=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(null!==n)for(var o=0;o1)this.connection=null;else{var n=this.connection,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},e}(dt),Tt=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return et(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new lt).add(this.source.subscribe(new It(this.getSubject(),this))),t.closed&&(this._connection=null,t=lt.EMPTY)),t},e.prototype.refCount=function(){return Ct()(this)},e}(wt),jt=function(){var t=Tt.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),It=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return et(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(St),At=function(){function t(t,e,n,r){this.keySelector=t,this.elementSelector=e,this.durationSelector=n,this.subjectSelector=r}return t.prototype.call=function(t,e){return e.subscribe(new Pt(t,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),Pt=function(t){function e(e,n,r,i,o){var s=t.call(this,e)||this;return s.keySelector=n,s.elementSelector=r,s.durationSelector=i,s.subjectSelector=o,s.groups=null,s.attemptedToUnsubscribe=!1,s.count=0,s}return et(e,t),e.prototype._next=function(t){var e;try{e=this.keySelector(t)}catch(t){return void this.error(t)}this._group(t,e)},e.prototype._group=function(t,e){var n=this.groups;n||(n=this.groups=new Map);var r,i=n.get(e);if(this.elementSelector)try{r=this.elementSelector(t)}catch(t){this.error(t)}else r=t;if(!i){i=this.subjectSelector?this.subjectSelector():new Mt,n.set(e,i);var o=new Dt(e,i,this);if(this.destination.next(o),this.durationSelector){var s=void 0;try{s=this.durationSelector(new Dt(e,i))}catch(t){return void this.error(t)}this.add(s.subscribe(new Rt(e,i,this)))}}i.closed||i.next(r)},e.prototype._error=function(t){var e=this.groups;e&&(e.forEach((function(e,n){e.error(t)})),e.clear()),this.destination.error(t)},e.prototype._complete=function(){var t=this.groups;t&&(t.forEach((function(t,e){t.complete()})),t.clear()),this.destination.complete()},e.prototype.removeGroup=function(t){this.groups.delete(t)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&t.prototype.unsubscribe.call(this))},e}(dt),Rt=function(t){function e(e,n,r){var i=t.call(this,n)||this;return i.key=e,i.group=n,i.parent=r,i}return et(e,t),e.prototype._next=function(t){this.complete()},e.prototype._unsubscribe=function(){var t=this.parent,e=this.key;this.key=this.parent=null,t&&t.removeGroup(e)},e}(dt),Dt=function(t){function e(e,n,r){var i=t.call(this)||this;return i.key=e,i.groupSubject=n,i.refCountSubscription=r,i}return et(e,t),e.prototype._subscribe=function(t){var e=new lt,n=this.refCountSubscription,r=this.groupSubject;return n&&!n.closed&&e.add(new Lt(n)),e.add(r.subscribe(t)),e},e}(wt),Lt=function(t){function e(e){var n=t.call(this)||this;return n.parent=e,e.count++,n}return et(e,t),e.prototype.unsubscribe=function(){var e=this.parent;e.closed||this.closed||(t.prototype.unsubscribe.call(this),e.count-=1,0===e.count&&e.attemptedToUnsubscribe&&e.unsubscribe())},e}(lt),Bt=function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}return et(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new kt;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(Mt),Ft=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return et(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),setInterval(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return e;clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n=!1,r=void 0;try{this.work(t)}catch(t){n=!0,r=!!t&&t||new Error(t)}if(n)return this.unsubscribe(),r},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,n=e.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(function(t){function e(e,n){return t.call(this)||this}return et(e,t),e.prototype.schedule=function(t,e){return this},e}(lt)),Wt=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return et(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(Ft),qt=function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=function(){return Date.now()},t}(),Ut=function(t){function e(n,r){void 0===r&&(r=qt.now);var i=t.call(this,n,(function(){return e.delegate&&e.delegate!==i?e.delegate.now():r()}))||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return et(e,t),e.prototype.schedule=function(n,r,i){return void 0===r&&(r=0),e.delegate&&e.delegate!==this?e.delegate.schedule(n,r,i):t.prototype.schedule.call(this,n,r,i)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(qt),Vt=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return et(e,t),e}(Ut))(Wt),zt=new wt((function(t){return t.complete()}));function Ht(t){return t?function(t){return new wt((function(e){return t.schedule((function(){return e.complete()}))}))}(t):zt}function Kt(t){return t&&"function"==typeof t.schedule}var Jt,$t=function(t){return function(e){for(var n=0,r=t.length;nthis._bufferSize&&n.shift(),t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this._events.push(new oe(this._getNow(),e)),this._trimBufferThenGetEvents(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,n=this._infiniteTimeWindow,r=n?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,o=r.length;if(this.closed)throw new kt;if(this.isStopped||this.hasError?e=lt.EMPTY:(this.observers.push(t),e=new xt(this,t)),i&&t.add(t=new ne(t,i)),n)for(var s=0;se&&(o=Math.max(o,i-e)),o>0&&r.splice(0,o),r},e}(Mt),oe=function(t,e){this.time=t,this.value=e},se=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.value=null,e.hasNext=!1,e.hasCompleted=!1,e}return et(e,t),e.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),lt.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),lt.EMPTY):t.prototype._subscribe.call(this,e)},e.prototype.next=function(t){this.hasCompleted||(this.value=t,this.hasNext=!0)},e.prototype.error=function(e){this.hasCompleted||t.prototype.error.call(this,e)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(Mt),ue=1,ae=Promise.resolve(),ce={};function le(t){return t in ce&&(delete ce[t],!0)}var he=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return et(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e.scheduled||(e.scheduled=function(t){var e=ue++;return ce[e]=!0,ae.then((function(){return le(e)&&t()})),e}(e.flush.bind(e,null))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);0===e.actions.length&&(function(t){le(t)}(n),e.scheduled=void 0)},e}(Ft),fe=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return et(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1,i=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++r0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame((function(){return e.flush(null)}))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);0===e.actions.length&&(cancelAnimationFrame(n),e.scheduled=void 0)},e}(Ft),be=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return et(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1,i=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++re.index?1:-1:t.delay>e.delay?1:-1},e}(Ft);function ye(){}var ge=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}(),we=function(){function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t}(),_e=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}();function ke(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new xe(t,e))}}var xe=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new Se(t,this.project,this.thisArg))},t}(),Se=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.project=n,i.count=0,i.thisArg=r||i,i}return et(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(dt);function Me(t){var e=this,n=t.args,r=t.subscriber,i=t.params,o=i.callbackFunc,s=i.context,u=i.scheduler,a=i.subject;if(!a){a=i.subject=new se;try{o.apply(s,n.concat([function(){for(var t=[],n=0;n0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(Te);function He(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),Ue(mt,t)}function Ke(){return He(1)}function Je(){for(var t=[],e=0;e=0}function Qe(t){var e=t.subscriber,n=t.counter,r=t.period;e.next(n),this.schedule({subscriber:e,counter:n+1,period:r},r)}function Xe(){for(var t=[],e=0;e1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof i&&(n=t.pop()),null===r&&1===t.length&&t[0]instanceof wt?t[0]:He(n)(Yt(t,r))}var tn=new wt(ye);function en(t){var e=t.keys,n=t.index,r=t.subscriber,i=t.subscription,o=t.obj;if(!r.closed)if(n=r?i.complete():(i.next(e),i.closed||(t.index=n+1,t.start=e+1,this.schedule(t)))}function hn(t,e,n){void 0===t&&(t=0);var r=-1;return Ze(e)?r=Number(e)<1?1:Number(e):Kt(e)&&(n=e),Kt(n)||(n=de),new wt((function(e){var i=Ze(t)?t:+t-n.now();return n.schedule(fn,i,{index:0,period:r,subscriber:e})}))}function fn(t){var e=t.index,n=t.period,r=t.subscriber;if(r.next(e),!r.closed){if(-1===n)return r.complete();t.index=e+1,this.schedule(t,n)}}function dn(){for(var t=[],e=0;ethis.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),yn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.parent=n,i.observable=r,i.stillUnsubscribed=!0,i.buffer=[],i.isComplete=!1,i}return et(e,t),e.prototype[Ie]=function(){return this},e.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(t,e,n,r,i){this.buffer.push(e),this.parent.checkIterators()},e.prototype.subscribe=function(t,e){return De(this,this.observable,this,e)},e}(Te),gn=Object.freeze({__proto__:null,Observable:wt,ConnectableObservable:Tt,GroupedObservable:Dt,observable:vt,Subject:Mt,BehaviorSubject:Bt,ReplaySubject:ie,AsyncSubject:se,asapScheduler:fe,asyncScheduler:de,queueScheduler:Vt,animationFrameScheduler:be,VirtualTimeScheduler:ve,VirtualAction:me,Scheduler:qt,Subscription:lt,Subscriber:dt,Notification:te,get NotificationKind(){return Jt},pipe:yt,noop:ye,identity:mt,isObservable:function(t){return!!t&&(t instanceof wt||"function"==typeof t.lift&&"function"==typeof t.subscribe)},ArgumentOutOfRangeError:ge,EmptyError:we,ObjectUnsubscribedError:kt,UnsubscriptionError:ct,TimeoutError:_e,bindCallback:function t(e,n,r){if(n){if(!Kt(n))return function(){for(var i=[],o=0;o1?t.next(Array.prototype.slice.call(arguments)):t.next(e)}),t,r)}))},fromEventPattern:function t(e,n,r){return r?t(e,n).pipe(ke((function(t){return ut(t)?r.apply(void 0,t):r(t)}))):new wt((function(t){var r,i=function(){for(var e=[],n=0;n=e){r.complete();break}if(r.next(o++),r.closed)break}}))},throwError:Qt,timer:hn,using:function(t,e){return new wt((function(n){var r,i;try{r=t()}catch(t){return void n.error(t)}try{i=e(r)}catch(t){return void n.error(t)}var o=(i?qe(i):zt).subscribe(n);return function(){o.unsubscribe(),r&&r.unsubscribe()}}))},zip:dn,scheduled:We,EMPTY:zt,NEVER:tn,config:it});function wn(t){return function(e){return e.lift(new _n(t))}}var _n=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new kn(t,this.durationSelector))},t}(),kn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.durationSelector=n,r.hasValue=!1,r}return et(e,t),e.prototype._next=function(t){if(this.value=t,this.hasValue=!0,!this.throttled){var e=void 0;try{e=(0,this.durationSelector)(t)}catch(t){return this.destination.error(t)}var n=De(this,e);!n||n.closed?this.clearThrottle():this.add(this.throttled=n)}},e.prototype.clearThrottle=function(){var t=this.value,e=this.hasValue,n=this.throttled;n&&(this.remove(n),this.throttled=null,n.unsubscribe()),e&&(this.value=null,this.hasValue=!1,this.destination.next(t))},e.prototype.notifyNext=function(t,e,n,r){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(Te),xn=function(){function t(t){this.closingNotifier=t}return t.prototype.call=function(t,e){return e.subscribe(new Sn(t,this.closingNotifier))},t}(),Sn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.buffer=[],r.add(De(r,n)),r}return et(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype.notifyNext=function(t,e,n,r,i){var o=this.buffer;this.buffer=[],this.destination.next(o)},e}(Te),Mn=function(){function t(t,e){this.bufferSize=t,this.startBufferEvery=e,this.subscriberClass=e&&t!==e?Cn:En}return t.prototype.call=function(t,e){return e.subscribe(new this.subscriberClass(t,this.bufferSize,this.startBufferEvery))},t}(),En=function(t){function e(e,n){var r=t.call(this,e)||this;return r.bufferSize=n,r.buffer=[],r}return et(e,t),e.prototype._next=function(t){var e=this.buffer;e.push(t),e.length==this.bufferSize&&(this.destination.next(e),this.buffer=[])},e.prototype._complete=function(){var e=this.buffer;e.length>0&&this.destination.next(e),t.prototype._complete.call(this)},e}(dt),Cn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.bufferSize=n,i.startBufferEvery=r,i.buffers=[],i.count=0,i}return et(e,t),e.prototype._next=function(t){var e=this.bufferSize,n=this.startBufferEvery,r=this.buffers,i=this.count;this.count++,i%n==0&&r.push([]);for(var o=r.length;o--;){var s=r[o];s.push(t),s.length===e&&(r.splice(o,1),this.destination.next(s))}},e.prototype._complete=function(){for(var e=this.buffers,n=this.destination;e.length>0;){var r=e.shift();r.length>0&&n.next(r)}t.prototype._complete.call(this)},e}(dt),On=function(){function t(t,e,n,r){this.bufferTimeSpan=t,this.bufferCreationInterval=e,this.maxBufferSize=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new Tn(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),Nn=function(){this.buffer=[]},Tn=function(t){function e(e,n,r,i,o){var s=t.call(this,e)||this;s.bufferTimeSpan=n,s.bufferCreationInterval=r,s.maxBufferSize=i,s.scheduler=o,s.contexts=[];var u=s.openContext();if(s.timespanOnly=null==r||r<0,s.timespanOnly){var a={subscriber:s,context:u,bufferTimeSpan:n};s.add(u.closeAction=o.schedule(jn,n,a))}else{var c={subscriber:s,context:u},l={bufferTimeSpan:n,bufferCreationInterval:r,subscriber:s,scheduler:o};s.add(u.closeAction=o.schedule(An,n,c)),s.add(o.schedule(In,r,l))}return s}return et(e,t),e.prototype._next=function(t){for(var e,n=this.contexts,r=n.length,i=0;i0;){var r=e.shift();n.next(r.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(t){this.closeContext(t);var e=t.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){t=this.openContext();var n=this.bufferTimeSpan,r={subscriber:this,context:t,bufferTimeSpan:n};this.add(t.closeAction=this.scheduler.schedule(jn,n,r))}},e.prototype.openContext=function(){var t=new Nn;return this.contexts.push(t),t},e.prototype.closeContext=function(t){this.destination.next(t.buffer);var e=this.contexts;(e?e.indexOf(t):-1)>=0&&e.splice(e.indexOf(t),1)},e}(dt);function jn(t){var e=t.subscriber,n=t.context;n&&e.closeContext(n),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function In(t){var e=t.bufferCreationInterval,n=t.bufferTimeSpan,r=t.subscriber,i=t.scheduler,o=r.openContext();r.closed||(r.add(o.closeAction=i.schedule(An,n,{subscriber:r,context:o})),this.schedule(t,e))}function An(t){var e=t.subscriber,n=t.context;e.closeContext(n)}var Pn=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new Rn(t,this.openings,this.closingSelector))},t}(),Rn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.openings=n,i.closingSelector=r,i.contexts=[],i.add(De(i,n)),i}return et(e,t),e.prototype._next=function(t){for(var e=this.contexts,n=e.length,r=0;r0;){var r=n.shift();r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts;e.length>0;){var n=e.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,r,i){t?this.closeBuffer(t):this.openBuffer(e)},e.prototype.notifyComplete=function(t){this.closeBuffer(t.context)},e.prototype.openBuffer=function(t){try{var e=this.closingSelector.call(this,t);e&&this.trySubscribe(e)}catch(t){this._error(t)}},e.prototype.closeBuffer=function(t){var e=this.contexts;if(e&&t){var n=t.buffer,r=t.subscription;this.destination.next(n),e.splice(e.indexOf(t),1),this.remove(r),r.unsubscribe()}},e.prototype.trySubscribe=function(t){var e=this.contexts,n=new lt,r={buffer:[],subscription:n};e.push(r);var i=De(this,t,r);!i||i.closed?this.closeBuffer(r):(i.context=r,this.add(i),n.add(i))},e}(Te),Dn=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new Ln(t,this.closingSelector))},t}(),Ln=function(t){function e(e,n){var r=t.call(this,e)||this;return r.closingSelector=n,r.subscribing=!1,r.openBuffer(),r}return et(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype._complete=function(){var e=this.buffer;e&&this.destination.next(e),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=null,this.subscribing=!1},e.prototype.notifyNext=function(t,e,n,r,i){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe());var e,n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];try{e=(0,this.closingSelector)()}catch(t){return this.error(t)}t=new lt,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add(De(this,e)),this.subscribing=!1},e}(Te),Bn=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new Fn(t,this.selector,this.caught))},t}(),Fn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.selector=n,i.caught=r,i}return et(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=void 0;try{n=this.selector(e,this.caught)}catch(e){return void t.prototype.error.call(this,e)}this._unsubscribeAndRecycle();var r=new je(this,void 0,void 0);this.add(r);var i=De(this,n,void 0,void 0,r);i!==r&&this.add(i)}},e}(Te);function Wn(t,e){return Ue(t,e,1)}var qn=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new Un(t,this.predicate,this.source))},t}(),Un=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.source=r,i.count=0,i.index=0,i}return et(e,t),e.prototype._next=function(t){this.predicate?this._tryPredicate(t):this.count++},e.prototype._tryPredicate=function(t){var e;try{e=this.predicate(t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e&&this.count++},e.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},e}(dt),Vn=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new zn(t,this.durationSelector))},t}(),zn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.durationSelector=n,r.hasValue=!1,r.durationSubscription=null,r}return et(e,t),e.prototype._next=function(t){try{var e=this.durationSelector.call(this,t);e&&this._tryNext(t,e)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.emitValue(),this.destination.complete()},e.prototype._tryNext=function(t,e){var n=this.durationSubscription;this.value=t,this.hasValue=!0,n&&(n.unsubscribe(),this.remove(n)),(n=De(this,e))&&!n.closed&&this.add(this.durationSubscription=n)},e.prototype.notifyNext=function(t,e,n,r,i){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){if(this.hasValue){var e=this.value,n=this.durationSubscription;n&&(this.durationSubscription=null,n.unsubscribe(),this.remove(n)),this.value=null,this.hasValue=!1,t.prototype._next.call(this,e)}},e}(Te),Hn=function(){function t(t,e){this.dueTime=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new Kn(t,this.dueTime,this.scheduler))},t}(),Kn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.dueTime=n,i.scheduler=r,i.debouncedSubscription=null,i.lastValue=null,i.hasValue=!1,i}return et(e,t),e.prototype._next=function(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Jn,this.dueTime,this))},e.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},e.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var t=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}},e.prototype.clearDebounce=function(){var t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)},e}(dt);function Jn(t){t.debouncedNext()}function $n(t){return void 0===t&&(t=null),function(e){return e.lift(new Gn(t))}}var Gn=function(){function t(t){this.defaultValue=t}return t.prototype.call=function(t,e){return e.subscribe(new Yn(t,this.defaultValue))},t}(),Yn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.defaultValue=n,r.isEmpty=!0,r}return et(e,t),e.prototype._next=function(t){this.isEmpty=!1,this.destination.next(t)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(dt);function Zn(t){return t instanceof Date&&!isNaN(+t)}var Qn=function(){function t(t,e){this.delay=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new Xn(t,this.delay,this.scheduler))},t}(),Xn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.delay=n,i.scheduler=r,i.queue=[],i.active=!1,i.errored=!1,i}return et(e,t),e.dispatch=function(t){for(var e=t.source,n=e.queue,r=t.scheduler,i=t.destination;n.length>0&&n[0].time-r.now()<=0;)n.shift().notification.observe(i);if(n.length>0){var o=Math.max(0,n[0].time-r.now());this.schedule(t,o)}else this.unsubscribe(),e.active=!1},e.prototype._schedule=function(t){this.active=!0,this.destination.add(t.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))},e.prototype.scheduleNotification=function(t){if(!0!==this.errored){var e=this.scheduler,n=new tr(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}},e.prototype._next=function(t){this.scheduleNotification(te.createNext(t))},e.prototype._error=function(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(te.createComplete()),this.unsubscribe()},e}(dt),tr=function(t,e){this.time=t,this.notification=e},er=function(){function t(t){this.delayDurationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new nr(t,this.delayDurationSelector))},t}(),nr=function(t){function e(e,n){var r=t.call(this,e)||this;return r.delayDurationSelector=n,r.completed=!1,r.delayNotifierSubscriptions=[],r.index=0,r}return et(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(t),this.removeSubscription(i),this.tryComplete()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){var e=this.removeSubscription(t);e&&this.destination.next(e),this.tryComplete()},e.prototype._next=function(t){var e=this.index++;try{var n=this.delayDurationSelector(t,e);n&&this.tryDelay(n,t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(t){t.unsubscribe();var e=this.delayNotifierSubscriptions.indexOf(t);return-1!==e&&this.delayNotifierSubscriptions.splice(e,1),t.outerValue},e.prototype.tryDelay=function(t,e){var n=De(this,t,e);n&&!n.closed&&(this.destination.add(n),this.delayNotifierSubscriptions.push(n))},e.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},e}(Te),rr=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subscriptionDelay=n,r}return et(e,t),e.prototype._subscribe=function(t){this.subscriptionDelay.subscribe(new ir(t,this.source))},e}(wt),ir=function(t){function e(e,n){var r=t.call(this)||this;return r.parent=e,r.source=n,r.sourceSubscribed=!1,r}return et(e,t),e.prototype._next=function(t){this.subscribeToSource()},e.prototype._error=function(t){this.unsubscribe(),this.parent.error(t)},e.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(dt),or=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new sr(t))},t}(),sr=function(t){function e(e){return t.call(this,e)||this}return et(e,t),e.prototype._next=function(t){t.observe(this.destination)},e}(dt),ur=function(){function t(t,e){this.keySelector=t,this.flushes=e}return t.prototype.call=function(t,e){return e.subscribe(new ar(t,this.keySelector,this.flushes))},t}(),ar=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.keySelector=n,i.values=new Set,r&&i.add(De(i,r)),i}return et(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.values.clear()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype._next=function(t){this.keySelector?this._useKeySelector(t):this._finalizeNext(t,t)},e.prototype._useKeySelector=function(t){var e,n=this.destination;try{e=this.keySelector(t)}catch(t){return void n.error(t)}this._finalizeNext(e,t)},e.prototype._finalizeNext=function(t,e){var n=this.values;n.has(t)||(n.add(t),this.destination.next(e))},e}(Te);function cr(t,e){return function(n){return n.lift(new lr(t,e))}}var lr=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new hr(t,this.compare,this.keySelector))},t}(),hr=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.keySelector=r,i.hasKey=!1,"function"==typeof n&&(i.compare=n),i}return et(e,t),e.prototype.compare=function(t,e){return t===e},e.prototype._next=function(t){var e;try{var n=this.keySelector;e=n?n(t):t}catch(t){return this.destination.error(t)}var r=!1;if(this.hasKey)try{r=(0,this.compare)(this.key,e)}catch(t){return this.destination.error(t)}else this.hasKey=!0;r||(this.key=e,this.destination.next(t))},e}(dt);function fr(t){return void 0===t&&(t=br),function(e){return e.lift(new dr(t))}}var dr=function(){function t(t){this.errorFactory=t}return t.prototype.call=function(t,e){return e.subscribe(new pr(t,this.errorFactory))},t}(),pr=function(t){function e(e,n){var r=t.call(this,e)||this;return r.errorFactory=n,r.hasValue=!1,r}return et(e,t),e.prototype._next=function(t){this.hasValue=!0,this.destination.next(t)},e.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var t=void 0;try{t=this.errorFactory()}catch(e){t=e}this.destination.error(t)},e}(dt);function br(){return new we}function vr(t){return function(e){return 0===t?Ht():e.lift(new mr(t))}}var mr=function(){function t(t){if(this.total=t,this.total<0)throw new ge}return t.prototype.call=function(t,e){return e.subscribe(new yr(t,this.total))},t}(),yr=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return et(e,t),e.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},e}(dt),gr=function(){function t(t,e,n){this.predicate=t,this.thisArg=e,this.source=n}return t.prototype.call=function(t,e){return e.subscribe(new wr(t,this.predicate,this.thisArg,this.source))},t}(),wr=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.predicate=n,o.thisArg=r,o.source=i,o.index=0,o.thisArg=r||o,o}return et(e,t),e.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},e.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(dt),_r=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new kr(t))},t}(),kr=function(t){function e(e){var n=t.call(this,e)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return et(e,t),e.prototype._next=function(t){this.hasSubscription||(this.hasSubscription=!0,this.add(De(this,t)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(t){this.remove(t),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(Te),xr=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new Sr(t,this.project))},t}(),Sr=function(t){function e(e,n){var r=t.call(this,e)||this;return r.project=n,r.hasSubscription=!1,r.hasCompleted=!1,r.index=0,r}return et(e,t),e.prototype._next=function(t){this.hasSubscription||this.tryNext(t)},e.prototype.tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.hasSubscription=!0,this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=new je(this,e,n),i=this.destination;i.add(r);var o=De(this,t,void 0,void 0,r);o!==r&&i.add(o)},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(e)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.remove(t),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(Te),Mr=function(){function t(t,e,n){this.project=t,this.concurrent=e,this.scheduler=n}return t.prototype.call=function(t,e){return e.subscribe(new Er(t,this.project,this.concurrent,this.scheduler))},t}(),Er=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.project=n,o.concurrent=r,o.scheduler=i,o.index=0,o.active=0,o.hasCompleted=!1,r0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},e}(Te),Cr=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new Or(t,this.callback))},t}(),Or=function(t){function e(e,n){var r=t.call(this,e)||this;return r.add(new lt(n)),r}return et(e,t),e}(dt),Nr=function(){function t(t,e,n,r){this.predicate=t,this.source=e,this.yieldIndex=n,this.thisArg=r}return t.prototype.call=function(t,e){return e.subscribe(new Tr(t,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),Tr=function(t){function e(e,n,r,i,o){var s=t.call(this,e)||this;return s.predicate=n,s.source=r,s.yieldIndex=i,s.thisArg=o,s.index=0,s}return et(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete(),this.unsubscribe()},e.prototype._next=function(t){var e=this.predicate,n=this.thisArg,r=this.index++;try{e.call(n||this,t,r,this.source)&&this.notifyComplete(this.yieldIndex?r:t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(dt),jr=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Ir(t))},t}(),Ir=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return et(e,t),e.prototype._next=function(t){},e}(dt),Ar=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Pr(t))},t}(),Pr=function(t){function e(e){return t.call(this,e)||this}return et(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype._next=function(t){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(dt);function Rr(t){return function(e){return 0===t?Ht():e.lift(new Dr(t))}}var Dr=function(){function t(t){if(this.total=t,this.total<0)throw new ge}return t.prototype.call=function(t,e){return e.subscribe(new Lr(t,this.total))},t}(),Lr=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.ring=new Array,r.count=0,r}return et(e,t),e.prototype._next=function(t){var e=this.ring,n=this.total,r=this.count++;e.length0)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,i=0;i=2&&(n=!0),function(r){return r.lift(new Vr(t,e,n))}}var Vr=function(){function t(t,e,n){void 0===n&&(n=!1),this.accumulator=t,this.seed=e,this.hasSeed=n}return t.prototype.call=function(t,e){return e.subscribe(new zr(t,this.accumulator,this.seed,this.hasSeed))},t}(),zr=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.accumulator=n,o._seed=r,o.hasSeed=i,o.index=0,o}return et(e,t),Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),e.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.accumulator(this.seed,t,n)}catch(t){this.destination.error(t)}this.seed=e,this.destination.next(e)},e}(dt);function Hr(t,e){return arguments.length>=2?function(n){return yt(Ur(t,e),Rr(1),$n(e))(n)}:function(e){return yt(Ur((function(e,n,r){return t(e,n,r+1)})),Rr(1))(e)}}var Kr=function(){function t(t,e,n){this.accumulator=t,this.seed=e,this.concurrent=n}return t.prototype.call=function(t,e){return e.subscribe(new Jr(t,this.accumulator,this.seed,this.concurrent))},t}(),Jr=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.accumulator=n,o.acc=r,o.concurrent=i,o.hasValue=!1,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return et(e,t),e.prototype._next=function(t){if(this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},e}(Te);function $r(t,e){return function(n){var r;if(r="function"==typeof t?t:function(){return t},"function"==typeof e)return n.lift(new Gr(r,e));var i=Object.create(n,jt);return i.source=n,i.subjectFactory=r,i}}var Gr=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var n=this.selector,r=this.subjectFactory(),i=n(r).subscribe(t);return i.add(e.subscribe(r)),i},t}(),Yr=function(){function t(t){this.nextSources=t}return t.prototype.call=function(t,e){return e.subscribe(new Zr(t,this.nextSources))},t}(),Zr=function(t){function e(e,n){var r=t.call(this,e)||this;return r.destination=e,r.nextSources=n,r}return et(e,t),e.prototype.notifyError=function(t,e){this.subscribeToNextSource()},e.prototype.notifyComplete=function(t){this.subscribeToNextSource()},e.prototype._error=function(t){this.subscribeToNextSource(),this.unsubscribe()},e.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},e.prototype.subscribeToNextSource=function(){var t=this.nextSources.shift();if(t){var e=new je(this,void 0,void 0),n=this.destination;n.add(e);var r=De(this,t,void 0,void 0,e);r!==e&&n.add(r)}else this.destination.complete()},e}(Te),Qr=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Xr(t))},t}(),Xr=function(t){function e(e){var n=t.call(this,e)||this;return n.hasPrev=!1,n}return et(e,t),e.prototype._next=function(t){var e;this.hasPrev?e=[this.prev,t]:this.hasPrev=!0,this.prev=t,e&&this.destination.next(e)},e}(dt);function ti(t,e){return function(n){for(var r=n,i=0;i-1&&(this.count=n-1),e.subscribe(this._unsubscribeAndRecycle())}},e}(dt),ri=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new ii(t,this.notifier,e))},t}(),ii=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.notifier=n,i.source=r,i.sourceIsBeingSubscribedTo=!0,i}return et(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(e){if(!1===this.sourceIsBeingSubscribedTo)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next()}},e.prototype._unsubscribe=function(){var t=this.notifications,e=this.retriesSubscription;t&&(t.unsubscribe(),this.notifications=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype._unsubscribeAndRecycle=function(){var e=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=e,this},e.prototype.subscribeToRetries=function(){var e;this.notifications=new Mt;try{e=(0,this.notifier)(this.notifications)}catch(e){return t.prototype.complete.call(this)}this.retries=e,this.retriesSubscription=De(this,e)},e}(Te),oi=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new si(t,this.count,this.source))},t}(),si=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.count=n,i.source=r,i}return et(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.source,r=this.count;if(0===r)return t.prototype.error.call(this,e);r>-1&&(this.count=r-1),n.subscribe(this._unsubscribeAndRecycle())}},e}(dt),ui=function(){function t(t,e){this.notifier=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new ai(t,this.notifier,this.source))},t}(),ai=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.notifier=n,i.source=r,i}return et(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.errors,r=this.retries,i=this.retriesSubscription;if(r)this.errors=null,this.retriesSubscription=null;else{n=new Mt;try{r=(0,this.notifier)(n)}catch(e){return t.prototype.error.call(this,e)}i=De(this,r)}this._unsubscribeAndRecycle(),this.errors=n,this.retries=r,this.retriesSubscription=i,n.next(e)}},e.prototype._unsubscribe=function(){var t=this.errors,e=this.retriesSubscription;t&&(t.unsubscribe(),this.errors=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype.notifyNext=function(t,e,n,r,i){var o=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=o,this.source.subscribe(this)},e}(Te),ci=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new li(t),r=e.subscribe(n);return r.add(De(n,this.notifier)),r},t}(),li=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasValue=!1,e}return et(e,t),e.prototype._next=function(t){this.value=t,this.hasValue=!0},e.prototype.notifyNext=function(t,e,n,r,i){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(Te),hi=function(){function t(t,e){this.period=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new fi(t,this.period,this.scheduler))},t}(),fi=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.period=n,i.scheduler=r,i.hasValue=!1,i.add(r.schedule(di,n,{subscriber:i,period:n})),i}return et(e,t),e.prototype._next=function(t){this.lastValue=t,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(dt);function di(t){var e=t.subscriber,n=t.period;e.notifyNext(),this.schedule(t,n)}var pi=function(){function t(t,e){this.compareTo=t,this.comparator=e}return t.prototype.call=function(t,e){return e.subscribe(new bi(t,this.compareTo,this.comparator))},t}(),bi=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.compareTo=n,i.comparator=r,i._a=[],i._b=[],i._oneComplete=!1,i.destination.add(n.subscribe(new vi(e,i))),i}return et(e,t),e.prototype._next=function(t){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(t),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},e.prototype.checkValues=function(){for(var t=this._a,e=this._b,n=this.comparator;t.length>0&&e.length>0;){var r=t.shift(),i=e.shift(),o=!1;try{o=n?n(r,i):r===i}catch(t){this.destination.error(t)}o||this.emit(!1)}},e.prototype.emit=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype.nextB=function(t){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(t),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},e}(dt),vi=function(t){function e(e,n){var r=t.call(this,e)||this;return r.parent=n,r}return et(e,t),e.prototype._next=function(t){this.parent.nextB(t)},e.prototype._error=function(t){this.parent.error(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(dt);function mi(){return new Mt}var yi=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new gi(t,this.predicate,this.source))},t}(),gi=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.source=r,i.seenValue=!1,i.index=0,i}return et(e,t),e.prototype.applySingleValue=function(t){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=t)},e.prototype._next=function(t){var e=this.index++;this.predicate?this.tryNext(t,e):this.applySingleValue(t)},e.prototype.tryNext=function(t,e){try{this.predicate(t,e,this.source)&&this.applySingleValue(t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){var t=this.destination;this.index>0?(t.next(this.seenValue?this.singleValue:void 0),t.complete()):t.error(new we)},e}(dt),wi=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new _i(t,this.total))},t}(),_i=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return et(e,t),e.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},e}(dt),ki=function(){function t(t){if(this._skipCount=t,this._skipCount<0)throw new ge}return t.prototype.call=function(t,e){return 0===this._skipCount?e.subscribe(new dt(t)):e.subscribe(new xi(t,this._skipCount))},t}(),xi=function(t){function e(e,n){var r=t.call(this,e)||this;return r._skipCount=n,r._count=0,r._ring=new Array(n),r}return et(e,t),e.prototype._next=function(t){var e=this._skipCount,n=this._count++;if(n0?this.startWindowEvery:this.windowSize,n=this.destination,r=this.windowSize,i=this.windows,o=i.length,s=0;s=0&&u%e==0&&!this.closed&&i.shift().complete(),++this.count%e==0&&!this.closed){var a=new Mt;i.push(a),n.next(a)}},e.prototype._error=function(t){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(dt),eo=function(){function t(t,e,n,r){this.windowTimeSpan=t,this.windowCreationInterval=e,this.maxWindowSize=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new ro(t,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),no=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._numberOfNextedValues=0,e}return et(e,t),e.prototype.next=function(e){this._numberOfNextedValues++,t.prototype.next.call(this,e)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(Mt),ro=function(t){function e(e,n,r,i,o){var s=t.call(this,e)||this;s.destination=e,s.windowTimeSpan=n,s.windowCreationInterval=r,s.maxWindowSize=i,s.scheduler=o,s.windows=[];var u=s.openWindow();if(null!==r&&r>=0){var a={subscriber:s,window:u,context:null},c={windowTimeSpan:n,windowCreationInterval:r,subscriber:s,scheduler:o};s.add(o.schedule(so,n,a)),s.add(o.schedule(oo,r,c))}else{var l={subscriber:s,window:u,windowTimeSpan:n};s.add(o.schedule(io,n,l))}return s}return et(e,t),e.prototype._next=function(t){for(var e=this.windows,n=e.length,r=0;r=this.maxWindowSize&&this.closeWindow(i))}},e.prototype._error=function(t){for(var e=this.windows;e.length>0;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){for(var t=this.windows;t.length>0;){var e=t.shift();e.closed||e.complete()}this.destination.complete()},e.prototype.openWindow=function(){var t=new no;return this.windows.push(t),this.destination.next(t),t},e.prototype.closeWindow=function(t){t.complete();var e=this.windows;e.splice(e.indexOf(t),1)},e}(dt);function io(t){var e=t.subscriber,n=t.windowTimeSpan,r=t.window;r&&e.closeWindow(r),t.window=e.openWindow(),this.schedule(t,n)}function oo(t){var e=t.windowTimeSpan,n=t.subscriber,r=t.scheduler,i=t.windowCreationInterval,o=n.openWindow(),s={action:this,subscription:null},u={subscriber:n,window:o,context:s};s.subscription=r.schedule(so,e,u),this.add(s.subscription),this.schedule(t,i)}function so(t){var e=t.subscriber,n=t.window,r=t.context;r&&r.action&&r.subscription&&r.action.remove(r.subscription),e.closeWindow(n)}var uo,ao,co,lo,ho,fo,po,bo,vo=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new mo(t,this.openings,this.closingSelector))},t}(),mo=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.openings=n,i.closingSelector=r,i.contexts=[],i.add(i.openSubscription=De(i,n,n)),i}return et(e,t),e.prototype._next=function(t){var e=this.contexts;if(e)for(var n=e.length,r=0;r0){var s=o.indexOf(n);-1!==s&&o.splice(s,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(Te),ko=Object.freeze({__proto__:null,audit:wn,auditTime:function(t,e){return void 0===e&&(e=de),wn((function(){return hn(t,e)}))},buffer:function(t){return function(e){return e.lift(new xn(t))}},bufferCount:function(t,e){return void 0===e&&(e=null),function(n){return n.lift(new Mn(t,e))}},bufferTime:function(t){var e=arguments.length,n=de;Kt(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],e--);var r=null;e>=2&&(r=arguments[1]);var i=Number.POSITIVE_INFINITY;return e>=3&&(i=arguments[2]),function(e){return e.lift(new On(t,r,i,n))}},bufferToggle:function(t,e){return function(n){return n.lift(new Pn(t,e))}},bufferWhen:function(t){return function(e){return e.lift(new Dn(t))}},catchError:function(t){return function(e){var n=new Bn(t),r=e.lift(n);return n.caught=r}},combineAll:function(t){return function(e){return e.lift(new Be(t))}},combineLatest:function(){for(var t=[],e=0;e=2;return function(r){return r.pipe(rn((function(e,n){return n===t})),vr(1),n?$n(e):fr((function(){return new ge})))}},endWith:function(){for(var t=[],e=0;e=2;return function(r){return r.pipe(t?rn((function(e,n){return t(e,n,r)})):mt,vr(1),n?$n(e):fr((function(){return new we})))}},groupBy:function(t,e,n,r){return function(i){return i.lift(new At(t,e,n,r))}},ignoreElements:function(){return function(t){return t.lift(new jr)}},isEmpty:function(){return function(t){return t.lift(new Ar)}},last:function(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?rn((function(e,n){return t(e,n,r)})):mt,Rr(1),n?$n(e):fr((function(){return new we})))}},map:ke,mapTo:function(t){return function(e){return e.lift(new Br(t))}},materialize:function(){return function(t){return t.lift(new Wr)}},max:function(t){return Hr("function"==typeof t?function(e,n){return t(e,n)>0?e:n}:function(t,e){return t>e?t:e})},merge:function(){for(var t=[],e=0;e3)for(n=[n],r=3;r2&&(e.children=So.slice.call(arguments,2)),No(t.type,e,e.key||t.key,e.ref||t.ref,null)},createContext:function(t){var e={},n={__c:"__cC"+bo++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var r,i=this;return this.getChildContext||(r=[],this.getChildContext=function(){return e[n.__c]=i,e},this.shouldComponentUpdate=function(t){i.props.value!==t.value&&r.some((function(e){e.context=t.value,Po(e)}))},this.sub=function(t){r.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){r.splice(r.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Consumer.contextType=n,n},toChildArray:Lo,_unmount:zo,get options(){return uo}});function $o(t){var e,n,r="";if(t)if("object"==typeof t)if(Array.isArray(t))for(e=0;e=e.__.length&&e.__.push({}),e.__[t]}function os(t){return ss(ds,t)}function ss(t,e,n){var r=is(Yo++);return r.__c||(r.__c=Zo,r.__=[n?n(e):ds(void 0,e),function(e){var n=t(r.__[0],e);r.__[0]!==n&&(r.__[0]=n,r.__c.setState({}))}]),r.__}function us(t,e){var n=is(Yo++);fs(n.__H,e)&&(n.__=t,n.__H=e,Zo.__h.push(n))}function as(t,e){var n=is(Yo++);return fs(n.__H,e)?(n.__H=e,n.__h=t,n.__=t()):n.__}function cs(){Xo.some((function(t){if(t.__P)try{t.__H.__h.forEach(ls),t.__H.__h.forEach(hs),t.__H.__h=[]}catch(e){return t.__H.__h=[],uo.__e(e,t.__v),!0}})),Xo=[]}function ls(t){t.t&&t.t()}function hs(t){var e=t.__();"function"==typeof e&&(t.t=e)}function fs(t,e){return!t||e.some((function(e,n){return e!==t[n]}))}function ds(t,e){return"function"==typeof e?e(t):e}uo.__r=function(t){ts&&ts(t),Yo=0,(Zo=t.__c).__H&&(Zo.__H.__h.forEach(ls),Zo.__H.__h.forEach(hs),Zo.__H.__h=[])},uo.diffed=function(t){es&&es(t);var e=t.__c;if(e){var n=e.__H;n&&n.__h.length&&(1!==Xo.push(e)&&Qo===uo.requestAnimationFrame||((Qo=uo.requestAnimationFrame)||function(t){var e,n=function(){clearTimeout(r),cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);"undefined"!=typeof window&&(e=requestAnimationFrame(n))})(cs))}},uo.__c=function(t,e){e.some((function(t){try{t.__h.forEach(ls),t.__h=t.__h.filter((function(t){return!t.__||hs(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],uo.__e(n,t.__v)}})),ns&&ns(t,e)},uo.unmount=function(t){rs&&rs(t);var e=t.__c;if(e){var n=e.__H;if(n)try{n.__.forEach((function(t){return t.t&&t.t()}))}catch(t){uo.__e(t,e.__v)}}};var ps=Object.freeze({__proto__:null,useState:os,useReducer:ss,useEffect:function(t,e){var n=is(Yo++);fs(n.__H,e)&&(n.__=t,n.__H=e,Zo.__H.__h.push(n))},useLayoutEffect:us,useRef:function(t){return as((function(){return{current:t}}),[])},useImperativeHandle:function(t,e,n){us((function(){"function"==typeof t?t(e()):t&&(t.current=e())}),null==n?n:n.concat(t))},useMemo:as,useCallback:function(t,e){return as((function(){return t}),e)},useContext:function(t){var e=Zo.context[t.__c];if(!e)return t.__;var n=is(Yo++);return null==n.__&&(n.__=!0,e.sub(Zo)),e.props.value},useDebugValue:function(t,e){uo.useDebugValue&&uo.useDebugValue(e?e(t):t)},useErrorBoundary:function(t){var e=is(Yo++),n=os();return e.__=t,Zo.componentDidCatch||(Zo.componentDidCatch=function(t){e.__&&e.__(t),n[1](t)}),[n[0],function(){n[1](void 0)}]}}),bs=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default='.-walletlink-css-reset .-walletlink-link-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-walletlink-css-reset .-walletlink-link-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,.33);transition:opacity .25s}.-walletlink-css-reset .-walletlink-link-dialog-backdrop-hidden{opacity:0}.-walletlink-css-reset .-walletlink-link-dialog-box{display:flex;position:relative;flex-direction:column;background-color:#f6f6f6;border-radius:16px;box-shadow:0px 16px 24px rgba(0,0,0,.1),0px 0px 8px rgba(0,0,0,.05);transform:scale(1);transition:opacity .25s,transform .25s;overflow:hidden}.-walletlink-css-reset .-walletlink-link-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-walletlink-css-reset .-walletlink-link-dialog-box-content{padding:24px;text-align:center}.-walletlink-css-reset .-walletlink-link-dialog-box-content h3{display:block;margin-bottom:24px;text-align:left;text-transform:uppercase;font-size:22px;font-weight:bold;line-height:1.2;color:#000}.-walletlink-css-reset .-walletlink-link-dialog-box-content-qrcode{position:relative;display:block;margin-bottom:24px;background-color:#f6f6f6;padding:16px;border-radius:16px;box-shadow:4px 4px 8px rgba(0,0,0,.15),-8px -8px 8px #fff;overflow:hidden}.-walletlink-css-reset .-walletlink-link-dialog-box-content-qrcode-wrapper{display:block;width:232px;height:232px;padding:4px;border-radius:4px;background:#f4f4f4;margin-bottom:16px}.-walletlink-css-reset .-walletlink-link-dialog-box-content-qrcode-wrapper img{display:block;width:224px;height:224px}.-walletlink-css-reset .-walletlink-link-dialog-box-content-qrcode>p{display:block;color:gray;font-weight:bold;font-size:12px;text-align:center}.-walletlink-css-reset .-walletlink-link-dialog-box-content-qrcode-connecting{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;align-items:center;justify-content:center;background:rgba(246,246,246,.98)}.-walletlink-css-reset .-walletlink-link-dialog-box-content-qrcode-connecting p{margin-top:16px;color:#333;font-size:12px;font-weight:bold}.-walletlink-css-reset .-walletlink-link-dialog-box-content a{text-align:center;cursor:pointer;transition:color .1s;font-size:14px}.-walletlink-css-reset .-walletlink-link-dialog-box-content a,.-walletlink-css-reset .-walletlink-link-dialog-box-content a:link,.-walletlink-css-reset .-walletlink-link-dialog-box-content a:visited{color:#999}.-walletlink-css-reset .-walletlink-link-dialog-box-content a:hover,.-walletlink-css-reset .-walletlink-link-dialog-box-content a:active{color:#666;text-decoration:underline}.-walletlink-css-reset .-walletlink-link-dialog-box-cancel{position:absolute;-webkit-appearance:none;display:flex;align-items:center;justify-content:center;top:24px;right:24px;width:24px;height:24px;border-radius:12px;background-color:#e7e7e7;cursor:pointer}.-walletlink-css-reset .-walletlink-link-dialog-box-cancel-x{position:relative;display:block}.-walletlink-css-reset .-walletlink-link-dialog-box-cancel-x::before,.-walletlink-css-reset .-walletlink-link-dialog-box-cancel-x::after{content:"";position:absolute;display:block;top:-1px;left:-7px;width:14px;height:2px;background-color:#999;transition:background-color .2s}.-walletlink-css-reset .-walletlink-link-dialog-box-cancel-x::before{transform:rotate(45deg)}.-walletlink-css-reset .-walletlink-link-dialog-box-cancel-x::after{transform:rotate(135deg)}.-walletlink-css-reset .-walletlink-link-dialog-box-cancel:hover .-walletlink-link-dialog-box-cancel-x-a,.-walletlink-css-reset .-walletlink-link-dialog-box-cancel:hover .-walletlink-link-dialog-box-cancel-x-b{background-color:#000}.-walletlink-css-reset .-walletlink-link-dialog-container{display:block}.-walletlink-css-reset .-walletlink-link-dialog-container-hidden{display:none}.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box{background-color:#2a2a2a}.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-content h3{color:#ccc}.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-content-qrcode{background-color:#2a2a2a;box-shadow:4px 4px 8px rgba(0,0,0,.5),-8px -8px 8px #343434}.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-content-qrcode>p{color:#999}.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-content-qrcode-connecting{background:rgba(42,42,42,.98)}.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-content-qrcode-connecting p{color:#ddd}.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-content a,.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-content a:link,.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-content a:visited{color:#888}.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-content a:hover,.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-content a:active{color:#aaa}.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-cancel{background-color:#333}.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-cancel-x::before,.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-cancel-x::after{background-color:#aaa}.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-cancel:hover .-walletlink-link-dialog-box-cancel-x::before,.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-cancel:hover .-walletlink-link-dialog-box-cancel-x::after{background-color:#eee}'}));function vs(t){this.mode=ys.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,n=this.data.length;e65536?(r[0]=240|(1835008&i)>>>18,r[1]=128|(258048&i)>>>12,r[2]=128|(4032&i)>>>6,r[3]=128|63&i):i>2048?(r[0]=224|(61440&i)>>>12,r[1]=128|(4032&i)>>>6,r[2]=128|63&i):i>128?(r[0]=192|(1984&i)>>>6,r[1]=128|63&i):r[0]=i,this.parsedData.push(r)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function ms(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Object(v.c)(bs),vs.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,n=this.parsedData.length;e=7&&this.setupTypeNumber(t),null==this.dataCache&&(this.dataCache=ms.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var n=-1;n<=7;n++)if(!(t+n<=-1||this.moduleCount<=t+n))for(var r=-1;r<=7;r++)e+r<=-1||this.moduleCount<=e+r||(this.modules[t+n][e+r]=0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4)},getBestMaskPattern:function(){for(var t=0,e=0,n=0;n<8;n++){this.makeImpl(!0,n);var r=gs.getLostPoint(this);(0==n||t>r)&&(t=r,e=n)}return e},createMovieClip:function(t,e,n){var r=t.createEmptyMovieClip(e,n);this.make();for(var i=0;i>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(n=0;n<18;n++)r=!t&&1==(e>>n&1),this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r},setupTypeInfo:function(t,e){for(var n=this.errorCorrectLevel<<3|e,r=gs.getBCHTypeInfo(n),i=0;i<15;i++){var o=!t&&1==(r>>i&1);i<6?this.modules[i][8]=o:i<8?this.modules[i+1][8]=o:this.modules[this.moduleCount-15+i][8]=o}for(i=0;i<15;i++)o=!t&&1==(r>>i&1),i<8?this.modules[8][this.moduleCount-i-1]=o:i<9?this.modules[8][15-i-1+1]=o:this.modules[8][15-i-1]=o;this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var n=-1,r=this.moduleCount-1,i=7,o=0,s=this.moduleCount-1;s>0;s-=2)for(6==s&&s--;;){for(var u=0;u<2;u++)if(null==this.modules[r][s-u]){var a=!1;o>>i&1)),gs.getMask(e,r,s-u)&&(a=!a),this.modules[r][s-u]=a,-1==--i&&(o++,i=7)}if((r+=n)<0||this.moduleCount<=r){r-=n,n=-n;break}}}},ms.PAD0=236,ms.PAD1=17,ms.createData=function(t,e,n){for(var r=xs.getRSBlocks(t,e),i=new Ss,o=0;o8*u)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+8*u+")");for(i.getLengthInBits()+4<=8*u&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*u||(i.put(ms.PAD0,8),i.getLengthInBits()>=8*u));)i.put(ms.PAD1,8);return ms.createBytes(i,r)},ms.createBytes=function(t,e){for(var n=0,r=0,i=0,o=new Array(e.length),s=new Array(e.length),u=0;u=0?f.get(d):0}}var p=0;for(l=0;l=0;)e^=gs.G15<=0;)e^=gs.G18<>>=1;return e},getPatternPosition:function(t){return gs.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,n){switch(t){case 0:return(e+n)%2==0;case 1:return e%2==0;case 2:return n%3==0;case 3:return(e+n)%3==0;case 4:return(Math.floor(e/2)+Math.floor(n/3))%2==0;case 5:return e*n%2+e*n%3==0;case 6:return(e*n%2+e*n%3)%2==0;case 7:return(e*n%3+(e+n)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new ks([1],0),n=0;n5&&(n+=3+o-5)}for(r=0;r=256;)t-=255;return ws.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},_s=0;_s<8;_s++)ws.EXP_TABLE[_s]=1<<_s;for(_s=8;_s<256;_s++)ws.EXP_TABLE[_s]=ws.EXP_TABLE[_s-4]^ws.EXP_TABLE[_s-5]^ws.EXP_TABLE[_s-6]^ws.EXP_TABLE[_s-8];for(_s=0;_s<255;_s++)ws.LOG_TABLE[ws.EXP_TABLE[_s]]=_s;function ks(t,e){if(null==t.length)throw new Error(t.length+"/"+e);for(var n=0;n>>7-t%8&1)},put:function(t,e){for(var n=0;n>>e-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Ms=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function Es(t){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M"},"string"==typeof t&&(t={content:t}),t)for(var e in t)this.options[e]=t[e];if("string"!=typeof this.options.content)throw new Error("Expected 'content' as string!");if(0===this.options.content.length)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0&&this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");var n=this.options.content,r=function(t,e){for(var n=function(t){var e=encodeURI(t).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return e.length+(e.length!=t?3:0)}(t),r=1,i=0,o=0,s=Ms.length;o<=s;o++){var u=Ms[o];if(!u)throw new Error("Content too long: expected "+i+" but got "+n);switch(e){case"L":i=u[0];break;case"M":i=u[1];break;case"Q":i=u[2];break;case"H":i=u[3];break;default:throw new Error("Unknwon error correction level: "+e)}if(n<=i)break;r++}if(r>Ms.length)throw new Error("Content too long");return r}(n,this.options.ecl),i=function(t){switch(t){case"L":return 1;case"M":return 0;case"Q":return 3;case"H":return 2;default:throw new Error("Unknwon error correction level: "+t)}}(this.options.ecl);this.qrcode=new ms(r,i),this.qrcode.addData(n),this.qrcode.make()}Es.prototype.svg=function(t){var e=this.options||{},n=this.qrcode.modules;void 0===t&&(t={container:e.container||"svg"});for(var r=void 0===e.pretty||!!e.pretty,i=r?" ":"",o=r?"\r\n":"",s=e.width,u=e.height,a=n.length,c=s/(a+2*e.padding),l=u/(a+2*e.padding),h=void 0!==e.join&&!!e.join,f=void 0!==e.swap&&!!e.swap,d=void 0===e.xmlDeclaration||!!e.xmlDeclaration,p=void 0!==e.predefined&&!!e.predefined,b=p?i+''+o:"",v=i+''+o,m="",y="",g=0;g'+o:i+''+o}h&&(m=i+'');var E="";switch(t.container){case"svg":d&&(E+=''+o),E+=''+o,E+=b+v+m,E+="";break;case"svg-viewbox":d&&(E+=''+o),E+=''+o,E+=b+v+m,E+="";break;case"g":E+=''+o,E+=b+v+m,E+="";break;default:E+=(b+v+m).replace(/^\s+/,"")}return E};var Cs=Es,Os=Object(v.b)((function(e,n){var r=v.d&&v.d.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var i=r(Cs);n.QRCode=function(e){var n=ps.useState(""),r=Object(h.a)(n,2),o=r[0],s=r[1];return ps.useEffect((function(){var n,r,o=new i.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:null!==(n=e.width)&&void 0!==n?n:256,height:null!==(r=e.height)&&void 0!==r?r:256,padding:0}),u=t.from(o.svg(),"utf8").toString("base64");s("data:image/svg+xml;base64,".concat(u))})),o?Jo.h("img",{src:o,alt:"QR Code"}):null}}));Object(v.c)(Os),Os.QRCode;var Ns=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=".-walletlink-css-reset .-walletlink-spinner{display:inline-block}.-walletlink-css-reset .-walletlink-spinner svg{display:inline-block;animation:2s linear infinite -walletlink-spinner-svg}.-walletlink-css-reset .-walletlink-spinner svg circle{animation:1.9s ease-in-out infinite both -walletlink-spinner-circle;display:block;fill:transparent;stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -walletlink-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -walletlink-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}"}));Object(v.c)(Ns);var Ts=Object(v.b)((function(t,e){var n=v.d&&v.d.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(Ns);e.Spinner=function(t){var e,n=null!==(e=t.size)&&void 0!==e?e:64,i=t.color||"#000";return Jo.h("div",{class:"-walletlink-spinner"},Jo.h("style",null,r.default),Jo.h("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:n,height:n}},Jo.h("circle",{style:{cx:50,cy:50,r:45,stroke:i}})))}}));Object(v.c)(Ts),Ts.Spinner;var js=Object(v.b)((function(t,e){var n=v.d&&v.d.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(Go),i=n(bs);e.LinkDialog=function(t){var e=ps.useState(!t.isOpen),n=Object(h.a)(e,2),u=n[0],a=n[1],c=ps.useState(!t.isOpen),l=Object(h.a)(c,2),f=l[0],d=l[1];return ps.useEffect((function(){var e=t.isOpen,n=[window.setTimeout((function(){d(!e)}),10)];return e?a(!1):n.push(window.setTimeout((function(){a(!0)}),360)),function(){n.forEach(window.clearTimeout)}}),[t.isOpen]),Jo.h("div",{class:r.default("-walletlink-link-dialog-container",t.darkMode&&"-walletlink-link-dialog-container-dark",u&&"-walletlink-link-dialog-container-hidden")},Jo.h("style",null,i.default),Jo.h("div",{class:r.default("-walletlink-link-dialog-backdrop",f&&"-walletlink-link-dialog-backdrop-hidden")}),Jo.h("div",{class:"-walletlink-link-dialog"},Jo.h("div",{class:r.default("-walletlink-link-dialog-box",f&&"-walletlink-link-dialog-box-hidden")},Jo.h(o,{darkMode:t.darkMode,version:t.version,sessionId:t.sessionId,sessionSecret:t.sessionSecret,walletLinkUrl:t.walletLinkUrl,isConnected:t.isConnected}),t.onCancel&&Jo.h(s,{onClick:t.onCancel}))))};var o=function(t){var e=window.encodeURIComponent(t.walletLinkUrl),n="".concat(t.walletLinkUrl,"/#/link?id=").concat(t.sessionId,"&secret=").concat(t.sessionSecret,"&server=").concat(e,"&v=1");return Jo.h("div",{class:"-walletlink-link-dialog-box-content"},Jo.h("h3",null,"Scan to",Jo.h("br",null)," Connect"),Jo.h("div",{class:"-walletlink-link-dialog-box-content-qrcode"},Jo.h("div",{class:"-walletlink-link-dialog-box-content-qrcode-wrapper"},Jo.h(Os.QRCode,{content:n,width:224,height:224,fgColor:"#000",bgColor:"transparent"})),Jo.h("input",{type:"hidden",value:n}),!t.isConnected&&Jo.h("div",{class:"-walletlink-link-dialog-box-content-qrcode-connecting"},Jo.h(Ts.Spinner,{size:128,color:t.darkMode?"#fff":"#000"}),Jo.h("p",null,"Connecting...")),Jo.h("p",{title:"WalletLink v".concat(t.version)},"Powered by WalletLink")),Jo.h("a",{href:"".concat(t.walletLinkUrl,"/#/wallets"),target:"_blank",rel:"noopener"},"Don\u2019t have a wallet app?"))},s=function(t){return Jo.h("button",{class:"-walletlink-link-dialog-box-cancel",onClick:t.onClick},Jo.h("div",{class:"-walletlink-link-dialog-box-cancel-x"}))}}));Object(v.c)(js),js.LinkDialog;var Is=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinkFlow=function(){function t(e){Object(f.a)(this,t),this.subscriptions=new gn.Subscription,this.isConnected=!1,this.isOpen=!1,this.onCancel=null,this.root=null,this.darkMode=e.darkMode,this.version=e.version,this.sessionId=e.sessionId,this.sessionSecret=e.sessionSecret,this.walletLinkUrl=e.walletLinkUrl,this.connected$=e.connected$}return Object(d.a)(t,[{key:"attach",value:function(t){var e=this;this.root=document.createElement("div"),this.root.className="-walletlink-link-flow-root",t.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe((function(t){e.isConnected!==t&&(e.isConnected=t,e.render())})))}},{key:"detach",value:function(){var t;this.root&&(this.subscriptions.unsubscribe(),Jo.render(null,this.root),null===(t=this.root.parentElement)||void 0===t||t.removeChild(this.root))}},{key:"open",value:function(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}},{key:"close",value:function(){this.isOpen=!1,this.onCancel=null,this.render()}},{key:"render",value:function(){this.root&&Jo.render(Jo.h(js.LinkDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,walletLinkUrl:this.walletLinkUrl,isOpen:this.isOpen,isConnected:this.isConnected,onCancel:this.onCancel}),this.root)}}]),t}()}));Object(v.c)(Is),Is.LinkFlow;var As=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default='.-walletlink-css-reset .-walletlink-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-walletlink-css-reset .-walletlink-snackbar-item{background-color:#fff;border-radius:8px;box-shadow:0px 16px 24px rgba(0,0,0,.06),0px 0px 8px rgba(0,0,0,.04);display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:hidden;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-walletlink-css-reset .-walletlink-snackbar-item-content{align-items:center;cursor:pointer;display:flex;flex-direction:row;justify-content:space-between;padding:8px 8px 8px 16px;user-select:none}.-walletlink-css-reset .-walletlink-snackbar-item-content-message{color:#000;font-size:14px;line-height:1.5}.-walletlink-css-reset .-walletlink-snackbar-item-content-chevron{position:relative;display:block;margin:0 8px;transition:transform .05s}.-walletlink-css-reset .-walletlink-snackbar-item-content-chevron::before{position:relative;top:-2px;content:"";display:block;border-top:2px solid #000;border-left:2px solid #000;width:8px;height:8px;transform:rotate(-135deg)}.-walletlink-css-reset .-walletlink-snackbar-item-progress-bar{display:block;height:2px;position:relative}.-walletlink-css-reset .-walletlink-snackbar-item-progress-bar::before{animation:-walletlink-snackbar-progressbar 2s linear infinite;background-image:linear-gradient(to right, rgba(22, 82, 240, 0) 0%, #1652f0 100%);content:"";height:100%;left:-100%;position:absolute;width:100%}.-walletlink-css-reset .-walletlink-snackbar-item-actions{display:none;flex-direction:column;border-top:1px solid #f5f7f8;padding:2px 16px 8px}.-walletlink-css-reset .-walletlink-snackbar-item-actions-item{margin:8px 0}.-walletlink-css-reset .-walletlink-snackbar-item-actions-item-info{color:#888;font-size:14px;margin:0 8px 0 0}.-walletlink-css-reset .-walletlink-snackbar-item-actions-item-button{-webkit-appearance:none;-webkit-text-fill-color:#1652f0;background:transparent;color:#1652f0;cursor:pointer;display:inline;font-size:14px;margin:0;padding:0;transition:opacity .25s}.-walletlink-css-reset .-walletlink-snackbar-item-actions-item-button:active{opacity:.6}.-walletlink-css-reset .-walletlink-snackbar-item-hidden{opacity:0;text-align:left;transform:translateX(25%)}.-walletlink-css-reset .-walletlink-snackbar-item-expanded .-walletlink-snackbar-item-content-chevron{transform:rotate(180deg)}.-walletlink-css-reset .-walletlink-snackbar-item-expanded .-walletlink-snackbar-item-actions{display:flex}.-walletlink-css-reset .-walletlink-snackbar-container-dark .-walletlink-snackbar-item{background-color:#2a2a2a}.-walletlink-css-reset .-walletlink-snackbar-container-dark .-walletlink-snackbar-item-content-message{color:#999}.-walletlink-css-reset .-walletlink-snackbar-container-dark .-walletlink-snackbar-item-content-chevron::before{border-top:2px solid #ccc;border-left:2px solid #ccc}.-walletlink-css-reset .-walletlink-snackbar-container-dark .-walletlink-snackbar-item-progress-bar::before{animation:-walletlink-snackbar-progressbar-dark 2s linear infinite;background-image:linear-gradient(to right, rgba(69, 120, 255, 0) 0%, #4578ff 100%)}.-walletlink-css-reset .-walletlink-snackbar-container-dark .-walletlink-snackbar-item-actions{border-top:1px solid #343434}.-walletlink-css-reset .-walletlink-snackbar-container-dark .-walletlink-snackbar-item-actions-item-button{-webkit-text-fill-color:#ccc;color:#ccc}@keyframes -walletlink-snackbar-progressbar{0%{left:0;width:0%;background-image:linear-gradient(to right, rgba(22, 82, 240, 0) 0%, #1652f0 100%)}25%{left:0;width:100%}50%{left:100%;width:0%;background-image:linear-gradient(to right, rgba(22, 82, 240, 0) 0%, #1652f0 100%)}50.01%{background-image:linear-gradient(to left, rgba(22, 82, 240, 0) 0%, #1652f0 100%)}75%{left:0;width:100%}100%{left:0;width:0%;background-image:linear-gradient(to left, rgba(22, 82, 240, 0) 0%, #1652f0 100%)}}@keyframes -walletlink-snackbar-progressbar-dark{0%{left:0;width:0%;background-image:linear-gradient(to right, rgba(69, 120, 255, 0) 0%, #4578ff 100%)}25%{left:0;width:100%}50%{left:100%;width:0%;background-image:linear-gradient(to right, rgba(69, 120, 255, 0) 0%, #4578ff 100%)}50.01%{background-image:linear-gradient(to left, rgba(69, 120, 255, 0) 0%, #4578ff 100%)}75%{left:0;width:100%}100%{left:0;width:0%;background-image:linear-gradient(to left, rgba(69, 120, 255, 0) 0%, #4578ff 100%)}}'}));Object(v.c)(As);var Ps=Object(v.b)((function(t,e){var n=v.d&&v.d.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(Go),i=n(As);e.Snackbar=function(){function t(e){Object(f.a)(this,t),this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=e.darkMode}return Object(d.a)(t,[{key:"attach",value:function(t){this.root=document.createElement("div"),this.root.className="-walletlink-snackbar-root",t.appendChild(this.root),this.render()}},{key:"presentItem",value:function(t){var e=this,n=this.nextItemKey++;return this.items.set(n,t),this.render(),function(){e.items.delete(n),e.render()}}},{key:"clear",value:function(){this.items.clear(),this.render()}},{key:"render",value:function(){this.root&&Jo.render(Jo.h(o,{darkMode:this.darkMode},Array.from(this.items.entries()).map((function(t){var e=Object(h.a)(t,2),n=e[0],r=e[1];return Jo.h(s,Object.assign({},r,{key:n}))}))),this.root)}}]),t}();var o=function(t){return Jo.h("div",{class:r.default("-walletlink-snackbar-container",t.darkMode&&"-walletlink-snackbar-container-dark")},Jo.h("style",null,i.default),Jo.h("div",{class:"-walletlink-snackbar"},t.children))},s=function(t){var e=t.message,n=t.showProgressBar,i=t.actions,o=ps.useState(!0),s=Object(h.a)(o,2),u=s[0],a=s[1],c=ps.useState(!1),l=Object(h.a)(c,2),f=l[0],d=l[1];return ps.useEffect((function(){var t=[window.setTimeout((function(){a(!1)}),1),window.setTimeout((function(){d(!0)}),1e4)];return function(){t.forEach(window.clearTimeout)}})),Jo.h("div",{class:r.default("-walletlink-snackbar-item",u&&"-walletlink-snackbar-item-hidden",f&&"-walletlink-snackbar-item-expanded")},Jo.h("div",{class:"-walletlink-snackbar-item-content",onClick:function(){d(!f)}},Jo.h("div",{class:"-walletlink-snackbar-item-content-message"},e),Jo.h("div",{class:"-walletlink-snackbar-item-content-chevron",title:"Expand"})),n&&Jo.h("div",{class:"-walletlink-snackbar-item-progress-bar"}),i&&i.length>0&&Jo.h("div",{class:"-walletlink-snackbar-item-actions"},i.map((function(t,e){return Jo.h("div",{class:"-walletlink-snackbar-item-actions-item",key:e},Jo.h("span",{class:"-walletlink-snackbar-item-actions-item-info"},t.info),Jo.h("button",{class:"-walletlink-snackbar-item-actions-item-button",onClick:t.onClick},t.buttonLabel))}))))}}));Object(v.c)(Ps),Ps.Snackbar;var Rs=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ClientMessageHostSession=function(t){return Object.assign({type:"HostSession"},t)},e.ClientMessageIsLinked=function(t){return Object.assign({type:"IsLinked"},t)},e.ClientMessageGetSessionConfig=function(t){return Object.assign({type:"GetSessionConfig"},t)},e.ClientMessageSetSessionConfig=function(t){return Object.assign({type:"SetSessionConfig"},t)},e.ClientMessagePublishEvent=function(t){return Object.assign({type:"PublishEvent"},t)}}));Object(v.c)(Rs),Rs.ClientMessageHostSession,Rs.ClientMessageIsLinked,Rs.ClientMessageGetSessionConfig,Rs.ClientMessageSetSessionConfig,Rs.ClientMessagePublishEvent;var Ds=Object(v.b)((function(t,e){var n;Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"}(n=e.ConnectionState||(e.ConnectionState={})),e.RxWebSocket=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:WebSocket;Object(f.a)(this,t),this.WebSocketClass=r,this.webSocket=null,this.connectionStateSubject=new gn.BehaviorSubject(n.DISCONNECTED),this.incomingDataSubject=new gn.Subject,this.url=e.replace(/^http/,"ws")}return Object(d.a)(t,[{key:"connect",value:function(){var t=this;return this.webSocket?gn.throwError(new Error("webSocket object is not null")):new gn.Observable((function(e){var r;try{t.webSocket=r=new t.WebSocketClass(t.url)}catch(r){return void e.error(r)}t.connectionStateSubject.next(n.CONNECTING),r.onclose=function(r){t.clearWebSocket(),e.error(new Error("websocket error ".concat(r.code,": ").concat(r.reason))),t.connectionStateSubject.next(n.DISCONNECTED)},r.onopen=function(r){e.next(),e.complete(),t.connectionStateSubject.next(n.CONNECTED)},r.onmessage=function(e){t.incomingDataSubject.next(e.data)}})).pipe(ko.take(1))}},{key:"disconnect",value:function(){var t=this.webSocket;if(t){this.clearWebSocket(),this.connectionStateSubject.next(n.DISCONNECTED);try{t.close()}catch(t){}}}},{key:"connectionState$",get:function(){return this.connectionStateSubject.asObservable()}},{key:"incomingData$",get:function(){return this.incomingDataSubject.asObservable()}},{key:"incomingJSONData$",get:function(){return this.incomingData$.pipe(ko.flatMap((function(t){var e;try{e=JSON.parse(t)}catch(t){return gn.empty()}return gn.of(e)})))}},{key:"sendData",value:function(t){var e=this.webSocket;if(!e)throw new Error("websocket is not connected");e.send(t)}},{key:"clearWebSocket",value:function(){var t=this.webSocket;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}]),t}()}));Object(v.c)(Ds),Ds.ConnectionState,Ds.RxWebSocket;var Ls=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.isServerMessageFail=function(t){return t&&"Fail"===t.type&&"number"==typeof t.id&&"string"==typeof t.sessionId&&"string"==typeof t.error}}));Object(v.c)(Ls),Ls.isServerMessageFail;var Bs=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.WalletLinkConnection=function(){function e(t,n,r){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:WebSocket;Object(f.a)(this,e),this.sessionId=t,this.sessionKey=n,this.subscriptions=new gn.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=w.IntNumber(1),this.connectedSubject=new gn.BehaviorSubject(!1),this.linkedSubject=new gn.BehaviorSubject(!1),this.sessionConfigSubject=new gn.ReplaySubject(1);var s=new Ds.RxWebSocket(r+"/rpc",o);this.ws=s,this.subscriptions.add(s.connectionState$.pipe(ko.skip(1),ko.filter((function(t){return t===Ds.ConnectionState.DISCONNECTED&&!i.destroyed})),ko.delay(5e3),ko.filter((function(t){return!i.destroyed})),ko.flatMap((function(t){return s.connect()})),ko.retry()).subscribe()),this.subscriptions.add(s.connectionState$.pipe(ko.skip(2),ko.switchMap((function(t){return gn.iif((function(){return t===Ds.ConnectionState.CONNECTED}),i.authenticate().pipe(ko.tap((function(t){return i.sendIsLinked()})),ko.tap((function(t){return i.sendGetSessionConfig()})),ko.map((function(t){return!0}))),gn.of(!1))})),ko.distinctUntilChanged(),ko.catchError((function(t){return gn.of(!1)}))).subscribe((function(t){return i.connectedSubject.next(t)}))),this.subscriptions.add(s.connectionState$.pipe(ko.skip(1),ko.switchMap((function(t){return gn.iif((function(){return t===Ds.ConnectionState.CONNECTED}),gn.timer(0,1e4))}))).subscribe((function(t){return 0===t?i.updateLastHeartbeat():i.heartbeat()}))),this.subscriptions.add(s.incomingData$.pipe(ko.filter((function(t){return"h"===t}))).subscribe((function(t){return i.updateLastHeartbeat()}))),this.subscriptions.add(s.incomingJSONData$.pipe(ko.filter((function(t){return["IsLinkedOK","Linked"].includes(t.type)}))).subscribe((function(t){var e=t;i.linkedSubject.next(e.linked||e.onlineGuests>0)}))),this.subscriptions.add(s.incomingJSONData$.pipe(ko.filter((function(t){return["GetSessionConfigOK","SessionConfigUpdated"].includes(t.type)}))).subscribe((function(t){var e=t;i.sessionConfigSubject.next({webhookId:e.webhookId,webhookUrl:e.webhookUrl,metadata:e.metadata})})))}return Object(d.a)(e,[{key:"connect",value:function(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect().subscribe()}},{key:"destroy",value:function(){this.subscriptions.unsubscribe(),this.ws.disconnect(),this.destroyed=!0}},{key:"connected$",get:function(){return this.connectedSubject.asObservable()}},{key:"onceConnected$",get:function(){return this.connected$.pipe(ko.filter((function(t){return t})),ko.take(1),ko.map((function(){})))}},{key:"linked$",get:function(){return this.linkedSubject.asObservable()}},{key:"onceLinked$",get:function(){return this.linked$.pipe(ko.filter((function(t){return t})),ko.take(1),ko.map((function(){})))}},{key:"sessionConfig$",get:function(){return this.sessionConfigSubject.asObservable()}},{key:"incomingEvent$",get:function(){return this.ws.incomingJSONData$.pipe(ko.filter((function(t){if("Event"!==t.type)return!1;var e=t;return"string"==typeof e.sessionId&&"string"==typeof e.eventId&&"string"==typeof e.event&&"string"==typeof e.data})),ko.map((function(t){return t})))}},{key:"setSessionMetadata",value:function(t,e){var n=this,i=Rs.ClientMessageSetSessionConfig({id:w.IntNumber(this.nextReqId++),sessionId:this.sessionId,metadata:Object(r.a)({},t,e)});return this.onceConnected$.pipe(ko.flatMap((function(t){return n.makeRequest(i)})),ko.map((function(t){if(Ls.isServerMessageFail(t))throw new Error(t.error||"failed to set session metadata")})))}},{key:"publishEvent",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=Rs.ClientMessagePublishEvent({id:w.IntNumber(this.nextReqId++),sessionId:this.sessionId,event:t,data:e,callWebhook:r});return this.onceLinked$.pipe(ko.flatMap((function(t){return n.makeRequest(i)})),ko.map((function(t){if(Ls.isServerMessageFail(t))throw new Error(t.error||"failed to publish event");return t.eventId})))}},{key:"sendData",value:function(t){this.ws.sendData(JSON.stringify(t))}},{key:"updateLastHeartbeat",value:function(){this.lastHeartbeatResponse=Date.now()}},{key:"heartbeat",value:function(){if(Date.now()-this.lastHeartbeatResponse>2e4)this.ws.disconnect();else try{this.ws.sendData("h")}catch(t){}}},{key:"makeRequest",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6e4,n=t.id;try{this.sendData(t)}catch(t){return gn.throwError(t)}return this.ws.incomingJSONData$.pipe(ko.timeoutWith(e,gn.throwError(new Error("request ".concat(n," timed out")))),ko.filter((function(t){return t.id===n})),ko.take(1))}},{key:"authenticate",value:function(){var t=Rs.ClientMessageHostSession({id:w.IntNumber(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(t).pipe(ko.map((function(t){if(Ls.isServerMessageFail(t))throw new Error(t.error||"failed to authentcate")})))}},{key:"sendIsLinked",value:function(){var t=Rs.ClientMessageIsLinked({id:w.IntNumber(this.nextReqId++),sessionId:this.sessionId});this.sendData(t)}},{key:"sendGetSessionConfig",value:function(){var t=Rs.ClientMessageGetSessionConfig({id:w.IntNumber(this.nextReqId++),sessionId:this.sessionId});this.sendData(t)}}]),e}()}));Object(v.c)(Bs),Bs.WalletLinkConnection;var Fs=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ScopedLocalStorage=function(){function t(e){Object(f.a)(this,t),this.scope=e}return Object(d.a)(t,[{key:"setItem",value:function(t,e){localStorage.setItem(this.scopedKey(t),e)}},{key:"getItem",value:function(t){return localStorage.getItem(this.scopedKey(t))}},{key:"removeItem",value:function(t){localStorage.removeItem(this.scopedKey(t))}},{key:"clear",value:function(){for(var t=this.scopedKey(""),e=[],n=0;n=0;u--)(i=t[u])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},r=v.d&&v.d.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=v.d&&v.d.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=r(X),s=r(m.c),u=r(y.a),a=i(Ws),c=function(){function t(e){Object(f.a)(this,t),this.appName="",this.appLogoUrl=null,this.attached=!1,this.walletLinkUrl=e.walletLinkUrl;var n=u.default.parse(this.walletLinkUrl);this.walletLinkOrigin="".concat(n.protocol,"//").concat(n.host),this.storage=new Fs.ScopedLocalStorage("-walletlink:".concat(this.walletLinkOrigin)),this.session=qs.Session.load(this.storage)||new qs.Session(this.storage).save(),this.connection=new Bs.WalletLinkConnection(this.session.id,this.session.key,this.walletLinkUrl),this.connection.incomingEvent$.pipe(ko.filter((function(t){return"Web3Response"===t.event}))).subscribe({next:this.handleIncomingEvent}),this.connection.sessionConfig$.pipe(ko.filter((function(t){return!!t.metadata&&"1"===t.metadata.__destroyed}))).subscribe({next:this.resetAndReload}),this.snackbar=new Ps.Snackbar({darkMode:e.darkMode}),this.linkFlow=new Is.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:this.session.id,sessionSecret:this.session.secret,walletLinkUrl:this.walletLinkUrl,connected$:this.connection.connected$}),this.connection.connect()}return Object(d.a)(t,[{key:"resetAndReload",value:function(){var t=this;this.connection.setSessionMetadata("__destroyed","1").pipe(ko.timeout(1e3),ko.catchError((function(t){return gn.of(null)}))).subscribe((function(e){t.connection.destroy(),t.storage.clear(),document.location.reload()}))}},{key:"setAppInfo",value:function(t,e){this.appName=t,this.appLogoUrl=e}},{key:"attach",value:function(t){if(this.attached)throw new Error("WalletLinkRelay is already attached");var e=document.createElement("div");e.className="-walletlink-css-reset",t.appendChild(e),this.linkFlow.attach(e),this.snackbar.attach(e)}},{key:"getStorageItem",value:function(t){return this.storage.getItem(t)}},{key:"setStorageItem",value:function(t,e){this.storage.setItem(t,e)}},{key:"requestEthereumAccounts",value:function(){return this.sendRequest({method:Us.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}})}},{key:"signEthereumMessage",value:function(t,e,n,r){return this.sendRequest({method:Us.Web3Method.signEthereumMessage,params:{message:_.hexStringFromBuffer(t,!0),address:e,addPrefix:n,typedDataJson:r||null}})}},{key:"ethereumAddressFromSignedMessage",value:function(t,e,n){return this.sendRequest({method:Us.Web3Method.ethereumAddressFromSignedMessage,params:{message:_.hexStringFromBuffer(t,!0),signature:_.hexStringFromBuffer(e,!0),addPrefix:n}})}},{key:"signEthereumTransaction",value:function(t){return this.sendRequest({method:Us.Web3Method.signEthereumTransaction,params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:_.bigIntStringFromBN(t.weiValue),data:_.hexStringFromBuffer(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?_.bigIntStringFromBN(t.gasPriceInWei):null,gasLimit:t.gasLimit?_.bigIntStringFromBN(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}},{key:"signAndSubmitEthereumTransaction",value:function(t){return this.sendRequest({method:Us.Web3Method.signEthereumTransaction,params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:_.bigIntStringFromBN(t.weiValue),data:_.hexStringFromBuffer(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?_.bigIntStringFromBN(t.gasPriceInWei):null,gasLimit:t.gasLimit?_.bigIntStringFromBN(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}},{key:"submitEthereumTransaction",value:function(t,e){return this.sendRequest({method:Us.Web3Method.submitEthereumTransaction,params:{signedTransaction:_.hexStringFromBuffer(t,!0),chainId:e}})}},{key:"scanQRCode",value:function(t){return this.sendRequest({method:Us.Web3Method.scanQRCode,params:{regExp:t}})}},{key:"arbitraryRequest",value:function(t){return this.sendRequest({method:Us.Web3Method.arbitrary,params:{data:t}})}},{key:"sendRequest",value:function(e){var n=this;return new Promise((function(r,i){var o=null,u=s.default.randomBytes(8).toString("hex"),a=function(){n.publishWeb3RequestCanceledEvent(u),n.handleWeb3ResponseMessage(Js.Web3ResponseMessage({id:u,response:Ks.ErrorResponse(e.method,"User rejected request")})),null==o||o()};if(e.method===Us.Web3Method.requestEthereumAccounts)n.linkFlow.open({onCancel:a}),t.accountRequestCallbackIds.add(u);else{var c={message:"Pushed a request to your wallet...",showProgressBar:!0,actions:[{info:"Made a mistake?",buttonLabel:"Cancel",onClick:a},{info:"Not receiving requests?",buttonLabel:"Reset Connection",onClick:n.resetAndReload}]};o=n.snackbar.presentItem(c)}t.callbacks.set(u,(function(t){if(n.linkFlow.close(),null==o||o(),t.errorMessage)return i(new Error(t.errorMessage));r(t)})),n.publishWeb3RequestEvent(u,e)}))}},{key:"publishWeb3RequestEvent",value:function(t,e){var n=this,r=Hs.Web3RequestMessage({id:t,request:e});this.publishEvent("Web3Request",r,!0).subscribe({error:function(t){n.handleWeb3ResponseMessage(Js.Web3ResponseMessage({id:r.id,response:{method:r.request.method,errorMessage:t.message}}))}})}},{key:"publishWeb3RequestCanceledEvent",value:function(t){var e=zs.Web3RequestCanceledMessage(t);this.publishEvent("Web3RequestCanceled",e,!1).subscribe()}},{key:"publishEvent",value:function(t,e,n){var r=a.encrypt(JSON.stringify(Object.assign(Object.assign({},e),{origin:location.origin})),this.session.secret);return this.connection.publishEvent(t,r,n)}},{key:"handleIncomingEvent",value:function(t){var e;try{e=JSON.parse(a.decrypt(t.data,this.session.secret))}catch(t){return}var n=Js.isWeb3ResponseMessage(e)?e:null;n&&this.handleWeb3ResponseMessage(n)}},{key:"handleWeb3ResponseMessage",value:function(e){var n=this,r=e.response;if(Ks.isRequestEthereumAccountsResponse(r))return Array.from(t.accountRequestCallbackIds.values()).forEach((function(t){return n.invokeCallback(Object.assign(Object.assign({},e),{id:t}))})),void t.accountRequestCallbackIds.clear();this.invokeCallback(e)}},{key:"invokeCallback",value:function(e){var n=t.callbacks.get(e.id);n&&(n(e.response),t.callbacks.delete(e.id))}}]),t}();c.callbacks=new Map,c.accountRequestCallbackIds=new Set,n([o.default],c.prototype,"resetAndReload",null),n([o.default],c.prototype,"handleIncomingEvent",null),e.WalletLinkRelay=c}));Object(v.c)($s),$s.WalletLinkRelay;var Gs=["cipher","cipherbrowser","coinbase","coinbasewallet","eth","ether","ethereum","etherium","injection","toshi","wallet","walletlink","web3"],Ys="dist/index.js",Zs="https://github.com/walletlink/walletlink.git",Qs={tsc:"tsc --noEmit --pretty",test:"jest","test:watch":"jest --watch",build:"node compile-assets.js && webpack --config webpack.config.js","build-chrome":"webpack --config webpack.config.chrome.js","build-npm":"tsc -p ./tsconfig.build.json","build:dev":"export WALLETLINK_URL='http://localhost:3000'; yarn build && yarn build-chrome","build:dev:watch":"nodemon -e 'ts,tsx,js,json,css,scss,svg' --ignore 'src/**/*-css.ts' --ignore 'src/**/*-svg.ts' --watch src/ --watch chrome/ --exec 'yarn build:dev'","build:prod":"yarn build && yarn build-chrome && yarn build-npm && cp ./package.json ../README.md ../LICENSE build/npm && cp -a src/vendor-js build/npm/dist && sed -i '' 's| \"private\": true,||g' build/npm/package.json",lint:"tslint -p . 'src/**/*.ts{,x}'","lint:watch":"nodemon -e ts,tsx,js,json,css,scss,svg --watch src/ --exec 'yarn tsc && yarn lint'"},Xs={"bind-decorator":"^1.0.11","bn.js":"^5.1.1",clsx:"^1.1.0",preact:"^10.3.3",rxjs:"^6.5.4"},tu={"@types/bn.js":"^4.11.6","@types/jest":"^25.1.3","@types/node":"^13.7.7","copy-webpack-plugin":"^5.1.1","core-js":"^3.6.4",glob:"^7.1.6",jest:"^25.1.0",nodemon:"^2.0.2","raw-loader":"^4.0.0","regenerator-runtime":"^0.13.3","rxjs-tslint":"^0.1.7",sass:"^1.26.2",svgo:"^1.3.2","ts-jest":"^25.2.1","ts-loader":"^6.2.1",tslib:"^1.11.1",tslint:"^6.0.0","tslint-config-prettier":"^1.18.0","tslint-config-security":"^1.16.0","tslint-microsoft-contrib":"^6.2.0",typescript:"^3.8.3",webpack:"^4.42.0","webpack-cli":"^3.3.11","whatwg-fetch":"^3.0.0"},eu={node:">= 10.0.0"},nu={transform:{"^.+\\.tsx?$":"ts-jest"},testEnvironment:"node",testPathIgnorePatterns:["/dist/","/node_modules/"],testRegex:"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",moduleFileExtensions:["ts","js","json"]},ru={name:"walletlink",version:"2.0.2",description:"WalletLink JavaScript SDK",keywords:Gs,main:Ys,types:"dist/index.d.ts",repository:Zs,author:"Coinbase, Inc.",license:"Apache-2.0",scripts:Qs,dependencies:Xs,devDependencies:tu,engines:eu,jest:nu},iu=Object(v.f)(Object.freeze({__proto__:null,name:"walletlink",version:"2.0.2",description:"WalletLink JavaScript SDK",keywords:Gs,main:Ys,types:"dist/index.d.ts",repository:Zs,author:"Coinbase, Inc.",license:"Apache-2.0",scripts:Qs,dependencies:Xs,devDependencies:tu,engines:eu,jest:nu,default:ru})),ou=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=Object({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,REACT_APP_INFURA_ID:"535ab8649e9f40cface13cbded7d647e",REACT_APP_FORTMATIC_KEY:"",REACT_APP_BITSKI_CLIENT_ID:""}).WALLETLINK_URL||"https://www.walletlink.org",r=Object({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,REACT_APP_INFURA_ID:"535ab8649e9f40cface13cbded7d647e",REACT_APP_FORTMATIC_KEY:"",REACT_APP_BITSKI_CLIENT_ID:""}).WALLETLINK_VERSION||iu.version||"unknown",i=function(){function t(e){Object(f.a)(this,t),this._appName="",this._appLogoUrl=null,this._relay=new $s.WalletLinkRelay({walletLinkUrl:e.walletLinkUrl||n,version:r,darkMode:!!e.darkMode}),this.setAppInfo(e.appName,e.appLogoUrl),this._relay.attach(document.documentElement),Q.injectCssReset()}return Object(d.a)(t,[{key:"makeWeb3Provider",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Y.WalletLinkProvider({relay:this._relay,jsonRpcUrl:t,chainId:e})}},{key:"setAppInfo",value:function(t,e){this._appName=t||"DApp",this._appLogoUrl=e||_.getFavicon(),this._relay.setAppInfo(this._appName,this._appLogoUrl)}},{key:"disconnect",value:function(){this._relay.resetAndReload()}}]),t}();e.WalletLink=i,i.VERSION=r}));Object(v.c)(ou),ou.WalletLink;var su=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=Y;e.WalletLinkProvider=n.WalletLinkProvider;var r=ou;e.WalletLink=r.WalletLink,e.default=ou.WalletLink,"undefined"!=typeof window&&(window.WalletLink=ou.WalletLink,window.WalletLinkProvider=Y.WalletLinkProvider)})),uu=Object(v.c)(su),au=su.WalletLinkProvider,cu=su.WalletLink;e.default=uu}.call(this,n(52).Buffer)},759:function(t,e,n){"use strict";var r=n(111),i=n.n(r);n.d(e,"a",(function(){return i.a}))}}]); \ No newline at end of file +/*! For license information please see 11.711038e8.chunk.js.LICENSE.txt */ +(this.webpackJsonpbridge=this.webpackJsonpbridge||[]).push([[11],{719:function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"WalletLink",(function(){return cu})),n.d(e,"WalletLinkProvider",(function(){return au})),n.d(e,"__moduleExports",(function(){return su}));var r=n(45),i=n(83),o=n(190),s=n(38),u=n(11),a=n.n(u),c=n(22),l=n(101),h=n(36),f=n(21),d=n(30),p=n(32),b=n(33),v=n(714),m=(n(0),n(330),n(73),n(52),n(737)),y=(n(374),n(726),n(110),n(761)),g=Object(v.b)((function(t){!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function r(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function i(t,e,n){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var o;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{o=m.a.Buffer}catch(t){}function s(t,e,r){for(var i=0,o=Math.min(t.length,r),s=0,u=e;u=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:c,s|=a}return n(!(240&s),"Invalid character in "+t),i}function u(t,e,r,i){for(var o=0,s=0,u=Math.min(t.length,r),a=e;a=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&s"}i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this._strip(),"le"===r&&this._initArray(this.toArray(),e,r)},i.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},i.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this._strip()},i.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=6)i=s(t,n,n+6),this.words[r]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,r++);n+6!==e&&(i=s(t,e,n+6),this.words[r]|=i<>>26-o&4194303),this._strip()},i.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var o=t.length-n,s=o%r,a=Math.min(o,o-s)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for?i.prototype[Symbol.for("nodejs.util.inspect.custom")]=c:i.prototype.inspect=c;var l=["","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"],h=[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],f=[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];function d(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,u=67108863&s,a=s/67108864|0;n.words[0]=u;for(var c=1;c>>26,h=67108863&a,f=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=f;d++){var p=c-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+h)/67108864|0,h=67108863&s}n.words[c]=0|h,a=0|l}return 0!==a?n.words[c]=0|a:n.length--,n._strip()}i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?l[6-a.length]+a+r:a+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=h[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modrn(d).toString(t);r=(p=p.idivn(d)).isZero()?b+r:l[c-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},i.prototype._toArrayLikeLE=function(t,e){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n=0&&(t[n--]=s>>8&255),n>=0&&(t[n--]=s>>16&255),6===o?(n>=0&&(t[n--]=s>>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n>=0)for(t[n--]=r;n>=0;)t[n--]=0},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;nt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(n=this,r=t):(n=t,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=t):(n=t,r=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,b=d>>>13,v=0|s[2],m=8191&v,y=v>>>13,g=0|s[3],w=8191&g,_=g>>>13,k=0|s[4],x=8191&k,S=k>>>13,M=0|s[5],E=8191&M,C=M>>>13,O=0|s[6],N=8191&O,T=O>>>13,j=0|s[7],I=8191&j,A=j>>>13,P=0|s[8],R=8191&P,D=P>>>13,L=0|s[9],B=8191&L,F=L>>>13,W=0|u[0],q=8191&W,U=W>>>13,V=0|u[1],z=8191&V,H=V>>>13,K=0|u[2],J=8191&K,$=K>>>13,G=0|u[3],Y=8191&G,Z=G>>>13,Q=0|u[4],X=8191&Q,tt=Q>>>13,et=0|u[5],nt=8191&et,rt=et>>>13,it=0|u[6],ot=8191&it,st=it>>>13,ut=0|u[7],at=8191&ut,ct=ut>>>13,lt=0|u[8],ht=8191<,ft=lt>>>13,dt=0|u[9],pt=8191&dt,bt=dt>>>13;n.negative=t.negative^e.negative,n.length=19;var vt=(c+(r=Math.imul(h,q))|0)+((8191&(i=(i=Math.imul(h,U))+Math.imul(f,q)|0))<<13)|0;c=((o=Math.imul(f,U))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(p,q),i=(i=Math.imul(p,U))+Math.imul(b,q)|0,o=Math.imul(b,U);var mt=(c+(r=r+Math.imul(h,z)|0)|0)+((8191&(i=(i=i+Math.imul(h,H)|0)+Math.imul(f,z)|0))<<13)|0;c=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(m,q),i=(i=Math.imul(m,U))+Math.imul(y,q)|0,o=Math.imul(y,U),r=r+Math.imul(p,z)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(b,z)|0,o=o+Math.imul(b,H)|0;var yt=(c+(r=r+Math.imul(h,J)|0)|0)+((8191&(i=(i=i+Math.imul(h,$)|0)+Math.imul(f,J)|0))<<13)|0;c=((o=o+Math.imul(f,$)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(w,q),i=(i=Math.imul(w,U))+Math.imul(_,q)|0,o=Math.imul(_,U),r=r+Math.imul(m,z)|0,i=(i=i+Math.imul(m,H)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,H)|0,r=r+Math.imul(p,J)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(b,J)|0,o=o+Math.imul(b,$)|0;var gt=(c+(r=r+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,Z)|0)+Math.imul(f,Y)|0))<<13)|0;c=((o=o+Math.imul(f,Z)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(x,q),i=(i=Math.imul(x,U))+Math.imul(S,q)|0,o=Math.imul(S,U),r=r+Math.imul(w,z)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,H)|0,r=r+Math.imul(m,J)|0,i=(i=i+Math.imul(m,$)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,$)|0,r=r+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,Z)|0;var wt=(c+(r=r+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(E,q),i=(i=Math.imul(E,U))+Math.imul(C,q)|0,o=Math.imul(C,U),r=r+Math.imul(x,z)|0,i=(i=i+Math.imul(x,H)|0)+Math.imul(S,z)|0,o=o+Math.imul(S,H)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,$)|0,r=r+Math.imul(m,Y)|0,i=(i=i+Math.imul(m,Z)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,Z)|0,r=r+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,tt)|0;var _t=(c+(r=r+Math.imul(h,nt)|0)|0)+((8191&(i=(i=i+Math.imul(h,rt)|0)+Math.imul(f,nt)|0))<<13)|0;c=((o=o+Math.imul(f,rt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(N,q),i=(i=Math.imul(N,U))+Math.imul(T,q)|0,o=Math.imul(T,U),r=r+Math.imul(E,z)|0,i=(i=i+Math.imul(E,H)|0)+Math.imul(C,z)|0,o=o+Math.imul(C,H)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,$)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,$)|0,r=r+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,Z)|0,r=r+Math.imul(m,X)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(b,nt)|0,o=o+Math.imul(b,rt)|0;var kt=(c+(r=r+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(f,ot)|0))<<13)|0;c=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(I,q),i=(i=Math.imul(I,U))+Math.imul(A,q)|0,o=Math.imul(A,U),r=r+Math.imul(N,z)|0,i=(i=i+Math.imul(N,H)|0)+Math.imul(T,z)|0,o=o+Math.imul(T,H)|0,r=r+Math.imul(E,J)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(C,J)|0,o=o+Math.imul(C,$)|0,r=r+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,Z)|0,r=r+Math.imul(w,X)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,tt)|0,r=r+Math.imul(m,nt)|0,i=(i=i+Math.imul(m,rt)|0)+Math.imul(y,nt)|0,o=o+Math.imul(y,rt)|0,r=r+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0;var xt=(c+(r=r+Math.imul(h,at)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(f,at)|0))<<13)|0;c=((o=o+Math.imul(f,ct)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(R,q),i=(i=Math.imul(R,U))+Math.imul(D,q)|0,o=Math.imul(D,U),r=r+Math.imul(I,z)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(A,z)|0,o=o+Math.imul(A,H)|0,r=r+Math.imul(N,J)|0,i=(i=i+Math.imul(N,$)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,$)|0,r=r+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,Z)|0,r=r+Math.imul(x,X)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,tt)|0,r=r+Math.imul(w,nt)|0,i=(i=i+Math.imul(w,rt)|0)+Math.imul(_,nt)|0,o=o+Math.imul(_,rt)|0,r=r+Math.imul(m,ot)|0,i=(i=i+Math.imul(m,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,r=r+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(b,at)|0,o=o+Math.imul(b,ct)|0;var St=(c+(r=r+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;c=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(B,q),i=(i=Math.imul(B,U))+Math.imul(F,q)|0,o=Math.imul(F,U),r=r+Math.imul(R,z)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(D,z)|0,o=o+Math.imul(D,H)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(A,J)|0,o=o+Math.imul(A,$)|0,r=r+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,Z)|0,r=r+Math.imul(E,X)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,tt)|0,r=r+Math.imul(x,nt)|0,i=(i=i+Math.imul(x,rt)|0)+Math.imul(S,nt)|0,o=o+Math.imul(S,rt)|0,r=r+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,r=r+Math.imul(m,at)|0,i=(i=i+Math.imul(m,ct)|0)+Math.imul(y,at)|0,o=o+Math.imul(y,ct)|0,r=r+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,ft)|0;var Mt=(c+(r=r+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,bt)|0)+Math.imul(f,pt)|0))<<13)|0;c=((o=o+Math.imul(f,bt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(B,z),i=(i=Math.imul(B,H))+Math.imul(F,z)|0,o=Math.imul(F,H),r=r+Math.imul(R,J)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,$)|0,r=r+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,Z)|0,r=r+Math.imul(N,X)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,tt)|0,r=r+Math.imul(E,nt)|0,i=(i=i+Math.imul(E,rt)|0)+Math.imul(C,nt)|0,o=o+Math.imul(C,rt)|0,r=r+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,r=r+Math.imul(w,at)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,at)|0,o=o+Math.imul(_,ct)|0,r=r+Math.imul(m,ht)|0,i=(i=i+Math.imul(m,ft)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ft)|0;var Et=(c+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;c=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(B,J),i=(i=Math.imul(B,$))+Math.imul(F,J)|0,o=Math.imul(F,$),r=r+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,Z)|0,r=r+Math.imul(I,X)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(N,nt)|0,i=(i=i+Math.imul(N,rt)|0)+Math.imul(T,nt)|0,o=o+Math.imul(T,rt)|0,r=r+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,r=r+Math.imul(x,at)|0,i=(i=i+Math.imul(x,ct)|0)+Math.imul(S,at)|0,o=o+Math.imul(S,ct)|0,r=r+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,ft)|0;var Ct=(c+(r=r+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,bt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,bt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(B,Y),i=(i=Math.imul(B,Z))+Math.imul(F,Y)|0,o=Math.imul(F,Z),r=r+Math.imul(R,X)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(D,X)|0,o=o+Math.imul(D,tt)|0,r=r+Math.imul(I,nt)|0,i=(i=i+Math.imul(I,rt)|0)+Math.imul(A,nt)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(N,ot)|0,i=(i=i+Math.imul(N,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,r=r+Math.imul(E,at)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(C,at)|0,o=o+Math.imul(C,ct)|0,r=r+Math.imul(x,ht)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(S,ht)|0,o=o+Math.imul(S,ft)|0;var Ot=(c+(r=r+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,bt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(B,X),i=(i=Math.imul(B,tt))+Math.imul(F,X)|0,o=Math.imul(F,tt),r=r+Math.imul(R,nt)|0,i=(i=i+Math.imul(R,rt)|0)+Math.imul(D,nt)|0,o=o+Math.imul(D,rt)|0,r=r+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,r=r+Math.imul(N,at)|0,i=(i=i+Math.imul(N,ct)|0)+Math.imul(T,at)|0,o=o+Math.imul(T,ct)|0,r=r+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(C,ht)|0,o=o+Math.imul(C,ft)|0;var Nt=(c+(r=r+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,bt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((o=o+Math.imul(S,bt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(B,nt),i=(i=Math.imul(B,rt))+Math.imul(F,nt)|0,o=Math.imul(F,rt),r=r+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,st)|0,r=r+Math.imul(I,at)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(A,at)|0,o=o+Math.imul(A,ct)|0,r=r+Math.imul(N,ht)|0,i=(i=i+Math.imul(N,ft)|0)+Math.imul(T,ht)|0,o=o+Math.imul(T,ft)|0;var Tt=(c+(r=r+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,bt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(B,ot),i=(i=Math.imul(B,st))+Math.imul(F,ot)|0,o=Math.imul(F,st),r=r+Math.imul(R,at)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(D,at)|0,o=o+Math.imul(D,ct)|0,r=r+Math.imul(I,ht)|0,i=(i=i+Math.imul(I,ft)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ft)|0;var jt=(c+(r=r+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,bt)|0)+Math.imul(T,pt)|0))<<13)|0;c=((o=o+Math.imul(T,bt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,r=Math.imul(B,at),i=(i=Math.imul(B,ct))+Math.imul(F,at)|0,o=Math.imul(F,ct),r=r+Math.imul(R,ht)|0,i=(i=i+Math.imul(R,ft)|0)+Math.imul(D,ht)|0,o=o+Math.imul(D,ft)|0;var It=(c+(r=r+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,bt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((o=o+Math.imul(A,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(B,ht),i=(i=Math.imul(B,ft))+Math.imul(F,ht)|0,o=Math.imul(F,ft);var At=(c+(r=r+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,bt)|0)+Math.imul(D,pt)|0))<<13)|0;c=((o=o+Math.imul(D,bt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863;var Pt=(c+(r=Math.imul(B,pt))|0)+((8191&(i=(i=Math.imul(B,bt))+Math.imul(F,pt)|0))<<13)|0;return c=((o=Math.imul(F,bt))+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,a[0]=vt,a[1]=mt,a[2]=yt,a[3]=gt,a[4]=wt,a[5]=_t,a[6]=kt,a[7]=xt,a[8]=St,a[9]=Mt,a[10]=Et,a[11]=Ct,a[12]=Ot,a[13]=Nt,a[14]=Tt,a[15]=jt,a[16]=It,a[17]=At,a[18]=Pt,0!==c&&(a[19]=c,n.length++),n};function b(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}n.words[o]=u,r=s,s=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function v(t,e,n){return b(t,e,n)}Math.imul||(p=d),i.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?b(this,t,e):v(this,t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),v(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n>>i&1}return e}(t);if(0===e.length)return new i(1);for(var n=this,r=0;r=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<s)for(this.length-=s,c=0;c=0&&(0!==l||c>=i);c--){var h=0|this.words[c];this.words[c]=l<<26-o|h>>>o,l=h&u}return a&&0!==l&&(a.words[a.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(a/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===u)return this._strip();for(n(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),o=t,s=0|o.words[o.length-1];0!==(n=26-this._countBits(s))&&(o=o.ushln(n),r.iushln(n),s=0|o.words[o.length-1]);var u,a=r.length-o.length;if("mod"!==e){(u=new i(null)).length=a+1,u.words=new Array(u.length);for(var c=0;c=0;h--){var f=67108864*(0|r.words[o.length+h])+(0|r.words[o.length+h-1]);for(f=Math.min(f/s|0,67108863),r._ishlnsubmul(o,f,h);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(o,1,h),r.isZero()||(r.negative^=1);u&&(u.words[h]=f)}return u&&u._strip(),r._strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:u||null,mod:r}},i.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(o=u.div.neg()),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(o=u.div.neg()),{div:o,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:u.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modrn(t.words[0]))}:this._wordDiv(t,e);var o,s,u},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},i.prototype.modn=function(t){return this.modrn(t)},i.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),s=new i(0),u=new i(0),a=new i(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(l),s.isub(h)),o.iushrn(1),s.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(u.isOdd()||a.isOdd())&&(u.iadd(l),a.isub(h)),u.iushrn(1),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(u),s.isub(a)):(r.isub(e),u.isub(o),a.isub(s))}return{a:u,b:a,gcd:r.iushln(c)}},i.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,s=new i(1),u=new i(0),a=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(a),s.iushrn(1);for(var h=0,f=1;0==(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)u.isOdd()&&u.iadd(a),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(u)):(r.isub(e),u.isub(s))}return(o=0===e.cmpn(1)?s:u).cmpn(0)<0&&o.iadd(t),o},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var o=e;e=n,n=o}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,u&=67108863,this.words[s]=u}return 0!==o&&(this.words[s]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){ri&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new S(t)},i.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}g.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?n.isub(this.p):n._strip(),n},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},r(w,g),w.prototype.split=function(t,e){for(var n=Math.min(t.length,9),r=0;r>>22,i=o}i>>>=22,t.words[r-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new _;else if("p192"===t)e=new k;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new x}return y[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(a(t,t.umod(this.m)._forceRed(this)),t)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},S.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new i(1)).iushrn(2);return this.pow(t,r)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);n(!o.isZero());var u=new i(1).toRed(this),a=u.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(a);)l.redIAdd(a);for(var h=this.pow(l,o),f=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(u);){for(var b=d,v=0;0!==b.cmp(u);v++)b=b.redSqr();n(v=0;r--){for(var c=e.words[r],l=a-1;l>=0;l--){var h=c>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==h||0!==s?(s<<=1,s|=h,(4===++u||0===r&&0===l)&&(o=this.mul(o,n[s]),u=0,s=0)):u=0}a=26}return o},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new M(t)},r(M,S),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,v.d)})),w=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.OpaqueType=function(){return function(t){return t}},e.HexString=function(t){return t},e.AddressString=function(t){return t},e.BigIntString=function(t){return t},e.IntNumber=function(t){return Math.floor(t)},e.RegExpString=function(t){return t}}));Object(v.c)(w),w.OpaqueType,w.HexString,w.AddressString,w.BigIntString,w.IntNumber,w.RegExpString;var _=Object(v.b)((function(e,n){var r=v.d&&v.d.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var i=r(g),o=/^[0-9]*$/,s=/^[a-f0-9]*$/;function u(t){return t.startsWith("0x")||t.startsWith("0X")}function a(t){return u(t)?t.slice(2):t}function c(t){return u(t)?"0x"+t.slice(2):"0x"+t}function l(t){if("string"!=typeof t)return!1;var e=a(t).toLowerCase();return s.test(e)}function h(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"==typeof t){var n=a(t).toLowerCase();if(s.test(n))return w.HexString(e?"0x"+n:n)}throw new Error('"'.concat(t,'" is not a hexadecimal string'))}function f(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=h(t,!1);return n.length%2==1&&(n=w.HexString("0"+n)),e?w.HexString("0x"+n):n}function d(t){if("number"==typeof t&&Number.isInteger(t))return w.IntNumber(t);if("string"==typeof t){if(o.test(t))return w.IntNumber(Number(t));if(l(t))return w.IntNumber(new i.default(f(t,!1),16).toNumber())}throw new Error("Not an integer: ".concat(t))}function p(t){if(null==t||"function"!=typeof t.constructor)return!1;var e=t.constructor;return"function"==typeof e.config&&"number"==typeof e.EUCLID}n.hexStringFromBuffer=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.toString("hex");return w.HexString(e?"0x"+n:n)},n.bigIntStringFromBN=function(t){return w.BigIntString(t.toString(10))},n.intNumberFromHexString=function(t){return w.IntNumber(new i.default(f(t,!1),16).toNumber())},n.hexStringFromIntNumber=function(t){return w.HexString("0x"+new i.default(t).toString(16))},n.has0xPrefix=u,n.strip0x=a,n.prepend0x=c,n.isHexString=l,n.ensureHexString=h,n.ensureEvenLengthHexString=f,n.ensureAddressString=function(t){if("string"==typeof t){var e=a(t).toLowerCase();if(l(e)&&40===e.length)return w.AddressString(c(e))}throw new Error("Invalid Ethereum address: ".concat(t))},n.ensureBuffer=function(e){if(t.isBuffer(e))return e;if("string"==typeof e){if(l(e)){var n=f(e,!1);return t.from(n,"hex")}return t.from(e,"utf8")}throw new Error("Not binary data: ".concat(e))},n.ensureIntNumber=d,n.ensureRegExpString=function(t){if(t instanceof RegExp)return w.RegExpString(t.toString());throw new Error("Not a RegExp: ".concat(t))},n.ensureBN=function(t){if(null!=t&&(i.default.isBN(t)||p(t)))return new i.default(t.toString(10),10);if("number"==typeof t)return new i.default(d(t));if("string"==typeof t){if(o.test(t))return new i.default(t,10);if(l(t))return new i.default(f(t,!1),16)}throw new Error("Not an integer: ".concat(t))},n.isBigNumber=p,n.range=function(t,e){return Array.from({length:e-t},(function(e,n){return t+n}))},n.getFavicon=function(){var t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),e=document.location,n=e.protocol,r=e.host,i=t?t.getAttribute("href"):null;return!i||i.startsWith("javascript:")?null:i.startsWith("http://")||i.startsWith("https://")||i.startsWith("data:")?i:i.startsWith("//")?n+i:"".concat(n,"//").concat(r).concat(i)}}));Object(v.c)(_),_.hexStringFromBuffer,_.bigIntStringFromBN,_.intNumberFromHexString,_.hexStringFromIntNumber,_.has0xPrefix,_.strip0x,_.prepend0x,_.isHexString,_.ensureHexString,_.ensureEvenLengthHexString,_.ensureAddressString,_.ensureBuffer,_.ensureIntNumber,_.ensureRegExpString,_.ensureBN,_.isBigNumber,_.range,_.getFavicon;var k=m.b.Transform,x=m.b.Transform,S=[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],M=function(t){for(var e=0;e<24;++e){var n=t[0]^t[10]^t[20]^t[30]^t[40],r=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],o=t[3]^t[13]^t[23]^t[33]^t[43],s=t[4]^t[14]^t[24]^t[34]^t[44],u=t[5]^t[15]^t[25]^t[35]^t[45],a=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],l=t[8]^t[18]^t[28]^t[38]^t[48],h=t[9]^t[19]^t[29]^t[39]^t[49],f=l^(i<<1|o>>>31),d=h^(o<<1|i>>>31),p=t[0]^f,b=t[1]^d,v=t[10]^f,m=t[11]^d,y=t[20]^f,g=t[21]^d,w=t[30]^f,_=t[31]^d,k=t[40]^f,x=t[41]^d;f=n^(s<<1|u>>>31),d=r^(u<<1|s>>>31);var M=t[2]^f,E=t[3]^d,C=t[12]^f,O=t[13]^d,N=t[22]^f,T=t[23]^d,j=t[32]^f,I=t[33]^d,A=t[42]^f,P=t[43]^d;f=i^(a<<1|c>>>31),d=o^(c<<1|a>>>31);var R=t[4]^f,D=t[5]^d,L=t[14]^f,B=t[15]^d,F=t[24]^f,W=t[25]^d,q=t[34]^f,U=t[35]^d,V=t[44]^f,z=t[45]^d;f=s^(l<<1|h>>>31),d=u^(h<<1|l>>>31);var H=t[6]^f,K=t[7]^d,J=t[16]^f,$=t[17]^d,G=t[26]^f,Y=t[27]^d,Z=t[36]^f,Q=t[37]^d,X=t[46]^f,tt=t[47]^d;f=a^(n<<1|r>>>31),d=c^(r<<1|n>>>31);var et=t[8]^f,nt=t[9]^d,rt=t[18]^f,it=t[19]^d,ot=t[28]^f,st=t[29]^d,ut=t[38]^f,at=t[39]^d,ct=t[48]^f,lt=t[49]^d,ht=p,ft=b,dt=m<<4|v>>>28,pt=v<<4|m>>>28,bt=y<<3|g>>>29,vt=g<<3|y>>>29,mt=_<<9|w>>>23,yt=w<<9|_>>>23,gt=k<<18|x>>>14,wt=x<<18|k>>>14,_t=M<<1|E>>>31,kt=E<<1|M>>>31,xt=O<<12|C>>>20,St=C<<12|O>>>20,Mt=N<<10|T>>>22,Et=T<<10|N>>>22,Ct=I<<13|j>>>19,Ot=j<<13|I>>>19,Nt=A<<2|P>>>30,Tt=P<<2|A>>>30,jt=D<<30|R>>>2,It=R<<30|D>>>2,At=L<<6|B>>>26,Pt=B<<6|L>>>26,Rt=W<<11|F>>>21,Dt=F<<11|W>>>21,Lt=q<<15|U>>>17,Bt=U<<15|q>>>17,Ft=z<<29|V>>>3,Wt=V<<29|z>>>3,qt=H<<28|K>>>4,Ut=K<<28|H>>>4,Vt=$<<23|J>>>9,zt=J<<23|$>>>9,Ht=G<<25|Y>>>7,Kt=Y<<25|G>>>7,Jt=Z<<21|Q>>>11,$t=Q<<21|Z>>>11,Gt=tt<<24|X>>>8,Yt=X<<24|tt>>>8,Zt=et<<27|nt>>>5,Qt=nt<<27|et>>>5,Xt=rt<<20|it>>>12,te=it<<20|rt>>>12,ee=st<<7|ot>>>25,ne=ot<<7|st>>>25,re=ut<<8|at>>>24,ie=at<<8|ut>>>24,oe=ct<<14|lt>>>18,se=lt<<14|ct>>>18;t[0]=ht^~xt&Rt,t[1]=ft^~St&Dt,t[10]=qt^~Xt&bt,t[11]=Ut^~te&vt,t[20]=_t^~At&Ht,t[21]=kt^~Pt&Kt,t[30]=Zt^~dt&Mt,t[31]=Qt^~pt&Et,t[40]=jt^~Vt&ee,t[41]=It^~zt&ne,t[2]=xt^~Rt&Jt,t[3]=St^~Dt&$t,t[12]=Xt^~bt&Ct,t[13]=te^~vt&Ot,t[22]=At^~Ht&re,t[23]=Pt^~Kt&ie,t[32]=dt^~Mt&Lt,t[33]=pt^~Et&Bt,t[42]=Vt^~ee&mt,t[43]=zt^~ne&yt,t[4]=Rt^~Jt&oe,t[5]=Dt^~$t&se,t[14]=bt^~Ct&Ft,t[15]=vt^~Ot&Wt,t[24]=Ht^~re>,t[25]=Kt^~ie&wt,t[34]=Mt^~Lt&Gt,t[35]=Et^~Bt&Yt,t[44]=ee^~mt&Nt,t[45]=ne^~yt&Tt,t[6]=Jt^~oe&ht,t[7]=$t^~se&ft,t[16]=Ct^~Ft&qt,t[17]=Ot^~Wt&Ut,t[26]=re^~gt&_t,t[27]=ie^~wt&kt,t[36]=Lt^~Gt&Zt,t[37]=Bt^~Yt&Qt,t[46]=mt^~Nt&jt,t[47]=yt^~Tt&It,t[8]=oe^~ht&xt,t[9]=se^~ft&St,t[18]=Ft^~qt&Xt,t[19]=Wt^~Ut&te,t[28]=gt^~_t&At,t[29]=wt^~kt&Pt,t[38]=Gt^~Zt&dt,t[39]=Yt^~Qt&pt,t[48]=Nt^~jt&Vt,t[49]=Tt^~It&zt,t[0]^=S[2*e],t[1]^=S[2*e+1]}};function E(){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}E.prototype.initialize=function(t,e){for(var n=0;n<50;++n)this.state[n]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1},E.prototype.absorb=function(t){for(var e=0;e>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(M(this.state),this.count=0);return n},E.prototype.copy=function(t){for(var e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var C=function(e){var n=function(e){return function(n){Object(p.a)(i,n);var r=Object(b.a)(i);function i(t,n,o,s,u){var a;return Object(f.a)(this,i),(a=r.call(this,u))._rate=t,a._capacity=n,a._delimitedSuffix=o,a._hashBitLength=s,a._options=u,a._state=new e,a._state.initialize(t,n),a._finalized=!1,a}return Object(d.a)(i,[{key:"_transform",value:function(t,e,n){var r=null;try{this.update(t,e)}catch(t){r=t}n(r)}},{key:"_flush",value:function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)}},{key:"update",value:function(e,n){if(!t.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return t.isBuffer(e)||(e=t.from(e,n)),this._state.absorb(e),this}},{key:"digest",value:function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var e=this._state.squeeze(this._hashBitLength/8);return void 0!==t&&(e=e.toString(t)),this._resetState(),e}},{key:"_resetState",value:function(){return this._state.initialize(this._rate,this._capacity),this}},{key:"_clone",value:function(){var t=new i(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}}]),i}(k)}(e),r=function(e){return function(n){Object(p.a)(i,n);var r=Object(b.a)(i);function i(t,n,o,s){var u;return Object(f.a)(this,i),(u=r.call(this,s))._rate=t,u._capacity=n,u._delimitedSuffix=o,u._options=s,u._state=new e,u._state.initialize(t,n),u._finalized=!1,u}return Object(d.a)(i,[{key:"_transform",value:function(t,e,n){var r=null;try{this.update(t,e)}catch(t){r=t}n(r)}},{key:"_flush",value:function(){}},{key:"_read",value:function(t){this.push(this.squeeze(t))}},{key:"update",value:function(e,n){if(!t.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return t.isBuffer(e)||(e=t.from(e,n)),this._state.absorb(e),this}},{key:"squeeze",value:function(t,e){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var n=this._state.squeeze(t);return void 0!==e&&(n=n.toString(e)),n}},{key:"_resetState",value:function(){return this._state.initialize(this._rate,this._capacity),this}},{key:"_clone",value:function(){var t=new i(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}}]),i}(x)}(e);return function(t,e){switch("string"==typeof t?t.toLowerCase():t){case"keccak224":return new n(1152,448,null,224,e);case"keccak256":return new n(1088,512,null,256,e);case"keccak384":return new n(832,768,null,384,e);case"keccak512":return new n(576,1024,null,512,e);case"sha3-224":return new n(1152,448,6,224,e);case"sha3-256":return new n(1088,512,6,256,e);case"sha3-384":return new n(832,768,6,384,e);case"sha3-512":return new n(576,1024,6,512,e);case"shake128":return new r(1344,256,31,e);case"shake256":return new r(1088,512,31,e);default:throw new Error("Invald algorithm: "+t)}}}(E);function O(e){return t.allocUnsafe(e).fill(0)}function N(t,e,n){var r=O(e);return t=T(t),n?t.lengthr)throw new Error("Elements exceed array size: "+r);for(s in o=[],e=e.slice(0,e.lastIndexOf("[")),"string"==typeof n&&(n=JSON.parse(n)),n)o.push(F(e,n[s]));if("dynamic"===r){var u=F("uint256",n.length);o.unshift(u)}return t.concat(o)}if("bytes"===e)return n=new t(n),o=t.concat([F("uint256",n.length),n]),n.length%32!=0&&(o=t.concat([o,A.zeros(32-n.length%32)])),o;if(e.startsWith("bytes")){if((r=R(e))<1||r>32)throw new Error("Invalid bytes width: "+r);return A.setLengthRight(n,32)}if(e.startsWith("uint")){if((r=R(e))%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if((i=B(n)).bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+i.bitLength());if(i<0)throw new Error("Supplied uint is negative");return i.toArrayLike(t,"be",32)}if(e.startsWith("int")){if((r=R(e))%8||r<8||r>256)throw new Error("Invalid int width: "+r);if((i=B(n)).bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+i.bitLength());return i.toTwos(256).toArrayLike(t,"be",32)}if(e.startsWith("ufixed")){if(r=D(e),(i=B(n))<0)throw new Error("Supplied ufixed is negative");return F("uint256",i.mul(new g(2).pow(new g(r[1]))))}if(e.startsWith("fixed"))return r=D(e),F("int256",B(n).mul(new g(2).pow(new g(r[1]))));throw new Error("Unsupported or invalid type: "+e)}function W(t){return"string"===t||"bytes"===t||"dynamic"===L(t)}function q(e,n){if(e.length!==n.length)throw new Error("Number of types are not matching the values");for(var r,i,o=[],s=0;s32)throw new Error("Invalid bytes width: "+r);o.push(A.setLengthRight(a,r))}else if(u.startsWith("uint")){if((r=R(u))%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if((i=B(a)).bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+i.bitLength());o.push(i.toArrayLike(t,"be",r/8))}else{if(!u.startsWith("int"))throw new Error("Unsupported or invalid type: "+u);if((r=R(u))%8||r<8||r>256)throw new Error("Invalid int width: "+r);if((i=B(a)).bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+i.bitLength());o.push(i.toTwos(r).toArrayLike(t,"be",r/8))}}return t.concat(o)}var U=function(e,n){var r=[],i=[],o=32*e.length;for(var s in e){var u=P(e[s]),a=F(u,n[s]);W(u)?(r.push(F("uint256",o)),i.push(a),o+=a.length):r.push(a)}return t.concat(r.concat(i))},V=function(t,e){return A.keccak(q(t,e))},z={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},H={encodeData:function(e,n,r){var i=this,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=["bytes32"],u=[this.hashType(e,r)];if(o){var a,c=function e(n,s,u){if(void 0!==r[s])return["bytes32",null==u?"0x0000000000000000000000000000000000000000000000000000000000000000":A.keccak(i.encodeData(s,u,r,o))];if(void 0===u)throw new Error("missing value for field ".concat(n," of type ").concat(s));if("bytes"===s)return["bytes32",A.keccak(u)];if("string"===s)return"string"==typeof u&&(u=t.from(u,"utf8")),["bytes32",A.keccak(u)];if(s.lastIndexOf("]")===s.length-1){var a=s.slice(0,s.lastIndexOf("[")),c=u.map((function(t){return e(n,a,t)}));return["bytes32",A.keccak(U(c.map((function(t){return Object(h.a)(t,1)[0]})),c.map((function(t){return Object(h.a)(t,2)[1]}))))]}return[s,u]},f=Object(l.a)(r[e]);try{for(f.s();!(a=f.n()).done;){var d=a.value,p=c(d.name,d.type,n[d.name]),b=Object(h.a)(p,2),v=b[0],m=b[1];s.push(v),u.push(m)}}catch(k){f.e(k)}finally{f.f()}}else{var y,g=Object(l.a)(r[e]);try{for(g.s();!(y=g.n()).done;){var w=y.value,_=n[w.name];if(void 0!==_)if("bytes"===w.type)s.push("bytes32"),_=A.keccak(_),u.push(_);else if("string"===w.type)s.push("bytes32"),"string"==typeof _&&(_=t.from(_,"utf8")),_=A.keccak(_),u.push(_);else if(void 0!==r[w.type])s.push("bytes32"),_=A.keccak(this.encodeData(w.type,_,r,o)),u.push(_);else{if(w.type.lastIndexOf("]")===w.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");s.push(w.type),u.push(_)}}}catch(k){g.e(k)}finally{g.f()}}return U(s,u)},encodeType:function(t,e){var n="",r=this.findTypeDependencies(t,e).filter((function(e){return e!==t}));r=[t].concat(r.sort());var i,o=Object(l.a)(r);try{for(o.s();!(i=o.n()).done;){var s=i.value;if(!e[s])throw new Error("No type definition specified: "+s);n+=s+"("+e[s].map((function(t){var e=t.name;return t.type+" "+e})).join(",")+")"}}catch(u){o.e(u)}finally{o.f()}return n},findTypeDependencies:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(t=t.match(/^\w*/)[0],n.includes(t)||void 0===e[t])return n;n.push(t);var r,i=Object(l.a)(e[t]);try{for(i.s();!(r=i.n()).done;){var o,s=r.value,u=Object(l.a)(this.findTypeDependencies(s.type,e,n));try{for(u.s();!(o=u.n()).done;){var a=o.value;!n.includes(a)&&n.push(a)}}catch(c){u.e(c)}finally{u.f()}}}catch(c){i.e(c)}finally{i.f()}return n},hashStruct:function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return A.keccak(this.encodeData(t,e,n,r))},hashType:function(t,e){return A.keccak(this.encodeType(t,e))},sanitizeData:function(t){var e={};for(var n in z.properties)t[n]&&(e[n]=t[n]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.sanitizeData(e),i=[t.from("1901","hex")];return i.push(this.hashStruct("EIP712Domain",r.domain,r.types,n)),"EIP712Domain"!==r.primaryType&&i.push(this.hashStruct(r.primaryType,r.message,r.types,n)),A.keccak(t.concat(i))}},K={TYPED_MESSAGE_SCHEMA:z,TypedDataUtils:H,hashForSignTypedDataLegacy:function(t){return function(t){var e=new Error("Expect argument to be non-empty array");if("object"!=typeof t||!t.length)throw e;var n=t.map((function(t){return"bytes"===t.type?A.toBuffer(t.value):t.value})),r=t.map((function(t){return t.type})),i=t.map((function(t){if(!t.name)throw e;return t.type+" "+t.name}));return V(["bytes32","bytes32"],[V(new Array(t.length).fill("string"),i),V(r,n)])}(t.data)},hashForSignTypedData_v3:function(t){return H.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return H.hash(t.data)}},J=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n={jsonrpc:"2.0",id:0};function r(t){return{fromBlock:o(t.fromBlock),toBlock:o(t.toBlock),addresses:void 0===t.address?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}function i(t){var e={fromBlock:u(t.fromBlock),toBlock:u(t.toBlock),topics:t.topics};return null!==t.addresses&&(e.address=t.addresses),e}function o(t){if(void 0===t||"latest"===t||"pending"===t)return"latest";if("earliest"===t)return w.IntNumber(0);if(_.isHexString(t))return _.intNumberFromHexString(t);throw new Error("Invalid block option: ".concat(t))}function u(t){return"latest"===t?t:_.hexStringFromIntNumber(t)}function l(){return Object.assign(Object.assign({},n),{error:{code:-32e3,message:"filter not found"}})}function h(){return Object.assign(Object.assign({},n),{result:[]})}e.FilterPolyfill=function(){function t(e){Object(f.a)(this,t),this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=w.IntNumber(1),this.provider=e}return Object(d.a)(t,[{key:"newFilter",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var n,i,o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r(e),i=this.makeFilterId(),t.next=4,this.setInitialCursorPosition(i,n.fromBlock);case 4:return o=t.sent,t.abrupt("return",(console.log("Installing new log filter(".concat(i,"):"),n,"initial cursor position:",o),this.logFilters.set(i,n),this.setFilterTimeout(i),_.hexStringFromIntNumber(i)));case 6:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"newBlockFilter",value:function(){var t=Object(c.a)(a.a.mark((function t(){var e,n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.makeFilterId(),t.next=3,this.setInitialCursorPosition(e,"latest");case 3:return n=t.sent,t.abrupt("return",(console.log("Installing new block filter (".concat(e,") with initial cursor position:"),n),this.blockFilters.add(e),this.setFilterTimeout(e),_.hexStringFromIntNumber(e)));case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"newPendingTransactionFilter",value:function(){var t=Object(c.a)(a.a.mark((function t(){var e,n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.makeFilterId(),t.next=3,this.setInitialCursorPosition(e,"latest");case 3:return n=t.sent,t.abrupt("return",(console.log("Installing new block filter (".concat(e,") with initial cursor position:"),n),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),_.hexStringFromIntNumber(e)));case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"uninstallFilter",value:function(t){var e=_.intNumberFromHexString(t);return console.log("Uninstalling filter (".concat(e,")")),this.deleteFilter(e),!0}},{key:"getFilterChanges",value:function(t){var e=_.intNumberFromHexString(t);return this.timeouts.has(e)&&this.setFilterTimeout(e),this.logFilters.has(e)?this.getLogFilterChanges(e):this.blockFilters.has(e)?this.getBlockFilterChanges(e):this.pendingTransactionFilters.has(e)?this.getPendingTransactionFilterChanges(e):Promise.resolve(l())}},{key:"getFilterLogs",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var r,o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=_.intNumberFromHexString(e),o=this.logFilters.get(r),t.abrupt("return",o?this.sendAsyncPromise(Object.assign(Object.assign({},n),{method:"eth_getLogs",params:[i(o)]})):l());case 2:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"makeFilterId",value:function(){return w.IntNumber(++this.nextFilterId)}},{key:"sendAsyncPromise",value:function(t){var e=this;return new Promise((function(n,r){e.provider.sendAsync(t,(function(t,e){return t?r(t):Array.isArray(e)||null==e?r(new Error("unexpected response received: ".concat(JSON.stringify(e)))):void n(e)}))}))}},{key:"deleteFilter",value:function(t){console.log("Deleting filter (".concat(t,")")),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}},{key:"getLogFilterChanges",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var r,o,u,c,f,d,p,b;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.logFilters.get(e),(o=this.cursors.get(e))&&r){t.next=3;break}return t.abrupt("return",l());case 3:return t.next=5,this.getCurrentBlockHeight();case 5:if(u=t.sent,c="latest"===r.toBlock?u:r.toBlock,!(o>u)){t.next=9;break}return t.abrupt("return",h());case 9:if(!(o>r.toBlock)){t.next=11;break}return t.abrupt("return",h());case 11:return console.log("Fetching logs from ".concat(o," to ").concat(c," for filter ").concat(e)),t.next=14,this.sendAsyncPromise(Object.assign(Object.assign({},n),{method:"eth_getLogs",params:[i(Object.assign(Object.assign({},r),{fromBlock:o,toBlock:c}))]}));case 14:return f=t.sent,Array.isArray(f.result)&&(d=f.result.map((function(t){return _.intNumberFromHexString(t.blockNumber||"0x0")})),(p=Math.max.apply(Math,Object(s.a)(d)))&&p>o&&(b=w.IntNumber(p+1),console.log("Moving cursor position for filter (".concat(e,") from ").concat(o," to ").concat(b)),this.cursors.set(e,b))),t.abrupt("return",f);case 17:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"getBlockFilterChanges",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var r,i,o,s,u=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.cursors.get(e)){t.next=3;break}return t.abrupt("return",l());case 3:return t.next=5,this.getCurrentBlockHeight();case 5:if(i=t.sent,!(r>i)){t.next=8;break}return t.abrupt("return",h());case 8:return console.log("Fetching blocks from ".concat(r," to ").concat(i," for filter (").concat(e,")")),t.next=11,Promise.all(_.range(r,i+1).map((function(t){return u.getBlockHashByNumber(w.IntNumber(t))})));case 11:return o=t.sent.filter((function(t){return!!t})),s=w.IntNumber(r+o.length),t.abrupt("return",(console.log("Moving cursor position for filter (".concat(e,") from ").concat(r," to ").concat(s)),this.cursors.set(e,s),Object.assign(Object.assign({},n),{result:o})));case 14:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"getPendingTransactionFilterChanges",value:function(){var t=Object(c.a)(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Promise.resolve(h()));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},{key:"setInitialCursorPosition",value:function(){var t=Object(c.a)(a.a.mark((function t(e,n){var r,i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getCurrentBlockHeight();case 2:return r=t.sent,i="number"==typeof n&&n>r?n:r,t.abrupt("return",(this.cursors.set(e,i),i));case 5:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}()},{key:"setFilterTimeout",value:function(t){var e=this,n=this.timeouts.get(t);n&&window.clearTimeout(n);var r=window.setTimeout((function(){console.log("Filter (".concat(t,") timed out")),e.deleteFilter(t)}),3e5);this.timeouts.set(t,r)}},{key:"getCurrentBlockHeight",value:function(){var t=Object(c.a)(a.a.mark((function t(){var e,r;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sendAsyncPromise(Object.assign(Object.assign({},n),{method:"eth_blockNumber",params:[]}));case 2:return e=t.sent,r=e.result,t.abrupt("return",_.intNumberFromHexString(_.ensureHexString(r)));case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"getBlockHashByNumber",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var r;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sendAsyncPromise(Object.assign(Object.assign({},n),{method:"eth_getBlockByNumber",params:[_.hexStringFromIntNumber(e),!1]}));case 2:return r=t.sent,t.abrupt("return",r.result&&"string"==typeof r.result.hash?_.ensureHexString(r.result.hash):null);case 4:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()}]),t}(),e.filterFromParam=r}));Object(v.c)(J),J.FilterPolyfill,J.filterFromParam;var $=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.eth_accounts="eth_accounts",t.eth_coinbase="eth_coinbase",t.net_version="net_version",t.eth_uninstallFilter="eth_uninstallFilter",t.eth_requestAccounts="eth_requestAccounts",t.eth_sign="eth_sign",t.eth_ecRecover="eth_ecRecover",t.personal_sign="personal_sign",t.personal_ecRecover="personal_ecRecover",t.eth_signTransaction="eth_signTransaction",t.eth_sendRawTransaction="eth_sendRawTransaction",t.eth_sendTransaction="eth_sendTransaction",t.eth_signTypedData_v1="eth_signTypedData_v1",t.eth_signTypedData_v2="eth_signTypedData_v2",t.eth_signTypedData_v3="eth_signTypedData_v3",t.eth_signTypedData_v4="eth_signTypedData_v4",t.eth_signTypedData="eth_signTypedData",t.walletlink_arbitrary="walletlink_arbitrary",t.eth_newFilter="eth_newFilter",t.eth_newBlockFilter="eth_newBlockFilter",t.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",t.eth_getFilterChanges="eth_getFilterChanges",t.eth_getFilterLogs="eth_getFilterLogs"}(e.JSONRPCMethod||(e.JSONRPCMethod={}))}));Object(v.c)($),$.JSONRPCMethod;var G=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.USER_DENIED_REQUEST_ACCOUNTS=4001]="USER_DENIED_REQUEST_ACCOUNTS",t[t.USER_DENIED_CREATE_ACCOUNT=4010]="USER_DENIED_CREATE_ACCOUNT",t[t.UNAUTHORIZED=4100]="UNAUTHORIZED",t[t.UNSUPPORTED_METHOD=4200]="UNSUPPORTED_METHOD",t[t.USER_DENIED_REQUEST_SIGNATURE=-32603]="USER_DENIED_REQUEST_SIGNATURE"}(e.ProviderErrorCode||(e.ProviderErrorCode={}));var n=function(t){Object(p.a)(n,t);var e=Object(b.a)(n);function n(t,r,o){var s;return Object(f.a)(this,n),(s=e.call(this,t||"Provider Error")).code=r,s.data=o,s.name="ProviderError",Object.setPrototypeOf(Object(i.a)(s),n.prototype),s}return n}(Object(o.a)(Error));e.ProviderError=n}));Object(v.c)(G),G.ProviderErrorCode,G.ProviderError;var Y=Object(v.b)((function(e,n){var r=v.d&&v.d.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var i=r(g),o=r(K);n.WalletLinkProvider=function(){function e(t){if(Object(f.a)(this,e),this._filterPolyfill=new J.FilterPolyfill(this),this._addresses=[],this._send=this.send,this._sendAsync=this.sendAsync,!t.relay)throw new Error("realy must be provided");if(!t.jsonRpcUrl)throw new Error("jsonRpcUrl must be provided");this._relay=t.relay,this._chainId=_.ensureIntNumber(t.chainId||1),this._jsonRpcUrl=t.jsonRpcUrl;var n=this._relay.getStorageItem("Addresses");if(n){var r=n.split(" ");""!==r[0]&&(this._addresses=r)}}return Object(d.a)(e,[{key:"selectedAddress",get:function(){return this._addresses[0]||void 0}},{key:"networkVersion",get:function(){return this._chainId.toString(10)}},{key:"isWalletLink",get:function(){return!0}},{key:"host",get:function(){return this._jsonRpcUrl}},{key:"connected",get:function(){return!0}},{key:"isConnected",value:function(){return!0}},{key:"enable",value:function(){var t=Object(c.a)(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(this._addresses.length>0)){t.next=4;break}t.t0=this._addresses,t.next=7;break;case 4:return t.next=6,this._send($.JSONRPCMethod.eth_requestAccounts);case 6:t.t0=t.sent;case 7:return t.abrupt("return",t.t0);case 8:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"close",value:function(){this._relay.resetAndReload()}},{key:"send",value:function(t,e){var n=this;if("string"==typeof t){var r={jsonrpc:"2.0",id:0,method:t,params:Array.isArray(e)?e:void 0!==e?[e]:[]};return this._sendRequestAsync(r).then((function(t){return t.result}))}if("function"==typeof e){var i=t,o=e;return this._sendAsync(i,o)}if(Array.isArray(t))return t.map((function(t){return n._sendRequest(t)}));var s=t;return this._sendRequest(s)}},{key:"sendAsync",value:function(t,e){if("function"!=typeof e)throw new Error("callback is required");if(Array.isArray(t)){var n=e;this._sendMultipleRequestsAsync(t).then((function(t){return n(null,t)})).catch((function(t){return n(t,null)}))}else{var r=e;this._sendRequestAsync(t).then((function(t){return r(null,t)})).catch((function(t){return r(t,null)}))}}},{key:"scanQRCode",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._relay.scanQRCode(_.ensureRegExpString(e));case 2:if("string"==typeof(n=t.sent).result){t.next=5;break}throw new Error("result was not a string");case 5:return t.abrupt("return",n.result);case 6:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"arbitraryRequest",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._relay.arbitraryRequest(e);case 2:if("string"==typeof(n=t.sent).result){t.next=5;break}throw new Error("result was not a string");case 5:return t.abrupt("return",n.result);case 6:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"supportsSubscriptions",value:function(){return!1}},{key:"subscribe",value:function(){throw new Error("Subscriptions are not supported")}},{key:"unsubscribe",value:function(){throw new Error("Subscriptions are not supported")}},{key:"disconnect",value:function(){return!0}},{key:"_sendRequest",value:function(t){var e={jsonrpc:"2.0",id:t.id},n=t.method;if(e.result=this._handleSynchronousMethods(t),void 0===e.result)throw new Error("WalletLink does not support calling ".concat(n," synchronously without ")+"a callback. Please provide a callback parameter to call ".concat(n," ")+"asynchronously.");return e}},{key:"_setAddresses",value:function(t){if(!Array.isArray(t))throw new Error("addresses is not an array");this._addresses=t.map((function(t){return _.ensureAddressString(t)})),this._relay.setStorageItem("Addresses",t.join(" ")),window.dispatchEvent(new CustomEvent("walletlink:addresses",{detail:this._addresses}))}},{key:"_sendRequestAsync",value:function(t){var e=this;return new Promise((function(n,r){try{var i=e._handleSynchronousMethods(t);if(void 0!==i)return n({jsonrpc:"2.0",id:t.id,result:i});var o=e._handleAsynchronousFilterMethods(t);if(void 0!==o)return void o.then((function(e){return n(Object.assign(Object.assign({},e),{id:t.id}))})).catch((function(t){return r(t)}))}catch(t){return r(t)}e._handleAsynchronousMethods(t).then((function(e){return n(Object.assign(Object.assign({},e),{id:t.id}))})).catch((function(t){return r(t)}))}))}},{key:"_sendMultipleRequestsAsync",value:function(t){var e=this;return Promise.all(t.map((function(t){return e._sendRequestAsync(t)})))}},{key:"_handleSynchronousMethods",value:function(t){var e=t.method,n=t.params||[];switch(e){case $.JSONRPCMethod.eth_accounts:return this._eth_accounts();case $.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case $.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(n);case $.JSONRPCMethod.net_version:return this._net_version();default:return}}},{key:"_handleAsynchronousMethods",value:function(t){var e=t.method,n=t.params||[];switch(e){case $.JSONRPCMethod.eth_requestAccounts:return this._eth_requestAccounts();case $.JSONRPCMethod.eth_sign:return this._eth_sign(n);case $.JSONRPCMethod.eth_ecRecover:return this._eth_ecRecover(n);case $.JSONRPCMethod.personal_sign:return this._personal_sign(n);case $.JSONRPCMethod.personal_ecRecover:return this._personal_ecRecover(n);case $.JSONRPCMethod.eth_signTransaction:return this._eth_signTransaction(n);case $.JSONRPCMethod.eth_sendRawTransaction:return this._eth_sendRawTransaction(n);case $.JSONRPCMethod.eth_sendTransaction:return this._eth_sendTransaction(n);case $.JSONRPCMethod.eth_signTypedData_v1:return this._eth_signTypedData_v1(n);case $.JSONRPCMethod.eth_signTypedData_v2:return this._throwUnsupportedMethodError();case $.JSONRPCMethod.eth_signTypedData_v3:return this._eth_signTypedData_v3(n);case $.JSONRPCMethod.eth_signTypedData_v4:case $.JSONRPCMethod.eth_signTypedData:return this._eth_signTypedData_v4(n);case $.JSONRPCMethod.walletlink_arbitrary:return this._walletlink_arbitrary(n)}return window.fetch(this._jsonRpcUrl,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then((function(t){return t.json()})).then((function(t){if(!t)throw new G.ProviderError("unexpected response");var e=t,n=e.error;if(n)throw new G.ProviderError(n.message||"RPC Error",n.code,n.data);return e}))}},{key:"_handleAsynchronousFilterMethods",value:function(t){var e=t.method,n=t.params||[];switch(e){case $.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(n);case $.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case $.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case $.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(n);case $.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(n)}}},{key:"_isKnownAddress",value:function(t){try{var e=_.ensureAddressString(t);return this._addresses.includes(e)}catch(t){}return!1}},{key:"_ensureKnownAddress",value:function(t){if(!this._isKnownAddress(t))throw new Error("Unknown Ethereum address")}},{key:"_prepareTransactionParams",value:function(e){var n=e.from?_.ensureAddressString(e.from):this.selectedAddress;if(!n)throw new Error("Ethereum address is unavailable");return this._ensureKnownAddress(n),{fromAddress:n,toAddress:e.to?_.ensureAddressString(e.to):null,weiValue:null!=e.value?_.ensureBN(e.value):new i.default(0),data:e.data?_.ensureBuffer(e.data):t.alloc(0),nonce:null!=e.nonce?_.ensureIntNumber(e.nonce):null,gasPriceInWei:null!=e.gasPrice?_.ensureBN(e.gasPrice):null,gasLimit:null!=e.gas?_.ensureBN(e.gas):null,chainId:this._chainId}}},{key:"_requireAuthorization",value:function(){if(0===this._addresses.length)throw new G.ProviderError("Unauthorized",G.ProviderErrorCode.UNAUTHORIZED)}},{key:"_throwUnsupportedMethodError",value:function(){throw new G.ProviderError("Unsupported method",G.ProviderErrorCode.UNSUPPORTED_METHOD)}},{key:"_signEthereumMessage",value:function(){var t=Object(c.a)(a.a.mark((function t(e,n,r,i){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._ensureKnownAddress(n),t.prev=1,t.next=4,this._relay.signEthereumMessage(e,n,r,i);case 4:return t.t0=t.sent.result,t.abrupt("return",{jsonrpc:"2.0",id:0,result:t.t0});case 8:if(t.prev=8,t.t1=t.catch(1),"string"!=typeof t.t1.message||!t.t1.message.match(/(denied|rejected)/i)){t.next=12;break}throw new G.ProviderError("User denied message signature",G.ProviderErrorCode.USER_DENIED_REQUEST_SIGNATURE);case 12:throw t.t1;case 13:case"end":return t.stop()}}),t,this,[[1,8]])})));return function(e,n,r,i){return t.apply(this,arguments)}}()},{key:"_ethereumAddressFromSignedMessage",value:function(){var t=Object(c.a)(a.a.mark((function t(e,n,r){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._relay.ethereumAddressFromSignedMessage(e,n,r);case 2:return t.t0=t.sent.result,t.abrupt("return",{jsonrpc:"2.0",id:0,result:t.t0});case 4:case"end":return t.stop()}}),t,this)})));return function(e,n,r){return t.apply(this,arguments)}}()},{key:"_eth_accounts",value:function(){return this._addresses}},{key:"_eth_coinbase",value:function(){return this.selectedAddress||null}},{key:"_net_version",value:function(){return this._chainId.toString(10)}},{key:"_eth_requestAccounts",value:function(){var t=Object(c.a)(a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(this._addresses.length>0)){t.next=2;break}return t.abrupt("return",Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses}));case 2:return t.prev=2,t.next=5,this._relay.requestEthereumAccounts();case 5:e=t.sent,t.next=13;break;case 8:if(t.prev=8,t.t0=t.catch(2),"string"!=typeof t.t0.message||!t.t0.message.match(/(denied|rejected)/i)){t.next=12;break}throw new G.ProviderError("User denied account authorization",G.ProviderErrorCode.USER_DENIED_REQUEST_ACCOUNTS);case 12:throw t.t0;case 13:if(e.result){t.next=15;break}throw new Error("accounts received is empty");case 15:return t.abrupt("return",(this._setAddresses(e.result),{jsonrpc:"2.0",id:0,result:this._addresses}));case 16:case"end":return t.stop()}}),t,this,[[2,8]])})));return function(){return t.apply(this,arguments)}}()},{key:"_eth_sign",value:function(t){this._requireAuthorization();var e=_.ensureAddressString(t[0]),n=_.ensureBuffer(t[1]);return this._signEthereumMessage(n,e,!1)}},{key:"_eth_ecRecover",value:function(t){var e=_.ensureBuffer(t[0]),n=_.ensureBuffer(t[1]);return this._ethereumAddressFromSignedMessage(e,n,!1)}},{key:"_personal_sign",value:function(t){this._requireAuthorization();var e=_.ensureBuffer(t[0]),n=_.ensureAddressString(t[1]);return this._signEthereumMessage(e,n,!0)}},{key:"_personal_ecRecover",value:function(t){var e=_.ensureBuffer(t[0]),n=_.ensureBuffer(t[1]);return this._ethereumAddressFromSignedMessage(e,n,!0)}},{key:"_eth_signTransaction",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._requireAuthorization(),n=this._prepareTransactionParams(e[0]||{}),t.prev=2,t.next=5,this._relay.signEthereumTransaction(n);case 5:return t.t0=t.sent.result,t.abrupt("return",{jsonrpc:"2.0",id:0,result:t.t0});case 9:if(t.prev=9,t.t1=t.catch(2),"string"!=typeof t.t1.message||!t.t1.message.match(/(denied|rejected)/i)){t.next=13;break}throw new G.ProviderError("User denied transaction signature",G.ProviderErrorCode.USER_DENIED_REQUEST_SIGNATURE);case 13:throw t.t1;case 14:case"end":return t.stop()}}),t,this,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()},{key:"_eth_sendRawTransaction",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=_.ensureBuffer(e[0]),t.next=3,this._relay.submitEthereumTransaction(n,this._chainId);case 3:return t.t0=t.sent.result,t.abrupt("return",{jsonrpc:"2.0",id:0,result:t.t0});case 5:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"_eth_sendTransaction",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._requireAuthorization(),n=this._prepareTransactionParams(e[0]||{}),t.prev=2,t.next=5,this._relay.signAndSubmitEthereumTransaction(n);case 5:return t.t0=t.sent.result,t.abrupt("return",{jsonrpc:"2.0",id:0,result:t.t0});case 9:if(t.prev=9,t.t1=t.catch(2),"string"!=typeof t.t1.message||!t.t1.message.match(/(denied|rejected)/i)){t.next=13;break}throw new G.ProviderError("User denied transaction signature",G.ProviderErrorCode.USER_DENIED_REQUEST_SIGNATURE);case 13:throw t.t1;case 14:case"end":return t.stop()}}),t,this,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()},{key:"_eth_signTypedData_v1",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var n,r,i,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._requireAuthorization(),n=e[0],r=_.ensureAddressString(e[1]),this._ensureKnownAddress(r),i=o.default.hashForSignTypedDataLegacy({data:n}),s=JSON.stringify(n,null,2),t.abrupt("return",this._signEthereumMessage(i,r,!1,s));case 5:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"_eth_signTypedData_v3",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var n,r,i,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._requireAuthorization(),n=_.ensureAddressString(e[0]),r=e[1],this._ensureKnownAddress(n),i=o.default.hashForSignTypedData_v3({data:r}),s=JSON.stringify(r,null,2),t.abrupt("return",this._signEthereumMessage(i,n,!1,s));case 5:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"_eth_signTypedData_v4",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var n,r,i,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._requireAuthorization(),n=_.ensureAddressString(e[0]),r=e[1],this._ensureKnownAddress(n),i=o.default.hashForSignTypedData_v4({data:r}),s=JSON.stringify(r,null,2),t.abrupt("return",this._signEthereumMessage(i,n,!1,s));case 5:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"_walletlink_arbitrary",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("string"==typeof(n=e[0])){t.next=3;break}throw new Error("parameter must be a string");case 3:return t.next=5,this.arbitraryRequest(n);case 5:return t.t0=t.sent,t.abrupt("return",{jsonrpc:"2.0",id:0,result:t.t0});case 7:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"_eth_uninstallFilter",value:function(t){var e=_.ensureHexString(t[0]);return this._filterPolyfill.uninstallFilter(e)}},{key:"_eth_newFilter",value:function(){var t=Object(c.a)(a.a.mark((function t(e){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e[0],t.next=3,this._filterPolyfill.newFilter(n);case 3:return t.t0=t.sent,t.abrupt("return",{jsonrpc:"2.0",id:0,result:t.t0});case 5:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"_eth_newBlockFilter",value:function(){var t=Object(c.a)(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._filterPolyfill.newBlockFilter();case 2:return t.t0=t.sent,t.abrupt("return",{jsonrpc:"2.0",id:0,result:t.t0});case 4:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"_eth_newPendingTransactionFilter",value:function(){var t=Object(c.a)(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._filterPolyfill.newPendingTransactionFilter();case 2:return t.t0=t.sent,t.abrupt("return",{jsonrpc:"2.0",id:0,result:t.t0});case 4:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"_eth_getFilterChanges",value:function(t){var e=_.ensureHexString(t[0]);return this._filterPolyfill.getFilterChanges(e)}},{key:"_eth_getFilterLogs",value:function(t){var e=_.ensureHexString(t[0]);return this._filterPolyfill.getFilterLogs(e)}}]),e}()}));Object(v.c)(Y),Y.WalletLinkProvider;var Z=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default='.-walletlink-css-reset,.-walletlink-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:transparent;background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;bottom:auto;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;content:normal;counter-increment:none;counter-reset:none;cursor:auto;direction:ltr;display:block;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;left:auto;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;max-height:none;max-width:none;min-height:0;min-width:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";right:auto;tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;top:auto;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;width:auto;word-spacing:normal;z-index:auto;all:initial;all:unset}.-walletlink-css-reset *{box-sizing:border-box;display:initial;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-walletlink-css-reset [class*=container]{margin:0;padding:0}.-walletlink-css-reset style{display:none}'}));Object(v.c)(Z);var Q=Object(v.b)((function(t,e){var n=v.d&&v.d.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(Z);e.injectCssReset=function(){var t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(r.default)),document.documentElement.appendChild(t)}}));Object(v.c)(Q),Q.injectCssReset;var X=Object(v.b)((function(t,e){var n;function r(t,e,r){if(!r||typeof r.value!==n.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+e+"> is not a method!");return{configurable:n.boolTrue,get:function(){var t=r.value.bind(this);return Object.defineProperty(this,e,{value:t,configurable:n.boolTrue,writable:n.boolTrue}),t}}}Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.typeOfFunction="function",t.boolTrue=!0}(n||(n={})),e.bind=r,e.default=r}));Object(v.c)(X),X.bind;var tt=function(t,e){return(tt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function et(t,e){function n(){this.constructor=t}tt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function nt(t){return"function"==typeof t}var rt=!1,it={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack,rt=t},get useDeprecatedSynchronousErrorHandling(){return rt}};function ot(t){setTimeout((function(){throw t}),0)}var st={closed:!0,next:function(t){},error:function(t){if(it.useDeprecatedSynchronousErrorHandling)throw t;ot(t)},complete:function(){}},ut=Array.isArray||function(t){return t&&"number"==typeof t.length};function at(t){return null!==t&&"object"==typeof t}var ct=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}(),lt=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}return t.prototype.unsubscribe=function(){var e;if(!this.closed){var n=this._parentOrParents,r=this._unsubscribe,i=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(null!==n)for(var o=0;o1)this.connection=null;else{var n=this.connection,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},e}(dt),Tt=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return et(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new lt).add(this.source.subscribe(new It(this.getSubject(),this))),t.closed&&(this._connection=null,t=lt.EMPTY)),t},e.prototype.refCount=function(){return Ct()(this)},e}(wt),jt=function(){var t=Tt.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),It=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return et(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(St),At=function(){function t(t,e,n,r){this.keySelector=t,this.elementSelector=e,this.durationSelector=n,this.subjectSelector=r}return t.prototype.call=function(t,e){return e.subscribe(new Pt(t,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),Pt=function(t){function e(e,n,r,i,o){var s=t.call(this,e)||this;return s.keySelector=n,s.elementSelector=r,s.durationSelector=i,s.subjectSelector=o,s.groups=null,s.attemptedToUnsubscribe=!1,s.count=0,s}return et(e,t),e.prototype._next=function(t){var e;try{e=this.keySelector(t)}catch(t){return void this.error(t)}this._group(t,e)},e.prototype._group=function(t,e){var n=this.groups;n||(n=this.groups=new Map);var r,i=n.get(e);if(this.elementSelector)try{r=this.elementSelector(t)}catch(t){this.error(t)}else r=t;if(!i){i=this.subjectSelector?this.subjectSelector():new Mt,n.set(e,i);var o=new Dt(e,i,this);if(this.destination.next(o),this.durationSelector){var s=void 0;try{s=this.durationSelector(new Dt(e,i))}catch(t){return void this.error(t)}this.add(s.subscribe(new Rt(e,i,this)))}}i.closed||i.next(r)},e.prototype._error=function(t){var e=this.groups;e&&(e.forEach((function(e,n){e.error(t)})),e.clear()),this.destination.error(t)},e.prototype._complete=function(){var t=this.groups;t&&(t.forEach((function(t,e){t.complete()})),t.clear()),this.destination.complete()},e.prototype.removeGroup=function(t){this.groups.delete(t)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&t.prototype.unsubscribe.call(this))},e}(dt),Rt=function(t){function e(e,n,r){var i=t.call(this,n)||this;return i.key=e,i.group=n,i.parent=r,i}return et(e,t),e.prototype._next=function(t){this.complete()},e.prototype._unsubscribe=function(){var t=this.parent,e=this.key;this.key=this.parent=null,t&&t.removeGroup(e)},e}(dt),Dt=function(t){function e(e,n,r){var i=t.call(this)||this;return i.key=e,i.groupSubject=n,i.refCountSubscription=r,i}return et(e,t),e.prototype._subscribe=function(t){var e=new lt,n=this.refCountSubscription,r=this.groupSubject;return n&&!n.closed&&e.add(new Lt(n)),e.add(r.subscribe(t)),e},e}(wt),Lt=function(t){function e(e){var n=t.call(this)||this;return n.parent=e,e.count++,n}return et(e,t),e.prototype.unsubscribe=function(){var e=this.parent;e.closed||this.closed||(t.prototype.unsubscribe.call(this),e.count-=1,0===e.count&&e.attemptedToUnsubscribe&&e.unsubscribe())},e}(lt),Bt=function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}return et(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new kt;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(Mt),Ft=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return et(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),setInterval(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return e;clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n=!1,r=void 0;try{this.work(t)}catch(t){n=!0,r=!!t&&t||new Error(t)}if(n)return this.unsubscribe(),r},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,n=e.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(function(t){function e(e,n){return t.call(this)||this}return et(e,t),e.prototype.schedule=function(t,e){return this},e}(lt)),Wt=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return et(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(Ft),qt=function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=function(){return Date.now()},t}(),Ut=function(t){function e(n,r){void 0===r&&(r=qt.now);var i=t.call(this,n,(function(){return e.delegate&&e.delegate!==i?e.delegate.now():r()}))||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return et(e,t),e.prototype.schedule=function(n,r,i){return void 0===r&&(r=0),e.delegate&&e.delegate!==this?e.delegate.schedule(n,r,i):t.prototype.schedule.call(this,n,r,i)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(qt),Vt=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return et(e,t),e}(Ut))(Wt),zt=new wt((function(t){return t.complete()}));function Ht(t){return t?function(t){return new wt((function(e){return t.schedule((function(){return e.complete()}))}))}(t):zt}function Kt(t){return t&&"function"==typeof t.schedule}var Jt,$t=function(t){return function(e){for(var n=0,r=t.length;nthis._bufferSize&&n.shift(),t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this._events.push(new oe(this._getNow(),e)),this._trimBufferThenGetEvents(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,n=this._infiniteTimeWindow,r=n?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,o=r.length;if(this.closed)throw new kt;if(this.isStopped||this.hasError?e=lt.EMPTY:(this.observers.push(t),e=new xt(this,t)),i&&t.add(t=new ne(t,i)),n)for(var s=0;se&&(o=Math.max(o,i-e)),o>0&&r.splice(0,o),r},e}(Mt),oe=function(t,e){this.time=t,this.value=e},se=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.value=null,e.hasNext=!1,e.hasCompleted=!1,e}return et(e,t),e.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),lt.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),lt.EMPTY):t.prototype._subscribe.call(this,e)},e.prototype.next=function(t){this.hasCompleted||(this.value=t,this.hasNext=!0)},e.prototype.error=function(e){this.hasCompleted||t.prototype.error.call(this,e)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(Mt),ue=1,ae=Promise.resolve(),ce={};function le(t){return t in ce&&(delete ce[t],!0)}var he=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return et(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e.scheduled||(e.scheduled=function(t){var e=ue++;return ce[e]=!0,ae.then((function(){return le(e)&&t()})),e}(e.flush.bind(e,null))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);0===e.actions.length&&(function(t){le(t)}(n),e.scheduled=void 0)},e}(Ft),fe=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return et(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1,i=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++r0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame((function(){return e.flush(null)}))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);0===e.actions.length&&(cancelAnimationFrame(n),e.scheduled=void 0)},e}(Ft),be=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return et(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1,i=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++re.index?1:-1:t.delay>e.delay?1:-1},e}(Ft);function ye(){}var ge=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}(),we=function(){function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t}(),_e=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}();function ke(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new xe(t,e))}}var xe=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new Se(t,this.project,this.thisArg))},t}(),Se=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.project=n,i.count=0,i.thisArg=r||i,i}return et(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(dt);function Me(t){var e=this,n=t.args,r=t.subscriber,i=t.params,o=i.callbackFunc,s=i.context,u=i.scheduler,a=i.subject;if(!a){a=i.subject=new se;try{o.apply(s,n.concat([function(){for(var t=[],n=0;n0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(Te);function He(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),Ue(mt,t)}function Ke(){return He(1)}function Je(){for(var t=[],e=0;e=0}function Qe(t){var e=t.subscriber,n=t.counter,r=t.period;e.next(n),this.schedule({subscriber:e,counter:n+1,period:r},r)}function Xe(){for(var t=[],e=0;e1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof i&&(n=t.pop()),null===r&&1===t.length&&t[0]instanceof wt?t[0]:He(n)(Yt(t,r))}var tn=new wt(ye);function en(t){var e=t.keys,n=t.index,r=t.subscriber,i=t.subscription,o=t.obj;if(!r.closed)if(n=r?i.complete():(i.next(e),i.closed||(t.index=n+1,t.start=e+1,this.schedule(t)))}function hn(t,e,n){void 0===t&&(t=0);var r=-1;return Ze(e)?r=Number(e)<1?1:Number(e):Kt(e)&&(n=e),Kt(n)||(n=de),new wt((function(e){var i=Ze(t)?t:+t-n.now();return n.schedule(fn,i,{index:0,period:r,subscriber:e})}))}function fn(t){var e=t.index,n=t.period,r=t.subscriber;if(r.next(e),!r.closed){if(-1===n)return r.complete();t.index=e+1,this.schedule(t,n)}}function dn(){for(var t=[],e=0;ethis.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),yn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.parent=n,i.observable=r,i.stillUnsubscribed=!0,i.buffer=[],i.isComplete=!1,i}return et(e,t),e.prototype[Ie]=function(){return this},e.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(t,e,n,r,i){this.buffer.push(e),this.parent.checkIterators()},e.prototype.subscribe=function(t,e){return De(this,this.observable,this,e)},e}(Te),gn=Object.freeze({__proto__:null,Observable:wt,ConnectableObservable:Tt,GroupedObservable:Dt,observable:vt,Subject:Mt,BehaviorSubject:Bt,ReplaySubject:ie,AsyncSubject:se,asapScheduler:fe,asyncScheduler:de,queueScheduler:Vt,animationFrameScheduler:be,VirtualTimeScheduler:ve,VirtualAction:me,Scheduler:qt,Subscription:lt,Subscriber:dt,Notification:te,get NotificationKind(){return Jt},pipe:yt,noop:ye,identity:mt,isObservable:function(t){return!!t&&(t instanceof wt||"function"==typeof t.lift&&"function"==typeof t.subscribe)},ArgumentOutOfRangeError:ge,EmptyError:we,ObjectUnsubscribedError:kt,UnsubscriptionError:ct,TimeoutError:_e,bindCallback:function t(e,n,r){if(n){if(!Kt(n))return function(){for(var i=[],o=0;o1?t.next(Array.prototype.slice.call(arguments)):t.next(e)}),t,r)}))},fromEventPattern:function t(e,n,r){return r?t(e,n).pipe(ke((function(t){return ut(t)?r.apply(void 0,t):r(t)}))):new wt((function(t){var r,i=function(){for(var e=[],n=0;n=e){r.complete();break}if(r.next(o++),r.closed)break}}))},throwError:Qt,timer:hn,using:function(t,e){return new wt((function(n){var r,i;try{r=t()}catch(t){return void n.error(t)}try{i=e(r)}catch(t){return void n.error(t)}var o=(i?qe(i):zt).subscribe(n);return function(){o.unsubscribe(),r&&r.unsubscribe()}}))},zip:dn,scheduled:We,EMPTY:zt,NEVER:tn,config:it});function wn(t){return function(e){return e.lift(new _n(t))}}var _n=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new kn(t,this.durationSelector))},t}(),kn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.durationSelector=n,r.hasValue=!1,r}return et(e,t),e.prototype._next=function(t){if(this.value=t,this.hasValue=!0,!this.throttled){var e=void 0;try{e=(0,this.durationSelector)(t)}catch(t){return this.destination.error(t)}var n=De(this,e);!n||n.closed?this.clearThrottle():this.add(this.throttled=n)}},e.prototype.clearThrottle=function(){var t=this.value,e=this.hasValue,n=this.throttled;n&&(this.remove(n),this.throttled=null,n.unsubscribe()),e&&(this.value=null,this.hasValue=!1,this.destination.next(t))},e.prototype.notifyNext=function(t,e,n,r){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(Te),xn=function(){function t(t){this.closingNotifier=t}return t.prototype.call=function(t,e){return e.subscribe(new Sn(t,this.closingNotifier))},t}(),Sn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.buffer=[],r.add(De(r,n)),r}return et(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype.notifyNext=function(t,e,n,r,i){var o=this.buffer;this.buffer=[],this.destination.next(o)},e}(Te),Mn=function(){function t(t,e){this.bufferSize=t,this.startBufferEvery=e,this.subscriberClass=e&&t!==e?Cn:En}return t.prototype.call=function(t,e){return e.subscribe(new this.subscriberClass(t,this.bufferSize,this.startBufferEvery))},t}(),En=function(t){function e(e,n){var r=t.call(this,e)||this;return r.bufferSize=n,r.buffer=[],r}return et(e,t),e.prototype._next=function(t){var e=this.buffer;e.push(t),e.length==this.bufferSize&&(this.destination.next(e),this.buffer=[])},e.prototype._complete=function(){var e=this.buffer;e.length>0&&this.destination.next(e),t.prototype._complete.call(this)},e}(dt),Cn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.bufferSize=n,i.startBufferEvery=r,i.buffers=[],i.count=0,i}return et(e,t),e.prototype._next=function(t){var e=this.bufferSize,n=this.startBufferEvery,r=this.buffers,i=this.count;this.count++,i%n==0&&r.push([]);for(var o=r.length;o--;){var s=r[o];s.push(t),s.length===e&&(r.splice(o,1),this.destination.next(s))}},e.prototype._complete=function(){for(var e=this.buffers,n=this.destination;e.length>0;){var r=e.shift();r.length>0&&n.next(r)}t.prototype._complete.call(this)},e}(dt),On=function(){function t(t,e,n,r){this.bufferTimeSpan=t,this.bufferCreationInterval=e,this.maxBufferSize=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new Tn(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),Nn=function(){this.buffer=[]},Tn=function(t){function e(e,n,r,i,o){var s=t.call(this,e)||this;s.bufferTimeSpan=n,s.bufferCreationInterval=r,s.maxBufferSize=i,s.scheduler=o,s.contexts=[];var u=s.openContext();if(s.timespanOnly=null==r||r<0,s.timespanOnly){var a={subscriber:s,context:u,bufferTimeSpan:n};s.add(u.closeAction=o.schedule(jn,n,a))}else{var c={subscriber:s,context:u},l={bufferTimeSpan:n,bufferCreationInterval:r,subscriber:s,scheduler:o};s.add(u.closeAction=o.schedule(An,n,c)),s.add(o.schedule(In,r,l))}return s}return et(e,t),e.prototype._next=function(t){for(var e,n=this.contexts,r=n.length,i=0;i0;){var r=e.shift();n.next(r.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(t){this.closeContext(t);var e=t.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){t=this.openContext();var n=this.bufferTimeSpan,r={subscriber:this,context:t,bufferTimeSpan:n};this.add(t.closeAction=this.scheduler.schedule(jn,n,r))}},e.prototype.openContext=function(){var t=new Nn;return this.contexts.push(t),t},e.prototype.closeContext=function(t){this.destination.next(t.buffer);var e=this.contexts;(e?e.indexOf(t):-1)>=0&&e.splice(e.indexOf(t),1)},e}(dt);function jn(t){var e=t.subscriber,n=t.context;n&&e.closeContext(n),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function In(t){var e=t.bufferCreationInterval,n=t.bufferTimeSpan,r=t.subscriber,i=t.scheduler,o=r.openContext();r.closed||(r.add(o.closeAction=i.schedule(An,n,{subscriber:r,context:o})),this.schedule(t,e))}function An(t){var e=t.subscriber,n=t.context;e.closeContext(n)}var Pn=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new Rn(t,this.openings,this.closingSelector))},t}(),Rn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.openings=n,i.closingSelector=r,i.contexts=[],i.add(De(i,n)),i}return et(e,t),e.prototype._next=function(t){for(var e=this.contexts,n=e.length,r=0;r0;){var r=n.shift();r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts;e.length>0;){var n=e.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,r,i){t?this.closeBuffer(t):this.openBuffer(e)},e.prototype.notifyComplete=function(t){this.closeBuffer(t.context)},e.prototype.openBuffer=function(t){try{var e=this.closingSelector.call(this,t);e&&this.trySubscribe(e)}catch(t){this._error(t)}},e.prototype.closeBuffer=function(t){var e=this.contexts;if(e&&t){var n=t.buffer,r=t.subscription;this.destination.next(n),e.splice(e.indexOf(t),1),this.remove(r),r.unsubscribe()}},e.prototype.trySubscribe=function(t){var e=this.contexts,n=new lt,r={buffer:[],subscription:n};e.push(r);var i=De(this,t,r);!i||i.closed?this.closeBuffer(r):(i.context=r,this.add(i),n.add(i))},e}(Te),Dn=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new Ln(t,this.closingSelector))},t}(),Ln=function(t){function e(e,n){var r=t.call(this,e)||this;return r.closingSelector=n,r.subscribing=!1,r.openBuffer(),r}return et(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype._complete=function(){var e=this.buffer;e&&this.destination.next(e),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=null,this.subscribing=!1},e.prototype.notifyNext=function(t,e,n,r,i){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe());var e,n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];try{e=(0,this.closingSelector)()}catch(t){return this.error(t)}t=new lt,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add(De(this,e)),this.subscribing=!1},e}(Te),Bn=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new Fn(t,this.selector,this.caught))},t}(),Fn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.selector=n,i.caught=r,i}return et(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=void 0;try{n=this.selector(e,this.caught)}catch(e){return void t.prototype.error.call(this,e)}this._unsubscribeAndRecycle();var r=new je(this,void 0,void 0);this.add(r);var i=De(this,n,void 0,void 0,r);i!==r&&this.add(i)}},e}(Te);function Wn(t,e){return Ue(t,e,1)}var qn=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new Un(t,this.predicate,this.source))},t}(),Un=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.source=r,i.count=0,i.index=0,i}return et(e,t),e.prototype._next=function(t){this.predicate?this._tryPredicate(t):this.count++},e.prototype._tryPredicate=function(t){var e;try{e=this.predicate(t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e&&this.count++},e.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},e}(dt),Vn=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new zn(t,this.durationSelector))},t}(),zn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.durationSelector=n,r.hasValue=!1,r.durationSubscription=null,r}return et(e,t),e.prototype._next=function(t){try{var e=this.durationSelector.call(this,t);e&&this._tryNext(t,e)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.emitValue(),this.destination.complete()},e.prototype._tryNext=function(t,e){var n=this.durationSubscription;this.value=t,this.hasValue=!0,n&&(n.unsubscribe(),this.remove(n)),(n=De(this,e))&&!n.closed&&this.add(this.durationSubscription=n)},e.prototype.notifyNext=function(t,e,n,r,i){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){if(this.hasValue){var e=this.value,n=this.durationSubscription;n&&(this.durationSubscription=null,n.unsubscribe(),this.remove(n)),this.value=null,this.hasValue=!1,t.prototype._next.call(this,e)}},e}(Te),Hn=function(){function t(t,e){this.dueTime=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new Kn(t,this.dueTime,this.scheduler))},t}(),Kn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.dueTime=n,i.scheduler=r,i.debouncedSubscription=null,i.lastValue=null,i.hasValue=!1,i}return et(e,t),e.prototype._next=function(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Jn,this.dueTime,this))},e.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},e.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var t=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}},e.prototype.clearDebounce=function(){var t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)},e}(dt);function Jn(t){t.debouncedNext()}function $n(t){return void 0===t&&(t=null),function(e){return e.lift(new Gn(t))}}var Gn=function(){function t(t){this.defaultValue=t}return t.prototype.call=function(t,e){return e.subscribe(new Yn(t,this.defaultValue))},t}(),Yn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.defaultValue=n,r.isEmpty=!0,r}return et(e,t),e.prototype._next=function(t){this.isEmpty=!1,this.destination.next(t)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(dt);function Zn(t){return t instanceof Date&&!isNaN(+t)}var Qn=function(){function t(t,e){this.delay=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new Xn(t,this.delay,this.scheduler))},t}(),Xn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.delay=n,i.scheduler=r,i.queue=[],i.active=!1,i.errored=!1,i}return et(e,t),e.dispatch=function(t){for(var e=t.source,n=e.queue,r=t.scheduler,i=t.destination;n.length>0&&n[0].time-r.now()<=0;)n.shift().notification.observe(i);if(n.length>0){var o=Math.max(0,n[0].time-r.now());this.schedule(t,o)}else this.unsubscribe(),e.active=!1},e.prototype._schedule=function(t){this.active=!0,this.destination.add(t.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))},e.prototype.scheduleNotification=function(t){if(!0!==this.errored){var e=this.scheduler,n=new tr(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}},e.prototype._next=function(t){this.scheduleNotification(te.createNext(t))},e.prototype._error=function(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(te.createComplete()),this.unsubscribe()},e}(dt),tr=function(t,e){this.time=t,this.notification=e},er=function(){function t(t){this.delayDurationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new nr(t,this.delayDurationSelector))},t}(),nr=function(t){function e(e,n){var r=t.call(this,e)||this;return r.delayDurationSelector=n,r.completed=!1,r.delayNotifierSubscriptions=[],r.index=0,r}return et(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(t),this.removeSubscription(i),this.tryComplete()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){var e=this.removeSubscription(t);e&&this.destination.next(e),this.tryComplete()},e.prototype._next=function(t){var e=this.index++;try{var n=this.delayDurationSelector(t,e);n&&this.tryDelay(n,t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(t){t.unsubscribe();var e=this.delayNotifierSubscriptions.indexOf(t);return-1!==e&&this.delayNotifierSubscriptions.splice(e,1),t.outerValue},e.prototype.tryDelay=function(t,e){var n=De(this,t,e);n&&!n.closed&&(this.destination.add(n),this.delayNotifierSubscriptions.push(n))},e.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},e}(Te),rr=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subscriptionDelay=n,r}return et(e,t),e.prototype._subscribe=function(t){this.subscriptionDelay.subscribe(new ir(t,this.source))},e}(wt),ir=function(t){function e(e,n){var r=t.call(this)||this;return r.parent=e,r.source=n,r.sourceSubscribed=!1,r}return et(e,t),e.prototype._next=function(t){this.subscribeToSource()},e.prototype._error=function(t){this.unsubscribe(),this.parent.error(t)},e.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(dt),or=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new sr(t))},t}(),sr=function(t){function e(e){return t.call(this,e)||this}return et(e,t),e.prototype._next=function(t){t.observe(this.destination)},e}(dt),ur=function(){function t(t,e){this.keySelector=t,this.flushes=e}return t.prototype.call=function(t,e){return e.subscribe(new ar(t,this.keySelector,this.flushes))},t}(),ar=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.keySelector=n,i.values=new Set,r&&i.add(De(i,r)),i}return et(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.values.clear()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype._next=function(t){this.keySelector?this._useKeySelector(t):this._finalizeNext(t,t)},e.prototype._useKeySelector=function(t){var e,n=this.destination;try{e=this.keySelector(t)}catch(t){return void n.error(t)}this._finalizeNext(e,t)},e.prototype._finalizeNext=function(t,e){var n=this.values;n.has(t)||(n.add(t),this.destination.next(e))},e}(Te);function cr(t,e){return function(n){return n.lift(new lr(t,e))}}var lr=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new hr(t,this.compare,this.keySelector))},t}(),hr=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.keySelector=r,i.hasKey=!1,"function"==typeof n&&(i.compare=n),i}return et(e,t),e.prototype.compare=function(t,e){return t===e},e.prototype._next=function(t){var e;try{var n=this.keySelector;e=n?n(t):t}catch(t){return this.destination.error(t)}var r=!1;if(this.hasKey)try{r=(0,this.compare)(this.key,e)}catch(t){return this.destination.error(t)}else this.hasKey=!0;r||(this.key=e,this.destination.next(t))},e}(dt);function fr(t){return void 0===t&&(t=br),function(e){return e.lift(new dr(t))}}var dr=function(){function t(t){this.errorFactory=t}return t.prototype.call=function(t,e){return e.subscribe(new pr(t,this.errorFactory))},t}(),pr=function(t){function e(e,n){var r=t.call(this,e)||this;return r.errorFactory=n,r.hasValue=!1,r}return et(e,t),e.prototype._next=function(t){this.hasValue=!0,this.destination.next(t)},e.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var t=void 0;try{t=this.errorFactory()}catch(e){t=e}this.destination.error(t)},e}(dt);function br(){return new we}function vr(t){return function(e){return 0===t?Ht():e.lift(new mr(t))}}var mr=function(){function t(t){if(this.total=t,this.total<0)throw new ge}return t.prototype.call=function(t,e){return e.subscribe(new yr(t,this.total))},t}(),yr=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return et(e,t),e.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},e}(dt),gr=function(){function t(t,e,n){this.predicate=t,this.thisArg=e,this.source=n}return t.prototype.call=function(t,e){return e.subscribe(new wr(t,this.predicate,this.thisArg,this.source))},t}(),wr=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.predicate=n,o.thisArg=r,o.source=i,o.index=0,o.thisArg=r||o,o}return et(e,t),e.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},e.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(dt),_r=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new kr(t))},t}(),kr=function(t){function e(e){var n=t.call(this,e)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return et(e,t),e.prototype._next=function(t){this.hasSubscription||(this.hasSubscription=!0,this.add(De(this,t)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(t){this.remove(t),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(Te),xr=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new Sr(t,this.project))},t}(),Sr=function(t){function e(e,n){var r=t.call(this,e)||this;return r.project=n,r.hasSubscription=!1,r.hasCompleted=!1,r.index=0,r}return et(e,t),e.prototype._next=function(t){this.hasSubscription||this.tryNext(t)},e.prototype.tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.hasSubscription=!0,this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=new je(this,e,n),i=this.destination;i.add(r);var o=De(this,t,void 0,void 0,r);o!==r&&i.add(o)},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(e)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.remove(t),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(Te),Mr=function(){function t(t,e,n){this.project=t,this.concurrent=e,this.scheduler=n}return t.prototype.call=function(t,e){return e.subscribe(new Er(t,this.project,this.concurrent,this.scheduler))},t}(),Er=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.project=n,o.concurrent=r,o.scheduler=i,o.index=0,o.active=0,o.hasCompleted=!1,r0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},e}(Te),Cr=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new Or(t,this.callback))},t}(),Or=function(t){function e(e,n){var r=t.call(this,e)||this;return r.add(new lt(n)),r}return et(e,t),e}(dt),Nr=function(){function t(t,e,n,r){this.predicate=t,this.source=e,this.yieldIndex=n,this.thisArg=r}return t.prototype.call=function(t,e){return e.subscribe(new Tr(t,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),Tr=function(t){function e(e,n,r,i,o){var s=t.call(this,e)||this;return s.predicate=n,s.source=r,s.yieldIndex=i,s.thisArg=o,s.index=0,s}return et(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete(),this.unsubscribe()},e.prototype._next=function(t){var e=this.predicate,n=this.thisArg,r=this.index++;try{e.call(n||this,t,r,this.source)&&this.notifyComplete(this.yieldIndex?r:t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(dt),jr=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Ir(t))},t}(),Ir=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return et(e,t),e.prototype._next=function(t){},e}(dt),Ar=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Pr(t))},t}(),Pr=function(t){function e(e){return t.call(this,e)||this}return et(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype._next=function(t){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(dt);function Rr(t){return function(e){return 0===t?Ht():e.lift(new Dr(t))}}var Dr=function(){function t(t){if(this.total=t,this.total<0)throw new ge}return t.prototype.call=function(t,e){return e.subscribe(new Lr(t,this.total))},t}(),Lr=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.ring=new Array,r.count=0,r}return et(e,t),e.prototype._next=function(t){var e=this.ring,n=this.total,r=this.count++;e.length0)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,i=0;i=2&&(n=!0),function(r){return r.lift(new Vr(t,e,n))}}var Vr=function(){function t(t,e,n){void 0===n&&(n=!1),this.accumulator=t,this.seed=e,this.hasSeed=n}return t.prototype.call=function(t,e){return e.subscribe(new zr(t,this.accumulator,this.seed,this.hasSeed))},t}(),zr=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.accumulator=n,o._seed=r,o.hasSeed=i,o.index=0,o}return et(e,t),Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),e.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.accumulator(this.seed,t,n)}catch(t){this.destination.error(t)}this.seed=e,this.destination.next(e)},e}(dt);function Hr(t,e){return arguments.length>=2?function(n){return yt(Ur(t,e),Rr(1),$n(e))(n)}:function(e){return yt(Ur((function(e,n,r){return t(e,n,r+1)})),Rr(1))(e)}}var Kr=function(){function t(t,e,n){this.accumulator=t,this.seed=e,this.concurrent=n}return t.prototype.call=function(t,e){return e.subscribe(new Jr(t,this.accumulator,this.seed,this.concurrent))},t}(),Jr=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.accumulator=n,o.acc=r,o.concurrent=i,o.hasValue=!1,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return et(e,t),e.prototype._next=function(t){if(this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},e}(Te);function $r(t,e){return function(n){var r;if(r="function"==typeof t?t:function(){return t},"function"==typeof e)return n.lift(new Gr(r,e));var i=Object.create(n,jt);return i.source=n,i.subjectFactory=r,i}}var Gr=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var n=this.selector,r=this.subjectFactory(),i=n(r).subscribe(t);return i.add(e.subscribe(r)),i},t}(),Yr=function(){function t(t){this.nextSources=t}return t.prototype.call=function(t,e){return e.subscribe(new Zr(t,this.nextSources))},t}(),Zr=function(t){function e(e,n){var r=t.call(this,e)||this;return r.destination=e,r.nextSources=n,r}return et(e,t),e.prototype.notifyError=function(t,e){this.subscribeToNextSource()},e.prototype.notifyComplete=function(t){this.subscribeToNextSource()},e.prototype._error=function(t){this.subscribeToNextSource(),this.unsubscribe()},e.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},e.prototype.subscribeToNextSource=function(){var t=this.nextSources.shift();if(t){var e=new je(this,void 0,void 0),n=this.destination;n.add(e);var r=De(this,t,void 0,void 0,e);r!==e&&n.add(r)}else this.destination.complete()},e}(Te),Qr=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Xr(t))},t}(),Xr=function(t){function e(e){var n=t.call(this,e)||this;return n.hasPrev=!1,n}return et(e,t),e.prototype._next=function(t){var e;this.hasPrev?e=[this.prev,t]:this.hasPrev=!0,this.prev=t,e&&this.destination.next(e)},e}(dt);function ti(t,e){return function(n){for(var r=n,i=0;i-1&&(this.count=n-1),e.subscribe(this._unsubscribeAndRecycle())}},e}(dt),ri=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new ii(t,this.notifier,e))},t}(),ii=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.notifier=n,i.source=r,i.sourceIsBeingSubscribedTo=!0,i}return et(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(e){if(!1===this.sourceIsBeingSubscribedTo)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next()}},e.prototype._unsubscribe=function(){var t=this.notifications,e=this.retriesSubscription;t&&(t.unsubscribe(),this.notifications=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype._unsubscribeAndRecycle=function(){var e=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=e,this},e.prototype.subscribeToRetries=function(){var e;this.notifications=new Mt;try{e=(0,this.notifier)(this.notifications)}catch(e){return t.prototype.complete.call(this)}this.retries=e,this.retriesSubscription=De(this,e)},e}(Te),oi=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new si(t,this.count,this.source))},t}(),si=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.count=n,i.source=r,i}return et(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.source,r=this.count;if(0===r)return t.prototype.error.call(this,e);r>-1&&(this.count=r-1),n.subscribe(this._unsubscribeAndRecycle())}},e}(dt),ui=function(){function t(t,e){this.notifier=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new ai(t,this.notifier,this.source))},t}(),ai=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.notifier=n,i.source=r,i}return et(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.errors,r=this.retries,i=this.retriesSubscription;if(r)this.errors=null,this.retriesSubscription=null;else{n=new Mt;try{r=(0,this.notifier)(n)}catch(e){return t.prototype.error.call(this,e)}i=De(this,r)}this._unsubscribeAndRecycle(),this.errors=n,this.retries=r,this.retriesSubscription=i,n.next(e)}},e.prototype._unsubscribe=function(){var t=this.errors,e=this.retriesSubscription;t&&(t.unsubscribe(),this.errors=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype.notifyNext=function(t,e,n,r,i){var o=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=o,this.source.subscribe(this)},e}(Te),ci=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new li(t),r=e.subscribe(n);return r.add(De(n,this.notifier)),r},t}(),li=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasValue=!1,e}return et(e,t),e.prototype._next=function(t){this.value=t,this.hasValue=!0},e.prototype.notifyNext=function(t,e,n,r,i){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(Te),hi=function(){function t(t,e){this.period=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new fi(t,this.period,this.scheduler))},t}(),fi=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.period=n,i.scheduler=r,i.hasValue=!1,i.add(r.schedule(di,n,{subscriber:i,period:n})),i}return et(e,t),e.prototype._next=function(t){this.lastValue=t,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(dt);function di(t){var e=t.subscriber,n=t.period;e.notifyNext(),this.schedule(t,n)}var pi=function(){function t(t,e){this.compareTo=t,this.comparator=e}return t.prototype.call=function(t,e){return e.subscribe(new bi(t,this.compareTo,this.comparator))},t}(),bi=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.compareTo=n,i.comparator=r,i._a=[],i._b=[],i._oneComplete=!1,i.destination.add(n.subscribe(new vi(e,i))),i}return et(e,t),e.prototype._next=function(t){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(t),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},e.prototype.checkValues=function(){for(var t=this._a,e=this._b,n=this.comparator;t.length>0&&e.length>0;){var r=t.shift(),i=e.shift(),o=!1;try{o=n?n(r,i):r===i}catch(t){this.destination.error(t)}o||this.emit(!1)}},e.prototype.emit=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype.nextB=function(t){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(t),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},e}(dt),vi=function(t){function e(e,n){var r=t.call(this,e)||this;return r.parent=n,r}return et(e,t),e.prototype._next=function(t){this.parent.nextB(t)},e.prototype._error=function(t){this.parent.error(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(dt);function mi(){return new Mt}var yi=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new gi(t,this.predicate,this.source))},t}(),gi=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.source=r,i.seenValue=!1,i.index=0,i}return et(e,t),e.prototype.applySingleValue=function(t){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=t)},e.prototype._next=function(t){var e=this.index++;this.predicate?this.tryNext(t,e):this.applySingleValue(t)},e.prototype.tryNext=function(t,e){try{this.predicate(t,e,this.source)&&this.applySingleValue(t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){var t=this.destination;this.index>0?(t.next(this.seenValue?this.singleValue:void 0),t.complete()):t.error(new we)},e}(dt),wi=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new _i(t,this.total))},t}(),_i=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return et(e,t),e.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},e}(dt),ki=function(){function t(t){if(this._skipCount=t,this._skipCount<0)throw new ge}return t.prototype.call=function(t,e){return 0===this._skipCount?e.subscribe(new dt(t)):e.subscribe(new xi(t,this._skipCount))},t}(),xi=function(t){function e(e,n){var r=t.call(this,e)||this;return r._skipCount=n,r._count=0,r._ring=new Array(n),r}return et(e,t),e.prototype._next=function(t){var e=this._skipCount,n=this._count++;if(n0?this.startWindowEvery:this.windowSize,n=this.destination,r=this.windowSize,i=this.windows,o=i.length,s=0;s=0&&u%e==0&&!this.closed&&i.shift().complete(),++this.count%e==0&&!this.closed){var a=new Mt;i.push(a),n.next(a)}},e.prototype._error=function(t){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(dt),eo=function(){function t(t,e,n,r){this.windowTimeSpan=t,this.windowCreationInterval=e,this.maxWindowSize=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new ro(t,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),no=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._numberOfNextedValues=0,e}return et(e,t),e.prototype.next=function(e){this._numberOfNextedValues++,t.prototype.next.call(this,e)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(Mt),ro=function(t){function e(e,n,r,i,o){var s=t.call(this,e)||this;s.destination=e,s.windowTimeSpan=n,s.windowCreationInterval=r,s.maxWindowSize=i,s.scheduler=o,s.windows=[];var u=s.openWindow();if(null!==r&&r>=0){var a={subscriber:s,window:u,context:null},c={windowTimeSpan:n,windowCreationInterval:r,subscriber:s,scheduler:o};s.add(o.schedule(so,n,a)),s.add(o.schedule(oo,r,c))}else{var l={subscriber:s,window:u,windowTimeSpan:n};s.add(o.schedule(io,n,l))}return s}return et(e,t),e.prototype._next=function(t){for(var e=this.windows,n=e.length,r=0;r=this.maxWindowSize&&this.closeWindow(i))}},e.prototype._error=function(t){for(var e=this.windows;e.length>0;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){for(var t=this.windows;t.length>0;){var e=t.shift();e.closed||e.complete()}this.destination.complete()},e.prototype.openWindow=function(){var t=new no;return this.windows.push(t),this.destination.next(t),t},e.prototype.closeWindow=function(t){t.complete();var e=this.windows;e.splice(e.indexOf(t),1)},e}(dt);function io(t){var e=t.subscriber,n=t.windowTimeSpan,r=t.window;r&&e.closeWindow(r),t.window=e.openWindow(),this.schedule(t,n)}function oo(t){var e=t.windowTimeSpan,n=t.subscriber,r=t.scheduler,i=t.windowCreationInterval,o=n.openWindow(),s={action:this,subscription:null},u={subscriber:n,window:o,context:s};s.subscription=r.schedule(so,e,u),this.add(s.subscription),this.schedule(t,i)}function so(t){var e=t.subscriber,n=t.window,r=t.context;r&&r.action&&r.subscription&&r.action.remove(r.subscription),e.closeWindow(n)}var uo,ao,co,lo,ho,fo,po,bo,vo=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new mo(t,this.openings,this.closingSelector))},t}(),mo=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.openings=n,i.closingSelector=r,i.contexts=[],i.add(i.openSubscription=De(i,n,n)),i}return et(e,t),e.prototype._next=function(t){var e=this.contexts;if(e)for(var n=e.length,r=0;r0){var s=o.indexOf(n);-1!==s&&o.splice(s,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(Te),ko=Object.freeze({__proto__:null,audit:wn,auditTime:function(t,e){return void 0===e&&(e=de),wn((function(){return hn(t,e)}))},buffer:function(t){return function(e){return e.lift(new xn(t))}},bufferCount:function(t,e){return void 0===e&&(e=null),function(n){return n.lift(new Mn(t,e))}},bufferTime:function(t){var e=arguments.length,n=de;Kt(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],e--);var r=null;e>=2&&(r=arguments[1]);var i=Number.POSITIVE_INFINITY;return e>=3&&(i=arguments[2]),function(e){return e.lift(new On(t,r,i,n))}},bufferToggle:function(t,e){return function(n){return n.lift(new Pn(t,e))}},bufferWhen:function(t){return function(e){return e.lift(new Dn(t))}},catchError:function(t){return function(e){var n=new Bn(t),r=e.lift(n);return n.caught=r}},combineAll:function(t){return function(e){return e.lift(new Be(t))}},combineLatest:function(){for(var t=[],e=0;e=2;return function(r){return r.pipe(rn((function(e,n){return n===t})),vr(1),n?$n(e):fr((function(){return new ge})))}},endWith:function(){for(var t=[],e=0;e=2;return function(r){return r.pipe(t?rn((function(e,n){return t(e,n,r)})):mt,vr(1),n?$n(e):fr((function(){return new we})))}},groupBy:function(t,e,n,r){return function(i){return i.lift(new At(t,e,n,r))}},ignoreElements:function(){return function(t){return t.lift(new jr)}},isEmpty:function(){return function(t){return t.lift(new Ar)}},last:function(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?rn((function(e,n){return t(e,n,r)})):mt,Rr(1),n?$n(e):fr((function(){return new we})))}},map:ke,mapTo:function(t){return function(e){return e.lift(new Br(t))}},materialize:function(){return function(t){return t.lift(new Wr)}},max:function(t){return Hr("function"==typeof t?function(e,n){return t(e,n)>0?e:n}:function(t,e){return t>e?t:e})},merge:function(){for(var t=[],e=0;e3)for(n=[n],r=3;r2&&(e.children=So.slice.call(arguments,2)),No(t.type,e,e.key||t.key,e.ref||t.ref,null)},createContext:function(t){var e={},n={__c:"__cC"+bo++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var r,i=this;return this.getChildContext||(r=[],this.getChildContext=function(){return e[n.__c]=i,e},this.shouldComponentUpdate=function(t){i.props.value!==t.value&&r.some((function(e){e.context=t.value,Po(e)}))},this.sub=function(t){r.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){r.splice(r.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Consumer.contextType=n,n},toChildArray:Lo,_unmount:zo,get options(){return uo}});function $o(t){var e,n,r="";if(t)if("object"==typeof t)if(Array.isArray(t))for(e=0;e=e.__.length&&e.__.push({}),e.__[t]}function os(t){return ss(ds,t)}function ss(t,e,n){var r=is(Yo++);return r.__c||(r.__c=Zo,r.__=[n?n(e):ds(void 0,e),function(e){var n=t(r.__[0],e);r.__[0]!==n&&(r.__[0]=n,r.__c.setState({}))}]),r.__}function us(t,e){var n=is(Yo++);fs(n.__H,e)&&(n.__=t,n.__H=e,Zo.__h.push(n))}function as(t,e){var n=is(Yo++);return fs(n.__H,e)?(n.__H=e,n.__h=t,n.__=t()):n.__}function cs(){Xo.some((function(t){if(t.__P)try{t.__H.__h.forEach(ls),t.__H.__h.forEach(hs),t.__H.__h=[]}catch(e){return t.__H.__h=[],uo.__e(e,t.__v),!0}})),Xo=[]}function ls(t){t.t&&t.t()}function hs(t){var e=t.__();"function"==typeof e&&(t.t=e)}function fs(t,e){return!t||e.some((function(e,n){return e!==t[n]}))}function ds(t,e){return"function"==typeof e?e(t):e}uo.__r=function(t){ts&&ts(t),Yo=0,(Zo=t.__c).__H&&(Zo.__H.__h.forEach(ls),Zo.__H.__h.forEach(hs),Zo.__H.__h=[])},uo.diffed=function(t){es&&es(t);var e=t.__c;if(e){var n=e.__H;n&&n.__h.length&&(1!==Xo.push(e)&&Qo===uo.requestAnimationFrame||((Qo=uo.requestAnimationFrame)||function(t){var e,n=function(){clearTimeout(r),cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);"undefined"!=typeof window&&(e=requestAnimationFrame(n))})(cs))}},uo.__c=function(t,e){e.some((function(t){try{t.__h.forEach(ls),t.__h=t.__h.filter((function(t){return!t.__||hs(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],uo.__e(n,t.__v)}})),ns&&ns(t,e)},uo.unmount=function(t){rs&&rs(t);var e=t.__c;if(e){var n=e.__H;if(n)try{n.__.forEach((function(t){return t.t&&t.t()}))}catch(t){uo.__e(t,e.__v)}}};var ps=Object.freeze({__proto__:null,useState:os,useReducer:ss,useEffect:function(t,e){var n=is(Yo++);fs(n.__H,e)&&(n.__=t,n.__H=e,Zo.__H.__h.push(n))},useLayoutEffect:us,useRef:function(t){return as((function(){return{current:t}}),[])},useImperativeHandle:function(t,e,n){us((function(){"function"==typeof t?t(e()):t&&(t.current=e())}),null==n?n:n.concat(t))},useMemo:as,useCallback:function(t,e){return as((function(){return t}),e)},useContext:function(t){var e=Zo.context[t.__c];if(!e)return t.__;var n=is(Yo++);return null==n.__&&(n.__=!0,e.sub(Zo)),e.props.value},useDebugValue:function(t,e){uo.useDebugValue&&uo.useDebugValue(e?e(t):t)},useErrorBoundary:function(t){var e=is(Yo++),n=os();return e.__=t,Zo.componentDidCatch||(Zo.componentDidCatch=function(t){e.__&&e.__(t),n[1](t)}),[n[0],function(){n[1](void 0)}]}}),bs=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default='.-walletlink-css-reset .-walletlink-link-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-walletlink-css-reset .-walletlink-link-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,.33);transition:opacity .25s}.-walletlink-css-reset .-walletlink-link-dialog-backdrop-hidden{opacity:0}.-walletlink-css-reset .-walletlink-link-dialog-box{display:flex;position:relative;flex-direction:column;background-color:#f6f6f6;border-radius:16px;box-shadow:0px 16px 24px rgba(0,0,0,.1),0px 0px 8px rgba(0,0,0,.05);transform:scale(1);transition:opacity .25s,transform .25s;overflow:hidden}.-walletlink-css-reset .-walletlink-link-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-walletlink-css-reset .-walletlink-link-dialog-box-content{padding:24px;text-align:center}.-walletlink-css-reset .-walletlink-link-dialog-box-content h3{display:block;margin-bottom:24px;text-align:left;text-transform:uppercase;font-size:22px;font-weight:bold;line-height:1.2;color:#000}.-walletlink-css-reset .-walletlink-link-dialog-box-content-qrcode{position:relative;display:block;margin-bottom:24px;background-color:#f6f6f6;padding:16px;border-radius:16px;box-shadow:4px 4px 8px rgba(0,0,0,.15),-8px -8px 8px #fff;overflow:hidden}.-walletlink-css-reset .-walletlink-link-dialog-box-content-qrcode-wrapper{display:block;width:232px;height:232px;padding:4px;border-radius:4px;background:#f4f4f4;margin-bottom:16px}.-walletlink-css-reset .-walletlink-link-dialog-box-content-qrcode-wrapper img{display:block;width:224px;height:224px}.-walletlink-css-reset .-walletlink-link-dialog-box-content-qrcode>p{display:block;color:gray;font-weight:bold;font-size:12px;text-align:center}.-walletlink-css-reset .-walletlink-link-dialog-box-content-qrcode-connecting{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;align-items:center;justify-content:center;background:rgba(246,246,246,.98)}.-walletlink-css-reset .-walletlink-link-dialog-box-content-qrcode-connecting p{margin-top:16px;color:#333;font-size:12px;font-weight:bold}.-walletlink-css-reset .-walletlink-link-dialog-box-content a{text-align:center;cursor:pointer;transition:color .1s;font-size:14px}.-walletlink-css-reset .-walletlink-link-dialog-box-content a,.-walletlink-css-reset .-walletlink-link-dialog-box-content a:link,.-walletlink-css-reset .-walletlink-link-dialog-box-content a:visited{color:#999}.-walletlink-css-reset .-walletlink-link-dialog-box-content a:hover,.-walletlink-css-reset .-walletlink-link-dialog-box-content a:active{color:#666;text-decoration:underline}.-walletlink-css-reset .-walletlink-link-dialog-box-cancel{position:absolute;-webkit-appearance:none;display:flex;align-items:center;justify-content:center;top:24px;right:24px;width:24px;height:24px;border-radius:12px;background-color:#e7e7e7;cursor:pointer}.-walletlink-css-reset .-walletlink-link-dialog-box-cancel-x{position:relative;display:block}.-walletlink-css-reset .-walletlink-link-dialog-box-cancel-x::before,.-walletlink-css-reset .-walletlink-link-dialog-box-cancel-x::after{content:"";position:absolute;display:block;top:-1px;left:-7px;width:14px;height:2px;background-color:#999;transition:background-color .2s}.-walletlink-css-reset .-walletlink-link-dialog-box-cancel-x::before{transform:rotate(45deg)}.-walletlink-css-reset .-walletlink-link-dialog-box-cancel-x::after{transform:rotate(135deg)}.-walletlink-css-reset .-walletlink-link-dialog-box-cancel:hover .-walletlink-link-dialog-box-cancel-x-a,.-walletlink-css-reset .-walletlink-link-dialog-box-cancel:hover .-walletlink-link-dialog-box-cancel-x-b{background-color:#000}.-walletlink-css-reset .-walletlink-link-dialog-container{display:block}.-walletlink-css-reset .-walletlink-link-dialog-container-hidden{display:none}.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box{background-color:#2a2a2a}.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-content h3{color:#ccc}.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-content-qrcode{background-color:#2a2a2a;box-shadow:4px 4px 8px rgba(0,0,0,.5),-8px -8px 8px #343434}.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-content-qrcode>p{color:#999}.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-content-qrcode-connecting{background:rgba(42,42,42,.98)}.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-content-qrcode-connecting p{color:#ddd}.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-content a,.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-content a:link,.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-content a:visited{color:#888}.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-content a:hover,.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-content a:active{color:#aaa}.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-cancel{background-color:#333}.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-cancel-x::before,.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-cancel-x::after{background-color:#aaa}.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-cancel:hover .-walletlink-link-dialog-box-cancel-x::before,.-walletlink-css-reset .-walletlink-link-dialog-container-dark .-walletlink-link-dialog-box-cancel:hover .-walletlink-link-dialog-box-cancel-x::after{background-color:#eee}'}));function vs(t){this.mode=ys.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,n=this.data.length;e65536?(r[0]=240|(1835008&i)>>>18,r[1]=128|(258048&i)>>>12,r[2]=128|(4032&i)>>>6,r[3]=128|63&i):i>2048?(r[0]=224|(61440&i)>>>12,r[1]=128|(4032&i)>>>6,r[2]=128|63&i):i>128?(r[0]=192|(1984&i)>>>6,r[1]=128|63&i):r[0]=i,this.parsedData.push(r)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function ms(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Object(v.c)(bs),vs.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,n=this.parsedData.length;e=7&&this.setupTypeNumber(t),null==this.dataCache&&(this.dataCache=ms.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var n=-1;n<=7;n++)if(!(t+n<=-1||this.moduleCount<=t+n))for(var r=-1;r<=7;r++)e+r<=-1||this.moduleCount<=e+r||(this.modules[t+n][e+r]=0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4)},getBestMaskPattern:function(){for(var t=0,e=0,n=0;n<8;n++){this.makeImpl(!0,n);var r=gs.getLostPoint(this);(0==n||t>r)&&(t=r,e=n)}return e},createMovieClip:function(t,e,n){var r=t.createEmptyMovieClip(e,n);this.make();for(var i=0;i>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(n=0;n<18;n++)r=!t&&1==(e>>n&1),this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r},setupTypeInfo:function(t,e){for(var n=this.errorCorrectLevel<<3|e,r=gs.getBCHTypeInfo(n),i=0;i<15;i++){var o=!t&&1==(r>>i&1);i<6?this.modules[i][8]=o:i<8?this.modules[i+1][8]=o:this.modules[this.moduleCount-15+i][8]=o}for(i=0;i<15;i++)o=!t&&1==(r>>i&1),i<8?this.modules[8][this.moduleCount-i-1]=o:i<9?this.modules[8][15-i-1+1]=o:this.modules[8][15-i-1]=o;this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var n=-1,r=this.moduleCount-1,i=7,o=0,s=this.moduleCount-1;s>0;s-=2)for(6==s&&s--;;){for(var u=0;u<2;u++)if(null==this.modules[r][s-u]){var a=!1;o>>i&1)),gs.getMask(e,r,s-u)&&(a=!a),this.modules[r][s-u]=a,-1==--i&&(o++,i=7)}if((r+=n)<0||this.moduleCount<=r){r-=n,n=-n;break}}}},ms.PAD0=236,ms.PAD1=17,ms.createData=function(t,e,n){for(var r=xs.getRSBlocks(t,e),i=new Ss,o=0;o8*u)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+8*u+")");for(i.getLengthInBits()+4<=8*u&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*u||(i.put(ms.PAD0,8),i.getLengthInBits()>=8*u));)i.put(ms.PAD1,8);return ms.createBytes(i,r)},ms.createBytes=function(t,e){for(var n=0,r=0,i=0,o=new Array(e.length),s=new Array(e.length),u=0;u=0?f.get(d):0}}var p=0;for(l=0;l=0;)e^=gs.G15<=0;)e^=gs.G18<>>=1;return e},getPatternPosition:function(t){return gs.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,n){switch(t){case 0:return(e+n)%2==0;case 1:return e%2==0;case 2:return n%3==0;case 3:return(e+n)%3==0;case 4:return(Math.floor(e/2)+Math.floor(n/3))%2==0;case 5:return e*n%2+e*n%3==0;case 6:return(e*n%2+e*n%3)%2==0;case 7:return(e*n%3+(e+n)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new ks([1],0),n=0;n5&&(n+=3+o-5)}for(r=0;r=256;)t-=255;return ws.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},_s=0;_s<8;_s++)ws.EXP_TABLE[_s]=1<<_s;for(_s=8;_s<256;_s++)ws.EXP_TABLE[_s]=ws.EXP_TABLE[_s-4]^ws.EXP_TABLE[_s-5]^ws.EXP_TABLE[_s-6]^ws.EXP_TABLE[_s-8];for(_s=0;_s<255;_s++)ws.LOG_TABLE[ws.EXP_TABLE[_s]]=_s;function ks(t,e){if(null==t.length)throw new Error(t.length+"/"+e);for(var n=0;n>>7-t%8&1)},put:function(t,e){for(var n=0;n>>e-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Ms=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function Es(t){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M"},"string"==typeof t&&(t={content:t}),t)for(var e in t)this.options[e]=t[e];if("string"!=typeof this.options.content)throw new Error("Expected 'content' as string!");if(0===this.options.content.length)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0&&this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");var n=this.options.content,r=function(t,e){for(var n=function(t){var e=encodeURI(t).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return e.length+(e.length!=t?3:0)}(t),r=1,i=0,o=0,s=Ms.length;o<=s;o++){var u=Ms[o];if(!u)throw new Error("Content too long: expected "+i+" but got "+n);switch(e){case"L":i=u[0];break;case"M":i=u[1];break;case"Q":i=u[2];break;case"H":i=u[3];break;default:throw new Error("Unknwon error correction level: "+e)}if(n<=i)break;r++}if(r>Ms.length)throw new Error("Content too long");return r}(n,this.options.ecl),i=function(t){switch(t){case"L":return 1;case"M":return 0;case"Q":return 3;case"H":return 2;default:throw new Error("Unknwon error correction level: "+t)}}(this.options.ecl);this.qrcode=new ms(r,i),this.qrcode.addData(n),this.qrcode.make()}Es.prototype.svg=function(t){var e=this.options||{},n=this.qrcode.modules;void 0===t&&(t={container:e.container||"svg"});for(var r=void 0===e.pretty||!!e.pretty,i=r?" ":"",o=r?"\r\n":"",s=e.width,u=e.height,a=n.length,c=s/(a+2*e.padding),l=u/(a+2*e.padding),h=void 0!==e.join&&!!e.join,f=void 0!==e.swap&&!!e.swap,d=void 0===e.xmlDeclaration||!!e.xmlDeclaration,p=void 0!==e.predefined&&!!e.predefined,b=p?i+''+o:"",v=i+''+o,m="",y="",g=0;g'+o:i+''+o}h&&(m=i+'');var E="";switch(t.container){case"svg":d&&(E+=''+o),E+=''+o,E+=b+v+m,E+="";break;case"svg-viewbox":d&&(E+=''+o),E+=''+o,E+=b+v+m,E+="";break;case"g":E+=''+o,E+=b+v+m,E+="";break;default:E+=(b+v+m).replace(/^\s+/,"")}return E};var Cs=Es,Os=Object(v.b)((function(e,n){var r=v.d&&v.d.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var i=r(Cs);n.QRCode=function(e){var n=ps.useState(""),r=Object(h.a)(n,2),o=r[0],s=r[1];return ps.useEffect((function(){var n,r,o=new i.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:null!==(n=e.width)&&void 0!==n?n:256,height:null!==(r=e.height)&&void 0!==r?r:256,padding:0}),u=t.from(o.svg(),"utf8").toString("base64");s("data:image/svg+xml;base64,".concat(u))})),o?Jo.h("img",{src:o,alt:"QR Code"}):null}}));Object(v.c)(Os),Os.QRCode;var Ns=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=".-walletlink-css-reset .-walletlink-spinner{display:inline-block}.-walletlink-css-reset .-walletlink-spinner svg{display:inline-block;animation:2s linear infinite -walletlink-spinner-svg}.-walletlink-css-reset .-walletlink-spinner svg circle{animation:1.9s ease-in-out infinite both -walletlink-spinner-circle;display:block;fill:transparent;stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -walletlink-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -walletlink-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}"}));Object(v.c)(Ns);var Ts=Object(v.b)((function(t,e){var n=v.d&&v.d.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(Ns);e.Spinner=function(t){var e,n=null!==(e=t.size)&&void 0!==e?e:64,i=t.color||"#000";return Jo.h("div",{class:"-walletlink-spinner"},Jo.h("style",null,r.default),Jo.h("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:n,height:n}},Jo.h("circle",{style:{cx:50,cy:50,r:45,stroke:i}})))}}));Object(v.c)(Ts),Ts.Spinner;var js=Object(v.b)((function(t,e){var n=v.d&&v.d.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(Go),i=n(bs);e.LinkDialog=function(t){var e=ps.useState(!t.isOpen),n=Object(h.a)(e,2),u=n[0],a=n[1],c=ps.useState(!t.isOpen),l=Object(h.a)(c,2),f=l[0],d=l[1];return ps.useEffect((function(){var e=t.isOpen,n=[window.setTimeout((function(){d(!e)}),10)];return e?a(!1):n.push(window.setTimeout((function(){a(!0)}),360)),function(){n.forEach(window.clearTimeout)}}),[t.isOpen]),Jo.h("div",{class:r.default("-walletlink-link-dialog-container",t.darkMode&&"-walletlink-link-dialog-container-dark",u&&"-walletlink-link-dialog-container-hidden")},Jo.h("style",null,i.default),Jo.h("div",{class:r.default("-walletlink-link-dialog-backdrop",f&&"-walletlink-link-dialog-backdrop-hidden")}),Jo.h("div",{class:"-walletlink-link-dialog"},Jo.h("div",{class:r.default("-walletlink-link-dialog-box",f&&"-walletlink-link-dialog-box-hidden")},Jo.h(o,{darkMode:t.darkMode,version:t.version,sessionId:t.sessionId,sessionSecret:t.sessionSecret,walletLinkUrl:t.walletLinkUrl,isConnected:t.isConnected}),t.onCancel&&Jo.h(s,{onClick:t.onCancel}))))};var o=function(t){var e=window.encodeURIComponent(t.walletLinkUrl),n="".concat(t.walletLinkUrl,"/#/link?id=").concat(t.sessionId,"&secret=").concat(t.sessionSecret,"&server=").concat(e,"&v=1");return Jo.h("div",{class:"-walletlink-link-dialog-box-content"},Jo.h("h3",null,"Scan to",Jo.h("br",null)," Connect"),Jo.h("div",{class:"-walletlink-link-dialog-box-content-qrcode"},Jo.h("div",{class:"-walletlink-link-dialog-box-content-qrcode-wrapper"},Jo.h(Os.QRCode,{content:n,width:224,height:224,fgColor:"#000",bgColor:"transparent"})),Jo.h("input",{type:"hidden",value:n}),!t.isConnected&&Jo.h("div",{class:"-walletlink-link-dialog-box-content-qrcode-connecting"},Jo.h(Ts.Spinner,{size:128,color:t.darkMode?"#fff":"#000"}),Jo.h("p",null,"Connecting...")),Jo.h("p",{title:"WalletLink v".concat(t.version)},"Powered by WalletLink")),Jo.h("a",{href:"".concat(t.walletLinkUrl,"/#/wallets"),target:"_blank",rel:"noopener"},"Don\u2019t have a wallet app?"))},s=function(t){return Jo.h("button",{class:"-walletlink-link-dialog-box-cancel",onClick:t.onClick},Jo.h("div",{class:"-walletlink-link-dialog-box-cancel-x"}))}}));Object(v.c)(js),js.LinkDialog;var Is=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinkFlow=function(){function t(e){Object(f.a)(this,t),this.subscriptions=new gn.Subscription,this.isConnected=!1,this.isOpen=!1,this.onCancel=null,this.root=null,this.darkMode=e.darkMode,this.version=e.version,this.sessionId=e.sessionId,this.sessionSecret=e.sessionSecret,this.walletLinkUrl=e.walletLinkUrl,this.connected$=e.connected$}return Object(d.a)(t,[{key:"attach",value:function(t){var e=this;this.root=document.createElement("div"),this.root.className="-walletlink-link-flow-root",t.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe((function(t){e.isConnected!==t&&(e.isConnected=t,e.render())})))}},{key:"detach",value:function(){var t;this.root&&(this.subscriptions.unsubscribe(),Jo.render(null,this.root),null===(t=this.root.parentElement)||void 0===t||t.removeChild(this.root))}},{key:"open",value:function(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}},{key:"close",value:function(){this.isOpen=!1,this.onCancel=null,this.render()}},{key:"render",value:function(){this.root&&Jo.render(Jo.h(js.LinkDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,walletLinkUrl:this.walletLinkUrl,isOpen:this.isOpen,isConnected:this.isConnected,onCancel:this.onCancel}),this.root)}}]),t}()}));Object(v.c)(Is),Is.LinkFlow;var As=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default='.-walletlink-css-reset .-walletlink-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-walletlink-css-reset .-walletlink-snackbar-item{background-color:#fff;border-radius:8px;box-shadow:0px 16px 24px rgba(0,0,0,.06),0px 0px 8px rgba(0,0,0,.04);display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:hidden;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-walletlink-css-reset .-walletlink-snackbar-item-content{align-items:center;cursor:pointer;display:flex;flex-direction:row;justify-content:space-between;padding:8px 8px 8px 16px;user-select:none}.-walletlink-css-reset .-walletlink-snackbar-item-content-message{color:#000;font-size:14px;line-height:1.5}.-walletlink-css-reset .-walletlink-snackbar-item-content-chevron{position:relative;display:block;margin:0 8px;transition:transform .05s}.-walletlink-css-reset .-walletlink-snackbar-item-content-chevron::before{position:relative;top:-2px;content:"";display:block;border-top:2px solid #000;border-left:2px solid #000;width:8px;height:8px;transform:rotate(-135deg)}.-walletlink-css-reset .-walletlink-snackbar-item-progress-bar{display:block;height:2px;position:relative}.-walletlink-css-reset .-walletlink-snackbar-item-progress-bar::before{animation:-walletlink-snackbar-progressbar 2s linear infinite;background-image:linear-gradient(to right, rgba(22, 82, 240, 0) 0%, #1652f0 100%);content:"";height:100%;left:-100%;position:absolute;width:100%}.-walletlink-css-reset .-walletlink-snackbar-item-actions{display:none;flex-direction:column;border-top:1px solid #f5f7f8;padding:2px 16px 8px}.-walletlink-css-reset .-walletlink-snackbar-item-actions-item{margin:8px 0}.-walletlink-css-reset .-walletlink-snackbar-item-actions-item-info{color:#888;font-size:14px;margin:0 8px 0 0}.-walletlink-css-reset .-walletlink-snackbar-item-actions-item-button{-webkit-appearance:none;-webkit-text-fill-color:#1652f0;background:transparent;color:#1652f0;cursor:pointer;display:inline;font-size:14px;margin:0;padding:0;transition:opacity .25s}.-walletlink-css-reset .-walletlink-snackbar-item-actions-item-button:active{opacity:.6}.-walletlink-css-reset .-walletlink-snackbar-item-hidden{opacity:0;text-align:left;transform:translateX(25%)}.-walletlink-css-reset .-walletlink-snackbar-item-expanded .-walletlink-snackbar-item-content-chevron{transform:rotate(180deg)}.-walletlink-css-reset .-walletlink-snackbar-item-expanded .-walletlink-snackbar-item-actions{display:flex}.-walletlink-css-reset .-walletlink-snackbar-container-dark .-walletlink-snackbar-item{background-color:#2a2a2a}.-walletlink-css-reset .-walletlink-snackbar-container-dark .-walletlink-snackbar-item-content-message{color:#999}.-walletlink-css-reset .-walletlink-snackbar-container-dark .-walletlink-snackbar-item-content-chevron::before{border-top:2px solid #ccc;border-left:2px solid #ccc}.-walletlink-css-reset .-walletlink-snackbar-container-dark .-walletlink-snackbar-item-progress-bar::before{animation:-walletlink-snackbar-progressbar-dark 2s linear infinite;background-image:linear-gradient(to right, rgba(69, 120, 255, 0) 0%, #4578ff 100%)}.-walletlink-css-reset .-walletlink-snackbar-container-dark .-walletlink-snackbar-item-actions{border-top:1px solid #343434}.-walletlink-css-reset .-walletlink-snackbar-container-dark .-walletlink-snackbar-item-actions-item-button{-webkit-text-fill-color:#ccc;color:#ccc}@keyframes -walletlink-snackbar-progressbar{0%{left:0;width:0%;background-image:linear-gradient(to right, rgba(22, 82, 240, 0) 0%, #1652f0 100%)}25%{left:0;width:100%}50%{left:100%;width:0%;background-image:linear-gradient(to right, rgba(22, 82, 240, 0) 0%, #1652f0 100%)}50.01%{background-image:linear-gradient(to left, rgba(22, 82, 240, 0) 0%, #1652f0 100%)}75%{left:0;width:100%}100%{left:0;width:0%;background-image:linear-gradient(to left, rgba(22, 82, 240, 0) 0%, #1652f0 100%)}}@keyframes -walletlink-snackbar-progressbar-dark{0%{left:0;width:0%;background-image:linear-gradient(to right, rgba(69, 120, 255, 0) 0%, #4578ff 100%)}25%{left:0;width:100%}50%{left:100%;width:0%;background-image:linear-gradient(to right, rgba(69, 120, 255, 0) 0%, #4578ff 100%)}50.01%{background-image:linear-gradient(to left, rgba(69, 120, 255, 0) 0%, #4578ff 100%)}75%{left:0;width:100%}100%{left:0;width:0%;background-image:linear-gradient(to left, rgba(69, 120, 255, 0) 0%, #4578ff 100%)}}'}));Object(v.c)(As);var Ps=Object(v.b)((function(t,e){var n=v.d&&v.d.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(Go),i=n(As);e.Snackbar=function(){function t(e){Object(f.a)(this,t),this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=e.darkMode}return Object(d.a)(t,[{key:"attach",value:function(t){this.root=document.createElement("div"),this.root.className="-walletlink-snackbar-root",t.appendChild(this.root),this.render()}},{key:"presentItem",value:function(t){var e=this,n=this.nextItemKey++;return this.items.set(n,t),this.render(),function(){e.items.delete(n),e.render()}}},{key:"clear",value:function(){this.items.clear(),this.render()}},{key:"render",value:function(){this.root&&Jo.render(Jo.h(o,{darkMode:this.darkMode},Array.from(this.items.entries()).map((function(t){var e=Object(h.a)(t,2),n=e[0],r=e[1];return Jo.h(s,Object.assign({},r,{key:n}))}))),this.root)}}]),t}();var o=function(t){return Jo.h("div",{class:r.default("-walletlink-snackbar-container",t.darkMode&&"-walletlink-snackbar-container-dark")},Jo.h("style",null,i.default),Jo.h("div",{class:"-walletlink-snackbar"},t.children))},s=function(t){var e=t.message,n=t.showProgressBar,i=t.actions,o=ps.useState(!0),s=Object(h.a)(o,2),u=s[0],a=s[1],c=ps.useState(!1),l=Object(h.a)(c,2),f=l[0],d=l[1];return ps.useEffect((function(){var t=[window.setTimeout((function(){a(!1)}),1),window.setTimeout((function(){d(!0)}),1e4)];return function(){t.forEach(window.clearTimeout)}})),Jo.h("div",{class:r.default("-walletlink-snackbar-item",u&&"-walletlink-snackbar-item-hidden",f&&"-walletlink-snackbar-item-expanded")},Jo.h("div",{class:"-walletlink-snackbar-item-content",onClick:function(){d(!f)}},Jo.h("div",{class:"-walletlink-snackbar-item-content-message"},e),Jo.h("div",{class:"-walletlink-snackbar-item-content-chevron",title:"Expand"})),n&&Jo.h("div",{class:"-walletlink-snackbar-item-progress-bar"}),i&&i.length>0&&Jo.h("div",{class:"-walletlink-snackbar-item-actions"},i.map((function(t,e){return Jo.h("div",{class:"-walletlink-snackbar-item-actions-item",key:e},Jo.h("span",{class:"-walletlink-snackbar-item-actions-item-info"},t.info),Jo.h("button",{class:"-walletlink-snackbar-item-actions-item-button",onClick:t.onClick},t.buttonLabel))}))))}}));Object(v.c)(Ps),Ps.Snackbar;var Rs=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ClientMessageHostSession=function(t){return Object.assign({type:"HostSession"},t)},e.ClientMessageIsLinked=function(t){return Object.assign({type:"IsLinked"},t)},e.ClientMessageGetSessionConfig=function(t){return Object.assign({type:"GetSessionConfig"},t)},e.ClientMessageSetSessionConfig=function(t){return Object.assign({type:"SetSessionConfig"},t)},e.ClientMessagePublishEvent=function(t){return Object.assign({type:"PublishEvent"},t)}}));Object(v.c)(Rs),Rs.ClientMessageHostSession,Rs.ClientMessageIsLinked,Rs.ClientMessageGetSessionConfig,Rs.ClientMessageSetSessionConfig,Rs.ClientMessagePublishEvent;var Ds=Object(v.b)((function(t,e){var n;Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"}(n=e.ConnectionState||(e.ConnectionState={})),e.RxWebSocket=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:WebSocket;Object(f.a)(this,t),this.WebSocketClass=r,this.webSocket=null,this.connectionStateSubject=new gn.BehaviorSubject(n.DISCONNECTED),this.incomingDataSubject=new gn.Subject,this.url=e.replace(/^http/,"ws")}return Object(d.a)(t,[{key:"connect",value:function(){var t=this;return this.webSocket?gn.throwError(new Error("webSocket object is not null")):new gn.Observable((function(e){var r;try{t.webSocket=r=new t.WebSocketClass(t.url)}catch(r){return void e.error(r)}t.connectionStateSubject.next(n.CONNECTING),r.onclose=function(r){t.clearWebSocket(),e.error(new Error("websocket error ".concat(r.code,": ").concat(r.reason))),t.connectionStateSubject.next(n.DISCONNECTED)},r.onopen=function(r){e.next(),e.complete(),t.connectionStateSubject.next(n.CONNECTED)},r.onmessage=function(e){t.incomingDataSubject.next(e.data)}})).pipe(ko.take(1))}},{key:"disconnect",value:function(){var t=this.webSocket;if(t){this.clearWebSocket(),this.connectionStateSubject.next(n.DISCONNECTED);try{t.close()}catch(t){}}}},{key:"connectionState$",get:function(){return this.connectionStateSubject.asObservable()}},{key:"incomingData$",get:function(){return this.incomingDataSubject.asObservable()}},{key:"incomingJSONData$",get:function(){return this.incomingData$.pipe(ko.flatMap((function(t){var e;try{e=JSON.parse(t)}catch(t){return gn.empty()}return gn.of(e)})))}},{key:"sendData",value:function(t){var e=this.webSocket;if(!e)throw new Error("websocket is not connected");e.send(t)}},{key:"clearWebSocket",value:function(){var t=this.webSocket;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}]),t}()}));Object(v.c)(Ds),Ds.ConnectionState,Ds.RxWebSocket;var Ls=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.isServerMessageFail=function(t){return t&&"Fail"===t.type&&"number"==typeof t.id&&"string"==typeof t.sessionId&&"string"==typeof t.error}}));Object(v.c)(Ls),Ls.isServerMessageFail;var Bs=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.WalletLinkConnection=function(){function e(t,n,r){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:WebSocket;Object(f.a)(this,e),this.sessionId=t,this.sessionKey=n,this.subscriptions=new gn.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=w.IntNumber(1),this.connectedSubject=new gn.BehaviorSubject(!1),this.linkedSubject=new gn.BehaviorSubject(!1),this.sessionConfigSubject=new gn.ReplaySubject(1);var s=new Ds.RxWebSocket(r+"/rpc",o);this.ws=s,this.subscriptions.add(s.connectionState$.pipe(ko.skip(1),ko.filter((function(t){return t===Ds.ConnectionState.DISCONNECTED&&!i.destroyed})),ko.delay(5e3),ko.filter((function(t){return!i.destroyed})),ko.flatMap((function(t){return s.connect()})),ko.retry()).subscribe()),this.subscriptions.add(s.connectionState$.pipe(ko.skip(2),ko.switchMap((function(t){return gn.iif((function(){return t===Ds.ConnectionState.CONNECTED}),i.authenticate().pipe(ko.tap((function(t){return i.sendIsLinked()})),ko.tap((function(t){return i.sendGetSessionConfig()})),ko.map((function(t){return!0}))),gn.of(!1))})),ko.distinctUntilChanged(),ko.catchError((function(t){return gn.of(!1)}))).subscribe((function(t){return i.connectedSubject.next(t)}))),this.subscriptions.add(s.connectionState$.pipe(ko.skip(1),ko.switchMap((function(t){return gn.iif((function(){return t===Ds.ConnectionState.CONNECTED}),gn.timer(0,1e4))}))).subscribe((function(t){return 0===t?i.updateLastHeartbeat():i.heartbeat()}))),this.subscriptions.add(s.incomingData$.pipe(ko.filter((function(t){return"h"===t}))).subscribe((function(t){return i.updateLastHeartbeat()}))),this.subscriptions.add(s.incomingJSONData$.pipe(ko.filter((function(t){return["IsLinkedOK","Linked"].includes(t.type)}))).subscribe((function(t){var e=t;i.linkedSubject.next(e.linked||e.onlineGuests>0)}))),this.subscriptions.add(s.incomingJSONData$.pipe(ko.filter((function(t){return["GetSessionConfigOK","SessionConfigUpdated"].includes(t.type)}))).subscribe((function(t){var e=t;i.sessionConfigSubject.next({webhookId:e.webhookId,webhookUrl:e.webhookUrl,metadata:e.metadata})})))}return Object(d.a)(e,[{key:"connect",value:function(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect().subscribe()}},{key:"destroy",value:function(){this.subscriptions.unsubscribe(),this.ws.disconnect(),this.destroyed=!0}},{key:"connected$",get:function(){return this.connectedSubject.asObservable()}},{key:"onceConnected$",get:function(){return this.connected$.pipe(ko.filter((function(t){return t})),ko.take(1),ko.map((function(){})))}},{key:"linked$",get:function(){return this.linkedSubject.asObservable()}},{key:"onceLinked$",get:function(){return this.linked$.pipe(ko.filter((function(t){return t})),ko.take(1),ko.map((function(){})))}},{key:"sessionConfig$",get:function(){return this.sessionConfigSubject.asObservable()}},{key:"incomingEvent$",get:function(){return this.ws.incomingJSONData$.pipe(ko.filter((function(t){if("Event"!==t.type)return!1;var e=t;return"string"==typeof e.sessionId&&"string"==typeof e.eventId&&"string"==typeof e.event&&"string"==typeof e.data})),ko.map((function(t){return t})))}},{key:"setSessionMetadata",value:function(t,e){var n=this,i=Rs.ClientMessageSetSessionConfig({id:w.IntNumber(this.nextReqId++),sessionId:this.sessionId,metadata:Object(r.a)({},t,e)});return this.onceConnected$.pipe(ko.flatMap((function(t){return n.makeRequest(i)})),ko.map((function(t){if(Ls.isServerMessageFail(t))throw new Error(t.error||"failed to set session metadata")})))}},{key:"publishEvent",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=Rs.ClientMessagePublishEvent({id:w.IntNumber(this.nextReqId++),sessionId:this.sessionId,event:t,data:e,callWebhook:r});return this.onceLinked$.pipe(ko.flatMap((function(t){return n.makeRequest(i)})),ko.map((function(t){if(Ls.isServerMessageFail(t))throw new Error(t.error||"failed to publish event");return t.eventId})))}},{key:"sendData",value:function(t){this.ws.sendData(JSON.stringify(t))}},{key:"updateLastHeartbeat",value:function(){this.lastHeartbeatResponse=Date.now()}},{key:"heartbeat",value:function(){if(Date.now()-this.lastHeartbeatResponse>2e4)this.ws.disconnect();else try{this.ws.sendData("h")}catch(t){}}},{key:"makeRequest",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6e4,n=t.id;try{this.sendData(t)}catch(t){return gn.throwError(t)}return this.ws.incomingJSONData$.pipe(ko.timeoutWith(e,gn.throwError(new Error("request ".concat(n," timed out")))),ko.filter((function(t){return t.id===n})),ko.take(1))}},{key:"authenticate",value:function(){var t=Rs.ClientMessageHostSession({id:w.IntNumber(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(t).pipe(ko.map((function(t){if(Ls.isServerMessageFail(t))throw new Error(t.error||"failed to authentcate")})))}},{key:"sendIsLinked",value:function(){var t=Rs.ClientMessageIsLinked({id:w.IntNumber(this.nextReqId++),sessionId:this.sessionId});this.sendData(t)}},{key:"sendGetSessionConfig",value:function(){var t=Rs.ClientMessageGetSessionConfig({id:w.IntNumber(this.nextReqId++),sessionId:this.sessionId});this.sendData(t)}}]),e}()}));Object(v.c)(Bs),Bs.WalletLinkConnection;var Fs=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ScopedLocalStorage=function(){function t(e){Object(f.a)(this,t),this.scope=e}return Object(d.a)(t,[{key:"setItem",value:function(t,e){localStorage.setItem(this.scopedKey(t),e)}},{key:"getItem",value:function(t){return localStorage.getItem(this.scopedKey(t))}},{key:"removeItem",value:function(t){localStorage.removeItem(this.scopedKey(t))}},{key:"clear",value:function(){for(var t=this.scopedKey(""),e=[],n=0;n=0;u--)(i=t[u])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},r=v.d&&v.d.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=v.d&&v.d.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=r(X),s=r(m.c),u=r(y.a),a=i(Ws),c=function(){function t(e){Object(f.a)(this,t),this.appName="",this.appLogoUrl=null,this.attached=!1,this.walletLinkUrl=e.walletLinkUrl;var n=u.default.parse(this.walletLinkUrl);this.walletLinkOrigin="".concat(n.protocol,"//").concat(n.host),this.storage=new Fs.ScopedLocalStorage("-walletlink:".concat(this.walletLinkOrigin)),this.session=qs.Session.load(this.storage)||new qs.Session(this.storage).save(),this.connection=new Bs.WalletLinkConnection(this.session.id,this.session.key,this.walletLinkUrl),this.connection.incomingEvent$.pipe(ko.filter((function(t){return"Web3Response"===t.event}))).subscribe({next:this.handleIncomingEvent}),this.connection.sessionConfig$.pipe(ko.filter((function(t){return!!t.metadata&&"1"===t.metadata.__destroyed}))).subscribe({next:this.resetAndReload}),this.snackbar=new Ps.Snackbar({darkMode:e.darkMode}),this.linkFlow=new Is.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:this.session.id,sessionSecret:this.session.secret,walletLinkUrl:this.walletLinkUrl,connected$:this.connection.connected$}),this.connection.connect()}return Object(d.a)(t,[{key:"resetAndReload",value:function(){var t=this;this.connection.setSessionMetadata("__destroyed","1").pipe(ko.timeout(1e3),ko.catchError((function(t){return gn.of(null)}))).subscribe((function(e){t.connection.destroy(),t.storage.clear(),document.location.reload()}))}},{key:"setAppInfo",value:function(t,e){this.appName=t,this.appLogoUrl=e}},{key:"attach",value:function(t){if(this.attached)throw new Error("WalletLinkRelay is already attached");var e=document.createElement("div");e.className="-walletlink-css-reset",t.appendChild(e),this.linkFlow.attach(e),this.snackbar.attach(e)}},{key:"getStorageItem",value:function(t){return this.storage.getItem(t)}},{key:"setStorageItem",value:function(t,e){this.storage.setItem(t,e)}},{key:"requestEthereumAccounts",value:function(){return this.sendRequest({method:Us.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}})}},{key:"signEthereumMessage",value:function(t,e,n,r){return this.sendRequest({method:Us.Web3Method.signEthereumMessage,params:{message:_.hexStringFromBuffer(t,!0),address:e,addPrefix:n,typedDataJson:r||null}})}},{key:"ethereumAddressFromSignedMessage",value:function(t,e,n){return this.sendRequest({method:Us.Web3Method.ethereumAddressFromSignedMessage,params:{message:_.hexStringFromBuffer(t,!0),signature:_.hexStringFromBuffer(e,!0),addPrefix:n}})}},{key:"signEthereumTransaction",value:function(t){return this.sendRequest({method:Us.Web3Method.signEthereumTransaction,params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:_.bigIntStringFromBN(t.weiValue),data:_.hexStringFromBuffer(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?_.bigIntStringFromBN(t.gasPriceInWei):null,gasLimit:t.gasLimit?_.bigIntStringFromBN(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}},{key:"signAndSubmitEthereumTransaction",value:function(t){return this.sendRequest({method:Us.Web3Method.signEthereumTransaction,params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:_.bigIntStringFromBN(t.weiValue),data:_.hexStringFromBuffer(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?_.bigIntStringFromBN(t.gasPriceInWei):null,gasLimit:t.gasLimit?_.bigIntStringFromBN(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}},{key:"submitEthereumTransaction",value:function(t,e){return this.sendRequest({method:Us.Web3Method.submitEthereumTransaction,params:{signedTransaction:_.hexStringFromBuffer(t,!0),chainId:e}})}},{key:"scanQRCode",value:function(t){return this.sendRequest({method:Us.Web3Method.scanQRCode,params:{regExp:t}})}},{key:"arbitraryRequest",value:function(t){return this.sendRequest({method:Us.Web3Method.arbitrary,params:{data:t}})}},{key:"sendRequest",value:function(e){var n=this;return new Promise((function(r,i){var o=null,u=s.default.randomBytes(8).toString("hex"),a=function(){n.publishWeb3RequestCanceledEvent(u),n.handleWeb3ResponseMessage(Js.Web3ResponseMessage({id:u,response:Ks.ErrorResponse(e.method,"User rejected request")})),null==o||o()};if(e.method===Us.Web3Method.requestEthereumAccounts)n.linkFlow.open({onCancel:a}),t.accountRequestCallbackIds.add(u);else{var c={message:"Pushed a request to your wallet...",showProgressBar:!0,actions:[{info:"Made a mistake?",buttonLabel:"Cancel",onClick:a},{info:"Not receiving requests?",buttonLabel:"Reset Connection",onClick:n.resetAndReload}]};o=n.snackbar.presentItem(c)}t.callbacks.set(u,(function(t){if(n.linkFlow.close(),null==o||o(),t.errorMessage)return i(new Error(t.errorMessage));r(t)})),n.publishWeb3RequestEvent(u,e)}))}},{key:"publishWeb3RequestEvent",value:function(t,e){var n=this,r=Hs.Web3RequestMessage({id:t,request:e});this.publishEvent("Web3Request",r,!0).subscribe({error:function(t){n.handleWeb3ResponseMessage(Js.Web3ResponseMessage({id:r.id,response:{method:r.request.method,errorMessage:t.message}}))}})}},{key:"publishWeb3RequestCanceledEvent",value:function(t){var e=zs.Web3RequestCanceledMessage(t);this.publishEvent("Web3RequestCanceled",e,!1).subscribe()}},{key:"publishEvent",value:function(t,e,n){var r=a.encrypt(JSON.stringify(Object.assign(Object.assign({},e),{origin:location.origin})),this.session.secret);return this.connection.publishEvent(t,r,n)}},{key:"handleIncomingEvent",value:function(t){var e;try{e=JSON.parse(a.decrypt(t.data,this.session.secret))}catch(t){return}var n=Js.isWeb3ResponseMessage(e)?e:null;n&&this.handleWeb3ResponseMessage(n)}},{key:"handleWeb3ResponseMessage",value:function(e){var n=this,r=e.response;if(Ks.isRequestEthereumAccountsResponse(r))return Array.from(t.accountRequestCallbackIds.values()).forEach((function(t){return n.invokeCallback(Object.assign(Object.assign({},e),{id:t}))})),void t.accountRequestCallbackIds.clear();this.invokeCallback(e)}},{key:"invokeCallback",value:function(e){var n=t.callbacks.get(e.id);n&&(n(e.response),t.callbacks.delete(e.id))}}]),t}();c.callbacks=new Map,c.accountRequestCallbackIds=new Set,n([o.default],c.prototype,"resetAndReload",null),n([o.default],c.prototype,"handleIncomingEvent",null),e.WalletLinkRelay=c}));Object(v.c)($s),$s.WalletLinkRelay;var Gs=["cipher","cipherbrowser","coinbase","coinbasewallet","eth","ether","ethereum","etherium","injection","toshi","wallet","walletlink","web3"],Ys="dist/index.js",Zs="https://github.com/walletlink/walletlink.git",Qs={tsc:"tsc --noEmit --pretty",test:"jest","test:watch":"jest --watch",build:"node compile-assets.js && webpack --config webpack.config.js","build-chrome":"webpack --config webpack.config.chrome.js","build-npm":"tsc -p ./tsconfig.build.json","build:dev":"export WALLETLINK_URL='http://localhost:3000'; yarn build && yarn build-chrome","build:dev:watch":"nodemon -e 'ts,tsx,js,json,css,scss,svg' --ignore 'src/**/*-css.ts' --ignore 'src/**/*-svg.ts' --watch src/ --watch chrome/ --exec 'yarn build:dev'","build:prod":"yarn build && yarn build-chrome && yarn build-npm && cp ./package.json ../README.md ../LICENSE build/npm && cp -a src/vendor-js build/npm/dist && sed -i '' 's| \"private\": true,||g' build/npm/package.json",lint:"tslint -p . 'src/**/*.ts{,x}'","lint:watch":"nodemon -e ts,tsx,js,json,css,scss,svg --watch src/ --exec 'yarn tsc && yarn lint'"},Xs={"bind-decorator":"^1.0.11","bn.js":"^5.1.1",clsx:"^1.1.0",preact:"^10.3.3",rxjs:"^6.5.4"},tu={"@types/bn.js":"^4.11.6","@types/jest":"^25.1.3","@types/node":"^13.7.7","copy-webpack-plugin":"^5.1.1","core-js":"^3.6.4",glob:"^7.1.6",jest:"^25.1.0",nodemon:"^2.0.2","raw-loader":"^4.0.0","regenerator-runtime":"^0.13.3","rxjs-tslint":"^0.1.7",sass:"^1.26.2",svgo:"^1.3.2","ts-jest":"^25.2.1","ts-loader":"^6.2.1",tslib:"^1.11.1",tslint:"^6.0.0","tslint-config-prettier":"^1.18.0","tslint-config-security":"^1.16.0","tslint-microsoft-contrib":"^6.2.0",typescript:"^3.8.3",webpack:"^4.42.0","webpack-cli":"^3.3.11","whatwg-fetch":"^3.0.0"},eu={node:">= 10.0.0"},nu={transform:{"^.+\\.tsx?$":"ts-jest"},testEnvironment:"node",testPathIgnorePatterns:["/dist/","/node_modules/"],testRegex:"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",moduleFileExtensions:["ts","js","json"]},ru={name:"walletlink",version:"2.0.2",description:"WalletLink JavaScript SDK",keywords:Gs,main:Ys,types:"dist/index.d.ts",repository:Zs,author:"Coinbase, Inc.",license:"Apache-2.0",scripts:Qs,dependencies:Xs,devDependencies:tu,engines:eu,jest:nu},iu=Object(v.f)(Object.freeze({__proto__:null,name:"walletlink",version:"2.0.2",description:"WalletLink JavaScript SDK",keywords:Gs,main:Ys,types:"dist/index.d.ts",repository:Zs,author:"Coinbase, Inc.",license:"Apache-2.0",scripts:Qs,dependencies:Xs,devDependencies:tu,engines:eu,jest:nu,default:ru})),ou=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=Object({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,REACT_APP_INFURA_ID:"535ab8649e9f40cface13cbded7d647e",REACT_APP_FORTMATIC_KEY:"",REACT_APP_BITSKI_CLIENT_ID:""}).WALLETLINK_URL||"https://www.walletlink.org",r=Object({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,REACT_APP_INFURA_ID:"535ab8649e9f40cface13cbded7d647e",REACT_APP_FORTMATIC_KEY:"",REACT_APP_BITSKI_CLIENT_ID:""}).WALLETLINK_VERSION||iu.version||"unknown",i=function(){function t(e){Object(f.a)(this,t),this._appName="",this._appLogoUrl=null,this._relay=new $s.WalletLinkRelay({walletLinkUrl:e.walletLinkUrl||n,version:r,darkMode:!!e.darkMode}),this.setAppInfo(e.appName,e.appLogoUrl),this._relay.attach(document.documentElement),Q.injectCssReset()}return Object(d.a)(t,[{key:"makeWeb3Provider",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Y.WalletLinkProvider({relay:this._relay,jsonRpcUrl:t,chainId:e})}},{key:"setAppInfo",value:function(t,e){this._appName=t||"DApp",this._appLogoUrl=e||_.getFavicon(),this._relay.setAppInfo(this._appName,this._appLogoUrl)}},{key:"disconnect",value:function(){this._relay.resetAndReload()}}]),t}();e.WalletLink=i,i.VERSION=r}));Object(v.c)(ou),ou.WalletLink;var su=Object(v.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=Y;e.WalletLinkProvider=n.WalletLinkProvider;var r=ou;e.WalletLink=r.WalletLink,e.default=ou.WalletLink,"undefined"!=typeof window&&(window.WalletLink=ou.WalletLink,window.WalletLinkProvider=Y.WalletLinkProvider)})),uu=Object(v.c)(su),au=su.WalletLinkProvider,cu=su.WalletLink;e.default=uu}.call(this,n(52).Buffer)},761:function(t,e,n){"use strict";var r=n(110),i=n.n(r);n.d(e,"a",(function(){return i.a}))}}]); \ No newline at end of file diff --git a/static/js/11.712bf097.chunk.js.LICENSE.txt b/bridge/static/js/11.711038e8.chunk.js.LICENSE.txt similarity index 100% rename from static/js/11.712bf097.chunk.js.LICENSE.txt rename to bridge/static/js/11.711038e8.chunk.js.LICENSE.txt diff --git a/static/js/12.beefb4e7.chunk.js b/bridge/static/js/12.9ac8c380.chunk.js similarity index 99% rename from static/js/12.beefb4e7.chunk.js rename to bridge/static/js/12.9ac8c380.chunk.js index dd9f031..3d6131c 100644 --- a/static/js/12.beefb4e7.chunk.js +++ b/bridge/static/js/12.9ac8c380.chunk.js @@ -1,2 +1,2 @@ -/*! For license information please see 12.beefb4e7.chunk.js.LICENSE.txt */ -(this.webpackJsonpbridge=this.webpackJsonpbridge||[]).push([[12],{719:function(t,e,r){"use strict";r.r(e),r.d(e,"__moduleExports",(function(){return P}));var i=r(36),n=r(55),o=r(48),s=r(189),a=r(21),h=r(30),u=r(32),f=r(33),l=r(12),c=r.n(l),d=r(22),p=r(712),m=(r(0),r(328),r(73),r(745)),v=Object(p.b)((function(t){var e,r;e=p.d,r=function(){var t=function(){},e="undefined"!=typeof window&&void 0!==window.navigator&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"];function i(t,e){var r=t[e];if("function"==typeof r.bind)return r.bind(t);try{return Function.prototype.bind.call(r,t)}catch(e){return function(){return Function.prototype.apply.apply(r,[t,arguments])}}}function n(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function o(r){return"debug"===r&&(r="log"),"undefined"!=typeof console&&("trace"===r&&e?n:void 0!==console[r]?i(console,r):void 0!==console.log?i(console,"log"):t)}function s(e,i){for(var n=0;n=0&&e<=o.levels.SILENT))throw"log.setLevel() called with invalid level: "+e;if(n=e,!1!==i&&function(t){var e=(r[t]||"silent").toUpperCase();if("undefined"!=typeof window){try{return void(window.localStorage[a]=e)}catch(t){}try{window.document.cookie=encodeURIComponent(a)+"="+e+";"}catch(t){}}}(e),s.call(o,e,t),"undefined"==typeof console&&e=0;--n){var o=this.tryEntries[n],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var a=r.call(o,"catchLoc"),h=r.call(o,"finallyLoc");if(a&&h){if(this.prev=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),M(r),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var i=r.completion;if("throw"===i.type){var n=i.arg;M(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),u}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}})),y=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t};function b(t,e,r,i,n,o,s){try{var a=t[o](s),h=a.value}catch(t){return void r(t)}a.done?e(h):Promise.resolve(h).then(i,n)}var w=function(t){return function(){var e=this,r=arguments;return new Promise((function(i,n){var o=t.apply(e,r);function s(t){b(o,i,n,s,a,"next",t)}function a(t){b(o,i,n,s,a,"throw",t)}s(void 0)}))}},M=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function _(t,e){for(var r=0;r=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(h.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(i)return U(t).length;e=(""+e).toLowerCase(),i=!0}}function m(t,e,r){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return k(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function v(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function g(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=h.from(e,i)),h.isBuffer(e))return 0===e.length?-1:y(t,e,r,i,n);if("number"==typeof e)return e&=255,h.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,i,n){var o,s=1,a=t.length,h=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,a/=2,h/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(n){var f=-1;for(o=r;oa&&(r=a-h),o=r;o>=0;o--){for(var l=!0,c=0;cn&&(i=n):i=n;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var s=0;s>8,n=r%256,o.push(n),o.push(i);return o}(e,t.length-r),t,r,i)}function k(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n239?4:u>223?3:u>191?2:1;if(n+l<=r)switch(l){case 1:u<128&&(f=u);break;case 2:128==(192&(o=t[n+1]))&&(h=(31&u)<<6|63&o)>127&&(f=h);break;case 3:o=t[n+1],s=t[n+2],128==(192&o)&&128==(192&s)&&(h=(15&u)<<12|(63&o)<<6|63&s)>2047&&(h<55296||h>57343)&&(f=h);break;case 4:o=t[n+1],s=t[n+2],a=t[n+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(h=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&h<1114112&&(f=h)}null===f?(f=65533,l=1):f>65535&&(f-=65536,i.push(f>>>10&1023|55296),f=56320|1023&f),i.push(f),n+=l}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",i=0;ii)&&(r=i);for(var n="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function T(t,e,r,i,n,o){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function j(t,e,r,i){e<0&&(e=65535+e+1);for(var n=0,o=Math.min(t.length-r,2);n>>8*(i?n:1-n)}function C(t,e,r,i){e<0&&(e=4294967295+e+1);for(var n=0,o=Math.min(t.length-r,4);n>>8*(i?n:3-n)&255}function N(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(t,e,r,i,o){return o||N(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function L(t,e,r,i,o){return o||N(t,0,r,8),n.write(t,e,r,i,52,8),r+8}e.Buffer=h,e.SlowBuffer=function(t){return+t!=t&&(t=0),h.alloc(+t)},e.INSPECT_MAX_BYTES=50,h.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),h.poolSize=8192,h._augment=function(t){return t.__proto__=h.prototype,t},h.from=function(t,e,r){return u(null,t,e,r)},h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0})),h.alloc=function(t,e,r){return function(t,e,r,i){return f(e),e<=0?a(t,e):void 0!==r?"string"==typeof i?a(t,e).fill(r,i):a(t,e).fill(r):a(t,e)}(null,t,e,r)},h.allocUnsafe=function(t){return l(null,t)},h.allocUnsafeSlow=function(t){return l(null,t)},h.isBuffer=function(t){return!(null==t||!t._isBuffer)},h.compare=function(t,e){if(!h.isBuffer(t)||!h.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,i=e.length,n=0,o=Math.min(r,i);n0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},h.prototype.compare=function(t,e,r,i,n){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(n>>>=0)-(i>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(i,n),f=t.slice(e,r),l=0;ln)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return M(this,t,e,r);case"latin1":case"binary":return _(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},h.prototype.slice=function(t,e){var r,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e0&&(n*=256);)i+=this[t+--e]*n;return i},h.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},h.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var i=this[t],n=1,o=0;++o=(n*=128)&&(i-=Math.pow(2,8*e)),i},h.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var i=e,n=1,o=this[t+--i];i>0&&(n*=256);)o+=this[t+--i]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*e)),o},h.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt32LE=function(t,e){return e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),n.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),n.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),n.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),n.read(this,t,!1,52,8)},h.prototype.writeUIntLE=function(t,e,r,i){t=+t,e|=0,r|=0,i||T(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+n]=t/o&255;return e+r},h.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,1,255,0),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},h.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},h.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},h.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):C(this,t,e,!0),e+4},h.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},h.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);T(this,t,e,r,n-1,-n)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},h.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);T(this,t,e,r,n-1,-n)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},h.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,1,127,-128),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},h.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},h.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},h.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):C(this,t,e,!0),e+4},h.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},h.prototype.writeFloatLE=function(t,e,r){return P(this,t,e,!0,r)},h.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},h.prototype.writeDoubleLE=function(t,e,r){return L(this,t,e,!0,r)},h.prototype.writeDoubleBE=function(t,e,r){return L(this,t,e,!1,r)},h.prototype.copy=function(t,e,r,i){if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--n)t[n+e]=this[n+r];else if(o<1e3||!h.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function F(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(q,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,i){for(var n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}}).call(this,r(0))},function(t,e,r){(function(t,r){var i;!function(){var n="object"==typeof self&&self.self===self&&self||"object"==typeof t&&t.global===t&&t||this||{},o=n._,s=Array.prototype,a=Object.prototype,h="undefined"!=typeof Symbol?Symbol.prototype:null,u=s.push,f=s.slice,l=a.toString,c=a.hasOwnProperty,d=Array.isArray,p=Object.keys,m=Object.create,v=function(){},g=function t(e){return e instanceof t?e:this instanceof t?void(this._wrapped=e):new t(e)};e.nodeType?n._=g:(!r.nodeType&&r.exports&&(e=r.exports=g),e._=g),g.VERSION="1.9.1";var y,b=function(t,e,r){if(void 0===e)return t;switch(null==r?3:r){case 1:return function(r){return t.call(e,r)};case 3:return function(r,i,n){return t.call(e,r,i,n)};case 4:return function(r,i,n,o){return t.call(e,r,i,n,o)}}return function(){return t.apply(e,arguments)}},w=function(t,e,r){return g.iteratee!==y?g.iteratee(t,e):null==t?g.identity:g.isFunction(t)?b(t,e,r):g.isObject(t)&&!g.isArray(t)?g.matcher(t):g.property(t)};g.iteratee=y=function(t,e){return w(t,e,1/0)};var M=function(t,e){return e=null==e?t.length-1:+e,function(){for(var r=Math.max(arguments.length-e,0),i=Array(r),n=0;n=0&&e<=A};g.each=g.forEach=function(t,e,r){var i,n;if(e=b(e,r),B(t))for(i=0,n=t.length;i0?0:s-1;for(n||(i=e[o?o[a]:a],a+=t);a>=0&&a=3;return e(t,b(r,n,4),i,o)}};g.reduce=g.foldl=g.inject=O(1),g.reduceRight=g.foldr=O(-1),g.find=g.detect=function(t,e,r){var i=(B(t)?g.findIndex:g.findKey)(t,e,r);if(void 0!==i&&-1!==i)return t[i]},g.filter=g.select=function(t,e,r){var i=[];return e=w(e,r),g.each(t,(function(t,r,n){e(t,r,n)&&i.push(t)})),i},g.reject=function(t,e,r){return g.filter(t,g.negate(w(e)),r)},g.every=g.all=function(t,e,r){e=w(e,r);for(var i=!B(t)&&g.keys(t),n=(i||t).length,o=0;o=0},g.invoke=M((function(t,e,r){var i,n;return g.isFunction(e)?n=e:g.isArray(e)&&(i=e.slice(0,-1),e=e[e.length-1]),g.map(t,(function(t){var o=n;if(!o){if(i&&i.length&&(t=k(t,i)),null==t)return;o=t[e]}return null==o?o:o.apply(t,r)}))})),g.pluck=function(t,e){return g.map(t,g.property(e))},g.where=function(t,e){return g.filter(t,g.matcher(e))},g.findWhere=function(t,e){return g.find(t,g.matcher(e))},g.max=function(t,e,r){var i,n,o=-1/0,s=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,h=(t=B(t)?t:g.values(t)).length;ao&&(o=i);else e=w(e,r),g.each(t,(function(t,r,i){((n=e(t,r,i))>s||n===-1/0&&o===-1/0)&&(o=t,s=n)}));return o},g.min=function(t,e,r){var i,n,o=1/0,s=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,h=(t=B(t)?t:g.values(t)).length;ai||void 0===r)return 1;if(r0?0:n-1;o>=0&&o0?s=o>=0?o:Math.max(o+a,s):a=o>=0?Math.min(o+1,a):o+a+1;else if(r&&o&&a)return i[o=r(i,n)]===n?o:-1;if(n!=n)return(o=e(f.call(i,s,a),g.isNaN))>=0?o+s:-1;for(o=t>0?s:a-1;o>=0&&oe?(i&&(clearTimeout(i),i=null),a=u,s=t.apply(n,o),i||(n=o=null)):i||!1===r.trailing||(i=setTimeout(h,f)),s};return u.cancel=function(){clearTimeout(i),a=0,i=n=o=null},u},g.debounce=function(t,e,r){var i,n,o=function(e,r){i=null,r&&(n=t.apply(e,r))},s=M((function(s){if(i&&clearTimeout(i),r){var a=!i;i=setTimeout(o,e),a&&(n=t.apply(this,s))}else i=g.delay(o,e,this,s);return n}));return s.cancel=function(){clearTimeout(i),i=null},s},g.wrap=function(t,e){return g.partial(e,t)},g.negate=function(t){return function(){return!t.apply(this,arguments)}},g.compose=function(){var t=arguments,e=t.length-1;return function(){for(var r=e,i=t[e].apply(this,arguments);r--;)i=t[r].call(this,i);return i}},g.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},g.before=function(t,e){var r;return function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=null),r}},g.once=g.partial(g.before,2),g.restArguments=M;var P=!{toString:null}.propertyIsEnumerable("toString"),L=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],q=function(t,e){var r=L.length,i=t.constructor,n=g.isFunction(i)&&i.prototype||a,o="constructor";for(x(t,o)&&!g.contains(e,o)&&e.push(o);r--;)(o=L[r])in t&&t[o]!==n[o]&&!g.contains(e,o)&&e.push(o)};g.keys=function(t){if(!g.isObject(t))return[];if(p)return p(t);var e=[];for(var r in t)x(t,r)&&e.push(r);return P&&q(t,e),e},g.allKeys=function(t){if(!g.isObject(t))return[];var e=[];for(var r in t)e.push(r);return P&&q(t,e),e},g.values=function(t){for(var e=g.keys(t),r=e.length,i=Array(r),n=0;n1&&(i=b(i,e[1])),e=g.allKeys(t)):(i=z,e=T(e,!1,!1),t=Object(t));for(var n=0,o=e.length;n1&&(r=e[1])):(e=g.map(T(e,!1,!1),String),i=function(t,r){return!g.contains(e,r)}),g.pick(t,i,r)})),g.defaults=D(g.allKeys,!0),g.create=function(t,e){var r=_(t);return e&&g.extendOwn(r,e),r},g.clone=function(t){return g.isObject(t)?g.isArray(t)?t.slice():g.extend({},t):t},g.tap=function(t,e){return e(t),t},g.isMatch=function(t,e){var r=g.keys(e),i=r.length;if(null==t)return!i;for(var n=Object(t),o=0;o":">",'"':""","'":"'","`":"`"},W=g.invert(Z),K=function(t){var e=function(e){return t[e]},r="(?:"+g.keys(t).join("|")+")",i=RegExp(r),n=RegExp(r,"g");return function(t){return t=null==t?"":""+t,i.test(t)?t.replace(n,e):t}};g.escape=K(Z),g.unescape=K(W),g.result=function(t,e,r){g.isArray(e)||(e=[e]);var i=e.length;if(!i)return g.isFunction(r)?r.call(t):r;for(var n=0;n/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var G=/(.)^/,Y={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},J=/\\|'|\r|\n|\u2028|\u2029/g,X=function(t){return"\\"+Y[t]};g.template=function(t,e,r){!e&&r&&(e=r),e=g.defaults({},e,g.templateSettings);var i,n=RegExp([(e.escape||G).source,(e.interpolate||G).source,(e.evaluate||G).source].join("|")+"|$","g"),o=0,s="__p+='";t.replace(n,(function(e,r,i,n,a){return s+=t.slice(o,a).replace(J,X),o=a+e.length,r?s+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":i?s+="'+\n((__t=("+i+"))==null?'':__t)+\n'":n&&(s+="';\n"+n+"\n__p+='"),e})),s+="';\n",e.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{i=new Function(e.variable||"obj","_",s)}catch(t){throw t.source=s,t}var a=function(t){return i.call(this,t,g)},h=e.variable||"obj";return a.source="function("+h+"){\n"+s+"}",a},g.chain=function(t){var e=g(t);return e._chain=!0,e};var $=function(t,e){return t._chain?g(e).chain():e};g.mixin=function(t){return g.each(g.functions(t),(function(e){var r=g[e]=t[e];g.prototype[e]=function(){var t=[this._wrapped];return u.apply(t,arguments),$(this,r.apply(g,t))}})),g},g.mixin(g),g.each(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=s[t];g.prototype[t]=function(){var r=this._wrapped;return e.apply(r,arguments),"shift"!==t&&"splice"!==t||0!==r.length||delete r[0],$(this,r)}})),g.each(["concat","join","slice"],(function(t){var e=s[t];g.prototype[t]=function(){return $(this,e.apply(this._wrapped,arguments))}})),g.prototype.value=function(){return this._wrapped},g.prototype.valueOf=g.prototype.toJSON=g.prototype.value,g.prototype.toString=function(){return String(this._wrapped)},void 0===(i=function(){return g}.apply(e,[]))||(r.exports=i)}()}).call(this,r(0),r(9)(t))},function(t,e,r){var i=r(48),n=r(49);t.exports={errors:i,formatters:n}},function(t,e){var r,i,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var h,u=[],f=!1,l=-1;function c(){f&&h&&(f=!1,h.length?u=h.concat(u):l=-1,u.length&&d())}function d(){if(!f){var t=a(c);f=!0;for(var e=u.length;e;){for(h=u,u=[];++l1)for(var r=1;r=0&&(o=r.type.substring(s));var a=t(e,r.components);i.isArray(a)&&e?n.push("tuple("+a.join(",")+")"+o):e?n.push("("+a+")"):n.push("("+a.join(",")+")"+o)}else n.push(r.type)})),n},u=function(t){if(!o.isHexStrict(t))throw new Error("The parameter must be a valid HEX string.");var e="",r=0,i=t.length;for("0x"===t.substring(0,2)&&(r=2);r7?r+=t[i].toUpperCase():r+=t[i];return r},toHex:o.toHex,toBN:o.toBN,bytesToHex:o.bytesToHex,hexToBytes:o.hexToBytes,hexToNumberString:o.hexToNumberString,hexToNumber:o.hexToNumber,toDecimal:o.hexToNumber,numberToHex:o.numberToHex,fromDecimal:o.numberToHex,hexToUtf8:o.hexToUtf8,hexToString:o.hexToUtf8,toUtf8:o.hexToUtf8,utf8ToHex:o.utf8ToHex,stringToHex:o.utf8ToHex,fromUtf8:o.utf8ToHex,hexToAscii:u,toAscii:u,asciiToHex:f,fromAscii:f,unitMap:n.unitMap,toWei:function(t,e){if(e=l(e),!o.isBN(t)&&!i.isString(t))throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return o.isBN(t)?n.toWei(t,e):n.toWei(t,e).toString(10)},fromWei:function(t,e){if(e=l(e),!o.isBN(t)&&!i.isString(t))throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return o.isBN(t)?n.fromWei(t,e):n.fromWei(t,e).toString(10)},padLeft:o.leftPad,leftPad:o.leftPad,padRight:o.rightPad,rightPad:o.rightPad,toTwosComplement:o.toTwosComplement,isBloom:o.isBloom,isUserEthereumAddressInBloom:o.isUserEthereumAddressInBloom,isContractAddressInBloom:o.isContractAddressInBloom,isTopic:o.isTopic,isTopicInBloom:o.isTopicInBloom,isInBloom:o.isInBloom}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},function(t,e,r){var i=r(14),n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=l;var o=Object.create(r(12));o.inherits=r(6);var s=r(28),a=r(32);o.inherits(l,s);for(var h=n(a.prototype),u=0;u=256||parseInt(String(r))!=r)return!1}return!0}function h(t){if(null==t&&n.throwError("cannot convert null value to array",n.INVALID_ARGUMENT,{arg:"value",value:t}),o(t)&&(t=t.toHexString()),"string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],i=0;i>4]+"0123456789abcdef"[15&h])}return"0x"+i.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function c(t,e){for(f(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function d(t){var e,r=0,i="0x",o="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&n.throwError("at least on of recoveryParam or v must be specified",n.INVALID_ARGUMENT,{argument:"signature",value:t}),i=c(t.r,32),o=c(t.s,32),"string"==typeof(r=t.v)&&(r=parseInt(r,16));var s=t.recoveryParam;null==s&&null!=t.v&&(s=1-r%2),r=27+s}else{var a=h(t);if(65!==a.length)throw new Error("invalid signature");i=l(a.slice(0,32)),o=l(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:i,s:o,recoveryParam:r-27,v:r}}e.AddressZero="0x0000000000000000000000000000000000000000",e.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",e.isArrayish=a,e.arrayify=h,e.concat=u,e.stripZeros=function(t){var e=h(t);if(0===e.length)return e;for(var r=0;0===e[r];)r++;return r&&(e=e.slice(r)),e},e.padZeros=function(t,e){if(e<(t=h(t)).length)throw new Error("cannot pad");var r=new Uint8Array(e);return r.set(t,e-t.length),s(r)},e.isHexString=f,e.hexlify=l,e.hexDataLength=function(t){return f(t)&&t.length%2==0?(t.length-2)/2:null},e.hexDataSlice=function(t,e,r){return f(t)||n.throwError("invalid hex data",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&n.throwError("hex data length must be even",n.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,e+2*r):"0x"+t.substring(e)},e.hexStripZeros=function(t){for(f(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length>3&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},e.hexZeroPad=c,e.splitSignature=d,e.joinSignature=function(t){return l(u([(t=d(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){(function(t){!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(57).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(9)(t))},function(t,e,r){var i=r(75),n=r(76);function o(){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}e.parse=b,e.resolve=function(t,e){return b(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?b(t,!1,!0).resolveObject(e):e},e.format=function(t){return n.isString(t)&&(t=b(t)),t instanceof o?t.format():o.prototype.format.call(t)},e.Url=o;var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,h=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),f=["'"].concat(u),l=["%","/","?",";","#"].concat(f),c=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=r(77);function b(t,e,r){if(t&&n.isObject(t)&&t instanceof o)return t;var i=new o;return i.parse(t,e,r),i}o.prototype.parse=function(t,e,r){if(!n.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),a=-1!==o&&o127?j+="x":j+=T[C];if(!j.match(d)){var P=R.slice(0,E),L=R.slice(E+1),q=T.match(p);q&&(P.push(q[1]),L.unshift(q[2])),L.length&&(b="/"+L.join(".")+b),this.hostname=P.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=i.toASCII(this.hostname));var D=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+D,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[_])for(E=0,I=f.length;E0)&&r.host.split("@"))&&(r.auth=O.shift(),r.host=r.hostname=O.shift())),r.search=t.search,r.query=t.query,n.isNull(r.pathname)&&n.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var k=S.slice(-1)[0],A=(r.host||t.host||S.length>1)&&("."===k||".."===k)||""===k,E=0,B=S.length;B>=0;B--)"."===(k=S[B])?S.splice(B,1):".."===k?(S.splice(B,1),E++):E&&(S.splice(B,1),E--);if(!M&&!_)for(;E--;E)S.unshift("..");!M||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),A&&"/"!==S.join("/").substr(-1)&&S.push("");var O,R=""===S[0]||S[0]&&"/"===S[0].charAt(0);return x&&(r.hostname=r.host=R?"":S.length?S.shift():"",(O=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=O.shift(),r.host=r.hostname=O.shift())),(M=M||r.host&&S.length)&&!R&&S.unshift(""),S.length?r.pathname=S.join("/"):(r.pathname=null,r.path=null),n.isNull(r.pathname)&&n.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,r){(function(t){function r(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===r(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===r(t)},e.isObject=function(t){return"object"==typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===r(t)},e.isError=function(t){return"[object Error]"===r(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=t.isBuffer}).call(this,r(1).Buffer)},function(t,e){t.exports=y},function(t,e,r){(function(e){void 0===e||!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,r,i,n){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick((function(){t.call(null,r)}));case 3:return e.nextTick((function(){t.call(null,r,i)}));case 4:return e.nextTick((function(){t.call(null,r,i,n)}));default:for(o=new Array(a-1),s=0;sr&&o("too many arguments"+i,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){i&&o("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),n=!!t,i=!!r}},function(t,e,r){(function(t){var i=r(83),n=r(26),o=r(93),s=r(94),a=r(11),h=e;h.request=function(e,r){e="string"==typeof e?a.parse(e):o(e);var n=-1===t.location.protocol.search(/^https?:$/)?"http:":"",s=e.protocol||n,h=e.hostname||e.host,u=e.port,f=e.path||"/";h&&-1!==h.indexOf(":")&&(h="["+h+"]"),e.url=(h?s+"//"+h:"")+(u?":"+u:"")+f,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var l=new i(e);return r&&l.on("response",r),l},h.get=function(t,e){var r=h.request(t,e);return r.end(),r},h.ClientRequest=i,h.IncomingMessage=n.IncomingMessage,h.Agent=function(){},h.Agent.defaultMaxSockets=4,h.globalAgent=new h.Agent,h.STATUS_CODES=s,h.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,r(0))},function(t,e,r){var i=r(1),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=s),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){this.listeners={}}return t.prototype.addEventListener=function(t,e){t=t.toLowerCase(),this.listeners[t]=this.listeners[t]||[],this.listeners[t].push(e.handleEvent||e)},t.prototype.removeEventListener=function(t,e){if(t=t.toLowerCase(),this.listeners[t]){var r=this.listeners[t].indexOf(e.handleEvent||e);r<0||this.listeners[t].splice(r,1)}},t.prototype.dispatchEvent=function(t){var e=t.type.toLowerCase();if(t.target=this,this.listeners[e])for(var r=0,i=this.listeners[e];r0&&t.topics.length!==i+1&&(e={anonymous:!0,inputs:[]})}var n=e.anonymous?t.topics:t.topics.slice(1);return r.returnValues=l.decodeLog(e.inputs,t.data,n),delete r.returnValues.__length__,r.event=e.name,r.signature=e.anonymous||!t.topics[0]?null:t.topics[0],r.raw={data:r.data,topics:r.topics},delete r.data,delete r.topics,r},c.prototype._encodeMethodABI=function(){var t=this._method.signature,e=this.arguments||[],r=!1,n=this._parent.options.jsonInterface.filter((function(e){return"constructor"===t&&e.type===t||(e.signature===t||e.signature===t.replace("0x","")||e.name===t)&&"function"===e.type})).map((function(t){var n=i.isArray(t.inputs)?t.inputs.length:0;if(n!==e.length)throw new Error("The number of arguments is not matching the methods required number. You need to pass "+n+" arguments.");return"function"===t.type&&(r=t.signature),i.isArray(t.inputs)?t.inputs:[]})).map((function(t){return l.encodeParameters(t,e).replace("0x","")}))[0]||"";if("constructor"===t){if(!this._deployData)throw new Error("The contract has no contract data option set. This is necessary to append the constructor parameters.");return this._deployData+n}var o=r?r+n:n;if(o)return o;throw new Error("Couldn't find a matching contract method named \""+this._method.name+'".')},c.prototype._decodeMethodReturn=function(t,e){if(!e)return null;e=e.length>=2?e.slice(2):e;var r=l.decodeParameters(t,e);return 1===r.__length__?r[0]:(delete r.__length__,r)},c.prototype.deploy=function(t,e){if((t=t||{}).arguments=t.arguments||[],!(t=this._getOrSetDefaultOptions(t)).data)return s._fireError(new Error('No "data" specified in neither the given options, nor the default options.'),null,null,e);var r=i.find(this.options.jsonInterface,(function(t){return"constructor"===t.type}))||{};return r.signature="constructor",this._createTxObject.apply({method:r,parent:this,deployData:t.data,_ethAccounts:this.constructor._ethAccounts},t.arguments)},c.prototype._generateEventOptions=function(){var t=Array.prototype.slice.call(arguments),e=this._getCallback(t),r=i.isObject(t[t.length-1])?t.pop():{},n=i.isString(t[0])?t[0]:"allevents",o="allevents"===n.toLowerCase()?{name:"ALLEVENTS",jsonInterface:this.options.jsonInterface}:this.options.jsonInterface.find((function(t){return"event"===t.type&&(t.name===n||t.signature==="0x"+n.replace("0x",""))}));if(!o)throw new Error('Event "'+n+"\" doesn't exist in this contract.");if(!s.isAddress(this.options.address))throw new Error("This contract object doesn't have address set yet, please set an address first.");return{params:this._encodeEventABI(o,r),event:o,callback:e}},c.prototype.clone=function(){return new this.constructor(this.options.jsonInterface,this.options.address,this.options)},c.prototype.once=function(t,e,r){var n=Array.prototype.slice.call(arguments);if(!(r=this._getCallback(n)))throw new Error("Once requires a callback as the second parameter.");e&&delete e.fromBlock,this._on(t,e,(function(t,e,n){n.unsubscribe(),i.isFunction(r)&&r(t,e,n)}))},c.prototype._on=function(){var t=this._generateEventOptions.apply(this,arguments);this._checkListener("newListener",t.event.name,t.callback),this._checkListener("removeListener",t.event.name,t.callback);var e=new a({subscription:{params:1,inputFormatter:[h.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(t.event),subscriptionHandler:function(t){t.removed?this.emit("changed",t):this.emit("data",t),i.isFunction(this.callback)&&this.callback(null,t,this)}},type:"eth",requestManager:this._requestManager});return e.subscribe("logs",t.params,t.callback||function(){}),e},c.prototype.getPastEvents=function(){var t=this._generateEventOptions.apply(this,arguments),e=new o({name:"getPastLogs",call:"eth_getLogs",params:1,inputFormatter:[h.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(t.event)});e.setRequestManager(this._requestManager);var r=e.buildCall();return e=null,r(t.params,t.callback)},c.prototype._createTxObject=function(){var t=Array.prototype.slice.call(arguments),e={};if("function"===this.method.type&&(e.call=this.parent._executeMethod.bind(e,"call"),e.call.request=this.parent._executeMethod.bind(e,"call",!0)),e.send=this.parent._executeMethod.bind(e,"send"),e.send.request=this.parent._executeMethod.bind(e,"send",!0),e.encodeABI=this.parent._encodeMethodABI.bind(e),e.estimateGas=this.parent._executeMethod.bind(e,"estimate"),t&&this.method.inputs&&t.length!==this.method.inputs.length){if(this.nextMethod)return this.nextMethod.apply(null,t);throw u.InvalidNumberOfParams(t.length,this.method.inputs.length,this.method.name)}return e.arguments=t||[],e._method=this.method,e._parent=this.parent,e._ethAccounts=this.parent.constructor._ethAccounts||this._ethAccounts,this.deployData&&(e._deployData=this.deployData),e},c.prototype._processExecuteArguments=function(t,e){var r={};if(r.type=t.shift(),r.callback=this._parent._getCallback(t),"call"===r.type&&!0!==t[t.length-1]&&(i.isString(t[t.length-1])||isFinite(t[t.length-1]))&&(r.defaultBlock=t.pop()),r.options=i.isObject(t[t.length-1])?t.pop():{},r.generateRequest=!0===t[t.length-1]&&t.pop(),r.options=this._parent._getOrSetDefaultOptions(r.options),r.options.data=this.encodeABI(),!this._deployData&&!s.isAddress(this._parent.options.address))throw new Error("This contract object doesn't have address set yet, please set an address first.");return this._deployData||(r.options.to=this._parent.options.address),r.options.data?r:s._fireError(new Error("Couldn't find a matching contract method, or the number of parameters is wrong."),e.eventEmitter,e.reject,r.callback)},c.prototype._executeMethod=function(){var t=this,e=this._parent._processExecuteArguments.call(this,Array.prototype.slice.call(arguments),r),r=f("send"!==e.type),n=t.constructor._ethAccounts||t._ethAccounts;if(e.generateRequest){var a={params:[h.inputCallFormatter.call(this._parent,e.options)],callback:e.callback};return"call"===e.type?(a.params.push(h.inputDefaultBlockNumberFormatter.call(this._parent,e.defaultBlock)),a.method="eth_call",a.format=this._parent._decodeMethodReturn.bind(null,this._method.outputs)):a.method="eth_sendTransaction",a}switch(e.type){case"estimate":var u=new o({name:"estimateGas",call:"eth_estimateGas",params:1,inputFormatter:[h.inputCallFormatter],outputFormatter:s.hexToNumber,requestManager:t._parent._requestManager,accounts:n,defaultAccount:t._parent.defaultAccount,defaultBlock:t._parent.defaultBlock}).createFunction();return u(e.options,e.callback);case"call":var c=new o({name:"call",call:"eth_call",params:2,inputFormatter:[h.inputCallFormatter,h.inputDefaultBlockNumberFormatter],outputFormatter:function(e){return t._parent._decodeMethodReturn(t._method.outputs,e)},requestManager:t._parent._requestManager,accounts:n,defaultAccount:t._parent.defaultAccount,defaultBlock:t._parent.defaultBlock,handleRevert:t._parent.handleRevert,abiCoder:l}).createFunction();return c(e.options,e.defaultBlock,e.callback);case"send":if(!s.isAddress(e.options.from))return s._fireError(new Error('No "from" address specified in neither the given options, nor the default options.'),r.eventEmitter,r.reject,e.callback);if(i.isBoolean(this._method.payable)&&!this._method.payable&&e.options.value&&e.options.value>0)return s._fireError(new Error("Can not send value to non-payable contract method or constructor"),r.eventEmitter,r.reject,e.callback);var d={receiptFormatter:function(e){if(i.isArray(e.logs)){var r=i.map(e.logs,(function(e){return t._parent._decodeEventABI.call({name:"ALLEVENTS",jsonInterface:t._parent.options.jsonInterface},e)}));e.events={};var n=0;r.forEach((function(t){t.event?e.events[t.event]?Array.isArray(e.events[t.event])?e.events[t.event].push(t):e.events[t.event]=[e.events[t.event],t]:e.events[t.event]=t:(e.events[n]=t,n++)})),delete e.logs}return e},contractDeployFormatter:function(e){var r=t._parent.clone();return r.options.address=e.contractAddress,r}},p=new o({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[h.inputTransactionFormatter],requestManager:t._parent._requestManager,accounts:t.constructor._ethAccounts||t._ethAccounts,defaultAccount:t._parent.defaultAccount,defaultBlock:t._parent.defaultBlock,transactionBlockTimeout:t._parent.transactionBlockTimeout,transactionConfirmationBlocks:t._parent.transactionConfirmationBlocks,transactionPollingTimeout:t._parent.transactionPollingTimeout,defaultCommon:t._parent.defaultCommon,defaultChain:t._parent.defaultChain,defaultHardfork:t._parent.defaultHardfork,handleRevert:t._parent.handleRevert,extraFormatters:d,abiCoder:l}).createFunction();return p(e.options,e.callback)}},t.exports=c},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){var i=r(54),n=r(55);t.exports=function(t){if("string"==typeof t||"number"==typeof t){var e=new i(1),r=String(t).toLowerCase().trim(),o="0x"===r.substr(0,2)||"-0x"===r.substr(0,3),s=n(r);if("-"===s.substr(0,1)&&(s=n(s.slice(1)),e=new i(-1,10)),!(s=""===s?"0":s).match(/^-?[0-9]+$/)&&s.match(/^[0-9A-Fa-f]+$/)||s.match(/^[a-fA-F]+$/)||!0===o&&s.match(/^[0-9A-Fa-f]+$/))return new i(s,16).mul(e);if((s.match(/^-?[0-9]+$/)||""===s)&&!1===o)return new i(s,10).mul(e)}else if("object"==typeof t&&t.toString&&!t.pop&&!t.push&&t.toString(10).match(/^-?[0-9]+$/)&&(t.mul||t.dividedToIntegerBy))return new i(t.toString(10),10);throw new Error("[number-to-bn] while converting number "+JSON.stringify(t)+" to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.")}},function(t,e,r){(function(e){var i=r(2),n=r(10),o=r(22),s=r(58),a=r(59),h=r(60),u=function(t){return n.isBN(t)},f=function(t){return t&&t.constructor&&"BigNumber"===t.constructor.name},l=function(t){try{return o.apply(null,arguments)}catch(e){throw new Error(e+' Given value: "'+t+'"')}},c=function(t){return!!/^(0x)?[0-9a-f]{40}$/i.test(t)&&(!(!/^(0x|0X)?[0-9a-f]{40}$/.test(t)&&!/^(0x|0X)?[0-9A-F]{40}$/.test(t))||d(t))},d=function(t){t=t.replace(/^0x/i,"");for(var e=b(t.toLowerCase()).replace(/^0x/i,""),r=0;r<40;r++)if(parseInt(e[r],16)>7&&t[r].toUpperCase()!==t[r]||parseInt(e[r],16)<=7&&t[r].toLowerCase()!==t[r])return!1;return!0},p=function(t){var e="";t=(t=(t=(t=(t=s.encode(t)).replace(/^(?:\u0000)*/,"")).split("").reverse().join("")).replace(/^(?:\u0000)*/,"")).split("").reverse().join("");for(var r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return"0x"+e.join("")},isHex:function(t){return(i.isString(t)||i.isNumber(t))&&/^(-0x|0x)?[0-9a-f]*$/i.test(t)},isHexStrict:g,leftPad:function(t,e,r){var i=/^0x/i.test(t)||"number"==typeof t,n=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(i?"0x":"")+new Array(n).join(r||"0")+t},rightPad:function(t,e,r){var i=/^0x/i.test(t)||"number"==typeof t,n=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(i?"0x":"")+t+new Array(n).join(r||"0")},toTwosComplement:function(t){return"0x"+l(t).toTwos(256).toString(16,64)},sha3:b,sha3Raw:function(t){return null===(t=b(t))?y:t}}}).call(this,r(1).Buffer)},function(t,e,r){var i={messageId:0,toPayload:function(t,e){if(!t)throw new Error('JSONRPC method should be specified for params: "'+JSON.stringify(e)+'"!');return i.messageId++,{jsonrpc:"2.0",id:i.messageId,method:t,params:e||[]}},isValidResponse:function(t){return Array.isArray(t)?t.every(e):e(t);function e(t){return!(!t||t.error||"2.0"!==t.jsonrpc||"number"!=typeof t.id&&"string"!=typeof t.id||void 0===t.result)}},toBatchPayload:function(t){return t.map((function(t){return i.toPayload(t.method,t.params)}))}};t.exports=i},function(t,e,r){(function(t){e.fetch=a(t.fetch)&&a(t.ReadableStream),e.writableStream=a(t.WritableStream),e.abortController=a(t.AbortController),e.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),e.blobConstructor=!0}catch(t){}var r;function i(){if(void 0!==r)return r;if(t.XMLHttpRequest){r=new t.XMLHttpRequest;try{r.open("GET",t.XDomainRequest?"/":"https://example.com")}catch(t){r=null}}else r=null;return r}function n(t){var e=i();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch(t){}return!1}var o=void 0!==t.ArrayBuffer,s=o&&a(t.ArrayBuffer.prototype.slice);function a(t){return"function"==typeof t}e.arraybuffer=e.fetch||o&&n("arraybuffer"),e.msstream=!e.fetch&&s&&n("ms-stream"),e.mozchunkedarraybuffer=!e.fetch&&o&&n("moz-chunked-arraybuffer"),e.overrideMimeType=e.fetch||!!i()&&a(i().overrideMimeType),e.vbArray=a(t.VBArray),r=null}).call(this,r(0))},function(t,e,r){(function(t,i,n){var o=r(25),s=r(6),a=r(27),h=e.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},u=e.IncomingMessage=function(e,r,s,h){var u=this;if(a.Readable.call(u),u._mode=s,u.headers={},u.rawHeaders=[],u.trailers={},u.rawTrailers=[],u.on("end",(function(){t.nextTick((function(){u.emit("close")}))})),"fetch"===s){if(u._fetchResponse=r,u.url=r.url,u.statusCode=r.status,u.statusMessage=r.statusText,r.headers.forEach((function(t,e){u.headers[e.toLowerCase()]=t,u.rawHeaders.push(e,t)})),o.writableStream){var f=new WritableStream({write:function(t){return new Promise((function(e,r){u._destroyed?r():u.push(new i(t))?e():u._resumeFetch=e}))},close:function(){n.clearTimeout(h),u._destroyed||u.push(null)},abort:function(t){u._destroyed||u.emit("error",t)}});try{return void r.body.pipeTo(f).catch((function(t){n.clearTimeout(h),u._destroyed||u.emit("error",t)}))}catch(t){}}var l=r.body.getReader();!function t(){l.read().then((function(e){if(!u._destroyed){if(e.done)return n.clearTimeout(h),void u.push(null);u.push(new i(e.value)),t()}})).catch((function(t){n.clearTimeout(h),u._destroyed||u.emit("error",t)}))}()}else if(u._xhr=e,u._pos=0,u.url=e.responseURL,u.statusCode=e.status,u.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(t){var e=t.match(/^([^:]+):\s*(.*)/);if(e){var r=e[1].toLowerCase();"set-cookie"===r?(void 0===u.headers[r]&&(u.headers[r]=[]),u.headers[r].push(e[2])):void 0!==u.headers[r]?u.headers[r]+=", "+e[2]:u.headers[r]=e[2],u.rawHeaders.push(e[1],e[2])}})),u._charset="x-user-defined",!o.overrideMimeType){var c=u.rawHeaders["mime-type"];if(c){var d=c.match(/;\s*charset=([^;])(;|$)/);d&&(u._charset=d[1].toLowerCase())}u._charset||(u._charset="utf-8")}};s(u,a.Readable),u.prototype._read=function(){var t=this._resumeFetch;t&&(this._resumeFetch=null,t())},u.prototype._onXHRProgress=function(){var t=this,e=t._xhr,r=null;switch(t._mode){case"text:vbarray":if(e.readyState!==h.DONE)break;try{r=new n.VBArray(e.responseBody).toArray()}catch(t){}if(null!==r){t.push(new i(r));break}case"text":try{r=e.responseText}catch(e){t._mode="text:vbarray";break}if(r.length>t._pos){var o=r.substr(t._pos);if("x-user-defined"===t._charset){for(var s=new i(o.length),a=0;at._pos&&(t.push(new i(new Uint8Array(u.result.slice(t._pos)))),t._pos=u.result.byteLength)},u.onload=function(){t.push(null)},u.readAsArrayBuffer(r)}t._xhr.readyState===h.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,r(4),r(1).Buffer,r(0))},function(t,e,r){(e=t.exports=r(28)).Stream=e,e.Readable=e,e.Writable=r(32),e.Duplex=r(7),e.Transform=r(34),e.PassThrough=r(91)},function(t,e,r){(function(e,i){var n=r(14);t.exports=b;var o,s=r(21);b.ReadableState=y,r(29).EventEmitter;var a=function(t,e){return t.listeners(e).length},h=r(30),u=r(17).Buffer,f=e.Uint8Array||function(){},l=Object.create(r(12));l.inherits=r(6);var c=r(84),d=void 0;d=c&&c.debuglog?c.debuglog("stream"):function(){};var p,m=r(85),v=r(31);l.inherits(b,h);var g=["error","close","destroy","pause","resume"];function y(t,e){t=t||{};var i=e instanceof(o=o||r(7));this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,s=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,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.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=r(33).StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function b(t){if(o=o||r(7),!(this instanceof b))return new b(t);this._readableState=new y(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),h.call(this)}function w(t,e,r,i,n){var o,s=t._readableState;return null===e?(s.reading=!1,function(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,S(t)}}(t,s)):(n||(o=function(t,e){var r,i;return i=e,u.isBuffer(i)||i instanceof f||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(s,e)),o?t.emit("error",o):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),i?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):M(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?M(t,s,e,!1):k(t,s)):M(t,s,e,!1))):i||(s.reading=!1)),function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=8388608?t=8388608:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function S(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(d("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?n.nextTick(x,t):x(t))}function x(t){d("emit readable"),t.emit("readable"),O(t)}function k(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(A,t,e))}function A(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var i;return to.length?o.length:t;if(s===o.length?n+=o:n+=o.slice(0,t),0==(t-=s)){s===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++i}return e.length-=i,n}(t,e):function(t,e){var r=u.allocUnsafe(t),i=e.head,n=1;for(i.data.copy(r),t-=i.data.length;i=i.next;){var o=i.data,s=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,s),0==(t-=s)){s===o.length?(++n,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=o.slice(s));break}++n}return e.length-=n,r}(t,e),i}(t,e.buffer,e.decoder),r);var r}function I(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,n.nextTick(T,e,t))}function T(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function j(t,e){for(var r=0,i=t.length;r=e.highWaterMark||e.ended))return d("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?I(this):S(this),null;if(0===(t=_(t,e))&&e.ended)return 0===e.length&&I(this),null;var i,n=e.needReadable;return d("need readable",n),(0===e.length||e.length-t0?R(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&I(this)),null!==i&&this.emit("data",i),i},b.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(t,e){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,e);var h=e&&!1===e.end||t===i.stdout||t===i.stderr?y:u;function u(){d("onend"),t.end()}o.endEmitted?n.nextTick(h):r.once("end",h),t.on("unpipe",(function e(i,n){d("onunpipe"),i===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d("cleanup"),t.removeListener("close",v),t.removeListener("finish",g),t.removeListener("drain",f),t.removeListener("error",m),t.removeListener("unpipe",e),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",p),l=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}));var f=function(t){return function(){var e=t._readableState;d("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,O(t))}}(r);t.on("drain",f);var l=!1,c=!1;function p(e){d("ondata"),c=!1,!1!==t.write(e)||c||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==j(o.pipes,t))&&!l&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,c=!0),r.pause())}function m(e){d("onerror",e),y(),t.removeListener("error",m),0===a(t,"error")&&t.emit("error",e)}function v(){t.removeListener("finish",g),y()}function g(){d("onfinish"),t.removeListener("close",v),y()}function y(){d("unpipe"),r.unpipe(t)}return r.on("data",p),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?s(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",m),t.once("close",v),t.once("finish",g),t.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),t},b.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0&&s.length>n&&!s.warned){s.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=t,h.type=e,h.count=s.length,a=h,console&&console.warn&&console.warn(a)}return t}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=c.bind(i);return n.listener=r,i.wrapFn=n,n}function p(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var h=n[t];if(void 0===h)return!1;if("function"==typeof h)o(h,this,e);else{var u=h.length,f=v(h,u);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},a.prototype.listeners=function(t){return p(this,t,!0)},a.prototype.rawListeners=function(t){return p(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},function(t,e,r){t.exports=r(29).EventEmitter},function(t,e,r){var i=r(14);function n(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||i.nextTick(n,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?(i.nextTick(n,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(t,e,r){(function(e,i,n){var o=r(14);function s(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(void 0),i=i.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=y;var a,h=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?i:o.nextTick;y.WritableState=g;var u=Object.create(r(12));u.inherits=r(6);var f,l={deprecate:r(89)},c=r(30),d=r(17).Buffer,p=n.Uint8Array||function(){},m=r(31);function v(){}function g(t,e){a=a||r(7),t=t||{};var i=e instanceof a;this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var n=t.highWaterMark,u=t.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i&&(u||0===u)?u:f,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 l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,i,n){--e.pendingcb,r?(o.nextTick(n,i),o.nextTick(x,t,e),t._writableState.errorEmitted=!0,t.emit("error",i)):(n(i),t._writableState.errorEmitted=!0,t.emit("error",i),x(t,e))}(t,r,i,e,n);else{var s=_(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||M(t,r),i?h(w,t,r,s,n):w(t,r,s,n)}}(e,t)},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 s(this)}function y(t){if(a=a||r(7),!(f.call(y,this)||this instanceof a))return new y(t);this._writableState=new g(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),c.call(this)}function b(t,e,r,i,n,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function w(t,e,r,i){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,i(),x(t,e)}function M(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,n=new Array(i),o=e.corkedRequestsFree;o.entry=r;for(var a=0,h=!0;r;)n[a]=r,r.isBuf||(h=!1),r=r.next,a+=1;n.allBuffers=h,b(t,e,!0,e.length,n,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new s(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,f=r.encoding,l=r.callback;if(b(t,e,!1,e.objectMode?1:u.length,u,f,l),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function _(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function S(t,e){t._final((function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),x(t,e)}))}function x(t,e){var r=_(e);return r&&(function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(S,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}u.inherits(y,c),g.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(g.prototype,"buffer",{get:l.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(t){return!!f.call(this,t)||this===y&&t&&t._writableState instanceof g}})):f=function(t){return t instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(t,e,r){var i,n=this._writableState,s=!1,a=!n.objectMode&&(i=t,d.isBuffer(i)||i instanceof p);return a&&!d.isBuffer(t)&&(t=function(t){return d.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=v),n.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),o.nextTick(e,r)}(this,r):(a||function(t,e,r,i){var n=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),o.nextTick(i,s),n=!1),n}(this,n,t,r))&&(n.pendingcb++,s=function(t,e,r,i,n,o){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=d.from(e,r)),e}(e,i,n);i!==s&&(r=!0,n="buffer",i=s)}var a=e.objectMode?1:i.length;e.length+=a;var h=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(t,e,r){var i=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||function(t,e,r){e.ending=!0,x(t,e),r&&(e.finished?o.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,i,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,r(4),r(87).setImmediate,r(0))},function(t,e,r){var i=r(90).Buffer,n=i.isEncoding||function(t){switch((t=""+t)&&t.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}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===n||!n(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=h,this.end=u,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=f,this.end=l,e=3;break;default:return this.write=c,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function h(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function c(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(n>0&&(t.lastNeed=n-1),n):--i=0?(n>0&&(t.lastNeed=n-2),n):--i=0?(n>0&&(2===n?n=0:t.lastNeed=n-3),n):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,r){t.exports=s;var i=r(7),n=Object.create(r(12));function o(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(!i)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=e&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length1?(t[r[0]]=t[r[0]]||{},t[r[0]][r[1]]=e):t[r[0]]=e},u.prototype.getCall=function(t){return i.isFunction(this.call)?this.call(t):this.call},u.prototype.extractCallback=function(t){if(i.isFunction(t[t.length-1]))return t.pop()},u.prototype.validateArgs=function(t){if(t.length!==this.params)throw n.InvalidNumberOfParams(t.length,this.params,this.name)},u.prototype.formatInput=function(t){var e=this;return this.inputFormatter?this.inputFormatter.map((function(r,i){return r?r.call(e,t[i]):t[i]})):t},u.prototype.formatOutput=function(t){var e=this;return i.isArray(t)?t.map((function(t){return e.outputFormatter&&t?e.outputFormatter(t):t})):this.outputFormatter&&t?this.outputFormatter(t):t},u.prototype.toPayload=function(t){var e=this.getCall(t),r=this.extractCallback(t),i=this.formatInput(t);this.validateArgs(i);var n={method:e,params:i,callback:r};return this.transformPayload&&(n=this.transformPayload(n)),n},u.prototype._confirmTransaction=function(t,e,r){var f=this,l=!1,p=!0,m=0,v=0,g=null,y=null,b=i.isObject(r.params[0])&&r.params[0].gas?r.params[0].gas:null,w=i.isObject(r.params[0])&&r.params[0].data&&r.params[0].from&&!r.params[0].to,M=w&&r.params[0].data.length>2,_=[new u({name:"getBlockByNumber",call:"eth_getBlockByNumber",params:2,inputFormatter:[o.inputBlockNumberFormatter,function(t){return!!t}],outputFormatter:o.outputBlockFormatter}),new u({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:o.outputTransactionReceiptFormatter}),new u({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[o.inputAddressFormatter,o.inputDefaultBlockNumberFormatter]}),new h({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:o.outputBlockFormatter}}})],S={};i.each(_,(function(t){t.attachToObject(S),t.requestManager=f.requestManager}));var x=function(i,o,h,u,_){if(!h)return _||(_={unsubscribe:function(){clearInterval(g)}}),(i?a.resolve(i):S.getTransactionReceipt(e)).catch((function(e){_.unsubscribe(),l=!0,s._fireError({message:"Failed to check for transaction receipt:",data:e},t.eventEmitter,t.reject)})).then(function(){var e=Object(d.a)(c.a.mark((function e(r){var n;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&r.blockHash){e.next=2;break}throw new Error("Receipt missing or blockHash null");case 2:if(f.extraFormatters&&f.extraFormatters.receiptFormatter&&(r=f.extraFormatters.receiptFormatter(r)),e.t0=t.eventEmitter.listeners("confirmation").length>0,!e.t0){e.next=27;break}if(e.t1=void 0!==i&&0===v,e.t1){e.next=24;break}if(!o){e.next=23;break}if(!y){e.next=16;break}return e.next=11,S.getBlockByNumber(y.number+1);case 11:if(e.t2=n=e.sent,!e.t2){e.next=14;break}y=n,t.eventEmitter.emit("confirmation",v,r);case 14:e.next=21;break;case 16:return e.next=18,S.getBlockByNumber(r.blockNumber);case 18:n=e.sent,y=n,t.eventEmitter.emit("confirmation",v,r);case 21:e.next=24;break;case 23:t.eventEmitter.emit("confirmation",v,r);case 24:(o&&n||!o)&&v++,p=!1,v===f.transactionConfirmationBlocks+1&&(_.unsubscribe(),t.eventEmitter.removeAllListeners());case 27:return e.abrupt("return",r);case 28:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).then(function(){var e=Object(d.a)(c.a.mark((function e(r){var i;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!w||l){e.next=14;break}if(r.contractAddress){e.next=3;break}return e.abrupt("return",(p&&(_.unsubscribe(),l=!0),void s._fireError(n.NoContractAddressFoundError(r),t.eventEmitter,t.reject,null,r)));case 3:return e.prev=3,e.next=6,S.getCode(r.contractAddress);case 6:i=e.sent,e.next=11;break;case 9:e.prev=9,e.t0=e.catch(3);case 11:if(i){e.next=13;break}return e.abrupt("return");case 13:!0===r.status&&M||i.length>2?(t.eventEmitter.emit("receipt",r),f.extraFormatters&&f.extraFormatters.contractDeployFormatter?t.resolve(f.extraFormatters.contractDeployFormatter(r)):t.resolve(r),p&&t.eventEmitter.removeAllListeners()):s._fireError(n.ContractCodeNotStoredError(r),t.eventEmitter,t.reject,null,r),p&&_.unsubscribe(),l=!0;case 14:return e.abrupt("return",r);case 15:case"end":return e.stop()}}),e,null,[[3,9]])})));return function(t){return e.apply(this,arguments)}}()).then(function(){var e=Object(d.a)(c.a.mark((function e(i){var o;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(w||l){e.next=23;break}if(!(i.outOfGas||b&&b===i.gasUsed||!0!==i.status&&"0x1"!==i.status&&void 0!==i.status)){e.next=21;break}if(JSON.stringify(i,null,2),!1!==i.status&&"0x0"!==i.status){e.next=18;break}if(e.prev=3,f.handleRevert&&"eth_sendTransaction"===f.call){e.next=6;break}throw!1;case 6:return e.next=8,f.getRevertReason(r.params[0],i.blockNumber);case 8:if(o=e.sent){e.next=10;break}throw!1;case 10:s._fireError(n.TransactionRevertInstructionError(o.reason,o.signature,i),t.eventEmitter,t.reject,null,i),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(3),s._fireError(n.TransactionRevertedWithoutReasonError(i),t.eventEmitter,t.reject,null,i);case 16:e.next=19;break;case 18:s._fireError(n.TransactionOutOfGasError(i),t.eventEmitter,t.reject,null,i);case 19:e.next=22;break;case 21:t.eventEmitter.emit("receipt",i),t.resolve(i),p&&t.eventEmitter.removeAllListeners();case 22:p&&_.unsubscribe(),l=!0;case 23:case"end":return e.stop()}}),e,null,[[3,13]])})));return function(t){return e.apply(this,arguments)}}()).catch((function(){m++,o?m-1>=f.transactionPollingTimeout&&(_.unsubscribe(),l=!0,s._fireError(n.TransactionError("Transaction was not mined within "+f.transactionPollingTimeout+" seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!"),t.eventEmitter,t.reject)):m-1>=f.transactionBlockTimeout&&(_.unsubscribe(),l=!0,s._fireError(n.TransactionError("Transaction was not mined within "+f.transactionBlockTimeout+" blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!"),t.eventEmitter,t.reject))}));_.unsubscribe(),l=!0,s._fireError({message:"Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.",data:h},t.eventEmitter,t.reject)},k=function(t){i.isFunction(this.requestManager.provider.on)?S.subscribe("newBlockHeaders",x.bind(null,t,!1)):g=setInterval(x.bind(null,t,!0),1e3)}.bind(this);S.getTransactionReceipt(e).then((function(e){e&&e.blockHash?(t.eventEmitter.listeners("confirmation").length>0&&k(e),x(e,!1)):l||k()})).catch((function(){l||k()}))};var f=function(t,e){return i.isNumber(t)?e.wallet[t]:i.isObject(t)&&t.address&&t.privateKey?t:e.wallet[t.toLowerCase()]};u.prototype.buildCall=function(){var t=this,e="eth_sendTransaction"===t.call||"eth_sendRawTransaction"===t.call,r="eth_call"===t.call,o=function(){var o=a(!e),h=t.toPayload(Array.prototype.slice.call(arguments)),l=function(i,a){if(t.handleRevert&&!i&&r&&t.isRevertReasonString(a)&&t.abiCoder){var u=t.abiCoder.decodeParameter("string","0x"+a.substring(10));s._fireError(n.RevertInstructionError(u,"Error(String)"),o.eventEmitter,o.reject,h.callback,{reason:u,signature:"Error(String)"})}else{try{a=t.formatOutput(a)}catch(t){i=t}if(a instanceof Error&&(i=a),i)return i.error&&(i=i.error),s._fireError(i,o.eventEmitter,o.reject,h.callback);h.callback&&h.callback(null,a),e?(o.eventEmitter.emit("transactionHash",a),t._confirmTransaction(o,a,h)):i||o.resolve(a)}},c=function(e){var r=i.extend({},h,{method:"eth_sendRawTransaction",params:[e.rawTransaction]});t.requestManager.send(r,l)},d=function(t,e){var r;if(e&&e.accounts&&e.accounts.wallet&&e.accounts.wallet.length)if("eth_sendTransaction"===t.method){var n=t.params[0];if((r=f(i.isObject(n)?n.from:null,e.accounts))&&r.privateKey){var s=i.omit(n,"from");return e.defaultChain&&!s.chain&&(s.chain=e.defaultChain),e.defaultHardfork&&!s.hardfork&&(s.hardfork=e.defaultHardfork),e.defaultCommon&&!s.common&&(s.common=e.defaultCommon),e.accounts.signTransaction(s,r.privateKey).then(c).catch((function(t){i.isFunction(o.eventEmitter.listeners)&&o.eventEmitter.listeners("error").length&&(o.eventEmitter.emit("error",t),o.eventEmitter.removeAllListeners(),o.eventEmitter.catch((function(){}))),o.reject(t)}))}}else if("eth_sign"===t.method){var a=t.params[1];if((r=f(t.params[0],e.accounts))&&r.privateKey){var h=e.accounts.sign(a,r.privateKey);return t.callback&&t.callback(null,h.signature),void o.resolve(h.signature)}}return e.requestManager.send(t,l)};if(e&&i.isObject(h.params[0])&&void 0===h.params[0].gasPrice){var p=new u({name:"getGasPrice",call:"eth_gasPrice",params:0}).createFunction(t.requestManager);p((function(e,r){r&&(h.params[0].gasPrice=r),d(h,t)}))}else d(h,t);return o.eventEmitter};return o.method=t,o.request=this.request.bind(this),o},u.prototype.getRevertReason=function(t,e){var r=this;return new Promise((function(i,n){new u({name:"call",call:"eth_call",params:2,abiCoder:r.abiCoder,handleRevert:!0}).createFunction(r.requestManager)(t,s.numberToHex(e)).then((function(){i(!1)})).catch((function(t){t.reason?i({reason:t.reason,signature:t.signature}):n(t)}))}))},u.prototype.isRevertReasonString=function(t){return i.isString(t)&&(t.length-2)/2%32==4&&"0x08c379a0"===t.substring(0,10)},u.prototype.request=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));return t.format=this.formatOutput.bind(this),t},t.exports=u},function(t,e,r){var i=r(38),n=r(103),o=function(t){var e,r,o=new n((function(){e=arguments[0],r=arguments[1]}));if(t)return{resolve:e,reject:r,eventEmitter:o};var s=new i;return o._events=s._events,o.emit=s.emit,o.on=s.on,o.once=s.once,o.off=s.off,o.listeners=s.listeners,o.addListener=s.addListener,o.removeListener=s.removeListener,o.removeAllListeners=s.removeAllListeners,{resolve:e,reject:r,eventEmitter:o}};o.resolve=function(t){var e=o(!0);return e.resolve(t),e.eventEmitter},t.exports=o},function(t,e,r){var i=Object.prototype.hasOwnProperty,n="~";function o(){}function s(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function a(t,e,r,i,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new s(r,i||t,o),h=n?n+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function h(t,e){0==--t._eventsCount?t._events=new o:delete t._events[e]}function u(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(n=!1)),u.prototype.eventNames=function(){var t,e,r=[];if(0===this._eventsCount)return r;for(e in t=this._events)i.call(t,e)&&r.push(n?e.slice(1):e);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},u.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,s=new Array(o);i1?(t[r[0]]=t[r[0]]||{},t[r[0]][r[1]]=e):t[r[0]]=e},n.prototype.buildCall=function(){var t=this;return function(){t.subscriptions[arguments[0]]||console.warn("Subscription "+JSON.stringify(arguments[0])+" doesn't exist. Subscribing anyway.");var e=new i({subscription:t.subscriptions[arguments[0]],requestManager:t.requestManager,type:t.type});return e.subscribe.apply(e,arguments)}},t.exports={subscriptions:n,subscription:i}},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.BigNumber=function(){},e.Indexed=function(){},e.MinimalProvider=function(){},e.Signer=function(){},e.HDNode=function(){}},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.defineReadOnly=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})},e.defineFrozen=function(t,e,r){var i=JSON.stringify(r);Object.defineProperty(t,e,{enumerable:!0,get:function(){return JSON.parse(i)}})},e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach((function(i){var n=t[i];n instanceof Promise?r.push(n.then((function(t){return e[i]=t,null}))):e[i]=n})),Promise.all(r).then((function(){return e}))},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e},e.jsonCopy=function(t){return JSON.parse(JSON.stringify(t))}},function(t,e){t.exports=w},function(t,e){t.exports=M},function(t,e){t.exports=S},function(t){t.exports=JSON.parse('{"a":[{"constant":true,"inputs":[],"name":"currentEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"getEpochInfo","outputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"n","type":"uint256"},{"internalType":"uint256","name":"k","type":"uint256"},{"internalType":"uint256","name":"t","type":"uint256"},{"internalType":"address[]","name":"nodeList","type":"address[]"},{"internalType":"uint256","name":"prevEpoch","type":"uint256"},{"internalType":"uint256","name":"nextEpoch","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"nodeAddress","type":"address"}],"name":"getNodeDetails","outputs":[{"internalType":"string","name":"declaredIp","type":"string"},{"internalType":"uint256","name":"position","type":"uint256"},{"internalType":"uint256","name":"pubKx","type":"uint256"},{"internalType":"uint256","name":"pubKy","type":"uint256"},{"internalType":"string","name":"tmP2PListenAddress","type":"string"},{"internalType":"string","name":"p2pListenAddress","type":"string"}],"payable":false,"stateMutability":"view","type":"function"}]}')},function(t,e,r){var i=r(47),n=r(102);t.exports={packageInit:function(t,e){if(e=Array.prototype.slice.call(e),!t)throw new Error('You need to instantiate using the "new" keyword.');Object.defineProperty(t,"currentProvider",{get:function(){return t._provider},set:function(e){return t.setProvider(e)},enumerable:!0,configurable:!0}),e[0]&&e[0]._requestManager?t._requestManager=new i.Manager(e[0].currentProvider):(t._requestManager=new i.Manager,t._requestManager.setProvider(e[0],e[1])),t.givenProvider=i.Manager.givenProvider,t.providers=i.Manager.providers,t._provider=t._requestManager.provider,t.setProvider||(t.setProvider=function(e,r){return t._requestManager.setProvider(e,r),t._provider=t._requestManager.provider,!0}),t.BatchRequest=i.BatchManager.bind(null,t._requestManager),t.extend=n(t)},addProviders:function(t){t.givenProvider=i.Manager.givenProvider,t.providers=i.Manager.providers}}},function(t,e,r){var i=r(2),n=r(3).errors,o=r(24),s=r(68),a=r(69),h=function t(e){this.provider=null,this.providers=t.providers,this.setProvider(e),this.subscriptions={}};h.givenProvider=a,h.providers={WebsocketProvider:r(70),HttpProvider:r(80),IpcProvider:r(100)},h.prototype.setProvider=function(t,e){var r=this;if(t&&"string"==typeof t&&this.providers)if(/^http(s)?:\/\//i.test(t))t=new this.providers.HttpProvider(t);else if(/^ws(s)?:\/\//i.test(t))t=new this.providers.WebsocketProvider(t);else if(t&&"object"==typeof e&&"function"==typeof e.connect)t=new this.providers.IpcProvider(t,e);else if(t)throw new Error("Can't autodetect provider for \""+t+'"');this.provider&&this.provider.connected&&this.clearSubscriptions(),this.provider=t||null,this.provider&&this.provider.on&&this.provider.on("data",(function(t,e){(t=t||e).method&&r.subscriptions[t.params.subscription]&&r.subscriptions[t.params.subscription].callback&&r.subscriptions[t.params.subscription].callback(null,t.params.result)}))},h.prototype.send=function(t,e){if(e=e||function(){},!this.provider)return e(n.InvalidProvider());var r=o.toPayload(t.method,t.params);this.provider[this.provider.sendAsync?"sendAsync":"send"](r,(function(t,i){return i&&i.id&&r.id!==i.id?e(new Error('Wrong response id "'+i.id+'" (expected: "'+r.id+'") in '+JSON.stringify(r))):t?e(t):i&&i.error?e(n.ErrorResponse(i)):o.isValidResponse(i)?void e(null,i.result):e(n.InvalidResponse(i))}))},h.prototype.sendBatch=function(t,e){if(!this.provider)return e(n.InvalidProvider());var r=o.toBatchPayload(t);this.provider[this.provider.sendAsync?"sendAsync":"send"](r,(function(t,r){return t?e(t):i.isArray(r)?void e(null,r):e(n.InvalidResponse(r))}))},h.prototype.addSubscription=function(t,e,r,i){if(!this.provider.on)throw new Error("The provider doesn't support subscriptions: "+this.provider.constructor.name);this.subscriptions[t]={callback:i,type:r,name:e}},h.prototype.removeSubscription=function(t,e){this.subscriptions[t]&&(this.send({method:this.subscriptions[t].type+"_unsubscribe",params:[t]},e),delete this.subscriptions[t])},h.prototype.clearSubscriptions=function(t){var e=this;this.subscriptions&&Object.keys(this.subscriptions).forEach((function(r){t&&"syncing"===e.subscriptions[r].name||e.removeSubscription(r)})),this.provider.reset&&this.provider.reset()},t.exports={Manager:h,BatchManager:s}},function(t,e,r){t.exports={ErrorResponse:function(t){var e=t&&t.error&&t.error.message?t.error.message:JSON.stringify(t);return new Error("Returned error: "+e)},InvalidNumberOfParams:function(t,e,r){return new Error('Invalid number of parameters for "'+r+'". Got '+t+" expected "+e+"!")},InvalidConnection:function(t){return new Error("CONNECTION ERROR: Couldn't connect to node "+t+".")},InvalidProvider:function(){return new Error("Provider not set or invalid")},InvalidResponse:function(t){var e=t&&t.error&&t.error.message?t.error.message:"Invalid JSON RPC response: "+JSON.stringify(t);return new Error(e)},ConnectionTimeout:function(t){return new Error("CONNECTION TIMEOUT: timeout of "+t+" ms achived")},RevertInstructionError:function(t,e){var r=new Error("Your request got reverted with the following reason string: "+t);return r.reason=t,r.signature=e,r},TransactionRevertInstructionError:function(t,e,r){var i=new Error("Transaction has been reverted by the EVM:\n"+JSON.stringify(r,null,2));return i.reason=t,i.signature=e,i.receipt=r,i},TransactionError:function(t,e){var r=new Error(t);return r.receipt=e,r},NoContractAddressFoundError:function(t){return this.TransactionError("The transaction receipt didn't contain a contract address.",t)},ContractCodeNotStoredError:function(t){return this.TransactionError("The contract code couldn't be stored, please check your gas limit.",t)},TransactionRevertedWithoutReasonError:function(t){return this.TransactionError("Transaction has been reverted by the EVM:\n"+JSON.stringify(t,null,2),t)},TransactionOutOfGasError:function(t){return this.TransactionError("Transaction ran out of gas. Please provide more gas:\n"+JSON.stringify(t,null,2),t)}}},function(t,e,r){var i=r(2),n=r(5),o=r(67),s=function(t){return n.toBN(t).toString(10)},a=function(t){if(void 0!==t)return function(t){return"latest"===t||"pending"===t||"earliest"===t}(t)?t:"genesis"===t?"0x0":n.isHexStrict(t)?i.isString(t)?t.toLowerCase():t:n.numberToHex(t)},h=function(t){if(t.to&&(t.to=l(t.to)),t.data&&t.input)throw new Error('You can\'t have "data" and "input" as properties of transactions at the same time, please use either "data" or "input" instead.');if(!t.data&&t.input&&(t.data=t.input,delete t.input),t.data&&!n.isHex(t.data))throw new Error("The data field must be HEX encoded data.");return(t.gas||t.gasLimit)&&(t.gas=t.gas||t.gasLimit),["gasPrice","gas","value","nonce"].filter((function(e){return void 0!==t[e]})).forEach((function(e){t[e]=n.numberToHex(t[e])})),t},u=function(t){return null!==t.blockNumber&&(t.blockNumber=n.hexToNumber(t.blockNumber)),null!==t.transactionIndex&&(t.transactionIndex=n.hexToNumber(t.transactionIndex)),t.nonce=n.hexToNumber(t.nonce),t.gas=n.hexToNumber(t.gas),t.gasPrice=s(t.gasPrice),t.value=s(t.value),t.to&&n.isAddress(t.to)?t.to=n.toChecksumAddress(t.to):t.to=null,t.from&&(t.from=n.toChecksumAddress(t.from)),t},f=function(t){if("string"==typeof t.blockHash&&"string"==typeof t.transactionHash&&"string"==typeof t.logIndex){var e=n.sha3(t.blockHash.replace("0x","")+t.transactionHash.replace("0x","")+t.logIndex.replace("0x",""));t.id="log_"+e.replace("0x","").substr(0,8)}else t.id||(t.id=null);return null!==t.blockNumber&&(t.blockNumber=n.hexToNumber(t.blockNumber)),null!==t.transactionIndex&&(t.transactionIndex=n.hexToNumber(t.transactionIndex)),null!==t.logIndex&&(t.logIndex=n.hexToNumber(t.logIndex)),t.address&&(t.address=n.toChecksumAddress(t.address)),t},l=function(t){var e=new o(t);if(e.isValid()&&e.isDirect())return e.toAddress().toLowerCase();if(n.isAddress(t))return"0x"+t.toLowerCase().replace("0x","");throw new Error('Provided address "'+t+"\" is invalid, the capitalization checksum test failed, or its an indrect IBAN address which can't be converted.")};t.exports={inputDefaultBlockNumberFormatter:function(t){return a(this&&null==t?this.defaultBlock:t)},inputBlockNumberFormatter:a,inputCallFormatter:function(t){var e=(t=h(t)).from||(this?this.defaultAccount:null);return e&&(t.from=l(e)),t},inputTransactionFormatter:function(t){if(t=h(t),!i.isNumber(t.from)&&!i.isObject(t.from)){if(t.from=t.from||(this?this.defaultAccount:null),!t.from&&!i.isNumber(t.from))throw new Error('The send transactions "from" field must be defined!');t.from=l(t.from)}return t},inputAddressFormatter:l,inputPostFormatter:function(t){return t.ttl&&(t.ttl=n.numberToHex(t.ttl)),t.workToProve&&(t.workToProve=n.numberToHex(t.workToProve)),t.priority&&(t.priority=n.numberToHex(t.priority)),i.isArray(t.topics)||(t.topics=t.topics?[t.topics]:[]),t.topics=t.topics.map((function(t){return 0===t.indexOf("0x")?t:n.fromUtf8(t)})),t},inputLogFormatter:function(t){var e=function(t){return null==t?null:0===(t=String(t)).indexOf("0x")?t:n.fromUtf8(t)};return(t.fromBlock||0===t.fromBlock)&&(t.fromBlock=a(t.fromBlock)),(t.toBlock||0===t.toBlock)&&(t.toBlock=a(t.toBlock)),t.topics=t.topics||[],t.topics=t.topics.map((function(t){return i.isArray(t)?t.map(e):e(t)})),e=null,t.address&&(t.address=i.isArray(t.address)?t.address.map((function(t){return l(t)})):l(t.address)),t},inputSignFormatter:function(t){return n.isHexStrict(t)?t:n.utf8ToHex(t)},inputStorageKeysFormatter:function(t){return t.map(n.numberToHex)},outputProofFormatter:function(t){return t.address=n.toChecksumAddress(t.address),t.nonce=n.hexToNumberString(t.nonce),t.balance=n.hexToNumberString(t.balance),t},outputBigNumberFormatter:s,outputTransactionFormatter:u,outputTransactionReceiptFormatter:function(t){if("object"!=typeof t)throw new Error("Received receipt is invalid: "+t);return null!==t.blockNumber&&(t.blockNumber=n.hexToNumber(t.blockNumber)),null!==t.transactionIndex&&(t.transactionIndex=n.hexToNumber(t.transactionIndex)),t.cumulativeGasUsed=n.hexToNumber(t.cumulativeGasUsed),t.gasUsed=n.hexToNumber(t.gasUsed),i.isArray(t.logs)&&(t.logs=t.logs.map(f)),t.contractAddress&&(t.contractAddress=n.toChecksumAddress(t.contractAddress)),void 0!==t.status&&null!==t.status&&(t.status=Boolean(parseInt(t.status))),t},outputBlockFormatter:function(t){return t.gasLimit=n.hexToNumber(t.gasLimit),t.gasUsed=n.hexToNumber(t.gasUsed),t.size=n.hexToNumber(t.size),t.timestamp=n.hexToNumber(t.timestamp),null!==t.number&&(t.number=n.hexToNumber(t.number)),t.difficulty&&(t.difficulty=s(t.difficulty)),t.totalDifficulty&&(t.totalDifficulty=s(t.totalDifficulty)),i.isArray(t.transactions)&&t.transactions.forEach((function(t){if(!i.isString(t))return u(t)})),t.miner&&(t.miner=n.toChecksumAddress(t.miner)),t},outputLogFormatter:f,outputPostFormatter:function(t){return t.expiry=n.hexToNumber(t.expiry),t.sent=n.hexToNumber(t.sent),t.ttl=n.hexToNumber(t.ttl),t.workProved=n.hexToNumber(t.workProved),t.topics||(t.topics=[]),t.topics=t.topics.map((function(t){return n.toUtf8(t)})),t},outputSyncingFormatter:function(t){return t.startingBlock=n.hexToNumber(t.startingBlock),t.currentBlock=n.hexToNumber(t.currentBlock),t.highestBlock=n.hexToNumber(t.highestBlock),t.knownStates&&(t.knownStates=n.hexToNumber(t.knownStates),t.pulledStates=n.hexToNumber(t.pulledStates)),t}}},function(t,e,r){var i=r(51),n=r(22),o=new i(0),s=new i(-1),a={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"};function h(t){var e=t?t.toLowerCase():"ether",r=a[e];if("string"!=typeof r)throw new Error("[ethjs-unit] the unit provided "+t+" doesn't exists, please use the one of the following units "+JSON.stringify(a,null,2));return new i(r,10)}function u(t){if("string"==typeof t){if(!t.match(/^-?[0-9.]+$/))throw new Error("while converting number to string, invalid number value '"+t+"', should be a number matching (^-?[0-9.]+).");return t}if("number"==typeof t)return String(t);if("object"==typeof t&&t.toString&&(t.toTwos||t.dividedToIntegerBy))return t.toPrecision?String(t.toPrecision()):t.toString(10);throw new Error("while converting number to string, invalid number value '"+t+"' type "+typeof t+".")}t.exports={unitMap:a,numberToString:u,getValueOfUnit:h,fromWei:function(t,e,r){var i=n(t),u=i.lt(o),f=h(e),l=a[e].length-1||1,c=r||{};u&&(i=i.mul(s));for(var d=i.mod(f).toString(10);d.length2)throw new Error("[ethjs-unit] while converting number "+t+" to wei, too many decimal points");var c=l[0],d=l[1];if(c||(c="0"),d||(d="0"),d.length>o)throw new Error("[ethjs-unit] while converting number "+t+" to wei, too many decimal places");for(;d.length=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(9)(t))},function(t,e,r){e.byteLength=function(t){var e=u(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,i=u(t),s=i[0],a=i[1],h=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),f=0,l=a>0?s-4:s;for(r=0;r>16&255,h[f++]=e>>8&255,h[f++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,h[f++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,h[f++]=e>>8&255,h[f++]=255&e),h},e.fromByteArray=function(t){for(var e,r=t.length,n=r%3,o=[],s=0,a=r-n;sa?a:s+16383));return 1===n?(e=t[r-1],o.push(i[e>>2]+i[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],o.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"=")),o.join("")};for(var i=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,h=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var n,o,s=[],a=e;a>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,i,n){var o,s,a=8*n-i-1,h=(1<>1,f=-7,l=r?n-1:0,c=r?-1:1,d=t[e+l];for(l+=c,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+t[e+l],l+=c,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=i;f>0;s=256*s+t[e+l],l+=c,f-=8);if(0===o)o=1-u;else{if(o===h)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),o-=u}return(d?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,r,i,n,o){var s,a,h,u=8*o-n-1,f=(1<>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-s))<1&&(s--,h*=2),(e+=s+l>=1?c/h:c*Math.pow(2,1-l))*h>=2&&(s++,h/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*h-1)*Math.pow(2,n),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,n),s=0));n>=8;t[r+d]=255&a,d+=p,a/=256,n-=8);for(s=s<0;t[r+d]=255&s,d+=p,s/=256,u-=8);t[r+d-p]|=128*m}},function(t,e,r){(function(t){!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(1).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(9)(t))},function(t,e,r){var i=r(56);t.exports=function(t){return"string"!=typeof t?t:i(t)?t.slice(2):t}},function(t,e){t.exports=function(t){if("string"!=typeof t)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof t+", while checking isHexPrefixed.");return"0x"===t.slice(0,2)}},function(t,e){},function(t,e,r){!function(t){var e,r,i,n=String.fromCharCode;function o(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n=55296&&t<=57343)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function a(t,e){return n(t>>e&63|128)}function h(t){if(0==(4294967168&t))return n(t);var e="";return 0==(4294965248&t)?e=n(t>>6&31|192):0==(4294901760&t)?(s(t),e=n(t>>12&15|224),e+=a(t,6)):0==(4292870144&t)&&(e=n(t>>18&7|240),e+=a(t,12),e+=a(t,6)),e+n(63&t|128)}function u(){if(i>=r)throw Error("Invalid byte index");var t=255&e[i];if(i++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function f(){var t,n;if(i>r)throw Error("Invalid byte index");if(i==r)return!1;if(t=255&e[i],i++,0==(128&t))return t;if(192==(224&t)){if((n=(31&t)<<6|u())>=128)return n;throw Error("Invalid continuation byte")}if(224==(240&t)){if((n=(15&t)<<12|u()<<6|u())>=2048)return s(n),n;throw Error("Invalid continuation byte")}if(240==(248&t)&&(n=(7&t)<<18|u()<<12|u()<<6|u())>=65536&&n<=1114111)return n;throw Error("Invalid UTF-8 detected")}t.version="3.0.0",t.encode=function(t){for(var e=o(t),r=e.length,i=-1,n="";++i65535&&(o+=n((e-=65536)>>>10&1023|55296),e=56320|1023&e),o+=n(e);return o}(a)}}(e)},function(t,e){var r="0123456789abcdef".split(""),i=[1,256,65536,16777216],n=[0,8,16,24],o=[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],s=function(t){var e,r,i,n,s,a,h,u,f,l,c,d,p,m,v,g,y,b,w,M,_,S,x,k,A,E,B,O,R,I,T,j,C,N,P,L,q,D,U,F,z,H,Z,W,K,V,G,Y,J,X,$,Q,tt,et,rt,it,nt,ot,st,at,ht,ut,ft;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],h=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],f=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|h>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(h<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(u<<1|f>>>31),r=s^(f<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(l<<1|c>>>31),r=h^(c<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(d<<1|p>>>31),r=f^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(n<<1|s>>>31),r=c^(s<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,m=t[0],v=t[1],V=t[11]<<4|t[10]>>>28,G=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,R=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ht=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,N=t[2]<<1|t[3]>>>31,P=t[3]<<1|t[2]>>>31,g=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,Y=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,I=t[33]<<13|t[32]>>>19,T=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,q=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,$=t[35]<<15|t[34]>>>17,j=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,k=t[6]<<28|t[7]>>>4,A=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,W=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,E=t[18]<<20|t[19]>>>12,B=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,S=t[48]<<14|t[49]>>>18,x=t[49]<<14|t[48]>>>18,t[0]=m^~g&b,t[1]=v^~y&w,t[10]=k^~E&O,t[11]=A^~B&R,t[20]=N^~L&D,t[21]=P^~q&U,t[30]=W^~V&Y,t[31]=K^~G&J,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=g^~b&M,t[3]=y^~w&_,t[12]=E^~O&I,t[13]=B^~R&T,t[22]=L^~D&F,t[23]=q^~U&z,t[32]=V^~Y&X,t[33]=G^~J&$,t[42]=it^~ot&at,t[43]=nt^~st&ht,t[4]=b^~M&S,t[5]=w^~_&x,t[14]=O^~I&j,t[15]=R^~T&C,t[24]=D^~F&H,t[25]=U^~z&Z,t[34]=Y^~X&Q,t[35]=J^~$&tt,t[44]=ot^~at&ut,t[45]=st^~ht&ft,t[6]=M^~S&m,t[7]=_^~x&v,t[16]=I^~j&k,t[17]=T^~C&A,t[26]=F^~H&N,t[27]=z^~Z&P,t[36]=X^~Q&W,t[37]=$^~tt&K,t[46]=at^~ut&et,t[47]=ht^~ft&rt,t[8]=S^~m&g,t[9]=x^~v&y,t[18]=j^~k&E,t[19]=C^~A&B,t[28]=H^~N&L,t[29]=Z^~P&q,t[38]=Q^~W&V,t[39]=tt^~K&G,t[48]=ut^~et&it,t[49]=ft^~rt&nt,t[0]^=o[i],t[1]^=o[i+1]},a=function(t){return function(e){var o;if("0x"===e.slice(0,2)){o=[];for(var a=2,h=e.length;a>2]|=e[d]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(h[v>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=u){for(t.start=v-u,t.block=h[f],v=0;v>2]|=i[3&v],t.lastByteIndex===u)for(h[0]=h[f],v=1;v>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];g%f==0&&(s(c),v=0)}return"0x"+m}(function(t){return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e}(t),o)}};t.exports={keccak256:a(256),keccak512:a(512),keccak256s:a(256),keccak512s:a(512)}},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0});var i=r(61);function n(t){return!("string"!=typeof t||!/^(0x)?[0-9a-f]{512}$/i.test(t)||!/^(0x)?[0-9a-f]{512}$/.test(t)&&!/^(0x)?[0-9A-F]{512}$/.test(t))}function o(t,e){"object"==typeof e&&e.constructor===Uint8Array&&(e=i.bytesToHex(e));for(var r=i.keccak256(e).replace("0x",""),n=0;n<12;n+=4){var o=(parseInt(r.substr(n,2),16)<<8)+parseInt(r.substr(n+2,2),16)&2047,a=1<=48&&t<=57)return t-48;if(t>=65&&t<=70)return t-55;if(t>=97&&t<=102)return t-87;throw new Error("invalid bloom")}function a(t){return!("string"!=typeof t||!/^(0x)?[0-9a-f]{64}$/i.test(t)||!/^(0x)?[0-9a-f]{64}$/.test(t)&&!/^(0x)?[0-9A-F]{64}$/.test(t))}function h(t){return!("string"!=typeof t||!t.match(/^(0x)?[0-9a-fA-F]{40}$/)&&!t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/))}e.isBloom=n,e.isInBloom=o,e.isUserEthereumAddressInBloom=function(t,e){if(!n(t))throw new Error("Invalid bloom given");if(!h(e))throw new Error('Invalid ethereum address given: "'.concat(e,'"'));return o(t,i.padLeft(e,64))},e.isContractAddressInBloom=function(t,e){if(!n(t))throw new Error("Invalid bloom given");if(!h(e))throw new Error('Invalid contract address given: "'.concat(e,'"'));return o(t,e)},e.isTopicInBloom=function(t,e){if(!n(t))throw new Error("Invalid bloom given");if(!a(e))throw new Error("Invalid topic");return o(t,e)},e.isTopic=a,e.isAddress=h},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0});var i=r(62);function n(t){if(null==t)throw new Error("cannot convert null value to array");if("string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);if(!e)throw new Error("invalid hexidecimal string");if("0x"!==e[1])throw new Error("hex string must have 0x prefix");(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],i=0;i=256||parseInt(String(r))!=r)return!1}return!0}(t))return o(new Uint8Array(t));throw new Error("invalid arrayify value")}function o(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return o(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}e.keccak256=function(t){return"0x"+i.keccak_256(n(t))},e.padLeft=function(t,e){var r=/^0x/i.test(t)||"number"==typeof t,i=e-(t=t.toString().replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(r?"0x":"")+new Array(i).join("0")+t},e.bytesToHex=function(t){for(var e=[],r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return"0x".concat(e.join("").replace(/^0+/,""))},e.toByteArray=n},function(t,e,r){(function(i,n){var o;!function(){var s="input is invalid type",a="object"==typeof window,h=a?window:{};h.JS_SHA3_NO_WINDOW&&(a=!1);var u=!a&&"object"==typeof self;!h.JS_SHA3_NO_NODE_JS&&"object"==typeof i&&i.versions&&i.versions.node?h=n:u&&(h=self);var f=!h.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,l=r(63),c=!h.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),p=[4,1024,262144,67108864],m=[0,8,16,24],v=[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],g=[224,256,384,512],y=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],w={128:168,256:136};!h.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!c||!h.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var M=function(t,e,r){return function(i){return new P(t,e,t).update(i)[r]()}},_=function(t,e,r){return function(i,n){return new P(t,e,n).update(i)[r]()}},S=function(t,e,r){return function(e,i,n,o){return B["cshake"+t].update(e,i,n,o)[r]()}},x=function(t,e,r){return function(e,i,n,o){return B["kmac"+t].update(e,i,n,o)[r]()}},k=function(t,e,r,i){for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}function L(t,e,r){P.call(this,t,e,r)}P.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(s);if(null===t)throw new Error(s);if(c&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||c&&ArrayBuffer.isView(t)))throw new Error(s);e=!0}for(var i,n,o=this.blocks,a=this.byteCount,h=t.length,u=this.blockCount,f=0,l=this.s;f>2]|=t[f]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[i>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=a){for(this.start=i-a,this.block=o[u],i=0;i>=8);r>0;)n.unshift(r),r=255&(t>>=8),++i;return e?n.push(i):n.unshift(i),this.update(n),n.length},P.prototype.encodeString=function(t){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(s);if(null===t)throw new Error(s);if(c&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||c&&ArrayBuffer.isView(t)))throw new Error(s);e=!0}var i=0,n=t.length;if(e)i=n;else for(var o=0;o=57344?i+=3:(a=65536+((1023&a)<<10|1023&t.charCodeAt(++o)),i+=4)}return i+=this.encode(8*i),this.update(t),i},P.prototype.bytepad=function(t,e){for(var r=this.encode(e),i=0;i>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+d[15&t]+d[t>>12&15]+d[t>>8&15]+d[t>>20&15]+d[t>>16&15]+d[t>>28&15]+d[t>>24&15];s%e==0&&(q(r),o=0)}return n&&(t=r[o],a+=d[t>>4&15]+d[15&t],n>1&&(a+=d[t>>12&15]+d[t>>8&15]),n>2&&(a+=d[t>>20&15]+d[t>>16&15])),a},P.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var h=new Uint32Array(t);s>8&255,h[t+2]=e>>16&255,h[t+3]=e>>24&255;a%r==0&&q(i)}return o&&(t=a<<2,e=i[s],h[t]=255&e,o>1&&(h[t+1]=e>>8&255),o>2&&(h[t+2]=e>>16&255)),h},L.prototype=new P,L.prototype.finalize=function(){return this.encode(this.outputBits,!0),P.prototype.finalize.call(this)};var q=function(t){var e,r,i,n,o,s,a,h,u,f,l,c,d,p,m,g,y,b,w,M,_,S,x,k,A,E,B,O,R,I,T,j,C,N,P,L,q,D,U,F,z,H,Z,W,K,V,G,Y,J,X,$,Q,tt,et,rt,it,nt,ot,st,at,ht,ut,ft;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],u=t[5]^t[15]^t[25]^t[35]^t[45],f=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(c=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(h<<1|u>>>31),r=o^(u<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(f<<1|l>>>31),r=a^(l<<1|f>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(c<<1|d>>>31),r=u^(d<<1|c>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=f^(n<<1|o>>>31),r=l^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],m=t[1],V=t[11]<<4|t[10]>>>28,G=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,R=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ht=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,N=t[2]<<1|t[3]>>>31,P=t[3]<<1|t[2]>>>31,g=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,Y=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,I=t[33]<<13|t[32]>>>19,T=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,q=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,$=t[35]<<15|t[34]>>>17,j=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,k=t[6]<<28|t[7]>>>4,A=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,W=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,E=t[18]<<20|t[19]>>>12,B=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,S=t[48]<<14|t[49]>>>18,x=t[49]<<14|t[48]>>>18,t[0]=p^~g&b,t[1]=m^~y&w,t[10]=k^~E&O,t[11]=A^~B&R,t[20]=N^~L&D,t[21]=P^~q&U,t[30]=W^~V&Y,t[31]=K^~G&J,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=g^~b&M,t[3]=y^~w&_,t[12]=E^~O&I,t[13]=B^~R&T,t[22]=L^~D&F,t[23]=q^~U&z,t[32]=V^~Y&X,t[33]=G^~J&$,t[42]=it^~ot&at,t[43]=nt^~st&ht,t[4]=b^~M&S,t[5]=w^~_&x,t[14]=O^~I&j,t[15]=R^~T&C,t[24]=D^~F&H,t[25]=U^~z&Z,t[34]=Y^~X&Q,t[35]=J^~$&tt,t[44]=ot^~at&ut,t[45]=st^~ht&ft,t[6]=M^~S&p,t[7]=_^~x&m,t[16]=I^~j&k,t[17]=T^~C&A,t[26]=F^~H&N,t[27]=z^~Z&P,t[36]=X^~Q&W,t[37]=$^~tt&K,t[46]=at^~ut&et,t[47]=ht^~ft&rt,t[8]=S^~p&g,t[9]=x^~m&y,t[18]=j^~k&E,t[19]=C^~A&B,t[28]=H^~N&L,t[29]=Z^~P&q,t[38]=Q^~W&V,t[39]=tt^~K&G,t[48]=ut^~et&it,t[49]=ft^~rt&nt,t[0]^=v[i],t[1]^=v[i+1]};if(f)t.exports=B;else{for(R=0;R32||i256)throw new Error("Invalid uint"+i+" size");if((a=s(e)).bitLength()>i)throw new Error("Supplied uint exceeds width: "+i+" vs "+a.bitLength());if(a.lt(new n(0)))throw new Error("Supplied uint "+a.toString()+" is negative");return i?o.leftPad(a.toString("hex"),i/8*2):a}if(t.startsWith("int")){if(i%8||i<8||i>256)throw new Error("Invalid int"+i+" size");if((a=s(e)).bitLength()>i)throw new Error("Supplied int exceeds width: "+i+" vs "+a.bitLength());return a.lt(new n(0))?a.toTwos(i).toString("hex"):i?o.leftPad(a.toString("hex"),i/8*2):a}throw new Error("Unsupported or invalid type: "+t)},h=function(t){if(i.isArray(t))throw new Error("Autodetection of array types is not supported.");var e,r,s="";if(i.isObject(t)&&(t.hasOwnProperty("v")||t.hasOwnProperty("t")||t.hasOwnProperty("value")||t.hasOwnProperty("type"))?(e=t.hasOwnProperty("t")?t.t:t.type,s=t.hasOwnProperty("v")?t.v:t.value):(e=o.toHex(t,!0),s=o.toHex(t),e.startsWith("int")||e.startsWith("uint")||(e="bytes")),!e.startsWith("int")&&!e.startsWith("uint")||"string"!=typeof s||/^(-)?0x/i.test(s)||(s=new n(s)),i.isArray(s)){if((r=function(t){var e=/^\D+\d*\[(\d+)\]$/.exec(t);return e?parseInt(e[1],10):null}(e))&&s.length!==r)throw new Error(e+" is not matching the given array "+JSON.stringify(s));r=s.length}return i.isArray(s)?s.map((function(t){return a(e,t,r).toString("hex").replace("0x","")})).join(""):a(e,s,r).toString("hex").replace("0x","")};t.exports={soliditySha3:function(){var t=Array.prototype.slice.call(arguments),e=i.map(t,h);return o.sha3("0x"+e.join(""))},soliditySha3Raw:function(){return o.sha3Raw("0x"+i.map(Array.prototype.slice.call(arguments),h).join(""))}}},function(t,e,r){(function(e,i){var n=r(66).Buffer,o=e.crypto||e.msCrypto;o&&o.getRandomValues?t.exports=function(t,e){if(t>4294967295)throw new RangeError("requested too many random bytes");var r=n.allocUnsafe(t);if(t>0)if(t>65536)for(var s=0;s=e&&i<=r?i-e+10:t})).join("")},s=function(t){for(var e,r=t;r.length>2;)e=r.slice(0,9),r=parseInt(e,10)%97+r.slice(e.length);return parseInt(r,10)%97},a=function(t){this._iban=t};a.toAddress=function(t){if(!(t=new a(t)).isDirect())throw new Error("IBAN is indirect and can't be converted");return t.toAddress()},a.toIban=function(t){return a.fromAddress(t).toString()},a.fromAddress=function(t){if(!i.isAddress(t))throw new Error("Provided address is not a valid address: "+t);t=t.replace("0x","").replace("0X","");var e=function(t,e){for(var r=t;r.length<30;)r="0"+r;return r}(new n(t,16).toString(36));return a.fromBban(e.toUpperCase())},a.fromBban=function(t){var e=("0"+(98-s(o("XE00"+t)))).slice(-2);return new a("XE"+e+t)},a.createIndirect=function(t){return a.fromBban("ETH"+t.institution+t.identifier)},a.isValid=function(t){return new a(t).isValid()},a.prototype.isValid=function(){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(this._iban)&&1===s(o(this._iban))},a.prototype.isDirect=function(){return 34===this._iban.length||35===this._iban.length},a.prototype.isIndirect=function(){return 20===this._iban.length},a.prototype.checksum=function(){return this._iban.substr(2,2)},a.prototype.institution=function(){return this.isIndirect()?this._iban.substr(7,4):""},a.prototype.client=function(){return this.isIndirect()?this._iban.substr(11):""},a.prototype.toAddress=function(){if(this.isDirect()){var t=this._iban.substr(4),e=new n(t,36);return i.toChecksumAddress(e.toString(16,20))}return""},a.prototype.toString=function(){return this._iban},t.exports=a},function(t,e,r){var i=r(24),n=r(3).errors,o=function(t){this.requestManager=t,this.requests=[]};o.prototype.add=function(t){this.requests.push(t)},o.prototype.execute=function(){var t=this.requests;this.requestManager.sendBatch(t,(function(e,r){r=r||[],t.map((function(t,e){return r[e]||{}})).forEach((function(e,r){if(t[r].callback){if(e&&e.error)return t[r].callback(n.ErrorResponse(e));if(!i.isValidResponse(e))return t[r].callback(n.InvalidResponse(e));try{t[r].callback(null,t[r].format?t[r].format(e.result):e.result)}catch(e){t[r].callback(e)}}}))}))},t.exports=o},function(t,e,r){var i,n=null;try{i=Function("return this")()}catch(t){i=window}void 0!==i.ethereumProvider?n=i.ethereumProvider:void 0!==i.web3&&i.web3.currentProvider&&(i.web3.currentProvider.sendAsync&&(i.web3.currentProvider.send=i.web3.currentProvider.sendAsync,delete i.web3.currentProvider.sendAsync),!i.web3.currentProvider.on&&i.web3.currentProvider.connection&&"ipcProviderWrapper"===i.web3.currentProvider.connection.constructor.name&&(i.web3.currentProvider.on=function(t,e){if("function"!=typeof e)throw new Error("The second parameter callback must be a function.");switch(t){case"data":this.connection.on("data",(function(t){var r="";t=t.toString();try{r=JSON.parse(t)}catch(r){return e(new Error("Couldn't parse response data"+t))}r.id||-1===r.method.indexOf("_subscription")||e(null,r)}));break;default:this.connection.on(t,e)}}),n=i.web3.currentProvider),t.exports=n},function(t,e,r){(function(e,i){var n=r(2),o=r(3).errors,s=r(71).w3cwebsocket,a="[object process]"===Object.prototype.toString.call(void 0!==e?e:0),h=null,u=null;if(a){h=function(t){return i.from(t).toString("base64")};var f=r(11);if(f.URL){var l=f.URL;u=function(t){return new l(t)}}else u=r(11).parse}else h=btoa,u=function(t){return new URL(t)};var c=function(t,e){if(!s)throw new Error("websocket is not available");var r=this;this.responseCallbacks={},this.notificationCallbacks=[],e=e||{},this._customTimeout=e.timeout;var i=u(t),o=e.headers||{},a=e.protocol||void 0;i.username&&i.password&&(o.authorization="Basic "+h(i.username+":"+i.password));var f=e.clientConfig||void 0,l=e.requestOptions||void 0;i.auth&&(o.authorization="Basic "+h(i.auth)),this.connection=new s(t,a,void 0,o,l,f),this.addDefaultEvents(),this.connection.onmessage=function(t){var e="string"==typeof t.data?t.data:"";r._parseResponse(e).forEach((function(t){var e=null;n.isArray(t)?t.forEach((function(t){r.responseCallbacks[t.id]&&(e=t.id)})):e=t.id,!e&&t&&t.method&&-1!==t.method.indexOf("_subscription")?r.notificationCallbacks.forEach((function(e){n.isFunction(e)&&e(t)})):r.responseCallbacks[e]&&(r.responseCallbacks[e](null,t),delete r.responseCallbacks[e])}))},Object.defineProperty(this,"connected",{get:function(){return this.connection&&this.connection.readyState===this.connection.OPEN},enumerable:!0})};c.prototype.addDefaultEvents=function(){var t=this;this.connection.onerror=function(){t._timeout()},this.connection.onclose=function(){t._timeout(),t.reset()}},c.prototype._parseResponse=function(t){var e=this,r=[];return t.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach((function(t){e.lastChunk&&(t=e.lastChunk+t);var i=null;try{i=JSON.parse(t)}catch(r){return e.lastChunk=t,clearTimeout(e.lastChunkTimeout),void(e.lastChunkTimeout=setTimeout((function(){throw e._timeout(),o.InvalidResponse(t)}),15e3))}clearTimeout(e.lastChunkTimeout),e.lastChunk=null,i&&r.push(i)})),r},c.prototype._addResponseCallback=function(t,e){var r=t.id||t[0].id,i=t.method||t[0].method;this.responseCallbacks[r]=e,this.responseCallbacks[r].method=i;var n=this;this._customTimeout&&setTimeout((function(){n.responseCallbacks[r]&&(n.responseCallbacks[r](o.ConnectionTimeout(n._customTimeout)),delete n.responseCallbacks[r])}),this._customTimeout)},c.prototype._timeout=function(){for(var t in this.responseCallbacks)this.responseCallbacks.hasOwnProperty(t)&&(this.responseCallbacks[t](o.InvalidConnection("on WS")),delete this.responseCallbacks[t])},c.prototype.send=function(t,e){var r=this;if(this.connection.readyState!==this.connection.CONNECTING){if(this.connection.readyState!==this.connection.OPEN)return console.error("connection not open on send()"),"function"==typeof this.connection.onerror?this.connection.onerror(new Error("connection not open")):console.error("no error callback"),void e(new Error("connection not open"));this.connection.send(JSON.stringify(t)),this._addResponseCallback(t,e)}else setTimeout((function(){r.send(t,e)}),10)},c.prototype.on=function(t,e){if("function"!=typeof e)throw new Error("The second parameter callback must be a function.");switch(t){case"data":this.notificationCallbacks.push(e);break;case"connect":this.connection.onopen=e;break;case"end":this.connection.onclose=e;break;case"error":this.connection.onerror=e}},c.prototype.removeListener=function(t,e){var r=this;switch(t){case"data":this.notificationCallbacks.forEach((function(t,i){t===e&&r.notificationCallbacks.splice(i,1)}))}},c.prototype.removeAllListeners=function(t){switch(t){case"data":this.notificationCallbacks=[];break;case"connect":this.connection.onopen=null;break;case"end":this.connection.onclose=null;break;case"error":this.connection.onerror=null}},c.prototype.reset=function(){this._timeout(),this.notificationCallbacks=[],this.addDefaultEvents()},c.prototype.disconnect=function(){this.connection&&this.connection.close()},c.prototype.supportsSubscriptions=function(){return!0},t.exports=c}).call(this,r(4),r(1).Buffer)},function(t,e,r){var i;try{i=r(72)}catch(t){}finally{if(i||"undefined"==typeof window||(i=window),!i)throw new Error("Could not determine global this")}var n=i.WebSocket||i.MozWebSocket,o=r(73);function s(t,e){return e?new n(t,e):new n(t)}n&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(t){Object.defineProperty(s,t,{get:function(){return n[t]}})})),t.exports={w3cwebsocket:n?s:null,version:o}},function(t,e){var r=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};t.exports=function(){if(this)return this;if("object"==typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return r()}try{return __global__||r()}finally{delete Object.prototype.__global__}}()},function(t,e,r){t.exports=r(74).version},function(t){t.exports=JSON.parse('{"_from":"@web3-js/websocket@^1.0.29","_id":"@web3-js/websocket@1.0.30","_inBundle":false,"_integrity":"sha512-fDwrD47MiDrzcJdSeTLF75aCcxVVt8B1N74rA+vh2XCAvFy4tEWJjtnUtj2QG7/zlQ6g9cQ88bZFBxwd9/FmtA==","_location":"/@web3-js/websocket","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"@web3-js/websocket@^1.0.29","name":"@web3-js/websocket","escapedName":"@web3-js%2fwebsocket","scope":"@web3-js","rawSpec":"^1.0.29","saveSpec":null,"fetchSpec":"^1.0.29"},"_requiredBy":["/web3-providers-ws"],"_resolved":"https://registry.npmjs.org/@web3-js/websocket/-/websocket-1.0.30.tgz","_shasum":"9ea15b7b582cf3bf3e8bc1f4d3d54c0731a87f87","_spec":"@web3-js/websocket@^1.0.29","_where":"/home/chai/source/repos/torus/fetch-node-details/node_modules/web3-providers-ws","author":{"name":"Brian McKelvey","email":"theturtle32@gmail.com","url":"https://github.com/theturtle32"},"browser":"lib/browser.js","bugs":{"url":"https://github.com/web3-js/WebSocket-Node/issues"},"bundleDependencies":false,"config":{"verbose":false},"contributors":[{"name":"I\xf1aki Baz Castillo","email":"ibc@aliax.net","url":"http://dev.sipdoc.net"}],"dependencies":{"debug":"^2.2.0","es5-ext":"^0.10.50","nan":"^2.14.0","typedarray-to-buffer":"^3.1.5","yaeti":"^0.0.6"},"deprecated":false,"description":"Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.","devDependencies":{"buffer-equal":"^1.0.0","faucet":"^0.0.1","gulp":"^4.0.2","gulp-jshint":"^2.0.4","jshint":"^2.0.0","jshint-stylish":"^2.2.1","tape":"^4.9.1"},"directories":{"lib":"./lib"},"engines":{"node":">=0.10.0"},"homepage":"https://github.com/web3-js/WebSocket-Node","keywords":["websocket","websockets","socket","networking","comet","push","RFC-6455","realtime","server","client"],"license":"Apache-2.0","main":"index","name":"@web3-js/websocket","repository":{"type":"git","url":"git+https://github.com/web3-js/WebSocket-Node.git"},"scripts":{"gulp":"gulp","install":"(node-gyp rebuild 2> builderror.log) || (exit 0)","test":"faucet test/unit"},"version":"1.0.30"}')},function(t,e,r){(function(t,i){var n;!function(o){e&&e.nodeType,t&&t.nodeType;var s="object"==typeof i&&i;s.global!==s&&s.window!==s&&s.self;var a,h=2147483647,u=/^xn--/,f=/[^\x20-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,c={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,p=String.fromCharCode;function m(t){throw new RangeError(c[t])}function v(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function g(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+v((t=t.replace(l,".")).split("."),e).join(".")}function y(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+p(t)})).join("")}function w(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,r){var i=0;for(t=r?d(t/700):t>>1,t+=d(t/e);t>455;i+=36)t=d(t/35);return d(i+36*t/(t+38))}function _(t){var e,r,i,n,o,s,a,u,f,l,c,p=[],v=t.length,g=0,y=128,w=72;for((r=t.lastIndexOf("-"))<0&&(r=0),i=0;i=128&&m("not-basic"),p.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=v&&m("invalid-input"),((u=(c=t.charCodeAt(n++))-48<10?c-22:c-65<26?c-65:c-97<26?c-97:36)>=36||u>d((h-g)/s))&&m("overflow"),g+=u*s,!(u<(f=a<=w?1:a>=w+26?26:a-w));a+=36)s>d(h/(l=36-f))&&m("overflow"),s*=l;w=M(g-o,e=p.length+1,0==o),d(g/e)>h-y&&m("overflow"),y+=d(g/e),g%=e,p.splice(g++,0,y)}return b(p)}function S(t){var e,r,i,n,o,s,a,u,f,l,c,v,g,b,_,S=[];for(v=(t=y(t)).length,e=128,r=0,o=72,s=0;s=e&&cd((h-r)/(g=i+1))&&m("overflow"),r+=(a-e)*g,e=a,s=0;sh&&m("overflow"),c==e){for(u=r,f=36;!(u<(l=f<=o?1:f>=o+26?26:f-o));f+=36)_=u-l,b=36-l,S.push(p(w(l+_%b,0))),u=d(_/b);S.push(p(w(u,0))),o=M(r,g,i==n),r=0,++i}++r,++e}return S.join("")}a={version:"1.4.1",ucs2:{decode:y,encode:b},decode:_,encode:S,toASCII:function(t){return g(t,(function(t){return f.test(t)?"xn--"+S(t):t}))},toUnicode:function(t){return g(t,(function(t){return u.test(t)?_(t.slice(4).toLowerCase()):t}))}},void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()}).call(this,r(9)(t),r(0))},function(t,e,r){t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,r){e.decode=e.parse=r(78),e.encode=e.stringify=r(79)},function(t,e,r){function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,r,o){e=e||"&",r=r||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var h=1e3;o&&"number"==typeof o.maxKeys&&(h=o.maxKeys);var u=t.length;h>0&&u>h&&(u=h);for(var f=0;f=0?(l=m.substr(0,v),c=m.substr(v+1)):(l=m,c=""),d=decodeURIComponent(l),p=decodeURIComponent(c),i(s,d)?n(s[d])?s[d].push(p):s[d]=[s[d],p]:s[d]=p}return s};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,r){var i=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,r,a){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?o(s(t),(function(s){var a=encodeURIComponent(i(s))+r;return n(t[s])?o(t[s],(function(t){return a+encodeURIComponent(i(t))})).join(e):a+encodeURIComponent(i(t[s]))})).join(e):a?encodeURIComponent(i(a))+r+encodeURIComponent(i(t)):""};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var r=[],i=0;i=0)return this._url=this._parseUrl(e.headers.location),this._method="GET",this._loweredHeaders["content-type"]&&(delete this._headers[this._loweredHeaders["content-type"]],delete this._loweredHeaders["content-type"]),null!=this._headers["Content-Type"]&&delete this._headers["Content-Type"],delete this._headers["Content-Length"],this.upload._reset(),this._finalizeHeaders(),void this._sendHxxpRequest();this._response=e,this._response.on("data",(function(t){return i._onHttpResponseData(e,t)})),this._response.on("end",(function(){return i._onHttpResponseEnd(e)})),this._response.on("close",(function(){return i._onHttpResponseClose(e)})),this.responseUrl=this._url.href.split("#")[0],this.status=e.statusCode,this.statusText=a.STATUS_CODES[this.status],this._parseResponseHeaders(e);var n=this._responseHeaders["content-length"]||"";this._totalBytes=+n,this._lengthComputable=!!n,this._setReadyState(r.HEADERS_RECEIVED)}},r.prototype._onHttpResponseData=function(t,e){this._response===t&&(this._responseParts.push(new i(e)),this._loadedBytes+=e.length,this.readyState!==r.LOADING&&this._setReadyState(r.LOADING),this._dispatchProgress("progress"))},r.prototype._onHttpResponseEnd=function(t){this._response===t&&(this._parseResponse(),this._request=null,this._response=null,this._setReadyState(r.DONE),this._dispatchProgress("load"),this._dispatchProgress("loadend"))},r.prototype._onHttpResponseClose=function(t){if(this._response===t){var e=this._request;this._setError(),e.abort(),this._setReadyState(r.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend")}},r.prototype._onHttpTimeout=function(t){this._request===t&&(this._setError(),t.abort(),this._setReadyState(r.DONE),this._dispatchProgress("timeout"),this._dispatchProgress("loadend"))},r.prototype._onHttpRequestError=function(t,e){this._request===t&&(this._setError(),t.abort(),this._setReadyState(r.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend"))},r.prototype._dispatchProgress=function(t){var e=new r.ProgressEvent(t);e.lengthComputable=this._lengthComputable,e.loaded=this._loadedBytes,e.total=this._totalBytes,this.dispatchEvent(e)},r.prototype._setError=function(){this._request=null,this._response=null,this._responseHeaders=null,this._responseParts=null},r.prototype._parseUrl=function(t,e,r){var i=null==this.nodejsBaseUrl?t:f.resolve(this.nodejsBaseUrl,t),n=f.parse(i,!1,!0);n.hash=null;var o=(n.auth||"").split(":"),s=o[0],a=o[1];return(s||a||e||r)&&(n.auth=(e||s||"")+":"+(r||a||"")),n},r.prototype._parseResponseHeaders=function(t){for(var e in this._responseHeaders={},t.headers){var r=e.toLowerCase();this._privateHeaders[r]||(this._responseHeaders[r]=t.headers[e])}null!=this._mimeOverride&&(this._responseHeaders["content-type"]=this._mimeOverride)},r.prototype._parseResponse=function(){var t=i.concat(this._responseParts);switch(this._responseParts=null,this.responseType){case"json":this.responseText=null;try{this.response=JSON.parse(t.toString("utf-8"))}catch(t){this.response=null}return;case"buffer":return this.responseText=null,void(this.response=t);case"arraybuffer":this.responseText=null;for(var e=new ArrayBuffer(t.length),r=new Uint8Array(e),n=0;n0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;for(var e,r,n=i.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=n,r=s,o.data.copy(e,r),s+=o.data.length,o=o.next;return n},t}(),n&&n.inspect&&n.inspect.custom&&(t.exports.prototype[n.inspect.custom]=function(){var t=n.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,r){(function(t){var i=void 0!==t&&t||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(n.call(setTimeout,i,arguments),clearTimeout)},e.setInterval=function(){return new o(n.call(setInterval,i,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(i,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(88),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(0))},function(t,e,r){(function(t,e){!function(t,r){if(!t.setImmediate){var i,n,o,s,a,h=1,u={},f=!1,l=t.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(t);c=c&&c.setTimeout?c:t,"[object process]"==={}.toString.call(t.process)?i=function(){var t=d(arguments);return e.nextTick(p(m,t)),t}:function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&m(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),i=function(){var e=d(arguments);return t.postMessage(s+e,"*"),e}):t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){m(t.data)},i=function(){var t=d(arguments);return o.port2.postMessage(t),t}):l&&"onreadystatechange"in l.createElement("script")?(n=l.documentElement,i=function(){var t=d(arguments),e=l.createElement("script");return e.onreadystatechange=function(){m(t),e.onreadystatechange=null,n.removeChild(e),e=null},n.appendChild(e),t}):i=function(){var t=d(arguments);return setTimeout(p(m,t),0),t},c.setImmediate=i,c.clearImmediate=v}function d(t){return u[h]=p.apply(void 0,t),h++}function p(t){var e=[].slice.call(arguments,1);return function(){"function"==typeof t?t.apply(void 0,e):new Function(""+t)()}}function m(t){if(f)setTimeout(p(m,t),0);else{var e=u[t];if(e){f=!0;try{e()}finally{v(t),f=!1}}}}function v(t){delete u[t]}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,r(0),r(4))},function(t,e,r){(function(e){function r(t){try{if(!e.localStorage)return!1}catch(t){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(t,e){if(r("noDeprecation"))return t;var i=!1;return function(){if(!i){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}}}).call(this,r(0))},function(t,e,r){var i=r(1),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=s),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},function(t,e,r){t.exports=o;var i=r(34),n=Object.create(r(12));function o(t){if(!(this instanceof o))return new o(t);i.call(this,t)}n.inherits=r(6),n.inherits(o,i),o.prototype._transform=function(t,e,r){r(null,t)}},function(t,e,r){var i=r(1).Buffer;t.exports=function(t){if(t instanceof Uint8Array){if(0===t.byteOffset&&t.byteLength===t.buffer.byteLength)return t.buffer;if("function"==typeof t.buffer.slice)return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}if(i.isBuffer(t)){for(var e=new Uint8Array(t.length),r=t.length,n=0;n0&&(i=r),r=t[h++]);)switch(F++,"\n"==r?(H++,z=0):z++,P){case l:if("{"===r)P=d;else if("["===r)P=m;else if(!W(r))return Z("Non-whitespace before {[.");continue;case y:case d:if(W(r))continue;if(P===y)L.push(b);else{if("}"===r){o({}),a(),P=L.pop()||c;continue}L.push(p)}if('"'!==r)return Z('Malformed object key should start with " ');P=g;continue;case b:case p:if(W(r))continue;if(":"===r)P===p?(L.push(p),void 0!==T&&(o({}),n(T),T=void 0),U++):void 0!==T&&(n(T),T=void 0),P=c;else if("}"===r)void 0!==T&&(o(T),a(),T=void 0),a(),U--,P=L.pop()||c;else{if(","!==r)return Z("Bad object");P===p&&L.push(p),void 0!==T&&(o(T),a(),T=void 0),P=y}continue;case m:case c:if(W(r))continue;if(P===m){if(o([]),U++,P=c,"]"===r){a(),U--,P=L.pop()||c;continue}L.push(v)}if('"'===r)P=g;else if("{"===r)P=d;else if("["===r)P=m;else if("t"===r)P=w;else if("f"===r)P=S;else if("n"===r)P=E;else if("-"===r)j+=r;else if("0"===r)j+=r,P=20;else{if(-1==="123456789".indexOf(r))return Z("Bad value");j+=r,P=20}continue;case v:if(","===r)L.push(v),void 0!==T&&(o(T),a(),T=void 0),P=c;else{if("]"!==r){if(W(r))continue;return Z("Bad array")}void 0!==T&&(o(T),a(),T=void 0),a(),U--,P=L.pop()||c}continue;case g:void 0===T&&(T="");var f=h-1;t:for(;;){for(;D>0;)if(q+=r,r=t.charAt(h++),4===D?(T+=String.fromCharCode(parseInt(q,16)),D=0,f=h-1):D++,!r)break t;if('"'===r&&!C){P=L.pop()||c,T+=t.substring(f,h-1);break}if(!("\\"!==r||C||(C=!0,T+=t.substring(f,h-1),r=t.charAt(h++))))break;if(C){if(C=!1,"n"===r?T+="\n":"r"===r?T+="\r":"t"===r?T+="\t":"f"===r?T+="\f":"b"===r?T+="\b":"u"===r?(D=1,q=""):T+=r,r=t.charAt(h++),f=h-1,r)continue;break}u.lastIndex=h;var K=u.exec(t);if(!K){h=t.length+1,T+=t.substring(f,h-1);break}if(h=K.index+1,!(r=t.charAt(K.index))){T+=t.substring(f,h-1);break}}continue;case w:if(!r)continue;if("r"!==r)return Z("Invalid true started with t"+r);P=M;continue;case M:if(!r)continue;if("u"!==r)return Z("Invalid true started with tr"+r);P=_;continue;case _:if(!r)continue;if("e"!==r)return Z("Invalid true started with tru"+r);o(!0),a(),P=L.pop()||c;continue;case S:if(!r)continue;if("a"!==r)return Z("Invalid false started with f"+r);P=x;continue;case x:if(!r)continue;if("l"!==r)return Z("Invalid false started with fa"+r);P=k;continue;case k:if(!r)continue;if("s"!==r)return Z("Invalid false started with fal"+r);P=A;continue;case A:if(!r)continue;if("e"!==r)return Z("Invalid false started with fals"+r);o(!1),a(),P=L.pop()||c;continue;case E:if(!r)continue;if("u"!==r)return Z("Invalid null started with n"+r);P=B;continue;case B:if(!r)continue;if("l"!==r)return Z("Invalid null started with nu"+r);P=O;continue;case O:if(!r)continue;if("l"!==r)return Z("Invalid null started with nul"+r);o(null),a(),P=L.pop()||c;continue;case R:if("."!==r)return Z("Leading zero not followed by .");j+=r,P=20;continue;case 20:if(-1!=="0123456789".indexOf(r))j+=r;else if("."===r){if(-1!==j.indexOf("."))return Z("Invalid number has two dots");j+=r}else if("e"===r||"E"===r){if(-1!==j.indexOf("e")||-1!==j.indexOf("E"))return Z("Invalid number has two exponential");j+=r}else if("+"===r||"-"===r){if("e"!==i&&"E"!==i)return Z("Invalid symbol in number");j+=r}else j&&(o(parseFloat(j)),a(),j=""),h--,P=L.pop()||c;continue;default:return Z("Unknown state: "+P)}F>=I&&(s=0,void 0!==T&&T.length>65536&&(Z("Max buffer length exceeded: textNode"),s=Math.max(s,T.length)),j.length>65536&&(Z("Max buffer length exceeded: numberNode"),s=Math.max(s,j.length)),I=65536-s+F)}})),t(ut).on((function(){if(P==l)return o({}),a(),void(N=!0);P===c&&0===U||Z("Unexpected end"),void 0!==T&&(o(T),a(),T=void 0),N=!0}))}var N,P,L,q,D,U,F,z,H,Z,W,K=(N=p((function(t){return t.unshift(/^/),(e=RegExp(t.map(l("source")).join(""))).exec.bind(e);var e})),q=N(P=/(\$?)/,/([\w-_]+|\*)/,L=/(?:{([\w ]*?)})?/),D=N(P,/\["([^"]+)"\]/,L),U=N(P,/\[(\d+|\*)\]/,L),F=N(P,/()/,/{([\w ]*?)}/),z=N(/\.\./),H=N(/\./),Z=N(P,/!/),W=N(/$/),function(t){return t(c(q,D,U,F),z,H,Z,W)});function V(t,e){return{key:t,node:e}}var G=l("key"),Y=l("node"),J={};function X(t){var e=t(tt).emit,r=t(et).emit,i=t(st).emit,n=t(ot).emit;function s(t,e,r){Y(x(t))[e]=r}function a(t,r,i){t&&s(t,r,i);var n=S(V(r,i),t);return e(n),n}var h={};return h[ct]=function(t,e){if(!t)return i(e),a(t,J,e);var r=function(t,e){var r=Y(x(t));return y(o,r)?a(t,b(r),e):t}(t,e),n=k(r),h=G(x(r));return s(n,h,e),S(V(h,e),n)},h[dt]=function(t){return r(t),k(t)||n(Y(x(t)))},h[lt]=a,h}var $=K((function(t,e,r,i,n){var o=f(G,x),a=f(Y,x);function h(t,e){return e[1]?m(t,x):t}function l(t){return t==g?g:m((function(t){return o(t)!=J}),f(t,k))}function d(){return function(t){return o(t)==J}}function p(t,e,r,i,n){var o=t(r);if(o){var s=function(t,e,r){return R((function(t,e){return e(t,r)}),e,t)}(e,i,o);return n(r.substr(b(o[0])),s)}}function v(t,e){return u(p,t,e)}var y=c(v(t,E(h,(function(t,e){var r=e[3];return r?m(f(u(_,A(r.split(/\W+/))),a),t):t}),(function(t,e){var r=e[2];return m(r&&"*"!=r?function(t){return o(t)==r}:g,t)}),l)),v(e,E((function(t){if(t==g)return g;var e=d(),r=t,i=l((function(t){return n(t)})),n=c(e,r,i);return n}))),v(r,E()),v(i,E(h,d)),v(n,E((function(t){return function(e){var r=t(e);return!0===r?x(e):r}}))),(function(t){throw s('"'+t+'" could not be tokenised')}));function w(t,e){return e}function M(t,e){return y(t,e,t?M:w)}return function(t){try{return M(t,g)}catch(e){throw s('Could not compile "'+t+'" because '+e.message)}}})),Q=1,tt=Q++,et=Q++,rt=Q++,it=Q++,nt="fail",ot=Q++,st=Q++,at="start",ht="data",ut="end",ft=Q++,lt=Q++,ct=Q++,dt=Q++;function pt(t,e,r){try{var i=a.parse(e)}catch(t){}return{statusCode:t,body:e,jsonBody:i,thrown:r}}function mt(t,e){var r,i=/^(node|path):./,n=t(ot),o=t(it).emit,a=t(rt).emit,h=p((function(e,n){if(r[e])d(n,r[e]);else{var o=t(e),s=n[0];i.test(e)?f(o,s):o.on(s)}return r}));function f(t,e,i){i=i||e;var n=l(e);return t.on((function(){var e=!1;r.forget=function(){e=!0},d(arguments,n),delete r.forget,e&&t.un(i)}),i),r}function l(t){return function(){try{return t.apply(r,arguments)}catch(t){setTimeout((function(){throw new s(t.message)}))}}}function c(e,r,i){var n;n="node"==e?function(t){return function(){var e=t.apply(this,arguments);M(e)&&(e==yt.drop?o():a(e))}}(i):i,f(function(e,r){return t(e+":"+r)}(e,r),n,i)}function m(t,e,i){return w(e)?c(t,e,i):function(t,e){for(var r in e)c(t,r,e[r])}(t,e),r}return t(st).on((function(t){var e;r.root=(e=t,function(){return e})})),t(at).on((function(t,e){r.header=function(t){return t?e[t]:e}})),r={on:h,addListener:h,removeListener:function(e,i,o){if("done"==e)n.un(i);else if("node"==e||"path"==e)t.un(e+":"+i,o);else{var s=i;t(e).un(s)}return r},emit:t.emit,node:u(m,"node"),path:u(m,"path"),done:u(f,n),start:u((function(e,i){return t(e).on(l(i),i),r}),at),fail:t(nt).on,abort:t(ft).emit,header:v,root:v,source:e}}function vt(t,e,i,n,o){var s=function(){var t={},e=i("newListener"),r=i("removeListener");function i(i){return t[i]=function(t,e,r){var i,n;function o(t){return function(e){return e.id==t}}return{on:function(r,o){var s={listener:r,id:o||r};return e&&e.emit(t,r,s.id),i=S(s,i),n=S(r,n),this},emit:function(){T(n,arguments)},un:function(e){var s;i=I(i,o(e),(function(t){s=t})),s&&(n=I(n,(function(t){return t==s.listener})),r&&r.emit(t,s.listener,s.id))},listeners:function(){return n},hasListener:function(t){return M(function t(e,r){return r&&(e(x(r))?x(r):t(e,k(r)))}(t?o(t):g,i))}}}(i,e,r)}function n(e){return t[e]||i(e)}return["emit","on","un"].forEach((function(t){n[t]=p((function(e,r){d(r,n(e)[t])}))})),n}();return e&&function(t,e,i,n,o,s,a){var h=t(ht).emit,f=t(nt).emit,l=0,c=!0;function d(){var t=e.responseText,r=t.substr(l);r&&h(r),l=b(t)}t(ft).on((function(){e.onreadystatechange=null,e.abort()})),"onprogress"in e&&(e.onprogress=d),e.onreadystatechange=function(){function r(){try{c&&t(at).emit(e.status,function(t){var e={};return t&&t.split("\r\n").forEach((function(t){var r=t.indexOf(": ");e[t.substring(0,r)]=t.substring(r+2)})),e}(e.getAllResponseHeaders())),c=!1}catch(t){}}switch(e.readyState){case 2:case 3:return r();case 4:r(),2==String(e.status)[0]?(d(),t(ut).emit()):f(pt(e.status,e.responseText))}};try{for(var p in e.open(i,n,!0),s)e.setRequestHeader(p,s[p]);(function(t,e){function r(e){return e.port||{"http:":80,"https:":443}[e.protocol||t.protocol]}return!!(e.protocol&&e.protocol!=t.protocol||e.host&&e.host!=t.host||e.host&&r(e)!=r(t))})(r.location,function(t){var e=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(t)||[];return{protocol:e[1]||"",host:e[2]||"",port:e[3]||""}}(n))||e.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.withCredentials=a,e.send(o)}catch(t){r.setTimeout(u(f,pt(void 0,void 0,t)),0)}}(s,new XMLHttpRequest,t,e,i,n,o),C(s),function(t,e){var r,i={};function n(t){return function(e){r=t(r,e)}}for(var o in e)t(o).on(n(e[o]),i);t(rt).on((function(t){var e=x(r),i=G(e),n=k(r);n&&(Y(x(n))[i]=t)})),t(it).on((function(){var t=x(r),e=G(t),i=k(r);i&&delete Y(x(i))[e]})),t(ft).on((function(){for(var r in e)t(r).un(i)}))}(s,X(s)),function(t,e){var r={node:t(et),path:t(tt)};function i(e,r,i){var n=t(e).emit;r.on((function(t){var e=i(t);!1!==e&&function(t,e,r){var i=j(r);t(e,B(k(O(G,i))),B(O(Y,i)))}(n,Y(e),t)}),e),t("removeListener").on((function(i){i==e&&(t(i).listeners()||r.un(e))}))}t("newListener").on((function(t){var n=/(node|path):(.*)/.exec(t);if(n){var o=r[n[1]];o.hasListener(t)||i(t,o,e(n[2]))}}))}(s,$),mt(s,e)}function gt(t,e,r,i,n,o,s){return n=n?a.parse(a.stringify(n)):{},i?(w(i)||(i=a.stringify(i),n["Content-Type"]=n["Content-Type"]||"application/json"),n["Content-Length"]=n["Content-Length"]||i.length):i=null,t(r||"GET",function(t,e){return!1===e&&(-1==t.indexOf("?")?t+="?":t+="&",t+="_="+(new Date).getTime()),t}(e,s),i,n,o||!1)}function yt(t){var e=E("resume","pause","pipe"),r=u(_,e);return t?r(t)||w(t)?gt(vt,t):gt(vt,t.url,t.method,t.body,t.headers,t.withCredentials,t.cached):vt()}yt.drop=function(){return yt.drop},void 0===(i=function(){return yt}.apply(e,[]))||(t.exports=i)}(function(){try{return window}catch(t){return self}}(),Object,Array,Error,JSON)},function(t,e,r){var i=r(3).formatters,n=r(36),o=r(5);t.exports=function(t){var e=function(e){var r;return e.property?(t[e.property]||(t[e.property]={}),r=t[e.property]):r=t,e.methods&&e.methods.forEach((function(e){e instanceof n||(e=new n(e)),e.attachToObject(r),e.setRequestManager(t._requestManager)})),t};return e.formatters=i,e.utils=o,e.Method=n,e}},function(t,e,r){t.exports=r(104)().Promise},function(t,e,r){t.exports=r(105)(window,(function(){if(void 0===window.Promise)throw new Error("any-promise browser requires a polyfill or explicit registration e.g: require('any-promise/register/bluebird')");return{Promise:window.Promise,implementation:"window.Promise"}}))},function(t,e,r){var i=null;t.exports=function(t,e){return function(r,n){r=r||null;var o=!1!==(n=n||{}).global;if(null===i&&o&&(i=t["@@any-promise/REGISTRATION"]||null),null!==i&&null!==r&&i.implementation!==r)throw new Error('any-promise already defined as "'+i.implementation+'". You can only register an implementation before the first call to require("any-promise") and an implementation cannot be changed');return null===i&&(i=null!==r&&void 0!==n.Promise?{Promise:n.Promise,implementation:r}:e(r),o&&(t["@@any-promise/REGISTRATION"]=i)),i}}},function(t,e,r){var i=r(2),n=r(3).errors,o=r(38);function s(t){o.call(this),this.id=null,this.callback=i.identity,this.arguments=null,this._reconnectIntervalId=null,this.options={subscription:t.subscription,type:t.type,requestManager:t.requestManager}}s.prototype=Object.create(o.prototype),s.prototype.constructor=s,s.prototype._extractCallback=function(t){if(i.isFunction(t[t.length-1]))return t.pop()},s.prototype._validateArgs=function(t){var e=this.options.subscription;if(e||(e={}),e.params||(e.params=0),t.length!==e.params)throw n.InvalidNumberOfParams(t.length,e.params+1,t[0])},s.prototype._formatInput=function(t){var e=this.options.subscription;return e&&e.inputFormatter?e.inputFormatter.map((function(e,r){return e?e(t[r]):t[r]})):t},s.prototype._formatOutput=function(t){var e=this.options.subscription;return e&&e.outputFormatter&&t?e.outputFormatter(t):t},s.prototype._toPayload=function(t){var e=[];if(this.callback=this._extractCallback(t)||i.identity,this.subscriptionMethod||(this.subscriptionMethod=t.shift(),this.options.subscription.subscriptionName&&(this.subscriptionMethod=this.options.subscription.subscriptionName)),this.arguments||(this.arguments=this._formatInput(t),this._validateArgs(this.arguments),t=[]),e.push(this.subscriptionMethod),e=e.concat(this.arguments),t.length)throw new Error("Only a callback is allowed as parameter on an already instantiated subscription.");return{method:this.options.type+"_subscribe",params:e}},s.prototype.unsubscribe=function(t){this.options.requestManager.removeSubscription(this.id,t),this.id=null,this.removeAllListeners(),clearInterval(this._reconnectIntervalId)},s.prototype.subscribe=function(){var t=this,e=Array.prototype.slice.call(arguments),r=this._toPayload(e);if(!r)return this;if(!this.options.requestManager.provider){var n=new Error("No provider set.");return this.callback(n,null,this),this.emit("error",n),this}if(!this.options.requestManager.provider.on){var o=new Error("The current provider doesn't support subscriptions: "+this.options.requestManager.provider.constructor.name);return this.callback(o,null,this),this.emit("error",o),this}return this.id&&this.unsubscribe(),this.options.params=r.params[1],"logs"===r.params[0]&&i.isObject(r.params[1])&&r.params[1].hasOwnProperty("fromBlock")&&isFinite(r.params[1].fromBlock)&&this.options.requestManager.send({method:"eth_getLogs",params:[r.params[1]]},(function(e,r){e?(t.callback(e,null,t),t.emit("error",e)):r.forEach((function(e){var r=t._formatOutput(e);t.callback(null,r,t),t.emit("data",r)}))})),"object"==typeof r.params[1]&&delete r.params[1].fromBlock,this.options.requestManager.send(r,(function(e,n){!e&&n?(t.id=n,t.emit("connected",n),t.options.requestManager.addSubscription(t.id,r.params[0],t.options.type,(function(e,r){e?(t.options.requestManager.removeSubscription(t.id),t.options.requestManager.provider.once&&(t._reconnectIntervalId=setInterval((function(){t.options.requestManager.provider.reconnect&&t.options.requestManager.provider.reconnect()}),500),t.options.requestManager.provider.once("connect",(function(){clearInterval(t._reconnectIntervalId),t.subscribe(t.callback)}))),t.emit("error",e),t.callback(e,null,t)):(i.isArray(r)||(r=[r]),r.forEach((function(e){var r=t._formatOutput(e);if(i.isFunction(t.options.subscription.subscriptionHandler))return t.options.subscription.subscriptionHandler.call(t,r);t.emit("data",r),t.callback(null,r,t)})))}))):(t.callback(e,null,t),t.emit("error",e))})),this},t.exports=s},function(t,e,r){var i=r(2),n=r(5),o=new(r(108).AbiCoder)((function(t,e){return!t.match(/^u?int/)||i.isArray(e)||i.isObject(e)&&"BN"===e.constructor.name?e:e.toString()}));function s(){}var a=function(){};a.prototype.encodeFunctionSignature=function(t){return i.isObject(t)&&(t=n._jsonInterfaceMethodToString(t)),n.sha3(t).slice(0,10)},a.prototype.encodeEventSignature=function(t){return i.isObject(t)&&(t=n._jsonInterfaceMethodToString(t)),n.sha3(t)},a.prototype.encodeParameter=function(t,e){return this.encodeParameters([t],[e])},a.prototype.encodeParameters=function(t,e){return o.encode(this.mapTypes(t),e.map((function(t){return n.isBN(t)||n.isBigNumber(t)?t.toString(10):t})))},a.prototype.mapTypes=function(t){var e=this,r=[];return t.forEach((function(t){if(e.isSimplifiedStructFormat(t)){var i=Object.keys(t)[0];r.push(Object.assign(e.mapStructNameAndType(i),{components:e.mapStructToCoderFormat(t[i])}))}else r.push(t)})),r},a.prototype.isSimplifiedStructFormat=function(t){return"object"==typeof t&&void 0===t.components&&void 0===t.name},a.prototype.mapStructNameAndType=function(t){var e="tuple";return t.indexOf("[]")>-1&&(e="tuple[]",t=t.slice(0,-2)),{type:e,name:t}},a.prototype.mapStructToCoderFormat=function(t){var e=this,r=[];return Object.keys(t).forEach((function(i){"object"!=typeof t[i]?r.push({name:i,type:t[i]}):r.push(Object.assign(e.mapStructNameAndType(i),{components:e.mapStructToCoderFormat(t[i])}))})),r},a.prototype.encodeFunctionCall=function(t,e){return this.encodeFunctionSignature(t)+this.encodeParameters(t.inputs,e).replace("0x","")},a.prototype.decodeParameter=function(t,e){return this.decodeParameters([t],e)[0]},a.prototype.decodeParameters=function(t,e){if(t.length>0&&(!e||"0x"===e||"0X"===e))throw new Error("Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.");var r=o.decode(this.mapTypes(t),"0x"+e.replace(/0x/i,"")),n=new s;return n.__length__=0,t.forEach((function(t,e){var o=r[n.__length__];o="0x"===o?null:o,n[e]=o,i.isObject(t)&&t.name&&(n[t.name]=o),n.__length__++})),n},a.prototype.decodeLog=function(t,e,r){var n=this;r=i.isArray(r)?r:[r],e=e||"";var o=[],a=[],h=0;t.forEach((function(t,e){t.indexed?(a[e]=["bool","int","uint","address","fixed","ufixed"].find((function(e){return-1!==t.type.indexOf(e)}))?n.decodeParameter(t.type,r[h]):r[h],h++):o[e]=t}));var u=e,f=u?this.decodeParameters(o,u):[],l=new s;return l.__length__=0,t.forEach((function(t,e){l[e]="string"===t.type?"":null,void 0!==f[e]&&(l[e]=f[e]),void 0!==a[e]&&(l[e]=a[e]),t.name&&(l[t.name]=l[e]),l.__length__++})),l};var h=new a;t.exports=h},function(t,e,r){var i,n=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var s=r(109),a=r(113),h=r(8),u=r(114),f=r(41),l=o(r(15)),c=new RegExp(/^bytes([0-9]*)$/),d=new RegExp(/^(u?int)([0-9]*)$/),p=new RegExp(/^(.*)\[([0-9]*)\]$/);e.defaultCoerceFunc=function(t,e){var r=t.match(d);return r&&parseInt(r[2])<=48?e.toNumber():e};var m=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),v=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function g(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function y(t,e){function r(e){throw new Error('unexpected character "'+t[e]+'" at position '+e+' in "'+t+'"')}for(var i={type:"",name:"",state:{allowType:!0}},n=i,o=0;o1){var n=r[1].match(m);if(""!=n[1].trim()||""!=n[3].trim())throw new Error("unexpected tokens");L(n[2]).forEach((function(t){e.outputs.push(y(t))}))}return e}(t.trim()));throw new Error("unknown signature")};var w=function(t,e,r,i,n){this.coerceFunc=t,this.name=e,this.type=r,this.localName=i,this.dynamic=n},M=function(t){function e(e){var r=t.call(this,e.coerceFunc,e.name,e.type,void 0,e.dynamic)||this;return f.defineReadOnly(r,"coder",e),r}return n(e,t),e.prototype.encode=function(t){return this.coder.encode(t)},e.prototype.decode=function(t,e){return this.coder.decode(t,e)},e}(w),_=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return n(e,t),e.prototype.encode=function(t){return h.arrayify([])},e.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},e}(w),S=function(t){function e(e,r,i,n){var o=this,s=(i?"int":"uint")+8*r;return(o=t.call(this,e,s,s,n,!1)||this).size=r,o.signed=i,o}return n(e,t),e.prototype.encode=function(t){try{var e=a.bigNumberify(t);return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),h.padZeros(h.arrayify(e),32)}catch(e){l.throwError("invalid number value",l.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length32)throw new Error;e.set(r)}catch(e){l.throwError("invalid "+this.name+" value",l.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},e.prototype.decode=function(t,e){return t.length=0?i:"")+"]",a=-1===i||r.dynamic;return(o=t.call(this,e,"array",s,n,a)||this).coder=r,o.length=i,o}return n(e,t),e.prototype.encode=function(t){Array.isArray(t)||l.throwError("expected array value",l.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=x.encode(e)),l.checkArgumentCount(e,t.length,"in coder array"+(this.localName?" "+this.localName:""));for(var i=[],n=0;n256||n%8!=0)&&l.throwError("invalid "+r[1]+" bit length",l.INVALID_ARGUMENT,{arg:"param",value:e}),new S(t,n/8,"int"===r[1],e.name);if(r=e.type.match(c))return(0===(n=parseInt(r[1]))||n>32)&&l.throwError("invalid bytes length",l.INVALID_ARGUMENT,{arg:"param",value:e}),new A(t,n,e.name);if(r=e.type.match(p)){var n=parseInt(r[2]||"-1");return(e=f.jsonCopy(e)).type=r[1],new N(t,D(t,e),n,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var i=[];return e.forEach((function(e){i.push(D(t,e))})),new P(t,i,r)}(t,e.components,e.name):""===e.type?new _(t,e.name):(l.throwError("invalid type",l.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var U=function(){function t(r){l.checkNew(this,t),r||(r=e.defaultCoerceFunc),f.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&l.throwError("types/values length mismatch",l.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach((function(t){var e;e="string"==typeof t?y(t):t,r.push(D(this.coerceFunc,e))}),this),h.hexlify(new P(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach((function(t){var e;e="string"==typeof t?y(t):f.jsonCopy(t),r.push(D(this.coerceFunc,e))}),this),new P(this.coerceFunc,r,"_").decode(h.arrayify(e),0).value},t}();e.AbiCoder=U,e.defaultAbiCoder=new U},function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(10)),o=r(8),s=r(110),a=r(112),h=r(15);function u(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||h.throwError("invalid address",h.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),i=0;i<40;i++)r[i]=e[i].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var n=0;n<40;n+=2)r[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(15&r[n>>1])>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}for(var f={},l=0;l<10;l++)f[String(l)]=String(l);for(l=0;l<26;l++)f[String.fromCharCode(65+l)]=String(10+l);var c,d=Math.floor((c=9007199254740991,Math.log10?Math.log10(c):Math.log(c)/Math.LN10));function p(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=f[t]}));e.length>=d;){var r=e.substring(0,d);e=parseInt(r,10)%97+e.substring(r.length)}for(var i=String(98-parseInt(e,10)%97);i.length<2;)i="0"+i;return i}function m(t){var e=null;if("string"!=typeof t&&h.throwError("invalid address",h.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=u(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&h.throwError("bad address checksum",h.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&h.throwError("bad icap checksum",h.INVALID_ARGUMENT,{arg:"address",value:t}),e=new n.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=u("0x"+e)}else h.throwError("invalid address",h.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=m,e.getIcapAddress=function(t){for(var e=new n.default.BN(m(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e},e.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return m("0x"+s.keccak256(a.encode([m(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0});var i=r(111),n=r(8);e.keccak256=function(t){return"0x"+i.keccak_256(n.arrayify(t))}},function(t,e,r){(function(e,r){!function(){var i="object"==typeof window?window:{};!i.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(i=r);for(var n=!i.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),s=[0,8,16,24],a=[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],h=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],f=function(t,e,r){return function(i){return new M(t,e,t).update(i)[r]()}},l=function(t,e,r){return function(i,n){return new M(t,e,n).update(i)[r]()}},c=function(t,e){var r=f(t,e,"hex");r.create=function(){return new M(t,e,t)},r.update=function(t){return r.create().update(t)};for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}M.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,i,n=t.length,o=this.blocks,a=this.byteCount,h=this.blockCount,u=0,f=this.s;u>2]|=t[u]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(o[r>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=r-a,this.block=o[h],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];a%e==0&&(_(r),s=0)}return n&&(t=r[s],n>0&&(h+=o[t>>4&15]+o[15&t]),n>1&&(h+=o[t>>12&15]+o[t>>8&15]),n>2&&(h+=o[t>>20&15]+o[t>>16&15])),h},M.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var h=new Uint32Array(t);s>8&255,h[t+2]=e>>16&255,h[t+3]=e>>24&255;a%r==0&&_(i)}return o&&(t=a<<2,e=i[s],o>0&&(h[t]=255&e),o>1&&(h[t+1]=e>>8&255),o>2&&(h[t+2]=e>>16&255)),h};var _=function(t){var e,r,i,n,o,s,h,u,f,l,c,d,p,m,v,g,y,b,w,M,_,S,x,k,A,E,B,O,R,I,T,j,C,N,P,L,q,D,U,F,z,H,Z,W,K,V,G,Y,J,X,$,Q,tt,et,rt,it,nt,ot,st,at,ht,ut,ft;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],h=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],f=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|h>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(h<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(u<<1|f>>>31),r=o^(f<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(l<<1|c>>>31),r=h^(c<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(d<<1|p>>>31),r=f^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(n<<1|o>>>31),r=c^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,m=t[0],v=t[1],V=t[11]<<4|t[10]>>>28,G=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,R=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ht=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,N=t[2]<<1|t[3]>>>31,P=t[3]<<1|t[2]>>>31,g=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,Y=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,I=t[33]<<13|t[32]>>>19,T=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,q=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,$=t[35]<<15|t[34]>>>17,j=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,k=t[6]<<28|t[7]>>>4,A=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,W=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,E=t[18]<<20|t[19]>>>12,B=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,S=t[48]<<14|t[49]>>>18,x=t[49]<<14|t[48]>>>18,t[0]=m^~g&b,t[1]=v^~y&w,t[10]=k^~E&O,t[11]=A^~B&R,t[20]=N^~L&D,t[21]=P^~q&U,t[30]=W^~V&Y,t[31]=K^~G&J,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=g^~b&M,t[3]=y^~w&_,t[12]=E^~O&I,t[13]=B^~R&T,t[22]=L^~D&F,t[23]=q^~U&z,t[32]=V^~Y&X,t[33]=G^~J&$,t[42]=it^~ot&at,t[43]=nt^~st&ht,t[4]=b^~M&S,t[5]=w^~_&x,t[14]=O^~I&j,t[15]=R^~T&C,t[24]=D^~F&H,t[25]=U^~z&Z,t[34]=Y^~X&Q,t[35]=J^~$&tt,t[44]=ot^~at&ut,t[45]=st^~ht&ft,t[6]=M^~S&m,t[7]=_^~x&v,t[16]=I^~j&k,t[17]=T^~C&A,t[26]=F^~H&N,t[27]=z^~Z&P,t[36]=X^~Q&W,t[37]=$^~tt&K,t[46]=at^~ut&et,t[47]=ht^~ft&rt,t[8]=S^~m&g,t[9]=x^~v&y,t[18]=j^~k&E,t[19]=C^~A&B,t[28]=H^~N&L,t[29]=Z^~P&q,t[38]=Q^~W&V,t[39]=tt^~K&G,t[48]=ut^~et&it,t[49]=ft^~rt&nt,t[0]^=a[i],t[1]^=a[i+1]};if(n)t.exports=p;else for(v=0;v>=8;return e}function o(t,e,r){for(var i=0,n=0;ne+1+i)throw new Error("invalid rlp")}return{consumed:1+i,result:n}}function a(t,e){if(0===t.length)throw new Error("invalid rlp data");if(t[e]>=248){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+n)}if(t[e]>=192){if(e+1+(n=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,n)}if(t[e]>=184){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+n,result:i.hexlify(t.slice(e+1+r,e+1+r+n))}}if(t[e]>=128){var n;if(e+1+(n=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+n,result:i.hexlify(t.slice(e+1,e+1+n))}}return{consumed:1,result:i.hexlify(t[e])}}e.encode=function(t){return i.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach((function(e){r=r.concat(t(e))})),r.length<=55?(r.unshift(192+r.length),r):((o=n(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(i.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=n(s.length)).unshift(183+o.length),o.concat(s))}(t))},e.decode=function(t){var e=i.arrayify(t),r=a(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},function(t,e,r){var i,n=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var a=o(r(10)),h=r(8),u=r(41),f=r(40),l=s(r(15)),c=new a.default.BN(-1);function d(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function p(t){return g(t)._bn}function m(t){return new v(d(t))}var v=function(t){function e(r){var i=t.call(this)||this;if(l.checkNew(i,e),"string"==typeof r)h.isHexString(r)?("0x"==r&&(r="0x0"),u.defineReadOnly(i,"_hex",r)):"-"===r[0]&&h.isHexString(r.substring(1))?u.defineReadOnly(i,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),u.defineReadOnly(i,"_hex",d(new a.default.BN(r)))):l.throwError("invalid BigNumber string value",l.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(String(r))!==r&&l.throwError("underflow",l.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(String(r))});try{u.defineReadOnly(i,"_hex",d(new a.default.BN(r)))}catch(t){l.throwError("overflow",l.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else r instanceof e?u.defineReadOnly(i,"_hex",r._hex):r.toHexString?u.defineReadOnly(i,"_hex",d(p(r.toHexString()))):h.isArrayish(r)?u.defineReadOnly(i,"_hex",d(new a.default.BN(h.hexlify(r).substring(2),16))):l.throwError("invalid BigNumber value",l.INVALID_ARGUMENT,{arg:"value",value:r});return i}return n(e,t),Object.defineProperty(e.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new a.default.BN(this._hex.substring(3),16).mul(c):new a.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),e.prototype.fromTwos=function(t){return m(this._bn.fromTwos(t))},e.prototype.toTwos=function(t){return m(this._bn.toTwos(t))},e.prototype.add=function(t){return m(this._bn.add(p(t)))},e.prototype.sub=function(t){return m(this._bn.sub(p(t)))},e.prototype.div=function(t){return g(t).isZero()&&l.throwError("division by zero",l.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),m(this._bn.div(p(t)))},e.prototype.mul=function(t){return m(this._bn.mul(p(t)))},e.prototype.mod=function(t){return m(this._bn.mod(p(t)))},e.prototype.pow=function(t){return m(this._bn.pow(p(t)))},e.prototype.maskn=function(t){return m(this._bn.maskn(t))},e.prototype.eq=function(t){return this._bn.eq(p(t))},e.prototype.lt=function(t){return this._bn.lt(p(t))},e.prototype.lte=function(t){return this._bn.lte(p(t))},e.prototype.gt=function(t){return this._bn.gt(p(t))},e.prototype.gte=function(t){return this._bn.gte(p(t))},e.prototype.isZero=function(){return this._bn.isZero()},e.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(t){l.throwError("overflow",l.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},e.prototype.toString=function(){return this._bn.toString(10)},e.prototype.toHexString=function(){return this._hex},e}(f.BigNumber);function g(t){return t instanceof v?t:new v(t)}e.bigNumberify=g,e.ConstantNegativeOne=g(-1),e.ConstantZero=g(0),e.ConstantOne=g(1),e.ConstantTwo=g(2),e.ConstantWeiPerEther=g("1000000000000000000")},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0});var i,n=r(8);!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(i=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=function(t,e){void 0===e&&(e=i.current),e!=i.current&&(t=t.normalize(e));for(var r=[],o=0,s=0;s>6|192,r[o++]=63&a|128):55296==(64512&a)&&s+1>18|240,r[o++]=a>>12&63|128,r[o++]=a>>6&63|128,r[o++]=63&a|128):(r[o++]=a>>12|224,r[o++]=a>>6&63|128,r[o++]=63&a|128)}return n.arrayify(r)},e.toUtf8String=function(t){t=n.arrayify(t);for(var e="",r=0;r>7!=0){if(i>>6!=2){var o=null;if(i>>5==6)o=1;else if(i>>4==14)o=2;else if(i>>3==30)o=3;else if(i>>2==62)o=4;else{if(i>>1!=126)continue;o=5}if(r+o>t.length){for(;r>6==2;r++);if(r!=t.length)continue;return e}var s,a=i&(1<<8-o-1)-1;for(s=0;s>6!=2)break;a=a<<6|63&h}s==o?a<=65535?e+=String.fromCharCode(a):(a-=65536,e+=String.fromCharCode(55296+(a>>10&1023),56320+(1023&a))):r--}}else e+=String.fromCharCode(i)}return e}},function(t,e,r){r.r(e);var i=r(19),n=r.n(i),o=r(42),s=r.n(o),a=r(43),h=r.n(a),u=r(44),f=r.n(u),l=r(13),c=r.n(l),d=r(20),p=r.n(d),m=r(5),v=r(45),g=function(){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.network,n=void 0===i?"mainnet":i,o=r.proxyAddress,s=void 0===o?"0x638646503746d5456209e33a2ff5e3226d698bea":o;h()(this,t),c()(this,"_currentEpoch","18"),c()(this,"_torusNodeEndpoints",["https://torus-18.torusnode.com/jrpc","https://torus.ont.io/jrpc","https://torus.binancex.dev/jrpc","https://torus.matic.network/jrpc","https://torusnode.zilliqa.network/jrpc","https://torus.ens.domains/jrpc","https://torus-node.skalelabs.com/jrpc","https://torus.cosmos.network/jrpc","https://torus.etherscan.com/jrpc"]),c()(this,"_torusNodePub",[{X:"ecbe4a29e02bb9c077433191051ba74d2458a7ebce95a3183a4201338376539f",Y:"114018f97e6576f3fe1c247fc6802de3ff219507589a90544e6921ea9608adcf"},{X:"c1d31f5b0ba633ad5dec80c35df7209ffe282392831f5d3a386d3c5c0c6b4c2b",Y:"2490a3e69ac1d5a6c3170b5dc4947f038bf37a738cc279d75c18b6a85c90bc71"},{X:"a6d83cc23847dec596d19e93801a0d67ee85f4b1e5f44f267a7118a0c01381ef",Y:"f4b16a19ba44766d53cfaa8fe5858d87c842c7ec0c7b6ecdf11056e6afbeb726"},{X:"79242c54fcfda56c914a28ae89b038dcae8ef2e9dd295171d5562f01d396fbb",Y:"519c655678bf9f6091aa17d0bc13443b69fe8b10ba9336c7cc966a2164eec9e4"},{X:"24b3f3582397f4f4274510e94d8e95fa1a17d57fab2e581d4da1dd2ba61c47d2",Y:"fa15e5cd538992c74cbca5fc1c654ab4d79fb40e2cf5ec58190c35252d81bb6"},{X:"a08620e79b5c006f261b5221e0fae75d379fd0fcd16c66ced105b3fe5282ed64",Y:"e589aa09a7ac28a74d4f4cf7f52718dd9c3cca0541070eec36c66e62a748b17"},{X:"17b5b8402eb27b520eaf4697c7ca3e4818bc79c6cedb6c39490da18602cd84a9",Y:"f18768b68383b8fa9a91caa55768fd7bdec64c8c01cc2fa88963fc6fe92775a6"},{X:"47953df2031bf785f95158a1753a65735fecc93a0248620c4afd7b08ddf239e2",Y:"8058bf6928e7d49179d08cc354d3d735dd08be2f0aa6023d8a7298bb892cf65"},{X:"e53c29bd04eb211d911d78ebcd36d3645872d8f8a18af4fb1937fb2a1f049078",Y:"91ace383afb055ce304ccc5ee811fd8e7407c93e8e0d63d993fc08affc646045"}]),c()(this,"_torusIndexes",[1,2,3,4,5,6,7,8,9]);try{var a=new URL(n);e=a.href}catch(t){e="https://api.infura.io/v1/jsonrpc/".concat(n)}try{p.a.setProvider(e),this.nodeListContract=new p.a(v.a,s),this.nodeListAddress=s,this.updated=!1}catch(t){throw new Error(t)}}var e;return f()(t,[{key:"getCurrentEpoch",value:function(){return this.nodeListContract.methods.currentEpoch().call()}},{key:"getEpochInfo",value:function(t){return this.nodeListContract.methods.getEpochInfo(t).call()}},{key:"getNodeEndpoint",value:function(t){return this.nodeListContract.methods.getNodeDetails(t).call()}},{key:"getNodeDetails",value:(e=s()(n.a.mark((function t(){var e,r,i,o,s,a,h,u,f,l,c,d=this,p=arguments;return n.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=p.length>0&&void 0!==p[0]&&p[0],t.prev=1,!e){t.next=4;break}return t.abrupt("return",this._nodeDetails);case 4:if(!this.updated){t.next=6;break}return t.abrupt("return",this._nodeDetails);case 6:return t.next=8,this.getCurrentEpoch();case 8:return r=t.sent,this._currentEpoch=r,t.next=12,this.getEpochInfo(r);case 12:return i=t.sent,o=[],s=i.nodeList.map((function(t,e){return e+1})),this._torusIndexes=s,i.nodeList.map((function(t){return o.push(d.getNodeEndpoint(t).catch((function(t){})))})),t.next=19,Promise.all(o);case 19:for(a=t.sent,h=[],u=[],f=0;ft.length)&&(e=t.length);for(var r=0,i=new Array(e);r=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(h.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(i)return U(t).length;e=(""+e).toLowerCase(),i=!0}}function m(t,e,r){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return k(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function v(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function g(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=h.from(e,i)),h.isBuffer(e))return 0===e.length?-1:y(t,e,r,i,n);if("number"==typeof e)return e&=255,h.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,i,n){var o,s=1,a=t.length,h=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,a/=2,h/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(n){var f=-1;for(o=r;oa&&(r=a-h),o=r;o>=0;o--){for(var l=!0,c=0;cn&&(i=n):i=n;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var s=0;s>8,n=r%256,o.push(n),o.push(i);return o}(e,t.length-r),t,r,i)}function k(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n239?4:u>223?3:u>191?2:1;if(n+l<=r)switch(l){case 1:u<128&&(f=u);break;case 2:128==(192&(o=t[n+1]))&&(h=(31&u)<<6|63&o)>127&&(f=h);break;case 3:o=t[n+1],s=t[n+2],128==(192&o)&&128==(192&s)&&(h=(15&u)<<12|(63&o)<<6|63&s)>2047&&(h<55296||h>57343)&&(f=h);break;case 4:o=t[n+1],s=t[n+2],a=t[n+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(h=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&h<1114112&&(f=h)}null===f?(f=65533,l=1):f>65535&&(f-=65536,i.push(f>>>10&1023|55296),f=56320|1023&f),i.push(f),n+=l}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",i=0;ii)&&(r=i);for(var n="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function T(t,e,r,i,n,o){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function j(t,e,r,i){e<0&&(e=65535+e+1);for(var n=0,o=Math.min(t.length-r,2);n>>8*(i?n:1-n)}function C(t,e,r,i){e<0&&(e=4294967295+e+1);for(var n=0,o=Math.min(t.length-r,4);n>>8*(i?n:3-n)&255}function N(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(t,e,r,i,o){return o||N(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function L(t,e,r,i,o){return o||N(t,0,r,8),n.write(t,e,r,i,52,8),r+8}e.Buffer=h,e.SlowBuffer=function(t){return+t!=t&&(t=0),h.alloc(+t)},e.INSPECT_MAX_BYTES=50,h.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),h.poolSize=8192,h._augment=function(t){return t.__proto__=h.prototype,t},h.from=function(t,e,r){return u(null,t,e,r)},h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0})),h.alloc=function(t,e,r){return function(t,e,r,i){return f(e),e<=0?a(t,e):void 0!==r?"string"==typeof i?a(t,e).fill(r,i):a(t,e).fill(r):a(t,e)}(null,t,e,r)},h.allocUnsafe=function(t){return l(null,t)},h.allocUnsafeSlow=function(t){return l(null,t)},h.isBuffer=function(t){return!(null==t||!t._isBuffer)},h.compare=function(t,e){if(!h.isBuffer(t)||!h.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,i=e.length,n=0,o=Math.min(r,i);n0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},h.prototype.compare=function(t,e,r,i,n){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(n>>>=0)-(i>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(i,n),f=t.slice(e,r),l=0;ln)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return M(this,t,e,r);case"latin1":case"binary":return _(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},h.prototype.slice=function(t,e){var r,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e0&&(n*=256);)i+=this[t+--e]*n;return i},h.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},h.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var i=this[t],n=1,o=0;++o=(n*=128)&&(i-=Math.pow(2,8*e)),i},h.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var i=e,n=1,o=this[t+--i];i>0&&(n*=256);)o+=this[t+--i]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*e)),o},h.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt32LE=function(t,e){return e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),n.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),n.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),n.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),n.read(this,t,!1,52,8)},h.prototype.writeUIntLE=function(t,e,r,i){t=+t,e|=0,r|=0,i||T(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+n]=t/o&255;return e+r},h.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,1,255,0),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},h.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},h.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},h.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):C(this,t,e,!0),e+4},h.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},h.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);T(this,t,e,r,n-1,-n)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},h.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);T(this,t,e,r,n-1,-n)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},h.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,1,127,-128),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},h.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},h.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},h.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):C(this,t,e,!0),e+4},h.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},h.prototype.writeFloatLE=function(t,e,r){return P(this,t,e,!0,r)},h.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},h.prototype.writeDoubleLE=function(t,e,r){return L(this,t,e,!0,r)},h.prototype.writeDoubleBE=function(t,e,r){return L(this,t,e,!1,r)},h.prototype.copy=function(t,e,r,i){if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--n)t[n+e]=this[n+r];else if(o<1e3||!h.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function F(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(q,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,i){for(var n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}}).call(this,r(7))},function(t,e,r){(function(t){!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(110).Buffer}catch(t){}function a(t,e,r){for(var n=0,o=Math.min(t.length,r),s=0,a=e;a=49&&u<=54?u-49+10:u>=17&&u<=22?u-17+10:u,s|=h}return i(!(240&s),"Invalid character in "+t),n}function h(t,e,r,n){for(var o=0,s=0,a=Math.min(t.length,r),h=e;h=49?u-49+10:u>=17?u-17+10:u,i(u>=0&&s"}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this._strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for?o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f:o.prototype.inspect=f;var l=["","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"],c=[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],d=[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];function p(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r._strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?l[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=c[t],f=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(f).toString(t);r=(p=p.idivn(f)).isZero()?m+r:l[u-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){this._strip();var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,n),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,i=0,n=0,o=0;n>8&255),r>16&255),6===o?(r>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r>=0)for(t[r--]=i;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function v(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function g(t,e,r){return v(t,e,r)}Math.imul||(m=p),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):r<63?p(this,t,e):r<1024?v(this,t,e):g(this,t,e)},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),g(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){var e=t<0;e&&(t=-t),i("number"==typeof t),i(t<67108864);for(var r=0,n=0;n>=26,r+=o/67108864|0,r+=s>>>26,this.words[n]=67108863&s}return 0!==r&&(this.words[n]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this._strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a._strip(),i._strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=(1<<26)%t,n=0,o=this.length-1;o>=0;o--)n=(r*n+(0|this.words[o]))%t;return e?-n:n},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*r;this.words[n]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}b.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r._strip(),r},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},n(w,b),w.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new M;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return y[t]=e,e},x.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(u(t,t.umod(this.m)._forceRed(this)),t)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},n(k,x),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=r,r.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},function(t,e,r){r.d(e,"b",(function(){return h})),r.d(e,"a",(function(){return u}));var i=r(21),n=r.n(i);function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function s(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(e)},n=s({},i,{},r,{},{method:"POST"});return a(12e3,fetch(t,n).then((function(t){if(t.ok)return t.json();throw t})))},u=function(t,e){return{jsonrpc:"2.0",method:t,id:10,params:e}}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){var i=e,n=r(12),o=r(5),s=r(41);i.assert=o,i.toArray=s.toArray,i.zero2=s.zero2,i.toHex=s.toHex,i.encode=s.encode,i.getNAF=function(t,e){for(var r=[],i=1<=0;){var o;if(n.isOdd()){var s=n.andln(i-1);o=s>(i>>1)-1?(i>>1)-s:s,n.isubn(o)}else o=0;r.push(o);for(var a=0!==n.cmpn(0)&&0===n.andln(i-1)?e+1:1,h=1;h0||e.cmpn(-n)>0;){var o,s,a,h=t.andln(3)+i&3,u=e.andln(3)+n&3;3===h&&(h=-1),3===u&&(u=-1),o=0==(1&h)?0:3!=(a=t.andln(7)+i&7)&&5!==a||2!==u?h:-h,r[0].push(o),s=0==(1&u)?0:3!=(a=e.andln(7)+n&7)&&5!==a||2!==h?u:-u,r[1].push(s),2*i===o+1&&(i=1-i),2*n===s+1&&(n=1-n),t.iushrn(1),e.iushrn(1)}return r},i.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},i.parseBytes=function(t){return"string"==typeof t?i.toArray(t,"hex"):t},i.intFromLE=function(t){return new n(t,"hex","le")}},function(t,e,r){var i=e,n=r(14),o=r(5),s=r(41);i.assert=o,i.toArray=s.toArray,i.zero2=s.zero2,i.toHex=s.toHex,i.encode=s.encode,i.getNAF=function(t,e,r){var i=new Array(Math.max(t.bitLength(),r)+1);i.fill(0);for(var n=1<(n>>1)-1?(n>>1)-h:h,o.isubn(a)):a=0,i[s]=a,o.iushrn(1)}return i},i.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i=0,n=0;t.cmpn(-i)>0||e.cmpn(-n)>0;){var o,s,a,h=t.andln(3)+i&3,u=e.andln(3)+n&3;3===h&&(h=-1),3===u&&(u=-1),o=0==(1&h)?0:3!=(a=t.andln(7)+i&7)&&5!==a||2!==u?h:-h,r[0].push(o),s=0==(1&u)?0:3!=(a=e.andln(7)+n&7)&&5!==a||2!==h?u:-u,r[1].push(s),2*i===o+1&&(i=1-i),2*n===s+1&&(n=1-n),t.iushrn(1),e.iushrn(1)}return r},i.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},i.parseBytes=function(t){return"string"==typeof t?i.toArray(t,"hex"):t},i.intFromLE=function(t){return new n(t,"hex","le")}},function(t,e){t.exports=g},function(t,e,r){var i=r(5),n=r(0);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function s(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function h(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=n,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n>6|192,r[i++]=63&s|128):o(t,n)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++n)),r[i++]=s>>18|240,r[i++]=s>>12&63|128,r[i++]=s>>6&63|128,r[i++]=63&s|128):(r[i++]=s>>12|224,r[i++]=s>>6&63|128,r[i++]=63&s|128)}else for(n=0;n>>0}return s},e.split32=function(t,e){for(var r=new Array(4*t.length),i=0,n=0;i>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,i){return t+e+r+i>>>0},e.sum32_5=function(t,e,r,i,n){return t+e+r+i+n>>>0},e.sum64=function(t,e,r,i){var n=t[e],o=i+t[e+1]>>>0,s=(o>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,i){return(e+i>>>0>>0},e.sum64_lo=function(t,e,r,i){return e+i>>>0},e.sum64_4_hi=function(t,e,r,i,n,o,s,a){var h=0,u=e;return h+=(u=u+i>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,r,i,n,o,s,a){return e+i+o+a>>>0},e.sum64_5_hi=function(t,e,r,i,n,o,s,a,h,u){var f=0,l=e;return f+=(l=l+i>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,r,i,n,o,s,a,h,u){return e+i+o+a+u>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},function(t,e,r){(function(t){!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(113).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e){var r,i,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var h,u=[],f=!1,l=-1;function c(){f&&h&&(f=!1,h.length?u=h.concat(u):l=-1,u.length&&d())}function d(){if(!f){var t=a(c);f=!0;for(var e=u.length;e;){for(h=u,u=[];++l1)for(var r=1;r=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e,r){var i=r(1).Buffer,n=r(44).Transform,o=r(49).StringDecoder;function s(t){n.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(0)(s,n),s.prototype.update=function(t,e,r){"string"==typeof t&&(t=i.from(t,e));var n=this._update(t);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(t,e,r){var i;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){i=t}finally{r(i)}},s.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},s.prototype._finalOrDigest=function(t){var e=this.__final()||i.alloc(0);return t&&(e=this._toString(e,t,!0)),e},s.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var i=this._decoder.write(t);return r&&(i+=this._decoder.end()),i},t.exports=s},function(t,e){t.exports=v},function(t,e,r){(function(e,i){var n=r(1).Buffer,o=e.crypto||e.msCrypto;o&&o.getRandomValues?t.exports=function(t,e){if(t>4294967295)throw new RangeError("requested too many random bytes");var r=n.allocUnsafe(t);if(t>0)if(t>65536)for(var s=0;s=0&&(o=r.type.substring(s));var a=t(e,r.components);i.isArray(a)&&e?n.push("tuple("+a.join(",")+")"+o):e?n.push("("+a+")"):n.push("("+a.join(",")+")"+o)}else n.push(r.type)})),n},u=function(t){if(!o.isHexStrict(t))throw new Error("The parameter must be a valid HEX string.");var e="",r=0,i=t.length;for("0x"===t.substring(0,2)&&(r=2);r7?r+=t[i].toUpperCase():r+=t[i];return r},toHex:o.toHex,toBN:o.toBN,bytesToHex:o.bytesToHex,hexToBytes:o.hexToBytes,hexToNumberString:o.hexToNumberString,hexToNumber:o.hexToNumber,toDecimal:o.hexToNumber,numberToHex:o.numberToHex,fromDecimal:o.numberToHex,hexToUtf8:o.hexToUtf8,hexToString:o.hexToUtf8,toUtf8:o.hexToUtf8,utf8ToHex:o.utf8ToHex,stringToHex:o.utf8ToHex,fromUtf8:o.utf8ToHex,hexToAscii:u,toAscii:u,asciiToHex:f,fromAscii:f,unitMap:n.unitMap,toWei:function(t,e){if(e=l(e),!o.isBN(t)&&!i.isString(t))throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return o.isBN(t)?n.toWei(t,e):n.toWei(t,e).toString(10)},fromWei:function(t,e){if(e=l(e),!o.isBN(t)&&!i.isString(t))throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return o.isBN(t)?n.fromWei(t,e):n.fromWei(t,e).toString(10)},padLeft:o.leftPad,leftPad:o.leftPad,padRight:o.rightPad,rightPad:o.rightPad,toTwosComplement:o.toTwosComplement,isBloom:o.isBloom,isUserEthereumAddressInBloom:o.isUserEthereumAddressInBloom,isContractAddressInBloom:o.isContractAddressInBloom,isTopic:o.isTopic,isTopicInBloom:o.isTopicInBloom,isInBloom:o.isInBloom}},function(t,e,r){var i=r(1).Buffer;function n(t,e){this._block=i.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}n.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=i.from(t,e));for(var r=this._block,n=this._blockSize,o=t.length,s=this._len,a=0;a=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(4294967295&r)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=n},function(t,e){t.exports=y},function(t,e){t.exports=w},function(t,e,r){r.d(e,"a",(function(){return c})),r.d(e,"d",(function(){return d})),r.d(e,"c",(function(){return p})),r.d(e,"b",(function(){return m}));var i=r(21),n=r.n(i),o=r(59),s=r.n(o),a=r(106),h=r.n(a),u=r(6),f=r(33);function l(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}var c=function t(e,r){var i=e;if("number"==typeof i&&(i=Array.from({length:i},(function(t,e){return e}))),r>i.length||r<=0)return[];if(r===i.length)return[i];if(1===r)return i.reduce((function(t,e){return[].concat(s()(t),[[e]])}),[]);for(var n=[],o=[],a=0;a<=i.length-r+1;a+=1){o=t(i.slice(a+1),r-1);for(var h=0;h=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=i.join32(t,0,t.length-r,this.endian);for(var n=0;n>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;o0&&t.compare(h)<0;var e}function c(t){var e=new Uint8Array(t);return void 0===o.getRandomValues?i.from(a.randomBytes(t)):(o.getRandomValues(e),i.from(e))}function d(t){return new Promise((function(e){var r=a.createHash("sha512").update(t).digest();e(new Uint8Array(r))}))}function p(t){return function(e,r,n){return new Promise((function(o){if(s)return s.importKey("raw",r,{name:"AES-CBC"},!1,[t]).then((function(r){var i={name:"AES-CBC",iv:e};return s[t](i,r,n)})).then((function(t){o(i.from(new Uint8Array(t)))}));if("encrypt"===t){var h=a.createCipheriv("aes-256-cbc",r,e);h.update(n),o(h.final())}else if("decrypt"===t){var u=a.createDecipheriv("aes-256-cbc",r,e);u.update(n),o(u.final())}}))}}var m=p("encrypt"),v=p("decrypt");e.generatePrivate=function(){for(var t=c(32);!l(t);)t=c(32);return t};var g=e.getPublic=function(t){return f(32===t.length,"Bad private key"),f(l(t),"Bad private key"),i.from(n.keyFromPrivate(t).getPublic("arr"))};e.getPublicCompressed=function(t){return f(32===t.length,"Bad private key"),f(l(t),"Bad private key"),i.from(n.keyFromPrivate(t).getPublic(!0,"arr"))},e.sign=function(t,e){return new Promise((function(r){f(32===t.length,"Bad private key"),f(l(t),"Bad private key"),f(e.length>0,"Message should not be empty"),f(e.length<=32,"Message is too long"),r(i.from(n.sign(e,t,{canonical:!0}).toDER()))}))},e.verify=function(t,e,r){return new Promise((function(i,o){f(65===t.length||33===t.length,"Bad public key"),65===t.length&&f(4===t[0],"Bad public key"),33===t.length&&f(2===t[0]||3===t[0],"Bad public key"),f(e.length>0,"Message should not be empty"),f(e.length<=32,"Message is too long"),n.verify(e,r,t)?i(null):o(new Error("Bad signature"))}))};var y=e.derive=function(t,e){return new Promise((function(r){f(i.isBuffer(t),"Bad private key"),f(i.isBuffer(e),"Bad public key"),f(32===t.length,"Bad private key"),f(l(t),"Bad private key"),f(65===e.length||33===e.length,"Bad public key"),65===e.length&&f(4===e[0],"Bad public key"),33===e.length&&f(2===e[0]||3===e[0],"Bad public key");var o=n.keyFromPrivate(t),s=n.keyFromPublic(e),a=o.derive(s.getPublic());r(i.from(a.toArray()))}))};e.encrypt=function(t,e,r){var n,o,s,h;return r=r||{},new Promise((function(e){for(var i=r.ephemPrivateKey||c(32);!l(i);)i=r.ephemPrivateKey||c(32);o=g(i),e(y(i,t))})).then((function(t){return d(t)})).then((function(t){n=r.iv||c(16);var i=t.slice(0,32);return h=t.slice(32),m(n,i,e)})).then((function(t){s=t;var e=i.concat([n,o,s]);return function(t,e){return new Promise((function(r){var n=a.createHmac("sha256",i.from(t));n.update(e),r(n.digest())}))}(h,e)})).then((function(t){return{iv:n,ephemPublicKey:o,ciphertext:s,mac:t}}))},e.decrypt=function(t,e){var r;return y(t,e.ephemPublicKey).then((function(t){return d(t)})).then((function(t){r=t.slice(0,32);var n,o,s,h=t.slice(32),u=i.concat([e.iv,e.ephemPublicKey,e.ciphertext]);return n=h,o=u,s=e.mac,new Promise((function(t){var e=a.createHmac("sha256",i.from(n));e.update(o),t(function(t,e){if(t.length!==e.length)return!1;for(var r=0,i=0;i0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=h,h.prototype.point=function(){throw new Error("Not implemented")},h.prototype.validate=function(){throw new Error("Not implemented")},h.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),i=o(e,1),n=(1<=h;e--)u=(u<<1)+i[e];s.push(u)}for(var f=this.jpoint(null,null,null),l=this.jpoint(null,null,null),c=n;c>0;c--){for(h=0;h=0;u--){for(e=0;u>=0&&0===s[u];u--)e++;if(u>=0&&e++,h=h.dblp(e),u<0)break;var f=s[u];a(0!==f),h="affine"===t.type?f>0?h.mixedAdd(n[f-1>>1]):h.mixedAdd(n[-f-1>>1].neg()):f>0?h.add(n[f-1>>1]):h.add(n[-f-1>>1].neg())}return"affine"===t.type?h.toP():h},h.prototype._wnafMulAdd=function(t,e,r,i,n){for(var a=this._wnafT1,h=this._wnafT2,u=this._wnafT3,f=0,l=0;l=1;l-=2){var d=l-1,p=l;if(1===a[d]&&1===a[p]){var m=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(m[1]=e[d].add(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].add(e[p].neg())):(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],g=s(r[d],r[p]);f=Math.max(g[0].length,f),u[d]=new Array(f),u[p]=new Array(f);for(var y=0;y=0;l--){for(var S=0;l>=0;){var x=!0;for(y=0;y=0&&S++,M=M.dblp(S),l<0)break;for(y=0;y0?k=h[y][A-1>>1]:A<0&&(k=h[y][-A-1>>1].neg()),M="affine"===k.type?M.mixedAdd(k):M.add(k))}}for(l=0;l=Math.ceil((t.bitLength()+1)/e.step)},u.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n>>24]^f[p>>>16&255]^l[m>>>8&255]^c[255&v]^e[g++],s=u[p>>>24]^f[m>>>16&255]^l[v>>>8&255]^c[255&d]^e[g++],a=u[m>>>24]^f[v>>>16&255]^l[d>>>8&255]^c[255&p]^e[g++],h=u[v>>>24]^f[d>>>16&255]^l[p>>>8&255]^c[255&m]^e[g++],d=o,p=s,m=a,v=h;return o=(i[d>>>24]<<24|i[p>>>16&255]<<16|i[m>>>8&255]<<8|i[255&v])^e[g++],s=(i[p>>>24]<<24|i[m>>>16&255]<<16|i[v>>>8&255]<<8|i[255&d])^e[g++],a=(i[m>>>24]<<24|i[v>>>16&255]<<16|i[d>>>8&255]<<8|i[255&p])^e[g++],h=(i[v>>>24]<<24|i[d>>>16&255]<<16|i[p>>>8&255]<<8|i[255&m])^e[g++],[o>>>=0,s>>>=0,a>>>=0,h>>>=0]}var a=[0,1,2,4,8,16,32,64,128,27,54],h=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],s=0,a=0,h=0;h<256;++h){var u=a^a<<1^a<<2^a<<3^a<<4;u=u>>>8^255&u^99,r[s]=u,i[u]=s;var f=t[s],l=t[f],c=t[l],d=257*t[u]^16843008*u;n[0][s]=d<<24|d>>>8,n[1][s]=d<<16|d>>>16,n[2][s]=d<<8|d>>>24,n[3][s]=d,d=16843009*c^65537*l^257*f^16843008*s,o[0][u]=d<<24|d>>>8,o[1][u]=d<<16|d>>>16,o[2][u]=d<<8|d>>>24,o[3][u]=d,0===s?s=a=1:(s=f^t[t[t[c^f]]],a^=t[t[a]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}}();function u(t){this._key=n(t),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,i=4*(r+1),n=[],o=0;o>>24,s=h.SBOX[s>>>24]<<24|h.SBOX[s>>>16&255]<<16|h.SBOX[s>>>8&255]<<8|h.SBOX[255&s],s^=a[o/e|0]<<24):e>6&&o%e==4&&(s=h.SBOX[s>>>24]<<24|h.SBOX[s>>>16&255]<<16|h.SBOX[s>>>8&255]<<8|h.SBOX[255&s]),n[o]=n[o-e]^s}for(var u=[],f=0;f>>24]]^h.INV_SUB_MIX[1][h.SBOX[c>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[c>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&c]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=u},u.prototype.encryptBlockRaw=function(t){return s(t=n(t),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},u.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=i.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},u.prototype.decryptBlock=function(t){var e=(t=n(t))[1];t[1]=t[3],t[3]=e;var r=s(t,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),o=i.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},u.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=u},function(t,e,r){var i=r(1).Buffer,n=r(43);t.exports=function(t,e,r,o){if(i.isBuffer(t)||(t=i.from(t,"binary")),e&&(i.isBuffer(e)||(e=i.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=r/8,a=i.alloc(s),h=i.alloc(o||0),u=i.alloc(0);s>0||o>0;){var f=new n;f.update(u),f.update(t),e&&f.update(e),u=f.digest();var l=0;if(s>0){var c=a.length-s;l=Math.min(s,u.length),u.copy(a,c,0,l),s-=l}if(l0){var d=h.length-o,p=Math.min(o,u.length-l);u.copy(h,d,l,l+p),o-=p}}return u.fill(0),{key:a,iv:h}}},function(t,e,r){var i=r(14),n=r(9),o=n.getNAF,s=n.getJSF,a=n.assert;function h(t,e){this.type=t,this.p=new i(e.p,16),this.red=e.prime?i.red(e.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=e.n&&new i(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=h,h.prototype.point=function(){throw new Error("Not implemented")},h.prototype.validate=function(){throw new Error("Not implemented")},h.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),i=o(e,1,this._bitLength),n=(1<=h;e--)u=(u<<1)+i[e];s.push(u)}for(var f=this.jpoint(null,null,null),l=this.jpoint(null,null,null),c=n;c>0;c--){for(h=0;h=0;u--){for(e=0;u>=0&&0===s[u];u--)e++;if(u>=0&&e++,h=h.dblp(e),u<0)break;var f=s[u];a(0!==f),h="affine"===t.type?f>0?h.mixedAdd(n[f-1>>1]):h.mixedAdd(n[-f-1>>1].neg()):f>0?h.add(n[f-1>>1]):h.add(n[-f-1>>1].neg())}return"affine"===t.type?h.toP():h},h.prototype._wnafMulAdd=function(t,e,r,i,n){for(var a=this._wnafT1,h=this._wnafT2,u=this._wnafT3,f=0,l=0;l=1;l-=2){var d=l-1,p=l;if(1===a[d]&&1===a[p]){var m=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(m[1]=e[d].add(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].add(e[p].neg())):(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],g=s(r[d],r[p]);f=Math.max(g[0].length,f),u[d]=new Array(f),u[p]=new Array(f);for(var y=0;y=0;l--){for(var S=0;l>=0;){var x=!0;for(y=0;y=0&&S++,M=M.dblp(S),l<0)break;for(y=0;y0?k=h[y][A-1>>1]:A<0&&(k=h[y][-A-1>>1].neg()),M="affine"===k.type?M.mixedAdd(k):M.add(k))}}for(l=0;l=Math.ceil((t.bitLength()+1)/e.step)},u.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n>8,s=255&n;o?r.push(o,s):r.push(s)}return r},i.zero2=n,i.toHex=o,i.encode=function(t,e){return"hex"===e?o(t):t}},function(t,e,r){var i,n=e,o=r(25),s=r(61),a=r(8).assert;function h(t){"short"===t.type?this.curve=new s.short(t):"edwards"===t.type?this.curve=new s.edwards(t):this.curve=new s.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new h(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=h,u("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:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("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:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("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:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("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:o.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"]}),u("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:o.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"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("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:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=r(124)}catch(t){i=void 0}u("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:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},function(t,e,r){var i=r(0),n=r(66),o=r(1).Buffer,s=new Array(16);function a(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function h(t,e){return t<>>32-e}function u(t,e,r,i,n,o,s){return h(t+(e&r|~e&i)+n+o|0,s)+e|0}function f(t,e,r,i,n,o,s){return h(t+(e&i|r&~i)+n+o|0,s)+e|0}function l(t,e,r,i,n,o,s){return h(t+(e^r^i)+n+o|0,s)+e|0}function c(t,e,r,i,n,o,s){return h(t+(r^(e|~i))+n+o|0,s)+e|0}i(a,n),a.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,i=this._b,n=this._c,o=this._d;r=u(r,i,n,o,t[0],3614090360,7),o=u(o,r,i,n,t[1],3905402710,12),n=u(n,o,r,i,t[2],606105819,17),i=u(i,n,o,r,t[3],3250441966,22),r=u(r,i,n,o,t[4],4118548399,7),o=u(o,r,i,n,t[5],1200080426,12),n=u(n,o,r,i,t[6],2821735955,17),i=u(i,n,o,r,t[7],4249261313,22),r=u(r,i,n,o,t[8],1770035416,7),o=u(o,r,i,n,t[9],2336552879,12),n=u(n,o,r,i,t[10],4294925233,17),i=u(i,n,o,r,t[11],2304563134,22),r=u(r,i,n,o,t[12],1804603682,7),o=u(o,r,i,n,t[13],4254626195,12),n=u(n,o,r,i,t[14],2792965006,17),r=f(r,i=u(i,n,o,r,t[15],1236535329,22),n,o,t[1],4129170786,5),o=f(o,r,i,n,t[6],3225465664,9),n=f(n,o,r,i,t[11],643717713,14),i=f(i,n,o,r,t[0],3921069994,20),r=f(r,i,n,o,t[5],3593408605,5),o=f(o,r,i,n,t[10],38016083,9),n=f(n,o,r,i,t[15],3634488961,14),i=f(i,n,o,r,t[4],3889429448,20),r=f(r,i,n,o,t[9],568446438,5),o=f(o,r,i,n,t[14],3275163606,9),n=f(n,o,r,i,t[3],4107603335,14),i=f(i,n,o,r,t[8],1163531501,20),r=f(r,i,n,o,t[13],2850285829,5),o=f(o,r,i,n,t[2],4243563512,9),n=f(n,o,r,i,t[7],1735328473,14),r=l(r,i=f(i,n,o,r,t[12],2368359562,20),n,o,t[5],4294588738,4),o=l(o,r,i,n,t[8],2272392833,11),n=l(n,o,r,i,t[11],1839030562,16),i=l(i,n,o,r,t[14],4259657740,23),r=l(r,i,n,o,t[1],2763975236,4),o=l(o,r,i,n,t[4],1272893353,11),n=l(n,o,r,i,t[7],4139469664,16),i=l(i,n,o,r,t[10],3200236656,23),r=l(r,i,n,o,t[13],681279174,4),o=l(o,r,i,n,t[0],3936430074,11),n=l(n,o,r,i,t[3],3572445317,16),i=l(i,n,o,r,t[6],76029189,23),r=l(r,i,n,o,t[9],3654602809,4),o=l(o,r,i,n,t[12],3873151461,11),n=l(n,o,r,i,t[15],530742520,16),r=c(r,i=l(i,n,o,r,t[2],3299628645,23),n,o,t[0],4096336452,6),o=c(o,r,i,n,t[7],1126891415,10),n=c(n,o,r,i,t[14],2878612391,15),i=c(i,n,o,r,t[5],4237533241,21),r=c(r,i,n,o,t[12],1700485571,6),o=c(o,r,i,n,t[3],2399980690,10),n=c(n,o,r,i,t[10],4293915773,15),i=c(i,n,o,r,t[1],2240044497,21),r=c(r,i,n,o,t[8],1873313359,6),o=c(o,r,i,n,t[15],4264355552,10),n=c(n,o,r,i,t[6],2734768916,15),i=c(i,n,o,r,t[13],1309151649,21),r=c(r,i,n,o,t[4],4149444226,6),o=c(o,r,i,n,t[11],3174756917,10),n=c(n,o,r,i,t[2],718787259,15),i=c(i,n,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+o|0},a.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 t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=a},function(t,e,r){t.exports=n;var i=r(45).EventEmitter;function n(){i.call(this)}r(0)(n,i),n.Readable=r(46),n.Writable=r(140),n.Duplex=r(141),n.Transform=r(142),n.PassThrough=r(143),n.Stream=n,n.prototype.pipe=function(t,e){var r=this;function n(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",n),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",h));var s=!1;function a(){s||(s=!0,t.end())}function h(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function u(t){if(f(),0===i.listenerCount(this,"error"))throw t}function f(){r.removeListener("data",n),t.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",h),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),t.removeListener("close",f)}return r.on("error",u),t.on("error",u),r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t}},function(t,e,r){var i,n="object"==typeof Reflect?Reflect:null,o=n&&"function"==typeof n.apply?n.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};i=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}t.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var h=10;function u(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function f(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function l(t,e,r,i){var n,o,s,a;if(u(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=f(t))>0&&s.length>n&&!s.warned){s.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=t,h.type=e,h.count=s.length,a=h,console&&console.warn&&console.warn(a)}return t}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=c.bind(i);return n.listener=r,i.wrapFn=n,n}function p(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var h=n[t];if(void 0===h)return!1;if("function"==typeof h)o(h,this,e);else{var u=h.length,f=v(h,u);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},a.prototype.listeners=function(t){return p(this,t,!0)},a.prototype.rawListeners=function(t){return p(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},function(t,e,r){(e=t.exports=r(67)).Stream=e,e.Readable=e,e.Writable=r(48),e.Duplex=r(18),e.Transform=r(70),e.PassThrough=r(139)},function(t,e,r){var i=r(2),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=s),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},function(t,e,r){(function(e,i,n){var o=r(36);function s(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(void 0),i=i.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=y;var a,h=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?i:o.nextTick;y.WritableState=g;var u=Object.create(r(28));u.inherits=r(0);var f,l={deprecate:r(137)},c=r(68),d=r(47).Buffer,p=n.Uint8Array||function(){},m=r(69);function v(){}function g(t,e){a=a||r(18),t=t||{};var i=e instanceof a;this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var n=t.highWaterMark,u=t.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i&&(u||0===u)?u:f,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 l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,i,n){--e.pendingcb,r?(o.nextTick(n,i),o.nextTick(x,t,e),t._writableState.errorEmitted=!0,t.emit("error",i)):(n(i),t._writableState.errorEmitted=!0,t.emit("error",i),x(t,e))}(t,r,i,e,n);else{var s=_(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||M(t,r),i?h(w,t,r,s,n):w(t,r,s,n)}}(e,t)},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 s(this)}function y(t){if(a=a||r(18),!(f.call(y,this)||this instanceof a))return new y(t);this._writableState=new g(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),c.call(this)}function b(t,e,r,i,n,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function w(t,e,r,i){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,i(),x(t,e)}function M(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,n=new Array(i),o=e.corkedRequestsFree;o.entry=r;for(var a=0,h=!0;r;)n[a]=r,r.isBuf||(h=!1),r=r.next,a+=1;n.allBuffers=h,b(t,e,!0,e.length,n,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new s(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,f=r.encoding,l=r.callback;if(b(t,e,!1,e.objectMode?1:u.length,u,f,l),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function _(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function S(t,e){t._final((function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),x(t,e)}))}function x(t,e){var r=_(e);return r&&(function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(S,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}u.inherits(y,c),g.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(g.prototype,"buffer",{get:l.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(t){return!!f.call(this,t)||this===y&&t&&t._writableState instanceof g}})):f=function(t){return t instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(t,e,r){var i,n=this._writableState,s=!1,a=!n.objectMode&&(i=t,d.isBuffer(i)||i instanceof p);return a&&!d.isBuffer(t)&&(t=function(t){return d.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=v),n.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),o.nextTick(e,r)}(this,r):(a||function(t,e,r,i){var n=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),o.nextTick(i,s),n=!1),n}(this,n,t,r))&&(n.pendingcb++,s=function(t,e,r,i,n,o){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=d.from(e,r)),e}(e,i,n);i!==s&&(r=!0,n="buffer",i=s)}var a=e.objectMode?1:i.length;e.length+=a;var h=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(t,e,r){var i=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||function(t,e,r){e.ending=!0,x(t,e),r&&(e.finished?o.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,i,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,r(13),r(135).setImmediate,r(7))},function(t,e,r){var i=r(138).Buffer,n=i.isEncoding||function(t){switch((t=""+t)&&t.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}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===n||!n(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=h,this.end=u,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=f,this.end=l,e=3;break;default:return this.write=c,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function h(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function c(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(n>0&&(t.lastNeed=n-1),n):--i=0?(n>0&&(t.lastNeed=n-2),n):--i=0?(n>0&&(2===n?n=0:t.lastNeed=n-3),n):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,r){var i=r(2).Buffer,n=r(0),o=r(66),s=new Array(16),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],h=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],f=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],l=[0,1518500249,1859775393,2400959708,2840853838],c=[1352829926,1548603684,1836072691,2053994217,0];function d(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(t,e){return t<>>32-e}function m(t,e,r,i,n,o,s,a){return p(t+(e^r^i)+o+s|0,a)+n|0}function v(t,e,r,i,n,o,s,a){return p(t+(e&r|~e&i)+o+s|0,a)+n|0}function g(t,e,r,i,n,o,s,a){return p(t+((e|~r)^i)+o+s|0,a)+n|0}function y(t,e,r,i,n,o,s,a){return p(t+(e&i|r&~i)+o+s|0,a)+n|0}function b(t,e,r,i,n,o,s,a){return p(t+(e^(r|~i))+o+s|0,a)+n|0}n(d,o),d.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,i=0|this._b,n=0|this._c,o=0|this._d,d=0|this._e,w=0|this._a,M=0|this._b,_=0|this._c,S=0|this._d,x=0|this._e,k=0;k<80;k+=1){var A,E;k<16?(A=m(r,i,n,o,d,t[a[k]],l[0],u[k]),E=b(w,M,_,S,x,t[h[k]],c[0],f[k])):k<32?(A=v(r,i,n,o,d,t[a[k]],l[1],u[k]),E=y(w,M,_,S,x,t[h[k]],c[1],f[k])):k<48?(A=g(r,i,n,o,d,t[a[k]],l[2],u[k]),E=g(w,M,_,S,x,t[h[k]],c[2],f[k])):k<64?(A=y(r,i,n,o,d,t[a[k]],l[3],u[k]),E=v(w,M,_,S,x,t[h[k]],c[3],f[k])):(A=b(r,i,n,o,d,t[a[k]],l[4],u[k]),E=m(w,M,_,S,x,t[h[k]],c[4],f[k])),r=d,d=o,o=p(n,10),n=i,i=A,w=x,x=S,S=p(_,10),_=M,M=E}var B=this._b+n+S|0;this._b=this._c+o+x|0,this._c=this._d+d+w|0,this._d=this._e+r+M|0,this._e=this._a+i+_|0,this._a=B},d.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 t=i.alloc?i.alloc(20):new i(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=d},function(t,e,r){(e=t.exports=function(t){t=t.toLowerCase();var r=e[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r}).sha=r(144),e.sha1=r(145),e.sha224=r(146),e.sha256=r(71),e.sha384=r(147),e.sha512=r(72)},function(t,e,r){var i=r(5);function n(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}t.exports=n,n.prototype._init=function(){},n.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},n.prototype._buffer=function(t,e){for(var r=Math.min(this.buffer.length-this.bufferOff,t.length-e),i=0;i0;i--)e+=this._buffer(t,e),r+=this._flushBuffer(n,r);return e+=this._buffer(t,e),n},n.prototype.final=function(t){var e,r;return t&&(e=this.update(t)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},n.prototype._pad=function(t,e){if(0===e)return!1;for(;e=0||!r.umod(t.prime1)||!r.umod(t.prime2);)r=new i(n(e));return r}t.exports=o,o.getr=s}).call(this,r(2).Buffer)},function(t,e,r){var i,n=e,o=r(25),s=r(90),a=r(9).assert;function h(t){"short"===t.type?this.curve=new s.short(t):"edwards"===t.type?this.curve=new s.edwards(t):this.curve=new s.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new h(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=h,u("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:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("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:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("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:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("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:o.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"]}),u("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:o.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"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("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:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=r(181)}catch(t){i=void 0}u("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:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},function(t,e,r){(function(t){!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(210).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e,r){(function(t,r){var i;!function(){var n="object"==typeof self&&self.self===self&&self||"object"==typeof t&&t.global===t&&t||this||{},o=n._,s=Array.prototype,a=Object.prototype,h="undefined"!=typeof Symbol?Symbol.prototype:null,u=s.push,f=s.slice,l=a.toString,c=a.hasOwnProperty,d=Array.isArray,p=Object.keys,m=Object.create,v=function(){},g=function t(e){return e instanceof t?e:this instanceof t?void(this._wrapped=e):new t(e)};e.nodeType?n._=g:(!r.nodeType&&r.exports&&(e=r.exports=g),e._=g),g.VERSION="1.9.1";var y,b=function(t,e,r){if(void 0===e)return t;switch(null==r?3:r){case 1:return function(r){return t.call(e,r)};case 3:return function(r,i,n){return t.call(e,r,i,n)};case 4:return function(r,i,n,o){return t.call(e,r,i,n,o)}}return function(){return t.apply(e,arguments)}},w=function(t,e,r){return g.iteratee!==y?g.iteratee(t,e):null==t?g.identity:g.isFunction(t)?b(t,e,r):g.isObject(t)&&!g.isArray(t)?g.matcher(t):g.property(t)};g.iteratee=y=function(t,e){return w(t,e,1/0)};var M=function(t,e){return e=null==e?t.length-1:+e,function(){for(var r=Math.max(arguments.length-e,0),i=Array(r),n=0;n=0&&e<=A};g.each=g.forEach=function(t,e,r){var i,n;if(e=b(e,r),B(t))for(i=0,n=t.length;i0?0:s-1;for(n||(i=e[o?o[a]:a],a+=t);a>=0&&a=3;return e(t,b(r,n,4),i,o)}};g.reduce=g.foldl=g.inject=O(1),g.reduceRight=g.foldr=O(-1),g.find=g.detect=function(t,e,r){var i=(B(t)?g.findIndex:g.findKey)(t,e,r);if(void 0!==i&&-1!==i)return t[i]},g.filter=g.select=function(t,e,r){var i=[];return e=w(e,r),g.each(t,(function(t,r,n){e(t,r,n)&&i.push(t)})),i},g.reject=function(t,e,r){return g.filter(t,g.negate(w(e)),r)},g.every=g.all=function(t,e,r){e=w(e,r);for(var i=!B(t)&&g.keys(t),n=(i||t).length,o=0;o=0},g.invoke=M((function(t,e,r){var i,n;return g.isFunction(e)?n=e:g.isArray(e)&&(i=e.slice(0,-1),e=e[e.length-1]),g.map(t,(function(t){var o=n;if(!o){if(i&&i.length&&(t=k(t,i)),null==t)return;o=t[e]}return null==o?o:o.apply(t,r)}))})),g.pluck=function(t,e){return g.map(t,g.property(e))},g.where=function(t,e){return g.filter(t,g.matcher(e))},g.findWhere=function(t,e){return g.find(t,g.matcher(e))},g.max=function(t,e,r){var i,n,o=-1/0,s=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,h=(t=B(t)?t:g.values(t)).length;ao&&(o=i);else e=w(e,r),g.each(t,(function(t,r,i){((n=e(t,r,i))>s||n===-1/0&&o===-1/0)&&(o=t,s=n)}));return o},g.min=function(t,e,r){var i,n,o=1/0,s=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,h=(t=B(t)?t:g.values(t)).length;ai||void 0===r)return 1;if(r0?0:n-1;o>=0&&o0?s=o>=0?o:Math.max(o+a,s):a=o>=0?Math.min(o+1,a):o+a+1;else if(r&&o&&a)return i[o=r(i,n)]===n?o:-1;if(n!=n)return(o=e(f.call(i,s,a),g.isNaN))>=0?o+s:-1;for(o=t>0?s:a-1;o>=0&&oe?(i&&(clearTimeout(i),i=null),a=u,s=t.apply(n,o),i||(n=o=null)):i||!1===r.trailing||(i=setTimeout(h,f)),s};return u.cancel=function(){clearTimeout(i),a=0,i=n=o=null},u},g.debounce=function(t,e,r){var i,n,o=function(e,r){i=null,r&&(n=t.apply(e,r))},s=M((function(s){if(i&&clearTimeout(i),r){var a=!i;i=setTimeout(o,e),a&&(n=t.apply(this,s))}else i=g.delay(o,e,this,s);return n}));return s.cancel=function(){clearTimeout(i),i=null},s},g.wrap=function(t,e){return g.partial(e,t)},g.negate=function(t){return function(){return!t.apply(this,arguments)}},g.compose=function(){var t=arguments,e=t.length-1;return function(){for(var r=e,i=t[e].apply(this,arguments);r--;)i=t[r].call(this,i);return i}},g.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},g.before=function(t,e){var r;return function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=null),r}},g.once=g.partial(g.before,2),g.restArguments=M;var P=!{toString:null}.propertyIsEnumerable("toString"),L=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],q=function(t,e){var r=L.length,i=t.constructor,n=g.isFunction(i)&&i.prototype||a,o="constructor";for(x(t,o)&&!g.contains(e,o)&&e.push(o);r--;)(o=L[r])in t&&t[o]!==n[o]&&!g.contains(e,o)&&e.push(o)};g.keys=function(t){if(!g.isObject(t))return[];if(p)return p(t);var e=[];for(var r in t)x(t,r)&&e.push(r);return P&&q(t,e),e},g.allKeys=function(t){if(!g.isObject(t))return[];var e=[];for(var r in t)e.push(r);return P&&q(t,e),e},g.values=function(t){for(var e=g.keys(t),r=e.length,i=Array(r),n=0;n1&&(i=b(i,e[1])),e=g.allKeys(t)):(i=z,e=T(e,!1,!1),t=Object(t));for(var n=0,o=e.length;n1&&(r=e[1])):(e=g.map(T(e,!1,!1),String),i=function(t,r){return!g.contains(e,r)}),g.pick(t,i,r)})),g.defaults=D(g.allKeys,!0),g.create=function(t,e){var r=_(t);return e&&g.extendOwn(r,e),r},g.clone=function(t){return g.isObject(t)?g.isArray(t)?t.slice():g.extend({},t):t},g.tap=function(t,e){return e(t),t},g.isMatch=function(t,e){var r=g.keys(e),i=r.length;if(null==t)return!i;for(var n=Object(t),o=0;o":">",'"':""","'":"'","`":"`"},W=g.invert(Z),K=function(t){var e=function(e){return t[e]},r="(?:"+g.keys(t).join("|")+")",i=RegExp(r),n=RegExp(r,"g");return function(t){return t=null==t?"":""+t,i.test(t)?t.replace(n,e):t}};g.escape=K(Z),g.unescape=K(W),g.result=function(t,e,r){g.isArray(e)||(e=[e]);var i=e.length;if(!i)return g.isFunction(r)?r.call(t):r;for(var n=0;n/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var G=/(.)^/,Y={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},J=/\\|'|\r|\n|\u2028|\u2029/g,X=function(t){return"\\"+Y[t]};g.template=function(t,e,r){!e&&r&&(e=r),e=g.defaults({},e,g.templateSettings);var i,n=RegExp([(e.escape||G).source,(e.interpolate||G).source,(e.evaluate||G).source].join("|")+"|$","g"),o=0,s="__p+='";t.replace(n,(function(e,r,i,n,a){return s+=t.slice(o,a).replace(J,X),o=a+e.length,r?s+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":i?s+="'+\n((__t=("+i+"))==null?'':__t)+\n'":n&&(s+="';\n"+n+"\n__p+='"),e})),s+="';\n",e.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{i=new Function(e.variable||"obj","_",s)}catch(t){throw t.source=s,t}var a=function(t){return i.call(this,t,g)},h=e.variable||"obj";return a.source="function("+h+"){\n"+s+"}",a},g.chain=function(t){var e=g(t);return e._chain=!0,e};var $=function(t,e){return t._chain?g(e).chain():e};g.mixin=function(t){return g.each(g.functions(t),(function(e){var r=g[e]=t[e];g.prototype[e]=function(){var t=[this._wrapped];return u.apply(t,arguments),$(this,r.apply(g,t))}})),g},g.mixin(g),g.each(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=s[t];g.prototype[t]=function(){var r=this._wrapped;return e.apply(r,arguments),"shift"!==t&&"splice"!==t||0!==r.length||delete r[0],$(this,r)}})),g.each(["concat","join","slice"],(function(t){var e=s[t];g.prototype[t]=function(){return $(this,e.apply(this._wrapped,arguments))}})),g.prototype.value=function(){return this._wrapped},g.prototype.valueOf=g.prototype.toJSON=g.prototype.value,g.prototype.toString=function(){return String(this._wrapped)},void 0===(i=function(){return g}.apply(e,[]))||(r.exports=i)}()}).call(this,r(7),r(4)(t))},function(t,e){t.exports=T},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){var i=e;i.base=r(35),i.short=r(115),i.mont=r(116),i.edwards=r(117)},function(t,e,r){var i=r(11).rotr32;function n(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function s(t,e,r){return t^e^r}e.ft_1=function(t,e,r,i){return 0===t?n(e,r,i):1===t||3===t?s(e,r,i):2===t?o(e,r,i):void 0},e.ch32=n,e.maj32=o,e.p32=s,e.s0_256=function(t){return i(t,2)^i(t,13)^i(t,22)},e.s1_256=function(t){return i(t,6)^i(t,11)^i(t,25)},e.g0_256=function(t){return i(t,7)^i(t,18)^t>>>3},e.g1_256=function(t){return i(t,17)^i(t,19)^t>>>10}},function(t,e,r){var i=r(11),n=r(26),o=r(62),s=r(5),a=i.sum32,h=i.sum32_4,u=i.sum32_5,f=o.ch32,l=o.maj32,c=o.s0_256,d=o.s1_256,p=o.g0_256,m=o.g1_256,v=n.BlockHash,g=[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];function y(){if(!(this instanceof y))return new y;v.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}i.inherits(y,v),t.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}t.exports=s,s.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},s.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(i=r,r=e,e=null),r&&(r=n.toArray(r,i||"hex"),this._update(r));for(var o=[];o.length=this._blockSize;){for(var o=this._blockOffset;o0;++s)this._length[s]+=a,(a=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*a);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},function(t,e,r){(function(e,i){var n=r(36);t.exports=b;var o,s=r(60);b.ReadableState=y,r(45).EventEmitter;var a=function(t,e){return t.listeners(e).length},h=r(68),u=r(47).Buffer,f=e.Uint8Array||function(){},l=Object.create(r(28));l.inherits=r(0);var c=r(132),d=void 0;d=c&&c.debuglog?c.debuglog("stream"):function(){};var p,m=r(133),v=r(69);l.inherits(b,h);var g=["error","close","destroy","pause","resume"];function y(t,e){t=t||{};var i=e instanceof(o=o||r(18));this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,s=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,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.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=r(49).StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function b(t){if(o=o||r(18),!(this instanceof b))return new b(t);this._readableState=new y(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),h.call(this)}function w(t,e,r,i,n){var o,s=t._readableState;return null===e?(s.reading=!1,function(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,S(t)}}(t,s)):(n||(o=function(t,e){var r,i;return i=e,u.isBuffer(i)||i instanceof f||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(s,e)),o?t.emit("error",o):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),i?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):M(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?M(t,s,e,!1):k(t,s)):M(t,s,e,!1))):i||(s.reading=!1)),function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=8388608?t=8388608:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function S(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(d("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?n.nextTick(x,t):x(t))}function x(t){d("emit readable"),t.emit("readable"),O(t)}function k(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(A,t,e))}function A(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var i;return to.length?o.length:t;if(s===o.length?n+=o:n+=o.slice(0,t),0==(t-=s)){s===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++i}return e.length-=i,n}(t,e):function(t,e){var r=u.allocUnsafe(t),i=e.head,n=1;for(i.data.copy(r),t-=i.data.length;i=i.next;){var o=i.data,s=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,s),0==(t-=s)){s===o.length?(++n,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=o.slice(s));break}++n}return e.length-=n,r}(t,e),i}(t,e.buffer,e.decoder),r);var r}function I(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,n.nextTick(T,e,t))}function T(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function j(t,e){for(var r=0,i=t.length;r=e.highWaterMark||e.ended))return d("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?I(this):S(this),null;if(0===(t=_(t,e))&&e.ended)return 0===e.length&&I(this),null;var i,n=e.needReadable;return d("need readable",n),(0===e.length||e.length-t0?R(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&I(this)),null!==i&&this.emit("data",i),i},b.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(t,e){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,e);var h=e&&!1===e.end||t===i.stdout||t===i.stderr?y:u;function u(){d("onend"),t.end()}o.endEmitted?n.nextTick(h):r.once("end",h),t.on("unpipe",(function e(i,n){d("onunpipe"),i===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d("cleanup"),t.removeListener("close",v),t.removeListener("finish",g),t.removeListener("drain",f),t.removeListener("error",m),t.removeListener("unpipe",e),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",p),l=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}));var f=function(t){return function(){var e=t._readableState;d("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,O(t))}}(r);t.on("drain",f);var l=!1,c=!1;function p(e){d("ondata"),c=!1,!1!==t.write(e)||c||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==j(o.pipes,t))&&!l&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,c=!0),r.pause())}function m(e){d("onerror",e),y(),t.removeListener("error",m),0===a(t,"error")&&t.emit("error",e)}function v(){t.removeListener("finish",g),y()}function g(){d("onfinish"),t.removeListener("close",v),y()}function y(){d("unpipe"),r.unpipe(t)}return r.on("data",p),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?s(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",m),t.once("close",v),t.once("finish",g),t.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),t},b.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function c(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}i(h,n),h.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},h.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,h=0|this._e,p=0|this._f,m=0|this._g,v=0|this._h,g=0;g<16;++g)r[g]=t.readInt32BE(4*g);for(;g<64;++g)r[g]=0|(((e=r[g-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[g-7]+d(r[g-15])+r[g-16];for(var y=0;y<64;++y){var b=v+c(h)+u(h,p,m)+s[y]+r[y]|0,w=l(i)+f(i,n,o)|0;v=m,m=p,p=h,h=a+b|0,a=o,o=n,n=i,i=b+w|0}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=h+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=v+this._h|0},h.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=h},function(t,e,r){var i=r(0),n=r(20),o=r(1).Buffer,s=[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],a=new Array(160);function h(){this.init(),this._w=a,n.call(this,128,112)}function u(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function l(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function c(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function m(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function v(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function g(t,e){return t>>>0>>0?1:0}i(h,n),h.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},h.prototype._update=function(t){for(var e=this._w,r=0|this._ah,i=0|this._bh,n=0|this._ch,o=0|this._dh,a=0|this._eh,h=0|this._fh,y=0|this._gh,b=0|this._hh,w=0|this._al,M=0|this._bl,_=0|this._cl,S=0|this._dl,x=0|this._el,k=0|this._fl,A=0|this._gl,E=0|this._hl,B=0;B<32;B+=2)e[B]=t.readInt32BE(4*B),e[B+1]=t.readInt32BE(4*B+4);for(;B<160;B+=2){var O=e[B-30],R=e[B-30+1],I=d(O,R),T=p(R,O),j=m(O=e[B-4],R=e[B-4+1]),C=v(R,O),N=e[B-14],P=e[B-14+1],L=e[B-32],q=e[B-32+1],D=T+P|0,U=I+N+g(D,T)|0;U=(U=U+j+g(D=D+C|0,C)|0)+L+g(D=D+q|0,q)|0,e[B]=U,e[B+1]=D}for(var F=0;F<160;F+=2){U=e[F],D=e[F+1];var z=f(r,i,n),H=f(w,M,_),Z=l(r,w),W=l(w,r),K=c(a,x),V=c(x,a),G=s[F],Y=s[F+1],J=u(a,h,y),X=u(x,k,A),$=E+V|0,Q=b+K+g($,E)|0;Q=(Q=(Q=Q+J+g($=$+X|0,X)|0)+G+g($=$+Y|0,Y)|0)+U+g($=$+D|0,D)|0;var tt=W+H|0,et=Z+z+g(tt,W)|0;b=y,E=A,y=h,A=k,h=a,k=x,a=o+Q+g(x=S+$|0,S)|0,o=n,S=_,n=i,_=M,i=r,M=w,r=Q+et+g(w=$+tt|0,$)|0}this._al=this._al+w|0,this._bl=this._bl+M|0,this._cl=this._cl+_|0,this._dl=this._dl+S|0,this._el=this._el+x|0,this._fl=this._fl+k|0,this._gl=this._gl+A|0,this._hl=this._hl+E|0,this._ah=this._ah+r+g(this._al,w)|0,this._bh=this._bh+i+g(this._bl,M)|0,this._ch=this._ch+n+g(this._cl,_)|0,this._dh=this._dh+o+g(this._dl,S)|0,this._eh=this._eh+a+g(this._el,x)|0,this._fh=this._fh+h+g(this._fl,k)|0,this._gh=this._gh+y+g(this._gl,A)|0,this._hh=this._hh+b+g(this._hl,E)|0},h.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=h},function(t,e,r){var i=r(0),n=r(148),o=r(15),s=r(1).Buffer,a=r(74),h=r(50),u=r(51),f=s.alloc(128);function l(t,e){o.call(this,"digest"),"string"==typeof e&&(e=s.from(e));var r="sha512"===t||"sha384"===t?128:64;this._alg=t,this._key=e,e.length>r?e=("rmd160"===t?new h:u(t)).update(e).digest():e.lengthr||o!=o)throw new TypeError("Bad key length")}}).call(this,r(2).Buffer)},function(t,e,r){(function(e){var r;r=e.browser||parseInt(e.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary",t.exports=r}).call(this,r(13))},function(t,e,r){var i=r(74),n=r(50),o=r(51),s=r(77),a=r(78),h=r(1).Buffer,u=h.alloc(128),f={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function l(t,e,r){var s=function(t){return"rmd160"===t||"ripemd160"===t?function(t){return(new n).update(t).digest()}:"md5"===t?i:function(e){return o(t).update(e).digest()}}(t),a="sha512"===t||"sha384"===t?128:64;e.length>a?e=s(e):e.length>>0},e.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},e.ip=function(t,e,r,i){for(var n=0,o=0,s=6;s>=0;s-=2){for(var a=0;a<=24;a+=8)n<<=1,n|=e>>>a+s&1;for(a=0;a<=24;a+=8)n<<=1,n|=t>>>a+s&1}for(s=6;s>=0;s-=2){for(a=1;a<=25;a+=8)o<<=1,o|=e>>>a+s&1;for(a=1;a<=25;a+=8)o<<=1,o|=t>>>a+s&1}r[i+0]=n>>>0,r[i+1]=o>>>0},e.rip=function(t,e,r,i){for(var n=0,o=0,s=0;s<4;s++)for(var a=24;a>=0;a-=8)n<<=1,n|=e>>>a+s&1,n<<=1,n|=t>>>a+s&1;for(s=4;s<8;s++)for(a=24;a>=0;a-=8)o<<=1,o|=e>>>a+s&1,o<<=1,o|=t>>>a+s&1;r[i+0]=n>>>0,r[i+1]=o>>>0},e.pc1=function(t,e,r,i){for(var n=0,o=0,s=7;s>=5;s--){for(var a=0;a<=24;a+=8)n<<=1,n|=e>>a+s&1;for(a=0;a<=24;a+=8)n<<=1,n|=t>>a+s&1}for(a=0;a<=24;a+=8)n<<=1,n|=e>>a+s&1;for(s=1;s<=3;s++){for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1;for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1}for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1;r[i+0]=n>>>0,r[i+1]=o>>>0},e.r28shl=function(t,e){return t<>>28-e};var i=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];e.pc2=function(t,e,r,n){for(var o=0,s=0,a=i.length>>>1,h=0;h>>i[h]&1;for(h=a;h>>i[h]&1;r[n+0]=o>>>0,r[n+1]=s>>>0},e.expand=function(t,e,r){var i=0,n=0;i=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)i<<=6,i|=t>>>o&63;for(o=11;o>=3;o-=4)n|=t>>>o&63,n<<=6;n|=(31&t)<<1|t>>>31,e[r+0]=i>>>0,e[r+1]=n>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];e.substitute=function(t,e){for(var r=0,i=0;i<4;i++)r<<=4,r|=n[64*i+(t>>>18-6*i&63)];for(i=0;i<4;i++)r<<=4,r|=n[256+64*i+(e>>>18-6*i&63)];return r>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];e.permute=function(t){for(var e=0,r=0;r>>o[r]&1;return e>>>0},e.padSplit=function(t,e,r){for(var i=t.toString(2);i.length>>1];r=o.r28shl(r,a),n=o.r28shl(n,a),o.pc2(r,n,t.keys,s)}},h.prototype._update=function(t,e,r,i){var n=this._desState,s=o.readUInt32BE(t,e),a=o.readUInt32BE(t,e+4);o.ip(s,a,n.tmp,0),s=n.tmp[0],a=n.tmp[1],"encrypt"===this.type?this._encrypt(n,s,a,n.tmp,0):this._decrypt(n,s,a,n.tmp,0),s=n.tmp[0],a=n.tmp[1],o.writeUInt32BE(r,s,i),o.writeUInt32BE(r,a,i+4)},h.prototype._pad=function(t,e){for(var r=t.length-e,i=e;i>>0,s=c}o.rip(a,s,i,n)},h.prototype._decrypt=function(t,e,r,i,n){for(var s=r,a=e,h=t.keys.length-2;h>=0;h-=2){var u=t.keys[h],f=t.keys[h+1];o.expand(s,t.tmp,0),u^=t.tmp[0],f^=t.tmp[1];var l=o.substitute(u,f),c=s;s=(a^o.permute(l))>>>0,a=c}o.rip(s,a,i,n)}},function(t,e,r){var i=r(29),n=r(1).Buffer,o=r(83);function s(t){var e=t._cipher.encryptBlockRaw(t._prev);return o(t._prev),e}e.encrypt=function(t,e){var r=Math.ceil(e.length/16),o=t._cache.length;t._cache=n.concat([t._cache,n.allocUnsafe(16*r)]);for(var a=0;at;)r.ishrn(1);if(r.isEven()&&r.iadd(a),r.testn(1)||r.iadd(h),e.cmp(h)){if(!e.cmp(u))for(;r.mod(f).cmp(l);)r.iadd(d)}else for(;r.mod(o).cmp(c);)r.iadd(d);if(m(p=r.shrn(1))&&m(r)&&v(p)&&v(r)&&s.test(p)&&s.test(r))return r}}},function(t,e,r){(function(t){!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(167).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e,r){var i=r(168),n=r(24);function o(t){this.rand=t||new n.Rand}t.exports=o,o.create=function(t){return new o(t)},o.prototype._randbelow=function(t){var e=t.bitLength(),r=Math.ceil(e/8);do{var n=new i(this.rand.generate(r))}while(n.cmp(t)>=0);return n},o.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},o.prototype.test=function(t,e,r){var n=t.bitLength(),o=i.mont(t),s=new i(1).toRed(o);e||(e=Math.max(1,n/48|0));for(var a=t.subn(1),h=0;!a.testn(h);h++);for(var u=t.shrn(h),f=a.toRed(o);e>0;e--){var l=this._randrange(new i(2),a);r&&r(l);var c=l.toRed(o).redPow(u);if(0!==c.cmp(s)&&0!==c.cmp(f)){for(var d=1;d0;e--){var f=this._randrange(new i(2),s),l=t.gcd(f);if(0!==l.cmpn(1))return l;var c=f.toRed(n).redPow(h);if(0!==c.cmp(o)&&0!==c.cmp(u)){for(var d=1;d=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e,r){var i=r(0),n=r(31).Reporter,o=r(2).Buffer;function s(t,e){n.call(this,e),o.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function a(t,e){if(Array.isArray(t))this.length=0,this.value=t.map((function(t){return t instanceof a||(t=new a(t,e)),this.length+=t.length,t}),this);else if("number"==typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=o.byteLength(t);else{if(!o.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}i(s,n),e.DecoderBuffer=s,s.prototype.save=function(){return{offset:this.offset,reporter:n.prototype.save.call(this)}},s.prototype.restore=function(t){var e=new s(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,n.prototype.restore.call(this,t.reporter),e},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},s.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");var r=new s(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+t,this.offset+=t,r},s.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},e.EncoderBuffer=a,a.prototype.join=function(t,e){return t||(t=new o(this.length)),e||(e=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(t,e),e+=r.length})):("number"==typeof this.value?t[e]=this.value:"string"==typeof this.value?t.write(this.value,e):o.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length)),t}},function(t,e,r){var i=e;i._reverse=function(t){var e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);var i=t[r];e[i]=r})),e},i.der=r(196)},function(t,e,r){var i=r(0),n=r(30),o=n.base,s=n.bignum,a=n.constants.der;function h(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new u,this.tree._init(t.body)}function u(t){o.Node.call(this,"der",t)}function f(t,e){var r=t.readUInt8(e);if(t.isError(r))return r;var i=a.tagClass[r>>6],n=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=t.readUInt8(e),t.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:a.tag[r]}}function l(t,e,r){var i=t.readUInt8(r);if(t.isError(i))return i;if(!e&&128===i)return null;if(0==(128&i))return i;var n=127&i;if(n>4)return t.error("length octect is too long");i=0;for(var o=0;o=31?i.error("Multi-octet tag encoding unsupported"):(e||(n|=32),n|a.tagClassByName[r||"universal"]<<6)}(t,e,r,this.reporter);if(i.length<128)return(o=new n(2))[0]=s,o[1]=i.length,this._createEncoderBuffer([o,i]);for(var h=1,u=i.length;u>=256;u>>=8)h++;(o=new n(2+h))[0]=s,o[1]=128|h,u=1+h;for(var f=i.length;f>0;u--,f>>=8)o[u]=255&f;return this._createEncoderBuffer([o,i])},u.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){for(var r=new n(2*t.length),i=0;i=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}var o=0;for(i=0;i=128;s>>=7)o++}var a=new n(o),h=a.length-1;for(i=t.length-1;i>=0;i--)for(s=t[i],a[h--]=127&s;(s>>=7)>0;)a[h--]=128|127&s;return this._createEncoderBuffer(a)},u.prototype._encodeTime=function(t,e){var r,i=new Date(t);return"gentime"===e?r=[f(i.getFullYear()),f(i.getUTCMonth()+1),f(i.getUTCDate()),f(i.getUTCHours()),f(i.getUTCMinutes()),f(i.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[f(i.getFullYear()%100),f(i.getUTCMonth()+1),f(i.getUTCDate()),f(i.getUTCHours()),f(i.getUTCMinutes()),f(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!n.isBuffer(t)){var r=t.toArray();!t.sign&&128&r[0]&&r.unshift(0),t=new n(r)}if(n.isBuffer(t)){var i=t.length;0===t.length&&i++;var o=new n(i);return t.copy(o),0===t.length&&(o[0]=0),this._createEncoderBuffer(o)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);i=1;for(var s=t;s>=256;s>>=8)i++;for(s=(o=new Array(i)).length-1;s>=0;s--)o[s]=255&t,t>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(new n(o))},u.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},u.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},u.prototype._skipDefault=function(t,e,r){var i,n=this._baseState;if(null===n.default)return!1;var o=t.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,e,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;i7&&t[r].toUpperCase()!==t[r]||parseInt(e[r],16)<=7&&t[r].toLowerCase()!==t[r])return!1;return!0},p=function(t){var e="";t=(t=(t=(t=(t=s.encode(t)).replace(/^(?:\u0000)*/,"")).split("").reverse().join("")).replace(/^(?:\u0000)*/,"")).split("").reverse().join("");for(var r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return"0x"+e.join("")},isHex:function(t){return(i.isString(t)||i.isNumber(t))&&/^(-0x|0x)?[0-9a-f]*$/i.test(t)},isHexStrict:g,leftPad:function(t,e,r){var i=/^0x/i.test(t)||"number"==typeof t,n=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(i?"0x":"")+new Array(n).join(r||"0")+t},rightPad:function(t,e,r){var i=/^0x/i.test(t)||"number"==typeof t,n=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(i?"0x":"")+t+new Array(n).join(r||"0")},toTwosComplement:function(t){return"0x"+l(t).toTwos(256).toString(16,64)},sha3:b,sha3Raw:function(t){return null===(t=b(t))?y:t}}}).call(this,r(2).Buffer)},function(t,e,r){(function(t){!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(218).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e,r){(function(t){var i=r(10),n=r.n(i),o=r(21),s=r.n(o),a=r(22),h=r.n(a),u=r(104),f=r.n(u),l=r(105),c=r.n(l),d=r(3),p=r.n(d),m=r(34),v=r(32),g=r(16),y=r.n(g),b=r(19),w=r(6),M=r(33),_=r(23);function S(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function x(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},r=t.enableLogging,i=void 0!==r&&r,n=t.metadataHost,o=void 0===n?"https://metadata.tor.us":n;f()(this,e),this.ec=new v.ec("secp256k1"),this.metadataHost=o,y.a.setDefaultLevel("DEBUG"),i||y.a.disableAll()}var r,i,o;return c()(e,[{key:"retrieveShares",value:(o=h()(n.a.mark((function e(r,i,o,s,a){var u,f,l,c,d,v,g,S,k=this;return n.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(u=[],f=Object(m.generatePrivate)(),l=Object(m.getPublic)(f).toString("hex"),c=l.slice(2,66),d=l.slice(66),v=Object(b.keccak256)(a),g=0;g=3*~~(r.length/4)+1?Promise.resolve(t):Promise.reject(new Error("invalid"))})).then((function(e){for(var u=[],l=[],c=0;c=1+~~(r.length/2)&&h)){e.next=32;break}for(u=[],l=[],c=0;c0?(o[c].result.keys.sort((function(t,e){return new p.a(t.Index,16).cmp(new p.a(e.Index,16))})),o[c].result.keys[0].Metadata?(d={ephemPublicKey:t.from(o[c].result.keys[0].Metadata.ephemPublicKey,"hex"),iv:t.from(o[c].result.keys[0].Metadata.iv,"hex"),mac:t.from(o[c].result.keys[0].Metadata.mac,"hex"),mode:t.from(o[c].result.keys[0].Metadata.mode,"hex")},u.push(Object(m.decrypt)(f,x({},d,{ciphertext:t.from(atob(o[c].result.keys[0].Share).padStart(64,"0"),"hex")})).catch((function(t){return y.a.debug("share decryption",t)})))):u.push(Promise.resolve(t.from(o[c].result.keys[0].Share.padStart(64,"0"),"hex")))):u.push(Promise.resolve(void 0)),l.push(new p.a(i[c],16));return e.next=8,Promise.all(u);case 8:if(v=e.sent,!s.resolved){e.next=11;break}return e.abrupt("return",void 0);case 11:g=v.reduce((function(t,e,r){return e&&t.push({index:l[r],value:new p.a(e)}),t}),[]),b=Object(_.a)(g.length,1+~~(r.length/2)),M=function(e){var r=b[e],i=g.filter((function(t,e){return r.includes(e)})),n=i.map((function(t){return t.value})),o=i.map((function(t){return t.index})),s=k.lagrangeInterpolation(n,o),a=Object(m.getPublic)(t.from(s.toString(16,64),"hex")).toString("hex"),u=a.slice(2,66),f=a.slice(66);if(0===new p.a(u,16).cmp(new p.a(h.X,16))&&0===new p.a(f,16).cmp(new p.a(h.Y,16)))return w=s,"break"},S=0;case 15:if(!(S3&&void 0!==arguments[3]&&arguments[3];return Object(_.c)(t,o,s).then((function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.keyResult,n=r.errorResult;if(n)return Object(_.b)(t,e,void 0,void 0,o,s).then((function(e){return Object(_.c)(t,o,s)}));if(i)return{keyResult:i};throw new Error("node results do not match")})).then(h()(n.a.mark((function t(){var e,r,o,s,h,u,f,l,c=arguments;return n.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},!(r=e.keyResult)){t.next=13;break}return o=r.keys[0],s=o.pub_key_X,h=o.pub_key_Y,t.next=5,i.getMetadata({pub_key_X:s,pub_key_Y:h});case 5:if(u=t.sent,f=i.ec.keyFromPublic({x:s.toString(16),y:h.toString(16)}).getPublic().add(i.ec.keyFromPrivate(u.toString(16)).getPublic()),s=f.getX().toString(16),h=f.getY().toString(16),l=i.generateAddressFromPubKey(f.getX(),f.getY()),a){t.next=12;break}return t.abrupt("return",l);case 12:return t.abrupt("return",{address:l,X:s,Y:h});case 13:throw new Error("node results do not match");case 14:case"end":return t.stop()}}),t)}))))}}]),e}();e.a=k}).call(this,r(2).Buffer)},function(t,e){t.exports=M},function(t,e){t.exports=S},function(t,e){t.exports=m.a},function(t,e,r){r.r(e);var i=r(103);e.default=i.a},function(t,e,r){e.byteLength=function(t){var e=u(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,i=u(t),s=i[0],a=i[1],h=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),f=0,l=a>0?s-4:s;for(r=0;r>16&255,h[f++]=e>>8&255,h[f++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,h[f++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,h[f++]=e>>8&255,h[f++]=255&e),h},e.fromByteArray=function(t){for(var e,r=t.length,n=r%3,o=[],s=0,a=r-n;sa?a:s+16383));return 1===n?(e=t[r-1],o.push(i[e>>2]+i[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],o.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"=")),o.join("")};for(var i=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,h=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var n,o,s=[],a=e;a>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,i,n){var o,s,a=8*n-i-1,h=(1<>1,f=-7,l=r?n-1:0,c=r?-1:1,d=t[e+l];for(l+=c,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+t[e+l],l+=c,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=i;f>0;s=256*s+t[e+l],l+=c,f-=8);if(0===o)o=1-u;else{if(o===h)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),o-=u}return(d?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,r,i,n,o){var s,a,h,u=8*o-n-1,f=(1<>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-s))<1&&(s--,h*=2),(e+=s+l>=1?c/h:c*Math.pow(2,1-l))*h>=2&&(s++,h/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*h-1)*Math.pow(2,n),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,n),s=0));n>=8;t[r+d]=255&a,d+=p,a/=256,n-=8);for(s=s<0;t[r+d]=255&s,d+=p,s/=256,u-=8);t[r+d-p]|=128*m}},function(t,e){},function(t,e,r){var i=e;i.version=r(112).version,i.utils=r(8),i.rand=r(24),i.curve=r(61),i.curves=r(42),i.ec=r(125),i.eddsa=r(128)},function(t){t.exports=JSON.parse('{"_from":"elliptic@6.5.1","_id":"elliptic@6.5.1","_inBundle":false,"_integrity":"sha512-xvJINNLbTeWQjrl6X+7eQCrIy/YPv5XCpKW6kB5mKvtnGILoLDcySuwomfdzt0BMdLNVnuRNTuzKNHj0bva1Cg==","_location":"/eccrypto/elliptic","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"elliptic@6.5.1","name":"elliptic","escapedName":"elliptic","rawSpec":"6.5.1","saveSpec":null,"fetchSpec":"6.5.1"},"_requiredBy":["/eccrypto"],"_resolved":"https://registry.npmjs.org/elliptic/-/elliptic-6.5.1.tgz","_shasum":"c380f5f909bf1b9b4428d028cd18d3b0efd6b52b","_spec":"elliptic@6.5.1","_where":"/home/chai/source/repos/torus/torus.js/node_modules/eccrypto","author":{"name":"Fedor Indutny","email":"fedor@indutny.com"},"bugs":{"url":"https://github.com/indutny/elliptic/issues"},"bundleDependencies":false,"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":false,"description":"EC cryptography","devDependencies":{"brfs":"^1.4.3","coveralls":"^3.0.4","grunt":"^1.0.4","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":"^9.0.1","istanbul":"^0.4.2","jscs":"^3.0.7","jshint":"^2.6.0","mocha":"^6.1.4"},"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.5.1"}')},function(t,e){},function(t,e){},function(t,e,r){var i=r(8),n=r(12),o=r(0),s=r(35),a=i.assert;function h(t){s.call(this,"short",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.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(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(t,e,r,i){s.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(e,16),this.y=new n(r,16),i&&(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 f(t,e,r,i){s.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(e,16),this.y=new n(r,16),this.z=new n(i,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}o(h,s),t.exports=h,h.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new n(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);e=(e=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(t.lambda)r=new n(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new n(t.a,16),b:new n(t.b,16)}})):this._getEndoBasis(r)}}},h.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:n.mont(t),r=new n(2).toRed(e).redInvm(),i=r.redNeg(),o=new n(3).toRed(e).redNeg().redSqrt().redMul(r);return[i.redAdd(o).fromRed(),i.redSub(o).fromRed()]},h.prototype._getEndoBasis=function(t){for(var e,r,i,o,s,a,h,u,f,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),c=t,d=this.n.clone(),p=new n(1),m=new n(0),v=new n(0),g=new n(1),y=0;0!==c.cmpn(0);){var b=d.div(c);u=d.sub(b.mul(c)),f=v.sub(b.mul(p));var w=g.sub(b.mul(m));if(!i&&u.cmp(l)<0)e=h.neg(),r=p,i=u.neg(),o=f;else if(i&&2==++y)break;h=u,d=c,c=u,v=p,p=f,g=m,m=w}s=u.neg(),a=f;var M=i.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(M)>=0&&(s=e,a=r),i.negative&&(i=i.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:i,b:o},{a:s,b:a}]},h.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=n.mul(r.a),a=o.mul(i.a),h=n.mul(r.b),u=o.mul(i.b);return{k1:t.sub(s).sub(a),k2:h.add(u).neg()}},h.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=i.fromRed().isOdd();return(e&&!o||!e&&o)&&(i=i.redNeg()),this.point(t,i)},h.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},h.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o":""},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},u.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(t){return t=new n(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},u.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},u.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},u.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(f,s.BasePoint),h.prototype.jpoint=function(t,e,r){return new f(this,t,e,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=i.redSub(n),h=o.redSub(s);if(0===a.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),f=u.redMul(a),l=i.redMul(u),c=h.redSqr().redIAdd(f).redISub(l).redISub(l),d=h.redMul(l.redISub(c)).redISub(o.redMul(f)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(c,d,p)},f.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(i),a=n.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=s.redSqr(),u=h.redMul(s),f=r.redMul(h),l=a.redSqr().redIAdd(u).redISub(f).redISub(f),c=a.redMul(f.redISub(l)).redISub(n.redMul(u)),d=this.z.redMul(s);return this.curve.jpoint(l,c,d)},f.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(t,e,r){var i=r(12),n=r(0),o=r(35),s=r(8);function a(t){o.call(this,"mont",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function h(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(e,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(a,o),t.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),i=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===i.redSqrt().redSqr().cmp(i)},n(h,o.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},a.prototype.point=function(t,e){return new h(this,t,e)},a.prototype.pointFromJSON=function(t){return h.fromJSON(this,t)},h.prototype.precompute=function(){},h.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},h.fromJSON=function(t,e){return new h(t,e[0],e[1]||t.one)},h.prototype.inspect=function(){return this.isInfinity()?"":""},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},h.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),i=t.redMul(e),n=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},h.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),s=n.redMul(i),a=e.z.redMul(o.redAdd(s).redSqr()),h=e.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,h)},h.prototype.mul=function(t){for(var e=t.clone(),r=this,i=this.curve.point(null,null),n=[];0!==e.cmpn(0);e.iushrn(1))n.push(e.andln(1));for(var o=n.length-1;o>=0;o--)0===n[o]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},h.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},h.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},h.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(t,e,r){var i=r(8),n=r(12),o=r(0),s=r(35),a=i.assert;function h(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,s.call(this,"edwards",t),this.a=new n(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function u(t,e,r,i,o){s.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new n(e,16),this.y=new n(r,16),this.z=i?new n(i,16):this.curve.one,this.t=o&&new n(o,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(h,s),t.exports=h,h.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},h.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},h.prototype.jpoint=function(t,e,r,i){return this.point(t,e,r,i)},h.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=i.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var h=a.fromRed().isOdd();return(e&&!h||!e&&h)&&(a=a.redNeg()),this.point(t,a)},h.prototype.pointFromY=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=i.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},h.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),i=e.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===i.cmp(n)},o(u,s.BasePoint),h.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},h.prototype.point=function(t,e,r,i){return new u(this,t,e,r,i)},u.fromJSON=function(t,e){return new u(t,e[0],e[1],e[2])},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(t),n=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=i.redAdd(e),s=o.redSub(r),a=i.redSub(e),h=n.redMul(s),u=o.redMul(a),f=n.redMul(a),l=s.redMul(o);return this.curve.point(h,u,l,f)},u.prototype._projDbl=function(){var t,e,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var s=(u=this.curve._mulA(n)).redAdd(o);if(this.zOne)t=i.redSub(n).redSub(o).redMul(s.redSub(this.curve.two)),e=s.redMul(u.redSub(o)),r=s.redSqr().redSub(s).redSub(s);else{var a=this.z.redSqr(),h=s.redSub(a).redISub(a);t=i.redSub(n).redISub(o).redMul(h),e=s.redMul(u.redSub(o)),r=s.redMul(h)}}else{var u=n.redAdd(o);a=this.curve._mulC(this.z).redSqr(),h=u.redSub(a).redSub(a),t=this.curve._mulC(i.redISub(u)).redMul(h),e=this.curve._mulC(u).redMul(n.redISub(o)),r=u.redMul(h)}return this.curve.point(t,e,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),n=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),s=n.redSub(i),a=n.redAdd(i),h=r.redAdd(e),u=o.redMul(s),f=a.redMul(h),l=o.redMul(h),c=s.redMul(a);return this.curve.point(u,f,c,l)},u.prototype._projAdd=function(t){var e,r,i=this.z.redMul(t.z),n=i.redSqr(),o=this.x.redMul(t.x),s=this.y.redMul(t.y),a=this.curve.d.redMul(o).redMul(s),h=n.redSub(a),u=n.redAdd(a),f=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(s),l=i.redMul(h).redMul(f);return this.curve.twisted?(e=i.redMul(u).redMul(s.redSub(this.curve._mulA(o))),r=h.redMul(u)):(e=i.redMul(u).redMul(s.redSub(o)),r=this.curve._mulC(h).redMul(u)),this.curve.point(l,e,r)},u.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},u.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},u.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},u.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(i),0===this.x.cmp(e))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},function(t,e,r){e.sha1=r(119),e.sha224=r(120),e.sha256=r(63),e.sha384=r(121),e.sha512=r(64)},function(t,e,r){var i=r(11),n=r(26),o=r(62),s=i.rotl32,a=i.sum32,h=i.sum32_5,u=o.ft_1,f=n.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function c(){if(!(this instanceof c))return new c;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}i.inherits(c,f),t.exports=c,c.blockSize=512,c.outSize=160,c.hmacStrength=80,c.padLength=64,c.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;ithis.blockSize&&(t=(new this.Hash).update(t).digest()),n(t.length<=this.blockSize);for(var e=t.length;e0))return s.iaddn(1),this.keyFromPrivate(s)}},l.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},l.prototype.sign=function(t,e,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new i(t,16));for(var s=this.n.byteLength(),a=e.getPrivate().toArray("be",s),h=t.toArray("be",s),u=new n({hash:this.hash,entropy:a,nonce:h,pers:o.pers,persEnc:o.persEnc||"utf8"}),l=this.n.sub(new i(1)),c=0;;c++){var d=o.k?o.k(c):new i(u.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(l)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var m=p.getX(),v=m.umod(this.n);if(0!==v.cmpn(0)){var g=d.invm(this.n).mul(v.mul(e.getPrivate()).iadd(t));if(0!==(g=g.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==m.cmp(v)?2:0);return o.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),y^=1),new f({r:v,s:g,recoveryParam:y})}}}}}},l.prototype.verify=function(t,e,r,n){t=this._truncateToN(new i(t,16)),r=this.keyFromPublic(r,n);var o=(e=new f(e,"hex")).r,s=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,h=s.invm(this.n),u=h.mul(t).umod(this.n),l=h.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),l)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(u,r.getPublic(),l)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},l.prototype.recoverPubKey=function(t,e,r,n){h((3&r)===r,"The recovery param is more than two bits"),e=new f(e,n);var o=this.n,s=new i(t),a=e.r,u=e.s,l=1&r,c=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),l):this.curve.pointFromX(a,l);var d=e.r.invm(o),p=o.sub(s).mul(d).umod(o),m=u.mul(d).umod(o);return this.g.mulAdd(p,a,m)},l.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new f(e,i)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(t,e,n)}catch(t){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},function(t,e,r){var i=r(12),n=r(8).assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new i(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?n(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return""}},function(t,e,r){var i=r(12),n=r(8),o=n.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new i(t.r,16),this.s=new i(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function h(t,e){var r=t[e.place++];if(!(128&r))return r;for(var i=15&r,n=0,o=0,s=e.place;o>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=s,s.prototype._importDER=function(t,e){t=n.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;if(h(t,r)+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=h(t,r),s=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var u=h(t,r);if(t.length!==u+r.place)return!1;var f=t.slice(r.place,u+r.place);return 0===s[0]&&128&s[1]&&(s=s.slice(1)),0===f[0]&&128&f[1]&&(f=f.slice(1)),this.r=new i(s),this.s=new i(f),this.recoveryParam=null,!0},s.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=u(e),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];f(i,e.length),(i=i.concat(e)).push(2),f(i,r.length);var o=i.concat(r),s=[48];return f(s,o.length),s=s.concat(o),n.encode(s,t)}},function(t,e,r){var i=r(25),n=r(42),o=r(8),s=o.assert,a=o.parseBytes,h=r(129),u=r(130);function f(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof f))return new f(t);t=n[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=i.sha512}t.exports=f,f.prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),i=this.hashInt(r.messagePrefix(),t),n=this.g.mul(i),o=this.encodePoint(n),s=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),h=i.add(s).umod(this.curve.n);return this.makeSignature({R:n,S:h,Rencoded:o})},f.prototype.verify=function(t,e,r){t=a(t),e=this.makeSignature(e);var i=this.keyFromPublic(r),n=this.hashInt(e.Rencoded(),i.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(i.pub().mul(n)).eq(o)},f.prototype.hashInt=function(){for(var t=this.hash(),e=0;e0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;for(var e,r,n=i.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=n,r=s,o.data.copy(e,r),s+=o.data.length,o=o.next;return n},t}(),n&&n.inspect&&n.inspect.custom&&(t.exports.prototype[n.inspect.custom]=function(){var t=n.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,r){(function(t){var i=void 0!==t&&t||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(n.call(setTimeout,i,arguments),clearTimeout)},e.setInterval=function(){return new o(n.call(setInterval,i,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(i,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(136),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(7))},function(t,e,r){(function(t,e){!function(t,r){if(!t.setImmediate){var i,n,o,s,a,h=1,u={},f=!1,l=t.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(t);c=c&&c.setTimeout?c:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick((function(){p(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&p(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),i=function(e){t.postMessage(s+e,"*")}):t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},i=function(t){o.port2.postMessage(t)}):l&&"onreadystatechange"in l.createElement("script")?(n=l.documentElement,i=function(t){var e=l.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,n.removeChild(e),e=null},n.appendChild(e)}):i=function(t){setTimeout(p,0,t)},c.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r>>2}function f(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}i(h,n),h.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},h.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,h=0|this._e,l=0;l<16;++l)r[l]=t.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var c=0;c<80;++c){var d=~~(c/20),p=0|((e=i)<<5|e>>>27)+f(d,n,o,a)+h+r[c]+s[d];h=a,a=o,o=u(n),n=i,i=p}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=h+this._e|0},h.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=h},function(t,e,r){var i=r(0),n=r(20),o=r(1).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function h(){this.init(),this._w=a,n.call(this,64,56)}function u(t){return t<<5|t>>>27}function f(t){return t<<30|t>>>2}function l(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}i(h,n),h.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},h.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,h=0|this._e,c=0;c<16;++c)r[c]=t.readInt32BE(4*c);for(;c<80;++c)r[c]=(e=r[c-3]^r[c-8]^r[c-14]^r[c-16])<<1|e>>>31;for(var d=0;d<80;++d){var p=~~(d/20),m=u(i)+l(p,n,o,a)+h+r[d]+s[p]|0;h=a,a=o,o=f(n),n=i,i=m}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=h+this._e|0},h.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=h},function(t,e,r){var i=r(0),n=r(71),o=r(20),s=r(1).Buffer,a=new Array(64);function h(){this.init(),this._w=a,o.call(this,64,56)}i(h,n),h.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},h.prototype._hash=function(){var t=s.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=h},function(t,e,r){var i=r(0),n=r(72),o=r(20),s=r(1).Buffer,a=new Array(160);function h(){this.init(),this._w=a,o.call(this,128,112)}i(h,n),h.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},h.prototype._hash=function(){var t=s.allocUnsafe(48);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=h},function(t,e,r){var i=r(0),n=r(1).Buffer,o=r(15),s=n.alloc(128);function a(t,e){o.call(this,"digest"),"string"==typeof e&&(e=n.from(e)),this._alg=t,this._key=e,e.length>64?e=t(e):e.length<64&&(e=n.concat([e,s],64));for(var r=this._ipad=n.allocUnsafe(64),i=this._opad=n.allocUnsafe(64),a=0;a<64;a++)r[a]=54^e[a],i[a]=92^e[a];this._hash=[r]}i(a,o),a.prototype._update=function(t){this._hash.push(t)},a.prototype._final=function(){var t=this._alg(n.concat(this._hash));return this._alg(n.concat([this._opad,t]))},t.exports=a},function(t,e,r){t.exports=r(75)},function(t,e,r){(function(e,i){var n,o=r(77),s=r(78),a=r(79),h=r(1).Buffer,u=e.crypto&&e.crypto.subtle,f={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},l=[];function c(t,e,r,i,n){return u.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then((function(t){return u.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:n}},t,i<<3)})).then((function(t){return h.from(t)}))}t.exports=function(t,r,d,p,m,v){"function"==typeof m&&(v=m,m=void 0);var g=f[(m=m||"sha1").toLowerCase()];if(!g||"function"!=typeof e.Promise)return i.nextTick((function(){var e;try{e=a(t,r,d,p,m)}catch(t){return v(t)}v(null,e)}));if(o(t,r,d,p),"function"!=typeof v)throw new Error("No callback provided to pbkdf2");h.isBuffer(t)||(t=h.from(t,s)),h.isBuffer(r)||(r=h.from(r,s)),function(t,e){t.then((function(t){i.nextTick((function(){e(null,t)}))}),(function(t){i.nextTick((function(){e(t)}))}))}(function(t){if(e.process&&!e.process.browser)return Promise.resolve(!1);if(!u||!u.importKey||!u.deriveBits)return Promise.resolve(!1);if(void 0!==l[t])return l[t];var r=c(n=n||h.alloc(8),n,10,128,t).then((function(){return!0})).catch((function(){return!1}));return l[t]=r,r}(g).then((function(e){return e?c(t,r,d,p,g):a(t,r,d,p,m)})),v)}}).call(this,r(7),r(13))},function(t,e,r){var i=r(152),n=r(53),o=r(54),s=r(165),a=r(38);function h(t,e,r){if(t=t.toLowerCase(),o[t])return n.createCipheriv(t,e,r);if(s[t])return new i({key:e,iv:r,mode:t});throw new TypeError("invalid suite type")}function u(t,e,r){if(t=t.toLowerCase(),o[t])return n.createDecipheriv(t,e,r);if(s[t])return new i({key:e,iv:r,mode:t,decrypt:!0});throw new TypeError("invalid suite type")}e.createCipher=e.Cipher=function(t,e){var r,i;if(t=t.toLowerCase(),o[t])r=o[t].key,i=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,i=s[t].iv}var n=a(e,!1,r,i);return h(t,n.key,n.iv)},e.createCipheriv=e.Cipheriv=h,e.createDecipher=e.Decipher=function(t,e){var r,i;if(t=t.toLowerCase(),o[t])r=o[t].key,i=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,i=s[t].iv}var n=a(e,!1,r,i);return u(t,n.key,n.iv)},e.createDecipheriv=e.Decipheriv=u,e.listCiphers=e.getCiphers=function(){return Object.keys(s).concat(n.getCiphers())}},function(t,e,r){var i=r(15),n=r(153),o=r(0),s=r(1).Buffer,a={"des-ede3-cbc":n.CBC.instantiate(n.EDE),"des-ede3":n.EDE,"des-ede-cbc":n.CBC.instantiate(n.EDE),"des-ede":n.EDE,"des-cbc":n.CBC.instantiate(n.DES),"des-ecb":n.DES};function h(t){i.call(this);var e,r=t.mode.toLowerCase(),n=a[r];e=t.decrypt?"decrypt":"encrypt";var o=t.key;s.isBuffer(o)||(o=s.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=s.concat([o,o.slice(0,8)]));var h=t.iv;s.isBuffer(h)||(h=s.from(h)),this._des=n.create({key:o,iv:h,type:e})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],t.exports=h,o(h,i),h.prototype._update=function(t){return s.from(this._des.update(t))},h.prototype._final=function(){return s.from(this._des.final())}},function(t,e,r){e.utils=r(80),e.Cipher=r(52),e.DES=r(81),e.CBC=r(154),e.EDE=r(155)},function(t,e,r){var i=r(5),n=r(0),o={};function s(t){i.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},c.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),r=-1;++r>s%8,t._prev=o(t._prev,r?i:n);return a}function o(t,e){var r=t.length,n=-1,o=i.allocUnsafe(t.length);for(t=i.concat([t,i.from([e])]);++n>7;return o}e.encrypt=function(t,e,r){for(var o=e.length,s=i.allocUnsafe(o),a=-1;++a>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function s(t){this.h=t,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}s.prototype.ghash=function(t){for(var e=-1;++e0;e--)i[e]=i[e]>>>1|(1&i[e-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=o(n)},s.prototype.update=function(t){var e;for(this.cache=i.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},s.prototype.final=function(t,e){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,t,0,e])),this.state},t.exports=s},function(t,e,r){var i=r(85),n=r(1).Buffer,o=r(54),s=r(86),a=r(15),h=r(37),u=r(38);function f(t,e,r){a.call(this),this._cache=new l,this._last=void 0,this._cipher=new h.AES(e),this._prev=n.from(r),this._mode=t,this._autopadding=!0}function l(){this.cache=n.allocUnsafe(0)}function c(t,e,r){var a=o[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=n.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof e&&(e=n.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);return"stream"===a.type?new s(a.module,e,r,!0):"auth"===a.type?new i(a.module,e,r,!0):new f(a.module,e,r)}r(0)(f,a),f.prototype._update=function(t){var e,r;this._cache.add(t);for(var i=[];e=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,e),i.push(r);return n.concat(i)},f.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");for(var r=-1;++r16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},e.createDecipher=function(t,e){var r=o[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=u(e,!1,r.key,r.iv);return c(t,i.key,i.iv)},e.createDecipheriv=c},function(t,e){e["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}},function(t,e,r){(function(t){var i=r(87),n=r(170),o=r(171),s={binary:!0,hex:!0,base64:!0};e.DiffieHellmanGroup=e.createDiffieHellmanGroup=e.getDiffieHellman=function(e){var r=new t(n[e].prime,"hex"),i=new t(n[e].gen,"hex");return new o(r,i)},e.createDiffieHellman=e.DiffieHellman=function e(r,n,a,h){return t.isBuffer(n)||void 0===s[n]?e(r,"binary",n,a):(n=n||"binary",h=h||"binary",a=a||new t([2]),t.isBuffer(a)||(a=new t(a,h)),"number"==typeof r?new o(i(r,a),a,!0):(t.isBuffer(r)||(r=new t(r,n)),new o(r,a,!0)))}}).call(this,r(2).Buffer)},function(t,e){},function(t,e,r){(function(t){!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(169).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e){},function(t){t.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},function(t,e,r){(function(e){var i=r(88),n=new(r(89)),o=new i(24),s=new i(11),a=new i(10),h=new i(3),u=new i(7),f=r(87),l=r(17);function c(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this._pub=new i(t),this}function d(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this._priv=new i(t),this}t.exports=m;var p={};function m(t,e,r){this.setGenerator(e),this.__prime=new i(t),this._prime=i.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=c,this.setPrivateKey=d):this._primeCode=8}function v(t,r){var i=new e(t.toArray());return r?i.toString(r):i}Object.defineProperty(m.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(t,e){var r=e.toString("hex"),i=[r,t.toString(16)].join("_");if(i in p)return p[i];var l,c=0;if(t.isEven()||!f.simpleSieve||!f.fermatTest(t)||!n.test(t))return c+=1,c+="02"===r||"05"===r?8:4,p[i]=c,c;switch(n.test(t.shrn(1))||(c+=2),r){case"02":t.mod(o).cmp(s)&&(c+=8);break;case"05":(l=t.mod(a)).cmp(h)&&l.cmp(u)&&(c+=8);break;default:c+=4}return p[i]=c,c}(this.__prime,this.__gen)),this._primeCode}}),m.prototype.generateKeys=function(){return this._priv||(this._priv=new i(l(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},m.prototype.computeSecret=function(t){var r=(t=(t=new i(t)).toRed(this._prime)).redPow(this._priv).fromRed(),n=new e(r.toArray()),o=this.getPrime();if(n.length0&&r.ishrn(i),r}function l(t,r,n){var o,s;do{for(o=new e(0);8*o.length=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e){},function(t){t.exports=JSON.parse('{"_from":"elliptic@^6.5.2","_id":"elliptic@6.5.2","_inBundle":false,"_integrity":"sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==","_location":"/elliptic","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"elliptic@^6.5.2","name":"elliptic","escapedName":"elliptic","rawSpec":"^6.5.2","saveSpec":null,"fetchSpec":"^6.5.2"},"_requiredBy":["/","/browserify-sign","/create-ecdh","/eth-lib","/secp256k1"],"_resolved":"https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz","_shasum":"05c5678d7173c049d8ca433552224a495d0e3762","_spec":"elliptic@^6.5.2","_where":"/home/chai/source/repos/torus/torus.js","author":{"name":"Fedor Indutny","email":"fedor@indutny.com"},"bugs":{"url":"https://github.com/indutny/elliptic/issues"},"bundleDependencies":false,"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":false,"description":"EC cryptography","devDependencies":{"brfs":"^1.4.3","coveralls":"^3.0.8","grunt":"^1.0.4","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":"^9.0.1","istanbul":"^0.4.2","jscs":"^3.0.7","jshint":"^2.10.3","mocha":"^6.2.2"},"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.5.2"}')},function(t,e){},function(t,e,r){var i=r(9),n=r(14),o=r(0),s=r(39),a=i.assert;function h(t){s.call(this,"short",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.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(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(t,e,r,i){s.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(e,16),this.y=new n(r,16),i&&(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 f(t,e,r,i){s.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(e,16),this.y=new n(r,16),this.z=new n(i,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}o(h,s),t.exports=h,h.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new n(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);e=(e=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(t.lambda)r=new n(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new n(t.a,16),b:new n(t.b,16)}})):this._getEndoBasis(r)}}},h.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:n.mont(t),r=new n(2).toRed(e).redInvm(),i=r.redNeg(),o=new n(3).toRed(e).redNeg().redSqrt().redMul(r);return[i.redAdd(o).fromRed(),i.redSub(o).fromRed()]},h.prototype._getEndoBasis=function(t){for(var e,r,i,o,s,a,h,u,f,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),c=t,d=this.n.clone(),p=new n(1),m=new n(0),v=new n(0),g=new n(1),y=0;0!==c.cmpn(0);){var b=d.div(c);u=d.sub(b.mul(c)),f=v.sub(b.mul(p));var w=g.sub(b.mul(m));if(!i&&u.cmp(l)<0)e=h.neg(),r=p,i=u.neg(),o=f;else if(i&&2==++y)break;h=u,d=c,c=u,v=p,p=f,g=m,m=w}s=u.neg(),a=f;var M=i.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(M)>=0&&(s=e,a=r),i.negative&&(i=i.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:i,b:o},{a:s,b:a}]},h.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=n.mul(r.a),a=o.mul(i.a),h=n.mul(r.b),u=o.mul(i.b);return{k1:t.sub(s).sub(a),k2:h.add(u).neg()}},h.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=i.fromRed().isOdd();return(e&&!o||!e&&o)&&(i=i.redNeg()),this.point(t,i)},h.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},h.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o":""},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},u.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(t){return t=new n(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},u.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},u.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},u.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(f,s.BasePoint),h.prototype.jpoint=function(t,e,r){return new f(this,t,e,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=i.redSub(n),h=o.redSub(s);if(0===a.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),f=u.redMul(a),l=i.redMul(u),c=h.redSqr().redIAdd(f).redISub(l).redISub(l),d=h.redMul(l.redISub(c)).redISub(o.redMul(f)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(c,d,p)},f.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(i),a=n.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=s.redSqr(),u=h.redMul(s),f=r.redMul(h),l=a.redSqr().redIAdd(u).redISub(f).redISub(f),c=a.redMul(f.redISub(l)).redISub(n.redMul(u)),d=this.z.redMul(s);return this.curve.jpoint(l,c,d)},f.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(t,e,r){var i=r(14),n=r(0),o=r(39),s=r(9);function a(t){o.call(this,"mont",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function h(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(e,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(a,o),t.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),i=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===i.redSqrt().redSqr().cmp(i)},n(h,o.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},a.prototype.point=function(t,e){return new h(this,t,e)},a.prototype.pointFromJSON=function(t){return h.fromJSON(this,t)},h.prototype.precompute=function(){},h.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},h.fromJSON=function(t,e){return new h(t,e[0],e[1]||t.one)},h.prototype.inspect=function(){return this.isInfinity()?"":""},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},h.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),i=t.redMul(e),n=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},h.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),s=n.redMul(i),a=e.z.redMul(o.redAdd(s).redSqr()),h=e.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,h)},h.prototype.mul=function(t){for(var e=t.clone(),r=this,i=this.curve.point(null,null),n=[];0!==e.cmpn(0);e.iushrn(1))n.push(e.andln(1));for(var o=n.length-1;o>=0;o--)0===n[o]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},h.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},h.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},h.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(t,e,r){var i=r(9),n=r(14),o=r(0),s=r(39),a=i.assert;function h(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,s.call(this,"edwards",t),this.a=new n(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function u(t,e,r,i,o){s.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new n(e,16),this.y=new n(r,16),this.z=i?new n(i,16):this.curve.one,this.t=o&&new n(o,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(h,s),t.exports=h,h.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},h.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},h.prototype.jpoint=function(t,e,r,i){return this.point(t,e,r,i)},h.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=i.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var h=a.fromRed().isOdd();return(e&&!h||!e&&h)&&(a=a.redNeg()),this.point(t,a)},h.prototype.pointFromY=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=i.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},h.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),i=e.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===i.cmp(n)},o(u,s.BasePoint),h.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},h.prototype.point=function(t,e,r,i){return new u(this,t,e,r,i)},u.fromJSON=function(t,e){return new u(t,e[0],e[1],e[2])},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(t),n=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=i.redAdd(e),s=o.redSub(r),a=i.redSub(e),h=n.redMul(s),u=o.redMul(a),f=n.redMul(a),l=s.redMul(o);return this.curve.point(h,u,l,f)},u.prototype._projDbl=function(){var t,e,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var s=(u=this.curve._mulA(n)).redAdd(o);if(this.zOne)t=i.redSub(n).redSub(o).redMul(s.redSub(this.curve.two)),e=s.redMul(u.redSub(o)),r=s.redSqr().redSub(s).redSub(s);else{var a=this.z.redSqr(),h=s.redSub(a).redISub(a);t=i.redSub(n).redISub(o).redMul(h),e=s.redMul(u.redSub(o)),r=s.redMul(h)}}else{var u=n.redAdd(o);a=this.curve._mulC(this.z).redSqr(),h=u.redSub(a).redSub(a),t=this.curve._mulC(i.redISub(u)).redMul(h),e=this.curve._mulC(u).redMul(n.redISub(o)),r=u.redMul(h)}return this.curve.point(t,e,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),n=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),s=n.redSub(i),a=n.redAdd(i),h=r.redAdd(e),u=o.redMul(s),f=a.redMul(h),l=o.redMul(h),c=s.redMul(a);return this.curve.point(u,f,c,l)},u.prototype._projAdd=function(t){var e,r,i=this.z.redMul(t.z),n=i.redSqr(),o=this.x.redMul(t.x),s=this.y.redMul(t.y),a=this.curve.d.redMul(o).redMul(s),h=n.redSub(a),u=n.redAdd(a),f=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(s),l=i.redMul(h).redMul(f);return this.curve.twisted?(e=i.redMul(u).redMul(s.redSub(this.curve._mulA(o))),r=h.redMul(u)):(e=i.redMul(u).redMul(s.redSub(o)),r=this.curve._mulC(h).redMul(u)),this.curve.point(l,e,r)},u.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},u.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},u.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},u.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(i),0===this.x.cmp(e))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},function(t,e){t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(t,e,r){var i=r(14),n=r(65),o=r(9),s=r(56),a=r(24),h=o.assert,u=r(183),f=r(184);function l(t){if(!(this instanceof l))return new l(t);"string"==typeof t&&(h(s.hasOwnProperty(t),"Unknown curve "+t),t=s[t]),t instanceof s.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=l,l.prototype.keyPair=function(t){return new u(this,t)},l.prototype.keyFromPrivate=function(t,e){return u.fromPrivate(this,t,e)},l.prototype.keyFromPublic=function(t,e){return u.fromPublic(this,t,e)},l.prototype.genKeyPair=function(t){t||(t={});for(var e=new n({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new i(2));;){var s=new i(e.generate(r));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},l.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},l.prototype.sign=function(t,e,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new i(t,16));for(var s=this.n.byteLength(),a=e.getPrivate().toArray("be",s),h=t.toArray("be",s),u=new n({hash:this.hash,entropy:a,nonce:h,pers:o.pers,persEnc:o.persEnc||"utf8"}),l=this.n.sub(new i(1)),c=0;;c++){var d=o.k?o.k(c):new i(u.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(l)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var m=p.getX(),v=m.umod(this.n);if(0!==v.cmpn(0)){var g=d.invm(this.n).mul(v.mul(e.getPrivate()).iadd(t));if(0!==(g=g.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==m.cmp(v)?2:0);return o.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),y^=1),new f({r:v,s:g,recoveryParam:y})}}}}}},l.prototype.verify=function(t,e,r,n){t=this._truncateToN(new i(t,16)),r=this.keyFromPublic(r,n);var o=(e=new f(e,"hex")).r,s=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,h=s.invm(this.n),u=h.mul(t).umod(this.n),l=h.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),l)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(u,r.getPublic(),l)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},l.prototype.recoverPubKey=function(t,e,r,n){h((3&r)===r,"The recovery param is more than two bits"),e=new f(e,n);var o=this.n,s=new i(t),a=e.r,u=e.s,l=1&r,c=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),l):this.curve.pointFromX(a,l);var d=e.r.invm(o),p=o.sub(s).mul(d).umod(o),m=u.mul(d).umod(o);return this.g.mulAdd(p,a,m)},l.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new f(e,i)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(t,e,n)}catch(t){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},function(t,e,r){var i=r(14),n=r(9).assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new i(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?n(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return""}},function(t,e,r){var i=r(14),n=r(9),o=n.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new i(t.r,16),this.s=new i(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function h(t,e){var r=t[e.place++];if(!(128&r))return r;for(var i=15&r,n=0,o=0,s=e.place;o>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=s,s.prototype._importDER=function(t,e){t=n.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;if(h(t,r)+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=h(t,r),s=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var u=h(t,r);if(t.length!==u+r.place)return!1;var f=t.slice(r.place,u+r.place);return 0===s[0]&&128&s[1]&&(s=s.slice(1)),0===f[0]&&128&f[1]&&(f=f.slice(1)),this.r=new i(s),this.s=new i(f),this.recoveryParam=null,!0},s.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=u(e),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];f(i,e.length),(i=i.concat(e)).push(2),f(i,r.length);var o=i.concat(r),s=[48];return f(s,o.length),s=s.concat(o),n.encode(s,t)}},function(t,e,r){var i=r(25),n=r(56),o=r(9),s=o.assert,a=o.parseBytes,h=r(186),u=r(187);function f(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof f))return new f(t);t=n[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=i.sha512}t.exports=f,f.prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),i=this.hashInt(r.messagePrefix(),t),n=this.g.mul(i),o=this.encodePoint(n),s=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),h=i.add(s).umod(this.curve.n);return this.makeSignature({R:n,S:h,Rencoded:o})},f.prototype.verify=function(t,e,r){t=a(t),e=this.makeSignature(e);var i=this.keyFromPublic(r),n=this.hashInt(e.Rencoded(),i.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(i.pub().mul(n)).eq(o)},f.prototype.hashInt=function(){for(var t=this.hash(),e=0;e=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e){},function(t,e,r){var i=r(30),n=r(0);function o(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}e.define=function(t,e){return new o(t,e)},o.prototype._createNamed=function(t){var e;try{e=r(193).runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(t){e=function(t){this._initNamed(t)}}return n(e,t),e.prototype._initNamed=function(e){t.call(this,e)},new e(this)},o.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(i.decoders[t])),this.decoders[t]},o.prototype.decode=function(t,e,r){return this._getDecoder(e).decode(t,r)},o.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(i.encoders[t])),this.encoders[t]},o.prototype.encode=function(t,e,r){return this._getEncoder(e).encode(t,r)}},function(t,e){},function(t,e,r){var i=r(0);function n(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function o(t,e){this.path=t,this.rethrow(e)}e.Reporter=n,n.prototype.isError=function(t){return t instanceof o},n.prototype.save=function(){var t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},n.prototype.restore=function(t){var e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},n.prototype.enterKey=function(t){return this._reporterState.path.push(t)},n.prototype.exitKey=function(t){var e=this._reporterState;e.path=e.path.slice(0,t-1)},n.prototype.leaveKey=function(t,e,r){var i=this._reporterState;this.exitKey(t),null!==i.obj&&(i.obj[e]=r)},n.prototype.path=function(){return this._reporterState.path.join("/")},n.prototype.enterObject=function(){var t=this._reporterState,e=t.obj;return t.obj={},e},n.prototype.leaveObject=function(t){var e=this._reporterState,r=e.obj;return e.obj=t,r},n.prototype.error=function(t){var e,r=this._reporterState,i=t instanceof o;if(e=i?t:new o(r.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),t.message||t,t.stack),!r.options.partial)throw e;return i||r.errors.push(e),e},n.prototype.wrapResult=function(t){var e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},i(o,Error),o.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},function(t,e,r){var i=r(31).Reporter,n=r(31).EncoderBuffer,o=r(31).DecoderBuffer,s=r(5),a=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],h=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);function u(t,e){var r={};this._baseState=r,r.enc=t,r.parent=e||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}t.exports=u;var f=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];u.prototype.clone=function(){var t=this._baseState,e={};f.forEach((function(r){e[r]=t[r]}));var r=new this.constructor(e.parent);return r._baseState=e,r},u.prototype._wrap=function(){var t=this._baseState;h.forEach((function(e){this[e]=function(){var r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}}),this)},u.prototype._init=function(t){var e=this._baseState;s(null===e.parent),t.call(this),e.children=e.children.filter((function(t){return t._baseState.parent===this}),this),s.equal(e.children.length,1,"Root node can have only one child")},u.prototype._useArgs=function(t){var e=this._baseState,r=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==r.length&&(s(null===e.children),e.children=r,r.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(s(null===e.args),e.args=t,e.reverseArgs=t.map((function(t){if("object"!=typeof t||t.constructor!==Object)return t;var e={};return Object.keys(t).forEach((function(r){r==(0|r)&&(r|=0);var i=t[r];e[i]=r})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){u.prototype[t]=function(){var e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}})),a.forEach((function(t){u.prototype[t]=function(){var e=this._baseState,r=Array.prototype.slice.call(arguments);return s(null===e.tag),e.tag=t,this._useArgs(r),this}})),u.prototype.use=function(t){s(t);var e=this._baseState;return s(null===e.use),e.use=t,this},u.prototype.optional=function(){return this._baseState.optional=!0,this},u.prototype.def=function(t){var e=this._baseState;return s(null===e.default),e.default=t,e.optional=!0,this},u.prototype.explicit=function(t){var e=this._baseState;return s(null===e.explicit&&null===e.implicit),e.explicit=t,this},u.prototype.implicit=function(t){var e=this._baseState;return s(null===e.explicit&&null===e.implicit),e.implicit=t,this},u.prototype.obj=function(){var t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},u.prototype.key=function(t){var e=this._baseState;return s(null===e.key),e.key=t,this},u.prototype.any=function(){return this._baseState.any=!0,this},u.prototype.choice=function(t){var e=this._baseState;return s(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map((function(e){return t[e]}))),this},u.prototype.contains=function(t){var e=this._baseState;return s(null===e.use),e.contains=t,this},u.prototype._decode=function(t,e){var r=this._baseState;if(null===r.parent)return t.wrapResult(r.children[0]._decode(t,e));var i,n=r.default,s=!0,a=null;if(null!==r.key&&(a=t.enterKey(r.key)),r.optional){var h=null;if(null!==r.explicit?h=r.explicit:null!==r.implicit?h=r.implicit:null!==r.tag&&(h=r.tag),null!==h||r.any){if(s=this._peekTag(t,h,r.any),t.isError(s))return s}else{var u=t.save();try{null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),s=!0}catch(t){s=!1}t.restore(u)}}if(r.obj&&s&&(i=t.enterObject()),s){if(null!==r.explicit){var f=this._decodeTag(t,r.explicit);if(t.isError(f))return f;t=f}var l=t.offset;if(null===r.use&&null===r.choice){r.any&&(u=t.save());var c=this._decodeTag(t,null!==r.implicit?r.implicit:r.tag,r.any);if(t.isError(c))return c;r.any?n=t.raw(u):t=c}if(e&&e.track&&null!==r.tag&&e.track(t.path(),l,t.length,"tagged"),e&&e.track&&null!==r.tag&&e.track(t.path(),t.offset,t.length,"content"),n=r.any?n:null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),t.isError(n))return n;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(t,e)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){var d=new o(n);n=this._getUse(r.contains,t._reporterState.obj)._decode(d,e)}}return r.obj&&s&&(n=t.leaveObject(i)),null===r.key||null===n&&!0!==s?null!==a&&t.exitKey(a):t.leaveKey(a,r.key,n),n},u.prototype._decodeGeneric=function(t,e,r){var i=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,i.args[0],r):/str$/.test(t)?this._decodeStr(e,t,r):"objid"===t&&i.args?this._decodeObjid(e,i.args[0],i.args[1],r):"objid"===t?this._decodeObjid(e,null,null,r):"gentime"===t||"utctime"===t?this._decodeTime(e,t,r):"null_"===t?this._decodeNull(e,r):"bool"===t?this._decodeBool(e,r):"objDesc"===t?this._decodeStr(e,t,r):"int"===t||"enum"===t?this._decodeInt(e,i.args&&i.args[0],r):null!==i.use?this._getUse(i.use,e._reporterState.obj)._decode(e,r):e.error("unknown tag: "+t)},u.prototype._getUse=function(t,e){var r=this._baseState;return r.useDecoder=this._use(t,e),s(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},u.prototype._decodeChoice=function(t,e){var r=this._baseState,i=null,n=!1;return Object.keys(r.choice).some((function(o){var s=t.save(),a=r.choice[o];try{var h=a._decode(t,e);if(t.isError(h))return!1;i={type:o,value:h},n=!0}catch(e){return t.restore(s),!1}return!0}),this),n?i:t.error("Choice not matched")},u.prototype._createEncoderBuffer=function(t){return new n(t,this.reporter)},u.prototype._encode=function(t,e,r){var i=this._baseState;if(null===i.default||i.default!==t){var n=this._encodeValue(t,e,r);if(void 0!==n&&!this._skipDefault(n,e,r))return n}},u.prototype._encodeValue=function(t,e,r){var n=this._baseState;if(null===n.parent)return n.children[0]._encode(t,e||new i);var o=null;if(this.reporter=e,n.optional&&void 0===t){if(null===n.default)return;t=n.default}var s=null,a=!1;if(n.any)o=this._createEncoderBuffer(t);else if(n.choice)o=this._encodeChoice(t,e);else if(n.contains)s=this._getUse(n.contains,r)._encode(t,e),a=!0;else if(n.children)s=n.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,e,t);if(null===r._baseState.key)return e.error("Child should have a key");var i=e.enterKey(r._baseState.key);if("object"!=typeof t)return e.error("Child expected, but input is not object");var n=r._encode(t[r._baseState.key],e,t);return e.leaveKey(i),n}),this).filter((function(t){return t})),s=this._createEncoderBuffer(s);else if("seqof"===n.tag||"setof"===n.tag){if(!n.args||1!==n.args.length)return e.error("Too many args for : "+n.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");var h=this.clone();h._baseState.implicit=null,s=this._createEncoderBuffer(t.map((function(r){var i=this._baseState;return this._getUse(i.args[0],t)._encode(r,e)}),h))}else null!==n.use?o=this._getUse(n.use,r)._encode(t,e):(s=this._encodePrimitive(n.tag,t),a=!0);if(!n.any&&null===n.choice){var u=null!==n.implicit?n.implicit:n.tag,f=null===n.implicit?"universal":"context";null===u?null===n.use&&e.error("Tag could be omitted only for .use()"):null===n.use&&(o=this._encodeComposite(u,a,f,s))}return null!==n.explicit&&(o=this._encodeComposite(n.explicit,!1,"context",o)),o},u.prototype._encodeChoice=function(t,e){var r=this._baseState,i=r.choice[t.type];return i||s(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),i._encode(t.value,e)},u.prototype._encodePrimitive=function(t,e){var r=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&r.args)return this._encodeObjid(e,r.reverseArgs[0],r.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,r.args&&r.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},u.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},u.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(t)}},function(t,e,r){var i=r(93);e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=i._reverse(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=i._reverse(e.tag)},function(t,e,r){var i=e;i.der=r(94),i.pem=r(198)},function(t,e,r){var i=r(0),n=r(2).Buffer,o=r(94);function s(t){o.call(this,t),this.enc="pem"}i(s,o),t.exports=s,s.prototype.decode=function(t,e){for(var r=t.toString().split(/[\r\n]+/g),i=e.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,a=-1,h=-1,u=0;u=e)throw new Error("invalid sig")}t.exports=function(t,r,h,u,f){var l=o(h);if("ec"===l.type){if("ecdsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");return function(t,e,r){var i=s[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var o=new n(i),a=r.data.subjectPrivateKey.data;return o.verify(e,t,a)}(t,r,l)}if("dsa"===l.type){if("dsa"!==u)throw new Error("wrong public key type");return function(t,e,r){var n=r.data.p,s=r.data.q,h=r.data.g,u=r.data.pub_key,f=o.signature.decode(t,"der"),l=f.s,c=f.r;a(l,s),a(c,s);var d=i.mont(n),p=l.invm(s);return 0===h.toRed(d).redPow(new i(e).mul(p).mod(s)).fromRed().mul(u.toRed(d).redPow(c.mul(p).mod(s)).fromRed()).mod(n).mod(s).cmp(c)}(t,r,l)}if("rsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");r=e.concat([f,r]);for(var c=l.modulus.byteLength(),d=[1],p=0;r.length+d.length+2=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e){},function(t,e,r){e.publicEncrypt=r(209),e.privateDecrypt=r(211),e.privateEncrypt=function(t,r){return e.publicEncrypt(t,r,!0)},e.publicDecrypt=function(t,r){return e.privateDecrypt(t,r,!0)}},function(t,e,r){var i=r(40),n=r(17),o=r(27),s=r(97),a=r(98),h=r(57),u=r(99),f=r(55),l=r(1).Buffer;t.exports=function(t,e,r){var c;c=t.padding?t.padding:r?1:4;var d,p=i(t);if(4===c)d=function(t,e){var r=t.modulus.byteLength(),i=e.length,u=o("sha1").update(l.alloc(0)).digest(),f=u.length,c=2*f;if(i>r-c-2)throw new Error("message too long");var d=l.alloc(r-i-c-2),p=r-f-1,m=n(f),v=a(l.concat([u,d,l.alloc(1,1),e],p),s(m,p)),g=a(m,s(v,f));return new h(l.concat([l.alloc(1),g,v],r))}(p,e);else if(1===c)d=function(t,e,r){var i,o=e.length,s=t.modulus.byteLength();if(o>s-11)throw new Error("message too long");return i=r?l.alloc(s-o-3,255):function(t){for(var e,r=l.allocUnsafe(t),i=0,o=n(2*t),s=0;i=0)throw new Error("data too long for modulus")}return r?f(d,p):u(d,p)}},function(t,e){},function(t,e,r){var i=r(40),n=r(97),o=r(98),s=r(57),a=r(55),h=r(27),u=r(99),f=r(1).Buffer;t.exports=function(t,e,r){var l;l=t.padding?t.padding:r?1:4;var c,d=i(t),p=d.modulus.byteLength();if(e.length>p||new s(e).cmp(d.modulus)>=0)throw new Error("decryption error");c=r?u(new s(e),d):a(e,d);var m=f.alloc(p-c.length);if(c=f.concat([m,c],p),4===l)return function(t,e){var r=t.modulus.byteLength(),i=h("sha1").update(f.alloc(0)).digest(),s=i.length;if(0!==e[0])throw new Error("decryption error");var a=e.slice(1,s+1),u=e.slice(s+1),l=o(a,n(u,s)),c=o(u,n(l,r-s-1));if(function(t,e){t=f.from(t),e=f.from(e);var r=0,i=t.length;t.length!==e.length&&(r++,i=Math.min(t.length,e.length));for(var n=-1;++n=e.length){o++;break}var s=e.slice(2,n-1);if(("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&o++,s.length<8&&o++,o)throw new Error("decryption error");return e.slice(n)}(0,c,r);if(3===l)return c;throw new Error("unknown padding")}},function(t,e,r){(function(t,i){function n(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=r(1),s=r(17),a=o.Buffer,h=o.kMaxLength,u=t.crypto||t.msCrypto,f=Math.pow(2,32)-1;function l(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>f||t<0)throw new TypeError("offset must be a uint32");if(t>h||t>e)throw new RangeError("offset out of range")}function c(t,e,r){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>f||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>h)throw new RangeError("buffer too small")}function d(t,e,r,n){if(i.browser){var o=t.buffer,a=new Uint8Array(o,e,r);return u.getRandomValues(a),n?void i.nextTick((function(){n(null,t)})):t}if(!n)return s(r).copy(t,e),t;s(r,(function(r,i){if(r)return n(r);i.copy(t,e),n(null,t)}))}u&&u.getRandomValues||!i.browser?(e.randomFill=function(e,r,i,n){if(!(a.isBuffer(e)||e instanceof t.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof r)n=r,r=0,i=e.length;else if("function"==typeof i)n=i,i=e.length-r;else if("function"!=typeof n)throw new TypeError('"cb" argument must be a function');return l(r,e.length),c(i,r,e.length),d(e,r,i,n)},e.randomFillSync=function(e,r,i){if(void 0===r&&(r=0),!(a.isBuffer(e)||e instanceof t.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return l(r,e.length),void 0===i&&(i=e.length-r),c(i,r,e.length),d(e,r,i)}):(e.randomFill=n,e.randomFillSync=n)}).call(this,r(7),r(13))},function(t,e,r){var i=r(214),n=r(100),o=new i(0),s=new i(-1),a={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"};function h(t){var e=t?t.toLowerCase():"ether",r=a[e];if("string"!=typeof r)throw new Error("[ethjs-unit] the unit provided "+t+" doesn't exists, please use the one of the following units "+JSON.stringify(a,null,2));return new i(r,10)}function u(t){if("string"==typeof t){if(!t.match(/^-?[0-9.]+$/))throw new Error("while converting number to string, invalid number value '"+t+"', should be a number matching (^-?[0-9.]+).");return t}if("number"==typeof t)return String(t);if("object"==typeof t&&t.toString&&(t.toTwos||t.dividedToIntegerBy))return t.toPrecision?String(t.toPrecision()):t.toString(10);throw new Error("while converting number to string, invalid number value '"+t+"' type "+typeof t+".")}t.exports={unitMap:a,numberToString:u,getValueOfUnit:h,fromWei:function(t,e,r){var i=n(t),u=i.lt(o),f=h(e),l=a[e].length-1||1,c=r||{};u&&(i=i.mul(s));for(var d=i.mod(f).toString(10);d.length2)throw new Error("[ethjs-unit] while converting number "+t+" to wei, too many decimal points");var c=l[0],d=l[1];if(c||(c="0"),d||(d="0"),d.length>o)throw new Error("[ethjs-unit] while converting number "+t+" to wei, too many decimal places");for(;d.length=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e,r){(function(t){!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(2).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e,r){var i=r(217);t.exports=function(t){return"string"!=typeof t?t:i(t)?t.slice(2):t}},function(t,e){t.exports=function(t){if("string"!=typeof t)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof t+", while checking isHexPrefixed.");return"0x"===t.slice(0,2)}},function(t,e){},function(t,e,r){!function(t){var e,r,i,n=String.fromCharCode;function o(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n=55296&&t<=57343)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function a(t,e){return n(t>>e&63|128)}function h(t){if(0==(4294967168&t))return n(t);var e="";return 0==(4294965248&t)?e=n(t>>6&31|192):0==(4294901760&t)?(s(t),e=n(t>>12&15|224),e+=a(t,6)):0==(4292870144&t)&&(e=n(t>>18&7|240),e+=a(t,12),e+=a(t,6)),e+n(63&t|128)}function u(){if(i>=r)throw Error("Invalid byte index");var t=255&e[i];if(i++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function f(){var t,n;if(i>r)throw Error("Invalid byte index");if(i==r)return!1;if(t=255&e[i],i++,0==(128&t))return t;if(192==(224&t)){if((n=(31&t)<<6|u())>=128)return n;throw Error("Invalid continuation byte")}if(224==(240&t)){if((n=(15&t)<<12|u()<<6|u())>=2048)return s(n),n;throw Error("Invalid continuation byte")}if(240==(248&t)&&(n=(7&t)<<18|u()<<12|u()<<6|u())>=65536&&n<=1114111)return n;throw Error("Invalid UTF-8 detected")}t.version="3.0.0",t.encode=function(t){for(var e=o(t),r=e.length,i=-1,n="";++i65535&&(o+=n((e-=65536)>>>10&1023|55296),e=56320|1023&e),o+=n(e);return o}(a)}}(e)},function(t,e){var r="0123456789abcdef".split(""),i=[1,256,65536,16777216],n=[0,8,16,24],o=[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],s=function(t){var e,r,i,n,s,a,h,u,f,l,c,d,p,m,v,g,y,b,w,M,_,S,x,k,A,E,B,O,R,I,T,j,C,N,P,L,q,D,U,F,z,H,Z,W,K,V,G,Y,J,X,$,Q,tt,et,rt,it,nt,ot,st,at,ht,ut,ft;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],h=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],f=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|h>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(h<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(u<<1|f>>>31),r=s^(f<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(l<<1|c>>>31),r=h^(c<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(d<<1|p>>>31),r=f^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(n<<1|s>>>31),r=c^(s<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,m=t[0],v=t[1],V=t[11]<<4|t[10]>>>28,G=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,R=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ht=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,N=t[2]<<1|t[3]>>>31,P=t[3]<<1|t[2]>>>31,g=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,Y=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,I=t[33]<<13|t[32]>>>19,T=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,q=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,$=t[35]<<15|t[34]>>>17,j=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,k=t[6]<<28|t[7]>>>4,A=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,W=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,E=t[18]<<20|t[19]>>>12,B=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,S=t[48]<<14|t[49]>>>18,x=t[49]<<14|t[48]>>>18,t[0]=m^~g&b,t[1]=v^~y&w,t[10]=k^~E&O,t[11]=A^~B&R,t[20]=N^~L&D,t[21]=P^~q&U,t[30]=W^~V&Y,t[31]=K^~G&J,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=g^~b&M,t[3]=y^~w&_,t[12]=E^~O&I,t[13]=B^~R&T,t[22]=L^~D&F,t[23]=q^~U&z,t[32]=V^~Y&X,t[33]=G^~J&$,t[42]=it^~ot&at,t[43]=nt^~st&ht,t[4]=b^~M&S,t[5]=w^~_&x,t[14]=O^~I&j,t[15]=R^~T&C,t[24]=D^~F&H,t[25]=U^~z&Z,t[34]=Y^~X&Q,t[35]=J^~$&tt,t[44]=ot^~at&ut,t[45]=st^~ht&ft,t[6]=M^~S&m,t[7]=_^~x&v,t[16]=I^~j&k,t[17]=T^~C&A,t[26]=F^~H&N,t[27]=z^~Z&P,t[36]=X^~Q&W,t[37]=$^~tt&K,t[46]=at^~ut&et,t[47]=ht^~ft&rt,t[8]=S^~m&g,t[9]=x^~v&y,t[18]=j^~k&E,t[19]=C^~A&B,t[28]=H^~N&L,t[29]=Z^~P&q,t[38]=Q^~W&V,t[39]=tt^~K&G,t[48]=ut^~et&it,t[49]=ft^~rt&nt,t[0]^=o[i],t[1]^=o[i+1]},a=function(t){return function(e){var o;if("0x"===e.slice(0,2)){o=[];for(var a=2,h=e.length;a>2]|=e[d]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(h[v>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=u){for(t.start=v-u,t.block=h[f],v=0;v>2]|=i[3&v],t.lastByteIndex===u)for(h[0]=h[f],v=1;v>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];g%f==0&&(s(c),v=0)}return"0x"+m}(function(t){return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e}(t),o)}};t.exports={keccak256:a(256),keccak512:a(512),keccak256s:a(256),keccak512s:a(512)}},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0});var i=r(222);function n(t){return!("string"!=typeof t||!/^(0x)?[0-9a-f]{512}$/i.test(t)||!/^(0x)?[0-9a-f]{512}$/.test(t)&&!/^(0x)?[0-9A-F]{512}$/.test(t))}function o(t,e){"object"==typeof e&&e.constructor===Uint8Array&&(e=i.bytesToHex(e));for(var r=i.keccak256(e).replace("0x",""),n=0;n<12;n+=4){var o=(parseInt(r.substr(n,2),16)<<8)+parseInt(r.substr(n+2,2),16)&2047,a=1<=48&&t<=57)return t-48;if(t>=65&&t<=70)return t-55;if(t>=97&&t<=102)return t-87;throw new Error("invalid bloom")}function a(t){return!("string"!=typeof t||!/^(0x)?[0-9a-f]{64}$/i.test(t)||!/^(0x)?[0-9a-f]{64}$/.test(t)&&!/^(0x)?[0-9A-F]{64}$/.test(t))}function h(t){return!("string"!=typeof t||!t.match(/^(0x)?[0-9a-fA-F]{40}$/)&&!t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/))}e.isBloom=n,e.isInBloom=o,e.isUserEthereumAddressInBloom=function(t,e){if(!n(t))throw new Error("Invalid bloom given");if(!h(e))throw new Error('Invalid ethereum address given: "'.concat(e,'"'));return o(t,i.padLeft(e,64))},e.isContractAddressInBloom=function(t,e){if(!n(t))throw new Error("Invalid bloom given");if(!h(e))throw new Error('Invalid contract address given: "'.concat(e,'"'));return o(t,e)},e.isTopicInBloom=function(t,e){if(!n(t))throw new Error("Invalid bloom given");if(!a(e))throw new Error("Invalid topic");return o(t,e)},e.isTopic=a,e.isAddress=h},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0});var i=r(223);function n(t){if(null==t)throw new Error("cannot convert null value to array");if("string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);if(!e)throw new Error("invalid hexidecimal string");if("0x"!==e[1])throw new Error("hex string must have 0x prefix");(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],i=0;i=256||parseInt(String(r))!=r)return!1}return!0}(t))return o(new Uint8Array(t));throw new Error("invalid arrayify value")}function o(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return o(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}e.keccak256=function(t){return"0x"+i.keccak_256(n(t))},e.padLeft=function(t,e){var r=/^0x/i.test(t)||"number"==typeof t,i=e-(t=t.toString().replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(r?"0x":"")+new Array(i).join("0")+t},e.bytesToHex=function(t){for(var e=[],r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return"0x".concat(e.join("").replace(/^0+/,""))},e.toByteArray=n},function(t,e,r){(function(i,n){var o;!function(){var s="input is invalid type",a="object"==typeof window,h=a?window:{};h.JS_SHA3_NO_WINDOW&&(a=!1);var u=!a&&"object"==typeof self;!h.JS_SHA3_NO_NODE_JS&&"object"==typeof i&&i.versions&&i.versions.node?h=n:u&&(h=self);var f=!h.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,l=r(224),c=!h.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),p=[4,1024,262144,67108864],m=[0,8,16,24],v=[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],g=[224,256,384,512],y=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],w={128:168,256:136};!h.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!c||!h.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var M=function(t,e,r){return function(i){return new P(t,e,t).update(i)[r]()}},_=function(t,e,r){return function(i,n){return new P(t,e,n).update(i)[r]()}},S=function(t,e,r){return function(e,i,n,o){return B["cshake"+t].update(e,i,n,o)[r]()}},x=function(t,e,r){return function(e,i,n,o){return B["kmac"+t].update(e,i,n,o)[r]()}},k=function(t,e,r,i){for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}function L(t,e,r){P.call(this,t,e,r)}P.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(s);if(null===t)throw new Error(s);if(c&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||c&&ArrayBuffer.isView(t)))throw new Error(s);e=!0}for(var i,n,o=this.blocks,a=this.byteCount,h=t.length,u=this.blockCount,f=0,l=this.s;f>2]|=t[f]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[i>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=a){for(this.start=i-a,this.block=o[u],i=0;i>=8);r>0;)n.unshift(r),r=255&(t>>=8),++i;return e?n.push(i):n.unshift(i),this.update(n),n.length},P.prototype.encodeString=function(t){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(s);if(null===t)throw new Error(s);if(c&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||c&&ArrayBuffer.isView(t)))throw new Error(s);e=!0}var i=0,n=t.length;if(e)i=n;else for(var o=0;o=57344?i+=3:(a=65536+((1023&a)<<10|1023&t.charCodeAt(++o)),i+=4)}return i+=this.encode(8*i),this.update(t),i},P.prototype.bytepad=function(t,e){for(var r=this.encode(e),i=0;i>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+d[15&t]+d[t>>12&15]+d[t>>8&15]+d[t>>20&15]+d[t>>16&15]+d[t>>28&15]+d[t>>24&15];s%e==0&&(q(r),o=0)}return n&&(t=r[o],a+=d[t>>4&15]+d[15&t],n>1&&(a+=d[t>>12&15]+d[t>>8&15]),n>2&&(a+=d[t>>20&15]+d[t>>16&15])),a},P.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var h=new Uint32Array(t);s>8&255,h[t+2]=e>>16&255,h[t+3]=e>>24&255;a%r==0&&q(i)}return o&&(t=a<<2,e=i[s],h[t]=255&e,o>1&&(h[t+1]=e>>8&255),o>2&&(h[t+2]=e>>16&255)),h},L.prototype=new P,L.prototype.finalize=function(){return this.encode(this.outputBits,!0),P.prototype.finalize.call(this)};var q=function(t){var e,r,i,n,o,s,a,h,u,f,l,c,d,p,m,g,y,b,w,M,_,S,x,k,A,E,B,O,R,I,T,j,C,N,P,L,q,D,U,F,z,H,Z,W,K,V,G,Y,J,X,$,Q,tt,et,rt,it,nt,ot,st,at,ht,ut,ft;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],u=t[5]^t[15]^t[25]^t[35]^t[45],f=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(c=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(h<<1|u>>>31),r=o^(u<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(f<<1|l>>>31),r=a^(l<<1|f>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(c<<1|d>>>31),r=u^(d<<1|c>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=f^(n<<1|o>>>31),r=l^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],m=t[1],V=t[11]<<4|t[10]>>>28,G=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,R=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ht=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,N=t[2]<<1|t[3]>>>31,P=t[3]<<1|t[2]>>>31,g=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,Y=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,I=t[33]<<13|t[32]>>>19,T=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,q=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,$=t[35]<<15|t[34]>>>17,j=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,k=t[6]<<28|t[7]>>>4,A=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,W=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,E=t[18]<<20|t[19]>>>12,B=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,S=t[48]<<14|t[49]>>>18,x=t[49]<<14|t[48]>>>18,t[0]=p^~g&b,t[1]=m^~y&w,t[10]=k^~E&O,t[11]=A^~B&R,t[20]=N^~L&D,t[21]=P^~q&U,t[30]=W^~V&Y,t[31]=K^~G&J,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=g^~b&M,t[3]=y^~w&_,t[12]=E^~O&I,t[13]=B^~R&T,t[22]=L^~D&F,t[23]=q^~U&z,t[32]=V^~Y&X,t[33]=G^~J&$,t[42]=it^~ot&at,t[43]=nt^~st&ht,t[4]=b^~M&S,t[5]=w^~_&x,t[14]=O^~I&j,t[15]=R^~T&C,t[24]=D^~F&H,t[25]=U^~z&Z,t[34]=Y^~X&Q,t[35]=J^~$&tt,t[44]=ot^~at&ut,t[45]=st^~ht&ft,t[6]=M^~S&p,t[7]=_^~x&m,t[16]=I^~j&k,t[17]=T^~C&A,t[26]=F^~H&N,t[27]=z^~Z&P,t[36]=X^~Q&W,t[37]=$^~tt&K,t[46]=at^~ut&et,t[47]=ht^~ft&rt,t[8]=S^~p&g,t[9]=x^~m&y,t[18]=j^~k&E,t[19]=C^~A&B,t[28]=H^~N&L,t[29]=Z^~P&q,t[38]=Q^~W&V,t[39]=tt^~K&G,t[48]=ut^~et&it,t[49]=ft^~rt&nt,t[0]^=v[i],t[1]^=v[i+1]};if(f)t.exports=B;else{for(R=0;R32||i256)throw new Error("Invalid uint"+i+" size");if((a=s(e)).bitLength()>i)throw new Error("Supplied uint exceeds width: "+i+" vs "+a.bitLength());if(a.lt(new n(0)))throw new Error("Supplied uint "+a.toString()+" is negative");return i?o.leftPad(a.toString("hex"),i/8*2):a}if(t.startsWith("int")){if(i%8||i<8||i>256)throw new Error("Invalid int"+i+" size");if((a=s(e)).bitLength()>i)throw new Error("Supplied int exceeds width: "+i+" vs "+a.bitLength());return a.lt(new n(0))?a.toTwos(i).toString("hex"):i?o.leftPad(a.toString("hex"),i/8*2):a}throw new Error("Unsupported or invalid type: "+t)},h=function(t){if(i.isArray(t))throw new Error("Autodetection of array types is not supported.");var e,r,s="";if(i.isObject(t)&&(t.hasOwnProperty("v")||t.hasOwnProperty("t")||t.hasOwnProperty("value")||t.hasOwnProperty("type"))?(e=t.hasOwnProperty("t")?t.t:t.type,s=t.hasOwnProperty("v")?t.v:t.value):(e=o.toHex(t,!0),s=o.toHex(t),e.startsWith("int")||e.startsWith("uint")||(e="bytes")),!e.startsWith("int")&&!e.startsWith("uint")||"string"!=typeof s||/^(-)?0x/i.test(s)||(s=new n(s)),i.isArray(s)){if((r=function(t){var e=/^\D+\d*\[(\d+)\]$/.exec(t);return e?parseInt(e[1],10):null}(e))&&s.length!==r)throw new Error(e+" is not matching the given array "+JSON.stringify(s));r=s.length}return i.isArray(s)?s.map((function(t){return a(e,t,r).toString("hex").replace("0x","")})).join(""):a(e,s,r).toString("hex").replace("0x","")};t.exports={soliditySha3:function(){var t=Array.prototype.slice.call(arguments),e=i.map(t,h);return o.sha3("0x"+e.join(""))},soliditySha3Raw:function(){return o.sha3Raw("0x"+i.map(Array.prototype.slice.call(arguments),h).join(""))}}}]).default}));Object(p.c)(j);var C=function t(e,r){if(e===r)return!0;if(e&&r&&"object"==typeof e&&"object"==typeof r){if(e.constructor!==r.constructor)return!1;var i,n,o;if(Array.isArray(e)){if((i=e.length)!=r.length)return!1;for(n=i;0!=n--;)if(!t(e[n],r[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if((i=(o=Object.keys(e)).length)!==Object.keys(r).length)return!1;for(n=i;0!=n--;)if(!Object.prototype.hasOwnProperty.call(r,o[n]))return!1;for(n=i;0!=n--;){var s=o[n];if(!t(e[s],r[s]))return!1}return!0}return e!=e&&r!=r},N=function(t,e){t||(t=30),e||(e="aA0");var r="";e.split("").forEach((function(t){isNaN(parseInt(t))?/[a-z]/.test(t)?r+="abcdefghijklmnopqrstuvwxyz":/[A-Z]/.test(t)?r+="ABCDEFGHIJKLMNOPQRSTUVWXYZ":r+="~!@#$%^&()_+-={}[];',":r+="0123456789"}));for(var i="",n=0;n>>2]>>>24-o%4*8&255;e[i+o>>>2]|=s<<24-(i+o)%4*8}else for(o=0;o>>2]=r[o>>>2];return this.sigBytes+=n,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var r,i=[],n=function(e){e=e;var r=987654321,i=4294967295;return function(){var n=((r=36969*(65535&r)+(r>>16)&i)<<16)+(e=18e3*(65535&e)+(e>>16)&i)&i;return n/=4294967296,(n+=.5)*(t.random()>.5?1:-1)}},o=0;o>>2]>>>24-n%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i>>3]|=parseInt(t.substr(i,2),16)<<24-i%8*4;return new s.init(r,e/2)}},u=a.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n>>2]>>>24-n%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;return new s.init(r,e)}},f=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(u.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return u.parse(unescape(encodeURIComponent(t)))}},l=n.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=f.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r=this._data,i=r.words,n=r.sigBytes,o=this.blockSize,a=n/(4*o),h=(a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*o,u=t.min(4*h,n);if(h){for(var f=0;f7&&t[r].toUpperCase()!==t[r]||parseInt(e[r],16)<=7&&t[r].toLowerCase()!==t[r])return!1;return!0},m=function(t){return t instanceof i||t&&t.constructor&&"BigNumber"===t.constructor.name},v=function(t){return"string"==typeof t||t&&t.constructor&&"String"===t.constructor.name},g=function(t){return"boolean"==typeof t};t.exports={padLeft:a,padRight:function(t,e,r){return t+new Array(e-t.length+1).join(r||"0")},toHex:f,toDecimal:function(t){return c(t).toNumber()},fromDecimal:u,toUtf8:function(t){var e="",r=0,i=t.length;for("0x"===t.substring(0,2)&&(r=2);r7?r+=t[i].toUpperCase():r+=t[i];return r},isFunction:function(t){return"function"==typeof t},isString:v,isObject:function(t){return null!==t&&!Array.isArray(t)&&"object"==typeof t},isBoolean:g,isArray:function(t){return Array.isArray(t)},isJson:function(t){try{return!!JSON.parse(t)}catch(t){return!1}},isBloom:function(t){return!(!/^(0x)?[0-9a-f]{512}$/i.test(t)||!/^(0x)?[0-9a-f]{512}$/.test(t)&&!/^(0x)?[0-9A-F]{512}$/.test(t))},isTopic:function(t){return!(!/^(0x)?[0-9a-f]{64}$/i.test(t)||!/^(0x)?[0-9a-f]{64}$/.test(t)&&!/^(0x)?[0-9A-F]{64}$/.test(t))}}},function(t,e,r){var i,n,o,s,a,h,u,f,l,c,d,p,m,v,g,y,b,w,M;t.exports=(i=r(1),r(20),void(i.lib.Cipher||(n=i,o=n.lib,s=o.Base,a=o.WordArray,h=o.BufferedBlockAlgorithm,u=n.enc,u.Utf8,f=u.Base64,l=n.algo.EvpKDF,c=o.Cipher=h.extend({cfg:s.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r),this._xformMode=t,this._key=e,this.reset()},reset:function(){h.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?M:b}return function(e){return{encrypt:function(r,i,n){return t(i).encrypt(e,r,i,n)},decrypt:function(r,i,n){return t(i).decrypt(e,r,i,n)}}}}()}),o.StreamCipher=c.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),d=n.mode={},p=o.BlockCipherMode=s.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),m=d.CBC=function(){var t=p.extend();function e(t,e,r){var i=this._iv;if(i){var n=i;this._iv=void 0}else n=this._prevBlock;for(var o=0;o>>2];t.sigBytes-=e}},o.BlockCipher=c.extend({cfg:c.cfg.extend({mode:m,padding:v}),reset:function(){c.reset.call(this);var t=this.cfg,e=t.iv,r=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=r.createEncryptor;else i=r.createDecryptor,this._minBufferSize=1;this._mode&&this._mode.__creator==i?this._mode.init(this,e&&e.words):(this._mode=i.call(r,this,e&&e.words),this._mode.__creator=i)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else e=this._process(!0),t.unpad(e);return e},blockSize:4}),g=o.CipherParams=s.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),y=(n.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,r=t.salt;if(r)var i=a.create([1398893684,1701076831]).concat(r).concat(e);else i=e;return i.toString(f)},parse:function(t){var e=f.parse(t),r=e.words;if(1398893684==r[0]&&1701076831==r[1]){var i=a.create(r.slice(2,4));r.splice(0,4),e.sigBytes-=16}return g.create({ciphertext:e,salt:i})}},b=o.SerializableCipher=s.extend({cfg:s.extend({format:y}),encrypt:function(t,e,r,i){i=this.cfg.extend(i);var n=t.createEncryptor(r,i),o=n.finalize(e),s=n.cfg;return g.create({ciphertext:o,key:r,iv:s.iv,algorithm:t,mode:s.mode,padding:s.padding,blockSize:t.blockSize,formatter:i.format})},decrypt:function(t,e,r,i){return i=this.cfg.extend(i),e=this._parse(e,i.format),t.createDecryptor(r,i).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),w=(n.kdf={}).OpenSSL={execute:function(t,e,r,i){i||(i=a.random(8));var n=l.create({keySize:e+r}).compute(t,i),o=a.create(n.words.slice(e),4*r);return n.sigBytes=4*e,g.create({key:n,iv:o,salt:i})}},M=o.PasswordBasedCipher=b.extend({cfg:b.cfg.extend({kdf:w}),encrypt:function(t,e,r,i){var n=(i=this.cfg.extend(i)).kdf.execute(r,t.keySize,t.ivSize);i.iv=n.iv;var o=b.encrypt.call(this,t,e,n.key,i);return o.mixIn(n),o},decrypt:function(t,e,r,i){i=this.cfg.extend(i),e=this._parse(e,i.format);var n=i.kdf.execute(r,t.keySize,t.ivSize,e.salt);return i.iv=n.iv,b.decrypt.call(this,t,e,n.key,i)}}))))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){t.exports=y},function(t,e){t.exports=w},function(t,e,r){r.d(e,"f",(function(){return b})),r.d(e,"a",(function(){return w})),r.d(e,"d",(function(){return M})),r.d(e,"e",(function(){return _})),r.d(e,"b",(function(){return S})),r.d(e,"c",(function(){return k}));var i=r(3),n=r.n(i),o=r(9),s=r.n(o),a=r(8),h=r.n(a),u=r(99),f=r.n(u),l=r(36),c=r(2),d=r.n(c),p=r(30),m=r(15);function v(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function g(t){for(var e=1;ei.maxOrderValue&&(r.fiatValue="Requested amount is higher than supported")}return n.selectedCurrency&&!i.validCurrencies.includes(n.selectedCurrency)&&(r.selectedCurrency="Unsupported currency"),n.selectedCryptoCurrency&&!i.validCryptoCurrencies.includes(n.selectedCryptoCurrency)&&(r.selectedCryptoCurrency="Unsupported cryptoCurrency"),{errors:r,isValid:0===Object.keys(r).length}},w=function(){return function(t,e,r){r((function(t){var r=e.error;return r?(Object(l.serializeError)(r),d.a.error("MetaMask - RPC Error: ".concat(r.message),r),t()):t()}))}};function M(t,e){var r="MetamaskInpageProvider - lost connection to ".concat(t);e&&(r+="\n".concat(e.stack)),d.a.warn(r),this.emit&&this.listenerCount&&this.listenerCount("error")>0&&this.emit("error",r)}var _=function(t,e){if(t instanceof Promise)return t;var r={configurable:!0,writable:!0,enumerable:!1};return Object.defineProperty(t,"then",g({},r,{value:function(r,i){return Promise.resolve().then((function(){return r(t[e])}),i)}})),Object.defineProperty(t,"catch",g({},r,{value:Promise.prototype.catch})),Object.defineProperty(t,"finally",g({},r,{value:Promise.prototype.finally})),t},S=function(){return f()()},x=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={mode:"cors",cache:"no-cache"},i=g({},r,{},e,{},{method:"GET"});return fetch(t,i).then((function(t){if(t.ok)return t.json();throw t}))},k=function(){var t=s()(n.a.mark((function t(e,r){var i,o,s,a;return n.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=r.version||p.b,t.prev=1,"staging"!==e&&"production"!==e||r.check){t.next=7;break}return t.next=5,x("".concat(m.a.api,"/latestversion?name=").concat(p.a,"&version=").concat(r.version||p.b));case 5:a=t.sent,s=a.data;case 7:t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),d.a.error(t.t0,"unable to fetch latest version");case 12:d.a.info("version used: ",s),t.t1=e,t.next="staging"===t.t1?16:"testing"===t.t1?19:"development"===t.t1?22:25;break;case 16:return i="https://staging.tor.us/v".concat(s),o="info",t.abrupt("break",28);case 19:return i="https://testing.tor.us",o="debug",t.abrupt("break",28);case 22:return i="https://localhost:3000",o="debug",t.abrupt("break",28);case 25:return i="https://app.tor.us/v".concat(s),o="error",t.abrupt("break",28);case 28:return t.abrupt("return",{torusUrl:i,logLevel:o});case 29:case"end":return t.stop()}}),t,null,[[1,9]])})));return function(e,r){return t.apply(this,arguments)}}()},function(t,e){var r,i,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var h,u=[],f=!1,l=-1;function c(){f&&h&&(f=!1,h.length?u=h.concat(u):l=-1,u.length&&d())}function d(){if(!f){var t=a(c);f=!0;for(var e=u.length;e;){for(h=u,u=[];++l1)for(var r=1;r=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(h.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(i)return U(t).length;e=(""+e).toLowerCase(),i=!0}}function m(t,e,r){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return k(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function v(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function g(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=h.from(e,i)),h.isBuffer(e))return 0===e.length?-1:y(t,e,r,i,n);if("number"==typeof e)return e&=255,h.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,i,n){var o,s=1,a=t.length,h=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,a/=2,h/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(n){var f=-1;for(o=r;oa&&(r=a-h),o=r;o>=0;o--){for(var l=!0,c=0;cn&&(i=n):i=n;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var s=0;s>8,n=r%256,o.push(n),o.push(i);return o}(e,t.length-r),t,r,i)}function k(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n239?4:u>223?3:u>191?2:1;if(n+l<=r)switch(l){case 1:u<128&&(f=u);break;case 2:128==(192&(o=t[n+1]))&&(h=(31&u)<<6|63&o)>127&&(f=h);break;case 3:o=t[n+1],s=t[n+2],128==(192&o)&&128==(192&s)&&(h=(15&u)<<12|(63&o)<<6|63&s)>2047&&(h<55296||h>57343)&&(f=h);break;case 4:o=t[n+1],s=t[n+2],a=t[n+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(h=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&h<1114112&&(f=h)}null===f?(f=65533,l=1):f>65535&&(f-=65536,i.push(f>>>10&1023|55296),f=56320|1023&f),i.push(f),n+=l}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",i=0;ii)&&(r=i);for(var n="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function T(t,e,r,i,n,o){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function j(t,e,r,i){e<0&&(e=65535+e+1);for(var n=0,o=Math.min(t.length-r,2);n>>8*(i?n:1-n)}function C(t,e,r,i){e<0&&(e=4294967295+e+1);for(var n=0,o=Math.min(t.length-r,4);n>>8*(i?n:3-n)&255}function N(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(t,e,r,i,o){return o||N(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function L(t,e,r,i,o){return o||N(t,0,r,8),n.write(t,e,r,i,52,8),r+8}e.Buffer=h,e.SlowBuffer=function(t){return+t!=t&&(t=0),h.alloc(+t)},e.INSPECT_MAX_BYTES=50,h.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),h.poolSize=8192,h._augment=function(t){return t.__proto__=h.prototype,t},h.from=function(t,e,r){return u(null,t,e,r)},h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0})),h.alloc=function(t,e,r){return function(t,e,r,i){return f(e),e<=0?a(t,e):void 0!==r?"string"==typeof i?a(t,e).fill(r,i):a(t,e).fill(r):a(t,e)}(null,t,e,r)},h.allocUnsafe=function(t){return l(null,t)},h.allocUnsafeSlow=function(t){return l(null,t)},h.isBuffer=function(t){return!(null==t||!t._isBuffer)},h.compare=function(t,e){if(!h.isBuffer(t)||!h.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,i=e.length,n=0,o=Math.min(r,i);n0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},h.prototype.compare=function(t,e,r,i,n){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(n>>>=0)-(i>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(i,n),f=t.slice(e,r),l=0;ln)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return M(this,t,e,r);case"latin1":case"binary":return _(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},h.prototype.slice=function(t,e){var r,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e0&&(n*=256);)i+=this[t+--e]*n;return i},h.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},h.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var i=this[t],n=1,o=0;++o=(n*=128)&&(i-=Math.pow(2,8*e)),i},h.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var i=e,n=1,o=this[t+--i];i>0&&(n*=256);)o+=this[t+--i]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*e)),o},h.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt32LE=function(t,e){return e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),n.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),n.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),n.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),n.read(this,t,!1,52,8)},h.prototype.writeUIntLE=function(t,e,r,i){t=+t,e|=0,r|=0,i||T(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+n]=t/o&255;return e+r},h.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,1,255,0),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},h.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},h.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},h.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):C(this,t,e,!0),e+4},h.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},h.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);T(this,t,e,r,n-1,-n)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},h.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);T(this,t,e,r,n-1,-n)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},h.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,1,127,-128),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},h.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},h.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},h.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):C(this,t,e,!0),e+4},h.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},h.prototype.writeFloatLE=function(t,e,r){return P(this,t,e,!0,r)},h.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},h.prototype.writeDoubleLE=function(t,e,r){return L(this,t,e,!0,r)},h.prototype.writeDoubleBE=function(t,e,r){return L(this,t,e,!1,r)},h.prototype.copy=function(t,e,r,i){if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--n)t[n+e]=this[n+r];else if(o<1e3||!h.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function F(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(q,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,i){for(var n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}}).call(this,r(7))},function(t,e,r){var i=r(34),n=r(5),o=r(41),s=r(77),a=function(t){i.config(o.ETH_BIGNUMBER_ROUNDING_MODE);var e=n.padLeft(n.toTwosComplement(t).toString(16),64);return new s(e)},h=function(t){var e=t.staticPart()||"0";return function(t){return"1"===new i(t.substr(0,1),16).toString(2).substr(0,1)}(e)?new i(e,16).minus(new i("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16)).minus(1):new i(e,16)},u=function(t){var e=t.staticPart()||"0";return new i(e,16)};t.exports={formatInputInt:a,formatInputBytes:function(t){var e=n.toHex(t).substr(2),r=Math.floor((e.length+63)/64);return e=n.padRight(e,64*r),new s(e)},formatInputDynamicBytes:function(t){var e=n.toHex(t).substr(2),r=e.length/2,i=Math.floor((e.length+63)/64);return e=n.padRight(e,64*i),new s(a(r).value+e)},formatInputString:function(t){var e=n.fromUtf8(t).substr(2),r=e.length/2,i=Math.floor((e.length+63)/64);return e=n.padRight(e,64*i),new s(a(r).value+e)},formatInputBool:function(t){return new s("000000000000000000000000000000000000000000000000000000000000000"+(t?"1":"0"))},formatInputReal:function(t){return a(new i(t).times(new i(2).pow(128)))},formatOutputInt:h,formatOutputUInt:u,formatOutputReal:function(t){return h(t).dividedBy(new i(2).pow(128))},formatOutputUReal:function(t){return u(t).dividedBy(new i(2).pow(128))},formatOutputBool:function(t){return"0000000000000000000000000000000000000000000000000000000000000001"===t.staticPart()},formatOutputBytes:function(t,e){var r=e.match(/^bytes([0-9]*)/),i=parseInt(r[1]);return"0x"+t.staticPart().slice(0,2*i)},formatOutputDynamicBytes:function(t){var e=2*new i(t.dynamicPart().slice(0,64),16).toNumber();return"0x"+t.dynamicPart().substr(64,e)},formatOutputString:function(t){var e=2*new i(t.dynamicPart().slice(0,64),16).toNumber();return n.toUtf8(t.dynamicPart().substr(64,e))},formatOutputAddress:function(t){var e=t.staticPart();return"0x"+e.slice(e.length-40,e.length)}}},function(t,e,r){var i=r(12),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=s),s.prototype=Object.create(n.prototype),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},function(t,e,r){var i,n=r(8),o=r.n(n),s={GOOGLE:"google",FACEBOOK:"facebook",TWITCH:"twitch",REDDIT:"reddit",DISCORD:"discord",MOONPAY:"moonpay",WYRE:"wyre",RAMPNETWORK:"rampnetwork"},a=Object.values(s),h=(i={},o()(i,s.RAMPNETWORK,{line1:"Bank transfer",line2:"0% - 2.5%",line3:"10,000\u20ac/purchase, 10,000\u20ac/mo",supportPage:"https://instant.ramp.network/",minOrderValue:1,maxOrderValue:1e4,validCurrencies:["GBP","EUR"],validCryptoCurrencies:["ETH","DAI","USDC"],includeFees:!0}),o()(i,s.MOONPAY,{line1:"Credit / Debit Card / Apple Pay",line2:"4.5% or 5 USD",line3:"2,000\u20ac/day, 10,000\u20ac/mo",supportPage:"https://help.moonpay.io/en/",minOrderValue:24.99,maxOrderValue:2e3,validCurrencies:["USD","EUR","GBP"],validCryptoCurrencies:["ETH","DAI","TUSD","USDC","USDT"],includeFees:!0}),o()(i,s.WYRE,{line1:"Apple Pay/Debit Card",line2:"1.5% + 30\xa2",line3:"$250/day",supportPage:"https://support.sendwyre.com/en/",minOrderValue:20,maxOrderValue:250,validCurrencies:["USD"],validCryptoCurrencies:["ETH","DAI","USDC"],includeFees:!1}),i);e.a={networkList:["mainnet","rinkeby","ropsten","kovan","goerli","localhost","matic"],enums:s,verifierList:a,supportedVerifierList:[s.GOOGLE,s.REDDIT,s.DISCORD],paymentProviders:h,api:"https://api.tor.us"}},function(t,e,r){var i=r(13),n=r(77),o=function(t){this._inputFormatter=t.inputFormatter,this._outputFormatter=t.outputFormatter};o.prototype.isType=function(t){throw"this method should be overrwritten for type "+t},o.prototype.staticPartLength=function(t){return(this.nestedTypes(t)||["[1]"]).map((function(t){return parseInt(t.slice(1,-1),10)||1})).reduce((function(t,e){return t*e}),32)},o.prototype.isDynamicArray=function(t){var e=this.nestedTypes(t);return!!e&&!e[e.length-1].match(/[0-9]{1,}/g)},o.prototype.isStaticArray=function(t){var e=this.nestedTypes(t);return!!e&&!!e[e.length-1].match(/[0-9]{1,}/g)},o.prototype.staticArrayLength=function(t){var e=this.nestedTypes(t);return e?parseInt(e[e.length-1].match(/[0-9]{1,}/g)||1):1},o.prototype.nestedName=function(t){var e=this.nestedTypes(t);return e?t.substr(0,t.length-e[e.length-1].length):t},o.prototype.isDynamicType=function(){return!1},o.prototype.nestedTypes=function(t){return t.match(/(\[[0-9]*\])/g)},o.prototype.encode=function(t,e){var r,n,o,s=this;return this.isDynamicArray(e)?(r=t.length,n=s.nestedName(e),(o=[]).push(i.formatInputInt(r).encode()),t.forEach((function(t){o.push(s.encode(t,n))})),o):this.isStaticArray(e)?function(){for(var r=s.staticArrayLength(e),i=s.nestedName(e),n=[],o=0;o1?(t[r[0]]=t[r[0]]||{},t[r[0]][r[1]]=e):t[r[0]]=e},o.prototype.buildCall=function(){var t=this,e=function(){var e=t.toPayload(Array.prototype.slice.call(arguments));return e.callback?t.requestManager.sendAsync(e,(function(r,i){e.callback(r,t.formatOutput(i))})):t.formatOutput(t.requestManager.send(e))};return e.request=this.request.bind(this),e},o.prototype.request=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));return t.format=this.formatOutput.bind(this),t},t.exports=o},function(t,e,r){var i=r(72),n=r(39),o="object"==typeof Reflect?Reflect:null,s=o&&"function"==typeof o.apply?o.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};function a(){n.call(this)}function h(t,e,r){try{s(t,e,r)}catch(t){setTimeout((function(){throw t}))}}function u(t,e){for(var r=new Array(e),i=0;i0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=n[t];if(void 0===a)return!1;if("function"==typeof a)h(a,this,e);else{var f=a.length,l=u(a,f);for(r=0;r>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a>>6*(3-a)&63));var h=i.charAt(64);if(h)for(;n.length%4;)n.push(h);return n.join("")},parse:function(t){var e=t.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o>>6-s%4*2;i[o>>>2]|=(a|h)<<24-o%4*8,o++}return n.create(i,o)}(t,e,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},o.enc.Base64)},function(t,e,r){var i;t.exports=(i=r(1),function(t){var e=i,r=e.lib,n=r.WordArray,o=r.Hasher,s=e.algo,a=[];!function(){for(var e=0;e<64;e++)a[e]=4294967296*t.abs(t.sin(e+1))|0}();var h=s.MD5=o.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var i=e+r,n=t[i];t[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var o=this._hash.words,s=t[e+0],h=t[e+1],d=t[e+2],p=t[e+3],m=t[e+4],v=t[e+5],g=t[e+6],y=t[e+7],b=t[e+8],w=t[e+9],M=t[e+10],_=t[e+11],S=t[e+12],x=t[e+13],k=t[e+14],A=t[e+15],E=o[0],B=o[1],O=o[2],R=o[3];E=u(E,B,O,R,s,7,a[0]),R=u(R,E,B,O,h,12,a[1]),O=u(O,R,E,B,d,17,a[2]),B=u(B,O,R,E,p,22,a[3]),E=u(E,B,O,R,m,7,a[4]),R=u(R,E,B,O,v,12,a[5]),O=u(O,R,E,B,g,17,a[6]),B=u(B,O,R,E,y,22,a[7]),E=u(E,B,O,R,b,7,a[8]),R=u(R,E,B,O,w,12,a[9]),O=u(O,R,E,B,M,17,a[10]),B=u(B,O,R,E,_,22,a[11]),E=u(E,B,O,R,S,7,a[12]),R=u(R,E,B,O,x,12,a[13]),O=u(O,R,E,B,k,17,a[14]),E=f(E,B=u(B,O,R,E,A,22,a[15]),O,R,h,5,a[16]),R=f(R,E,B,O,g,9,a[17]),O=f(O,R,E,B,_,14,a[18]),B=f(B,O,R,E,s,20,a[19]),E=f(E,B,O,R,v,5,a[20]),R=f(R,E,B,O,M,9,a[21]),O=f(O,R,E,B,A,14,a[22]),B=f(B,O,R,E,m,20,a[23]),E=f(E,B,O,R,w,5,a[24]),R=f(R,E,B,O,k,9,a[25]),O=f(O,R,E,B,p,14,a[26]),B=f(B,O,R,E,b,20,a[27]),E=f(E,B,O,R,x,5,a[28]),R=f(R,E,B,O,d,9,a[29]),O=f(O,R,E,B,y,14,a[30]),E=l(E,B=f(B,O,R,E,S,20,a[31]),O,R,v,4,a[32]),R=l(R,E,B,O,b,11,a[33]),O=l(O,R,E,B,_,16,a[34]),B=l(B,O,R,E,k,23,a[35]),E=l(E,B,O,R,h,4,a[36]),R=l(R,E,B,O,m,11,a[37]),O=l(O,R,E,B,y,16,a[38]),B=l(B,O,R,E,M,23,a[39]),E=l(E,B,O,R,x,4,a[40]),R=l(R,E,B,O,s,11,a[41]),O=l(O,R,E,B,p,16,a[42]),B=l(B,O,R,E,g,23,a[43]),E=l(E,B,O,R,w,4,a[44]),R=l(R,E,B,O,S,11,a[45]),O=l(O,R,E,B,A,16,a[46]),E=c(E,B=l(B,O,R,E,d,23,a[47]),O,R,s,6,a[48]),R=c(R,E,B,O,y,10,a[49]),O=c(O,R,E,B,k,15,a[50]),B=c(B,O,R,E,v,21,a[51]),E=c(E,B,O,R,S,6,a[52]),R=c(R,E,B,O,p,10,a[53]),O=c(O,R,E,B,M,15,a[54]),B=c(B,O,R,E,h,21,a[55]),E=c(E,B,O,R,b,6,a[56]),R=c(R,E,B,O,A,10,a[57]),O=c(O,R,E,B,g,15,a[58]),B=c(B,O,R,E,x,21,a[59]),E=c(E,B,O,R,m,6,a[60]),R=c(R,E,B,O,_,10,a[61]),O=c(O,R,E,B,d,15,a[62]),B=c(B,O,R,E,w,21,a[63]),o[0]=o[0]+E|0,o[1]=o[1]+B|0,o[2]=o[2]+O|0,o[3]=o[3]+R|0},_doFinalize:function(){var e=this._data,r=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;r[n>>>5]|=128<<24-n%32;var o=t.floor(i/4294967296),s=i;r[15+(n+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(n+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),e.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,h=a.words,u=0;u<4;u++){var f=h[u];h[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return a},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function u(t,e,r,i,n,o,s){var a=t+(e&r|~e&i)+n+s;return(a<>>32-o)+e}function f(t,e,r,i,n,o,s){var a=t+(e&i|r&~i)+n+s;return(a<>>32-o)+e}function l(t,e,r,i,n,o,s){var a=t+(e^r^i)+n+s;return(a<>>32-o)+e}function c(t,e,r,i,n,o,s){var a=t+(r^(e|~i))+n+s;return(a<>>32-o)+e}e.MD5=o._createHelper(h),e.HmacMD5=o._createHmacHelper(h)}(Math),i.MD5)},function(t,e){t.exports={InvalidNumberOfSolidityArgs:function(){return new Error("Invalid number of arguments to Solidity function")},InvalidNumberOfRPCParams:function(){return new Error("Invalid number of input parameters to RPC method")},InvalidConnection:function(t){return new Error("CONNECTION ERROR: Couldn't connect to node "+t+".")},InvalidProvider:function(){return new Error("Provider not set or invalid")},InvalidResponse:function(t){var e=t&&t.error&&t.error.message?t.error.message:"Invalid JSON RPC response: "+JSON.stringify(t);return new Error(e)},ConnectionTimeout:function(t){return new Error("CONNECTION TIMEOUT: timeout of "+t+" ms achived")}}},function(t,e,r){var i=r(5),n=function(t){this.name=t.name,this.getter=t.getter,this.setter=t.setter,this.outputFormatter=t.outputFormatter,this.inputFormatter=t.inputFormatter,this.requestManager=null};n.prototype.setRequestManager=function(t){this.requestManager=t},n.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter(t):t},n.prototype.formatOutput=function(t){return this.outputFormatter&&null!=t?this.outputFormatter(t):t},n.prototype.extractCallback=function(t){if(i.isFunction(t[t.length-1]))return t.pop()},n.prototype.attachToObject=function(t){var e={get:this.buildGet(),enumerable:!0},r=this.name.split("."),i=r[0];r.length>1&&(t[r[0]]=t[r[0]]||{},t=t[r[0]],i=r[1]),Object.defineProperty(t,i,e),t[o(i)]=this.buildAsyncGet()};var o=function(t){return"get"+t.charAt(0).toUpperCase()+t.slice(1)};n.prototype.buildGet=function(){var t=this;return function(){return t.formatOutput(t.requestManager.send({method:t.getter}))}},n.prototype.buildAsyncGet=function(){var t=this,e=function(e){t.requestManager.sendAsync({method:t.getter},(function(r,i){e(r,t.formatOutput(i))}))};return e.request=this.request.bind(this),e},n.prototype.request=function(){var t={method:this.getter,params:[],callback:this.extractCallback(Array.prototype.slice.call(arguments))};return t.format=this.formatOutput.bind(this),t},t.exports=n},function(t,e,r){var i=r(14).Buffer;function n(t,e){this._block=i.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}n.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=i.from(t,e));for(var r=this._block,n=this._blockSize,o=t.length,s=this._len,a=0;a=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(4294967295&r)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=n},function(t,e){t.exports=M},function(t,e){t.exports=S},function(t){t.exports=JSON.parse('{"a":"@toruslabs/torus-embed","b":"1.3.0"}')},function(t,e){t.exports=x},function(t,e,r){(function(e){var i=r(60),n=r(84),o=r(199),s=function(){},a=/^v?\.0/.test(e.version),h=function(t){return"function"==typeof t},u=function(t,e,r,u){u=i(u);var f=!1;t.on("close",(function(){f=!0})),n(t,{readable:e,writable:r},(function(t){if(t)return u(t);f=!0,u()}));var l=!1;return function(e){if(!f&&!l)return l=!0,function(t){return!!a&&!!o&&(t instanceof(o.ReadStream||s)||t instanceof(o.WriteStream||s))&&h(t.close)}(t)?t.close(s):function(t){return t.setHeader&&h(t.abort)}(t)?t.abort():h(t.destroy)?t.destroy():void u(e||new Error("stream was destroyed"))}},f=function(t){t()},l=function(t,e){return t.pipe(e)};t.exports=function(){var t,e=Array.prototype.slice.call(arguments),r=h(e[e.length-1]||s)&&e.pop()||s;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var i=e.map((function(n,o){var s=o0,(function(e){t||(t=e),e&&i.forEach(f),s||(i.forEach(f),r(t))}))}));return e.reduce(l)}}).call(this,r(11))},function(t,e,r){(function(t){function r(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===r(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===r(t)},e.isObject=function(t){return"object"==typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===r(t)},e.isError=function(t){return"[object Error]"===r(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=t.isBuffer}).call(this,r(12).Buffer)},function(t,e,r){var i;!function(n){var o,s,a=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,h=Math.ceil,u=Math.floor,f=" not a boolean or binary digit",l="number type has more than 15 significant digits",c="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",d=1e14,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],m=1e9;function v(t){var e=0|t;return t>0||t===e?e:e-1}function g(t){for(var e,r,i=1,n=t.length,o=t[0]+"";iu^r?1:-1;for(a=(h=n.length)<(u=o.length)?h:u,s=0;so[s]^r?1:-1;return h==u?0:h>u^r?1:-1}function b(t,e,r){return(t=x(t))>=e&&t<=r}function w(t){return"[object Array]"==Object.prototype.toString.call(t)}function M(t,e,r){for(var i,n,o=[0],s=0,a=t.length;sr-1&&(null==o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/r|0,o[i]%=r)}return o.reverse()}function _(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function S(t,e){var r,i;if(e<0){for(i="0.";++e;i+="0");t=i+t}else if(++e>(r=t.length)){for(i="0",e-=r;--e;i+="0");t+=i}else e15&&Y(B,l,t),o=!1):f.s=45===u.charCodeAt(0)?(u=u.slice(1),-1):1,u=Z(u,10,e,f.s)}else{if(t instanceof H)return f.s=t.s,f.e=t.e,f.c=(t=t.c)?t.slice():t,void(B=0);if((o="number"==typeof t)&&0*t==0){if(f.s=1/t<0?(t=-t,-1):1,t===~~t){for(i=0,n=t;n>=10;n/=10,i++);return f.e=i,f.c=[t],void(B=0)}u=t+""}else{if(!a.test(u=t+""))return s(f,u,o);f.s=45===u.charCodeAt(0)?(u=u.slice(1),-1):1}}for((i=u.indexOf("."))>-1&&(u=u.replace(".","")),(n=u.search(/e/i))>0?(i<0&&(i=n),i+=+u.slice(n+1),u=u.substring(0,n)):i<0&&(i=u.length),n=0;48===u.charCodeAt(n);n++);for(h=u.length;48===u.charCodeAt(--h););if(u=u.slice(n,h+1))if(h=u.length,o&&L&&h>15&&Y(B,l,f.s*t),(i=i-n-1)>P)f.c=f.e=null;else if(i=0&&(a=F,F=0,t=t.replace(".",""),u=(l=new H(i)).pow(t.length-d),F=a,l.c=M(S(g(u.c),u.e),10,e),l.e=l.c.length),s=a=(f=M(t,i,e)).length;0==f[--a];f.pop());if(!f[0])return"0";if(d<0?--s:(u.c=f,u.e=s,u.s=n,f=(u=r(u,l,p,m,e)).c,h=u.r,s=u.e),d=f[o=s+p+1],a=e/2,h=h||o<0||null!=f[o+1],h=m<4?(null!=d||h)&&(0==m||m==(u.s<0?3:2)):d>a||d==a&&(4==m||h||6==m&&1&f[o-1]||m==(u.s<0?8:7)),o<1||!f[0])t=h?S("1",-p):"0";else{if(f.length=o,h)for(--e;++f[--o]>e;)f[o]=0,o||(++s,f.unshift(1));for(a=f.length;!f[--a];);for(d=0,t="";d<=a;t+=c.charAt(f[d++]));t=S(t,s)}return t}function W(t,e,r,i){var n,o,s,a,h;if(r=null!=r&&q(r,0,8,i,"rounding mode")?0|r:T,!t.c)return t.toString();if(n=t.c[0],s=t.e,null==e)h=g(t.c),h=19==i||24==i&&s<=j?_(h,s):S(h,s);else if(o=(t=J(new H(t),e,r)).e,a=(h=g(t.c)).length,19==i||24==i&&(e<=o||o<=j)){for(;aa){if(--e>0)for(h+=".";e--;h+="0");}else if((e+=o-a)>0)for(o+1==a&&(h+=".");e--;h+="0");return t.s<0&&n?"-"+h:h}function K(t,e){var r,i,n=0;for(w(t[0])&&(t=t[0]),r=new H(t[0]);++nr||t!=x(t))&&Y(i,(n||"decimal places")+(tr?" out of range":" not an integer"),t),!0}function G(t,e,r){for(var i=1,n=e.length;!e[--n];e.pop());for(n=e[0];n>=10;n/=10,i++);return(r=i+14*r-1)>P?t.c=t.e=null:r=10;a/=10,n++);if((o=e-n)<0)o+=14,s=e,c=(f=m[l=0])/v[n-s-1]%10|0;else if((l=h((o+1)/14))>=m.length){if(!i)break t;for(;m.length<=l;m.push(0));f=c=0,n=1,s=(o%=14)-14+1}else{for(f=a=m[l],n=1;a>=10;a/=10,n++);c=(s=(o%=14)-14+n)<0?0:f/v[n-s-1]%10|0}if(i=i||e<0||null!=m[l+1]||(s<0?f:f%v[n-s-1]),i=r<4?(c||i)&&(0==r||r==(t.s<0?3:2)):c>5||5==c&&(4==r||i||6==r&&(o>0?s>0?f/v[n-s]:0:m[l-1])%10&1||r==(t.s<0?8:7)),e<1||!m[0])return m.length=0,i?(e-=t.e+1,m[0]=v[e%14],t.e=-e||0):m[0]=t.e=0,t;if(0==o?(m.length=l,a=1,l--):(m.length=l+1,a=v[14-o],m[l]=s>0?u(f/v[n-s]%v[s])*a:0),i)for(;;){if(0==l){for(o=1,s=m[0];s>=10;s/=10,o++);for(s=m[0]+=a,a=1;s>=10;s/=10,a++);o!=a&&(t.e++,m[0]==d&&(m[0]=1));break}if(m[l]+=a,m[l]!=d)break;m[l--]=0,a=1}for(o=m.length;0===m[--o];m.pop());}t.e>P?t.c=t.e=null:t.er)return null!=(t=n[r++])};return s(e="DECIMAL_PLACES")&&q(t,0,m,2,e)&&(I=0|t),i[e]=I,s(e="ROUNDING_MODE")&&q(t,0,8,2,e)&&(T=0|t),i[e]=T,s(e="EXPONENTIAL_AT")&&(w(t)?q(t[0],-m,0,2,e)&&q(t[1],0,m,2,e)&&(j=0|t[0],C=0|t[1]):q(t,-m,m,2,e)&&(j=-(C=0|(t<0?-t:t)))),i[e]=[j,C],s(e="RANGE")&&(w(t)?q(t[0],-m,-1,2,e)&&q(t[1],1,m,2,e)&&(N=0|t[0],P=0|t[1]):q(t,-m,m,2,e)&&(0|t?N=-(P=0|(t<0?-t:t)):L&&Y(2,e+" cannot be zero",t))),i[e]=[N,P],s(e="ERRORS")&&(t===!!t||1===t||0===t?(B=0,q=(L=!!t)?V:b):L&&Y(2,e+f,t)),i[e]=L,s(e="CRYPTO")&&(t===!!t||1===t||0===t?(D=!1,t&&!D&&L&&Y(2,"crypto unavailable",void 0)):L&&Y(2,e+f,t)),i[e]=D,s(e="MODULO_MODE")&&q(t,0,9,2,e)&&(U=0|t),i[e]=U,s(e="POW_PRECISION")&&q(t,0,m,2,e)&&(F=0|t),i[e]=F,s(e="FORMAT")&&("object"==typeof t?z=t:L&&Y(2,e+" not an object",t)),i[e]=z,i},H.max=function(){return K(arguments,O.lt)},H.min=function(){return K(arguments,O.gt)},H.random=(i=9007199254740992*Math.random()&2097151?function(){return u(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,r,n,o=0,s=[],a=new H(R);if(t=null!=t&&q(t,0,m,14)?0|t:I,r=h(t/14),D&&L&&Y(14,"crypto unavailable",void 0),!o)for(;o=10;n/=10,o++);o<14&&(e-=14-o)}return a.e=e,a.c=s,a}),r=function(){function t(t,e,r){var i,n,o,s,a=0,h=t.length,u=e%1e7,f=e/1e7|0;for(t=t.slice();h--;)a=((n=u*(o=t[h]%1e7)+(i=f*o+(s=t[h]/1e7|0)*u)%1e7*1e7+a)/r|0)+(i/1e7|0)+f*s,t[h]=n%r;return a&&t.unshift(a),t}function e(t,e,r,i){var n,o;if(r!=i)o=r>i?1:-1;else for(n=o=0;ne[n]?1:-1;break}return o}function r(t,e,r,i){for(var n=0;r--;)t[r]-=n,n=t[r]1;t.shift());}return function(i,n,o,s,a){var h,f,l,c,p,m,g,y,b,w,M,_,S,x,k,A,E,B=i.s==n.s?1:-1,O=i.c,R=n.c;if(!(O&&O[0]&&R&&R[0]))return new H(i.s&&n.s&&(O?!R||O[0]!=R[0]:R)?O&&0==O[0]||!R?0*B:B/0:NaN);for(b=(y=new H(B)).c=[],B=o+(f=i.e-n.e)+1,a||(a=d,f=v(i.e/14)-v(n.e/14),B=B/14|0),l=0;R[l]==(O[l]||0);l++);if(R[l]>(O[l]||0)&&f--,B<0)b.push(1),c=!0;else{for(x=O.length,A=R.length,l=0,B+=2,(p=u(a/(R[0]+1)))>1&&(R=t(R,p,a),O=t(O,p,a),A=R.length,x=O.length),S=A,M=(w=O.slice(0,A)).length;M=a/2&&k++;do{if(p=0,(h=e(R,w,A,M))<0){if(_=w[0],A!=M&&(_=_*a+(w[1]||0)),(p=u(_/k))>1)for(p>=a&&(p=a-1),g=(m=t(R,p,a)).length,M=w.length;1==e(m,w,g,M);)p--,r(m,A=10;B/=10,l++);J(y,o+(y.e=l+14*f-1)+1,s,c)}else y.e=f,y.r=+c;return y}}(),n=/^(-?)0([xbo])/i,o=/^([^.]+)\.$/,k=/^\.([^.]+)$/,A=/^-?(Infinity|NaN)$/,E=/^\s*\+|^\s+|\s+$/g,s=function(t,e,r,i){var s,a=r?e:e.replace(E,"");if(A.test(a))t.s=isNaN(a)?null:a<0?-1:1;else{if(!r&&(a=a.replace(n,(function(t,e,r){return s="x"==(r=r.toLowerCase())?16:"b"==r?2:8,i&&i!=s?t:e})),i&&(s=i,a=a.replace(o,"$1").replace(k,"0.$1")),e!=a))return new H(a,s);L&&Y(B,"not a"+(i?" base "+i:"")+" number",e),t.s=null}t.c=t.e=null,B=0},O.absoluteValue=O.abs=function(){var t=new H(this);return t.s<0&&(t.s=1),t},O.ceil=function(){return J(new H(this),this.e+1,2)},O.comparedTo=O.cmp=function(t,e){return B=1,y(this,new H(t,e))},O.decimalPlaces=O.dp=function(){var t,e,r=this.c;if(!r)return null;if(t=14*((e=r.length-1)-v(this.e/14)),e=r[e])for(;e%10==0;e/=10,t--);return t<0&&(t=0),t},O.dividedBy=O.div=function(t,e){return B=3,r(this,new H(t,e),I,T)},O.dividedToIntegerBy=O.divToInt=function(t,e){return B=4,r(this,new H(t,e),0,1)},O.equals=O.eq=function(t,e){return B=5,0===y(this,new H(t,e))},O.floor=function(){return J(new H(this),this.e+1,3)},O.greaterThan=O.gt=function(t,e){return B=6,y(this,new H(t,e))>0},O.greaterThanOrEqualTo=O.gte=function(t,e){return B=7,1===(e=y(this,new H(t,e)))||0===e},O.isFinite=function(){return!!this.c},O.isInteger=O.isInt=function(){return!!this.c&&v(this.e/14)>this.c.length-2},O.isNaN=function(){return!this.s},O.isNegative=O.isNeg=function(){return this.s<0},O.isZero=function(){return!!this.c&&0==this.c[0]},O.lessThan=O.lt=function(t,e){return B=8,y(this,new H(t,e))<0},O.lessThanOrEqualTo=O.lte=function(t,e){return B=9,-1===(e=y(this,new H(t,e)))||0===e},O.minus=O.sub=function(t,e){var r,i,n,o,s=this,a=s.s;if(B=10,e=(t=new H(t,e)).s,!a||!e)return new H(NaN);if(a!=e)return t.s=-e,s.plus(t);var h=s.e/14,u=t.e/14,f=s.c,l=t.c;if(!h||!u){if(!f||!l)return f?(t.s=-e,t):new H(l?s:NaN);if(!f[0]||!l[0])return l[0]?(t.s=-e,t):new H(f[0]?s:3==T?-0:0)}if(h=v(h),u=v(u),f=f.slice(),a=h-u){for((o=a<0)?(a=-a,n=f):(u=h,n=l),n.reverse(),e=a;e--;n.push(0));n.reverse()}else for(i=(o=(a=f.length)<(e=l.length))?a:e,a=e=0;e0)for(;e--;f[r++]=0);for(e=d-1;i>a;){if(f[--i]0?(s=o,r=h):(n=-n,r=a),r.reverse();n--;r.push(0));r.reverse()}for((n=a.length)-(e=h.length)<0&&(r=h,h=a,a=r,e=n),n=0;e;)n=(a[--e]=a[e]+h[e]+n)/d|0,a[e]%=d;return n&&(a.unshift(n),++s),G(t,a,s)},O.precision=O.sd=function(t){var e,r,i=this,n=i.c;if(null!=t&&t!==!!t&&1!==t&&0!==t&&(L&&Y(13,"argument"+f,t),t!=!!t&&(t=null)),!n)return null;if(e=14*(r=n.length-1)+1,r=n[r]){for(;r%10==0;r/=10,e--);for(r=n[0];r>=10;r/=10,e++);}return t&&i.e+1>e&&(e=i.e+1),e},O.round=function(t,e){var r=new H(this);return(null==t||q(t,0,m,15))&&J(r,~~t+this.e+1,null!=e&&q(e,0,8,15,"rounding mode")?0|e:T),r},O.shift=function(t){var e=this;return q(t,-9007199254740991,9007199254740991,16,"argument")?e.times("1e"+x(t)):new H(e.c&&e.c[0]&&(t<-9007199254740991||t>9007199254740991)?e.s*(t<0?0:1/0):e)},O.squareRoot=O.sqrt=function(){var t,e,i,n,o,s=this,a=s.c,h=s.s,u=s.e,f=I+4,l=new H("0.5");if(1!==h||!a||!a[0])return new H(!h||h<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(h=Math.sqrt(+s))||h==1/0?(((e=g(a)).length+u)%2==0&&(e+="0"),h=Math.sqrt(e),u=v((u+1)/2)-(u<0||u%2),i=new H(e=h==1/0?"1e"+u:(e=h.toExponential()).slice(0,e.indexOf("e")+1)+u)):i=new H(h+""),i.c[0])for((h=(u=i.e)+f)<3&&(h=0);;)if(o=i,i=l.times(o.plus(r(s,o,f,1))),g(o.c).slice(0,h)===(e=g(i.c)).slice(0,h)){if(i.e=0;){for(r=0,c=w[n]%1e7,p=w[n]/1e7|0,o=n+(s=h);o>n;)r=((u=c*(u=b[--s]%1e7)+(a=p*u+(f=b[s]/1e7|0)*c)%1e7*1e7+m[o]+r)/g|0)+(a/1e7|0)+p*f,m[o--]=u%g;m[o]=r}return r?++i:m.shift(),G(t,m,i)},O.toDigits=function(t,e){var r=new H(this);return t=null!=t&&q(t,1,m,18,"precision")?0|t:null,e=null!=e&&q(e,0,8,18,"rounding mode")?0|e:T,t?J(r,t,e):r},O.toExponential=function(t,e){return W(this,null!=t&&q(t,0,m,19)?1+~~t:null,e,19)},O.toFixed=function(t,e){return W(this,null!=t&&q(t,0,m,20)?~~t+this.e+1:null,e,20)},O.toFormat=function(t,e){var r=W(this,null!=t&&q(t,0,m,21)?~~t+this.e+1:null,e,21);if(this.c){var i,n=r.split("."),o=+z.groupSize,s=+z.secondaryGroupSize,a=z.groupSeparator,h=n[0],u=n[1],f=this.s<0,l=f?h.slice(1):h,c=l.length;if(s&&(i=o,o=s,s=i,c-=i),o>0&&c>0){for(i=c%o||o,h=l.substr(0,i);i0&&(h+=a+l.slice(i)),f&&(h="-"+h)}r=u?h+z.decimalSeparator+((s=+z.fractionGroupSize)?u.replace(new RegExp("\\d{"+s+"}\\B","g"),"$&"+z.fractionGroupSeparator):u):h}return r},O.toFraction=function(t){var e,i,n,o,s,a,h,u,f,l=L,c=this,d=c.c,m=new H(R),v=i=new H(R),y=h=new H(R);if(null!=t&&(L=!1,a=new H(t),L=l,(l=a.isInt())&&!a.lt(R)||(L&&Y(22,"max denominator "+(l?"out of range":"not an integer"),t),t=!l&&a.c&&J(a,a.e+1,1).gte(R)?a:null)),!d)return c.toString();for(f=g(d),o=m.e=f.length-c.e-1,m.c[0]=p[(s=o%14)<0?14+s:s],t=!t||a.cmp(m)>0?o>0?m:v:a,s=P,P=1/0,a=new H(f),h.c[0]=0;u=r(a,m,0,1),1!=(n=i.plus(u.times(y))).cmp(t);)i=y,y=n,v=h.plus(u.times(n=v)),h=n,m=a.minus(u.times(n=m)),a=n;return n=r(t.minus(i),y,0,1),h=h.plus(n.times(v)),i=i.plus(n.times(y)),h.s=v.s=c.s,e=r(v,y,o*=2,T).minus(c).abs().cmp(r(h,i,o,T).minus(c).abs())<1?[v.toString(),y.toString()]:[h.toString(),i.toString()],P=s,e},O.toNumber=function(){var t=this;return+t||(t.s?0*t.s:NaN)},O.toPower=O.pow=function(t){var e,r,i=u(t<0?-t:+t),n=this;if(!q(t,-9007199254740991,9007199254740991,23,"exponent")&&(!isFinite(t)||i>9007199254740991&&(t/=0)||parseFloat(t)!=t&&!(t=NaN)))return new H(Math.pow(+n,t));for(e=F?h(F/14+2):0,r=new H(R);;){if(i%2){if(!(r=r.times(n)).c)break;e&&r.c.length>e&&(r.c.length=e)}if(!(i=u(i/2)))break;n=n.times(n),e&&n.c&&n.c.length>e&&(n.c.length=e)}return t<0&&(r=R.div(r)),e?J(r,F,T):r},O.toPrecision=function(t,e){return W(this,null!=t&&q(t,1,m,24,"precision")?0|t:null,e,24)},O.toString=function(t){var e,r=this,i=r.s,n=r.e;return null===n?i?(e="Infinity",i<0&&(e="-"+e)):e="NaN":(e=g(r.c),e=null!=t&&q(t,2,64,25,"base")?Z(S(e,n),0|t,10,i):n<=j||n>=C?_(e,n):S(e,n),i<0&&r.c[0]&&(e="-"+e)),e},O.truncated=O.trunc=function(){return J(new H(this),this.e+1,1)},O.valueOf=O.toJSON=function(){return this.toString()},null!=e&&H.config(e),H}(),void 0===(i=function(){return o}.call(e,r,e,t))||(t.exports=i)}()},function(t,e,r){var i=r(118),n=r(76);t.exports=function(t,e){return e&&"hex"===e.encoding&&(t.length>2&&"0x"===t.substr(0,2)&&(t=t.substr(2)),t=i.enc.Hex.parse(t)),n(t,{outputLength:256}).toString()}},function(t,e,r){var i=r(58),n=i.EthereumRpcError,o=i.EthereumProviderError,s=r(83),a=s.serializeError,h=s.getMessageFromCode,u=r(191),f=r(59);t.exports={ethErrors:u,EthereumRpcError:n,EthereumProviderError:o,serializeError:a,getMessageFromCode:h,ERROR_CODES:f}},function(t,e,r){e.a={errors:{invalidParams:function(){return"MetaMask: Invalid request parameters. Please use ethereum.send(method: string, params: Array). For more details, see: https://eips.ethereum.org/EIPS/eip-1193"},sendSiteMetadata:function(){return"MetaMask: Failed to send site metadata. This is an internal error, please report this bug."},unsupportedSync:function(t){return"MetaMask: The MetaMask Web3 object does not support synchronous methods like ".concat(t," without a callback parameter.")}},warnings:{sendSyncDeprecation:'MetaMask: "ethereum.send(...)" will return result-resolving Promises for all methods starting in Q1 2020. For more information, see: https://medium.com/metamask/deprecating-synchronous-provider-methods-82f0edbc874b',enableDeprecation:'MetaMask: \'"ethereum.enable()" is deprecated and may be removed in the future. Please use "ethereum.send(\'eth_requestAccounts\')" instead. For more information, see: https://eips.ethereum.org/EIPS/eip-1102',isConnectedDeprecation:'MetaMask: "ethereum.isConnected()" is deprecated and may be removed in the future. Please listen for the relevant events instead. For more information, see: https://eips.ethereum.org/EIPS/eip-1193',sendAsyncDeprecation:'MetaMask: "ethereum.sendAsync(...)" is deprecated and may be removed in the future. Please use "ethereum.send(method: string, params: Array)" instead. For more information, see: https://eips.ethereum.org/EIPS/eip-1193',experimentalMethods:'MetaMask: "ethereum._metamask" exposes non-standard, experimental methods. They may be removed or changed without warning.'}}},function(t,e,r){(function(e){void 0===e||!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,r,i,n){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick((function(){t.call(null,r)}));case 3:return e.nextTick((function(){t.call(null,r,i)}));case 4:return e.nextTick((function(){t.call(null,r,i,n)}));default:for(o=new Array(a-1),s=0;s0&&s.length>n&&!s.warned){s.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=t,h.type=e,h.count=s.length,a=h,console&&console.warn&&console.warn(a)}return t}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=c.bind(i);return n.listener=r,i.wrapFn=n,n}function p(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var h=n[t];if(void 0===h)return!1;if("function"==typeof h)o(h,this,e);else{var u=h.length,f=v(h,u);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},a.prototype.listeners=function(t){return p(this,t,!0)},a.prototype.rawListeners=function(t){return p(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},function(t,e,r){var i,n,o,s,a,h;t.exports=(n=(i=h=r(1)).lib,o=n.Base,s=n.WordArray,(a=i.x64={}).Word=o.extend({init:function(t,e){this.high=t,this.low=e}}),a.WordArray=o.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:8*t.length},toX32:function(){for(var t=this.words,e=t.length,r=[],i=0;i=e&&i<=r?i-e+10:t})).join("")},s=function(t){for(var e,r=t;r.length>2;)e=r.slice(0,9),r=parseInt(e,10)%97+r.slice(e.length);return parseInt(r,10)%97},a=function(t){this._iban=t};a.fromAddress=function(t){var e=new i(t,16).toString(36),r=n(e,15);return a.fromBban(r.toUpperCase())},a.fromBban=function(t){var e=("0"+(98-s(o("XE00"+t)))).slice(-2);return new a("XE"+e+t)},a.createIndirect=function(t){return a.fromBban("ETH"+t.institution+t.identifier)},a.isValid=function(t){return new a(t).isValid()},a.prototype.isValid=function(){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(this._iban)&&1===s(o(this._iban))},a.prototype.isDirect=function(){return 34===this._iban.length||35===this._iban.length},a.prototype.isIndirect=function(){return 20===this._iban.length},a.prototype.checksum=function(){return this._iban.substr(2,2)},a.prototype.institution=function(){return this.isIndirect()?this._iban.substr(7,4):""},a.prototype.client=function(){return this.isIndirect()?this._iban.substr(11):""},a.prototype.address=function(){if(this.isDirect()){var t=this._iban.substr(4),e=new i(t,36);return n(e.toString(16),20)}return""},a.prototype.toString=function(){return this._iban},t.exports=a},function(t,e,r){var i=r(18),n=r(5),o=function(t){return null==t?null:0===(t=String(t)).indexOf("0x")?t:n.fromUtf8(t)},s=function(t,e){n.isString(t.options)||t.get((function(t,r){t&&e(t),n.isArray(r)&&r.forEach((function(t){e(null,t)}))}))},a=function(t){t.requestManager.startPolling({method:t.implementation.poll.call,params:[t.filterId]},t.filterId,(function(e,r){if(e)return t.callbacks.forEach((function(t){t(e)}));n.isArray(r)&&r.forEach((function(e){e=t.formatter?t.formatter(e):e,t.callbacks.forEach((function(t){t(null,e)}))}))}),t.stopWatching.bind(t))},h=function(t,e,r,h,u,f,l){var c=this,d={};return h.forEach((function(t){t.setRequestManager(r),t.attachToObject(d)})),this.requestManager=r,this.options=function(t,e){if(n.isString(t))return t;switch(t=t||{},e){case"eth":return t.topics=t.topics||[],t.topics=t.topics.map((function(t){return n.isArray(t)?t.map(o):o(t)})),{topics:t.topics,from:t.from,to:t.to,address:t.address,fromBlock:i.inputBlockNumberFormatter(t.fromBlock),toBlock:i.inputBlockNumberFormatter(t.toBlock)};case"shh":return t}}(t,e),this.implementation=d,this.filterId=null,this.callbacks=[],this.getLogsCallbacks=[],this.pollFilters=[],this.formatter=u,this.implementation.newFilter(this.options,(function(t,e){if(t)c.callbacks.forEach((function(e){e(t)})),"function"==typeof l&&l(t);else if(c.filterId=e,c.getLogsCallbacks.forEach((function(t){c.get(t)})),c.getLogsCallbacks=[],c.callbacks.forEach((function(t){s(c,t)})),c.callbacks.length>0&&a(c),"function"==typeof f)return c.watch(f)})),this};h.prototype.watch=function(t){return this.callbacks.push(t),this.filterId&&(s(this,t),a(this)),this},h.prototype.stopWatching=function(t){if(this.requestManager.stopPolling(this.filterId),this.callbacks=[],!t)return this.implementation.uninstallFilter(this.filterId);this.implementation.uninstallFilter(this.filterId,t)},h.prototype.get=function(t){var e=this;if(!n.isFunction(t)){if(null===this.filterId)throw new Error("Filter ID Error: filter().get() can't be chained synchronous, please provide a callback for the get() method.");return this.implementation.getLogs(this.filterId).map((function(t){return e.formatter?e.formatter(t):t}))}return null===this.filterId?this.getLogsCallbacks.push(t):this.implementation.getLogs(this.filterId,(function(r,i){r?t(r):t(null,i.map((function(t){return e.formatter?e.formatter(t):t})))})),this},t.exports=h},function(t,e,r){var i=r(21);t.exports={eth:function(){return[new i({name:"newFilter",call:function(t){switch(t[0]){case"latest":return t.shift(),this.params=0,"eth_newBlockFilter";case"pending":return t.shift(),this.params=0,"eth_newPendingTransactionFilter";default:return"eth_newFilter"}},params:1}),new i({name:"uninstallFilter",call:"eth_uninstallFilter",params:1}),new i({name:"getLogs",call:"eth_getFilterLogs",params:1}),new i({name:"poll",call:"eth_getFilterChanges",params:1})]},shh:function(){return[new i({name:"newFilter",call:"shh_newMessageFilter",params:1}),new i({name:"uninstallFilter",call:"shh_deleteMessageFilter",params:1}),new i({name:"getLogs",call:"shh_getFilterMessages",params:1}),new i({name:"poll",call:"shh_getFilterMessages",params:1})]}}},function(t,e){t.exports=E},function(t,e){t.exports=O},function(t,e,r){var i=r(17).Duplex,n=r(84),o=r(60),s={},l=function(t){Object(u.a)(r,t);var e=Object(f.a)(r);function r(t){var i,n=t.parent,o=t.name;return Object(a.a)(this,r),(i=e.call(this,{objectMode:!0}))._parent=n,i._name=o,i}return Object(h.a)(r,[{key:"_read",value:function(){}},{key:"_write",value:function(t,e,r){this._parent.push({name:this._name,data:t}),r()}}]),r}(i);t.exports=function(t){Object(u.a)(r,t);var e=Object(f.a)(r);function r(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(a.a)(this,r),(t=e.call(this,Object.assign({},i,{objectMode:!0})))._substreams={},t}return Object(h.a)(r,[{key:"createStream",value:function(t){if(!t)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[t])throw new Error('ObjectMultiplex - Substream for name "${name}" already exists');var e=new l({parent:this,name:t});return this._substreams[t]=e,function(t,e){var r=o(e);n(t,{readable:!1},r),n(t,{writable:!1},r)}(this,(function(t){e.destroy(t)})),e}},{key:"ignoreStream",value:function(t){if(!t)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[t])throw new Error('ObjectMultiplex - Substream for name "${name}" already exists');this._substreams[t]=s}},{key:"_read",value:function(){}},{key:"_write",value:function(t,e,r){var i=t.name,n=t.data;if(!i)return console.warn('ObjectMultiplex - malformed chunk without name "'.concat(t,'"')),r();var o=this._substreams[i];if(!o)return console.warn('ObjectMultiplex - orphaned data for stream "'.concat(i,'"')),r();o!==s&&o.push(n),r()}}]),r}(i)},function(t,e){t.exports=A},function(t,e,r){var i=r(12),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=s),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},function(t,e,r){(function(e,i,n){var o=r(38);function s(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(void 0),i=i.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=y;var a,h=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?i:o.nextTick;y.WritableState=g;var u=Object.create(r(33));u.inherits=r(4);var f,l={deprecate:r(111)},c=r(68),d=r(49).Buffer,p=n.Uint8Array||function(){},m=r(69);function v(){}function g(t,e){a=a||r(19),t=t||{};var i=e instanceof a;this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var n=t.highWaterMark,u=t.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i&&(u||0===u)?u:f,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 l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,i,n){--e.pendingcb,r?(o.nextTick(n,i),o.nextTick(x,t,e),t._writableState.errorEmitted=!0,t.emit("error",i)):(n(i),t._writableState.errorEmitted=!0,t.emit("error",i),x(t,e))}(t,r,i,e,n);else{var s=_(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||M(t,r),i?h(w,t,r,s,n):w(t,r,s,n)}}(e,t)},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 s(this)}function y(t){if(a=a||r(19),!(f.call(y,this)||this instanceof a))return new y(t);this._writableState=new g(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),c.call(this)}function b(t,e,r,i,n,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function w(t,e,r,i){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,i(),x(t,e)}function M(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,n=new Array(i),o=e.corkedRequestsFree;o.entry=r;for(var a=0,h=!0;r;)n[a]=r,r.isBuf||(h=!1),r=r.next,a+=1;n.allBuffers=h,b(t,e,!0,e.length,n,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new s(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,f=r.encoding,l=r.callback;if(b(t,e,!1,e.objectMode?1:u.length,u,f,l),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function _(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function S(t,e){t._final((function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),x(t,e)}))}function x(t,e){var r=_(e);return r&&(function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(S,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}u.inherits(y,c),g.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(g.prototype,"buffer",{get:l.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(t){return!!f.call(this,t)||this===y&&t&&t._writableState instanceof g}})):f=function(t){return t instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(t,e,r){var i,n=this._writableState,s=!1,a=!n.objectMode&&(i=t,d.isBuffer(i)||i instanceof p);return a&&!d.isBuffer(t)&&(t=function(t){return d.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=v),n.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),o.nextTick(e,r)}(this,r):(a||function(t,e,r,i){var n=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),o.nextTick(i,s),n=!1),n}(this,n,t,r))&&(n.pendingcb++,s=function(t,e,r,i,n,o){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=d.from(e,r)),e}(e,i,n);i!==s&&(r=!0,n="buffer",i=s)}var a=e.objectMode?1:i.length;e.length+=a;var h=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(t,e,r){var i=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||function(t,e,r){e.ending=!0,x(t,e),r&&(e.finished?o.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,i,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,r(11),r(70).setImmediate,r(7))},function(t,e,r){var i=r(112).Buffer,n=i.isEncoding||function(t){switch((t=""+t)&&t.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}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===n||!n(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=h,this.end=u,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=f,this.end=l,e=3;break;default:return this.write=c,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function h(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function c(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(n>0&&(t.lastNeed=n-1),n):--i=0?(n>0&&(t.lastNeed=n-2),n):--i=0?(n>0&&(2===n?n=0:t.lastNeed=n-3),n):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,r){var i,n,o,s,a,h,u,f;t.exports=(n=(i=f=r(1)).lib,o=n.WordArray,s=n.Hasher,a=i.algo,h=[],u=a.SHA1=s.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],o=r[2],s=r[3],a=r[4],u=0;u<80;u++){if(u<16)h[u]=0|t[e+u];else{var f=h[u-3]^h[u-8]^h[u-14]^h[u-16];h[u]=f<<1|f>>>31}var l=(i<<5|i>>>27)+a+h[u];l+=u<20?1518500249+(n&o|~n&s):u<40?1859775393+(n^o^s):u<60?(n&o|n&s|o&s)-1894007588:(n^o^s)-899497514,a=s,s=o,o=n<<30|n>>>2,n=i,i=l}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=Math.floor(r/4294967296),e[15+(i+64>>>9<<4)]=r,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=s.clone.call(this);return t._hash=this._hash.clone(),t}}),i.SHA1=s._createHelper(u),i.HmacSHA1=s._createHmacHelper(u),f.SHA1)},function(t,e,r){var i,n,o;t.exports=(n=(i=r(1)).lib.Base,o=i.enc.Utf8,void(i.algo.HMAC=n.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=o.parse(e));var r=t.blockSize,i=4*r;e.sigBytes>i&&(e=t.finalize(e)),e.clamp();for(var n=this._oKey=e.clone(),s=this._iKey=e.clone(),a=n.words,h=s.words,u=0;u",'"',"`"," ","\r","\n","\t"]),f=["'"].concat(u),l=["%","/","?",";","#"].concat(f),c=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=r(179);function b(t,e,r){if(t&&n.isObject(t)&&t instanceof o)return t;var i=new o;return i.parse(t,e,r),i}o.prototype.parse=function(t,e,r){if(!n.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),a=-1!==o&&o127?j+="x":j+=T[C];if(!j.match(d)){var P=R.slice(0,E),L=R.slice(E+1),q=T.match(p);q&&(P.push(q[1]),L.unshift(q[2])),L.length&&(b="/"+L.join(".")+b),this.hostname=P.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=i.toASCII(this.hostname));var D=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+D,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[_])for(E=0,I=f.length;E0)&&r.host.split("@"))&&(r.auth=O.shift(),r.host=r.hostname=O.shift())),r.search=t.search,r.query=t.query,n.isNull(r.pathname)&&n.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var k=S.slice(-1)[0],A=(r.host||t.host||S.length>1)&&("."===k||".."===k)||""===k,E=0,B=S.length;B>=0;B--)"."===(k=S[B])?S.splice(B,1):".."===k?(S.splice(B,1),E++):E&&(S.splice(B,1),E--);if(!M&&!_)for(;E--;E)S.unshift("..");!M||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),A&&"/"!==S.join("/").substr(-1)&&S.push("");var O,R=""===S[0]||S[0]&&"/"===S[0].charAt(0);return x&&(r.hostname=r.host=R?"":S.length?S.shift():"",(O=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=O.shift(),r.host=r.hostname=O.shift())),(M=M||r.host&&S.length)&&!R&&S.unshift(""),S.length?r.pathname=S.join("/"):(r.pathname=null,r.path=null),n.isNull(r.pathname)&&n.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){this.listeners={}}return t.prototype.addEventListener=function(t,e){t=t.toLowerCase(),this.listeners[t]=this.listeners[t]||[],this.listeners[t].push(e.handleEvent||e)},t.prototype.removeEventListener=function(t,e){if(t=t.toLowerCase(),this.listeners[t]){var r=this.listeners[t].indexOf(e.handleEvent||e);r<0||this.listeners[t].splice(r,1)}},t.prototype.dispatchEvent=function(t){var e=t.type.toLowerCase();if(t.target=this,this.listeners[e])for(var r=0,i=this.listeners[e];r=1e3&&t<=4999}(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');return e.call(this,t,i,n)}return r}(n)}},function(t){t.exports=JSON.parse('{"rpc":{"invalidInput":-32000,"resourceNotFound":-32001,"resourceUnavailable":-32002,"transactionRejected":-32003,"methodNotSupported":-32004,"parse":-32700,"invalidRequest":-32600,"methodNotFound":-32601,"invalidParams":-32602,"internal":-32603},"provider":{"userRejectedRequest":4001,"unauthorized":4100,"unsupportedMethod":4200}}')},function(t,e,r){var i=r(194);function n(t){var e=function e(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function o(t){var e=function e(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}t.exports=i(n),t.exports.strict=i(o),n.proto=n((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return n(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return o(this)},configurable:!0})}))},function(t,e,r){t.exports=n;var i=r(39).EventEmitter;function n(){i.call(this)}r(4)(n,i),n.Readable=r(17),n.Writable=r(195),n.Duplex=r(196),n.Transform=r(197),n.PassThrough=r(198),n.Stream=n,n.prototype.pipe=function(t,e){var r=this;function n(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",n),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",h));var s=!1;function a(){s||(s=!0,t.end())}function h(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function u(t){if(f(),0===i.listenerCount(this,"error"))throw t}function f(){r.removeListener("data",n),t.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",h),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),t.removeListener("close",f)}return r.on("error",u),t.on("error",u),r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t}},function(t,e,r){var i=r(17).Duplex,n=r(72).inherits;function o(t){i.call(this,{objectMode:!0}),this._name=t.name,this._target=t.target,this._targetWindow=t.targetWindow||window,this._origin=t.targetWindow?"*":location.origin,this._init=!1,this._haveSyn=!1,window.addEventListener("message",this._onMessage.bind(this),!1),this._write("SYN",null,s),this.cork()}function s(){}t.exports=o,n(o,i),o.prototype._onMessage=function(t){var e=t.data;if(("*"===this._origin||t.origin===this._origin)&&t.source===this._targetWindow&&"object"==typeof e&&e.target===this._name&&e.data)if(this._init)try{this.push(e.data)}catch(t){this.emit("error",t)}else"SYN"===e.data?(this._haveSyn=!0,this._write("ACK",null,s)):"ACK"===e.data&&(this._init=!0,this._haveSyn||this._write("ACK",null,s),this.uncork())},o.prototype._read=s,o.prototype._write=function(t,e,r){var i={target:this._target,data:t};this._targetWindow.postMessage(i,this._origin),r()}},function(t,e,r){var i=r(116);"undefined"!=typeof window&&void 0===window.Web3&&(window.Web3=i),t.exports=i},function(t,e){t.exports=k},function(t,e,r){var i=r(28),n=r.n(i),o=r(29),s=r.n(o),a=r(45),h=r.n(a),u=r(31),f=r.n(u),l=r(46),c=r.n(l),d=r(22);function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}var m=function(t){c()(i,t);var e,r=(e=i,function(){var t,r=f()(e);if(p()){var i=f()(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return h()(this,t)});function i(t){var e,o=t.url,s=t.target,a=t.features;return n()(this,i),(e=r.call(this)).url=o,e.target=s||"_blank",e.features=a||"directories=0,titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=700,width=1200",e.window=void 0,e.windowTimer={},e.iClosedWindow=!1,e._setupTimer(),e}return s()(i,[{key:"_setupTimer",value:function(){var t=this;this.windowTimer=setInterval((function(){t.window&&t.window.closed&&(clearInterval(t.windowTimer),t.iClosedWindow||t.emit("close"),t.iClosedWindow=!1,t.window=void 0),void 0===t.window&&clearInterval(t.windowTimer)}),500)}},{key:"open",value:function(){this.window=window.open(this.url,this.target,this.features)}},{key:"close",value:function(){this.iClosedWindow=!0,this.window&&this.window.close()}}]),i}(r.n(d).a);e.a=m},function(t,e,r){(function(e,i){var n=r(38);t.exports=b;var o,s=r(67);b.ReadableState=y,r(39).EventEmitter;var a=function(t,e){return t.listeners(e).length},h=r(68),u=r(49).Buffer,f=e.Uint8Array||function(){},l=Object.create(r(33));l.inherits=r(4);var c=r(107),d=void 0;d=c&&c.debuglog?c.debuglog("stream"):function(){};var p,m=r(108),v=r(69);l.inherits(b,h);var g=["error","close","destroy","pause","resume"];function y(t,e){t=t||{};var i=e instanceof(o=o||r(19));this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,s=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,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.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=r(51).StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function b(t){if(o=o||r(19),!(this instanceof b))return new b(t);this._readableState=new y(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),h.call(this)}function w(t,e,r,i,n){var o,s=t._readableState;return null===e?(s.reading=!1,function(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,S(t)}}(t,s)):(n||(o=function(t,e){var r,i;return i=e,u.isBuffer(i)||i instanceof f||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(s,e)),o?t.emit("error",o):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),i?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):M(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?M(t,s,e,!1):k(t,s)):M(t,s,e,!1))):i||(s.reading=!1)),function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=8388608?t=8388608:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function S(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(d("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?n.nextTick(x,t):x(t))}function x(t){d("emit readable"),t.emit("readable"),O(t)}function k(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(A,t,e))}function A(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var i;return to.length?o.length:t;if(s===o.length?n+=o:n+=o.slice(0,t),0==(t-=s)){s===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++i}return e.length-=i,n}(t,e):function(t,e){var r=u.allocUnsafe(t),i=e.head,n=1;for(i.data.copy(r),t-=i.data.length;i=i.next;){var o=i.data,s=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,s),0==(t-=s)){s===o.length?(++n,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=o.slice(s));break}++n}return e.length-=n,r}(t,e),i}(t,e.buffer,e.decoder),r);var r}function I(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,n.nextTick(T,e,t))}function T(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function j(t,e){for(var r=0,i=t.length;r=e.highWaterMark||e.ended))return d("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?I(this):S(this),null;if(0===(t=_(t,e))&&e.ended)return 0===e.length&&I(this),null;var i,n=e.needReadable;return d("need readable",n),(0===e.length||e.length-t0?R(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&I(this)),null!==i&&this.emit("data",i),i},b.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(t,e){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,e);var h=e&&!1===e.end||t===i.stdout||t===i.stderr?y:u;function u(){d("onend"),t.end()}o.endEmitted?n.nextTick(h):r.once("end",h),t.on("unpipe",(function e(i,n){d("onunpipe"),i===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d("cleanup"),t.removeListener("close",v),t.removeListener("finish",g),t.removeListener("drain",f),t.removeListener("error",m),t.removeListener("unpipe",e),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",p),l=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}));var f=function(t){return function(){var e=t._readableState;d("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,O(t))}}(r);t.on("drain",f);var l=!1,c=!1;function p(e){d("ondata"),c=!1,!1!==t.write(e)||c||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==j(o.pipes,t))&&!l&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,c=!0),r.pause())}function m(e){d("onerror",e),y(),t.removeListener("error",m),0===a(t,"error")&&t.emit("error",e)}function v(){t.removeListener("finish",g),y()}function g(){d("onfinish"),t.removeListener("close",v),y()}function y(){d("unpipe"),r.unpipe(t)}return r.on("data",p),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?s(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",m),t.once("close",v),t.once("finish",g),t.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),t},b.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(110),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(7))},function(t,e,r){t.exports=s;var i=r(19),n=Object.create(r(33));function o(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(!i)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=e&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length=o)return t;switch(t){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(t){return"[Circular]"}default:return t}})),h=i[r];r=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),p(r)?i.showHidden=r:r&&e._extend(i,r),y(i.showHidden)&&(i.showHidden=!1),y(i.depth)&&(i.depth=2),y(i.colors)&&(i.colors=!1),y(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=h),f(i,t,i.depth)}function h(t,e){var r=a.styles[e];return r?"\x1b["+a.colors[r][0]+"m"+t+"\x1b["+a.colors[r][1]+"m":t}function u(t,e){return t}function f(t,r,i){if(t.customInspect&&r&&S(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(i,t);return g(n)||(n=f(t,n,i)),n}var o=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(g(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return v(e)?t.stylize(""+e,"number"):p(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}(t,r);if(o)return o;var s=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),_(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(r);if(0===s.length){if(S(r)){var h=r.name?": "+r.name:"";return t.stylize("[Function"+h+"]","special")}if(b(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(M(r))return t.stylize(Date.prototype.toString.call(r),"date");if(_(r))return l(r)}var u,w="",x=!1,k=["{","}"];return d(r)&&(x=!0,k=["[","]"]),S(r)&&(w=" [Function"+(r.name?": "+r.name:"")+"]"),b(r)&&(w=" "+RegExp.prototype.toString.call(r)),M(r)&&(w=" "+Date.prototype.toUTCString.call(r)),_(r)&&(w=" "+l(r)),0!==s.length||x&&0!=r.length?i<0?b(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),u=x?function(t,e,r,i,n){for(var o=[],s=0,a=e.length;s60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(u,w,k)):k[0]+w+k[1]}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function c(t,e,r,i,n,o){var s,a,h;if((h=Object.getOwnPropertyDescriptor(e,n)||{value:e[n]}).get?a=h.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):h.set&&(a=t.stylize("[Setter]","special")),B(i,n)||(s="["+n+"]"),a||(t.seen.indexOf(h.value)<0?(a=m(r)?f(t,h.value,null):f(t,h.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),y(s)){if(o&&n.match(/^\d+$/))return a;(s=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function d(t){return Array.isArray(t)}function p(t){return"boolean"==typeof t}function m(t){return null===t}function v(t){return"number"==typeof t}function g(t){return"string"==typeof t}function y(t){return void 0===t}function b(t){return w(t)&&"[object RegExp]"===x(t)}function w(t){return"object"==typeof t&&null!==t}function M(t){return w(t)&&"[object Date]"===x(t)}function _(t){return w(t)&&("[object Error]"===x(t)||t instanceof Error)}function S(t){return"function"==typeof t}function x(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(r){if(y(o)&&(o=t.env.NODE_DEBUG||""),r=r.toUpperCase(),!s[r])if(new RegExp("\\b"+r+"\\b","i").test(o)){var i=t.pid;s[r]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",r,i,t)}}else s[r]=function(){};return s[r]},e.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=d,e.isBoolean=p,e.isNull=m,e.isNullOrUndefined=function(t){return null==t},e.isNumber=v,e.isString=g,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=y,e.isRegExp=b,e.isObject=w,e.isDate=M,e.isError=_,e.isFunction=S,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(114);var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E(){var t=new Date,e=[k(t.getHours()),k(t.getMinutes()),k(t.getSeconds())].join(":");return[t.getDate(),A[t.getMonth()],e].join(" ")}function B(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",E(),e.format.apply(e,arguments))},e.inherits=r(115),e._extend=function(t,e){if(!e||!w(e))return t;for(var r=Object.keys(e),i=r.length;i--;)t[r[i]]=e[r[i]];return t};var O="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function R(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(O&&t[O]){var e;if("function"!=typeof(e=t[O]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,O,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,i=new Promise((function(t,i){e=t,r=i})),n=[],o=0;o>>7)^(p<<14|p>>>18)^p>>>3,v=u[d-2],g=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;u[d]=m+u[d-7]+g+u[d-16]}var y=i&n^i&o^n&o,b=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),w=c+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&f^~a&l)+h[d]+u[d];c=l,l=f,f=a,a=s+w|0,s=o,o=n,n=i,i=w+(b+y)|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+f|0,r[6]=r[6]+l|0,r[7]=r[7]+c|0},_doFinalize:function(){var e=this._data,r=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;return r[n>>>5]|=128<<24-n%32,r[14+(n+64>>>9<<4)]=t.floor(i/4294967296),r[15+(n+64>>>9<<4)]=i,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=o._createHelper(f),e.HmacSHA256=o._createHmacHelper(f)}(Math),i.SHA256)},function(t,e,r){var i;t.exports=(i=r(1),r(40),function(){var t=i,e=t.lib.Hasher,r=t.x64,n=r.Word,o=r.WordArray,s=t.algo;function a(){return n.create.apply(n,arguments)}var h=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],u=[];!function(){for(var t=0;t<80;t++)u[t]=a()}();var f=s.SHA512=e.extend({_doReset:function(){this._hash=new o.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],o=r[2],s=r[3],a=r[4],f=r[5],l=r[6],c=r[7],d=i.high,p=i.low,m=n.high,v=n.low,g=o.high,y=o.low,b=s.high,w=s.low,M=a.high,_=a.low,S=f.high,x=f.low,k=l.high,A=l.low,E=c.high,B=c.low,O=d,R=p,I=m,T=v,j=g,C=y,N=b,P=w,L=M,q=_,D=S,U=x,F=k,z=A,H=E,Z=B,W=0;W<80;W++){var K=u[W];if(W<16)var V=K.high=0|t[e+2*W],G=K.low=0|t[e+2*W+1];else{var Y=u[W-15],J=Y.high,X=Y.low,$=(J>>>1|X<<31)^(J>>>8|X<<24)^J>>>7,Q=(X>>>1|J<<31)^(X>>>8|J<<24)^(X>>>7|J<<25),tt=u[W-2],et=tt.high,rt=tt.low,it=(et>>>19|rt<<13)^(et<<3|rt>>>29)^et>>>6,nt=(rt>>>19|et<<13)^(rt<<3|et>>>29)^(rt>>>6|et<<26),ot=u[W-7],st=ot.high,at=ot.low,ht=u[W-16],ut=ht.high,ft=ht.low;V=(V=(V=$+st+((G=Q+at)>>>0>>0?1:0))+it+((G+=nt)>>>0>>0?1:0))+ut+((G+=ft)>>>0>>0?1:0),K.high=V,K.low=G}var lt,ct=L&D^~L&F,dt=q&U^~q&z,pt=O&I^O&j^I&j,mt=R&T^R&C^T&C,vt=(O>>>28|R<<4)^(O<<30|R>>>2)^(O<<25|R>>>7),gt=(R>>>28|O<<4)^(R<<30|O>>>2)^(R<<25|O>>>7),yt=(L>>>14|q<<18)^(L>>>18|q<<14)^(L<<23|q>>>9),bt=(q>>>14|L<<18)^(q>>>18|L<<14)^(q<<23|L>>>9),wt=h[W],Mt=wt.high,_t=wt.low,St=H+yt+((lt=Z+bt)>>>0>>0?1:0),xt=gt+mt;H=F,Z=z,F=D,z=U,D=L,U=q,L=N+(St=(St=(St=St+ct+((lt+=dt)>>>0
>>0?1:0))+Mt+((lt+=_t)>>>0<_t>>>0?1:0))+V+((lt+=G)>>>0>>0?1:0))+((q=P+lt|0)>>>0

>>0?1:0)|0,N=j,P=C,j=I,C=T,I=O,T=R,O=St+(vt+pt+(xt>>>0>>0?1:0))+((R=lt+xt|0)>>>0>>0?1:0)|0}p=i.low=p+R,i.high=d+O+(p>>>0>>0?1:0),v=n.low=v+T,n.high=m+I+(v>>>0>>0?1:0),y=o.low=y+C,o.high=g+j+(y>>>0>>0?1:0),w=s.low=w+P,s.high=b+N+(w>>>0

>>0?1:0),_=a.low=_+q,a.high=M+L+(_>>>0>>0?1:0),x=f.low=x+U,f.high=S+D+(x>>>0>>0?1:0),A=l.low=A+z,l.high=k+F+(A>>>0>>0?1:0),B=c.low=B+Z,c.high=E+H+(B>>>0>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[30+(i+128>>>10<<5)]=Math.floor(r/4294967296),e[31+(i+128>>>10<<5)]=r,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(f),t.HmacSHA512=e._createHmacHelper(f)}(),i.SHA512)},function(t,e,r){var i;t.exports=(i=r(1),r(40),function(t){var e=i,r=e.lib,n=r.WordArray,o=r.Hasher,s=e.x64.Word,a=e.algo,h=[],u=[],f=[];!function(){for(var t=1,e=0,r=0;r<24;r++){h[t+5*e]=(r+1)*(r+2)/2%64;var i=(2*t+3*e)%5;t=e%5,e=i}for(t=0;t<5;t++)for(e=0;e<5;e++)u[t+5*e]=e+(2*t+3*e)%5*5;for(var n=1,o=0;o<24;o++){for(var a=0,l=0,c=0;c<7;c++){if(1&n){var d=(1<>>24)|4278255360&(o<<24|o>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),(B=r[n]).high^=s,B.low^=o}for(var a=0;a<24;a++){for(var c=0;c<5;c++){for(var d=0,p=0,m=0;m<5;m++)d^=(B=r[c+5*m]).high,p^=B.low;var v=l[c];v.high=d,v.low=p}for(c=0;c<5;c++){var g=l[(c+4)%5],y=l[(c+1)%5],b=y.high,w=y.low;for(d=g.high^(b<<1|w>>>31),p=g.low^(w<<1|b>>>31),m=0;m<5;m++)(B=r[c+5*m]).high^=d,B.low^=p}for(var M=1;M<25;M++){var _=(B=r[M]).high,S=B.low,x=h[M];x<32?(d=_<>>32-x,p=S<>>32-x):(d=S<>>64-x,p=_<>>64-x);var k=l[u[M]];k.high=d,k.low=p}var A=l[0],E=r[0];for(A.high=E.high,A.low=E.low,c=0;c<5;c++)for(m=0;m<5;m++){var B=r[M=c+5*m],O=l[M],R=l[(c+1)%5+5*m],I=l[(c+2)%5+5*m];B.high=O.high^~R.high&I.high,B.low=O.low^~R.low&I.low}B=r[0];var T=f[a];B.high^=T.high,B.low^=T.low}},_doFinalize:function(){var e=this._data,r=e.words,i=(this._nDataBytes,8*e.sigBytes),o=32*this.blockSize;r[i>>>5]|=1<<24-i%32,r[(t.ceil((i+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*r.length,this._process();for(var s=this._state,a=this.cfg.outputLength/8,h=a/8,u=[],f=0;f>>24)|4278255360&(c<<24|c>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),u.push(d),u.push(c)}return new n.init(u,a)},clone:function(){for(var t=o.clone.call(this),e=t._state=this._state.slice(0),r=0;r<25;r++)e[r]=e[r].clone();return t}});e.SHA3=o._createHelper(c),e.HmacSHA3=o._createHmacHelper(c)}(Math),i.SHA3)},function(t,e,r){var i=r(5),n=function(t,e){this.value=t||"",this.offset=e};n.prototype.dynamicPartLength=function(){return this.dynamicPart().length/2},n.prototype.withOffset=function(t){return new n(this.value,t)},n.prototype.combine=function(t){return new n(this.value+t.value)},n.prototype.isDynamic=function(){return void 0!==this.offset},n.prototype.offsetAsBytes=function(){return this.isDynamic()?i.padLeft(i.toTwosComplement(this.offset).toString(16),64):""},n.prototype.staticPart=function(){return this.isDynamic()?this.offsetAsBytes():this.value},n.prototype.dynamicPart=function(){return this.isDynamic()?this.value:""},n.prototype.encode=function(){return this.staticPart()+this.dynamicPart()},n.encodeList=function(t){var e=32*t.length,r=t.map((function(t){if(!t.isDynamic())return t;var r=e;return e+=t.dynamicPartLength(),t.withOffset(r)}));return r.reduce((function(t,e){return t+e.dynamicPart()}),r.reduce((function(t,e){return t+e.staticPart()}),""))},t.exports=n},function(t,e,r){var i=r(5),n=r(55),o=r(18),s=r(35),a=r(43),h=r(44),u=function(t,e,r){this._requestManager=t,this._params=e.inputs,this._name=i.transformToFullName(e),this._address=r,this._anonymous=e.anonymous};u.prototype.types=function(t){return this._params.filter((function(e){return e.indexed===t})).map((function(t){return t.type}))},u.prototype.displayName=function(){return i.extractDisplayName(this._name)},u.prototype.typeName=function(){return i.extractTypeName(this._name)},u.prototype.signature=function(){return s(this._name)},u.prototype.encode=function(t,e){t=t||{},e=e||{};var r={};["fromBlock","toBlock"].filter((function(t){return void 0!==e[t]})).forEach((function(t){r[t]=o.inputBlockNumberFormatter(e[t])})),r.topics=[],r.address=this._address,this._anonymous||r.topics.push("0x"+this.signature());var s=this._params.filter((function(t){return!0===t.indexed})).map((function(e){var r=t[e.name];return null==r?null:i.isArray(r)?r.map((function(t){return"0x"+n.encodeParam(e.type,t)})):"0x"+n.encodeParam(e.type,r)}));return r.topics=r.topics.concat(s),r},u.prototype.decode=function(t){t.data=t.data||"",t.topics=t.topics||[];var e=(this._anonymous?t.topics:t.topics.slice(1)).map((function(t){return t.slice(2)})).join(""),r=n.decodeParams(this.types(!0),e),i=t.data.slice(2),s=n.decodeParams(this.types(!1),i),a=o.outputLogFormatter(t);return a.event=this.displayName(),a.address=t.address,a.args=this._params.reduce((function(t,e){return t[e.name]=e.indexed?r.shift():s.shift(),t}),{}),delete a.data,delete a.topics,a},u.prototype.execute=function(t,e,r){i.isFunction(arguments[arguments.length-1])&&(r=arguments[arguments.length-1],2===arguments.length&&(e=null),1===arguments.length&&(e=null,t={}));var n=this.encode(t,e),o=this.decode.bind(this);return new a(n,"eth",this._requestManager,h.eth(),o,r)},u.prototype.attachToContract=function(t){var e=this.execute.bind(this),r=this.displayName();t[r]||(t[r]=e),t[r][this.typeName()]=this.execute.bind(this,t)},t.exports=u},function(t,e,r){(function(t){var i=r(174),n=r(81),o=r(82),s=r(176),a=r(56),h=e;h.request=function(e,r){e="string"==typeof e?a.parse(e):o(e);var n=-1===t.location.protocol.search(/^https?:$/)?"http:":"",s=e.protocol||n,h=e.hostname||e.host,u=e.port,f=e.path||"/";h&&-1!==h.indexOf(":")&&(h="["+h+"]"),e.url=(h?s+"//"+h:"")+(u?":"+u:"")+f,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var l=new i(e);return r&&l.on("response",r),l},h.get=function(t,e){var r=h.request(t,e);return r.end(),r},h.ClientRequest=i,h.IncomingMessage=n.IncomingMessage,h.Agent=function(){},h.Agent.defaultMaxSockets=4,h.globalAgent=new h.Agent,h.STATUS_CODES=s,h.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,r(7))},function(t,e,r){(function(t){e.fetch=a(t.fetch)&&a(t.ReadableStream),e.writableStream=a(t.WritableStream),e.abortController=a(t.AbortController),e.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),e.blobConstructor=!0}catch(t){}var r;function i(){if(void 0!==r)return r;if(t.XMLHttpRequest){r=new t.XMLHttpRequest;try{r.open("GET",t.XDomainRequest?"/":"https://example.com")}catch(t){r=null}}else r=null;return r}function n(t){var e=i();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch(t){}return!1}var o=void 0!==t.ArrayBuffer,s=o&&a(t.ArrayBuffer.prototype.slice);function a(t){return"function"==typeof t}e.arraybuffer=e.fetch||o&&n("arraybuffer"),e.msstream=!e.fetch&&s&&n("ms-stream"),e.mozchunkedarraybuffer=!e.fetch&&o&&n("moz-chunked-arraybuffer"),e.overrideMimeType=e.fetch||!!i()&&a(i().overrideMimeType),e.vbArray=a(t.VBArray),r=null}).call(this,r(7))},function(t,e,r){(function(t,i,n){var o=r(80),s=r(4),a=r(17),h=e.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},u=e.IncomingMessage=function(e,r,s,h){var u=this;if(a.Readable.call(u),u._mode=s,u.headers={},u.rawHeaders=[],u.trailers={},u.rawTrailers=[],u.on("end",(function(){t.nextTick((function(){u.emit("close")}))})),"fetch"===s){if(u._fetchResponse=r,u.url=r.url,u.statusCode=r.status,u.statusMessage=r.statusText,r.headers.forEach((function(t,e){u.headers[e.toLowerCase()]=t,u.rawHeaders.push(e,t)})),o.writableStream){var f=new WritableStream({write:function(t){return new Promise((function(e,r){u._destroyed?r():u.push(new i(t))?e():u._resumeFetch=e}))},close:function(){n.clearTimeout(h),u._destroyed||u.push(null)},abort:function(t){u._destroyed||u.emit("error",t)}});try{return void r.body.pipeTo(f).catch((function(t){n.clearTimeout(h),u._destroyed||u.emit("error",t)}))}catch(t){}}var l=r.body.getReader();!function t(){l.read().then((function(e){if(!u._destroyed){if(e.done)return n.clearTimeout(h),void u.push(null);u.push(new i(e.value)),t()}})).catch((function(t){n.clearTimeout(h),u._destroyed||u.emit("error",t)}))}()}else if(u._xhr=e,u._pos=0,u.url=e.responseURL,u.statusCode=e.status,u.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(t){var e=t.match(/^([^:]+):\s*(.*)/);if(e){var r=e[1].toLowerCase();"set-cookie"===r?(void 0===u.headers[r]&&(u.headers[r]=[]),u.headers[r].push(e[2])):void 0!==u.headers[r]?u.headers[r]+=", "+e[2]:u.headers[r]=e[2],u.rawHeaders.push(e[1],e[2])}})),u._charset="x-user-defined",!o.overrideMimeType){var c=u.rawHeaders["mime-type"];if(c){var d=c.match(/;\s*charset=([^;])(;|$)/);d&&(u._charset=d[1].toLowerCase())}u._charset||(u._charset="utf-8")}};s(u,a.Readable),u.prototype._read=function(){var t=this._resumeFetch;t&&(this._resumeFetch=null,t())},u.prototype._onXHRProgress=function(){var t=this,e=t._xhr,r=null;switch(t._mode){case"text:vbarray":if(e.readyState!==h.DONE)break;try{r=new n.VBArray(e.responseBody).toArray()}catch(t){}if(null!==r){t.push(new i(r));break}case"text":try{r=e.responseText}catch(e){t._mode="text:vbarray";break}if(r.length>t._pos){var o=r.substr(t._pos);if("x-user-defined"===t._charset){for(var s=new i(o.length),a=0;at._pos&&(t.push(new i(new Uint8Array(u.result.slice(t._pos)))),t._pos=u.result.byteLength)},u.onload=function(){t.push(null)},u.readAsArrayBuffer(r)}t._xhr.readyState===h.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,r(11),r(12).Buffer,r(7))},function(t,e){t.exports=function(){for(var t={},e=0;e1&&void 0!==arguments[1]?arguments[1]:"Unspecified error message. This is a bug, please report it.";if(Number.isInteger(t)){var r=t.toString();if(i[r])return i[r].message;if(u(t))return"Unspecified server error."}return e}function h(t){if(!Number.isInteger(t))return!1;var e=t.toString();return!!i[e]||!!u(t)}function u(t){return t>=-32099&&t<=-32e3}function f(t){return t&&"object"==typeof t&&!Array.isArray(t)?Object.assign({},t):t}t.exports={getMessageFromCode:a,isValidCode:h,serializeError:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;if(!e||!Number.isInteger(e.code)||"string"!=typeof e.message)throw new Error("fallbackError must contain integer number code and string message.");if(t instanceof o)return t.serialize();var r={};return t&&h(t.code)?(r.code=t.code,t.message&&"string"==typeof t.message?(r.message=t.message,t.hasOwnProperty("data")&&(r.data=t.data)):(r.message=a(r.code),r.data={originalError:f(t)})):(r.code=e.code,r.message=t&&t.message?t.message:e.message,r.data={originalError:f(t)}),t&&t.stack&&(r.stack=t.stack),r},JSON_RPC_SERVER_ERROR_MESSAGE:"Unspecified server error."}},function(t,e,r){(function(e){var i=r(60),n=function(){};t.exports=function t(r,o,s){if("function"==typeof o)return t(r,null,o);o||(o={}),s=i(s||n);var a=r._writableState,h=r._readableState,u=o.readable||!1!==o.readable&&r.readable,f=o.writable||!1!==o.writable&&r.writable,l=!1,c=function(){r.writable||d()},d=function(){f=!1,u||s.call(r)},p=function(){u=!1,f||s.call(r)},m=function(t){s.call(r,t?new Error("exited with error code: "+t):null)},v=function(t){s.call(r,t)},g=function(){e.nextTick(y)},y=function(){if(!l)return(!u||h&&h.ended&&!h.destroyed)&&(!f||a&&a.ended&&!a.destroyed)?void 0:s.call(r,new Error("premature close"))},b=function(){r.req.on("finish",d)};return function(t){return t.setHeader&&"function"==typeof t.abort}(r)?(r.on("complete",d),r.on("abort",g),r.req?b():r.on("request",b)):f&&!a&&(r.on("end",c),r.on("close",c)),function(t){return t.stdio&&Array.isArray(t.stdio)&&3===t.stdio.length}(r)&&r.on("exit",m),r.on("end",p),r.on("finish",d),!1!==o.error&&r.on("error",v),r.on("close",g),function(){l=!0,r.removeListener("complete",d),r.removeListener("abort",g),r.removeListener("request",b),r.req&&r.req.removeListener("finish",d),r.removeListener("end",c),r.removeListener("close",c),r.removeListener("finish",d),r.removeListener("exit",m),r.removeListener("end",p),r.removeListener("error",v),r.removeListener("close",g)}}}).call(this,r(11))},function(t,e,r){var i=r(14).Buffer,n=r(61).Transform;function o(t){n.call(this),this._block=i.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(4)(o,n),o.prototype._transform=function(t,e,r){var i=null;try{this.update(t,e)}catch(t){i=t}r(i)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!i.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer")}(t),this._finalized)throw new Error("Digest already called");i.isBuffer(t)||(t=i.from(t,e));for(var r=this._block,n=0;this._blockOffset+t.length-n>=this._blockSize;){for(var o=this._blockOffset;o0;++s)this._length[s]+=a,(a=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*a);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},function(t,e,r){var i=r(4),n=r(27),o=r(14).Buffer,s=[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],a=new Array(64);function h(){this.init(),this._w=a,n.call(this,64,56)}function u(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function l(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function c(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}i(h,n),h.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},h.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,h=0|this._e,p=0|this._f,m=0|this._g,v=0|this._h,g=0;g<16;++g)r[g]=t.readInt32BE(4*g);for(;g<64;++g)r[g]=0|(((e=r[g-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[g-7]+d(r[g-15])+r[g-16];for(var y=0;y<64;++y){var b=v+c(h)+u(h,p,m)+s[y]+r[y]|0,w=l(i)+f(i,n,o)|0;v=m,m=p,p=h,h=a+b|0,a=o,o=n,n=i,i=b+w|0}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=h+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=v+this._h|0},h.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=h},function(t,e,r){var i=r(4),n=r(27),o=r(14).Buffer,s=[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],a=new Array(160);function h(){this.init(),this._w=a,n.call(this,128,112)}function u(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function l(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function c(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function m(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function v(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function g(t,e){return t>>>0>>0?1:0}i(h,n),h.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},h.prototype._update=function(t){for(var e=this._w,r=0|this._ah,i=0|this._bh,n=0|this._ch,o=0|this._dh,a=0|this._eh,h=0|this._fh,y=0|this._gh,b=0|this._hh,w=0|this._al,M=0|this._bl,_=0|this._cl,S=0|this._dl,x=0|this._el,k=0|this._fl,A=0|this._gl,E=0|this._hl,B=0;B<32;B+=2)e[B]=t.readInt32BE(4*B),e[B+1]=t.readInt32BE(4*B+4);for(;B<160;B+=2){var O=e[B-30],R=e[B-30+1],I=d(O,R),T=p(R,O),j=m(O=e[B-4],R=e[B-4+1]),C=v(R,O),N=e[B-14],P=e[B-14+1],L=e[B-32],q=e[B-32+1],D=T+P|0,U=I+N+g(D,T)|0;U=(U=U+j+g(D=D+C|0,C)|0)+L+g(D=D+q|0,q)|0,e[B]=U,e[B+1]=D}for(var F=0;F<160;F+=2){U=e[F],D=e[F+1];var z=f(r,i,n),H=f(w,M,_),Z=l(r,w),W=l(w,r),K=c(a,x),V=c(x,a),G=s[F],Y=s[F+1],J=u(a,h,y),X=u(x,k,A),$=E+V|0,Q=b+K+g($,E)|0;Q=(Q=(Q=Q+J+g($=$+X|0,X)|0)+G+g($=$+Y|0,Y)|0)+U+g($=$+D|0,D)|0;var tt=W+H|0,et=Z+z+g(tt,W)|0;b=y,E=A,y=h,A=k,h=a,k=x,a=o+Q+g(x=S+$|0,S)|0,o=n,S=_,n=i,_=M,i=r,M=w,r=Q+et+g(w=$+tt|0,$)|0}this._al=this._al+w|0,this._bl=this._bl+M|0,this._cl=this._cl+_|0,this._dl=this._dl+S|0,this._el=this._el+x|0,this._fl=this._fl+k|0,this._gl=this._gl+A|0,this._hl=this._hl+E|0,this._ah=this._ah+r+g(this._al,w)|0,this._bh=this._bh+i+g(this._bl,M)|0,this._ch=this._ch+n+g(this._cl,_)|0,this._dh=this._dh+o+g(this._dl,S)|0,this._eh=this._eh+a+g(this._el,x)|0,this._fh=this._fh+h+g(this._fl,k)|0,this._gh=this._gh+y+g(this._gl,A)|0,this._hh=this._hh+b+g(this._hl,E)|0},h.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=h},function(t,e,r){(function(t){var i,n=r(3),o=r.n(n),s=r(9),a=r.n(s),h=r(28),u=r.n(h),f=r(29),l=r.n(f),c=r(8),d=r.n(c),p=r(89),m=r.n(p),v=r(90),g=r.n(v),y=r(2),b=r.n(y),w=r(62),M=r.n(w),_=r(63),S=r.n(_),x=r(30),k=r(15),A=r(0),E=r(92),B=r(100),O=r(65),R=r(102),I=r(103),T=r(10);function j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function C(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},r=e.buttonPosition,i=void 0===r?"bottom-left":r;u()(this,t),d()(this,"paymentProviders",k.a.paymentProviders),this.buttonPosition=i,this.torusWidget={},this.torusMenuBtn={},this.torusLogin={},this.torusLoadingBtn={},this.torusUrl="",this.torusIframe={},this.torusLoginModal={},this.torusSpeedDial={},this.keyBtn={},this.styleLink={},this.isLoggedIn=!1,this.isInitalized=!1,this.torusButtonVisibility=!0,this.requestedVerifier="",this.currentVerifier="",this.enabledVerifiers={},this.Web3=S.a,this.torusAlert={},this.nodeDetailManager=new m.a,this.torusJs=new g.a}var e,r,i;return l()(t,[{key:"init",value:(i=a()(o.a.mark((function t(){var e,r,i,n,s,h,u,f,l,c,d,p,m,v,g,y,w,M,_,S,k,E,O=this,R=arguments;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=R.length>0&&void 0!==R[0]?R[0]:{},r=e.buildEnv,i=void 0===r?"production":r,n=e.enableLogging,s=void 0!==n&&n,h=e.enabledVerifiers,u=void 0===h?z:h,f=e.network,l=void 0===f?{host:"mainnet",chainId:1,networkName:"mainnet"}:f,c=e.showTorusButton,d=void 0===c||c,p=e.integrity,m=void 0===p?{check:!1,hash:H,version:x.b}:p,!this.isInitalized){t.next=3;break}return t.abrupt("return",Promise.reject(new Error("Already initialized")));case 3:return t.next=5,Object(T.c)(i,m);case 5:if(v=t.sent,g=v.torusUrl,y=v.logLevel,b.a.info(g,"url loaded"),this.torusUrl=g,this.enabledVerifiers=C({},z,{},u),b.a.setDefaultLevel(y),s?b.a.enableAll():b.a.disableAll(),this.torusButtonVisibility=d,this._createWidget(g),w=function(){window.document.body.appendChild(O.torusIframe)},M=function(){var t=a()(o.a.mark((function t(){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(A.d)(w);case 2:return t.next=4,Object(A.d)(O._setupWeb3.bind(O));case 4:return t.next=6,Object(A.d)(a()(o.a.mark((function t(){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,O._setProvider(l);case 2:O.isInitalized=!0;case 3:case"end":return t.stop()}}),t)}))));case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),"production"!==i||!m.check){t.next=38;break}return _="".concat(g,"/popup"),t.next=21,fetch(_,{cache:"reload"});case 21:if("max-age=3600"===(S=t.sent).headers.get("Cache-Control")){t.next=24;break}throw new Error("Unexpected Cache-Control headers, got ".concat(S.headers.get("Cache-Control")));case 24:return t.next=26,S.text();case 26:if(k=t.sent,E=Object(B.a)({algorithms:["sha384"]},k),b.a.info(E,"integrity"),E!==m.hash){t.next=34;break}return t.next=32,M();case 32:t.next=36;break;case 34:throw this._cleanUp(),new Error("Integrity check failed");case 36:t.next=40;break;case 38:return t.next=40,M();case 40:return t.abrupt("return",void 0);case 41:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"_checkThirdPartyCookies",value:function(){if(!Z)throw this._createAlert('

Cookies Required

Please enable cookies in your browser preferences to access Torus.

For more info, click here

'),new Error("Third party cookies not supported")}},{key:"login",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.verifier;if(!this.isInitalized)throw new Error("Call init() first");if(e&&!this.enabledVerifiers[e])throw new Error("Given verifier is not enabled");if(!e)return this.requestedVerifier="",this.ethereum.enable();if(k.a.verifierList.includes(e))return this.requestedVerifier=e,this.ethereum.enable();throw new Error("Unsupported verifier")}},{key:"logout",value:function(){var t=this;return new Promise((function(e,r){if(t.isLoggedIn){t.communicationMux.getStream("logout").write({name:"logOut"});var i=t.communicationMux.getStream("status");Object(A.b)(i,"data",(function(i){i.loggedIn?r(new Error("Some Error Occured")):(t.isLoggedIn=!1,t.currentVerifier="",t.requestedVerifier="",e())}))}else r(new Error("User has not logged in yet"))}))}},{key:"cleanUp",value:(r=a()(o.a.mark((function t(){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.isLoggedIn){t.next=3;break}return t.next=3,this.logout();case 3:this._cleanUp();case 4:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"_cleanUp",value:function(){function t(t){return t instanceof Element||t instanceof HTMLDocument}t(this.styleLink)&&window.document.body.contains(this.styleLink)&&(this.styleLink.remove(),this.styleLink={}),t(this.torusWidget)&&window.document.body.contains(this.torusWidget)&&(this.torusWidget.remove(),this.torusWidget={},this.torusLogin={},this.torusMenuBtn={},this.torusLoadingBtn={},this.torusLoginModal={}),t(this.torusIframe)&&window.document.body.contains(this.torusIframe)&&(this.torusIframe.remove(),this.torusIframe={}),t(this.torusAlert)&&window.document.body.contains(this.torusAlert)&&(this.torusAlert.remove(),this.torusAlert={}),this.isInitalized=!1}},{key:"_createAlert",value:function(t){var e=this;this.torusAlert=Object(A.c)(t);var r=Object(A.c)('x');this.torusAlert.appendChild(r),Object(A.d)((function(){window.document.body.appendChild(e.torusAlert)})),Object(A.d)((function(){r.addEventListener("click",(function(){e.torusAlert.remove()}))}))}},{key:"_createPopupBlockAlert",value:function(t){var e=this,r=Object(A.c)('

Action Required

You have a pending action that needs to be completed in a pop-up window

'),i=Object(A.c)('
');r.appendChild(i),Object(A.d)((function(){window.document.body.appendChild(r)})),Object(A.d)((function(){i.addEventListener("click",(function(){e._handleWindow(t,{target:"_blank",features:"directories=0,titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=660,width=500"}),r.remove()}))}))}},{key:"_createWidget",value:function(t){var e=this,r=window.document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("type","text/css"),r.setAttribute("href","".concat(t,"/css/widget.css")),this.styleLink=r,this.torusWidget=Object(A.c)('
');var i=Object(A.c)('
');this.torusLoadingBtn=Object(A.c)(''),this.torusButtonVisibility||(this.torusLoadingBtn.style.display="none"),this.torusLoadingBtn.appendChild(i),this.torusWidget.appendChild(this.torusLoadingBtn),this.torusLogin=Object(A.c)(''),this.torusButtonVisibility||(this.torusLogin.style.display="none"),this.torusWidget.appendChild(this.torusLogin),this.torusMenuBtn=Object(A.c)(''),o=Object(A.c)('
Copy public address to clipboard
'),s=Object(A.c)('
Copied!
');this.keyBtn=Object(A.c)('');var a=Object(A.c)('
  • ');a.appendChild(this.keyBtn),a.appendChild(o),a.appendChild(s);var h=Object(A.c)('
  • ');this.torusSpeedDial.appendChild(n),this.torusSpeedDial.appendChild(a),this.torusSpeedDial.appendChild(h),this.torusWidget.prepend(this.torusSpeedDial),this.torusLoginModal=Object(A.c)('
    '),this.torusLoginModal.style.display="none";var u=Object(A.c)('
    ×
    '),f=Object(A.c)('
    Login
    '),l=Object(A.c)('

    You are just one step away from your digital wallet

    ');this.googleLogin=Object(A.c)(''));var c=Object(A.c)('
      ');this.facebookLogin=Object(A.c)('
    • ')),this.twitchLogin=Object(A.c)('
    • '),this.redditLogin=Object(A.c)('
    • '),this.discordLogin=Object(A.c)('
    • '),this.enabledVerifiers[q]&&c.appendChild(this.facebookLogin),this.enabledVerifiers[D]&&c.appendChild(this.redditLogin),this.enabledVerifiers[U]&&c.appendChild(this.twitchLogin),this.enabledVerifiers[F]&&c.appendChild(this.discordLogin),this.enabledVerifiers[L]&&l.appendChild(this.googleLogin),l.appendChild(c);var d=Object(A.c)('
      By logging in, you accept Torus\' Terms and Conditions
      ');switch(l.appendChild(d),f.appendChild(l),u.appendChild(f),this.torusLoginModal.appendChild(u),this.torusWidget.appendChild(this.torusLoginModal),this.torusIframe=Object(A.c)('')),Object(A.d)((function(){window.document.head.appendChild(r),window.document.body.appendChild(e.torusWidget)})),Object(A.d)((function(){e.torusLogin.addEventListener("click",(function(){e._showLoginPopup(!1)})),n.addEventListener("click",(function(){e.showWallet(),e._toggleSpeedDial()})),h.addEventListener("click",(function(){e.showWallet("transfer"),e._toggleSpeedDial()})),e.keyBtn.addEventListener("click",(function(){var t=Object(A.c)(''));e.torusWidget.prepend(t),t.select(),t.setSelectionRange(0,99999),document.execCommand("copy"),e.torusWidget.removeChild(t),s.classList.add("active"),o.classList.add("active"),setTimeout((function(){s.classList.remove("active"),o.classList.remove("active"),e._toggleSpeedDial()}),1e3)})),e.torusMenuBtn.addEventListener("click",(function(){e._toggleSpeedDial()})),u.querySelector("#torus-login-modal__close").addEventListener("click",(function(){e.torusLoginModal.style.display="none",e.modalCloseHandler&&e.modalCloseHandler(),delete e.modalCloseHandler}))})),this.buttonPosition){case"top-left":this.torusWidget.style.top="34px",this.torusWidget.style.left="34px";break;case"top-right":this.torusWidget.style.top="34px",this.torusWidget.style.right="34px";break;case"bottom-right":this.torusWidget.style.bottom="34px",this.torusWidget.style.right="34px";break;case"bottom-left":default:this.torusWidget.style.bottom="34px",this.torusWidget.style.left="34px"}}},{key:"_updateKeyBtnAddress",value:function(t){this.keyBtn.innerText=t&&"".concat(t.slice(0,4),"..")}},{key:"_showLoggedOut",value:function(){this.torusMenuBtn.style.display="none",this.torusLogin.style.display=this.torusButtonVisibility?"block":"none",this.torusLoadingBtn.style.display="none",this.torusLoginModal.style.display="none",this.torusSpeedDial.style.display="none",this.torusSpeedDial.style.opacity="0"}},{key:"_showLoggingIn",value:function(){this.torusMenuBtn.style.display="none",this.torusLogin.style.display="none",this.torusLoadingBtn.style.display=this.torusButtonVisibility?"block":"none",this.torusLoginModal.style.display=""===this.requestedVerifier?"block":"none"}},{key:"_showLoggedIn",value:function(){this.torusMenuBtn.style.display=this.torusButtonVisibility?"block":"none",this.torusLogin.style.display="none",this.torusLoadingBtn.style.display="none",this.torusLoginModal.style.display="none"}},{key:"hideTorusButton",value:function(){this.torusButtonVisibility=!1,this.torusMenuBtn.style.display="none",this.torusLogin.style.display="none",this.torusLoadingBtn.style.display="none",this.torusSpeedDial.style.display="none",this.torusSpeedDial.style.opacity="0"}},{key:"showTorusButton",value:function(){this.torusButtonVisibility=!0,this.isLoggedIn?this._showLoggedIn():this._showLoggedOut()}},{key:"_setupWeb3",value:function(){var t=this;b.a.info("setupWeb3 running"),this.metamaskStream=new M.a({name:"embed_metamask",target:"iframe_metamask",targetWindow:this.torusIframe.contentWindow}),this.metamaskStream.setMaxListeners(100),this.communicationStream=new M.a({name:"embed_comm",target:"iframe_comm",targetWindow:this.torusIframe.contentWindow}),this.communicationStream.setMaxListeners(100);var e=new E.a(this.metamaskStream),r=function(t){var r=e[t];e[t]=function(t){if(t&&"eth_requestAccounts"===t)return e.enable();for(var i=arguments.length,n=new Array(i>1?i-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:{},o=n.result;if(e)setTimeout((function(){t._showLoggedOut(),i(e)}),50);else if(Array.isArray(o)&&o.length>0){var s=function(){if(""!==t.requestedVerifier&&t.currentVerifier!==t.requestedVerifier){var e=t.requestedVerifier;t.logout().then((function(n){t.requestedVerifier=e,t._showLoginPopup(!0,r,i)})).catch((function(t){return i(t)}))}else t._showLoggedIn(),r(o)};t.isLoggedIn?s():t.isLoginCallback=s}else t._showLoginPopup(!0,r,i)}))}))};var i=new Proxy(e,{deleteProperty:function(){return!0}});this.ethereum=i;var n=Object(I.a)(this.communicationStream);n.setMaxListeners(20),this.communicationMux=n,n.getStream("window").on("data",(function(e){"create_window"===e.name&&t._createPopupBlockAlert(e.data.preopenInstanceId)})),n.getStream("status").on("data",(function(e){e.loggedIn?(t.isLoggedIn=e.loggedIn,t.currentVerifier=e.verifier):t._showLoggedOut(),t.isLoginCallback&&(t.isLoginCallback(),delete t.isLoginCallback)})),this.provider=e,this.web3=new S.a(e),this.web3.setProvider=function(){b.a.debug("Torus - overrode web3.setProvider")},this.web3.currentProvider.isTorus=!0,e.on("accountsChanged",(function(e){t._updateKeyBtnAddress(e&&e[0]||"")})),Object(R.a)(this.provider._rpcEngine),b.a.debug("Torus - injected web3")}},{key:"_showLoginPopup",value:function(t,e,r){var i=this;if(this._showLoggingIn(),void 0===this.requestedVerifier||""===this.requestedVerifier){this.modalCloseHandler=function(){i._showLoggedOut(),r&&r(new Error("Modal has been closed"))};var n=function(n){i.requestedVerifier=n,i._showLoginPopup(t,e,r)};Object.keys(this.enabledVerifiers).forEach((function(t){i.enabledVerifiers[t]&&Object(A.a)(i["".concat(t,"Login")],"click",n,[t])}))}else{var o=this.communicationMux.getStream("oauth");Object(A.b)(o,"data",(function(t){var n=t.err,o=t.selectedAddress;n?(b.a.error(n),i._showLoggedOut(),r&&r(n)):(e&&e([Object(A.e)(o)]),i._showLoggedIn())}));var s=Object(T.b)();this._handleWindow(s),o.write({name:"oauth",data:{calledFromEmbed:t,verifier:this.requestedVerifier,preopenInstanceId:s}})}}},{key:"setProvider",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.host,i=void 0===r?"mainnet":r,n=e.chainId,o=void 0===n?1:n,s=e.networkName,a=void 0===s?"mainnet":s;return new Promise((function(e,r){var n=t.communicationMux.getStream("provider_change");Object(A.b)(n,"data",(function(t){var i=t.data,n=i.err,o=i.success;b.a.info(t),n?r(n):o?e():r(new Error("some error occured"))}));var s=Object(T.b)();t._handleWindow(s,{target:"_blank",features:"directories=0,titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=600,width=500"}),n.write({name:"show_provider_change",data:{network:{host:i,chainId:o,networkName:a},type:k.a.networkList.includes(i)?void 0:"rpc",preopenInstanceId:s,override:!1}})}))}},{key:"_setProvider",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.host,i=void 0===r?"mainnet":r,n=e.chainId,o=void 0===n?1:n,s=e.networkName,a=void 0===s?"mainnet":s;return new Promise((function(e,r){if(t.isInitalized)r(new Error("Already initialized"));else{var n=t.communicationMux.getStream("provider_change");Object(A.b)(n,"data",(function(t){b.a.info(t);var i=t.data,n=i.err,o=i.success;n?r(n):o?e():r(new Error("some error occured"))})),n.write({name:"show_provider_change",data:{network:{host:i,chainId:o,networkName:a},type:k.a.networkList.includes(i)?void 0:"rpc",override:!0}})}}))}},{key:"showWallet",value:function(t){var e=this,r=this.communicationMux.getStream("show_wallet"),i=t?"/".concat(t):"";r.write({name:"show_wallet",data:{path:i}}),Object(A.b)(r,"data",(function(t){if("show_wallet_instance"===t.name){var r=t.data.instanceId,n="".concat(e.torusUrl,"/wallet").concat(i,"?integrity=true&instanceId=").concat(r);new O.a({url:n}).open()}}))}},{key:"_toggleSpeedDial",value:function(){this.torusMenuBtn.classList.toggle("active");var t=this.torusMenuBtn.classList.contains("active"),e=this.torusSpeedDial;t&&(e.style.display="block"),e.style.opacity="0"===e.style.opacity?"1":"0",e.classList.toggle("active");var r=t?.05:1.2;e.style.transitionDelay="".concat(r,"s"),setTimeout((function(){for(var r=t?.05:.15,i=Object.values(e.children),n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=e.target,i=e.features;if(t){var n=this.communicationMux.getStream("window"),o="".concat(this.torusUrl,"/redirect?preopenInstanceId=").concat(t),s=new O.a({url:o,target:r,features:i});if(s.open(),!s.window)return void this._createPopupBlockAlert(t);n.write({name:"opened_window",data:{preopenInstanceId:t}});var a=function e(r){var i=r.preopenInstanceId,o=r.close;i===t&&o&&(s.close(),n.removeListener("data",e))};n.on("data",a),s.once("close",(function(){n.write({data:{preopenInstanceId:t,closed:!0}})}))}}},{key:"initiateTopup",value:function(t,e){var r=this;return new Promise((function(i,n){if(r.isInitalized){var o=Object(T.f)(t,e),s=o.errors;if(!o.isValid)return void n(new Error(JSON.stringify(s)));var a=r.communicationMux.getStream("topup");Object(A.b)(a,"data",(function(t){"topup_response"===t.name&&(t.data.success?i(t.data.success):n(new Error(t.data.error)))}));var h=Object(T.b)();r._handleWindow(h),a.write({name:"topup_request",data:{provider:t,params:e,preopenInstanceId:h}})}else n(new Error("User has not initialized in yet"))}))}}]),t}();e.a=W}).call(this,r(7))},function(t,e){t.exports=R},function(t,e){t.exports=j},function(t,e){t.exports=T},function(t,e,r){var i=r(64),n=r.n(i),o=r(28),s=r.n(o),a=r(29),h=r.n(a),u=r(48),f=r.n(u),l=r(45),c=r.n(l),d=r(31),p=r.n(d),m=r(46),v=r.n(m),g=r(36),y=r(93),b=r.n(y),w=r(94),M=r.n(w),_=r(95),S=r.n(_),x=r(96),k=r.n(x),A=r(2),E=r.n(A),B=r(47),O=r.n(B),R=r(97),I=r.n(R),T=r(98),j=r.n(T),C=r(32),N=r.n(C),P=r(22),L=r.n(P),q=r(37),D=r(10);function U(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}var F=function(t){v()(i,t);var e,r=(e=i,function(){var t,r=p()(e);if(U()){var i=p()(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return c()(this,t)});function i(t){var e;s()(this,i),(e=r.call(this))._state={sentWarnings:{isConnected:!1,sendAsync:!1,sendSync:!1},isConnected:void 0,accounts:void 0,isUnlocked:void 0},e.selectedAddress=null,e.networkVersion=void 0,e.chainId=void 0;var n=new O.a;e.mux=n,N()(t,n,t,e._handleDisconnect.bind(f()(e),"MetaMask")),e._publicConfigStore=new I.a({storageKey:"MetaMask-Config"}),e._publicConfigStore.subscribe((function(t){var r=JSON.parse(t);if("isUnlocked"in r&&r.isUnlocked!==e._state.isUnlocked)if(e._state.isUnlocked=r.isUnlocked,e._state.isUnlocked)try{e._sendAsync({method:"eth_accounts",params:[]},(function(){}),!0)}catch(t){}else e._handleAccountsChanged([]);if("selectedAddress"in r&&e.selectedAddress!==r.selectedAddress)try{e._sendAsync({method:"eth_accounts",params:[]},(function(){}),!0)}catch(t){}"chainId"in r&&r.chainId!==e.chainId&&(e.chainId=r.chainId,e.emit("chainChanged",e.chainId)),"networkVersion"in r&&r.networkVersion!==e.networkVersion&&(e.networkVersion=r.networkVersion,e.emit("networkChanged",e.networkVersion))})),N()(n.createStream("publicConfig"),j()(e._publicConfigStore),D.d.bind(f()(e),"MetaMask PublicConfigStore")),n.ignoreStream("phishing"),e.on("connect",(function(){e._state.isConnected=!0}));var o=k()();N()(o.stream,n.createStream("provider"),o.stream,e._handleDisconnect.bind(f()(e),"MetaMask RpcProvider"));var a=new M.a;return a.push(S()()),a.push(Object(D.a)()),a.push(o.middleware),e._rpcEngine=a,o.events.on("notification",(function(t){"wallet_accountsChanged"===t.method?e._handleAccountsChanged(t.result):"eth_subscription"===t.method&&e.emit("notification",t.params.result),e.emit("data",null,t)})),setTimeout((function(){return e.emit("connect")})),e}return h()(i,[{key:"send",value:function(t,e){var r,i=this,o=e,s=e;if("object"!==n()(t)||Array.isArray(t))"string"==typeof t&&"function"!=typeof s&&(void 0===s?s=[]:Array.isArray(s)||(s=[s]),r={method:t,params:s});else{if("function"==typeof s)return this._sendAsync(t,s);if(r=t,!s&&["eth_accounts","eth_coinbase","eth_uninstallFilter","net_version"].includes(r.method))return this._sendSync(r)}if(Array.isArray(r)||"function"==typeof s||"object"!==n()(r)||"string"!=typeof r.method)throw g.ethErrors.rpc.invalidRequest({message:q.a.errors.invalidParams(),data:[t,o]});return new Promise((function(t,e){try{i._sendAsync(r,function(t,e){return function(r,i){return r||i.error?e(r||i.error):Array.isArray(i)?t(i):t(i.result)}}(t,e))}catch(t){e(t)}}))}},{key:"sendAsync",value:function(t,e){this._sendAsync(t,e)}},{key:"_sendSync",value:function(t){var e;switch(t.method){case"eth_accounts":e=this.selectedAddress?[this.selectedAddress]:[];break;case"eth_coinbase":e=this.selectedAddress||null;break;case"eth_uninstallFilter":this._sendAsync(t,(function(){})),e=!0;break;case"net_version":e=this.networkVersion||null;break;default:throw new Error(q.a.errors.unsupportedSync(t.method))}return Object(D.e)({id:t.id,jsonrpc:t.jsonrpc,result:e},"result")}},{key:"_sendAsync",value:function(t,e){var r=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e,o=t;Array.isArray(o)||(o.jsonrpc||(o.jsonrpc="2.0"),"eth_accounts"!==o.method&&"eth_requestAccounts"!==o.method||(n=function(t,n){r._handleAccountsChanged(n.result||[],"eth_accounts"===o.method,i),e(t,n)})),this._rpcEngine.handle(o,n)}},{key:"_handleDisconnect",value:function(t,e){D.d.bind(this)(t,e),this._state.isConnected&&this.emit("close",{code:1011,reason:"MetaMask background communication error."}),this._state.isConnected=!1}},{key:"_handleAccountsChanged",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=t;Array.isArray(i)||(E.a.error("MetaMask: Received non-array accounts parameter. Please report this bug.",i),i=[]),b()(this._state.accounts,i)||(e&&!r&&E.a.error('MetaMask: "eth_accounts" unexpectedly updated accounts. Please report this bug.',i),this.emit("accountsChanged",i),this._state.accounts=i),this.selectedAddress!==i[0]&&(this.selectedAddress=i[0]||null)}}]),i}(L.a);e.a=F},function(t,e){t.exports=C},function(t,e,r){var i=r(192),n=r(22),o=r(36),s=o.serializeError,l=o.EthereumRpcError,p=o.ERROR_CODES;t.exports=function(t){Object(u.a)(r,t);var e=Object(f.a)(r);function r(){var t;return Object(a.a)(this,r),(t=e.call(this))._middleware=[],t}return Object(h.a)(r,[{key:"push",value:function(t){this._middleware.push(t)}},{key:"handle",value:function(t,e){Array.isArray(t)?this._handleBatch(t,e):this._handle(t,e)}},{key:"_handleBatch",value:function(){var t=Object(d.a)(c.a.mark((function t(e,r){return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.t0=r,t.next=4,Promise.all(e.map(this._promiseHandle.bind(this)));case 4:t.t1=t.sent,(0,t.t0)(null,t.t1),t.next=11;break;case 8:t.prev=8,t.t2=t.catch(0),r(t.t2);case 11:case"end":return t.stop()}}),t,this,[[0,8]])})));return function(e,r){return t.apply(this,arguments)}}()},{key:"_promiseHandle",value:function(t){var e=this;return new Promise((function(r,i){e._handle(t,(function(t,e){e?r(e):i(t||new l(p.rpc.internal,"JsonRpcEngine: Request handler returned neither error nor response."))}))}))}},{key:"_handle",value:function(t,e){var r=Object.assign({},t),i={id:r.id,jsonrpc:r.jsonrpc};this._runMiddleware(r,i,(function(t){var r=i._originalError;if(delete i._originalError,r)return delete i.result,e(r,i);e(t,i)}))}},{key:"_runMiddleware",value:function(t,e,r){var n=this;i.waterfall([function(r){return n._runMiddlewareDown(t,e,r)},function(r,i){var n=r.isComplete,o=r.returnHandlers;if(!("result"in e)&&!("error"in e)){var s="JsonRpcEngine: Response has no error or result for request:\n"+JSON.stringify(t,null,2);return i(new l(p.rpc.internal,s,t))}if(!n){var a="JsonRpcEngine: Nothing ended request:\n"+JSON.stringify(t,null,2);return i(new l(p.rpc.internal,a,t))}return i(null,o)},function(t,e){return n._runReturnHandlersUp(t,e)}],r)}},{key:"_runMiddlewareDown",value:function(t,e,r){var n=[],o=!1;i.mapSeries(this._middleware,(function(r,i){if(o)return i();function a(t){var r=t||e&&e.error;r&&(e.error=s(r),e._originalError=r),o=!0,i()}r(t,e,(function(t){e.error?a(e.error):(n.push(t),i())}),a)}),(function(t){if(t)return e.error=s(t),delete e.result,r(t,e);var i=n.filter(Boolean).reverse();r(null,{isComplete:o,returnHandlers:i})}))}},{key:"_runReturnHandlersUp",value:function(t,e){i.eachSeries(t,(function(t,e){return t(e)}),e)}}]),r}(n)},function(t,e,r){var i=r(193);t.exports=function(){return function(t,e,r,n){var o=t.id,s=i();t.id=s,e.id=s,r((function(r){t.id=o,e.id=o,r()}))}}},function(t,e,r){var i=r(22),n=r(17).Duplex;t.exports=function(){var t={},e=new n({objectMode:!0,read:function(){return!1},write:function(e,i,n){var o;try{e.id?function(e){var r=t[e.id];if(!r)throw new Error("StreamMiddleware - Unknown response id ".concat(e.id));delete t[e.id],Object.assign(r.res,e),setTimeout(r.end)}(e):function(t){r.emit("notification",t)}(e)}catch(t){o=t}n(o)}}),r=new i;return{events:r,middleware:function(r,i,n,o){e.push(r),t[r.id]={req:r,res:i,next:n,end:o}},stream:e}}},function(t,e,r){r(82);var i=r(22);t.exports=function(t){Object(u.a)(r,t);var e=Object(f.a)(r);function r(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(a.a)(this,r),(t=e.call(this))._state=i,t}return Object(h.a)(r,[{key:"getState",value:function(){return this._getState()}},{key:"putState",value:function(t){this._putState(t),this.emit("update",t)}},{key:"updateState",value:function(t){if(t&&"object"==typeof t){var e=this.getState(),r=Object.assign({},e,t);this.putState(r)}else this.putState(t)}},{key:"subscribe",value:function(t){this.on("update",t)}},{key:"unsubscribe",value:function(t){this.removeListener("update",t)}},{key:"_getState",value:function(){return this._state}},{key:"_putState",value:function(t){this._state=t}}]),r}(i)},function(t,e,r){var i=r(61).Duplex;t.exports=function(t){return new s(t)};var s=function(t){Object(u.a)(r,t);var e=Object(f.a)(r);function r(t){var i;return Object(a.a)(this,r),(i=e.call(this,{objectMode:!0})).resume(),i.handler=function(t){return i.push(t)},i.obsStore=t,i.obsStore.subscribe(i.handler),i}return Object(h.a)(r,[{key:"pipe",value:function(t,e){var r=i.prototype.pipe.call(this,t,e);return t.write(this.obsStore.getState()),r}},{key:"_write",value:function(t,e,r){this.obsStore.putState(t),r()}},{key:"_read",value:function(t){}},{key:"_destroy",value:function(t,e){this.obsStore.unsubscribe(this.handler),Object(n.a)(Object(o.a)(r.prototype),"_destroy",this).call(this,t,e)}}]),r}(i)},function(t,e){t.exports=N},function(t,e,r){var i=r(101),n=r.n(i),o=function(t,e){var r={};return t.algorithms.forEach((function(t){r[t]=function(t,e){return n()(t).update(e,"utf8").digest("base64")}(t,e)})),r};e.a=function(t,e){var r=function(t){return{algorithms:t.algorithms||["sha256"],delimiter:t.delimiter||" ",full:t.full||!1}}(t),i={hashes:o(r,e),integrity:void 0};return i.integrity=function(t,e){return""+Object.keys(e.hashes).map((function(t){return"".concat(t,"-").concat(e.hashes[t])})).join(t.delimiter)}(r,i),r.full?i:i.integrity}},function(t,e,r){var i=r(4),n=r(200),o=r(201),s=r(202),a=r(207);function h(t){a.call(this,"digest"),this._hash=t}i(h,a),h.prototype._update=function(t){this._hash.update(t)},h.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new n:"rmd160"===t||"ripemd160"===t?new o:new h(s(t))}},function(t,e,r){r.d(e,"a",(function(){return p}));var i=r(3),n=r.n(i),o=r(9),s=r.n(o),a=r(2),h=r.n(a),u=r(37).a.errors,f=function(t){return fetch(t,{method:"HEAD",mode:"same-origin"}).then((function(t){return 200===t.status})).catch((function(t){return!1}))},l=function(t){var e=t.document,r=e.querySelector('head > meta[property="og:site_name"]');if(r)return r.content;var i=e.querySelector('head > meta[name="title"]');return i?i.content:e.title&&e.title.length>0?e.title:t.location.hostname},c=function(){var t=s()(n.a.mark((function t(e){var r,i;return n.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.document,i=r.querySelector('head > link[rel="shortcut icon"]'),t.t0=i,!t.t0){t.next=7;break}return t.next=6,f(i.href);case 6:t.t0=t.sent;case 7:if(!t.t0){t.next=9;break}return t.abrupt("return",i.href);case 9:if(i=Array.from(r.querySelectorAll('head > link[rel="icon"]')).find((function(t){return Boolean(t.href)})),t.t1=i,!t.t1){t.next=15;break}return t.next=14,f(i.href);case 14:t.t1=t.sent;case 15:if(!t.t1){t.next=17;break}return t.abrupt("return",i.href);case 17:return t.abrupt("return",null);case 18:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),d=function(){var t=s()(n.a.mark((function t(){return n.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=l(window),t.next=3,c(window);case 3:return t.t1=t.sent,t.abrupt("return",{name:t.t0,icon:t.t1});case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),p=function(){var t=s()(n.a.mark((function t(e){var r;return n.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,d();case 3:r=t.sent,e.handle({method:"wallet_sendDomainMetadata",domainMetadata:r},(function(){})),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),h.a.error({message:u.sendSiteMetadata(),originalError:t.t0});case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e){return t.apply(this,arguments)}}()},function(t,e,r){r.d(e,"a",(function(){return a}));var i=r(47),n=r.n(i),o=r(32),s=r.n(o),a=function(t){var e=new n.a;return e.getStream=function(t){return this._substreams[t]?this._substreams[t]:this.createStream(t)},s()(t,e,t,(function(t){t&&console.error(t)})),e}},function(t,e,r){r.r(e);var i=r(88);e.default=i.a},function(t,e,r){e.byteLength=function(t){var e=u(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,i=u(t),s=i[0],a=i[1],h=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),f=0,l=a>0?s-4:s;for(r=0;r>16&255,h[f++]=e>>8&255,h[f++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,h[f++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,h[f++]=e>>8&255,h[f++]=255&e),h},e.fromByteArray=function(t){for(var e,r=t.length,n=r%3,o=[],s=0,a=r-n;sa?a:s+16383));return 1===n?(e=t[r-1],o.push(i[e>>2]+i[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],o.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"=")),o.join("")};for(var i=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,h=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var n,o,s=[],a=e;a>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,i,n){var o,s,a=8*n-i-1,h=(1<>1,f=-7,l=r?n-1:0,c=r?-1:1,d=t[e+l];for(l+=c,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+t[e+l],l+=c,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=i;f>0;s=256*s+t[e+l],l+=c,f-=8);if(0===o)o=1-u;else{if(o===h)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),o-=u}return(d?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,r,i,n,o){var s,a,h,u=8*o-n-1,f=(1<>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-s))<1&&(s--,h*=2),(e+=s+l>=1?c/h:c*Math.pow(2,1-l))*h>=2&&(s++,h/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*h-1)*Math.pow(2,n),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,n),s=0));n>=8;t[r+d]=255&a,d+=p,a/=256,n-=8);for(s=s<0;t[r+d]=255&s,d+=p,s/=256,u-=8);t[r+d-p]|=128*m}},function(t,e){},function(t,e,r){var i=r(49).Buffer,n=r(109);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;for(var e,r,n=i.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=n,r=s,o.data.copy(e,r),s+=o.data.length,o=o.next;return n},t}(),n&&n.inspect&&n.inspect.custom&&(t.exports.prototype[n.inspect.custom]=function(){var t=n.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,r){(function(t,e){!function(t,r){if(!t.setImmediate){var i,n,o,s,a,h=1,u={},f=!1,l=t.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(t);c=c&&c.setTimeout?c:t,"[object process]"==={}.toString.call(t.process)?i=function(){var t=d(arguments);return e.nextTick(p(m,t)),t}:function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&m(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),i=function(){var e=d(arguments);return t.postMessage(s+e,"*"),e}):t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){m(t.data)},i=function(){var t=d(arguments);return o.port2.postMessage(t),t}):l&&"onreadystatechange"in l.createElement("script")?(n=l.documentElement,i=function(){var t=d(arguments),e=l.createElement("script");return e.onreadystatechange=function(){m(t),e.onreadystatechange=null,n.removeChild(e),e=null},n.appendChild(e),t}):i=function(){var t=d(arguments);return setTimeout(p(m,t),0),t},c.setImmediate=i,c.clearImmediate=v}function d(t){return u[h]=p.apply(void 0,t),h++}function p(t){var e=[].slice.call(arguments,1);return function(){"function"==typeof t?t.apply(void 0,e):new Function(""+t)()}}function m(t){if(f)setTimeout(p(m,t),0);else{var e=u[t];if(e){f=!0;try{e()}finally{v(t),f=!1}}}}function v(t){delete u[t]}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,r(7),r(11))},function(t,e,r){(function(e){function r(t){try{if(!e.localStorage)return!1}catch(t){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(t,e){if(r("noDeprecation"))return t;var i=!1;return function(){if(!i){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}}}).call(this,r(7))},function(t,e,r){var i=r(12),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=s),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},function(t,e,r){t.exports=o;var i=r(71),n=Object.create(r(33));function o(t){if(!(this instanceof o))return new o(t);i.call(this,t)}n.inherits=r(4),n.inherits(o,i),o.prototype._transform=function(t,e,r){r(null,t)}},function(t,e){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e,r){var i=r(117),n=r(42),o=r(142),s=r(161),a=r(162),h=r(163),u=r(164),f=r(165),l=r(166),c=r(167),d=r(5),p=r(35),m=r(168),v=r(169),g=r(26),y=r(170),b=r(188),w=r(34);function M(t){this._requestManager=new i(t),this.currentProvider=t,this.eth=new o(this),this.db=new s(this),this.shh=new a(this),this.net=new h(this),this.personal=new u(this),this.bzz=new f(this),this.settings=new l,this.version={api:c.version},this.providers={HttpProvider:y,IpcProvider:b},this._extend=m(this),this._extend({properties:_()})}M.providers={HttpProvider:y,IpcProvider:b},M.prototype.setProvider=function(t){this._requestManager.setProvider(t),this.currentProvider=t},M.prototype.reset=function(t){this._requestManager.reset(t),this.settings=new l},M.prototype.BigNumber=w,M.prototype.toHex=d.toHex,M.prototype.toAscii=d.toAscii,M.prototype.toUtf8=d.toUtf8,M.prototype.fromAscii=d.fromAscii,M.prototype.fromUtf8=d.fromUtf8,M.prototype.toDecimal=d.toDecimal,M.prototype.fromDecimal=d.fromDecimal,M.prototype.toBigNumber=d.toBigNumber,M.prototype.toWei=d.toWei,M.prototype.fromWei=d.fromWei,M.prototype.isAddress=d.isAddress,M.prototype.isChecksumAddress=d.isChecksumAddress,M.prototype.toChecksumAddress=d.toChecksumAddress,M.prototype.isIBAN=d.isIBAN,M.prototype.padLeft=d.padLeft,M.prototype.padRight=d.padRight,M.prototype.sha3=function(t,e){return"0x"+p(t,e)},M.prototype.fromICAP=function(t){return new n(t).address()};var _=function(){return[new g({name:"version.node",getter:"web3_clientVersion"}),new g({name:"version.network",getter:"net_version",inputFormatter:d.toDecimal}),new g({name:"version.ethereum",getter:"eth_protocolVersion",inputFormatter:d.toDecimal}),new g({name:"version.whisper",getter:"shh_version",inputFormatter:d.toDecimal})]};M.prototype.isConnected=function(){return this.currentProvider&&this.currentProvider.isConnected()},M.prototype.createBatch=function(){return new v(this)},t.exports=M},function(t,e,r){var i=r(73),n=r(5),o=r(41),s=r(25),a=function(t){this.provider=t,this.polls={},this.timeout=null};a.prototype.send=function(t){if(!this.provider)return console.error(s.InvalidProvider()),null;var e=i.toPayload(t.method,t.params),r=this.provider.send(e);if(!i.isValidResponse(r))throw s.InvalidResponse(r);return r.result},a.prototype.sendAsync=function(t,e){if(!this.provider)return e(s.InvalidProvider());var r=i.toPayload(t.method,t.params);this.provider.sendAsync(r,(function(t,r){return t?e(t):i.isValidResponse(r)?void e(null,r.result):e(s.InvalidResponse(r))}))},a.prototype.sendBatch=function(t,e){if(!this.provider)return e(s.InvalidProvider());var r=i.toBatchPayload(t);this.provider.sendAsync(r,(function(t,r){return t?e(t):n.isArray(r)?void e(t,r):e(s.InvalidResponse(r))}))},a.prototype.setProvider=function(t){this.provider=t},a.prototype.startPolling=function(t,e,r,i){this.polls[e]={data:t,id:e,callback:r,uninstall:i},this.timeout||this.poll()},a.prototype.stopPolling=function(t){delete this.polls[t],0===Object.keys(this.polls).length&&this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},a.prototype.reset=function(t){for(var e in this.polls)t&&-1!==e.indexOf("syncPoll_")||(this.polls[e].uninstall(),delete this.polls[e]);0===Object.keys(this.polls).length&&this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},a.prototype.poll=function(){if(this.timeout=setTimeout(this.poll.bind(this),o.ETH_POLLING_TIMEOUT),0!==Object.keys(this.polls).length)if(this.provider){var t=[],e=[];for(var r in this.polls)t.push(this.polls[r].data),e.push(r);if(0!==t.length){var a=i.toBatchPayload(t),h={};a.forEach((function(t,r){h[t.id]=e[r]}));var u=this;this.provider.sendAsync(a,(function(t,e){if(!t){if(!n.isArray(e))throw s.InvalidResponse(e);e.map((function(t){var e=h[t.id];return!!u.polls[e]&&(t.callback=u.polls[e].callback,t)})).filter((function(t){return!!t})).filter((function(t){var e=i.isValidResponse(t);return e||t.callback(s.InvalidResponse(t)),e})).forEach((function(t){t.callback(null,t.result)}))}}))}}else console.error(s.InvalidProvider())},t.exports=a},function(t,e,r){var i;t.exports=(i=r(1),r(40),r(119),r(120),r(23),r(24),r(52),r(74),r(121),r(75),r(122),r(76),r(123),r(53),r(124),r(20),r(6),r(125),r(126),r(127),r(128),r(129),r(130),r(131),r(132),r(133),r(134),r(135),r(136),r(137),r(138),r(139),r(140),i)},function(t,e,r){var i;t.exports=(i=r(1),function(){if("function"==typeof ArrayBuffer){var t=i.lib.WordArray,e=t.init;(t.init=function(t){if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),(t instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),t instanceof Uint8Array){for(var r=t.byteLength,i=[],n=0;n>>2]|=t[n]<<24-n%4*8;e.call(this,i,r)}else e.apply(this,arguments)}).prototype=t}}(),i.lib.WordArray)},function(t,e,r){var i;t.exports=(i=r(1),function(){var t=i,e=t.lib.WordArray,r=t.enc;function n(t){return t<<8&4278255360|t>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n>>2]>>>16-n%4*8&65535;i.push(String.fromCharCode(o))}return i.join("")},parse:function(t){for(var r=t.length,i=[],n=0;n>>1]|=t.charCodeAt(n)<<16-n%2*16;return e.create(i,2*r)}},r.Utf16LE={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],o=0;o>>2]>>>16-o%4*8&65535);i.push(String.fromCharCode(s))}return i.join("")},parse:function(t){for(var r=t.length,i=[],o=0;o>>1]|=n(t.charCodeAt(o)<<16-o%2*16);return e.create(i,2*r)}}}(),i.enc.Utf16)},function(t,e,r){var i,n,o,s,a,h;t.exports=(h=r(1),r(74),n=(i=h).lib.WordArray,o=i.algo,s=o.SHA256,a=o.SHA224=s.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=s._doFinalize.call(this);return t.sigBytes-=4,t}}),i.SHA224=s._createHelper(a),i.HmacSHA224=s._createHmacHelper(a),h.SHA224)},function(t,e,r){var i,n,o,s,a,h,u,f;t.exports=(f=r(1),r(40),r(75),n=(i=f).x64,o=n.Word,s=n.WordArray,a=i.algo,h=a.SHA512,u=a.SHA384=h.extend({_doReset:function(){this._hash=new s.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var t=h._doFinalize.call(this);return t.sigBytes-=16,t}}),i.SHA384=h._createHelper(u),i.HmacSHA384=h._createHmacHelper(u),f.SHA384)},function(t,e,r){var i;t.exports=(i=r(1),function(t){var e=i,r=e.lib,n=r.WordArray,o=r.Hasher,s=e.algo,a=n.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),h=n.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),u=n.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=n.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),l=n.create([0,1518500249,1859775393,2400959708,2840853838]),c=n.create([1352829926,1548603684,1836072691,2053994217,0]),d=s.RIPEMD160=o.extend({_doReset:function(){this._hash=n.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var i=e+r,n=t[i];t[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var o,s,d,w,M,_,S,x,k,A,E,B=this._hash.words,O=l.words,R=c.words,I=a.words,T=h.words,j=u.words,C=f.words;for(_=o=B[0],S=s=B[1],x=d=B[2],k=w=B[3],A=M=B[4],r=0;r<80;r+=1)E=o+t[e+I[r]]|0,E+=r<16?p(s,d,w)+O[0]:r<32?m(s,d,w)+O[1]:r<48?v(s,d,w)+O[2]:r<64?g(s,d,w)+O[3]:y(s,d,w)+O[4],E=(E=b(E|=0,j[r]))+M|0,o=M,M=w,w=b(d,10),d=s,s=E,E=_+t[e+T[r]]|0,E+=r<16?y(S,x,k)+R[0]:r<32?g(S,x,k)+R[1]:r<48?v(S,x,k)+R[2]:r<64?m(S,x,k)+R[3]:p(S,x,k)+R[4],E=(E=b(E|=0,C[r]))+A|0,_=A,A=k,k=b(x,10),x=S,S=E;E=B[1]+d+k|0,B[1]=B[2]+w+A|0,B[2]=B[3]+M+_|0,B[3]=B[4]+o+S|0,B[4]=B[0]+s+x|0,B[0]=E},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process();for(var n=this._hash,o=n.words,s=0;s<5;s++){var a=o[s];o[s]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return n},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function p(t,e,r){return t^e^r}function m(t,e,r){return t&e|~t&r}function v(t,e,r){return(t|~e)^r}function g(t,e,r){return t&r|e&~r}function y(t,e,r){return t^(e|~r)}function b(t,e){return t<>>32-e}e.RIPEMD160=o._createHelper(d),e.HmacRIPEMD160=o._createHmacHelper(d)}(),i.RIPEMD160)},function(t,e,r){var i,n,o,s,a,h,u,f,l;t.exports=(l=r(1),r(52),r(53),o=(n=(i=l).lib).Base,s=n.WordArray,h=(a=i.algo).SHA1,u=a.HMAC,f=a.PBKDF2=o.extend({cfg:o.extend({keySize:4,hasher:h,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r=this.cfg,i=u.create(r.hasher,t),n=s.create(),o=s.create([1]),a=n.words,h=o.words,f=r.keySize,l=r.iterations;a.length>24&255)){var e=t>>16&255,r=t>>8&255,i=255&t;255===e?(e=0,255===r?(r=0,255===i?i=0:++i):++r):++e,t=0,t+=e<<16,t+=r<<8,t+=i}else t+=1<<24;return t}var r=t.Encryptor=t.extend({processBlock:function(t,r){var i=this._cipher,n=i.blockSize,o=this._iv,s=this._counter;o&&(s=this._counter=o.slice(0),this._iv=void 0),function(t){0===(t[0]=e(t[0]))&&(t[1]=e(t[1]))}(s);var a=s.slice(0);i.encryptBlock(a,0);for(var h=0;h>>2]|=n<<24-o%4*8,t.sigBytes+=n},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},i.pad.Ansix923)},function(t,e,r){var i;t.exports=(i=r(1),r(6),i.pad.Iso10126={pad:function(t,e){var r=4*e,n=r-t.sigBytes%r;t.concat(i.lib.WordArray.random(n-1)).concat(i.lib.WordArray.create([n<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},i.pad.Iso10126)},function(t,e,r){var i;t.exports=(i=r(1),r(6),i.pad.Iso97971={pad:function(t,e){t.concat(i.lib.WordArray.create([2147483648],1)),i.pad.ZeroPadding.pad(t,e)},unpad:function(t){i.pad.ZeroPadding.unpad(t),t.sigBytes--}},i.pad.Iso97971)},function(t,e,r){var i;t.exports=(i=r(1),r(6),i.pad.ZeroPadding={pad:function(t,e){var r=4*e;t.clamp(),t.sigBytes+=r-(t.sigBytes%r||r)},unpad:function(t){for(var e=t.words,r=t.sigBytes-1;!(e[r>>>2]>>>24-r%4*8&255);)r--;t.sigBytes=r+1}},i.pad.ZeroPadding)},function(t,e,r){var i;t.exports=(i=r(1),r(6),i.pad.NoPadding={pad:function(){},unpad:function(){}},i.pad.NoPadding)},function(t,e,r){var i,n,o,s;t.exports=(s=r(1),r(6),n=(i=s).lib.CipherParams,o=i.enc.Hex,i.format.Hex={stringify:function(t){return t.ciphertext.toString(o)},parse:function(t){var e=o.parse(t);return n.create({ciphertext:e})}},s.format.Hex)},function(t,e,r){var i;t.exports=(i=r(1),r(23),r(24),r(20),r(6),function(){var t=i,e=t.lib.BlockCipher,r=t.algo,n=[],o=[],s=[],a=[],h=[],u=[],f=[],l=[],c=[],d=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var r=0,i=0;for(e=0;e<256;e++){var p=i^i<<1^i<<2^i<<3^i<<4;p=p>>>8^255&p^99,n[r]=p,o[p]=r;var m=t[r],v=t[m],g=t[v],y=257*t[p]^16843008*p;s[r]=y<<24|y>>>8,a[r]=y<<16|y>>>16,h[r]=y<<8|y>>>24,u[r]=y,y=16843009*g^65537*v^257*m^16843008*r,f[p]=y<<24|y>>>8,l[p]=y<<16|y>>>16,c[p]=y<<8|y>>>24,d[p]=y,r?(r=m^t[t[t[g^m]]],i^=t[t[i]]):r=i=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],m=r.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,r=t.sigBytes/4,i=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],s=0;s6&&s%r==4&&(a=n[a>>>24]<<24|n[a>>>16&255]<<16|n[a>>>8&255]<<8|n[255&a]):(a=n[(a=a<<8|a>>>24)>>>24]<<24|n[a>>>16&255]<<16|n[a>>>8&255]<<8|n[255&a],a^=p[s/r|0]<<24),o[s]=o[s-r]^a}for(var h=this._invKeySchedule=[],u=0;u>>24]]^l[n[a>>>16&255]]^c[n[a>>>8&255]]^d[n[255&a]]}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,s,a,h,u,n)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,f,l,c,d,o),r=t[e+1],t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,i,n,o,s,a){for(var h=this._nRounds,u=t[e]^r[0],f=t[e+1]^r[1],l=t[e+2]^r[2],c=t[e+3]^r[3],d=4,p=1;p>>24]^n[f>>>16&255]^o[l>>>8&255]^s[255&c]^r[d++],v=i[f>>>24]^n[l>>>16&255]^o[c>>>8&255]^s[255&u]^r[d++],g=i[l>>>24]^n[c>>>16&255]^o[u>>>8&255]^s[255&f]^r[d++],y=i[c>>>24]^n[u>>>16&255]^o[f>>>8&255]^s[255&l]^r[d++];u=m,f=v,l=g,c=y}m=(a[u>>>24]<<24|a[f>>>16&255]<<16|a[l>>>8&255]<<8|a[255&c])^r[d++],v=(a[f>>>24]<<24|a[l>>>16&255]<<16|a[c>>>8&255]<<8|a[255&u])^r[d++],g=(a[l>>>24]<<24|a[c>>>16&255]<<16|a[u>>>8&255]<<8|a[255&f])^r[d++],y=(a[c>>>24]<<24|a[u>>>16&255]<<16|a[f>>>8&255]<<8|a[255&l])^r[d++],t[e]=m,t[e+1]=v,t[e+2]=g,t[e+3]=y},keySize:8});t.AES=e._createHelper(m)}(),i.AES)},function(t,e,r){var i;t.exports=(i=r(1),r(23),r(24),r(20),r(6),function(){var t=i,e=t.lib,r=e.WordArray,n=e.BlockCipher,o=t.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],h=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],f=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],l=o.DES=n.extend({_doReset:function(){for(var t=this._key.words,e=[],r=0;r<56;r++){var i=s[r]-1;e[r]=t[i>>>5]>>>31-i%32&1}for(var n=this._subKeys=[],o=0;o<16;o++){var u=n[o]=[],f=h[o];for(r=0;r<24;r++)u[r/6|0]|=e[(a[r]-1+f)%28]<<31-r%6,u[4+(r/6|0)]|=e[28+(a[r+24]-1+f)%28]<<31-r%6;for(u[0]=u[0]<<1|u[0]>>>31,r=1;r<7;r++)u[r]=u[r]>>>4*(r-1)+3;u[7]=u[7]<<5|u[7]>>>27}var l=this._invSubKeys=[];for(r=0;r<16;r++)l[r]=n[15-r]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,r){this._lBlock=t[e],this._rBlock=t[e+1],c.call(this,4,252645135),c.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),c.call(this,1,1431655765);for(var i=0;i<16;i++){for(var n=r[i],o=this._lBlock,s=this._rBlock,a=0,h=0;h<8;h++)a|=u[h][((s^n[h])&f[h])>>>0];this._lBlock=s,this._rBlock=o^a}var l=this._lBlock;this._lBlock=this._rBlock,this._rBlock=l,c.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),c.call(this,16,65535),c.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function c(t,e){var r=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=r,this._lBlock^=r<>>t^this._lBlock)&e;this._lBlock^=r,this._rBlock^=r<>>2]>>>24-s%4*8&255;o=(o+i[n]+a)%256;var h=i[n];i[n]=i[o],i[o]=h}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var t=this._S,e=this._i,r=this._j,i=0,n=0;n<4;n++){r=(r+t[e=(e+1)%256])%256;var o=t[e];t[e]=t[r],t[r]=o,i|=t[(t[e]+t[r])%256]<<24-8*n}return this._i=e,this._j=r,i}t.RC4=e._createHelper(n);var s=r.RC4Drop=n.extend({cfg:n.cfg.extend({drop:192}),_doReset:function(){n._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)o.call(this)}});t.RC4Drop=e._createHelper(s)}(),i.RC4)},function(t,e,r){var i;t.exports=(i=r(1),r(23),r(24),r(20),r(6),function(){var t=i,e=t.lib.StreamCipher,r=t.algo,n=[],o=[],s=[],a=r.Rabbit=e.extend({_doReset:function(){for(var t=this._key.words,e=this.cfg.iv,r=0;r<4;r++)t[r]=16711935&(t[r]<<8|t[r]>>>24)|4278255360&(t[r]<<24|t[r]>>>8);var i=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],n=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];for(this._b=0,r=0;r<4;r++)h.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(e){var o=e.words,s=o[0],a=o[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=u>>>16|4294901760&f,c=f<<16|65535&u;for(n[0]^=u,n[1]^=l,n[2]^=f,n[3]^=c,n[4]^=u,n[5]^=l,n[6]^=f,n[7]^=c,r=0;r<4;r++)h.call(this)}},_doProcessBlock:function(t,e){var r=this._X;h.call(this),n[0]=r[0]^r[5]>>>16^r[3]<<16,n[1]=r[2]^r[7]>>>16^r[5]<<16,n[2]=r[4]^r[1]>>>16^r[7]<<16,n[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)n[i]=16711935&(n[i]<<8|n[i]>>>24)|4278255360&(n[i]<<24|n[i]>>>8),t[e+i]^=n[i]},blockSize:4,ivSize:2});function h(){for(var t=this._X,e=this._C,r=0;r<8;r++)o[r]=e[r];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0,r=0;r<8;r++){var i=t[r]+e[r],n=65535&i,a=i>>>16,h=((n*n>>>17)+n*a>>>15)+a*a,u=((4294901760&i)*i|0)+((65535&i)*i|0);s[r]=h^u}t[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,t[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,t[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,t[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,t[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,t[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,t[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,t[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}t.Rabbit=e._createHelper(a)}(),i.Rabbit)},function(t,e,r){var i;t.exports=(i=r(1),r(23),r(24),r(20),r(6),function(){var t=i,e=t.lib.StreamCipher,r=t.algo,n=[],o=[],s=[],a=r.RabbitLegacy=e.extend({_doReset:function(){var t=this._key.words,e=this.cfg.iv,r=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],i=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var n=0;n<4;n++)h.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(e){var o=e.words,s=o[0],a=o[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=u>>>16|4294901760&f,c=f<<16|65535&u;for(i[0]^=u,i[1]^=l,i[2]^=f,i[3]^=c,i[4]^=u,i[5]^=l,i[6]^=f,i[7]^=c,n=0;n<4;n++)h.call(this)}},_doProcessBlock:function(t,e){var r=this._X;h.call(this),n[0]=r[0]^r[5]>>>16^r[3]<<16,n[1]=r[2]^r[7]>>>16^r[5]<<16,n[2]=r[4]^r[1]>>>16^r[7]<<16,n[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)n[i]=16711935&(n[i]<<8|n[i]>>>24)|4278255360&(n[i]<<24|n[i]>>>8),t[e+i]^=n[i]},blockSize:4,ivSize:2});function h(){for(var t=this._X,e=this._C,r=0;r<8;r++)o[r]=e[r];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0,r=0;r<8;r++){var i=t[r]+e[r],n=65535&i,a=i>>>16,h=((n*n>>>17)+n*a>>>15)+a*a,u=((4294901760&i)*i|0)+((65535&i)*i|0);s[r]=h^u}t[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,t[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,t[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,t[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,t[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,t[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,t[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,t[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}t.RabbitLegacy=e._createHelper(a)}(),i.RabbitLegacy)},function(t,e,r){(function(t,i){var n;!function(o){var s=(t&&t.exports,"object"==typeof i&&i);s.global!==s&&s.window;var a,h,u,f=String.fromCharCode;function l(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n=55296&&t<=57343)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function d(t,e){return f(t>>e&63|128)}function p(t){if(0==(4294967168&t))return f(t);var e="";return 0==(4294965248&t)?e=f(t>>6&31|192):0==(4294901760&t)?(c(t),e=f(t>>12&15|224),e+=d(t,6)):0==(4292870144&t)&&(e=f(t>>18&7|240),e+=d(t,12),e+=d(t,6)),e+f(63&t|128)}function m(){if(u>=h)throw Error("Invalid byte index");var t=255&a[u];if(u++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function v(){var t,e;if(u>h)throw Error("Invalid byte index");if(u==h)return!1;if(t=255&a[u],u++,0==(128&t))return t;if(192==(224&t)){if((e=(31&t)<<6|m())>=128)return e;throw Error("Invalid continuation byte")}if(224==(240&t)){if((e=(15&t)<<12|m()<<6|m())>=2048)return c(e),e;throw Error("Invalid continuation byte")}if(240==(248&t)&&(e=(7&t)<<18|m()<<12|m()<<6|m())>=65536&&e<=1114111)return e;throw Error("Invalid UTF-8 detected")}var g={version:"2.1.2",encode:function(t){for(var e=l(t),r=e.length,i=-1,n="";++i65535&&(n+=f((e-=65536)>>>10&1023|55296),e=56320|1023&e),n+=f(e);return n}(r)}};void 0===(n=function(){return g}.call(e,r,e,t))||(t.exports=n)}()}).call(this,r(54)(t),r(7))},function(t,e,r){var i=r(18),n=r(5),o=r(21),s=r(26),a=r(41),h=r(143),u=r(44),f=r(43),l=r(155),c=r(156),d=r(42),p=r(159),m=function(t){return n.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getBlockByHash":"eth_getBlockByNumber"},v=function(t){return n.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getTransactionByBlockHashAndIndex":"eth_getTransactionByBlockNumberAndIndex"},g=function(t){return n.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getUncleByBlockHashAndIndex":"eth_getUncleByBlockNumberAndIndex"},y=function(t){return n.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getBlockTransactionCountByHash":"eth_getBlockTransactionCountByNumber"},b=function(t){return n.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getUncleCountByBlockHash":"eth_getUncleCountByBlockNumber"};function w(t){this._requestManager=t._requestManager;var e=this;M().forEach((function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)})),_().forEach((function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)})),this.iban=d,this.sendIBANTransaction=p.bind(null,this)}Object.defineProperty(w.prototype,"defaultBlock",{get:function(){return a.defaultBlock},set:function(t){return a.defaultBlock=t,t}}),Object.defineProperty(w.prototype,"defaultAccount",{get:function(){return a.defaultAccount},set:function(t){return a.defaultAccount=t,t}});var M=function(){var t=new o({name:"getBalance",call:"eth_getBalance",params:2,inputFormatter:[i.inputAddressFormatter,i.inputDefaultBlockNumberFormatter],outputFormatter:i.outputBigNumberFormatter}),e=new o({name:"getStorageAt",call:"eth_getStorageAt",params:3,inputFormatter:[null,n.toHex,i.inputDefaultBlockNumberFormatter]}),r=new o({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[i.inputAddressFormatter,i.inputDefaultBlockNumberFormatter]}),s=new o({name:"getBlock",call:m,params:2,inputFormatter:[i.inputBlockNumberFormatter,function(t){return!!t}],outputFormatter:i.outputBlockFormatter}),a=new o({name:"getUncle",call:g,params:2,inputFormatter:[i.inputBlockNumberFormatter,n.toHex],outputFormatter:i.outputBlockFormatter}),h=new o({name:"getCompilers",call:"eth_getCompilers",params:0}),u=new o({name:"getBlockTransactionCount",call:y,params:1,inputFormatter:[i.inputBlockNumberFormatter],outputFormatter:n.toDecimal}),f=new o({name:"getBlockUncleCount",call:b,params:1,inputFormatter:[i.inputBlockNumberFormatter],outputFormatter:n.toDecimal}),l=new o({name:"getTransaction",call:"eth_getTransactionByHash",params:1,outputFormatter:i.outputTransactionFormatter}),c=new o({name:"getTransactionFromBlock",call:v,params:2,inputFormatter:[i.inputBlockNumberFormatter,n.toHex],outputFormatter:i.outputTransactionFormatter}),d=new o({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,outputFormatter:i.outputTransactionReceiptFormatter}),p=new o({name:"getTransactionCount",call:"eth_getTransactionCount",params:2,inputFormatter:[null,i.inputDefaultBlockNumberFormatter],outputFormatter:n.toDecimal}),w=new o({name:"sendRawTransaction",call:"eth_sendRawTransaction",params:1,inputFormatter:[null]}),M=new o({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[i.inputTransactionFormatter]}),_=new o({name:"signTransaction",call:"eth_signTransaction",params:1,inputFormatter:[i.inputTransactionFormatter]}),S=new o({name:"sign",call:"eth_sign",params:2,inputFormatter:[i.inputAddressFormatter,null]});return[t,e,r,s,a,h,u,f,l,c,d,p,new o({name:"call",call:"eth_call",params:2,inputFormatter:[i.inputCallFormatter,i.inputDefaultBlockNumberFormatter]}),new o({name:"estimateGas",call:"eth_estimateGas",params:1,inputFormatter:[i.inputCallFormatter],outputFormatter:n.toDecimal}),w,_,M,S,new o({name:"compile.solidity",call:"eth_compileSolidity",params:1}),new o({name:"compile.lll",call:"eth_compileLLL",params:1}),new o({name:"compile.serpent",call:"eth_compileSerpent",params:1}),new o({name:"submitWork",call:"eth_submitWork",params:3}),new o({name:"getWork",call:"eth_getWork",params:0})]},_=function(){return[new s({name:"coinbase",getter:"eth_coinbase"}),new s({name:"mining",getter:"eth_mining"}),new s({name:"hashrate",getter:"eth_hashrate",outputFormatter:n.toDecimal}),new s({name:"syncing",getter:"eth_syncing",outputFormatter:i.outputSyncingFormatter}),new s({name:"gasPrice",getter:"eth_gasPrice",outputFormatter:i.outputBigNumberFormatter}),new s({name:"accounts",getter:"eth_accounts"}),new s({name:"blockNumber",getter:"eth_blockNumber",outputFormatter:n.toDecimal}),new s({name:"protocolVersion",getter:"eth_protocolVersion"})]};w.prototype.contract=function(t){return new h(this,t)},w.prototype.filter=function(t,e,r){return new f(t,"eth",this._requestManager,u.eth(),i.outputLogFormatter,e,r)},w.prototype.namereg=function(){return this.contract(c.global.abi).at(c.global.address)},w.prototype.icapNamereg=function(){return this.contract(c.icap.abi).at(c.icap.address)},w.prototype.isSyncing=function(t){return new l(this._requestManager,t)},t.exports=w},function(t,e,r){var i=r(5),n=r(55),o=r(78),s=r(153),a=r(154),h=function(t,e){return t.filter((function(t){return"constructor"===t.type&&t.inputs.length===e.length})).map((function(t){return t.inputs.map((function(t){return t.type}))})).map((function(t){return n.encodeParams(t,e)}))[0]||""},u=function(t){t.abi.filter((function(t){return"function"===t.type})).map((function(e){return new s(t._eth,e,t.address)})).forEach((function(e){e.attachToContract(t)}))},f=function(t){var e=t.abi.filter((function(t){return"event"===t.type}));new a(t._eth._requestManager,e,t.address).attachToContract(t),e.map((function(e){return new o(t._eth._requestManager,e,t.address)})).forEach((function(e){e.attachToContract(t)}))},l=function(t,e){var r=0,i=!1,n=t._eth.filter("latest",(function(o){if(!o&&!i)if(++r>50){if(n.stopWatching((function(){})),i=!0,!e)throw new Error("Contract transaction couldn't be found after 50 blocks");e(new Error("Contract transaction couldn't be found after 50 blocks"))}else t._eth.getTransactionReceipt(t.transactionHash,(function(r,o){o&&o.blockHash&&!i&&t._eth.getCode(o.contractAddress,(function(r,s){if(!i&&s)if(n.stopWatching((function(){})),i=!0,s.length>3)t.address=o.contractAddress,u(t),f(t),e&&e(null,t);else{if(!e)throw new Error("The contract code couldn't be stored, please check your gas amount.");e(new Error("The contract code couldn't be stored, please check your gas amount."))}}))}))}))},c=function(t,e){this.eth=t,this.abi=e,this.new=function(){var t,r=new d(this.eth,this.abi),n={},o=Array.prototype.slice.call(arguments);i.isFunction(o[o.length-1])&&(t=o.pop());var s=o[o.length-1];if(i.isObject(s)&&!i.isArray(s)&&(n=o.pop()),n.value>0){var a=e.filter((function(t){return"constructor"===t.type&&t.inputs.length===o.length}))[0]||{};if(!a.payable)throw new Error("Cannot send value to non-payable constructor")}var u=h(this.abi,o);if(n.data+=u,t)this.eth.sendTransaction(n,(function(e,i){e?t(e):(r.transactionHash=i,t(null,r),l(r,t))}));else{var f=this.eth.sendTransaction(n);r.transactionHash=f,l(r)}return r},this.new.getData=this.getData.bind(this)};c.prototype.at=function(t,e){var r=new d(this.eth,this.abi,t);return u(r),f(r),e&&e(null,r),r},c.prototype.getData=function(){var t={},e=Array.prototype.slice.call(arguments),r=e[e.length-1];i.isObject(r)&&!i.isArray(r)&&(t=e.pop());var n=h(this.abi,e);return t.data+=n,t.data};var d=function(t,e,r){this._eth=t,this.transactionHash=null,this.address=r,this.abi=e};t.exports=c},function(t,e,r){var i=r(13),n=r(16),o=function(){this._inputFormatter=i.formatInputInt,this._outputFormatter=i.formatOutputAddress};(o.prototype=new n({})).constructor=o,o.prototype.isType=function(t){return!!t.match(/address(\[([0-9]*)\])?/)},t.exports=o},function(t,e,r){var i=r(13),n=r(16),o=function(){this._inputFormatter=i.formatInputBool,this._outputFormatter=i.formatOutputBool};(o.prototype=new n({})).constructor=o,o.prototype.isType=function(t){return!!t.match(/^bool(\[([0-9]*)\])*$/)},t.exports=o},function(t,e,r){var i=r(13),n=r(16),o=function(){this._inputFormatter=i.formatInputInt,this._outputFormatter=i.formatOutputInt};(o.prototype=new n({})).constructor=o,o.prototype.isType=function(t){return!!t.match(/^int([0-9]*)?(\[([0-9]*)\])*$/)},t.exports=o},function(t,e,r){var i=r(13),n=r(16),o=function(){this._inputFormatter=i.formatInputInt,this._outputFormatter=i.formatOutputUInt};(o.prototype=new n({})).constructor=o,o.prototype.isType=function(t){return!!t.match(/^uint([0-9]*)?(\[([0-9]*)\])*$/)},t.exports=o},function(t,e,r){var i=r(13),n=r(16),o=function(){this._inputFormatter=i.formatInputDynamicBytes,this._outputFormatter=i.formatOutputDynamicBytes};(o.prototype=new n({})).constructor=o,o.prototype.isType=function(t){return!!t.match(/^bytes(\[([0-9]*)\])*$/)},o.prototype.isDynamicType=function(){return!0},t.exports=o},function(t,e,r){var i=r(13),n=r(16),o=function(){this._inputFormatter=i.formatInputString,this._outputFormatter=i.formatOutputString};(o.prototype=new n({})).constructor=o,o.prototype.isType=function(t){return!!t.match(/^string(\[([0-9]*)\])*$/)},o.prototype.isDynamicType=function(){return!0},t.exports=o},function(t,e,r){var i=r(13),n=r(16),o=function(){this._inputFormatter=i.formatInputReal,this._outputFormatter=i.formatOutputReal};(o.prototype=new n({})).constructor=o,o.prototype.isType=function(t){return!!t.match(/real([0-9]*)?(\[([0-9]*)\])?/)},t.exports=o},function(t,e,r){var i=r(13),n=r(16),o=function(){this._inputFormatter=i.formatInputReal,this._outputFormatter=i.formatOutputUReal};(o.prototype=new n({})).constructor=o,o.prototype.isType=function(t){return!!t.match(/^ureal([0-9]*)?(\[([0-9]*)\])*$/)},t.exports=o},function(t,e,r){var i=r(13),n=r(16),o=function(){this._inputFormatter=i.formatInputBytes,this._outputFormatter=i.formatOutputBytes};(o.prototype=new n({})).constructor=o,o.prototype.isType=function(t){return!!t.match(/^bytes([0-9]{1,})(\[([0-9]*)\])*$/)},t.exports=o},function(t,e,r){var i=r(55),n=r(5),o=r(25),s=r(18),a=r(35),h=function(t,e,r){this._eth=t,this._inputTypes=e.inputs.map((function(t){return t.type})),this._outputTypes=e.outputs.map((function(t){return t.type})),this._constant="view"===e.stateMutability||"pure"===e.stateMutability||e.constant,this._payable="payable"===e.stateMutability||e.payable,this._name=n.transformToFullName(e),this._address=r};h.prototype.extractCallback=function(t){if(n.isFunction(t[t.length-1]))return t.pop()},h.prototype.extractDefaultBlock=function(t){if(t.length>this._inputTypes.length&&!n.isObject(t[t.length-1]))return s.inputDefaultBlockNumberFormatter(t.pop())},h.prototype.validateArgs=function(t){if(t.filter((function(t){return!(!0===n.isObject(t)&&!1===n.isArray(t)&&!1===n.isBigNumber(t))})).length!==this._inputTypes.length)throw o.InvalidNumberOfSolidityArgs()},h.prototype.toPayload=function(t){var e={};return t.length>this._inputTypes.length&&n.isObject(t[t.length-1])&&(e=t[t.length-1]),this.validateArgs(t),e.to=this._address,e.data="0x"+this.signature()+i.encodeParams(this._inputTypes,t),e},h.prototype.signature=function(){return a(this._name).slice(0,8)},h.prototype.unpackOutput=function(t){if(t){t=t.length>=2?t.slice(2):t;var e=i.decodeParams(this._outputTypes,t);return 1===e.length?e[0]:e}},h.prototype.call=function(){var t=Array.prototype.slice.call(arguments).filter((function(t){return void 0!==t})),e=this.extractCallback(t),r=this.extractDefaultBlock(t),i=this.toPayload(t);if(!e){var n=this._eth.call(i,r);return this.unpackOutput(n)}var o=this;this._eth.call(i,r,(function(t,r){if(t)return e(t,null);var i=null;try{i=o.unpackOutput(r)}catch(e){t=e}e(t,i)}))},h.prototype.sendTransaction=function(){var t=Array.prototype.slice.call(arguments).filter((function(t){return void 0!==t})),e=this.extractCallback(t),r=this.toPayload(t);if(r.value>0&&!this._payable)throw new Error("Cannot send value to non-payable function");if(!e)return this._eth.sendTransaction(r);this._eth.sendTransaction(r,e)},h.prototype.estimateGas=function(){var t=Array.prototype.slice.call(arguments),e=this.extractCallback(t),r=this.toPayload(t);if(!e)return this._eth.estimateGas(r);this._eth.estimateGas(r,e)},h.prototype.getData=function(){var t=Array.prototype.slice.call(arguments),e=this.toPayload(t);return e.data},h.prototype.displayName=function(){return n.extractDisplayName(this._name)},h.prototype.typeName=function(){return n.extractTypeName(this._name)},h.prototype.request=function(){var t=Array.prototype.slice.call(arguments),e=this.extractCallback(t),r=this.toPayload(t),i=this.unpackOutput.bind(this);return{method:this._constant?"eth_call":"eth_sendTransaction",callback:e,params:[r],format:i}},h.prototype.execute=function(){var t=!this._constant;return t?this.sendTransaction.apply(this,Array.prototype.slice.call(arguments)):this.call.apply(this,Array.prototype.slice.call(arguments))},h.prototype.attachToContract=function(t){var e=this.execute.bind(this);e.request=this.request.bind(this),e.call=this.call.bind(this),e.sendTransaction=this.sendTransaction.bind(this),e.estimateGas=this.estimateGas.bind(this),e.getData=this.getData.bind(this);var r=this.displayName();t[r]||(t[r]=e),t[r][this.typeName()]=e},t.exports=h},function(t,e,r){var i=r(35),n=r(78),o=r(18),s=r(5),a=r(43),h=r(44),u=function(t,e,r){this._requestManager=t,this._json=e,this._address=r};u.prototype.encode=function(t){t=t||{};var e={};return["fromBlock","toBlock"].filter((function(e){return void 0!==t[e]})).forEach((function(r){e[r]=o.inputBlockNumberFormatter(t[r])})),e.address=this._address,e},u.prototype.decode=function(t){t.data=t.data||"";var e=s.isArray(t.topics)&&s.isString(t.topics[0])?t.topics[0].slice(2):"",r=this._json.filter((function(t){return e===i(s.transformToFullName(t))}))[0];return r?new n(this._requestManager,r,this._address).decode(t):o.outputLogFormatter(t)},u.prototype.execute=function(t,e){s.isFunction(arguments[arguments.length-1])&&(e=arguments[arguments.length-1],1===arguments.length&&(t=null));var r=this.encode(t),i=this.decode.bind(this);return new a(r,"eth",this._requestManager,h.eth(),i,e)},u.prototype.attachToContract=function(t){var e=this.execute.bind(this);t.allEvents=e},t.exports=u},function(t,e,r){var i=r(18),n=r(5),o=1,s=function(t,e){return this.requestManager=t,this.pollId="syncPoll_"+o++,this.callbacks=[],this.addCallback(e),this.lastSyncState=!1,function(t){t.requestManager.startPolling({method:"eth_syncing",params:[]},t.pollId,(function(e,r){if(e)return t.callbacks.forEach((function(t){t(e)}));n.isObject(r)&&r.startingBlock&&(r=i.outputSyncingFormatter(r)),t.callbacks.forEach((function(e){t.lastSyncState!==r&&(!t.lastSyncState&&n.isObject(r)&&e(null,!0),setTimeout((function(){e(null,r)}),0),t.lastSyncState=r)}))}),t.stopWatching.bind(t))}(this),this};s.prototype.addCallback=function(t){return t&&this.callbacks.push(t),this},s.prototype.stopWatching=function(){this.requestManager.stopPolling(this.pollId),this.callbacks=[]},t.exports=s},function(t,e,r){var i=r(157),n=r(158);t.exports={global:{abi:i,address:"0xc6d9d2cd449a754c494264e1809c50e34d64562b"},icap:{abi:n,address:"0xa1a111bc074c9cfa781f0c38e63bd51c91b8af00"}}},function(t){t.exports=JSON.parse('[{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"name","outputs":[{"name":"o_name","type":"bytes32"}],"type":"function"},{"constant":true,"inputs":[{"name":"_name","type":"bytes32"}],"name":"owner","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":true,"inputs":[{"name":"_name","type":"bytes32"}],"name":"content","outputs":[{"name":"","type":"bytes32"}],"type":"function"},{"constant":true,"inputs":[{"name":"_name","type":"bytes32"}],"name":"addr","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"}],"name":"reserve","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"_name","type":"bytes32"}],"name":"subRegistrar","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"},{"name":"_newOwner","type":"address"}],"name":"transfer","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"},{"name":"_registrar","type":"address"}],"name":"setSubRegistrar","outputs":[],"type":"function"},{"constant":false,"inputs":[],"name":"Registrar","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"},{"name":"_a","type":"address"},{"name":"_primary","type":"bool"}],"name":"setAddress","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"},{"name":"_content","type":"bytes32"}],"name":"setContent","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"}],"name":"disown","outputs":[],"type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_name","type":"bytes32"},{"indexed":false,"name":"_winner","type":"address"}],"name":"AuctionEnded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_name","type":"bytes32"},{"indexed":false,"name":"_bidder","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"NewBid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"name","type":"bytes32"}],"name":"Changed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"name","type":"bytes32"},{"indexed":true,"name":"addr","type":"address"}],"name":"PrimaryChanged","type":"event"}]')},function(t){t.exports=JSON.parse('[{"constant":true,"inputs":[{"name":"_name","type":"bytes32"}],"name":"owner","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"},{"name":"_refund","type":"address"}],"name":"disown","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"_name","type":"bytes32"}],"name":"addr","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"}],"name":"reserve","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"},{"name":"_newOwner","type":"address"}],"name":"transfer","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"},{"name":"_a","type":"address"}],"name":"setAddr","outputs":[],"type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"name","type":"bytes32"}],"name":"Changed","type":"event"}]')},function(t,e,r){var i=r(42),n=r(160),o=function(t,e,r,i,o,s){var a=n;return t.contract(a).at(r).deposit(o,{from:e,value:i},s)};t.exports=function(t,e,r,n,s){var a=new i(r);if(!a.isValid())throw new Error("invalid iban address");if(a.isDirect())return function(t,e,r,i,n){return t.sendTransaction({address:r,from:e,value:i},n)}(t,e,a.address(),n,s);if(!s){var h=t.icapNamereg().addr(a.institution());return o(t,e,h,n,a.client())}t.icapNamereg().addr(a.institution(),(function(r,i){return o(t,e,i,n,a.client(),s)}))}},function(t){t.exports=JSON.parse('[{"constant":false,"inputs":[{"name":"from","type":"bytes32"},{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transfer","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"from","type":"bytes32"},{"name":"to","type":"address"},{"name":"indirectId","type":"bytes32"},{"name":"value","type":"uint256"}],"name":"icapTransfer","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"to","type":"bytes32"}],"name":"deposit","outputs":[],"payable":true,"type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"AnonymousDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"bytes32"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"bytes32"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"bytes32"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"indirectId","type":"bytes32"},{"indexed":false,"name":"value","type":"uint256"}],"name":"IcapTransfer","type":"event"}]')},function(t,e,r){var i=r(21);t.exports=function(t){this._requestManager=t._requestManager;var e=this;[new i({name:"putString",call:"db_putString",params:3}),new i({name:"getString",call:"db_getString",params:2}),new i({name:"putHex",call:"db_putHex",params:3}),new i({name:"getHex",call:"db_getHex",params:2})].forEach((function(r){r.attachToObject(e),r.setRequestManager(t._requestManager)}))}},function(t,e,r){var i=r(21),n=r(43),o=r(44),s=function(t){this._requestManager=t._requestManager;var e=this;a().forEach((function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)}))};s.prototype.newMessageFilter=function(t,e,r){return new n(t,"shh",this._requestManager,o.shh(),null,e,r)};var a=function(){return[new i({name:"version",call:"shh_version",params:0}),new i({name:"info",call:"shh_info",params:0}),new i({name:"setMaxMessageSize",call:"shh_setMaxMessageSize",params:1}),new i({name:"setMinPoW",call:"shh_setMinPoW",params:1}),new i({name:"markTrustedPeer",call:"shh_markTrustedPeer",params:1}),new i({name:"newKeyPair",call:"shh_newKeyPair",params:0}),new i({name:"addPrivateKey",call:"shh_addPrivateKey",params:1}),new i({name:"deleteKeyPair",call:"shh_deleteKeyPair",params:1}),new i({name:"hasKeyPair",call:"shh_hasKeyPair",params:1}),new i({name:"getPublicKey",call:"shh_getPublicKey",params:1}),new i({name:"getPrivateKey",call:"shh_getPrivateKey",params:1}),new i({name:"newSymKey",call:"shh_newSymKey",params:0}),new i({name:"addSymKey",call:"shh_addSymKey",params:1}),new i({name:"generateSymKeyFromPassword",call:"shh_generateSymKeyFromPassword",params:1}),new i({name:"hasSymKey",call:"shh_hasSymKey",params:1}),new i({name:"getSymKey",call:"shh_getSymKey",params:1}),new i({name:"deleteSymKey",call:"shh_deleteSymKey",params:1}),new i({name:"post",call:"shh_post",params:1,inputFormatter:[null]})]};t.exports=s},function(t,e,r){var i=r(5),n=r(26);t.exports=function(t){this._requestManager=t._requestManager;var e=this;[new n({name:"listening",getter:"net_listening"}),new n({name:"peerCount",getter:"net_peerCount",outputFormatter:i.toDecimal})].forEach((function(r){r.attachToObject(e),r.setRequestManager(t._requestManager)}))}},function(t,e,r){var i=r(21),n=r(26),o=r(18);t.exports=function(t){this._requestManager=t._requestManager;var e=this;(function(){var t=new i({name:"newAccount",call:"personal_newAccount",params:1,inputFormatter:[null]}),e=new i({name:"importRawKey",call:"personal_importRawKey",params:2}),r=new i({name:"sign",call:"personal_sign",params:3,inputFormatter:[null,o.inputAddressFormatter,null]}),n=new i({name:"ecRecover",call:"personal_ecRecover",params:2});return[t,e,new i({name:"unlockAccount",call:"personal_unlockAccount",params:3,inputFormatter:[o.inputAddressFormatter,null,null]}),n,r,new i({name:"sendTransaction",call:"personal_sendTransaction",params:2,inputFormatter:[o.inputTransactionFormatter,null]}),new i({name:"lockAccount",call:"personal_lockAccount",params:1,inputFormatter:[o.inputAddressFormatter]})]})().forEach((function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)})),[new n({name:"listAccounts",getter:"personal_listAccounts"})].forEach((function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)}))}},function(t,e,r){var i=r(21),n=r(26);t.exports=function(t){this._requestManager=t._requestManager;var e=this;[new i({name:"blockNetworkRead",call:"bzz_blockNetworkRead",params:1,inputFormatter:[null]}),new i({name:"syncEnabled",call:"bzz_syncEnabled",params:1,inputFormatter:[null]}),new i({name:"swapEnabled",call:"bzz_swapEnabled",params:1,inputFormatter:[null]}),new i({name:"download",call:"bzz_download",params:2,inputFormatter:[null,null]}),new i({name:"upload",call:"bzz_upload",params:2,inputFormatter:[null,null]}),new i({name:"retrieve",call:"bzz_retrieve",params:1,inputFormatter:[null]}),new i({name:"store",call:"bzz_store",params:2,inputFormatter:[null,null]}),new i({name:"get",call:"bzz_get",params:1,inputFormatter:[null]}),new i({name:"put",call:"bzz_put",params:2,inputFormatter:[null,null]}),new i({name:"modify",call:"bzz_modify",params:4,inputFormatter:[null,null,null,null]})].forEach((function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)})),[new n({name:"hive",getter:"bzz_hive"}),new n({name:"info",getter:"bzz_info"})].forEach((function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)}))}},function(t,e){t.exports=function(){this.defaultBlock="latest",this.defaultAccount=void 0}},function(t){t.exports=JSON.parse('{"version":"0.20.7"}')},function(t,e,r){var i=r(18),n=r(5),o=r(21),s=r(26);t.exports=function(t){var e=function(e){var r;e.property?(t[e.property]||(t[e.property]={}),r=t[e.property]):r=t,e.methods&&e.methods.forEach((function(e){e.attachToObject(r),e.setRequestManager(t._requestManager)})),e.properties&&e.properties.forEach((function(e){e.attachToObject(r),e.setRequestManager(t._requestManager)}))};return e.formatters=i,e.utils=n,e.Method=o,e.Property=s,e}},function(t,e,r){var i=r(73),n=r(25),o=function(t){this.requestManager=t._requestManager,this.requests=[]};o.prototype.add=function(t){this.requests.push(t)},o.prototype.execute=function(){var t=this.requests;this.requestManager.sendBatch(t,(function(e,r){r=r||[],t.map((function(t,e){return r[e]||{}})).forEach((function(e,r){if(t[r].callback){if(!i.isValidResponse(e))return t[r].callback(n.InvalidResponse(e));t[r].callback(null,t[r].format?t[r].format(e.result):e.result)}}))}))},t.exports=o},function(t,e,r){(function(e){var i=r(25);"undefined"!=typeof window&&window.XMLHttpRequest?XMLHttpRequest=window.XMLHttpRequest:XMLHttpRequest=r(171).XMLHttpRequest;var n=r(172).XMLHttpRequest,o=function(t,e,r,i,n){this.host=t||"http://localhost:8545",this.timeout=e||0,this.user=r,this.password=i,this.headers=n};o.prototype.prepareRequest=function(t){var r;if(t?(r=new n).timeout=this.timeout:r=new XMLHttpRequest,r.withCredentials=!0,r.open("POST",this.host,t),this.user&&this.password){var i="Basic "+new e(this.user+":"+this.password).toString("base64");r.setRequestHeader("Authorization",i)}return r.setRequestHeader("Content-Type","application/json"),this.headers&&this.headers.forEach((function(t){r.setRequestHeader(t.name,t.value)})),r},o.prototype.send=function(t){var e=this.prepareRequest(!1);try{e.send(JSON.stringify(t))}catch(t){throw i.InvalidConnection(this.host)}var r=e.responseText;try{r=JSON.parse(r)}catch(t){throw i.InvalidResponse(e.responseText)}return r},o.prototype.sendAsync=function(t,e){var r=this.prepareRequest(!0);r.onreadystatechange=function(){if(4===r.readyState&&1!==r.timeout){var t=r.responseText,n=null;try{t=JSON.parse(t)}catch(t){n=i.InvalidResponse(r.responseText)}e(n,t)}},r.ontimeout=function(){e(i.ConnectionTimeout(this.timeout))};try{r.send(JSON.stringify(t))}catch(t){e(i.InvalidConnection(this.host))}},o.prototype.isConnected=function(){try{return this.send({id:9999999999,jsonrpc:"2.0",method:"net_listening",params:[]}),!0}catch(t){return!1}},t.exports=o}).call(this,r(12).Buffer)},function(t,e,r){"undefined"==typeof XMLHttpRequest?e.XMLHttpRequest={}:e.XMLHttpRequest=XMLHttpRequest},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(173));var i=r(57);e.XMLHttpRequestEventTarget=i.XMLHttpRequestEventTarget},function(t,e,r){(function(t,i){var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=this&&this.__assign||Object.assign||function(t){for(var e,r=1,i=arguments.length;r=0)return this._url=this._parseUrl(e.headers.location),this._method="GET",this._loweredHeaders["content-type"]&&(delete this._headers[this._loweredHeaders["content-type"]],delete this._loweredHeaders["content-type"]),null!=this._headers["Content-Type"]&&delete this._headers["Content-Type"],delete this._headers["Content-Length"],this.upload._reset(),this._finalizeHeaders(),void this._sendHxxpRequest();this._response=e,this._response.on("data",(function(t){return i._onHttpResponseData(e,t)})),this._response.on("end",(function(){return i._onHttpResponseEnd(e)})),this._response.on("close",(function(){return i._onHttpResponseClose(e)})),this.responseUrl=this._url.href.split("#")[0],this.status=e.statusCode,this.statusText=a.STATUS_CODES[this.status],this._parseResponseHeaders(e);var n=this._responseHeaders["content-length"]||"";this._totalBytes=+n,this._lengthComputable=!!n,this._setReadyState(r.HEADERS_RECEIVED)}},r.prototype._onHttpResponseData=function(t,e){this._response===t&&(this._responseParts.push(new i(e)),this._loadedBytes+=e.length,this.readyState!==r.LOADING&&this._setReadyState(r.LOADING),this._dispatchProgress("progress"))},r.prototype._onHttpResponseEnd=function(t){this._response===t&&(this._parseResponse(),this._request=null,this._response=null,this._setReadyState(r.DONE),this._dispatchProgress("load"),this._dispatchProgress("loadend"))},r.prototype._onHttpResponseClose=function(t){if(this._response===t){var e=this._request;this._setError(),e.abort(),this._setReadyState(r.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend")}},r.prototype._onHttpTimeout=function(t){this._request===t&&(this._setError(),t.abort(),this._setReadyState(r.DONE),this._dispatchProgress("timeout"),this._dispatchProgress("loadend"))},r.prototype._onHttpRequestError=function(t,e){this._request===t&&(this._setError(),t.abort(),this._setReadyState(r.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend"))},r.prototype._dispatchProgress=function(t){var e=new r.ProgressEvent(t);e.lengthComputable=this._lengthComputable,e.loaded=this._loadedBytes,e.total=this._totalBytes,this.dispatchEvent(e)},r.prototype._setError=function(){this._request=null,this._response=null,this._responseHeaders=null,this._responseParts=null},r.prototype._parseUrl=function(t,e,r){var i=null==this.nodejsBaseUrl?t:f.resolve(this.nodejsBaseUrl,t),n=f.parse(i,!1,!0);n.hash=null;var o=(n.auth||"").split(":"),s=o[0],a=o[1];return(s||a||e||r)&&(n.auth=(e||s||"")+":"+(r||a||"")),n},r.prototype._parseResponseHeaders=function(t){for(var e in this._responseHeaders={},t.headers){var r=e.toLowerCase();this._privateHeaders[r]||(this._responseHeaders[r]=t.headers[e])}null!=this._mimeOverride&&(this._responseHeaders["content-type"]=this._mimeOverride)},r.prototype._parseResponse=function(){var t=i.concat(this._responseParts);switch(this._responseParts=null,this.responseType){case"json":this.responseText=null;try{this.response=JSON.parse(t.toString("utf-8"))}catch(t){this.response=null}return;case"buffer":return this.responseText=null,void(this.response=t);case"arraybuffer":this.responseText=null;for(var e=new ArrayBuffer(t.length),r=new Uint8Array(e),n=0;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,p=String.fromCharCode;function m(t){throw new RangeError(c[t])}function v(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function g(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+v((t=t.replace(l,".")).split("."),e).join(".")}function y(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+p(t)})).join("")}function w(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,r){var i=0;for(t=r?d(t/700):t>>1,t+=d(t/e);t>455;i+=36)t=d(t/35);return d(i+36*t/(t+38))}function _(t){var e,r,i,n,o,s,a,u,f,l,c,p=[],v=t.length,g=0,y=128,w=72;for((r=t.lastIndexOf("-"))<0&&(r=0),i=0;i=128&&m("not-basic"),p.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=v&&m("invalid-input"),((u=(c=t.charCodeAt(n++))-48<10?c-22:c-65<26?c-65:c-97<26?c-97:36)>=36||u>d((h-g)/s))&&m("overflow"),g+=u*s,!(u<(f=a<=w?1:a>=w+26?26:a-w));a+=36)s>d(h/(l=36-f))&&m("overflow"),s*=l;w=M(g-o,e=p.length+1,0==o),d(g/e)>h-y&&m("overflow"),y+=d(g/e),g%=e,p.splice(g++,0,y)}return b(p)}function S(t){var e,r,i,n,o,s,a,u,f,l,c,v,g,b,_,S=[];for(v=(t=y(t)).length,e=128,r=0,o=72,s=0;s=e&&cd((h-r)/(g=i+1))&&m("overflow"),r+=(a-e)*g,e=a,s=0;sh&&m("overflow"),c==e){for(u=r,f=36;!(u<(l=f<=o?1:f>=o+26?26:f-o));f+=36)_=u-l,b=36-l,S.push(p(w(l+_%b,0))),u=d(_/b);S.push(p(w(u,0))),o=M(r,g,i==n),r=0,++i}++r,++e}return S.join("")}a={version:"1.4.1",ucs2:{decode:y,encode:b},decode:_,encode:S,toASCII:function(t){return g(t,(function(t){return f.test(t)?"xn--"+S(t):t}))},toUnicode:function(t){return g(t,(function(t){return u.test(t)?_(t.slice(4).toLowerCase()):t}))}},void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()}).call(this,r(54)(t),r(7))},function(t,e,r){t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,r){e.decode=e.parse=r(180),e.encode=e.stringify=r(181)},function(t,e,r){function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,r,o){e=e||"&",r=r||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var h=1e3;o&&"number"==typeof o.maxKeys&&(h=o.maxKeys);var u=t.length;h>0&&u>h&&(u=h);for(var f=0;f=0?(l=m.substr(0,v),c=m.substr(v+1)):(l=m,c=""),d=decodeURIComponent(l),p=decodeURIComponent(c),i(s,d)?n(s[d])?s[d].push(p):s[d]=[s[d],p]:s[d]=p}return s};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,r){var i=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,r,a){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?o(s(t),(function(s){var a=encodeURIComponent(i(s))+r;return n(t[s])?o(t[s],(function(t){return a+encodeURIComponent(i(t))})).join(e):a+encodeURIComponent(i(t[s]))})).join(e):a?encodeURIComponent(i(a))+r+encodeURIComponent(i(t)):""};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var r=[],i=0;ie?1:0}function s(t,e,n){var s,h=function t(e,n,s,a){var h;if("object"==typeof e&&null!==e){for(h=0;h0)for(var n=0;n-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return u(e,t)},invalidInput:function(t){return u(h.rpc.invalidInput,t)},resourceNotFound:function(t){return u(h.rpc.resourceNotFound,t)},resourceUnavailable:function(t){return u(h.rpc.resourceUnavailable,t)},transactionRejected:function(t){return u(h.rpc.transactionRejected,t)},methodNotSupported:function(t){return u(h.rpc.methodNotSupported,t)}},provider:{userRejectedRequest:function(t){return f(h.provider.userRejectedRequest,t)},unauthorized:function(t){return f(h.provider.unauthorized,t)},unsupportedMethod:function(t){return f(h.provider.unsupportedMethod,t)},custom:function(t){if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");var e=t.code,r=t.message,i=t.data;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new s(e,r,i)}}}},function(t,e,r){(function(t,r,i,n){!function(e){function o(t,e){e|=0;for(var r=Math.max(t.length-e,0),i=Array(r),n=0;n-1&&t%1==0&&t<=9007199254740991}function j(t){return null!=t&&T(t.length)&&!function(t){if(!h(t))return!1;var e=I(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}(t)}var C={};function N(){}function P(t){return function(){if(null!==t){var e=t;t=null,e.apply(this,arguments)}}}var L="function"==typeof Symbol&&Symbol.iterator;function q(t){return null!=t&&"object"==typeof t}function D(t){return q(t)&&"[object Arguments]"==I(t)}var U=Object.prototype,F=U.hasOwnProperty,z=U.propertyIsEnumerable,H=D(function(){return arguments}())?D:function(t){return q(t)&&F.call(t,"callee")&&!z.call(t,"callee")},Z=Array.isArray,W="object"==typeof e&&e&&!e.nodeType&&e,K=W&&"object"==typeof n&&n&&!n.nodeType&&n,V=K&&K.exports===W?S.Buffer:void 0,G=(V?V.isBuffer:void 0)||function(){return!1},Y=/^(?:0|[1-9]\d*)$/;function J(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&Y.test(t))&&t>-1&&t%1==0&&t2&&(i=o(arguments,1)),e){var u={};At(n,(function(t,e){u[e]=t})),u[t]=i,a=!0,h=Object.create(null),r(e,u)}else n[t]=i,p(t)}));s++;var u=b(e[e.length-1]);e.length>1?u(n,i):u(i)}}(t,e)}))}function d(){if(0===u.length&&0===s)return r(null,n);for(;u.length&&s=0&&r.push(i)})),r}At(t,(function(e,r){if(!Z(e))return c(r,[e]),void f.push(r);var i=e.slice(0,e.length-1),n=i.length;if(0===n)return c(r,e),void f.push(r);l[r]=n,kt(i,(function(o){if(!t[o])throw new Error("async.auto task `"+r+"` has a non-existent dependency `"+o+"` in "+i.join(", "));var s,a,u;a=function(){0==--n&&c(r,e)},(u=h[s=o])||(u=h[s]=[]),u.push(a)}))})),function(){for(var t=0;f.length;)t++,kt(m(f.pop()),(function(t){0==--l[t]&&f.push(t)}));if(t!==i)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),d()};function Rt(t,e){for(var r=-1,i=null==t?0:t.length,n=Array(i);++r0?s:t);else if(o)r[e]=t;else{if(i=function(t){return(t=(t=(t=t.toString().replace(Yt,"")).match(Kt)[2].replace(" ",""))?t.split(Vt):[]).map((function(t){return function(t,e,r){var i;if((t=null==(i=t)?"":jt(i))&&(r||void 0===e))return t.replace(Wt,"");if(!t||!(e=jt(e)))return t;var n=Zt(t),o=Zt(e);return function(t,e,r){var i=t.length;return r=void 0===r?i:r,!e&&r>=i?t:function(t,e,r){var i=-1,n=t.length;e<0&&(e=-e>n?0:n+e),(r=r>n?n:r)<0&&(r+=n),n=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(n);++i-1;);return r}(n,o),function(t,e){for(var r=t.length;r--&&Bt(e,t[r],0)>-1;);return r}(n,o)+1).join("")}(t.replace(Gt,""))}))}(t),0===t.length&&!n&&0===i.length)throw new Error("autoInject task functions require explicit parameters.");n||i.pop(),r[e]=i.concat(s)}function s(e,r){var n=Rt(i,(function(t){return e[t]}));n.push(r),b(t).apply(null,n)}})),Ot(r,e)}function Xt(){this.head=this.tail=null,this.length=0}function $t(t,e){t.length=1,t.head=t.tail=e}function Qt(t,e,r){if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var i=b(t),n=0,o=[],s=!1;function a(t,e,r){if(null!=r&&"function"!=typeof r)throw new Error("task callback must be a function");if(f.started=!0,Z(t)||(t=[t]),0===t.length&&f.idle())return d((function(){f.drain()}));for(var i=0,n=t.length;i0&&o.splice(a,1),s.callback.apply(s,arguments),null!=e&&f.error(e,s.data)}n<=f.concurrency-f.buffer&&f.unsaturated(),f.idle()&&f.drain(),f.process()}}var u=!1,f={_tasks:new Xt,concurrency:e,payload:r,saturated:N,unsaturated:N,buffer:e/4,empty:N,drain:N,error:N,started:!1,paused:!1,push:function(t,e){a(t,!1,e)},kill:function(){f.drain=N,f._tasks.empty()},unshift:function(t,e){a(t,!0,e)},remove:function(t){f._tasks.remove(t)},process:function(){if(!u){for(u=!0;!f.paused&&n2&&(n=o(arguments,1)),i[e]=n,r(t)}))}),(function(t){r(t,i)}))}function Je(t,e){Ye(vt,t,e)}function Xe(t,e,r){Ye(lt(e),t,r)}var $e=function(t,e){var r=b(t);return Qt((function(t,e){r(t[0],e)}),e,1)},Qe=function(t,e){var r=$e(t,e);return r.push=function(t,e,i){if(null==i&&(i=N),"function"!=typeof i)throw new Error("task callback must be a function");if(r.started=!0,Z(t)||(t=[t]),0===t.length)return d((function(){r.drain()}));e=e||0;for(var n=r._tasks.head;n&&e>=n.priority;)n=n.next;for(var o=0,s=t.length;oi?1:0}bt(t,(function(t,e){i(t,(function(r,i){if(r)return e(r);e(null,{value:t,criteria:i})}))}),(function(t,e){if(t)return r(t);r(null,Rt(e.sort(n),Ie("value")))}))}function vr(t,e,r){var i=b(t);return a((function(n,o){var s,a=!1;n.push((function(){a||(o.apply(null,arguments),clearTimeout(s))})),s=setTimeout((function(){var e=t.name||"anonymous",i=new Error('Callback function "'+e+'" timed out.');i.code="ETIMEDOUT",r&&(i.info=r),a=!0,o(i)}),e),i.apply(null,n)}))}var gr=Math.ceil,yr=Math.max;function br(t,e,r,i){var n=b(r);_t(function(t,e,r,i){for(var n=-1,o=yr(gr((e-t)/1),0),s=Array(o);o--;)s[++n]=t,t+=1;return s}(0,t),e,n,i)}var wr=dt(br,1/0),Mr=dt(br,1);function _r(t,e,r,i){arguments.length<=3&&(i=r,r=e,e=Z(t)?[]:{}),i=P(i||N);var n=b(r);vt(t,(function(t,r,i){n(e,t,r,i)}),(function(t){i(t,e)}))}function Sr(t,e){var r,i=null;e=e||N,ke(t,(function(t,e){b(t)((function(t,n){r=arguments.length>2?o(arguments,1):n,i=t,e(!t)}))}),(function(){e(i,r)}))}function xr(t){return function(){return(t.unmemoized||t).apply(null,arguments)}}function kr(t,e,r){r=ft(r||N);var i=b(e);if(!t())return r(null);i((function e(n){if(n)return r(n);if(t())return i(e);var s=o(arguments,1);r.apply(null,[null].concat(s))}))}function Ar(t,e,r){kr((function(){return!t.apply(this,arguments)}),e,r)}var Er=function(t,e){if(e=P(e||N),!Z(t))return e(new Error("First argument to waterfall must be an array of functions"));if(!t.length)return e();var r=0;function i(e){var i=b(t[r++]);e.push(ft(n)),i.apply(null,e)}function n(n){if(n||r===t.length)return e.apply(null,arguments);i(o(arguments,1))}i([])},Br={apply:s,applyEach:wt,applyEachSeries:xt,asyncify:p,auto:Ot,autoInject:Jt,cargo:te,compose:ne,concat:ae,concatLimit:se,concatSeries:he,constant:ue,detect:de,detectLimit:pe,detectSeries:me,dir:ge,doDuring:ye,doUntil:we,doWhilst:be,during:Me,each:Se,eachLimit:xe,eachOf:vt,eachOfLimit:ct,eachOfSeries:ee,eachSeries:ke,ensureAsync:Ae,every:Be,everyLimit:Oe,everySeries:Re,filter:Ne,filterLimit:Pe,filterSeries:Le,forever:qe,groupBy:Ue,groupByLimit:De,groupBySeries:Fe,log:ze,map:bt,mapLimit:_t,mapSeries:St,mapValues:Ze,mapValuesLimit:He,mapValuesSeries:We,memoize:Ve,nextTick:Ge,parallel:Je,parallelLimit:Xe,priorityQueue:Qe,queue:$e,race:tr,reduce:re,reduceRight:er,reflect:rr,reflectAll:ir,reject:or,rejectLimit:sr,rejectSeries:ar,retry:ur,retryable:fr,seq:ie,series:lr,setImmediate:d,some:cr,someLimit:dr,someSeries:pr,sortBy:mr,timeout:vr,times:wr,timesLimit:br,timesSeries:Mr,transform:_r,tryEach:Sr,unmemoize:xr,until:Ar,waterfall:Er,whilst:kr,all:Be,allLimit:Oe,allSeries:Re,any:cr,anyLimit:dr,anySeries:pr,find:de,findLimit:pe,findSeries:me,forEach:Se,forEachSeries:ke,forEachLimit:xe,forEachOf:vt,forEachOfSeries:ee,forEachOfLimit:ct,inject:re,foldl:re,foldr:er,select:Ne,selectLimit:Pe,selectSeries:Le,wrapSync:p};e.default=Br,e.apply=s,e.applyEach=wt,e.applyEachSeries=xt,e.asyncify=p,e.auto=Ot,e.autoInject=Jt,e.cargo=te,e.compose=ne,e.concat=ae,e.concatLimit=se,e.concatSeries=he,e.constant=ue,e.detect=de,e.detectLimit=pe,e.detectSeries=me,e.dir=ge,e.doDuring=ye,e.doUntil=we,e.doWhilst=be,e.during=Me,e.each=Se,e.eachLimit=xe,e.eachOf=vt,e.eachOfLimit=ct,e.eachOfSeries=ee,e.eachSeries=ke,e.ensureAsync=Ae,e.every=Be,e.everyLimit=Oe,e.everySeries=Re,e.filter=Ne,e.filterLimit=Pe,e.filterSeries=Le,e.forever=qe,e.groupBy=Ue,e.groupByLimit=De,e.groupBySeries=Fe,e.log=ze,e.map=bt,e.mapLimit=_t,e.mapSeries=St,e.mapValues=Ze,e.mapValuesLimit=He,e.mapValuesSeries=We,e.memoize=Ve,e.nextTick=Ge,e.parallel=Je,e.parallelLimit=Xe,e.priorityQueue=Qe,e.queue=$e,e.race=tr,e.reduce=re,e.reduceRight=er,e.reflect=rr,e.reflectAll=ir,e.reject=or,e.rejectLimit=sr,e.rejectSeries=ar,e.retry=ur,e.retryable=fr,e.seq=ie,e.series=lr,e.setImmediate=d,e.some=cr,e.someLimit=dr,e.someSeries=pr,e.sortBy=mr,e.timeout=vr,e.times=wr,e.timesLimit=br,e.timesSeries=Mr,e.transform=_r,e.tryEach=Sr,e.unmemoize=xr,e.until=Ar,e.waterfall=Er,e.whilst=kr,e.all=Be,e.allLimit=Oe,e.allSeries=Re,e.any=cr,e.anyLimit=dr,e.anySeries=pr,e.find=de,e.findLimit=pe,e.findSeries=me,e.forEach=Se,e.forEachSeries=ke,e.forEachLimit=xe,e.forEachOf=vt,e.forEachOfSeries=ee,e.forEachOfLimit=ct,e.inject=re,e.foldl=re,e.foldr=er,e.select=Ne,e.selectLimit=Pe,e.selectSeries=Le,e.wrapSync=p,Object.defineProperty(e,"__esModule",{value:!0})}(e)}).call(this,r(70).setImmediate,r(11),r(7),r(54)(t))},function(t,e){var r=Math.floor(4294967295*Math.random());t.exports=function(){return r=(r+1)%4294967295}},function(t,e){t.exports=function t(e,r){if(e&&r)return t(e)(r);if("function"!=typeof e)throw new TypeError("need wrapper function");return Object.keys(e).forEach((function(t){i[t]=e[t]})),i;function i(){for(var t=new Array(arguments.length),r=0;r>>32-e}function u(t,e,r,i,n,o,s){return h(t+(e&r|~e&i)+n+o|0,s)+e|0}function f(t,e,r,i,n,o,s){return h(t+(e&i|r&~i)+n+o|0,s)+e|0}function l(t,e,r,i,n,o,s){return h(t+(e^r^i)+n+o|0,s)+e|0}function c(t,e,r,i,n,o,s){return h(t+(r^(e|~i))+n+o|0,s)+e|0}i(a,n),a.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,i=this._b,n=this._c,o=this._d;r=u(r,i,n,o,t[0],3614090360,7),o=u(o,r,i,n,t[1],3905402710,12),n=u(n,o,r,i,t[2],606105819,17),i=u(i,n,o,r,t[3],3250441966,22),r=u(r,i,n,o,t[4],4118548399,7),o=u(o,r,i,n,t[5],1200080426,12),n=u(n,o,r,i,t[6],2821735955,17),i=u(i,n,o,r,t[7],4249261313,22),r=u(r,i,n,o,t[8],1770035416,7),o=u(o,r,i,n,t[9],2336552879,12),n=u(n,o,r,i,t[10],4294925233,17),i=u(i,n,o,r,t[11],2304563134,22),r=u(r,i,n,o,t[12],1804603682,7),o=u(o,r,i,n,t[13],4254626195,12),n=u(n,o,r,i,t[14],2792965006,17),r=f(r,i=u(i,n,o,r,t[15],1236535329,22),n,o,t[1],4129170786,5),o=f(o,r,i,n,t[6],3225465664,9),n=f(n,o,r,i,t[11],643717713,14),i=f(i,n,o,r,t[0],3921069994,20),r=f(r,i,n,o,t[5],3593408605,5),o=f(o,r,i,n,t[10],38016083,9),n=f(n,o,r,i,t[15],3634488961,14),i=f(i,n,o,r,t[4],3889429448,20),r=f(r,i,n,o,t[9],568446438,5),o=f(o,r,i,n,t[14],3275163606,9),n=f(n,o,r,i,t[3],4107603335,14),i=f(i,n,o,r,t[8],1163531501,20),r=f(r,i,n,o,t[13],2850285829,5),o=f(o,r,i,n,t[2],4243563512,9),n=f(n,o,r,i,t[7],1735328473,14),r=l(r,i=f(i,n,o,r,t[12],2368359562,20),n,o,t[5],4294588738,4),o=l(o,r,i,n,t[8],2272392833,11),n=l(n,o,r,i,t[11],1839030562,16),i=l(i,n,o,r,t[14],4259657740,23),r=l(r,i,n,o,t[1],2763975236,4),o=l(o,r,i,n,t[4],1272893353,11),n=l(n,o,r,i,t[7],4139469664,16),i=l(i,n,o,r,t[10],3200236656,23),r=l(r,i,n,o,t[13],681279174,4),o=l(o,r,i,n,t[0],3936430074,11),n=l(n,o,r,i,t[3],3572445317,16),i=l(i,n,o,r,t[6],76029189,23),r=l(r,i,n,o,t[9],3654602809,4),o=l(o,r,i,n,t[12],3873151461,11),n=l(n,o,r,i,t[15],530742520,16),r=c(r,i=l(i,n,o,r,t[2],3299628645,23),n,o,t[0],4096336452,6),o=c(o,r,i,n,t[7],1126891415,10),n=c(n,o,r,i,t[14],2878612391,15),i=c(i,n,o,r,t[5],4237533241,21),r=c(r,i,n,o,t[12],1700485571,6),o=c(o,r,i,n,t[3],2399980690,10),n=c(n,o,r,i,t[10],4293915773,15),i=c(i,n,o,r,t[1],2240044497,21),r=c(r,i,n,o,t[8],1873313359,6),o=c(o,r,i,n,t[15],4264355552,10),n=c(n,o,r,i,t[6],2734768916,15),i=c(i,n,o,r,t[13],1309151649,21),r=c(r,i,n,o,t[4],4149444226,6),o=c(o,r,i,n,t[11],3174756917,10),n=c(n,o,r,i,t[2],718787259,15),i=c(i,n,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+o|0},a.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 t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=a},function(t,e,r){var i=r(12).Buffer,n=r(4),o=r(85),s=new Array(16),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],h=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],f=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],l=[0,1518500249,1859775393,2400959708,2840853838],c=[1352829926,1548603684,1836072691,2053994217,0];function d(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(t,e){return t<>>32-e}function m(t,e,r,i,n,o,s,a){return p(t+(e^r^i)+o+s|0,a)+n|0}function v(t,e,r,i,n,o,s,a){return p(t+(e&r|~e&i)+o+s|0,a)+n|0}function g(t,e,r,i,n,o,s,a){return p(t+((e|~r)^i)+o+s|0,a)+n|0}function y(t,e,r,i,n,o,s,a){return p(t+(e&i|r&~i)+o+s|0,a)+n|0}function b(t,e,r,i,n,o,s,a){return p(t+(e^(r|~i))+o+s|0,a)+n|0}n(d,o),d.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,i=0|this._b,n=0|this._c,o=0|this._d,d=0|this._e,w=0|this._a,M=0|this._b,_=0|this._c,S=0|this._d,x=0|this._e,k=0;k<80;k+=1){var A,E;k<16?(A=m(r,i,n,o,d,t[a[k]],l[0],u[k]),E=b(w,M,_,S,x,t[h[k]],c[0],f[k])):k<32?(A=v(r,i,n,o,d,t[a[k]],l[1],u[k]),E=y(w,M,_,S,x,t[h[k]],c[1],f[k])):k<48?(A=g(r,i,n,o,d,t[a[k]],l[2],u[k]),E=g(w,M,_,S,x,t[h[k]],c[2],f[k])):k<64?(A=y(r,i,n,o,d,t[a[k]],l[3],u[k]),E=v(w,M,_,S,x,t[h[k]],c[3],f[k])):(A=b(r,i,n,o,d,t[a[k]],l[4],u[k]),E=m(w,M,_,S,x,t[h[k]],c[4],f[k])),r=d,d=o,o=p(n,10),n=i,i=A,w=x,x=S,S=p(_,10),_=M,M=E}var B=this._b+n+S|0;this._b=this._c+o+x|0,this._c=this._d+d+w|0,this._d=this._e+r+M|0,this._e=this._a+i+_|0,this._a=B},d.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 t=i.alloc?i.alloc(20):new i(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=d},function(t,e,r){(e=t.exports=function(t){t=t.toLowerCase();var r=e[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r}).sha=r(203),e.sha1=r(204),e.sha224=r(205),e.sha256=r(86),e.sha384=r(206),e.sha512=r(87)},function(t,e,r){var i=r(4),n=r(27),o=r(14).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function h(){this.init(),this._w=a,n.call(this,64,56)}function u(t){return t<<30|t>>>2}function f(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}i(h,n),h.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},h.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,h=0|this._e,l=0;l<16;++l)r[l]=t.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var c=0;c<80;++c){var d=~~(c/20),p=0|((e=i)<<5|e>>>27)+f(d,n,o,a)+h+r[c]+s[d];h=a,a=o,o=u(n),n=i,i=p}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=h+this._e|0},h.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=h},function(t,e,r){var i=r(4),n=r(27),o=r(14).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function h(){this.init(),this._w=a,n.call(this,64,56)}function u(t){return t<<5|t>>>27}function f(t){return t<<30|t>>>2}function l(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}i(h,n),h.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},h.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,h=0|this._e,c=0;c<16;++c)r[c]=t.readInt32BE(4*c);for(;c<80;++c)r[c]=(e=r[c-3]^r[c-8]^r[c-14]^r[c-16])<<1|e>>>31;for(var d=0;d<80;++d){var p=~~(d/20),m=u(i)+l(p,n,o,a)+h+r[d]+s[p]|0;h=a,a=o,o=f(n),n=i,i=m}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=h+this._e|0},h.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=h},function(t,e,r){var i=r(4),n=r(86),o=r(27),s=r(14).Buffer,a=new Array(64);function h(){this.init(),this._w=a,o.call(this,64,56)}i(h,n),h.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},h.prototype._hash=function(){var t=s.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=h},function(t,e,r){var i=r(4),n=r(87),o=r(27),s=r(14).Buffer,a=new Array(160);function h(){this.init(),this._w=a,o.call(this,128,112)}i(h,n),h.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},h.prototype._hash=function(){var t=s.allocUnsafe(48);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=h},function(t,e,r){var i=r(14).Buffer,n=r(61).Transform,o=r(51).StringDecoder;function s(t){n.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(4)(s,n),s.prototype.update=function(t,e,r){"string"==typeof t&&(t=i.from(t,e));var n=this._update(t);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(t,e,r){var i;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){i=t}finally{r(i)}},s.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},s.prototype._finalOrDigest=function(t){var e=this.__final()||i.alloc(0);return t&&(e=this._toString(e,t,!0)),e},s.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var i=this._decoder.write(t);return r&&(i+=this._decoder.end()),i},t.exports=s}]).default})),L=Object(p.c)(P);e.default=L},745:function(t,e,r){"use strict";r.d(e,"a",(function(){return w}));var i,n,o,s,a={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},h=function(t){throw{name:"SyntaxError",message:t,at:i,text:o}},u=function(t){return t&&t!==n&&h("Expected '"+t+"' instead of '"+n+"'"),n=o.charAt(i),i+=1,n},f=function(){var t,e="";for("-"===n&&(e="-",u("-"));n>="0"&&n<="9";)e+=n,u();if("."===n)for(e+=".";u()&&n>="0"&&n<="9";)e+=n;if("e"===n||"E"===n)for(e+=n,u(),"-"!==n&&"+"!==n||(e+=n,u());n>="0"&&n<="9";)e+=n,u();if(t=+e,isFinite(t))return t;h("Bad number")},l=function(){var t,e,r,i="";if('"'===n)for(;u();){if('"'===n)return u(),i;if("\\"===n)if(u(),"u"===n){for(r=0,e=0;e<4&&(t=parseInt(u(),16),isFinite(t));e+=1)r=16*r+t;i+=String.fromCharCode(r)}else{if("string"!=typeof a[n])break;i+=a[n]}else i+=n}h("Bad string")},c=function(){for(;n&&n<=" ";)u()};s=function(){switch(c(),n){case"{":return function(){var t,e={};if("{"===n){if(u("{"),c(),"}"===n)return u("}"),e;for(;n;){if(t=l(),c(),u(":"),Object.hasOwnProperty.call(e,t)&&h('Duplicate key "'+t+'"'),e[t]=s(),c(),"}"===n)return u("}"),e;u(","),c()}}h("Bad object")}();case"[":return function(){var t=[];if("["===n){if(u("["),c(),"]"===n)return u("]"),t;for(;n;){if(t.push(s()),c(),"]"===n)return u("]"),t;u(","),c()}}h("Bad array")}();case'"':return l();case"-":return f();default:return n>="0"&&n<="9"?f():function(){switch(n){case"t":return u("t"),u("r"),u("u"),u("e"),!0;case"f":return u("f"),u("a"),u("l"),u("s"),u("e"),!1;case"n":return u("n"),u("u"),u("l"),u("l"),null}h("Unexpected '"+n+"'")}()}};var d,p,m,v=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,g={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function y(t){return v.lastIndex=0,v.test(t)?'"'+t.replace(v,(function(t){var e=g[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+t+'"'}var b="undefined"!=typeof JSON?JSON:{parse:function(t,e){var r;return o=t,i=0,n=" ",r=s(),c(),n&&h("Syntax error"),"function"==typeof e?function t(r,i){var n,o,s=r[i];if(s&&"object"==typeof s)for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(void 0!==(o=t(s,n))?s[n]=o:delete s[n]);return e.call(r,i,s)}({"":r},""):r},stringify:function(t,e,r){var i;if(d="",p="","number"==typeof r)for(i=0;i=0&&e<=o.levels.SILENT))throw"log.setLevel() called with invalid level: "+e;if(n=e,!1!==i&&function(t){var e=(r[t]||"silent").toUpperCase();if("undefined"!=typeof window){try{return void(window.localStorage[a]=e)}catch(t){}try{window.document.cookie=encodeURIComponent(a)+"="+e+";"}catch(t){}}}(e),s.call(o,e,t),"undefined"==typeof console&&e=0;--n){var o=this.tryEntries[n],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var a=r.call(o,"catchLoc"),h=r.call(o,"finallyLoc");if(a&&h){if(this.prev=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),M(r),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var i=r.completion;if("throw"===i.type){var n=i.arg;M(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),u}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}})),y=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t};function b(t,e,r,i,n,o,s){try{var a=t[o](s),h=a.value}catch(t){return void r(t)}a.done?e(h):Promise.resolve(h).then(i,n)}var w=function(t){return function(){var e=this,r=arguments;return new Promise((function(i,n){var o=t.apply(e,r);function s(t){b(o,i,n,s,a,"next",t)}function a(t){b(o,i,n,s,a,"throw",t)}s(void 0)}))}},M=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function _(t,e){for(var r=0;r=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(h.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(i)return U(t).length;e=(""+e).toLowerCase(),i=!0}}function m(t,e,r){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return k(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function v(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function g(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=h.from(e,i)),h.isBuffer(e))return 0===e.length?-1:y(t,e,r,i,n);if("number"==typeof e)return e&=255,h.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,i,n){var o,s=1,a=t.length,h=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,a/=2,h/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(n){var f=-1;for(o=r;oa&&(r=a-h),o=r;o>=0;o--){for(var l=!0,c=0;cn&&(i=n):i=n;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var s=0;s>8,n=r%256,o.push(n),o.push(i);return o}(e,t.length-r),t,r,i)}function k(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n239?4:u>223?3:u>191?2:1;if(n+l<=r)switch(l){case 1:u<128&&(f=u);break;case 2:128==(192&(o=t[n+1]))&&(h=(31&u)<<6|63&o)>127&&(f=h);break;case 3:o=t[n+1],s=t[n+2],128==(192&o)&&128==(192&s)&&(h=(15&u)<<12|(63&o)<<6|63&s)>2047&&(h<55296||h>57343)&&(f=h);break;case 4:o=t[n+1],s=t[n+2],a=t[n+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(h=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&h<1114112&&(f=h)}null===f?(f=65533,l=1):f>65535&&(f-=65536,i.push(f>>>10&1023|55296),f=56320|1023&f),i.push(f),n+=l}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",i=0;ii)&&(r=i);for(var n="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function T(t,e,r,i,n,o){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function j(t,e,r,i){e<0&&(e=65535+e+1);for(var n=0,o=Math.min(t.length-r,2);n>>8*(i?n:1-n)}function C(t,e,r,i){e<0&&(e=4294967295+e+1);for(var n=0,o=Math.min(t.length-r,4);n>>8*(i?n:3-n)&255}function N(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(t,e,r,i,o){return o||N(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function L(t,e,r,i,o){return o||N(t,0,r,8),n.write(t,e,r,i,52,8),r+8}e.Buffer=h,e.SlowBuffer=function(t){return+t!=t&&(t=0),h.alloc(+t)},e.INSPECT_MAX_BYTES=50,h.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),h.poolSize=8192,h._augment=function(t){return t.__proto__=h.prototype,t},h.from=function(t,e,r){return u(null,t,e,r)},h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0})),h.alloc=function(t,e,r){return function(t,e,r,i){return f(e),e<=0?a(t,e):void 0!==r?"string"==typeof i?a(t,e).fill(r,i):a(t,e).fill(r):a(t,e)}(null,t,e,r)},h.allocUnsafe=function(t){return l(null,t)},h.allocUnsafeSlow=function(t){return l(null,t)},h.isBuffer=function(t){return!(null==t||!t._isBuffer)},h.compare=function(t,e){if(!h.isBuffer(t)||!h.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,i=e.length,n=0,o=Math.min(r,i);n0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},h.prototype.compare=function(t,e,r,i,n){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(n>>>=0)-(i>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(i,n),f=t.slice(e,r),l=0;ln)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return M(this,t,e,r);case"latin1":case"binary":return _(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},h.prototype.slice=function(t,e){var r,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e0&&(n*=256);)i+=this[t+--e]*n;return i},h.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},h.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var i=this[t],n=1,o=0;++o=(n*=128)&&(i-=Math.pow(2,8*e)),i},h.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var i=e,n=1,o=this[t+--i];i>0&&(n*=256);)o+=this[t+--i]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*e)),o},h.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt32LE=function(t,e){return e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),n.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),n.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),n.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),n.read(this,t,!1,52,8)},h.prototype.writeUIntLE=function(t,e,r,i){t=+t,e|=0,r|=0,i||T(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+n]=t/o&255;return e+r},h.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,1,255,0),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},h.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},h.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},h.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):C(this,t,e,!0),e+4},h.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},h.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);T(this,t,e,r,n-1,-n)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},h.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);T(this,t,e,r,n-1,-n)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},h.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,1,127,-128),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},h.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},h.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},h.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):C(this,t,e,!0),e+4},h.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},h.prototype.writeFloatLE=function(t,e,r){return P(this,t,e,!0,r)},h.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},h.prototype.writeDoubleLE=function(t,e,r){return L(this,t,e,!0,r)},h.prototype.writeDoubleBE=function(t,e,r){return L(this,t,e,!1,r)},h.prototype.copy=function(t,e,r,i){if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--n)t[n+e]=this[n+r];else if(o<1e3||!h.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function F(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(q,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,i){for(var n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}}).call(this,r(0))},function(t,e,r){(function(t,r){var i;!function(){var n="object"==typeof self&&self.self===self&&self||"object"==typeof t&&t.global===t&&t||this||{},o=n._,s=Array.prototype,a=Object.prototype,h="undefined"!=typeof Symbol?Symbol.prototype:null,u=s.push,f=s.slice,l=a.toString,c=a.hasOwnProperty,d=Array.isArray,p=Object.keys,m=Object.create,v=function(){},g=function t(e){return e instanceof t?e:this instanceof t?void(this._wrapped=e):new t(e)};e.nodeType?n._=g:(!r.nodeType&&r.exports&&(e=r.exports=g),e._=g),g.VERSION="1.9.1";var y,b=function(t,e,r){if(void 0===e)return t;switch(null==r?3:r){case 1:return function(r){return t.call(e,r)};case 3:return function(r,i,n){return t.call(e,r,i,n)};case 4:return function(r,i,n,o){return t.call(e,r,i,n,o)}}return function(){return t.apply(e,arguments)}},w=function(t,e,r){return g.iteratee!==y?g.iteratee(t,e):null==t?g.identity:g.isFunction(t)?b(t,e,r):g.isObject(t)&&!g.isArray(t)?g.matcher(t):g.property(t)};g.iteratee=y=function(t,e){return w(t,e,1/0)};var M=function(t,e){return e=null==e?t.length-1:+e,function(){for(var r=Math.max(arguments.length-e,0),i=Array(r),n=0;n=0&&e<=A};g.each=g.forEach=function(t,e,r){var i,n;if(e=b(e,r),B(t))for(i=0,n=t.length;i0?0:s-1;for(n||(i=e[o?o[a]:a],a+=t);a>=0&&a=3;return e(t,b(r,n,4),i,o)}};g.reduce=g.foldl=g.inject=O(1),g.reduceRight=g.foldr=O(-1),g.find=g.detect=function(t,e,r){var i=(B(t)?g.findIndex:g.findKey)(t,e,r);if(void 0!==i&&-1!==i)return t[i]},g.filter=g.select=function(t,e,r){var i=[];return e=w(e,r),g.each(t,(function(t,r,n){e(t,r,n)&&i.push(t)})),i},g.reject=function(t,e,r){return g.filter(t,g.negate(w(e)),r)},g.every=g.all=function(t,e,r){e=w(e,r);for(var i=!B(t)&&g.keys(t),n=(i||t).length,o=0;o=0},g.invoke=M((function(t,e,r){var i,n;return g.isFunction(e)?n=e:g.isArray(e)&&(i=e.slice(0,-1),e=e[e.length-1]),g.map(t,(function(t){var o=n;if(!o){if(i&&i.length&&(t=k(t,i)),null==t)return;o=t[e]}return null==o?o:o.apply(t,r)}))})),g.pluck=function(t,e){return g.map(t,g.property(e))},g.where=function(t,e){return g.filter(t,g.matcher(e))},g.findWhere=function(t,e){return g.find(t,g.matcher(e))},g.max=function(t,e,r){var i,n,o=-1/0,s=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,h=(t=B(t)?t:g.values(t)).length;ao&&(o=i);else e=w(e,r),g.each(t,(function(t,r,i){((n=e(t,r,i))>s||n===-1/0&&o===-1/0)&&(o=t,s=n)}));return o},g.min=function(t,e,r){var i,n,o=1/0,s=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,h=(t=B(t)?t:g.values(t)).length;ai||void 0===r)return 1;if(r0?0:n-1;o>=0&&o0?s=o>=0?o:Math.max(o+a,s):a=o>=0?Math.min(o+1,a):o+a+1;else if(r&&o&&a)return i[o=r(i,n)]===n?o:-1;if(n!=n)return(o=e(f.call(i,s,a),g.isNaN))>=0?o+s:-1;for(o=t>0?s:a-1;o>=0&&oe?(i&&(clearTimeout(i),i=null),a=u,s=t.apply(n,o),i||(n=o=null)):i||!1===r.trailing||(i=setTimeout(h,f)),s};return u.cancel=function(){clearTimeout(i),a=0,i=n=o=null},u},g.debounce=function(t,e,r){var i,n,o=function(e,r){i=null,r&&(n=t.apply(e,r))},s=M((function(s){if(i&&clearTimeout(i),r){var a=!i;i=setTimeout(o,e),a&&(n=t.apply(this,s))}else i=g.delay(o,e,this,s);return n}));return s.cancel=function(){clearTimeout(i),i=null},s},g.wrap=function(t,e){return g.partial(e,t)},g.negate=function(t){return function(){return!t.apply(this,arguments)}},g.compose=function(){var t=arguments,e=t.length-1;return function(){for(var r=e,i=t[e].apply(this,arguments);r--;)i=t[r].call(this,i);return i}},g.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},g.before=function(t,e){var r;return function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=null),r}},g.once=g.partial(g.before,2),g.restArguments=M;var P=!{toString:null}.propertyIsEnumerable("toString"),L=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],q=function(t,e){var r=L.length,i=t.constructor,n=g.isFunction(i)&&i.prototype||a,o="constructor";for(x(t,o)&&!g.contains(e,o)&&e.push(o);r--;)(o=L[r])in t&&t[o]!==n[o]&&!g.contains(e,o)&&e.push(o)};g.keys=function(t){if(!g.isObject(t))return[];if(p)return p(t);var e=[];for(var r in t)x(t,r)&&e.push(r);return P&&q(t,e),e},g.allKeys=function(t){if(!g.isObject(t))return[];var e=[];for(var r in t)e.push(r);return P&&q(t,e),e},g.values=function(t){for(var e=g.keys(t),r=e.length,i=Array(r),n=0;n1&&(i=b(i,e[1])),e=g.allKeys(t)):(i=z,e=T(e,!1,!1),t=Object(t));for(var n=0,o=e.length;n1&&(r=e[1])):(e=g.map(T(e,!1,!1),String),i=function(t,r){return!g.contains(e,r)}),g.pick(t,i,r)})),g.defaults=D(g.allKeys,!0),g.create=function(t,e){var r=_(t);return e&&g.extendOwn(r,e),r},g.clone=function(t){return g.isObject(t)?g.isArray(t)?t.slice():g.extend({},t):t},g.tap=function(t,e){return e(t),t},g.isMatch=function(t,e){var r=g.keys(e),i=r.length;if(null==t)return!i;for(var n=Object(t),o=0;o":">",'"':""","'":"'","`":"`"},W=g.invert(Z),K=function(t){var e=function(e){return t[e]},r="(?:"+g.keys(t).join("|")+")",i=RegExp(r),n=RegExp(r,"g");return function(t){return t=null==t?"":""+t,i.test(t)?t.replace(n,e):t}};g.escape=K(Z),g.unescape=K(W),g.result=function(t,e,r){g.isArray(e)||(e=[e]);var i=e.length;if(!i)return g.isFunction(r)?r.call(t):r;for(var n=0;n/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var G=/(.)^/,Y={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},J=/\\|'|\r|\n|\u2028|\u2029/g,X=function(t){return"\\"+Y[t]};g.template=function(t,e,r){!e&&r&&(e=r),e=g.defaults({},e,g.templateSettings);var i,n=RegExp([(e.escape||G).source,(e.interpolate||G).source,(e.evaluate||G).source].join("|")+"|$","g"),o=0,s="__p+='";t.replace(n,(function(e,r,i,n,a){return s+=t.slice(o,a).replace(J,X),o=a+e.length,r?s+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":i?s+="'+\n((__t=("+i+"))==null?'':__t)+\n'":n&&(s+="';\n"+n+"\n__p+='"),e})),s+="';\n",e.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{i=new Function(e.variable||"obj","_",s)}catch(t){throw t.source=s,t}var a=function(t){return i.call(this,t,g)},h=e.variable||"obj";return a.source="function("+h+"){\n"+s+"}",a},g.chain=function(t){var e=g(t);return e._chain=!0,e};var $=function(t,e){return t._chain?g(e).chain():e};g.mixin=function(t){return g.each(g.functions(t),(function(e){var r=g[e]=t[e];g.prototype[e]=function(){var t=[this._wrapped];return u.apply(t,arguments),$(this,r.apply(g,t))}})),g},g.mixin(g),g.each(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=s[t];g.prototype[t]=function(){var r=this._wrapped;return e.apply(r,arguments),"shift"!==t&&"splice"!==t||0!==r.length||delete r[0],$(this,r)}})),g.each(["concat","join","slice"],(function(t){var e=s[t];g.prototype[t]=function(){return $(this,e.apply(this._wrapped,arguments))}})),g.prototype.value=function(){return this._wrapped},g.prototype.valueOf=g.prototype.toJSON=g.prototype.value,g.prototype.toString=function(){return String(this._wrapped)},void 0===(i=function(){return g}.apply(e,[]))||(r.exports=i)}()}).call(this,r(0),r(9)(t))},function(t,e,r){var i=r(48),n=r(49);t.exports={errors:i,formatters:n}},function(t,e){var r,i,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var h,u=[],f=!1,l=-1;function c(){f&&h&&(f=!1,h.length?u=h.concat(u):l=-1,u.length&&d())}function d(){if(!f){var t=a(c);f=!0;for(var e=u.length;e;){for(h=u,u=[];++l1)for(var r=1;r=0&&(o=r.type.substring(s));var a=t(e,r.components);i.isArray(a)&&e?n.push("tuple("+a.join(",")+")"+o):e?n.push("("+a+")"):n.push("("+a.join(",")+")"+o)}else n.push(r.type)})),n},u=function(t){if(!o.isHexStrict(t))throw new Error("The parameter must be a valid HEX string.");var e="",r=0,i=t.length;for("0x"===t.substring(0,2)&&(r=2);r7?r+=t[i].toUpperCase():r+=t[i];return r},toHex:o.toHex,toBN:o.toBN,bytesToHex:o.bytesToHex,hexToBytes:o.hexToBytes,hexToNumberString:o.hexToNumberString,hexToNumber:o.hexToNumber,toDecimal:o.hexToNumber,numberToHex:o.numberToHex,fromDecimal:o.numberToHex,hexToUtf8:o.hexToUtf8,hexToString:o.hexToUtf8,toUtf8:o.hexToUtf8,utf8ToHex:o.utf8ToHex,stringToHex:o.utf8ToHex,fromUtf8:o.utf8ToHex,hexToAscii:u,toAscii:u,asciiToHex:f,fromAscii:f,unitMap:n.unitMap,toWei:function(t,e){if(e=l(e),!o.isBN(t)&&!i.isString(t))throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return o.isBN(t)?n.toWei(t,e):n.toWei(t,e).toString(10)},fromWei:function(t,e){if(e=l(e),!o.isBN(t)&&!i.isString(t))throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return o.isBN(t)?n.fromWei(t,e):n.fromWei(t,e).toString(10)},padLeft:o.leftPad,leftPad:o.leftPad,padRight:o.rightPad,rightPad:o.rightPad,toTwosComplement:o.toTwosComplement,isBloom:o.isBloom,isUserEthereumAddressInBloom:o.isUserEthereumAddressInBloom,isContractAddressInBloom:o.isContractAddressInBloom,isTopic:o.isTopic,isTopicInBloom:o.isTopicInBloom,isInBloom:o.isInBloom}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},function(t,e,r){var i=r(14),n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=l;var o=Object.create(r(12));o.inherits=r(6);var s=r(28),a=r(32);o.inherits(l,s);for(var h=n(a.prototype),u=0;u=256||parseInt(String(r))!=r)return!1}return!0}function h(t){if(null==t&&n.throwError("cannot convert null value to array",n.INVALID_ARGUMENT,{arg:"value",value:t}),o(t)&&(t=t.toHexString()),"string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],i=0;i>4]+"0123456789abcdef"[15&h])}return"0x"+i.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function c(t,e){for(f(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function d(t){var e,r=0,i="0x",o="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&n.throwError("at least on of recoveryParam or v must be specified",n.INVALID_ARGUMENT,{argument:"signature",value:t}),i=c(t.r,32),o=c(t.s,32),"string"==typeof(r=t.v)&&(r=parseInt(r,16));var s=t.recoveryParam;null==s&&null!=t.v&&(s=1-r%2),r=27+s}else{var a=h(t);if(65!==a.length)throw new Error("invalid signature");i=l(a.slice(0,32)),o=l(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:i,s:o,recoveryParam:r-27,v:r}}e.AddressZero="0x0000000000000000000000000000000000000000",e.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",e.isArrayish=a,e.arrayify=h,e.concat=u,e.stripZeros=function(t){var e=h(t);if(0===e.length)return e;for(var r=0;0===e[r];)r++;return r&&(e=e.slice(r)),e},e.padZeros=function(t,e){if(e<(t=h(t)).length)throw new Error("cannot pad");var r=new Uint8Array(e);return r.set(t,e-t.length),s(r)},e.isHexString=f,e.hexlify=l,e.hexDataLength=function(t){return f(t)&&t.length%2==0?(t.length-2)/2:null},e.hexDataSlice=function(t,e,r){return f(t)||n.throwError("invalid hex data",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&n.throwError("hex data length must be even",n.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,e+2*r):"0x"+t.substring(e)},e.hexStripZeros=function(t){for(f(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length>3&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},e.hexZeroPad=c,e.splitSignature=d,e.joinSignature=function(t){return l(u([(t=d(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){(function(t){!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(57).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(9)(t))},function(t,e,r){var i=r(75),n=r(76);function o(){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}e.parse=b,e.resolve=function(t,e){return b(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?b(t,!1,!0).resolveObject(e):e},e.format=function(t){return n.isString(t)&&(t=b(t)),t instanceof o?t.format():o.prototype.format.call(t)},e.Url=o;var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,h=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),f=["'"].concat(u),l=["%","/","?",";","#"].concat(f),c=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=r(77);function b(t,e,r){if(t&&n.isObject(t)&&t instanceof o)return t;var i=new o;return i.parse(t,e,r),i}o.prototype.parse=function(t,e,r){if(!n.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),a=-1!==o&&o127?j+="x":j+=T[C];if(!j.match(d)){var P=R.slice(0,E),L=R.slice(E+1),q=T.match(p);q&&(P.push(q[1]),L.unshift(q[2])),L.length&&(b="/"+L.join(".")+b),this.hostname=P.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=i.toASCII(this.hostname));var D=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+D,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[_])for(E=0,I=f.length;E0)&&r.host.split("@"))&&(r.auth=O.shift(),r.host=r.hostname=O.shift())),r.search=t.search,r.query=t.query,n.isNull(r.pathname)&&n.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var k=S.slice(-1)[0],A=(r.host||t.host||S.length>1)&&("."===k||".."===k)||""===k,E=0,B=S.length;B>=0;B--)"."===(k=S[B])?S.splice(B,1):".."===k?(S.splice(B,1),E++):E&&(S.splice(B,1),E--);if(!M&&!_)for(;E--;E)S.unshift("..");!M||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),A&&"/"!==S.join("/").substr(-1)&&S.push("");var O,R=""===S[0]||S[0]&&"/"===S[0].charAt(0);return x&&(r.hostname=r.host=R?"":S.length?S.shift():"",(O=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=O.shift(),r.host=r.hostname=O.shift())),(M=M||r.host&&S.length)&&!R&&S.unshift(""),S.length?r.pathname=S.join("/"):(r.pathname=null,r.path=null),n.isNull(r.pathname)&&n.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,r){(function(t){function r(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===r(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===r(t)},e.isObject=function(t){return"object"==typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===r(t)},e.isError=function(t){return"[object Error]"===r(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=t.isBuffer}).call(this,r(1).Buffer)},function(t,e){t.exports=y},function(t,e,r){(function(e){void 0===e||!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,r,i,n){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick((function(){t.call(null,r)}));case 3:return e.nextTick((function(){t.call(null,r,i)}));case 4:return e.nextTick((function(){t.call(null,r,i,n)}));default:for(o=new Array(a-1),s=0;sr&&o("too many arguments"+i,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){i&&o("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),n=!!t,i=!!r}},function(t,e,r){(function(t){var i=r(83),n=r(26),o=r(93),s=r(94),a=r(11),h=e;h.request=function(e,r){e="string"==typeof e?a.parse(e):o(e);var n=-1===t.location.protocol.search(/^https?:$/)?"http:":"",s=e.protocol||n,h=e.hostname||e.host,u=e.port,f=e.path||"/";h&&-1!==h.indexOf(":")&&(h="["+h+"]"),e.url=(h?s+"//"+h:"")+(u?":"+u:"")+f,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var l=new i(e);return r&&l.on("response",r),l},h.get=function(t,e){var r=h.request(t,e);return r.end(),r},h.ClientRequest=i,h.IncomingMessage=n.IncomingMessage,h.Agent=function(){},h.Agent.defaultMaxSockets=4,h.globalAgent=new h.Agent,h.STATUS_CODES=s,h.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,r(0))},function(t,e,r){var i=r(1),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=s),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){this.listeners={}}return t.prototype.addEventListener=function(t,e){t=t.toLowerCase(),this.listeners[t]=this.listeners[t]||[],this.listeners[t].push(e.handleEvent||e)},t.prototype.removeEventListener=function(t,e){if(t=t.toLowerCase(),this.listeners[t]){var r=this.listeners[t].indexOf(e.handleEvent||e);r<0||this.listeners[t].splice(r,1)}},t.prototype.dispatchEvent=function(t){var e=t.type.toLowerCase();if(t.target=this,this.listeners[e])for(var r=0,i=this.listeners[e];r0&&t.topics.length!==i+1&&(e={anonymous:!0,inputs:[]})}var n=e.anonymous?t.topics:t.topics.slice(1);return r.returnValues=l.decodeLog(e.inputs,t.data,n),delete r.returnValues.__length__,r.event=e.name,r.signature=e.anonymous||!t.topics[0]?null:t.topics[0],r.raw={data:r.data,topics:r.topics},delete r.data,delete r.topics,r},c.prototype._encodeMethodABI=function(){var t=this._method.signature,e=this.arguments||[],r=!1,n=this._parent.options.jsonInterface.filter((function(e){return"constructor"===t&&e.type===t||(e.signature===t||e.signature===t.replace("0x","")||e.name===t)&&"function"===e.type})).map((function(t){var n=i.isArray(t.inputs)?t.inputs.length:0;if(n!==e.length)throw new Error("The number of arguments is not matching the methods required number. You need to pass "+n+" arguments.");return"function"===t.type&&(r=t.signature),i.isArray(t.inputs)?t.inputs:[]})).map((function(t){return l.encodeParameters(t,e).replace("0x","")}))[0]||"";if("constructor"===t){if(!this._deployData)throw new Error("The contract has no contract data option set. This is necessary to append the constructor parameters.");return this._deployData+n}var o=r?r+n:n;if(o)return o;throw new Error("Couldn't find a matching contract method named \""+this._method.name+'".')},c.prototype._decodeMethodReturn=function(t,e){if(!e)return null;e=e.length>=2?e.slice(2):e;var r=l.decodeParameters(t,e);return 1===r.__length__?r[0]:(delete r.__length__,r)},c.prototype.deploy=function(t,e){if((t=t||{}).arguments=t.arguments||[],!(t=this._getOrSetDefaultOptions(t)).data)return s._fireError(new Error('No "data" specified in neither the given options, nor the default options.'),null,null,e);var r=i.find(this.options.jsonInterface,(function(t){return"constructor"===t.type}))||{};return r.signature="constructor",this._createTxObject.apply({method:r,parent:this,deployData:t.data,_ethAccounts:this.constructor._ethAccounts},t.arguments)},c.prototype._generateEventOptions=function(){var t=Array.prototype.slice.call(arguments),e=this._getCallback(t),r=i.isObject(t[t.length-1])?t.pop():{},n=i.isString(t[0])?t[0]:"allevents",o="allevents"===n.toLowerCase()?{name:"ALLEVENTS",jsonInterface:this.options.jsonInterface}:this.options.jsonInterface.find((function(t){return"event"===t.type&&(t.name===n||t.signature==="0x"+n.replace("0x",""))}));if(!o)throw new Error('Event "'+n+"\" doesn't exist in this contract.");if(!s.isAddress(this.options.address))throw new Error("This contract object doesn't have address set yet, please set an address first.");return{params:this._encodeEventABI(o,r),event:o,callback:e}},c.prototype.clone=function(){return new this.constructor(this.options.jsonInterface,this.options.address,this.options)},c.prototype.once=function(t,e,r){var n=Array.prototype.slice.call(arguments);if(!(r=this._getCallback(n)))throw new Error("Once requires a callback as the second parameter.");e&&delete e.fromBlock,this._on(t,e,(function(t,e,n){n.unsubscribe(),i.isFunction(r)&&r(t,e,n)}))},c.prototype._on=function(){var t=this._generateEventOptions.apply(this,arguments);this._checkListener("newListener",t.event.name,t.callback),this._checkListener("removeListener",t.event.name,t.callback);var e=new a({subscription:{params:1,inputFormatter:[h.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(t.event),subscriptionHandler:function(t){t.removed?this.emit("changed",t):this.emit("data",t),i.isFunction(this.callback)&&this.callback(null,t,this)}},type:"eth",requestManager:this._requestManager});return e.subscribe("logs",t.params,t.callback||function(){}),e},c.prototype.getPastEvents=function(){var t=this._generateEventOptions.apply(this,arguments),e=new o({name:"getPastLogs",call:"eth_getLogs",params:1,inputFormatter:[h.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(t.event)});e.setRequestManager(this._requestManager);var r=e.buildCall();return e=null,r(t.params,t.callback)},c.prototype._createTxObject=function(){var t=Array.prototype.slice.call(arguments),e={};if("function"===this.method.type&&(e.call=this.parent._executeMethod.bind(e,"call"),e.call.request=this.parent._executeMethod.bind(e,"call",!0)),e.send=this.parent._executeMethod.bind(e,"send"),e.send.request=this.parent._executeMethod.bind(e,"send",!0),e.encodeABI=this.parent._encodeMethodABI.bind(e),e.estimateGas=this.parent._executeMethod.bind(e,"estimate"),t&&this.method.inputs&&t.length!==this.method.inputs.length){if(this.nextMethod)return this.nextMethod.apply(null,t);throw u.InvalidNumberOfParams(t.length,this.method.inputs.length,this.method.name)}return e.arguments=t||[],e._method=this.method,e._parent=this.parent,e._ethAccounts=this.parent.constructor._ethAccounts||this._ethAccounts,this.deployData&&(e._deployData=this.deployData),e},c.prototype._processExecuteArguments=function(t,e){var r={};if(r.type=t.shift(),r.callback=this._parent._getCallback(t),"call"===r.type&&!0!==t[t.length-1]&&(i.isString(t[t.length-1])||isFinite(t[t.length-1]))&&(r.defaultBlock=t.pop()),r.options=i.isObject(t[t.length-1])?t.pop():{},r.generateRequest=!0===t[t.length-1]&&t.pop(),r.options=this._parent._getOrSetDefaultOptions(r.options),r.options.data=this.encodeABI(),!this._deployData&&!s.isAddress(this._parent.options.address))throw new Error("This contract object doesn't have address set yet, please set an address first.");return this._deployData||(r.options.to=this._parent.options.address),r.options.data?r:s._fireError(new Error("Couldn't find a matching contract method, or the number of parameters is wrong."),e.eventEmitter,e.reject,r.callback)},c.prototype._executeMethod=function(){var t=this,e=this._parent._processExecuteArguments.call(this,Array.prototype.slice.call(arguments),r),r=f("send"!==e.type),n=t.constructor._ethAccounts||t._ethAccounts;if(e.generateRequest){var a={params:[h.inputCallFormatter.call(this._parent,e.options)],callback:e.callback};return"call"===e.type?(a.params.push(h.inputDefaultBlockNumberFormatter.call(this._parent,e.defaultBlock)),a.method="eth_call",a.format=this._parent._decodeMethodReturn.bind(null,this._method.outputs)):a.method="eth_sendTransaction",a}switch(e.type){case"estimate":var u=new o({name:"estimateGas",call:"eth_estimateGas",params:1,inputFormatter:[h.inputCallFormatter],outputFormatter:s.hexToNumber,requestManager:t._parent._requestManager,accounts:n,defaultAccount:t._parent.defaultAccount,defaultBlock:t._parent.defaultBlock}).createFunction();return u(e.options,e.callback);case"call":var c=new o({name:"call",call:"eth_call",params:2,inputFormatter:[h.inputCallFormatter,h.inputDefaultBlockNumberFormatter],outputFormatter:function(e){return t._parent._decodeMethodReturn(t._method.outputs,e)},requestManager:t._parent._requestManager,accounts:n,defaultAccount:t._parent.defaultAccount,defaultBlock:t._parent.defaultBlock,handleRevert:t._parent.handleRevert,abiCoder:l}).createFunction();return c(e.options,e.defaultBlock,e.callback);case"send":if(!s.isAddress(e.options.from))return s._fireError(new Error('No "from" address specified in neither the given options, nor the default options.'),r.eventEmitter,r.reject,e.callback);if(i.isBoolean(this._method.payable)&&!this._method.payable&&e.options.value&&e.options.value>0)return s._fireError(new Error("Can not send value to non-payable contract method or constructor"),r.eventEmitter,r.reject,e.callback);var d={receiptFormatter:function(e){if(i.isArray(e.logs)){var r=i.map(e.logs,(function(e){return t._parent._decodeEventABI.call({name:"ALLEVENTS",jsonInterface:t._parent.options.jsonInterface},e)}));e.events={};var n=0;r.forEach((function(t){t.event?e.events[t.event]?Array.isArray(e.events[t.event])?e.events[t.event].push(t):e.events[t.event]=[e.events[t.event],t]:e.events[t.event]=t:(e.events[n]=t,n++)})),delete e.logs}return e},contractDeployFormatter:function(e){var r=t._parent.clone();return r.options.address=e.contractAddress,r}},p=new o({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[h.inputTransactionFormatter],requestManager:t._parent._requestManager,accounts:t.constructor._ethAccounts||t._ethAccounts,defaultAccount:t._parent.defaultAccount,defaultBlock:t._parent.defaultBlock,transactionBlockTimeout:t._parent.transactionBlockTimeout,transactionConfirmationBlocks:t._parent.transactionConfirmationBlocks,transactionPollingTimeout:t._parent.transactionPollingTimeout,defaultCommon:t._parent.defaultCommon,defaultChain:t._parent.defaultChain,defaultHardfork:t._parent.defaultHardfork,handleRevert:t._parent.handleRevert,extraFormatters:d,abiCoder:l}).createFunction();return p(e.options,e.callback)}},t.exports=c},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){var i=r(54),n=r(55);t.exports=function(t){if("string"==typeof t||"number"==typeof t){var e=new i(1),r=String(t).toLowerCase().trim(),o="0x"===r.substr(0,2)||"-0x"===r.substr(0,3),s=n(r);if("-"===s.substr(0,1)&&(s=n(s.slice(1)),e=new i(-1,10)),!(s=""===s?"0":s).match(/^-?[0-9]+$/)&&s.match(/^[0-9A-Fa-f]+$/)||s.match(/^[a-fA-F]+$/)||!0===o&&s.match(/^[0-9A-Fa-f]+$/))return new i(s,16).mul(e);if((s.match(/^-?[0-9]+$/)||""===s)&&!1===o)return new i(s,10).mul(e)}else if("object"==typeof t&&t.toString&&!t.pop&&!t.push&&t.toString(10).match(/^-?[0-9]+$/)&&(t.mul||t.dividedToIntegerBy))return new i(t.toString(10),10);throw new Error("[number-to-bn] while converting number "+JSON.stringify(t)+" to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.")}},function(t,e,r){(function(e){var i=r(2),n=r(10),o=r(22),s=r(58),a=r(59),h=r(60),u=function(t){return n.isBN(t)},f=function(t){return t&&t.constructor&&"BigNumber"===t.constructor.name},l=function(t){try{return o.apply(null,arguments)}catch(e){throw new Error(e+' Given value: "'+t+'"')}},c=function(t){return!!/^(0x)?[0-9a-f]{40}$/i.test(t)&&(!(!/^(0x|0X)?[0-9a-f]{40}$/.test(t)&&!/^(0x|0X)?[0-9A-F]{40}$/.test(t))||d(t))},d=function(t){t=t.replace(/^0x/i,"");for(var e=b(t.toLowerCase()).replace(/^0x/i,""),r=0;r<40;r++)if(parseInt(e[r],16)>7&&t[r].toUpperCase()!==t[r]||parseInt(e[r],16)<=7&&t[r].toLowerCase()!==t[r])return!1;return!0},p=function(t){var e="";t=(t=(t=(t=(t=s.encode(t)).replace(/^(?:\u0000)*/,"")).split("").reverse().join("")).replace(/^(?:\u0000)*/,"")).split("").reverse().join("");for(var r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return"0x"+e.join("")},isHex:function(t){return(i.isString(t)||i.isNumber(t))&&/^(-0x|0x)?[0-9a-f]*$/i.test(t)},isHexStrict:g,leftPad:function(t,e,r){var i=/^0x/i.test(t)||"number"==typeof t,n=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(i?"0x":"")+new Array(n).join(r||"0")+t},rightPad:function(t,e,r){var i=/^0x/i.test(t)||"number"==typeof t,n=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(i?"0x":"")+t+new Array(n).join(r||"0")},toTwosComplement:function(t){return"0x"+l(t).toTwos(256).toString(16,64)},sha3:b,sha3Raw:function(t){return null===(t=b(t))?y:t}}}).call(this,r(1).Buffer)},function(t,e,r){var i={messageId:0,toPayload:function(t,e){if(!t)throw new Error('JSONRPC method should be specified for params: "'+JSON.stringify(e)+'"!');return i.messageId++,{jsonrpc:"2.0",id:i.messageId,method:t,params:e||[]}},isValidResponse:function(t){return Array.isArray(t)?t.every(e):e(t);function e(t){return!(!t||t.error||"2.0"!==t.jsonrpc||"number"!=typeof t.id&&"string"!=typeof t.id||void 0===t.result)}},toBatchPayload:function(t){return t.map((function(t){return i.toPayload(t.method,t.params)}))}};t.exports=i},function(t,e,r){(function(t){e.fetch=a(t.fetch)&&a(t.ReadableStream),e.writableStream=a(t.WritableStream),e.abortController=a(t.AbortController),e.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),e.blobConstructor=!0}catch(t){}var r;function i(){if(void 0!==r)return r;if(t.XMLHttpRequest){r=new t.XMLHttpRequest;try{r.open("GET",t.XDomainRequest?"/":"https://example.com")}catch(t){r=null}}else r=null;return r}function n(t){var e=i();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch(t){}return!1}var o=void 0!==t.ArrayBuffer,s=o&&a(t.ArrayBuffer.prototype.slice);function a(t){return"function"==typeof t}e.arraybuffer=e.fetch||o&&n("arraybuffer"),e.msstream=!e.fetch&&s&&n("ms-stream"),e.mozchunkedarraybuffer=!e.fetch&&o&&n("moz-chunked-arraybuffer"),e.overrideMimeType=e.fetch||!!i()&&a(i().overrideMimeType),e.vbArray=a(t.VBArray),r=null}).call(this,r(0))},function(t,e,r){(function(t,i,n){var o=r(25),s=r(6),a=r(27),h=e.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},u=e.IncomingMessage=function(e,r,s,h){var u=this;if(a.Readable.call(u),u._mode=s,u.headers={},u.rawHeaders=[],u.trailers={},u.rawTrailers=[],u.on("end",(function(){t.nextTick((function(){u.emit("close")}))})),"fetch"===s){if(u._fetchResponse=r,u.url=r.url,u.statusCode=r.status,u.statusMessage=r.statusText,r.headers.forEach((function(t,e){u.headers[e.toLowerCase()]=t,u.rawHeaders.push(e,t)})),o.writableStream){var f=new WritableStream({write:function(t){return new Promise((function(e,r){u._destroyed?r():u.push(new i(t))?e():u._resumeFetch=e}))},close:function(){n.clearTimeout(h),u._destroyed||u.push(null)},abort:function(t){u._destroyed||u.emit("error",t)}});try{return void r.body.pipeTo(f).catch((function(t){n.clearTimeout(h),u._destroyed||u.emit("error",t)}))}catch(t){}}var l=r.body.getReader();!function t(){l.read().then((function(e){if(!u._destroyed){if(e.done)return n.clearTimeout(h),void u.push(null);u.push(new i(e.value)),t()}})).catch((function(t){n.clearTimeout(h),u._destroyed||u.emit("error",t)}))}()}else if(u._xhr=e,u._pos=0,u.url=e.responseURL,u.statusCode=e.status,u.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(t){var e=t.match(/^([^:]+):\s*(.*)/);if(e){var r=e[1].toLowerCase();"set-cookie"===r?(void 0===u.headers[r]&&(u.headers[r]=[]),u.headers[r].push(e[2])):void 0!==u.headers[r]?u.headers[r]+=", "+e[2]:u.headers[r]=e[2],u.rawHeaders.push(e[1],e[2])}})),u._charset="x-user-defined",!o.overrideMimeType){var c=u.rawHeaders["mime-type"];if(c){var d=c.match(/;\s*charset=([^;])(;|$)/);d&&(u._charset=d[1].toLowerCase())}u._charset||(u._charset="utf-8")}};s(u,a.Readable),u.prototype._read=function(){var t=this._resumeFetch;t&&(this._resumeFetch=null,t())},u.prototype._onXHRProgress=function(){var t=this,e=t._xhr,r=null;switch(t._mode){case"text:vbarray":if(e.readyState!==h.DONE)break;try{r=new n.VBArray(e.responseBody).toArray()}catch(t){}if(null!==r){t.push(new i(r));break}case"text":try{r=e.responseText}catch(e){t._mode="text:vbarray";break}if(r.length>t._pos){var o=r.substr(t._pos);if("x-user-defined"===t._charset){for(var s=new i(o.length),a=0;at._pos&&(t.push(new i(new Uint8Array(u.result.slice(t._pos)))),t._pos=u.result.byteLength)},u.onload=function(){t.push(null)},u.readAsArrayBuffer(r)}t._xhr.readyState===h.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,r(4),r(1).Buffer,r(0))},function(t,e,r){(e=t.exports=r(28)).Stream=e,e.Readable=e,e.Writable=r(32),e.Duplex=r(7),e.Transform=r(34),e.PassThrough=r(91)},function(t,e,r){(function(e,i){var n=r(14);t.exports=b;var o,s=r(21);b.ReadableState=y,r(29).EventEmitter;var a=function(t,e){return t.listeners(e).length},h=r(30),u=r(17).Buffer,f=e.Uint8Array||function(){},l=Object.create(r(12));l.inherits=r(6);var c=r(84),d=void 0;d=c&&c.debuglog?c.debuglog("stream"):function(){};var p,m=r(85),v=r(31);l.inherits(b,h);var g=["error","close","destroy","pause","resume"];function y(t,e){t=t||{};var i=e instanceof(o=o||r(7));this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,s=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,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.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=r(33).StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function b(t){if(o=o||r(7),!(this instanceof b))return new b(t);this._readableState=new y(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),h.call(this)}function w(t,e,r,i,n){var o,s=t._readableState;return null===e?(s.reading=!1,function(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,S(t)}}(t,s)):(n||(o=function(t,e){var r,i;return i=e,u.isBuffer(i)||i instanceof f||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(s,e)),o?t.emit("error",o):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),i?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):M(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?M(t,s,e,!1):k(t,s)):M(t,s,e,!1))):i||(s.reading=!1)),function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=8388608?t=8388608:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function S(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(d("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?n.nextTick(x,t):x(t))}function x(t){d("emit readable"),t.emit("readable"),O(t)}function k(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(A,t,e))}function A(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var i;return to.length?o.length:t;if(s===o.length?n+=o:n+=o.slice(0,t),0==(t-=s)){s===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++i}return e.length-=i,n}(t,e):function(t,e){var r=u.allocUnsafe(t),i=e.head,n=1;for(i.data.copy(r),t-=i.data.length;i=i.next;){var o=i.data,s=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,s),0==(t-=s)){s===o.length?(++n,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=o.slice(s));break}++n}return e.length-=n,r}(t,e),i}(t,e.buffer,e.decoder),r);var r}function I(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,n.nextTick(T,e,t))}function T(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function j(t,e){for(var r=0,i=t.length;r=e.highWaterMark||e.ended))return d("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?I(this):S(this),null;if(0===(t=_(t,e))&&e.ended)return 0===e.length&&I(this),null;var i,n=e.needReadable;return d("need readable",n),(0===e.length||e.length-t0?R(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&I(this)),null!==i&&this.emit("data",i),i},b.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(t,e){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,e);var h=e&&!1===e.end||t===i.stdout||t===i.stderr?y:u;function u(){d("onend"),t.end()}o.endEmitted?n.nextTick(h):r.once("end",h),t.on("unpipe",(function e(i,n){d("onunpipe"),i===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d("cleanup"),t.removeListener("close",v),t.removeListener("finish",g),t.removeListener("drain",f),t.removeListener("error",m),t.removeListener("unpipe",e),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",p),l=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}));var f=function(t){return function(){var e=t._readableState;d("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,O(t))}}(r);t.on("drain",f);var l=!1,c=!1;function p(e){d("ondata"),c=!1,!1!==t.write(e)||c||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==j(o.pipes,t))&&!l&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,c=!0),r.pause())}function m(e){d("onerror",e),y(),t.removeListener("error",m),0===a(t,"error")&&t.emit("error",e)}function v(){t.removeListener("finish",g),y()}function g(){d("onfinish"),t.removeListener("close",v),y()}function y(){d("unpipe"),r.unpipe(t)}return r.on("data",p),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?s(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",m),t.once("close",v),t.once("finish",g),t.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),t},b.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0&&s.length>n&&!s.warned){s.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=t,h.type=e,h.count=s.length,a=h,console&&console.warn&&console.warn(a)}return t}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=c.bind(i);return n.listener=r,i.wrapFn=n,n}function p(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var h=n[t];if(void 0===h)return!1;if("function"==typeof h)o(h,this,e);else{var u=h.length,f=v(h,u);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},a.prototype.listeners=function(t){return p(this,t,!0)},a.prototype.rawListeners=function(t){return p(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},function(t,e,r){t.exports=r(29).EventEmitter},function(t,e,r){var i=r(14);function n(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||i.nextTick(n,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?(i.nextTick(n,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(t,e,r){(function(e,i,n){var o=r(14);function s(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(void 0),i=i.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=y;var a,h=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?i:o.nextTick;y.WritableState=g;var u=Object.create(r(12));u.inherits=r(6);var f,l={deprecate:r(89)},c=r(30),d=r(17).Buffer,p=n.Uint8Array||function(){},m=r(31);function v(){}function g(t,e){a=a||r(7),t=t||{};var i=e instanceof a;this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var n=t.highWaterMark,u=t.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i&&(u||0===u)?u:f,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 l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,i,n){--e.pendingcb,r?(o.nextTick(n,i),o.nextTick(x,t,e),t._writableState.errorEmitted=!0,t.emit("error",i)):(n(i),t._writableState.errorEmitted=!0,t.emit("error",i),x(t,e))}(t,r,i,e,n);else{var s=_(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||M(t,r),i?h(w,t,r,s,n):w(t,r,s,n)}}(e,t)},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 s(this)}function y(t){if(a=a||r(7),!(f.call(y,this)||this instanceof a))return new y(t);this._writableState=new g(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),c.call(this)}function b(t,e,r,i,n,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function w(t,e,r,i){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,i(),x(t,e)}function M(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,n=new Array(i),o=e.corkedRequestsFree;o.entry=r;for(var a=0,h=!0;r;)n[a]=r,r.isBuf||(h=!1),r=r.next,a+=1;n.allBuffers=h,b(t,e,!0,e.length,n,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new s(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,f=r.encoding,l=r.callback;if(b(t,e,!1,e.objectMode?1:u.length,u,f,l),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function _(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function S(t,e){t._final((function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),x(t,e)}))}function x(t,e){var r=_(e);return r&&(function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(S,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}u.inherits(y,c),g.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(g.prototype,"buffer",{get:l.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(t){return!!f.call(this,t)||this===y&&t&&t._writableState instanceof g}})):f=function(t){return t instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(t,e,r){var i,n=this._writableState,s=!1,a=!n.objectMode&&(i=t,d.isBuffer(i)||i instanceof p);return a&&!d.isBuffer(t)&&(t=function(t){return d.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=v),n.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),o.nextTick(e,r)}(this,r):(a||function(t,e,r,i){var n=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),o.nextTick(i,s),n=!1),n}(this,n,t,r))&&(n.pendingcb++,s=function(t,e,r,i,n,o){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=d.from(e,r)),e}(e,i,n);i!==s&&(r=!0,n="buffer",i=s)}var a=e.objectMode?1:i.length;e.length+=a;var h=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(t,e,r){var i=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||function(t,e,r){e.ending=!0,x(t,e),r&&(e.finished?o.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,i,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,r(4),r(87).setImmediate,r(0))},function(t,e,r){var i=r(90).Buffer,n=i.isEncoding||function(t){switch((t=""+t)&&t.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}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===n||!n(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=h,this.end=u,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=f,this.end=l,e=3;break;default:return this.write=c,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function h(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function c(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(n>0&&(t.lastNeed=n-1),n):--i=0?(n>0&&(t.lastNeed=n-2),n):--i=0?(n>0&&(2===n?n=0:t.lastNeed=n-3),n):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,r){t.exports=s;var i=r(7),n=Object.create(r(12));function o(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(!i)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=e&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length1?(t[r[0]]=t[r[0]]||{},t[r[0]][r[1]]=e):t[r[0]]=e},u.prototype.getCall=function(t){return i.isFunction(this.call)?this.call(t):this.call},u.prototype.extractCallback=function(t){if(i.isFunction(t[t.length-1]))return t.pop()},u.prototype.validateArgs=function(t){if(t.length!==this.params)throw n.InvalidNumberOfParams(t.length,this.params,this.name)},u.prototype.formatInput=function(t){var e=this;return this.inputFormatter?this.inputFormatter.map((function(r,i){return r?r.call(e,t[i]):t[i]})):t},u.prototype.formatOutput=function(t){var e=this;return i.isArray(t)?t.map((function(t){return e.outputFormatter&&t?e.outputFormatter(t):t})):this.outputFormatter&&t?this.outputFormatter(t):t},u.prototype.toPayload=function(t){var e=this.getCall(t),r=this.extractCallback(t),i=this.formatInput(t);this.validateArgs(i);var n={method:e,params:i,callback:r};return this.transformPayload&&(n=this.transformPayload(n)),n},u.prototype._confirmTransaction=function(t,e,r){var f=this,l=!1,p=!0,m=0,v=0,g=null,y=null,b=i.isObject(r.params[0])&&r.params[0].gas?r.params[0].gas:null,w=i.isObject(r.params[0])&&r.params[0].data&&r.params[0].from&&!r.params[0].to,M=w&&r.params[0].data.length>2,_=[new u({name:"getBlockByNumber",call:"eth_getBlockByNumber",params:2,inputFormatter:[o.inputBlockNumberFormatter,function(t){return!!t}],outputFormatter:o.outputBlockFormatter}),new u({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:o.outputTransactionReceiptFormatter}),new u({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[o.inputAddressFormatter,o.inputDefaultBlockNumberFormatter]}),new h({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:o.outputBlockFormatter}}})],S={};i.each(_,(function(t){t.attachToObject(S),t.requestManager=f.requestManager}));var x=function(i,o,h,u,_){if(!h)return _||(_={unsubscribe:function(){clearInterval(g)}}),(i?a.resolve(i):S.getTransactionReceipt(e)).catch((function(e){_.unsubscribe(),l=!0,s._fireError({message:"Failed to check for transaction receipt:",data:e},t.eventEmitter,t.reject)})).then(function(){var e=Object(d.a)(c.a.mark((function e(r){var n;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&r.blockHash){e.next=2;break}throw new Error("Receipt missing or blockHash null");case 2:if(f.extraFormatters&&f.extraFormatters.receiptFormatter&&(r=f.extraFormatters.receiptFormatter(r)),e.t0=t.eventEmitter.listeners("confirmation").length>0,!e.t0){e.next=27;break}if(e.t1=void 0!==i&&0===v,e.t1){e.next=24;break}if(!o){e.next=23;break}if(!y){e.next=16;break}return e.next=11,S.getBlockByNumber(y.number+1);case 11:if(e.t2=n=e.sent,!e.t2){e.next=14;break}y=n,t.eventEmitter.emit("confirmation",v,r);case 14:e.next=21;break;case 16:return e.next=18,S.getBlockByNumber(r.blockNumber);case 18:n=e.sent,y=n,t.eventEmitter.emit("confirmation",v,r);case 21:e.next=24;break;case 23:t.eventEmitter.emit("confirmation",v,r);case 24:(o&&n||!o)&&v++,p=!1,v===f.transactionConfirmationBlocks+1&&(_.unsubscribe(),t.eventEmitter.removeAllListeners());case 27:return e.abrupt("return",r);case 28:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).then(function(){var e=Object(d.a)(c.a.mark((function e(r){var i;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!w||l){e.next=14;break}if(r.contractAddress){e.next=3;break}return e.abrupt("return",(p&&(_.unsubscribe(),l=!0),void s._fireError(n.NoContractAddressFoundError(r),t.eventEmitter,t.reject,null,r)));case 3:return e.prev=3,e.next=6,S.getCode(r.contractAddress);case 6:i=e.sent,e.next=11;break;case 9:e.prev=9,e.t0=e.catch(3);case 11:if(i){e.next=13;break}return e.abrupt("return");case 13:!0===r.status&&M||i.length>2?(t.eventEmitter.emit("receipt",r),f.extraFormatters&&f.extraFormatters.contractDeployFormatter?t.resolve(f.extraFormatters.contractDeployFormatter(r)):t.resolve(r),p&&t.eventEmitter.removeAllListeners()):s._fireError(n.ContractCodeNotStoredError(r),t.eventEmitter,t.reject,null,r),p&&_.unsubscribe(),l=!0;case 14:return e.abrupt("return",r);case 15:case"end":return e.stop()}}),e,null,[[3,9]])})));return function(t){return e.apply(this,arguments)}}()).then(function(){var e=Object(d.a)(c.a.mark((function e(i){var o;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(w||l){e.next=23;break}if(!(i.outOfGas||b&&b===i.gasUsed||!0!==i.status&&"0x1"!==i.status&&void 0!==i.status)){e.next=21;break}if(JSON.stringify(i,null,2),!1!==i.status&&"0x0"!==i.status){e.next=18;break}if(e.prev=3,f.handleRevert&&"eth_sendTransaction"===f.call){e.next=6;break}throw!1;case 6:return e.next=8,f.getRevertReason(r.params[0],i.blockNumber);case 8:if(o=e.sent){e.next=10;break}throw!1;case 10:s._fireError(n.TransactionRevertInstructionError(o.reason,o.signature,i),t.eventEmitter,t.reject,null,i),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(3),s._fireError(n.TransactionRevertedWithoutReasonError(i),t.eventEmitter,t.reject,null,i);case 16:e.next=19;break;case 18:s._fireError(n.TransactionOutOfGasError(i),t.eventEmitter,t.reject,null,i);case 19:e.next=22;break;case 21:t.eventEmitter.emit("receipt",i),t.resolve(i),p&&t.eventEmitter.removeAllListeners();case 22:p&&_.unsubscribe(),l=!0;case 23:case"end":return e.stop()}}),e,null,[[3,13]])})));return function(t){return e.apply(this,arguments)}}()).catch((function(){m++,o?m-1>=f.transactionPollingTimeout&&(_.unsubscribe(),l=!0,s._fireError(n.TransactionError("Transaction was not mined within "+f.transactionPollingTimeout+" seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!"),t.eventEmitter,t.reject)):m-1>=f.transactionBlockTimeout&&(_.unsubscribe(),l=!0,s._fireError(n.TransactionError("Transaction was not mined within "+f.transactionBlockTimeout+" blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!"),t.eventEmitter,t.reject))}));_.unsubscribe(),l=!0,s._fireError({message:"Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.",data:h},t.eventEmitter,t.reject)},k=function(t){i.isFunction(this.requestManager.provider.on)?S.subscribe("newBlockHeaders",x.bind(null,t,!1)):g=setInterval(x.bind(null,t,!0),1e3)}.bind(this);S.getTransactionReceipt(e).then((function(e){e&&e.blockHash?(t.eventEmitter.listeners("confirmation").length>0&&k(e),x(e,!1)):l||k()})).catch((function(){l||k()}))};var f=function(t,e){return i.isNumber(t)?e.wallet[t]:i.isObject(t)&&t.address&&t.privateKey?t:e.wallet[t.toLowerCase()]};u.prototype.buildCall=function(){var t=this,e="eth_sendTransaction"===t.call||"eth_sendRawTransaction"===t.call,r="eth_call"===t.call,o=function(){var o=a(!e),h=t.toPayload(Array.prototype.slice.call(arguments)),l=function(i,a){if(t.handleRevert&&!i&&r&&t.isRevertReasonString(a)&&t.abiCoder){var u=t.abiCoder.decodeParameter("string","0x"+a.substring(10));s._fireError(n.RevertInstructionError(u,"Error(String)"),o.eventEmitter,o.reject,h.callback,{reason:u,signature:"Error(String)"})}else{try{a=t.formatOutput(a)}catch(t){i=t}if(a instanceof Error&&(i=a),i)return i.error&&(i=i.error),s._fireError(i,o.eventEmitter,o.reject,h.callback);h.callback&&h.callback(null,a),e?(o.eventEmitter.emit("transactionHash",a),t._confirmTransaction(o,a,h)):i||o.resolve(a)}},c=function(e){var r=i.extend({},h,{method:"eth_sendRawTransaction",params:[e.rawTransaction]});t.requestManager.send(r,l)},d=function(t,e){var r;if(e&&e.accounts&&e.accounts.wallet&&e.accounts.wallet.length)if("eth_sendTransaction"===t.method){var n=t.params[0];if((r=f(i.isObject(n)?n.from:null,e.accounts))&&r.privateKey){var s=i.omit(n,"from");return e.defaultChain&&!s.chain&&(s.chain=e.defaultChain),e.defaultHardfork&&!s.hardfork&&(s.hardfork=e.defaultHardfork),e.defaultCommon&&!s.common&&(s.common=e.defaultCommon),e.accounts.signTransaction(s,r.privateKey).then(c).catch((function(t){i.isFunction(o.eventEmitter.listeners)&&o.eventEmitter.listeners("error").length&&(o.eventEmitter.emit("error",t),o.eventEmitter.removeAllListeners(),o.eventEmitter.catch((function(){}))),o.reject(t)}))}}else if("eth_sign"===t.method){var a=t.params[1];if((r=f(t.params[0],e.accounts))&&r.privateKey){var h=e.accounts.sign(a,r.privateKey);return t.callback&&t.callback(null,h.signature),void o.resolve(h.signature)}}return e.requestManager.send(t,l)};if(e&&i.isObject(h.params[0])&&void 0===h.params[0].gasPrice){var p=new u({name:"getGasPrice",call:"eth_gasPrice",params:0}).createFunction(t.requestManager);p((function(e,r){r&&(h.params[0].gasPrice=r),d(h,t)}))}else d(h,t);return o.eventEmitter};return o.method=t,o.request=this.request.bind(this),o},u.prototype.getRevertReason=function(t,e){var r=this;return new Promise((function(i,n){new u({name:"call",call:"eth_call",params:2,abiCoder:r.abiCoder,handleRevert:!0}).createFunction(r.requestManager)(t,s.numberToHex(e)).then((function(){i(!1)})).catch((function(t){t.reason?i({reason:t.reason,signature:t.signature}):n(t)}))}))},u.prototype.isRevertReasonString=function(t){return i.isString(t)&&(t.length-2)/2%32==4&&"0x08c379a0"===t.substring(0,10)},u.prototype.request=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));return t.format=this.formatOutput.bind(this),t},t.exports=u},function(t,e,r){var i=r(38),n=r(103),o=function(t){var e,r,o=new n((function(){e=arguments[0],r=arguments[1]}));if(t)return{resolve:e,reject:r,eventEmitter:o};var s=new i;return o._events=s._events,o.emit=s.emit,o.on=s.on,o.once=s.once,o.off=s.off,o.listeners=s.listeners,o.addListener=s.addListener,o.removeListener=s.removeListener,o.removeAllListeners=s.removeAllListeners,{resolve:e,reject:r,eventEmitter:o}};o.resolve=function(t){var e=o(!0);return e.resolve(t),e.eventEmitter},t.exports=o},function(t,e,r){var i=Object.prototype.hasOwnProperty,n="~";function o(){}function s(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function a(t,e,r,i,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new s(r,i||t,o),h=n?n+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function h(t,e){0==--t._eventsCount?t._events=new o:delete t._events[e]}function u(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(n=!1)),u.prototype.eventNames=function(){var t,e,r=[];if(0===this._eventsCount)return r;for(e in t=this._events)i.call(t,e)&&r.push(n?e.slice(1):e);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},u.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,s=new Array(o);i1?(t[r[0]]=t[r[0]]||{},t[r[0]][r[1]]=e):t[r[0]]=e},n.prototype.buildCall=function(){var t=this;return function(){t.subscriptions[arguments[0]]||console.warn("Subscription "+JSON.stringify(arguments[0])+" doesn't exist. Subscribing anyway.");var e=new i({subscription:t.subscriptions[arguments[0]],requestManager:t.requestManager,type:t.type});return e.subscribe.apply(e,arguments)}},t.exports={subscriptions:n,subscription:i}},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.BigNumber=function(){},e.Indexed=function(){},e.MinimalProvider=function(){},e.Signer=function(){},e.HDNode=function(){}},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.defineReadOnly=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})},e.defineFrozen=function(t,e,r){var i=JSON.stringify(r);Object.defineProperty(t,e,{enumerable:!0,get:function(){return JSON.parse(i)}})},e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach((function(i){var n=t[i];n instanceof Promise?r.push(n.then((function(t){return e[i]=t,null}))):e[i]=n})),Promise.all(r).then((function(){return e}))},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e},e.jsonCopy=function(t){return JSON.parse(JSON.stringify(t))}},function(t,e){t.exports=w},function(t,e){t.exports=M},function(t,e){t.exports=S},function(t){t.exports=JSON.parse('{"a":[{"constant":true,"inputs":[],"name":"currentEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"getEpochInfo","outputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"n","type":"uint256"},{"internalType":"uint256","name":"k","type":"uint256"},{"internalType":"uint256","name":"t","type":"uint256"},{"internalType":"address[]","name":"nodeList","type":"address[]"},{"internalType":"uint256","name":"prevEpoch","type":"uint256"},{"internalType":"uint256","name":"nextEpoch","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"nodeAddress","type":"address"}],"name":"getNodeDetails","outputs":[{"internalType":"string","name":"declaredIp","type":"string"},{"internalType":"uint256","name":"position","type":"uint256"},{"internalType":"uint256","name":"pubKx","type":"uint256"},{"internalType":"uint256","name":"pubKy","type":"uint256"},{"internalType":"string","name":"tmP2PListenAddress","type":"string"},{"internalType":"string","name":"p2pListenAddress","type":"string"}],"payable":false,"stateMutability":"view","type":"function"}]}')},function(t,e,r){var i=r(47),n=r(102);t.exports={packageInit:function(t,e){if(e=Array.prototype.slice.call(e),!t)throw new Error('You need to instantiate using the "new" keyword.');Object.defineProperty(t,"currentProvider",{get:function(){return t._provider},set:function(e){return t.setProvider(e)},enumerable:!0,configurable:!0}),e[0]&&e[0]._requestManager?t._requestManager=new i.Manager(e[0].currentProvider):(t._requestManager=new i.Manager,t._requestManager.setProvider(e[0],e[1])),t.givenProvider=i.Manager.givenProvider,t.providers=i.Manager.providers,t._provider=t._requestManager.provider,t.setProvider||(t.setProvider=function(e,r){return t._requestManager.setProvider(e,r),t._provider=t._requestManager.provider,!0}),t.BatchRequest=i.BatchManager.bind(null,t._requestManager),t.extend=n(t)},addProviders:function(t){t.givenProvider=i.Manager.givenProvider,t.providers=i.Manager.providers}}},function(t,e,r){var i=r(2),n=r(3).errors,o=r(24),s=r(68),a=r(69),h=function t(e){this.provider=null,this.providers=t.providers,this.setProvider(e),this.subscriptions={}};h.givenProvider=a,h.providers={WebsocketProvider:r(70),HttpProvider:r(80),IpcProvider:r(100)},h.prototype.setProvider=function(t,e){var r=this;if(t&&"string"==typeof t&&this.providers)if(/^http(s)?:\/\//i.test(t))t=new this.providers.HttpProvider(t);else if(/^ws(s)?:\/\//i.test(t))t=new this.providers.WebsocketProvider(t);else if(t&&"object"==typeof e&&"function"==typeof e.connect)t=new this.providers.IpcProvider(t,e);else if(t)throw new Error("Can't autodetect provider for \""+t+'"');this.provider&&this.provider.connected&&this.clearSubscriptions(),this.provider=t||null,this.provider&&this.provider.on&&this.provider.on("data",(function(t,e){(t=t||e).method&&r.subscriptions[t.params.subscription]&&r.subscriptions[t.params.subscription].callback&&r.subscriptions[t.params.subscription].callback(null,t.params.result)}))},h.prototype.send=function(t,e){if(e=e||function(){},!this.provider)return e(n.InvalidProvider());var r=o.toPayload(t.method,t.params);this.provider[this.provider.sendAsync?"sendAsync":"send"](r,(function(t,i){return i&&i.id&&r.id!==i.id?e(new Error('Wrong response id "'+i.id+'" (expected: "'+r.id+'") in '+JSON.stringify(r))):t?e(t):i&&i.error?e(n.ErrorResponse(i)):o.isValidResponse(i)?void e(null,i.result):e(n.InvalidResponse(i))}))},h.prototype.sendBatch=function(t,e){if(!this.provider)return e(n.InvalidProvider());var r=o.toBatchPayload(t);this.provider[this.provider.sendAsync?"sendAsync":"send"](r,(function(t,r){return t?e(t):i.isArray(r)?void e(null,r):e(n.InvalidResponse(r))}))},h.prototype.addSubscription=function(t,e,r,i){if(!this.provider.on)throw new Error("The provider doesn't support subscriptions: "+this.provider.constructor.name);this.subscriptions[t]={callback:i,type:r,name:e}},h.prototype.removeSubscription=function(t,e){this.subscriptions[t]&&(this.send({method:this.subscriptions[t].type+"_unsubscribe",params:[t]},e),delete this.subscriptions[t])},h.prototype.clearSubscriptions=function(t){var e=this;this.subscriptions&&Object.keys(this.subscriptions).forEach((function(r){t&&"syncing"===e.subscriptions[r].name||e.removeSubscription(r)})),this.provider.reset&&this.provider.reset()},t.exports={Manager:h,BatchManager:s}},function(t,e,r){t.exports={ErrorResponse:function(t){var e=t&&t.error&&t.error.message?t.error.message:JSON.stringify(t);return new Error("Returned error: "+e)},InvalidNumberOfParams:function(t,e,r){return new Error('Invalid number of parameters for "'+r+'". Got '+t+" expected "+e+"!")},InvalidConnection:function(t){return new Error("CONNECTION ERROR: Couldn't connect to node "+t+".")},InvalidProvider:function(){return new Error("Provider not set or invalid")},InvalidResponse:function(t){var e=t&&t.error&&t.error.message?t.error.message:"Invalid JSON RPC response: "+JSON.stringify(t);return new Error(e)},ConnectionTimeout:function(t){return new Error("CONNECTION TIMEOUT: timeout of "+t+" ms achived")},RevertInstructionError:function(t,e){var r=new Error("Your request got reverted with the following reason string: "+t);return r.reason=t,r.signature=e,r},TransactionRevertInstructionError:function(t,e,r){var i=new Error("Transaction has been reverted by the EVM:\n"+JSON.stringify(r,null,2));return i.reason=t,i.signature=e,i.receipt=r,i},TransactionError:function(t,e){var r=new Error(t);return r.receipt=e,r},NoContractAddressFoundError:function(t){return this.TransactionError("The transaction receipt didn't contain a contract address.",t)},ContractCodeNotStoredError:function(t){return this.TransactionError("The contract code couldn't be stored, please check your gas limit.",t)},TransactionRevertedWithoutReasonError:function(t){return this.TransactionError("Transaction has been reverted by the EVM:\n"+JSON.stringify(t,null,2),t)},TransactionOutOfGasError:function(t){return this.TransactionError("Transaction ran out of gas. Please provide more gas:\n"+JSON.stringify(t,null,2),t)}}},function(t,e,r){var i=r(2),n=r(5),o=r(67),s=function(t){return n.toBN(t).toString(10)},a=function(t){if(void 0!==t)return function(t){return"latest"===t||"pending"===t||"earliest"===t}(t)?t:"genesis"===t?"0x0":n.isHexStrict(t)?i.isString(t)?t.toLowerCase():t:n.numberToHex(t)},h=function(t){if(t.to&&(t.to=l(t.to)),t.data&&t.input)throw new Error('You can\'t have "data" and "input" as properties of transactions at the same time, please use either "data" or "input" instead.');if(!t.data&&t.input&&(t.data=t.input,delete t.input),t.data&&!n.isHex(t.data))throw new Error("The data field must be HEX encoded data.");return(t.gas||t.gasLimit)&&(t.gas=t.gas||t.gasLimit),["gasPrice","gas","value","nonce"].filter((function(e){return void 0!==t[e]})).forEach((function(e){t[e]=n.numberToHex(t[e])})),t},u=function(t){return null!==t.blockNumber&&(t.blockNumber=n.hexToNumber(t.blockNumber)),null!==t.transactionIndex&&(t.transactionIndex=n.hexToNumber(t.transactionIndex)),t.nonce=n.hexToNumber(t.nonce),t.gas=n.hexToNumber(t.gas),t.gasPrice=s(t.gasPrice),t.value=s(t.value),t.to&&n.isAddress(t.to)?t.to=n.toChecksumAddress(t.to):t.to=null,t.from&&(t.from=n.toChecksumAddress(t.from)),t},f=function(t){if("string"==typeof t.blockHash&&"string"==typeof t.transactionHash&&"string"==typeof t.logIndex){var e=n.sha3(t.blockHash.replace("0x","")+t.transactionHash.replace("0x","")+t.logIndex.replace("0x",""));t.id="log_"+e.replace("0x","").substr(0,8)}else t.id||(t.id=null);return null!==t.blockNumber&&(t.blockNumber=n.hexToNumber(t.blockNumber)),null!==t.transactionIndex&&(t.transactionIndex=n.hexToNumber(t.transactionIndex)),null!==t.logIndex&&(t.logIndex=n.hexToNumber(t.logIndex)),t.address&&(t.address=n.toChecksumAddress(t.address)),t},l=function(t){var e=new o(t);if(e.isValid()&&e.isDirect())return e.toAddress().toLowerCase();if(n.isAddress(t))return"0x"+t.toLowerCase().replace("0x","");throw new Error('Provided address "'+t+"\" is invalid, the capitalization checksum test failed, or its an indrect IBAN address which can't be converted.")};t.exports={inputDefaultBlockNumberFormatter:function(t){return a(this&&null==t?this.defaultBlock:t)},inputBlockNumberFormatter:a,inputCallFormatter:function(t){var e=(t=h(t)).from||(this?this.defaultAccount:null);return e&&(t.from=l(e)),t},inputTransactionFormatter:function(t){if(t=h(t),!i.isNumber(t.from)&&!i.isObject(t.from)){if(t.from=t.from||(this?this.defaultAccount:null),!t.from&&!i.isNumber(t.from))throw new Error('The send transactions "from" field must be defined!');t.from=l(t.from)}return t},inputAddressFormatter:l,inputPostFormatter:function(t){return t.ttl&&(t.ttl=n.numberToHex(t.ttl)),t.workToProve&&(t.workToProve=n.numberToHex(t.workToProve)),t.priority&&(t.priority=n.numberToHex(t.priority)),i.isArray(t.topics)||(t.topics=t.topics?[t.topics]:[]),t.topics=t.topics.map((function(t){return 0===t.indexOf("0x")?t:n.fromUtf8(t)})),t},inputLogFormatter:function(t){var e=function(t){return null==t?null:0===(t=String(t)).indexOf("0x")?t:n.fromUtf8(t)};return(t.fromBlock||0===t.fromBlock)&&(t.fromBlock=a(t.fromBlock)),(t.toBlock||0===t.toBlock)&&(t.toBlock=a(t.toBlock)),t.topics=t.topics||[],t.topics=t.topics.map((function(t){return i.isArray(t)?t.map(e):e(t)})),e=null,t.address&&(t.address=i.isArray(t.address)?t.address.map((function(t){return l(t)})):l(t.address)),t},inputSignFormatter:function(t){return n.isHexStrict(t)?t:n.utf8ToHex(t)},inputStorageKeysFormatter:function(t){return t.map(n.numberToHex)},outputProofFormatter:function(t){return t.address=n.toChecksumAddress(t.address),t.nonce=n.hexToNumberString(t.nonce),t.balance=n.hexToNumberString(t.balance),t},outputBigNumberFormatter:s,outputTransactionFormatter:u,outputTransactionReceiptFormatter:function(t){if("object"!=typeof t)throw new Error("Received receipt is invalid: "+t);return null!==t.blockNumber&&(t.blockNumber=n.hexToNumber(t.blockNumber)),null!==t.transactionIndex&&(t.transactionIndex=n.hexToNumber(t.transactionIndex)),t.cumulativeGasUsed=n.hexToNumber(t.cumulativeGasUsed),t.gasUsed=n.hexToNumber(t.gasUsed),i.isArray(t.logs)&&(t.logs=t.logs.map(f)),t.contractAddress&&(t.contractAddress=n.toChecksumAddress(t.contractAddress)),void 0!==t.status&&null!==t.status&&(t.status=Boolean(parseInt(t.status))),t},outputBlockFormatter:function(t){return t.gasLimit=n.hexToNumber(t.gasLimit),t.gasUsed=n.hexToNumber(t.gasUsed),t.size=n.hexToNumber(t.size),t.timestamp=n.hexToNumber(t.timestamp),null!==t.number&&(t.number=n.hexToNumber(t.number)),t.difficulty&&(t.difficulty=s(t.difficulty)),t.totalDifficulty&&(t.totalDifficulty=s(t.totalDifficulty)),i.isArray(t.transactions)&&t.transactions.forEach((function(t){if(!i.isString(t))return u(t)})),t.miner&&(t.miner=n.toChecksumAddress(t.miner)),t},outputLogFormatter:f,outputPostFormatter:function(t){return t.expiry=n.hexToNumber(t.expiry),t.sent=n.hexToNumber(t.sent),t.ttl=n.hexToNumber(t.ttl),t.workProved=n.hexToNumber(t.workProved),t.topics||(t.topics=[]),t.topics=t.topics.map((function(t){return n.toUtf8(t)})),t},outputSyncingFormatter:function(t){return t.startingBlock=n.hexToNumber(t.startingBlock),t.currentBlock=n.hexToNumber(t.currentBlock),t.highestBlock=n.hexToNumber(t.highestBlock),t.knownStates&&(t.knownStates=n.hexToNumber(t.knownStates),t.pulledStates=n.hexToNumber(t.pulledStates)),t}}},function(t,e,r){var i=r(51),n=r(22),o=new i(0),s=new i(-1),a={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"};function h(t){var e=t?t.toLowerCase():"ether",r=a[e];if("string"!=typeof r)throw new Error("[ethjs-unit] the unit provided "+t+" doesn't exists, please use the one of the following units "+JSON.stringify(a,null,2));return new i(r,10)}function u(t){if("string"==typeof t){if(!t.match(/^-?[0-9.]+$/))throw new Error("while converting number to string, invalid number value '"+t+"', should be a number matching (^-?[0-9.]+).");return t}if("number"==typeof t)return String(t);if("object"==typeof t&&t.toString&&(t.toTwos||t.dividedToIntegerBy))return t.toPrecision?String(t.toPrecision()):t.toString(10);throw new Error("while converting number to string, invalid number value '"+t+"' type "+typeof t+".")}t.exports={unitMap:a,numberToString:u,getValueOfUnit:h,fromWei:function(t,e,r){var i=n(t),u=i.lt(o),f=h(e),l=a[e].length-1||1,c=r||{};u&&(i=i.mul(s));for(var d=i.mod(f).toString(10);d.length2)throw new Error("[ethjs-unit] while converting number "+t+" to wei, too many decimal points");var c=l[0],d=l[1];if(c||(c="0"),d||(d="0"),d.length>o)throw new Error("[ethjs-unit] while converting number "+t+" to wei, too many decimal places");for(;d.length=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(9)(t))},function(t,e,r){e.byteLength=function(t){var e=u(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,i=u(t),s=i[0],a=i[1],h=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),f=0,l=a>0?s-4:s;for(r=0;r>16&255,h[f++]=e>>8&255,h[f++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,h[f++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,h[f++]=e>>8&255,h[f++]=255&e),h},e.fromByteArray=function(t){for(var e,r=t.length,n=r%3,o=[],s=0,a=r-n;sa?a:s+16383));return 1===n?(e=t[r-1],o.push(i[e>>2]+i[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],o.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"=")),o.join("")};for(var i=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,h=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var n,o,s=[],a=e;a>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,i,n){var o,s,a=8*n-i-1,h=(1<>1,f=-7,l=r?n-1:0,c=r?-1:1,d=t[e+l];for(l+=c,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+t[e+l],l+=c,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=i;f>0;s=256*s+t[e+l],l+=c,f-=8);if(0===o)o=1-u;else{if(o===h)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),o-=u}return(d?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,r,i,n,o){var s,a,h,u=8*o-n-1,f=(1<>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-s))<1&&(s--,h*=2),(e+=s+l>=1?c/h:c*Math.pow(2,1-l))*h>=2&&(s++,h/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*h-1)*Math.pow(2,n),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,n),s=0));n>=8;t[r+d]=255&a,d+=p,a/=256,n-=8);for(s=s<0;t[r+d]=255&s,d+=p,s/=256,u-=8);t[r+d-p]|=128*m}},function(t,e,r){(function(t){!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(1).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(9)(t))},function(t,e,r){var i=r(56);t.exports=function(t){return"string"!=typeof t?t:i(t)?t.slice(2):t}},function(t,e){t.exports=function(t){if("string"!=typeof t)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof t+", while checking isHexPrefixed.");return"0x"===t.slice(0,2)}},function(t,e){},function(t,e,r){!function(t){var e,r,i,n=String.fromCharCode;function o(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n=55296&&t<=57343)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function a(t,e){return n(t>>e&63|128)}function h(t){if(0==(4294967168&t))return n(t);var e="";return 0==(4294965248&t)?e=n(t>>6&31|192):0==(4294901760&t)?(s(t),e=n(t>>12&15|224),e+=a(t,6)):0==(4292870144&t)&&(e=n(t>>18&7|240),e+=a(t,12),e+=a(t,6)),e+n(63&t|128)}function u(){if(i>=r)throw Error("Invalid byte index");var t=255&e[i];if(i++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function f(){var t,n;if(i>r)throw Error("Invalid byte index");if(i==r)return!1;if(t=255&e[i],i++,0==(128&t))return t;if(192==(224&t)){if((n=(31&t)<<6|u())>=128)return n;throw Error("Invalid continuation byte")}if(224==(240&t)){if((n=(15&t)<<12|u()<<6|u())>=2048)return s(n),n;throw Error("Invalid continuation byte")}if(240==(248&t)&&(n=(7&t)<<18|u()<<12|u()<<6|u())>=65536&&n<=1114111)return n;throw Error("Invalid UTF-8 detected")}t.version="3.0.0",t.encode=function(t){for(var e=o(t),r=e.length,i=-1,n="";++i65535&&(o+=n((e-=65536)>>>10&1023|55296),e=56320|1023&e),o+=n(e);return o}(a)}}(e)},function(t,e){var r="0123456789abcdef".split(""),i=[1,256,65536,16777216],n=[0,8,16,24],o=[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],s=function(t){var e,r,i,n,s,a,h,u,f,l,c,d,p,m,v,g,y,b,w,M,_,S,x,k,A,E,B,O,R,I,T,j,C,N,P,L,q,D,U,F,z,H,Z,W,K,V,G,Y,J,X,$,Q,tt,et,rt,it,nt,ot,st,at,ht,ut,ft;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],h=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],f=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|h>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(h<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(u<<1|f>>>31),r=s^(f<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(l<<1|c>>>31),r=h^(c<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(d<<1|p>>>31),r=f^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(n<<1|s>>>31),r=c^(s<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,m=t[0],v=t[1],V=t[11]<<4|t[10]>>>28,G=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,R=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ht=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,N=t[2]<<1|t[3]>>>31,P=t[3]<<1|t[2]>>>31,g=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,Y=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,I=t[33]<<13|t[32]>>>19,T=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,q=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,$=t[35]<<15|t[34]>>>17,j=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,k=t[6]<<28|t[7]>>>4,A=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,W=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,E=t[18]<<20|t[19]>>>12,B=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,S=t[48]<<14|t[49]>>>18,x=t[49]<<14|t[48]>>>18,t[0]=m^~g&b,t[1]=v^~y&w,t[10]=k^~E&O,t[11]=A^~B&R,t[20]=N^~L&D,t[21]=P^~q&U,t[30]=W^~V&Y,t[31]=K^~G&J,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=g^~b&M,t[3]=y^~w&_,t[12]=E^~O&I,t[13]=B^~R&T,t[22]=L^~D&F,t[23]=q^~U&z,t[32]=V^~Y&X,t[33]=G^~J&$,t[42]=it^~ot&at,t[43]=nt^~st&ht,t[4]=b^~M&S,t[5]=w^~_&x,t[14]=O^~I&j,t[15]=R^~T&C,t[24]=D^~F&H,t[25]=U^~z&Z,t[34]=Y^~X&Q,t[35]=J^~$&tt,t[44]=ot^~at&ut,t[45]=st^~ht&ft,t[6]=M^~S&m,t[7]=_^~x&v,t[16]=I^~j&k,t[17]=T^~C&A,t[26]=F^~H&N,t[27]=z^~Z&P,t[36]=X^~Q&W,t[37]=$^~tt&K,t[46]=at^~ut&et,t[47]=ht^~ft&rt,t[8]=S^~m&g,t[9]=x^~v&y,t[18]=j^~k&E,t[19]=C^~A&B,t[28]=H^~N&L,t[29]=Z^~P&q,t[38]=Q^~W&V,t[39]=tt^~K&G,t[48]=ut^~et&it,t[49]=ft^~rt&nt,t[0]^=o[i],t[1]^=o[i+1]},a=function(t){return function(e){var o;if("0x"===e.slice(0,2)){o=[];for(var a=2,h=e.length;a>2]|=e[d]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(h[v>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=u){for(t.start=v-u,t.block=h[f],v=0;v>2]|=i[3&v],t.lastByteIndex===u)for(h[0]=h[f],v=1;v>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];g%f==0&&(s(c),v=0)}return"0x"+m}(function(t){return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e}(t),o)}};t.exports={keccak256:a(256),keccak512:a(512),keccak256s:a(256),keccak512s:a(512)}},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0});var i=r(61);function n(t){return!("string"!=typeof t||!/^(0x)?[0-9a-f]{512}$/i.test(t)||!/^(0x)?[0-9a-f]{512}$/.test(t)&&!/^(0x)?[0-9A-F]{512}$/.test(t))}function o(t,e){"object"==typeof e&&e.constructor===Uint8Array&&(e=i.bytesToHex(e));for(var r=i.keccak256(e).replace("0x",""),n=0;n<12;n+=4){var o=(parseInt(r.substr(n,2),16)<<8)+parseInt(r.substr(n+2,2),16)&2047,a=1<=48&&t<=57)return t-48;if(t>=65&&t<=70)return t-55;if(t>=97&&t<=102)return t-87;throw new Error("invalid bloom")}function a(t){return!("string"!=typeof t||!/^(0x)?[0-9a-f]{64}$/i.test(t)||!/^(0x)?[0-9a-f]{64}$/.test(t)&&!/^(0x)?[0-9A-F]{64}$/.test(t))}function h(t){return!("string"!=typeof t||!t.match(/^(0x)?[0-9a-fA-F]{40}$/)&&!t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/))}e.isBloom=n,e.isInBloom=o,e.isUserEthereumAddressInBloom=function(t,e){if(!n(t))throw new Error("Invalid bloom given");if(!h(e))throw new Error('Invalid ethereum address given: "'.concat(e,'"'));return o(t,i.padLeft(e,64))},e.isContractAddressInBloom=function(t,e){if(!n(t))throw new Error("Invalid bloom given");if(!h(e))throw new Error('Invalid contract address given: "'.concat(e,'"'));return o(t,e)},e.isTopicInBloom=function(t,e){if(!n(t))throw new Error("Invalid bloom given");if(!a(e))throw new Error("Invalid topic");return o(t,e)},e.isTopic=a,e.isAddress=h},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0});var i=r(62);function n(t){if(null==t)throw new Error("cannot convert null value to array");if("string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);if(!e)throw new Error("invalid hexidecimal string");if("0x"!==e[1])throw new Error("hex string must have 0x prefix");(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],i=0;i=256||parseInt(String(r))!=r)return!1}return!0}(t))return o(new Uint8Array(t));throw new Error("invalid arrayify value")}function o(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return o(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}e.keccak256=function(t){return"0x"+i.keccak_256(n(t))},e.padLeft=function(t,e){var r=/^0x/i.test(t)||"number"==typeof t,i=e-(t=t.toString().replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(r?"0x":"")+new Array(i).join("0")+t},e.bytesToHex=function(t){for(var e=[],r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return"0x".concat(e.join("").replace(/^0+/,""))},e.toByteArray=n},function(t,e,r){(function(i,n){var o;!function(){var s="input is invalid type",a="object"==typeof window,h=a?window:{};h.JS_SHA3_NO_WINDOW&&(a=!1);var u=!a&&"object"==typeof self;!h.JS_SHA3_NO_NODE_JS&&"object"==typeof i&&i.versions&&i.versions.node?h=n:u&&(h=self);var f=!h.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,l=r(63),c=!h.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),p=[4,1024,262144,67108864],m=[0,8,16,24],v=[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],g=[224,256,384,512],y=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],w={128:168,256:136};!h.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!c||!h.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var M=function(t,e,r){return function(i){return new P(t,e,t).update(i)[r]()}},_=function(t,e,r){return function(i,n){return new P(t,e,n).update(i)[r]()}},S=function(t,e,r){return function(e,i,n,o){return B["cshake"+t].update(e,i,n,o)[r]()}},x=function(t,e,r){return function(e,i,n,o){return B["kmac"+t].update(e,i,n,o)[r]()}},k=function(t,e,r,i){for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}function L(t,e,r){P.call(this,t,e,r)}P.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(s);if(null===t)throw new Error(s);if(c&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||c&&ArrayBuffer.isView(t)))throw new Error(s);e=!0}for(var i,n,o=this.blocks,a=this.byteCount,h=t.length,u=this.blockCount,f=0,l=this.s;f>2]|=t[f]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[i>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=a){for(this.start=i-a,this.block=o[u],i=0;i>=8);r>0;)n.unshift(r),r=255&(t>>=8),++i;return e?n.push(i):n.unshift(i),this.update(n),n.length},P.prototype.encodeString=function(t){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(s);if(null===t)throw new Error(s);if(c&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||c&&ArrayBuffer.isView(t)))throw new Error(s);e=!0}var i=0,n=t.length;if(e)i=n;else for(var o=0;o=57344?i+=3:(a=65536+((1023&a)<<10|1023&t.charCodeAt(++o)),i+=4)}return i+=this.encode(8*i),this.update(t),i},P.prototype.bytepad=function(t,e){for(var r=this.encode(e),i=0;i>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+d[15&t]+d[t>>12&15]+d[t>>8&15]+d[t>>20&15]+d[t>>16&15]+d[t>>28&15]+d[t>>24&15];s%e==0&&(q(r),o=0)}return n&&(t=r[o],a+=d[t>>4&15]+d[15&t],n>1&&(a+=d[t>>12&15]+d[t>>8&15]),n>2&&(a+=d[t>>20&15]+d[t>>16&15])),a},P.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var h=new Uint32Array(t);s>8&255,h[t+2]=e>>16&255,h[t+3]=e>>24&255;a%r==0&&q(i)}return o&&(t=a<<2,e=i[s],h[t]=255&e,o>1&&(h[t+1]=e>>8&255),o>2&&(h[t+2]=e>>16&255)),h},L.prototype=new P,L.prototype.finalize=function(){return this.encode(this.outputBits,!0),P.prototype.finalize.call(this)};var q=function(t){var e,r,i,n,o,s,a,h,u,f,l,c,d,p,m,g,y,b,w,M,_,S,x,k,A,E,B,O,R,I,T,j,C,N,P,L,q,D,U,F,z,H,Z,W,K,V,G,Y,J,X,$,Q,tt,et,rt,it,nt,ot,st,at,ht,ut,ft;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],u=t[5]^t[15]^t[25]^t[35]^t[45],f=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(c=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(h<<1|u>>>31),r=o^(u<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(f<<1|l>>>31),r=a^(l<<1|f>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(c<<1|d>>>31),r=u^(d<<1|c>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=f^(n<<1|o>>>31),r=l^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],m=t[1],V=t[11]<<4|t[10]>>>28,G=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,R=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ht=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,N=t[2]<<1|t[3]>>>31,P=t[3]<<1|t[2]>>>31,g=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,Y=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,I=t[33]<<13|t[32]>>>19,T=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,q=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,$=t[35]<<15|t[34]>>>17,j=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,k=t[6]<<28|t[7]>>>4,A=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,W=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,E=t[18]<<20|t[19]>>>12,B=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,S=t[48]<<14|t[49]>>>18,x=t[49]<<14|t[48]>>>18,t[0]=p^~g&b,t[1]=m^~y&w,t[10]=k^~E&O,t[11]=A^~B&R,t[20]=N^~L&D,t[21]=P^~q&U,t[30]=W^~V&Y,t[31]=K^~G&J,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=g^~b&M,t[3]=y^~w&_,t[12]=E^~O&I,t[13]=B^~R&T,t[22]=L^~D&F,t[23]=q^~U&z,t[32]=V^~Y&X,t[33]=G^~J&$,t[42]=it^~ot&at,t[43]=nt^~st&ht,t[4]=b^~M&S,t[5]=w^~_&x,t[14]=O^~I&j,t[15]=R^~T&C,t[24]=D^~F&H,t[25]=U^~z&Z,t[34]=Y^~X&Q,t[35]=J^~$&tt,t[44]=ot^~at&ut,t[45]=st^~ht&ft,t[6]=M^~S&p,t[7]=_^~x&m,t[16]=I^~j&k,t[17]=T^~C&A,t[26]=F^~H&N,t[27]=z^~Z&P,t[36]=X^~Q&W,t[37]=$^~tt&K,t[46]=at^~ut&et,t[47]=ht^~ft&rt,t[8]=S^~p&g,t[9]=x^~m&y,t[18]=j^~k&E,t[19]=C^~A&B,t[28]=H^~N&L,t[29]=Z^~P&q,t[38]=Q^~W&V,t[39]=tt^~K&G,t[48]=ut^~et&it,t[49]=ft^~rt&nt,t[0]^=v[i],t[1]^=v[i+1]};if(f)t.exports=B;else{for(R=0;R32||i256)throw new Error("Invalid uint"+i+" size");if((a=s(e)).bitLength()>i)throw new Error("Supplied uint exceeds width: "+i+" vs "+a.bitLength());if(a.lt(new n(0)))throw new Error("Supplied uint "+a.toString()+" is negative");return i?o.leftPad(a.toString("hex"),i/8*2):a}if(t.startsWith("int")){if(i%8||i<8||i>256)throw new Error("Invalid int"+i+" size");if((a=s(e)).bitLength()>i)throw new Error("Supplied int exceeds width: "+i+" vs "+a.bitLength());return a.lt(new n(0))?a.toTwos(i).toString("hex"):i?o.leftPad(a.toString("hex"),i/8*2):a}throw new Error("Unsupported or invalid type: "+t)},h=function(t){if(i.isArray(t))throw new Error("Autodetection of array types is not supported.");var e,r,s="";if(i.isObject(t)&&(t.hasOwnProperty("v")||t.hasOwnProperty("t")||t.hasOwnProperty("value")||t.hasOwnProperty("type"))?(e=t.hasOwnProperty("t")?t.t:t.type,s=t.hasOwnProperty("v")?t.v:t.value):(e=o.toHex(t,!0),s=o.toHex(t),e.startsWith("int")||e.startsWith("uint")||(e="bytes")),!e.startsWith("int")&&!e.startsWith("uint")||"string"!=typeof s||/^(-)?0x/i.test(s)||(s=new n(s)),i.isArray(s)){if((r=function(t){var e=/^\D+\d*\[(\d+)\]$/.exec(t);return e?parseInt(e[1],10):null}(e))&&s.length!==r)throw new Error(e+" is not matching the given array "+JSON.stringify(s));r=s.length}return i.isArray(s)?s.map((function(t){return a(e,t,r).toString("hex").replace("0x","")})).join(""):a(e,s,r).toString("hex").replace("0x","")};t.exports={soliditySha3:function(){var t=Array.prototype.slice.call(arguments),e=i.map(t,h);return o.sha3("0x"+e.join(""))},soliditySha3Raw:function(){return o.sha3Raw("0x"+i.map(Array.prototype.slice.call(arguments),h).join(""))}}},function(t,e,r){(function(e,i){var n=r(66).Buffer,o=e.crypto||e.msCrypto;o&&o.getRandomValues?t.exports=function(t,e){if(t>4294967295)throw new RangeError("requested too many random bytes");var r=n.allocUnsafe(t);if(t>0)if(t>65536)for(var s=0;s=e&&i<=r?i-e+10:t})).join("")},s=function(t){for(var e,r=t;r.length>2;)e=r.slice(0,9),r=parseInt(e,10)%97+r.slice(e.length);return parseInt(r,10)%97},a=function(t){this._iban=t};a.toAddress=function(t){if(!(t=new a(t)).isDirect())throw new Error("IBAN is indirect and can't be converted");return t.toAddress()},a.toIban=function(t){return a.fromAddress(t).toString()},a.fromAddress=function(t){if(!i.isAddress(t))throw new Error("Provided address is not a valid address: "+t);t=t.replace("0x","").replace("0X","");var e=function(t,e){for(var r=t;r.length<30;)r="0"+r;return r}(new n(t,16).toString(36));return a.fromBban(e.toUpperCase())},a.fromBban=function(t){var e=("0"+(98-s(o("XE00"+t)))).slice(-2);return new a("XE"+e+t)},a.createIndirect=function(t){return a.fromBban("ETH"+t.institution+t.identifier)},a.isValid=function(t){return new a(t).isValid()},a.prototype.isValid=function(){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(this._iban)&&1===s(o(this._iban))},a.prototype.isDirect=function(){return 34===this._iban.length||35===this._iban.length},a.prototype.isIndirect=function(){return 20===this._iban.length},a.prototype.checksum=function(){return this._iban.substr(2,2)},a.prototype.institution=function(){return this.isIndirect()?this._iban.substr(7,4):""},a.prototype.client=function(){return this.isIndirect()?this._iban.substr(11):""},a.prototype.toAddress=function(){if(this.isDirect()){var t=this._iban.substr(4),e=new n(t,36);return i.toChecksumAddress(e.toString(16,20))}return""},a.prototype.toString=function(){return this._iban},t.exports=a},function(t,e,r){var i=r(24),n=r(3).errors,o=function(t){this.requestManager=t,this.requests=[]};o.prototype.add=function(t){this.requests.push(t)},o.prototype.execute=function(){var t=this.requests;this.requestManager.sendBatch(t,(function(e,r){r=r||[],t.map((function(t,e){return r[e]||{}})).forEach((function(e,r){if(t[r].callback){if(e&&e.error)return t[r].callback(n.ErrorResponse(e));if(!i.isValidResponse(e))return t[r].callback(n.InvalidResponse(e));try{t[r].callback(null,t[r].format?t[r].format(e.result):e.result)}catch(e){t[r].callback(e)}}}))}))},t.exports=o},function(t,e,r){var i,n=null;try{i=Function("return this")()}catch(t){i=window}void 0!==i.ethereumProvider?n=i.ethereumProvider:void 0!==i.web3&&i.web3.currentProvider&&(i.web3.currentProvider.sendAsync&&(i.web3.currentProvider.send=i.web3.currentProvider.sendAsync,delete i.web3.currentProvider.sendAsync),!i.web3.currentProvider.on&&i.web3.currentProvider.connection&&"ipcProviderWrapper"===i.web3.currentProvider.connection.constructor.name&&(i.web3.currentProvider.on=function(t,e){if("function"!=typeof e)throw new Error("The second parameter callback must be a function.");switch(t){case"data":this.connection.on("data",(function(t){var r="";t=t.toString();try{r=JSON.parse(t)}catch(r){return e(new Error("Couldn't parse response data"+t))}r.id||-1===r.method.indexOf("_subscription")||e(null,r)}));break;default:this.connection.on(t,e)}}),n=i.web3.currentProvider),t.exports=n},function(t,e,r){(function(e,i){var n=r(2),o=r(3).errors,s=r(71).w3cwebsocket,a="[object process]"===Object.prototype.toString.call(void 0!==e?e:0),h=null,u=null;if(a){h=function(t){return i.from(t).toString("base64")};var f=r(11);if(f.URL){var l=f.URL;u=function(t){return new l(t)}}else u=r(11).parse}else h=btoa,u=function(t){return new URL(t)};var c=function(t,e){if(!s)throw new Error("websocket is not available");var r=this;this.responseCallbacks={},this.notificationCallbacks=[],e=e||{},this._customTimeout=e.timeout;var i=u(t),o=e.headers||{},a=e.protocol||void 0;i.username&&i.password&&(o.authorization="Basic "+h(i.username+":"+i.password));var f=e.clientConfig||void 0,l=e.requestOptions||void 0;i.auth&&(o.authorization="Basic "+h(i.auth)),this.connection=new s(t,a,void 0,o,l,f),this.addDefaultEvents(),this.connection.onmessage=function(t){var e="string"==typeof t.data?t.data:"";r._parseResponse(e).forEach((function(t){var e=null;n.isArray(t)?t.forEach((function(t){r.responseCallbacks[t.id]&&(e=t.id)})):e=t.id,!e&&t&&t.method&&-1!==t.method.indexOf("_subscription")?r.notificationCallbacks.forEach((function(e){n.isFunction(e)&&e(t)})):r.responseCallbacks[e]&&(r.responseCallbacks[e](null,t),delete r.responseCallbacks[e])}))},Object.defineProperty(this,"connected",{get:function(){return this.connection&&this.connection.readyState===this.connection.OPEN},enumerable:!0})};c.prototype.addDefaultEvents=function(){var t=this;this.connection.onerror=function(){t._timeout()},this.connection.onclose=function(){t._timeout(),t.reset()}},c.prototype._parseResponse=function(t){var e=this,r=[];return t.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach((function(t){e.lastChunk&&(t=e.lastChunk+t);var i=null;try{i=JSON.parse(t)}catch(r){return e.lastChunk=t,clearTimeout(e.lastChunkTimeout),void(e.lastChunkTimeout=setTimeout((function(){throw e._timeout(),o.InvalidResponse(t)}),15e3))}clearTimeout(e.lastChunkTimeout),e.lastChunk=null,i&&r.push(i)})),r},c.prototype._addResponseCallback=function(t,e){var r=t.id||t[0].id,i=t.method||t[0].method;this.responseCallbacks[r]=e,this.responseCallbacks[r].method=i;var n=this;this._customTimeout&&setTimeout((function(){n.responseCallbacks[r]&&(n.responseCallbacks[r](o.ConnectionTimeout(n._customTimeout)),delete n.responseCallbacks[r])}),this._customTimeout)},c.prototype._timeout=function(){for(var t in this.responseCallbacks)this.responseCallbacks.hasOwnProperty(t)&&(this.responseCallbacks[t](o.InvalidConnection("on WS")),delete this.responseCallbacks[t])},c.prototype.send=function(t,e){var r=this;if(this.connection.readyState!==this.connection.CONNECTING){if(this.connection.readyState!==this.connection.OPEN)return console.error("connection not open on send()"),"function"==typeof this.connection.onerror?this.connection.onerror(new Error("connection not open")):console.error("no error callback"),void e(new Error("connection not open"));this.connection.send(JSON.stringify(t)),this._addResponseCallback(t,e)}else setTimeout((function(){r.send(t,e)}),10)},c.prototype.on=function(t,e){if("function"!=typeof e)throw new Error("The second parameter callback must be a function.");switch(t){case"data":this.notificationCallbacks.push(e);break;case"connect":this.connection.onopen=e;break;case"end":this.connection.onclose=e;break;case"error":this.connection.onerror=e}},c.prototype.removeListener=function(t,e){var r=this;switch(t){case"data":this.notificationCallbacks.forEach((function(t,i){t===e&&r.notificationCallbacks.splice(i,1)}))}},c.prototype.removeAllListeners=function(t){switch(t){case"data":this.notificationCallbacks=[];break;case"connect":this.connection.onopen=null;break;case"end":this.connection.onclose=null;break;case"error":this.connection.onerror=null}},c.prototype.reset=function(){this._timeout(),this.notificationCallbacks=[],this.addDefaultEvents()},c.prototype.disconnect=function(){this.connection&&this.connection.close()},c.prototype.supportsSubscriptions=function(){return!0},t.exports=c}).call(this,r(4),r(1).Buffer)},function(t,e,r){var i;try{i=r(72)}catch(t){}finally{if(i||"undefined"==typeof window||(i=window),!i)throw new Error("Could not determine global this")}var n=i.WebSocket||i.MozWebSocket,o=r(73);function s(t,e){return e?new n(t,e):new n(t)}n&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(t){Object.defineProperty(s,t,{get:function(){return n[t]}})})),t.exports={w3cwebsocket:n?s:null,version:o}},function(t,e){var r=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};t.exports=function(){if(this)return this;if("object"==typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return r()}try{return __global__||r()}finally{delete Object.prototype.__global__}}()},function(t,e,r){t.exports=r(74).version},function(t){t.exports=JSON.parse('{"_from":"@web3-js/websocket@^1.0.29","_id":"@web3-js/websocket@1.0.30","_inBundle":false,"_integrity":"sha512-fDwrD47MiDrzcJdSeTLF75aCcxVVt8B1N74rA+vh2XCAvFy4tEWJjtnUtj2QG7/zlQ6g9cQ88bZFBxwd9/FmtA==","_location":"/@web3-js/websocket","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"@web3-js/websocket@^1.0.29","name":"@web3-js/websocket","escapedName":"@web3-js%2fwebsocket","scope":"@web3-js","rawSpec":"^1.0.29","saveSpec":null,"fetchSpec":"^1.0.29"},"_requiredBy":["/web3-providers-ws"],"_resolved":"https://registry.npmjs.org/@web3-js/websocket/-/websocket-1.0.30.tgz","_shasum":"9ea15b7b582cf3bf3e8bc1f4d3d54c0731a87f87","_spec":"@web3-js/websocket@^1.0.29","_where":"/home/chai/source/repos/torus/fetch-node-details/node_modules/web3-providers-ws","author":{"name":"Brian McKelvey","email":"theturtle32@gmail.com","url":"https://github.com/theturtle32"},"browser":"lib/browser.js","bugs":{"url":"https://github.com/web3-js/WebSocket-Node/issues"},"bundleDependencies":false,"config":{"verbose":false},"contributors":[{"name":"I\xf1aki Baz Castillo","email":"ibc@aliax.net","url":"http://dev.sipdoc.net"}],"dependencies":{"debug":"^2.2.0","es5-ext":"^0.10.50","nan":"^2.14.0","typedarray-to-buffer":"^3.1.5","yaeti":"^0.0.6"},"deprecated":false,"description":"Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.","devDependencies":{"buffer-equal":"^1.0.0","faucet":"^0.0.1","gulp":"^4.0.2","gulp-jshint":"^2.0.4","jshint":"^2.0.0","jshint-stylish":"^2.2.1","tape":"^4.9.1"},"directories":{"lib":"./lib"},"engines":{"node":">=0.10.0"},"homepage":"https://github.com/web3-js/WebSocket-Node","keywords":["websocket","websockets","socket","networking","comet","push","RFC-6455","realtime","server","client"],"license":"Apache-2.0","main":"index","name":"@web3-js/websocket","repository":{"type":"git","url":"git+https://github.com/web3-js/WebSocket-Node.git"},"scripts":{"gulp":"gulp","install":"(node-gyp rebuild 2> builderror.log) || (exit 0)","test":"faucet test/unit"},"version":"1.0.30"}')},function(t,e,r){(function(t,i){var n;!function(o){e&&e.nodeType,t&&t.nodeType;var s="object"==typeof i&&i;s.global!==s&&s.window!==s&&s.self;var a,h=2147483647,u=/^xn--/,f=/[^\x20-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,c={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,p=String.fromCharCode;function m(t){throw new RangeError(c[t])}function v(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function g(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+v((t=t.replace(l,".")).split("."),e).join(".")}function y(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+p(t)})).join("")}function w(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,r){var i=0;for(t=r?d(t/700):t>>1,t+=d(t/e);t>455;i+=36)t=d(t/35);return d(i+36*t/(t+38))}function _(t){var e,r,i,n,o,s,a,u,f,l,c,p=[],v=t.length,g=0,y=128,w=72;for((r=t.lastIndexOf("-"))<0&&(r=0),i=0;i=128&&m("not-basic"),p.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=v&&m("invalid-input"),((u=(c=t.charCodeAt(n++))-48<10?c-22:c-65<26?c-65:c-97<26?c-97:36)>=36||u>d((h-g)/s))&&m("overflow"),g+=u*s,!(u<(f=a<=w?1:a>=w+26?26:a-w));a+=36)s>d(h/(l=36-f))&&m("overflow"),s*=l;w=M(g-o,e=p.length+1,0==o),d(g/e)>h-y&&m("overflow"),y+=d(g/e),g%=e,p.splice(g++,0,y)}return b(p)}function S(t){var e,r,i,n,o,s,a,u,f,l,c,v,g,b,_,S=[];for(v=(t=y(t)).length,e=128,r=0,o=72,s=0;s=e&&cd((h-r)/(g=i+1))&&m("overflow"),r+=(a-e)*g,e=a,s=0;sh&&m("overflow"),c==e){for(u=r,f=36;!(u<(l=f<=o?1:f>=o+26?26:f-o));f+=36)_=u-l,b=36-l,S.push(p(w(l+_%b,0))),u=d(_/b);S.push(p(w(u,0))),o=M(r,g,i==n),r=0,++i}++r,++e}return S.join("")}a={version:"1.4.1",ucs2:{decode:y,encode:b},decode:_,encode:S,toASCII:function(t){return g(t,(function(t){return f.test(t)?"xn--"+S(t):t}))},toUnicode:function(t){return g(t,(function(t){return u.test(t)?_(t.slice(4).toLowerCase()):t}))}},void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()}).call(this,r(9)(t),r(0))},function(t,e,r){t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,r){e.decode=e.parse=r(78),e.encode=e.stringify=r(79)},function(t,e,r){function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,r,o){e=e||"&",r=r||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var h=1e3;o&&"number"==typeof o.maxKeys&&(h=o.maxKeys);var u=t.length;h>0&&u>h&&(u=h);for(var f=0;f=0?(l=m.substr(0,v),c=m.substr(v+1)):(l=m,c=""),d=decodeURIComponent(l),p=decodeURIComponent(c),i(s,d)?n(s[d])?s[d].push(p):s[d]=[s[d],p]:s[d]=p}return s};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,r){var i=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,r,a){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?o(s(t),(function(s){var a=encodeURIComponent(i(s))+r;return n(t[s])?o(t[s],(function(t){return a+encodeURIComponent(i(t))})).join(e):a+encodeURIComponent(i(t[s]))})).join(e):a?encodeURIComponent(i(a))+r+encodeURIComponent(i(t)):""};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var r=[],i=0;i=0)return this._url=this._parseUrl(e.headers.location),this._method="GET",this._loweredHeaders["content-type"]&&(delete this._headers[this._loweredHeaders["content-type"]],delete this._loweredHeaders["content-type"]),null!=this._headers["Content-Type"]&&delete this._headers["Content-Type"],delete this._headers["Content-Length"],this.upload._reset(),this._finalizeHeaders(),void this._sendHxxpRequest();this._response=e,this._response.on("data",(function(t){return i._onHttpResponseData(e,t)})),this._response.on("end",(function(){return i._onHttpResponseEnd(e)})),this._response.on("close",(function(){return i._onHttpResponseClose(e)})),this.responseUrl=this._url.href.split("#")[0],this.status=e.statusCode,this.statusText=a.STATUS_CODES[this.status],this._parseResponseHeaders(e);var n=this._responseHeaders["content-length"]||"";this._totalBytes=+n,this._lengthComputable=!!n,this._setReadyState(r.HEADERS_RECEIVED)}},r.prototype._onHttpResponseData=function(t,e){this._response===t&&(this._responseParts.push(new i(e)),this._loadedBytes+=e.length,this.readyState!==r.LOADING&&this._setReadyState(r.LOADING),this._dispatchProgress("progress"))},r.prototype._onHttpResponseEnd=function(t){this._response===t&&(this._parseResponse(),this._request=null,this._response=null,this._setReadyState(r.DONE),this._dispatchProgress("load"),this._dispatchProgress("loadend"))},r.prototype._onHttpResponseClose=function(t){if(this._response===t){var e=this._request;this._setError(),e.abort(),this._setReadyState(r.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend")}},r.prototype._onHttpTimeout=function(t){this._request===t&&(this._setError(),t.abort(),this._setReadyState(r.DONE),this._dispatchProgress("timeout"),this._dispatchProgress("loadend"))},r.prototype._onHttpRequestError=function(t,e){this._request===t&&(this._setError(),t.abort(),this._setReadyState(r.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend"))},r.prototype._dispatchProgress=function(t){var e=new r.ProgressEvent(t);e.lengthComputable=this._lengthComputable,e.loaded=this._loadedBytes,e.total=this._totalBytes,this.dispatchEvent(e)},r.prototype._setError=function(){this._request=null,this._response=null,this._responseHeaders=null,this._responseParts=null},r.prototype._parseUrl=function(t,e,r){var i=null==this.nodejsBaseUrl?t:f.resolve(this.nodejsBaseUrl,t),n=f.parse(i,!1,!0);n.hash=null;var o=(n.auth||"").split(":"),s=o[0],a=o[1];return(s||a||e||r)&&(n.auth=(e||s||"")+":"+(r||a||"")),n},r.prototype._parseResponseHeaders=function(t){for(var e in this._responseHeaders={},t.headers){var r=e.toLowerCase();this._privateHeaders[r]||(this._responseHeaders[r]=t.headers[e])}null!=this._mimeOverride&&(this._responseHeaders["content-type"]=this._mimeOverride)},r.prototype._parseResponse=function(){var t=i.concat(this._responseParts);switch(this._responseParts=null,this.responseType){case"json":this.responseText=null;try{this.response=JSON.parse(t.toString("utf-8"))}catch(t){this.response=null}return;case"buffer":return this.responseText=null,void(this.response=t);case"arraybuffer":this.responseText=null;for(var e=new ArrayBuffer(t.length),r=new Uint8Array(e),n=0;n0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;for(var e,r,n=i.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=n,r=s,o.data.copy(e,r),s+=o.data.length,o=o.next;return n},t}(),n&&n.inspect&&n.inspect.custom&&(t.exports.prototype[n.inspect.custom]=function(){var t=n.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,r){(function(t){var i=void 0!==t&&t||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(n.call(setTimeout,i,arguments),clearTimeout)},e.setInterval=function(){return new o(n.call(setInterval,i,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(i,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(88),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(0))},function(t,e,r){(function(t,e){!function(t,r){if(!t.setImmediate){var i,n,o,s,a,h=1,u={},f=!1,l=t.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(t);c=c&&c.setTimeout?c:t,"[object process]"==={}.toString.call(t.process)?i=function(){var t=d(arguments);return e.nextTick(p(m,t)),t}:function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&m(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),i=function(){var e=d(arguments);return t.postMessage(s+e,"*"),e}):t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){m(t.data)},i=function(){var t=d(arguments);return o.port2.postMessage(t),t}):l&&"onreadystatechange"in l.createElement("script")?(n=l.documentElement,i=function(){var t=d(arguments),e=l.createElement("script");return e.onreadystatechange=function(){m(t),e.onreadystatechange=null,n.removeChild(e),e=null},n.appendChild(e),t}):i=function(){var t=d(arguments);return setTimeout(p(m,t),0),t},c.setImmediate=i,c.clearImmediate=v}function d(t){return u[h]=p.apply(void 0,t),h++}function p(t){var e=[].slice.call(arguments,1);return function(){"function"==typeof t?t.apply(void 0,e):new Function(""+t)()}}function m(t){if(f)setTimeout(p(m,t),0);else{var e=u[t];if(e){f=!0;try{e()}finally{v(t),f=!1}}}}function v(t){delete u[t]}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,r(0),r(4))},function(t,e,r){(function(e){function r(t){try{if(!e.localStorage)return!1}catch(t){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(t,e){if(r("noDeprecation"))return t;var i=!1;return function(){if(!i){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}}}).call(this,r(0))},function(t,e,r){var i=r(1),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=s),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},function(t,e,r){t.exports=o;var i=r(34),n=Object.create(r(12));function o(t){if(!(this instanceof o))return new o(t);i.call(this,t)}n.inherits=r(6),n.inherits(o,i),o.prototype._transform=function(t,e,r){r(null,t)}},function(t,e,r){var i=r(1).Buffer;t.exports=function(t){if(t instanceof Uint8Array){if(0===t.byteOffset&&t.byteLength===t.buffer.byteLength)return t.buffer;if("function"==typeof t.buffer.slice)return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}if(i.isBuffer(t)){for(var e=new Uint8Array(t.length),r=t.length,n=0;n0&&(i=r),r=t[h++]);)switch(F++,"\n"==r?(H++,z=0):z++,P){case l:if("{"===r)P=d;else if("["===r)P=m;else if(!W(r))return Z("Non-whitespace before {[.");continue;case y:case d:if(W(r))continue;if(P===y)L.push(b);else{if("}"===r){o({}),a(),P=L.pop()||c;continue}L.push(p)}if('"'!==r)return Z('Malformed object key should start with " ');P=g;continue;case b:case p:if(W(r))continue;if(":"===r)P===p?(L.push(p),void 0!==T&&(o({}),n(T),T=void 0),U++):void 0!==T&&(n(T),T=void 0),P=c;else if("}"===r)void 0!==T&&(o(T),a(),T=void 0),a(),U--,P=L.pop()||c;else{if(","!==r)return Z("Bad object");P===p&&L.push(p),void 0!==T&&(o(T),a(),T=void 0),P=y}continue;case m:case c:if(W(r))continue;if(P===m){if(o([]),U++,P=c,"]"===r){a(),U--,P=L.pop()||c;continue}L.push(v)}if('"'===r)P=g;else if("{"===r)P=d;else if("["===r)P=m;else if("t"===r)P=w;else if("f"===r)P=S;else if("n"===r)P=E;else if("-"===r)j+=r;else if("0"===r)j+=r,P=20;else{if(-1==="123456789".indexOf(r))return Z("Bad value");j+=r,P=20}continue;case v:if(","===r)L.push(v),void 0!==T&&(o(T),a(),T=void 0),P=c;else{if("]"!==r){if(W(r))continue;return Z("Bad array")}void 0!==T&&(o(T),a(),T=void 0),a(),U--,P=L.pop()||c}continue;case g:void 0===T&&(T="");var f=h-1;t:for(;;){for(;D>0;)if(q+=r,r=t.charAt(h++),4===D?(T+=String.fromCharCode(parseInt(q,16)),D=0,f=h-1):D++,!r)break t;if('"'===r&&!C){P=L.pop()||c,T+=t.substring(f,h-1);break}if(!("\\"!==r||C||(C=!0,T+=t.substring(f,h-1),r=t.charAt(h++))))break;if(C){if(C=!1,"n"===r?T+="\n":"r"===r?T+="\r":"t"===r?T+="\t":"f"===r?T+="\f":"b"===r?T+="\b":"u"===r?(D=1,q=""):T+=r,r=t.charAt(h++),f=h-1,r)continue;break}u.lastIndex=h;var K=u.exec(t);if(!K){h=t.length+1,T+=t.substring(f,h-1);break}if(h=K.index+1,!(r=t.charAt(K.index))){T+=t.substring(f,h-1);break}}continue;case w:if(!r)continue;if("r"!==r)return Z("Invalid true started with t"+r);P=M;continue;case M:if(!r)continue;if("u"!==r)return Z("Invalid true started with tr"+r);P=_;continue;case _:if(!r)continue;if("e"!==r)return Z("Invalid true started with tru"+r);o(!0),a(),P=L.pop()||c;continue;case S:if(!r)continue;if("a"!==r)return Z("Invalid false started with f"+r);P=x;continue;case x:if(!r)continue;if("l"!==r)return Z("Invalid false started with fa"+r);P=k;continue;case k:if(!r)continue;if("s"!==r)return Z("Invalid false started with fal"+r);P=A;continue;case A:if(!r)continue;if("e"!==r)return Z("Invalid false started with fals"+r);o(!1),a(),P=L.pop()||c;continue;case E:if(!r)continue;if("u"!==r)return Z("Invalid null started with n"+r);P=B;continue;case B:if(!r)continue;if("l"!==r)return Z("Invalid null started with nu"+r);P=O;continue;case O:if(!r)continue;if("l"!==r)return Z("Invalid null started with nul"+r);o(null),a(),P=L.pop()||c;continue;case R:if("."!==r)return Z("Leading zero not followed by .");j+=r,P=20;continue;case 20:if(-1!=="0123456789".indexOf(r))j+=r;else if("."===r){if(-1!==j.indexOf("."))return Z("Invalid number has two dots");j+=r}else if("e"===r||"E"===r){if(-1!==j.indexOf("e")||-1!==j.indexOf("E"))return Z("Invalid number has two exponential");j+=r}else if("+"===r||"-"===r){if("e"!==i&&"E"!==i)return Z("Invalid symbol in number");j+=r}else j&&(o(parseFloat(j)),a(),j=""),h--,P=L.pop()||c;continue;default:return Z("Unknown state: "+P)}F>=I&&(s=0,void 0!==T&&T.length>65536&&(Z("Max buffer length exceeded: textNode"),s=Math.max(s,T.length)),j.length>65536&&(Z("Max buffer length exceeded: numberNode"),s=Math.max(s,j.length)),I=65536-s+F)}})),t(ut).on((function(){if(P==l)return o({}),a(),void(N=!0);P===c&&0===U||Z("Unexpected end"),void 0!==T&&(o(T),a(),T=void 0),N=!0}))}var N,P,L,q,D,U,F,z,H,Z,W,K=(N=p((function(t){return t.unshift(/^/),(e=RegExp(t.map(l("source")).join(""))).exec.bind(e);var e})),q=N(P=/(\$?)/,/([\w-_]+|\*)/,L=/(?:{([\w ]*?)})?/),D=N(P,/\["([^"]+)"\]/,L),U=N(P,/\[(\d+|\*)\]/,L),F=N(P,/()/,/{([\w ]*?)}/),z=N(/\.\./),H=N(/\./),Z=N(P,/!/),W=N(/$/),function(t){return t(c(q,D,U,F),z,H,Z,W)});function V(t,e){return{key:t,node:e}}var G=l("key"),Y=l("node"),J={};function X(t){var e=t(tt).emit,r=t(et).emit,i=t(st).emit,n=t(ot).emit;function s(t,e,r){Y(x(t))[e]=r}function a(t,r,i){t&&s(t,r,i);var n=S(V(r,i),t);return e(n),n}var h={};return h[ct]=function(t,e){if(!t)return i(e),a(t,J,e);var r=function(t,e){var r=Y(x(t));return y(o,r)?a(t,b(r),e):t}(t,e),n=k(r),h=G(x(r));return s(n,h,e),S(V(h,e),n)},h[dt]=function(t){return r(t),k(t)||n(Y(x(t)))},h[lt]=a,h}var $=K((function(t,e,r,i,n){var o=f(G,x),a=f(Y,x);function h(t,e){return e[1]?m(t,x):t}function l(t){return t==g?g:m((function(t){return o(t)!=J}),f(t,k))}function d(){return function(t){return o(t)==J}}function p(t,e,r,i,n){var o=t(r);if(o){var s=function(t,e,r){return R((function(t,e){return e(t,r)}),e,t)}(e,i,o);return n(r.substr(b(o[0])),s)}}function v(t,e){return u(p,t,e)}var y=c(v(t,E(h,(function(t,e){var r=e[3];return r?m(f(u(_,A(r.split(/\W+/))),a),t):t}),(function(t,e){var r=e[2];return m(r&&"*"!=r?function(t){return o(t)==r}:g,t)}),l)),v(e,E((function(t){if(t==g)return g;var e=d(),r=t,i=l((function(t){return n(t)})),n=c(e,r,i);return n}))),v(r,E()),v(i,E(h,d)),v(n,E((function(t){return function(e){var r=t(e);return!0===r?x(e):r}}))),(function(t){throw s('"'+t+'" could not be tokenised')}));function w(t,e){return e}function M(t,e){return y(t,e,t?M:w)}return function(t){try{return M(t,g)}catch(e){throw s('Could not compile "'+t+'" because '+e.message)}}})),Q=1,tt=Q++,et=Q++,rt=Q++,it=Q++,nt="fail",ot=Q++,st=Q++,at="start",ht="data",ut="end",ft=Q++,lt=Q++,ct=Q++,dt=Q++;function pt(t,e,r){try{var i=a.parse(e)}catch(t){}return{statusCode:t,body:e,jsonBody:i,thrown:r}}function mt(t,e){var r,i=/^(node|path):./,n=t(ot),o=t(it).emit,a=t(rt).emit,h=p((function(e,n){if(r[e])d(n,r[e]);else{var o=t(e),s=n[0];i.test(e)?f(o,s):o.on(s)}return r}));function f(t,e,i){i=i||e;var n=l(e);return t.on((function(){var e=!1;r.forget=function(){e=!0},d(arguments,n),delete r.forget,e&&t.un(i)}),i),r}function l(t){return function(){try{return t.apply(r,arguments)}catch(t){setTimeout((function(){throw new s(t.message)}))}}}function c(e,r,i){var n;n="node"==e?function(t){return function(){var e=t.apply(this,arguments);M(e)&&(e==yt.drop?o():a(e))}}(i):i,f(function(e,r){return t(e+":"+r)}(e,r),n,i)}function m(t,e,i){return w(e)?c(t,e,i):function(t,e){for(var r in e)c(t,r,e[r])}(t,e),r}return t(st).on((function(t){var e;r.root=(e=t,function(){return e})})),t(at).on((function(t,e){r.header=function(t){return t?e[t]:e}})),r={on:h,addListener:h,removeListener:function(e,i,o){if("done"==e)n.un(i);else if("node"==e||"path"==e)t.un(e+":"+i,o);else{var s=i;t(e).un(s)}return r},emit:t.emit,node:u(m,"node"),path:u(m,"path"),done:u(f,n),start:u((function(e,i){return t(e).on(l(i),i),r}),at),fail:t(nt).on,abort:t(ft).emit,header:v,root:v,source:e}}function vt(t,e,i,n,o){var s=function(){var t={},e=i("newListener"),r=i("removeListener");function i(i){return t[i]=function(t,e,r){var i,n;function o(t){return function(e){return e.id==t}}return{on:function(r,o){var s={listener:r,id:o||r};return e&&e.emit(t,r,s.id),i=S(s,i),n=S(r,n),this},emit:function(){T(n,arguments)},un:function(e){var s;i=I(i,o(e),(function(t){s=t})),s&&(n=I(n,(function(t){return t==s.listener})),r&&r.emit(t,s.listener,s.id))},listeners:function(){return n},hasListener:function(t){return M(function t(e,r){return r&&(e(x(r))?x(r):t(e,k(r)))}(t?o(t):g,i))}}}(i,e,r)}function n(e){return t[e]||i(e)}return["emit","on","un"].forEach((function(t){n[t]=p((function(e,r){d(r,n(e)[t])}))})),n}();return e&&function(t,e,i,n,o,s,a){var h=t(ht).emit,f=t(nt).emit,l=0,c=!0;function d(){var t=e.responseText,r=t.substr(l);r&&h(r),l=b(t)}t(ft).on((function(){e.onreadystatechange=null,e.abort()})),"onprogress"in e&&(e.onprogress=d),e.onreadystatechange=function(){function r(){try{c&&t(at).emit(e.status,function(t){var e={};return t&&t.split("\r\n").forEach((function(t){var r=t.indexOf(": ");e[t.substring(0,r)]=t.substring(r+2)})),e}(e.getAllResponseHeaders())),c=!1}catch(t){}}switch(e.readyState){case 2:case 3:return r();case 4:r(),2==String(e.status)[0]?(d(),t(ut).emit()):f(pt(e.status,e.responseText))}};try{for(var p in e.open(i,n,!0),s)e.setRequestHeader(p,s[p]);(function(t,e){function r(e){return e.port||{"http:":80,"https:":443}[e.protocol||t.protocol]}return!!(e.protocol&&e.protocol!=t.protocol||e.host&&e.host!=t.host||e.host&&r(e)!=r(t))})(r.location,function(t){var e=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(t)||[];return{protocol:e[1]||"",host:e[2]||"",port:e[3]||""}}(n))||e.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.withCredentials=a,e.send(o)}catch(t){r.setTimeout(u(f,pt(void 0,void 0,t)),0)}}(s,new XMLHttpRequest,t,e,i,n,o),C(s),function(t,e){var r,i={};function n(t){return function(e){r=t(r,e)}}for(var o in e)t(o).on(n(e[o]),i);t(rt).on((function(t){var e=x(r),i=G(e),n=k(r);n&&(Y(x(n))[i]=t)})),t(it).on((function(){var t=x(r),e=G(t),i=k(r);i&&delete Y(x(i))[e]})),t(ft).on((function(){for(var r in e)t(r).un(i)}))}(s,X(s)),function(t,e){var r={node:t(et),path:t(tt)};function i(e,r,i){var n=t(e).emit;r.on((function(t){var e=i(t);!1!==e&&function(t,e,r){var i=j(r);t(e,B(k(O(G,i))),B(O(Y,i)))}(n,Y(e),t)}),e),t("removeListener").on((function(i){i==e&&(t(i).listeners()||r.un(e))}))}t("newListener").on((function(t){var n=/(node|path):(.*)/.exec(t);if(n){var o=r[n[1]];o.hasListener(t)||i(t,o,e(n[2]))}}))}(s,$),mt(s,e)}function gt(t,e,r,i,n,o,s){return n=n?a.parse(a.stringify(n)):{},i?(w(i)||(i=a.stringify(i),n["Content-Type"]=n["Content-Type"]||"application/json"),n["Content-Length"]=n["Content-Length"]||i.length):i=null,t(r||"GET",function(t,e){return!1===e&&(-1==t.indexOf("?")?t+="?":t+="&",t+="_="+(new Date).getTime()),t}(e,s),i,n,o||!1)}function yt(t){var e=E("resume","pause","pipe"),r=u(_,e);return t?r(t)||w(t)?gt(vt,t):gt(vt,t.url,t.method,t.body,t.headers,t.withCredentials,t.cached):vt()}yt.drop=function(){return yt.drop},void 0===(i=function(){return yt}.apply(e,[]))||(t.exports=i)}(function(){try{return window}catch(t){return self}}(),Object,Array,Error,JSON)},function(t,e,r){var i=r(3).formatters,n=r(36),o=r(5);t.exports=function(t){var e=function(e){var r;return e.property?(t[e.property]||(t[e.property]={}),r=t[e.property]):r=t,e.methods&&e.methods.forEach((function(e){e instanceof n||(e=new n(e)),e.attachToObject(r),e.setRequestManager(t._requestManager)})),t};return e.formatters=i,e.utils=o,e.Method=n,e}},function(t,e,r){t.exports=r(104)().Promise},function(t,e,r){t.exports=r(105)(window,(function(){if(void 0===window.Promise)throw new Error("any-promise browser requires a polyfill or explicit registration e.g: require('any-promise/register/bluebird')");return{Promise:window.Promise,implementation:"window.Promise"}}))},function(t,e,r){var i=null;t.exports=function(t,e){return function(r,n){r=r||null;var o=!1!==(n=n||{}).global;if(null===i&&o&&(i=t["@@any-promise/REGISTRATION"]||null),null!==i&&null!==r&&i.implementation!==r)throw new Error('any-promise already defined as "'+i.implementation+'". You can only register an implementation before the first call to require("any-promise") and an implementation cannot be changed');return null===i&&(i=null!==r&&void 0!==n.Promise?{Promise:n.Promise,implementation:r}:e(r),o&&(t["@@any-promise/REGISTRATION"]=i)),i}}},function(t,e,r){var i=r(2),n=r(3).errors,o=r(38);function s(t){o.call(this),this.id=null,this.callback=i.identity,this.arguments=null,this._reconnectIntervalId=null,this.options={subscription:t.subscription,type:t.type,requestManager:t.requestManager}}s.prototype=Object.create(o.prototype),s.prototype.constructor=s,s.prototype._extractCallback=function(t){if(i.isFunction(t[t.length-1]))return t.pop()},s.prototype._validateArgs=function(t){var e=this.options.subscription;if(e||(e={}),e.params||(e.params=0),t.length!==e.params)throw n.InvalidNumberOfParams(t.length,e.params+1,t[0])},s.prototype._formatInput=function(t){var e=this.options.subscription;return e&&e.inputFormatter?e.inputFormatter.map((function(e,r){return e?e(t[r]):t[r]})):t},s.prototype._formatOutput=function(t){var e=this.options.subscription;return e&&e.outputFormatter&&t?e.outputFormatter(t):t},s.prototype._toPayload=function(t){var e=[];if(this.callback=this._extractCallback(t)||i.identity,this.subscriptionMethod||(this.subscriptionMethod=t.shift(),this.options.subscription.subscriptionName&&(this.subscriptionMethod=this.options.subscription.subscriptionName)),this.arguments||(this.arguments=this._formatInput(t),this._validateArgs(this.arguments),t=[]),e.push(this.subscriptionMethod),e=e.concat(this.arguments),t.length)throw new Error("Only a callback is allowed as parameter on an already instantiated subscription.");return{method:this.options.type+"_subscribe",params:e}},s.prototype.unsubscribe=function(t){this.options.requestManager.removeSubscription(this.id,t),this.id=null,this.removeAllListeners(),clearInterval(this._reconnectIntervalId)},s.prototype.subscribe=function(){var t=this,e=Array.prototype.slice.call(arguments),r=this._toPayload(e);if(!r)return this;if(!this.options.requestManager.provider){var n=new Error("No provider set.");return this.callback(n,null,this),this.emit("error",n),this}if(!this.options.requestManager.provider.on){var o=new Error("The current provider doesn't support subscriptions: "+this.options.requestManager.provider.constructor.name);return this.callback(o,null,this),this.emit("error",o),this}return this.id&&this.unsubscribe(),this.options.params=r.params[1],"logs"===r.params[0]&&i.isObject(r.params[1])&&r.params[1].hasOwnProperty("fromBlock")&&isFinite(r.params[1].fromBlock)&&this.options.requestManager.send({method:"eth_getLogs",params:[r.params[1]]},(function(e,r){e?(t.callback(e,null,t),t.emit("error",e)):r.forEach((function(e){var r=t._formatOutput(e);t.callback(null,r,t),t.emit("data",r)}))})),"object"==typeof r.params[1]&&delete r.params[1].fromBlock,this.options.requestManager.send(r,(function(e,n){!e&&n?(t.id=n,t.emit("connected",n),t.options.requestManager.addSubscription(t.id,r.params[0],t.options.type,(function(e,r){e?(t.options.requestManager.removeSubscription(t.id),t.options.requestManager.provider.once&&(t._reconnectIntervalId=setInterval((function(){t.options.requestManager.provider.reconnect&&t.options.requestManager.provider.reconnect()}),500),t.options.requestManager.provider.once("connect",(function(){clearInterval(t._reconnectIntervalId),t.subscribe(t.callback)}))),t.emit("error",e),t.callback(e,null,t)):(i.isArray(r)||(r=[r]),r.forEach((function(e){var r=t._formatOutput(e);if(i.isFunction(t.options.subscription.subscriptionHandler))return t.options.subscription.subscriptionHandler.call(t,r);t.emit("data",r),t.callback(null,r,t)})))}))):(t.callback(e,null,t),t.emit("error",e))})),this},t.exports=s},function(t,e,r){var i=r(2),n=r(5),o=new(r(108).AbiCoder)((function(t,e){return!t.match(/^u?int/)||i.isArray(e)||i.isObject(e)&&"BN"===e.constructor.name?e:e.toString()}));function s(){}var a=function(){};a.prototype.encodeFunctionSignature=function(t){return i.isObject(t)&&(t=n._jsonInterfaceMethodToString(t)),n.sha3(t).slice(0,10)},a.prototype.encodeEventSignature=function(t){return i.isObject(t)&&(t=n._jsonInterfaceMethodToString(t)),n.sha3(t)},a.prototype.encodeParameter=function(t,e){return this.encodeParameters([t],[e])},a.prototype.encodeParameters=function(t,e){return o.encode(this.mapTypes(t),e.map((function(t){return n.isBN(t)||n.isBigNumber(t)?t.toString(10):t})))},a.prototype.mapTypes=function(t){var e=this,r=[];return t.forEach((function(t){if(e.isSimplifiedStructFormat(t)){var i=Object.keys(t)[0];r.push(Object.assign(e.mapStructNameAndType(i),{components:e.mapStructToCoderFormat(t[i])}))}else r.push(t)})),r},a.prototype.isSimplifiedStructFormat=function(t){return"object"==typeof t&&void 0===t.components&&void 0===t.name},a.prototype.mapStructNameAndType=function(t){var e="tuple";return t.indexOf("[]")>-1&&(e="tuple[]",t=t.slice(0,-2)),{type:e,name:t}},a.prototype.mapStructToCoderFormat=function(t){var e=this,r=[];return Object.keys(t).forEach((function(i){"object"!=typeof t[i]?r.push({name:i,type:t[i]}):r.push(Object.assign(e.mapStructNameAndType(i),{components:e.mapStructToCoderFormat(t[i])}))})),r},a.prototype.encodeFunctionCall=function(t,e){return this.encodeFunctionSignature(t)+this.encodeParameters(t.inputs,e).replace("0x","")},a.prototype.decodeParameter=function(t,e){return this.decodeParameters([t],e)[0]},a.prototype.decodeParameters=function(t,e){if(t.length>0&&(!e||"0x"===e||"0X"===e))throw new Error("Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.");var r=o.decode(this.mapTypes(t),"0x"+e.replace(/0x/i,"")),n=new s;return n.__length__=0,t.forEach((function(t,e){var o=r[n.__length__];o="0x"===o?null:o,n[e]=o,i.isObject(t)&&t.name&&(n[t.name]=o),n.__length__++})),n},a.prototype.decodeLog=function(t,e,r){var n=this;r=i.isArray(r)?r:[r],e=e||"";var o=[],a=[],h=0;t.forEach((function(t,e){t.indexed?(a[e]=["bool","int","uint","address","fixed","ufixed"].find((function(e){return-1!==t.type.indexOf(e)}))?n.decodeParameter(t.type,r[h]):r[h],h++):o[e]=t}));var u=e,f=u?this.decodeParameters(o,u):[],l=new s;return l.__length__=0,t.forEach((function(t,e){l[e]="string"===t.type?"":null,void 0!==f[e]&&(l[e]=f[e]),void 0!==a[e]&&(l[e]=a[e]),t.name&&(l[t.name]=l[e]),l.__length__++})),l};var h=new a;t.exports=h},function(t,e,r){var i,n=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var s=r(109),a=r(113),h=r(8),u=r(114),f=r(41),l=o(r(15)),c=new RegExp(/^bytes([0-9]*)$/),d=new RegExp(/^(u?int)([0-9]*)$/),p=new RegExp(/^(.*)\[([0-9]*)\]$/);e.defaultCoerceFunc=function(t,e){var r=t.match(d);return r&&parseInt(r[2])<=48?e.toNumber():e};var m=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),v=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function g(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function y(t,e){function r(e){throw new Error('unexpected character "'+t[e]+'" at position '+e+' in "'+t+'"')}for(var i={type:"",name:"",state:{allowType:!0}},n=i,o=0;o1){var n=r[1].match(m);if(""!=n[1].trim()||""!=n[3].trim())throw new Error("unexpected tokens");L(n[2]).forEach((function(t){e.outputs.push(y(t))}))}return e}(t.trim()));throw new Error("unknown signature")};var w=function(t,e,r,i,n){this.coerceFunc=t,this.name=e,this.type=r,this.localName=i,this.dynamic=n},M=function(t){function e(e){var r=t.call(this,e.coerceFunc,e.name,e.type,void 0,e.dynamic)||this;return f.defineReadOnly(r,"coder",e),r}return n(e,t),e.prototype.encode=function(t){return this.coder.encode(t)},e.prototype.decode=function(t,e){return this.coder.decode(t,e)},e}(w),_=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return n(e,t),e.prototype.encode=function(t){return h.arrayify([])},e.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},e}(w),S=function(t){function e(e,r,i,n){var o=this,s=(i?"int":"uint")+8*r;return(o=t.call(this,e,s,s,n,!1)||this).size=r,o.signed=i,o}return n(e,t),e.prototype.encode=function(t){try{var e=a.bigNumberify(t);return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),h.padZeros(h.arrayify(e),32)}catch(e){l.throwError("invalid number value",l.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length32)throw new Error;e.set(r)}catch(e){l.throwError("invalid "+this.name+" value",l.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},e.prototype.decode=function(t,e){return t.length=0?i:"")+"]",a=-1===i||r.dynamic;return(o=t.call(this,e,"array",s,n,a)||this).coder=r,o.length=i,o}return n(e,t),e.prototype.encode=function(t){Array.isArray(t)||l.throwError("expected array value",l.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=x.encode(e)),l.checkArgumentCount(e,t.length,"in coder array"+(this.localName?" "+this.localName:""));for(var i=[],n=0;n256||n%8!=0)&&l.throwError("invalid "+r[1]+" bit length",l.INVALID_ARGUMENT,{arg:"param",value:e}),new S(t,n/8,"int"===r[1],e.name);if(r=e.type.match(c))return(0===(n=parseInt(r[1]))||n>32)&&l.throwError("invalid bytes length",l.INVALID_ARGUMENT,{arg:"param",value:e}),new A(t,n,e.name);if(r=e.type.match(p)){var n=parseInt(r[2]||"-1");return(e=f.jsonCopy(e)).type=r[1],new N(t,D(t,e),n,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var i=[];return e.forEach((function(e){i.push(D(t,e))})),new P(t,i,r)}(t,e.components,e.name):""===e.type?new _(t,e.name):(l.throwError("invalid type",l.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var U=function(){function t(r){l.checkNew(this,t),r||(r=e.defaultCoerceFunc),f.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&l.throwError("types/values length mismatch",l.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach((function(t){var e;e="string"==typeof t?y(t):t,r.push(D(this.coerceFunc,e))}),this),h.hexlify(new P(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach((function(t){var e;e="string"==typeof t?y(t):f.jsonCopy(t),r.push(D(this.coerceFunc,e))}),this),new P(this.coerceFunc,r,"_").decode(h.arrayify(e),0).value},t}();e.AbiCoder=U,e.defaultAbiCoder=new U},function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(10)),o=r(8),s=r(110),a=r(112),h=r(15);function u(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||h.throwError("invalid address",h.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),i=0;i<40;i++)r[i]=e[i].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var n=0;n<40;n+=2)r[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(15&r[n>>1])>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}for(var f={},l=0;l<10;l++)f[String(l)]=String(l);for(l=0;l<26;l++)f[String.fromCharCode(65+l)]=String(10+l);var c,d=Math.floor((c=9007199254740991,Math.log10?Math.log10(c):Math.log(c)/Math.LN10));function p(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=f[t]}));e.length>=d;){var r=e.substring(0,d);e=parseInt(r,10)%97+e.substring(r.length)}for(var i=String(98-parseInt(e,10)%97);i.length<2;)i="0"+i;return i}function m(t){var e=null;if("string"!=typeof t&&h.throwError("invalid address",h.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=u(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&h.throwError("bad address checksum",h.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&h.throwError("bad icap checksum",h.INVALID_ARGUMENT,{arg:"address",value:t}),e=new n.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=u("0x"+e)}else h.throwError("invalid address",h.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=m,e.getIcapAddress=function(t){for(var e=new n.default.BN(m(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e},e.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return m("0x"+s.keccak256(a.encode([m(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0});var i=r(111),n=r(8);e.keccak256=function(t){return"0x"+i.keccak_256(n.arrayify(t))}},function(t,e,r){(function(e,r){!function(){var i="object"==typeof window?window:{};!i.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(i=r);for(var n=!i.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),s=[0,8,16,24],a=[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],h=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],f=function(t,e,r){return function(i){return new M(t,e,t).update(i)[r]()}},l=function(t,e,r){return function(i,n){return new M(t,e,n).update(i)[r]()}},c=function(t,e){var r=f(t,e,"hex");r.create=function(){return new M(t,e,t)},r.update=function(t){return r.create().update(t)};for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}M.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,i,n=t.length,o=this.blocks,a=this.byteCount,h=this.blockCount,u=0,f=this.s;u>2]|=t[u]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(o[r>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=r-a,this.block=o[h],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];a%e==0&&(_(r),s=0)}return n&&(t=r[s],n>0&&(h+=o[t>>4&15]+o[15&t]),n>1&&(h+=o[t>>12&15]+o[t>>8&15]),n>2&&(h+=o[t>>20&15]+o[t>>16&15])),h},M.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var h=new Uint32Array(t);s>8&255,h[t+2]=e>>16&255,h[t+3]=e>>24&255;a%r==0&&_(i)}return o&&(t=a<<2,e=i[s],o>0&&(h[t]=255&e),o>1&&(h[t+1]=e>>8&255),o>2&&(h[t+2]=e>>16&255)),h};var _=function(t){var e,r,i,n,o,s,h,u,f,l,c,d,p,m,v,g,y,b,w,M,_,S,x,k,A,E,B,O,R,I,T,j,C,N,P,L,q,D,U,F,z,H,Z,W,K,V,G,Y,J,X,$,Q,tt,et,rt,it,nt,ot,st,at,ht,ut,ft;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],h=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],f=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|h>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(h<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(u<<1|f>>>31),r=o^(f<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(l<<1|c>>>31),r=h^(c<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(d<<1|p>>>31),r=f^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(n<<1|o>>>31),r=c^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,m=t[0],v=t[1],V=t[11]<<4|t[10]>>>28,G=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,R=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ht=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,N=t[2]<<1|t[3]>>>31,P=t[3]<<1|t[2]>>>31,g=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,Y=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,I=t[33]<<13|t[32]>>>19,T=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,q=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,$=t[35]<<15|t[34]>>>17,j=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,k=t[6]<<28|t[7]>>>4,A=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,W=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,E=t[18]<<20|t[19]>>>12,B=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,S=t[48]<<14|t[49]>>>18,x=t[49]<<14|t[48]>>>18,t[0]=m^~g&b,t[1]=v^~y&w,t[10]=k^~E&O,t[11]=A^~B&R,t[20]=N^~L&D,t[21]=P^~q&U,t[30]=W^~V&Y,t[31]=K^~G&J,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=g^~b&M,t[3]=y^~w&_,t[12]=E^~O&I,t[13]=B^~R&T,t[22]=L^~D&F,t[23]=q^~U&z,t[32]=V^~Y&X,t[33]=G^~J&$,t[42]=it^~ot&at,t[43]=nt^~st&ht,t[4]=b^~M&S,t[5]=w^~_&x,t[14]=O^~I&j,t[15]=R^~T&C,t[24]=D^~F&H,t[25]=U^~z&Z,t[34]=Y^~X&Q,t[35]=J^~$&tt,t[44]=ot^~at&ut,t[45]=st^~ht&ft,t[6]=M^~S&m,t[7]=_^~x&v,t[16]=I^~j&k,t[17]=T^~C&A,t[26]=F^~H&N,t[27]=z^~Z&P,t[36]=X^~Q&W,t[37]=$^~tt&K,t[46]=at^~ut&et,t[47]=ht^~ft&rt,t[8]=S^~m&g,t[9]=x^~v&y,t[18]=j^~k&E,t[19]=C^~A&B,t[28]=H^~N&L,t[29]=Z^~P&q,t[38]=Q^~W&V,t[39]=tt^~K&G,t[48]=ut^~et&it,t[49]=ft^~rt&nt,t[0]^=a[i],t[1]^=a[i+1]};if(n)t.exports=p;else for(v=0;v>=8;return e}function o(t,e,r){for(var i=0,n=0;ne+1+i)throw new Error("invalid rlp")}return{consumed:1+i,result:n}}function a(t,e){if(0===t.length)throw new Error("invalid rlp data");if(t[e]>=248){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+n)}if(t[e]>=192){if(e+1+(n=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,n)}if(t[e]>=184){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+n,result:i.hexlify(t.slice(e+1+r,e+1+r+n))}}if(t[e]>=128){var n;if(e+1+(n=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+n,result:i.hexlify(t.slice(e+1,e+1+n))}}return{consumed:1,result:i.hexlify(t[e])}}e.encode=function(t){return i.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach((function(e){r=r.concat(t(e))})),r.length<=55?(r.unshift(192+r.length),r):((o=n(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(i.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=n(s.length)).unshift(183+o.length),o.concat(s))}(t))},e.decode=function(t){var e=i.arrayify(t),r=a(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},function(t,e,r){var i,n=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var a=o(r(10)),h=r(8),u=r(41),f=r(40),l=s(r(15)),c=new a.default.BN(-1);function d(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function p(t){return g(t)._bn}function m(t){return new v(d(t))}var v=function(t){function e(r){var i=t.call(this)||this;if(l.checkNew(i,e),"string"==typeof r)h.isHexString(r)?("0x"==r&&(r="0x0"),u.defineReadOnly(i,"_hex",r)):"-"===r[0]&&h.isHexString(r.substring(1))?u.defineReadOnly(i,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),u.defineReadOnly(i,"_hex",d(new a.default.BN(r)))):l.throwError("invalid BigNumber string value",l.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(String(r))!==r&&l.throwError("underflow",l.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(String(r))});try{u.defineReadOnly(i,"_hex",d(new a.default.BN(r)))}catch(t){l.throwError("overflow",l.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else r instanceof e?u.defineReadOnly(i,"_hex",r._hex):r.toHexString?u.defineReadOnly(i,"_hex",d(p(r.toHexString()))):h.isArrayish(r)?u.defineReadOnly(i,"_hex",d(new a.default.BN(h.hexlify(r).substring(2),16))):l.throwError("invalid BigNumber value",l.INVALID_ARGUMENT,{arg:"value",value:r});return i}return n(e,t),Object.defineProperty(e.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new a.default.BN(this._hex.substring(3),16).mul(c):new a.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),e.prototype.fromTwos=function(t){return m(this._bn.fromTwos(t))},e.prototype.toTwos=function(t){return m(this._bn.toTwos(t))},e.prototype.add=function(t){return m(this._bn.add(p(t)))},e.prototype.sub=function(t){return m(this._bn.sub(p(t)))},e.prototype.div=function(t){return g(t).isZero()&&l.throwError("division by zero",l.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),m(this._bn.div(p(t)))},e.prototype.mul=function(t){return m(this._bn.mul(p(t)))},e.prototype.mod=function(t){return m(this._bn.mod(p(t)))},e.prototype.pow=function(t){return m(this._bn.pow(p(t)))},e.prototype.maskn=function(t){return m(this._bn.maskn(t))},e.prototype.eq=function(t){return this._bn.eq(p(t))},e.prototype.lt=function(t){return this._bn.lt(p(t))},e.prototype.lte=function(t){return this._bn.lte(p(t))},e.prototype.gt=function(t){return this._bn.gt(p(t))},e.prototype.gte=function(t){return this._bn.gte(p(t))},e.prototype.isZero=function(){return this._bn.isZero()},e.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(t){l.throwError("overflow",l.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},e.prototype.toString=function(){return this._bn.toString(10)},e.prototype.toHexString=function(){return this._hex},e}(f.BigNumber);function g(t){return t instanceof v?t:new v(t)}e.bigNumberify=g,e.ConstantNegativeOne=g(-1),e.ConstantZero=g(0),e.ConstantOne=g(1),e.ConstantTwo=g(2),e.ConstantWeiPerEther=g("1000000000000000000")},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0});var i,n=r(8);!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(i=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=function(t,e){void 0===e&&(e=i.current),e!=i.current&&(t=t.normalize(e));for(var r=[],o=0,s=0;s>6|192,r[o++]=63&a|128):55296==(64512&a)&&s+1>18|240,r[o++]=a>>12&63|128,r[o++]=a>>6&63|128,r[o++]=63&a|128):(r[o++]=a>>12|224,r[o++]=a>>6&63|128,r[o++]=63&a|128)}return n.arrayify(r)},e.toUtf8String=function(t){t=n.arrayify(t);for(var e="",r=0;r>7!=0){if(i>>6!=2){var o=null;if(i>>5==6)o=1;else if(i>>4==14)o=2;else if(i>>3==30)o=3;else if(i>>2==62)o=4;else{if(i>>1!=126)continue;o=5}if(r+o>t.length){for(;r>6==2;r++);if(r!=t.length)continue;return e}var s,a=i&(1<<8-o-1)-1;for(s=0;s>6!=2)break;a=a<<6|63&h}s==o?a<=65535?e+=String.fromCharCode(a):(a-=65536,e+=String.fromCharCode(55296+(a>>10&1023),56320+(1023&a))):r--}}else e+=String.fromCharCode(i)}return e}},function(t,e,r){r.r(e);var i=r(19),n=r.n(i),o=r(42),s=r.n(o),a=r(43),h=r.n(a),u=r(44),f=r.n(u),l=r(13),c=r.n(l),d=r(20),p=r.n(d),m=r(5),v=r(45),g=function(){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.network,n=void 0===i?"mainnet":i,o=r.proxyAddress,s=void 0===o?"0x638646503746d5456209e33a2ff5e3226d698bea":o;h()(this,t),c()(this,"_currentEpoch","18"),c()(this,"_torusNodeEndpoints",["https://torus-18.torusnode.com/jrpc","https://torus.ont.io/jrpc","https://torus.binancex.dev/jrpc","https://torus.matic.network/jrpc","https://torusnode.zilliqa.network/jrpc","https://torus.ens.domains/jrpc","https://torus-node.skalelabs.com/jrpc","https://torus.cosmos.network/jrpc","https://torus.etherscan.com/jrpc"]),c()(this,"_torusNodePub",[{X:"ecbe4a29e02bb9c077433191051ba74d2458a7ebce95a3183a4201338376539f",Y:"114018f97e6576f3fe1c247fc6802de3ff219507589a90544e6921ea9608adcf"},{X:"c1d31f5b0ba633ad5dec80c35df7209ffe282392831f5d3a386d3c5c0c6b4c2b",Y:"2490a3e69ac1d5a6c3170b5dc4947f038bf37a738cc279d75c18b6a85c90bc71"},{X:"a6d83cc23847dec596d19e93801a0d67ee85f4b1e5f44f267a7118a0c01381ef",Y:"f4b16a19ba44766d53cfaa8fe5858d87c842c7ec0c7b6ecdf11056e6afbeb726"},{X:"79242c54fcfda56c914a28ae89b038dcae8ef2e9dd295171d5562f01d396fbb",Y:"519c655678bf9f6091aa17d0bc13443b69fe8b10ba9336c7cc966a2164eec9e4"},{X:"24b3f3582397f4f4274510e94d8e95fa1a17d57fab2e581d4da1dd2ba61c47d2",Y:"fa15e5cd538992c74cbca5fc1c654ab4d79fb40e2cf5ec58190c35252d81bb6"},{X:"a08620e79b5c006f261b5221e0fae75d379fd0fcd16c66ced105b3fe5282ed64",Y:"e589aa09a7ac28a74d4f4cf7f52718dd9c3cca0541070eec36c66e62a748b17"},{X:"17b5b8402eb27b520eaf4697c7ca3e4818bc79c6cedb6c39490da18602cd84a9",Y:"f18768b68383b8fa9a91caa55768fd7bdec64c8c01cc2fa88963fc6fe92775a6"},{X:"47953df2031bf785f95158a1753a65735fecc93a0248620c4afd7b08ddf239e2",Y:"8058bf6928e7d49179d08cc354d3d735dd08be2f0aa6023d8a7298bb892cf65"},{X:"e53c29bd04eb211d911d78ebcd36d3645872d8f8a18af4fb1937fb2a1f049078",Y:"91ace383afb055ce304ccc5ee811fd8e7407c93e8e0d63d993fc08affc646045"}]),c()(this,"_torusIndexes",[1,2,3,4,5,6,7,8,9]);try{var a=new URL(n);e=a.href}catch(t){e="https://api.infura.io/v1/jsonrpc/".concat(n)}try{p.a.setProvider(e),this.nodeListContract=new p.a(v.a,s),this.nodeListAddress=s,this.updated=!1}catch(t){throw new Error(t)}}var e;return f()(t,[{key:"getCurrentEpoch",value:function(){return this.nodeListContract.methods.currentEpoch().call()}},{key:"getEpochInfo",value:function(t){return this.nodeListContract.methods.getEpochInfo(t).call()}},{key:"getNodeEndpoint",value:function(t){return this.nodeListContract.methods.getNodeDetails(t).call()}},{key:"getNodeDetails",value:(e=s()(n.a.mark((function t(){var e,r,i,o,s,a,h,u,f,l,c,d=this,p=arguments;return n.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=p.length>0&&void 0!==p[0]&&p[0],t.prev=1,!e){t.next=4;break}return t.abrupt("return",this._nodeDetails);case 4:if(!this.updated){t.next=6;break}return t.abrupt("return",this._nodeDetails);case 6:return t.next=8,this.getCurrentEpoch();case 8:return r=t.sent,this._currentEpoch=r,t.next=12,this.getEpochInfo(r);case 12:return i=t.sent,o=[],s=i.nodeList.map((function(t,e){return e+1})),this._torusIndexes=s,i.nodeList.map((function(t){return o.push(d.getNodeEndpoint(t).catch((function(t){})))})),t.next=19,Promise.all(o);case 19:for(a=t.sent,h=[],u=[],f=0;ft.length)&&(e=t.length);for(var r=0,i=new Array(e);r=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(h.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(i)return U(t).length;e=(""+e).toLowerCase(),i=!0}}function m(t,e,r){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return k(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function v(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function g(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=h.from(e,i)),h.isBuffer(e))return 0===e.length?-1:y(t,e,r,i,n);if("number"==typeof e)return e&=255,h.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,i,n){var o,s=1,a=t.length,h=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,a/=2,h/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(n){var f=-1;for(o=r;oa&&(r=a-h),o=r;o>=0;o--){for(var l=!0,c=0;cn&&(i=n):i=n;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var s=0;s>8,n=r%256,o.push(n),o.push(i);return o}(e,t.length-r),t,r,i)}function k(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n239?4:u>223?3:u>191?2:1;if(n+l<=r)switch(l){case 1:u<128&&(f=u);break;case 2:128==(192&(o=t[n+1]))&&(h=(31&u)<<6|63&o)>127&&(f=h);break;case 3:o=t[n+1],s=t[n+2],128==(192&o)&&128==(192&s)&&(h=(15&u)<<12|(63&o)<<6|63&s)>2047&&(h<55296||h>57343)&&(f=h);break;case 4:o=t[n+1],s=t[n+2],a=t[n+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(h=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&h<1114112&&(f=h)}null===f?(f=65533,l=1):f>65535&&(f-=65536,i.push(f>>>10&1023|55296),f=56320|1023&f),i.push(f),n+=l}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",i=0;ii)&&(r=i);for(var n="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function T(t,e,r,i,n,o){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function j(t,e,r,i){e<0&&(e=65535+e+1);for(var n=0,o=Math.min(t.length-r,2);n>>8*(i?n:1-n)}function C(t,e,r,i){e<0&&(e=4294967295+e+1);for(var n=0,o=Math.min(t.length-r,4);n>>8*(i?n:3-n)&255}function N(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(t,e,r,i,o){return o||N(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function L(t,e,r,i,o){return o||N(t,0,r,8),n.write(t,e,r,i,52,8),r+8}e.Buffer=h,e.SlowBuffer=function(t){return+t!=t&&(t=0),h.alloc(+t)},e.INSPECT_MAX_BYTES=50,h.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),h.poolSize=8192,h._augment=function(t){return t.__proto__=h.prototype,t},h.from=function(t,e,r){return u(null,t,e,r)},h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0})),h.alloc=function(t,e,r){return function(t,e,r,i){return f(e),e<=0?a(t,e):void 0!==r?"string"==typeof i?a(t,e).fill(r,i):a(t,e).fill(r):a(t,e)}(null,t,e,r)},h.allocUnsafe=function(t){return l(null,t)},h.allocUnsafeSlow=function(t){return l(null,t)},h.isBuffer=function(t){return!(null==t||!t._isBuffer)},h.compare=function(t,e){if(!h.isBuffer(t)||!h.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,i=e.length,n=0,o=Math.min(r,i);n0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},h.prototype.compare=function(t,e,r,i,n){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(n>>>=0)-(i>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(i,n),f=t.slice(e,r),l=0;ln)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return M(this,t,e,r);case"latin1":case"binary":return _(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},h.prototype.slice=function(t,e){var r,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e0&&(n*=256);)i+=this[t+--e]*n;return i},h.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},h.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var i=this[t],n=1,o=0;++o=(n*=128)&&(i-=Math.pow(2,8*e)),i},h.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var i=e,n=1,o=this[t+--i];i>0&&(n*=256);)o+=this[t+--i]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*e)),o},h.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt32LE=function(t,e){return e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),n.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),n.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),n.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),n.read(this,t,!1,52,8)},h.prototype.writeUIntLE=function(t,e,r,i){t=+t,e|=0,r|=0,i||T(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+n]=t/o&255;return e+r},h.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,1,255,0),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},h.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},h.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},h.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):C(this,t,e,!0),e+4},h.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},h.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);T(this,t,e,r,n-1,-n)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},h.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);T(this,t,e,r,n-1,-n)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},h.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,1,127,-128),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},h.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},h.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},h.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):C(this,t,e,!0),e+4},h.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},h.prototype.writeFloatLE=function(t,e,r){return P(this,t,e,!0,r)},h.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},h.prototype.writeDoubleLE=function(t,e,r){return L(this,t,e,!0,r)},h.prototype.writeDoubleBE=function(t,e,r){return L(this,t,e,!1,r)},h.prototype.copy=function(t,e,r,i){if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--n)t[n+e]=this[n+r];else if(o<1e3||!h.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function F(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(q,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,i){for(var n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}}).call(this,r(7))},function(t,e,r){(function(t){!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(110).Buffer}catch(t){}function a(t,e,r){for(var n=0,o=Math.min(t.length,r),s=0,a=e;a=49&&u<=54?u-49+10:u>=17&&u<=22?u-17+10:u,s|=h}return i(!(240&s),"Invalid character in "+t),n}function h(t,e,r,n){for(var o=0,s=0,a=Math.min(t.length,r),h=e;h=49?u-49+10:u>=17?u-17+10:u,i(u>=0&&s"}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this._strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for?o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f:o.prototype.inspect=f;var l=["","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"],c=[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],d=[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];function p(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r._strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?l[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=c[t],f=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(f).toString(t);r=(p=p.idivn(f)).isZero()?m+r:l[u-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){this._strip();var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,n),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,i=0,n=0,o=0;n>8&255),r>16&255),6===o?(r>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r>=0)for(t[r--]=i;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function v(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function g(t,e,r){return v(t,e,r)}Math.imul||(m=p),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):r<63?p(this,t,e):r<1024?v(this,t,e):g(this,t,e)},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),g(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){var e=t<0;e&&(t=-t),i("number"==typeof t),i(t<67108864);for(var r=0,n=0;n>=26,r+=o/67108864|0,r+=s>>>26,this.words[n]=67108863&s}return 0!==r&&(this.words[n]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this._strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a._strip(),i._strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=(1<<26)%t,n=0,o=this.length-1;o>=0;o--)n=(r*n+(0|this.words[o]))%t;return e?-n:n},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*r;this.words[n]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}b.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r._strip(),r},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},n(w,b),w.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new M;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return y[t]=e,e},x.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(u(t,t.umod(this.m)._forceRed(this)),t)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},n(k,x),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=r,r.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},function(t,e,r){r.d(e,"b",(function(){return h})),r.d(e,"a",(function(){return u}));var i=r(21),n=r.n(i);function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function s(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(e)},n=s({},i,{},r,{},{method:"POST"});return a(12e3,fetch(t,n).then((function(t){if(t.ok)return t.json();throw t})))},u=function(t,e){return{jsonrpc:"2.0",method:t,id:10,params:e}}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){var i=e,n=r(12),o=r(5),s=r(41);i.assert=o,i.toArray=s.toArray,i.zero2=s.zero2,i.toHex=s.toHex,i.encode=s.encode,i.getNAF=function(t,e){for(var r=[],i=1<=0;){var o;if(n.isOdd()){var s=n.andln(i-1);o=s>(i>>1)-1?(i>>1)-s:s,n.isubn(o)}else o=0;r.push(o);for(var a=0!==n.cmpn(0)&&0===n.andln(i-1)?e+1:1,h=1;h0||e.cmpn(-n)>0;){var o,s,a,h=t.andln(3)+i&3,u=e.andln(3)+n&3;3===h&&(h=-1),3===u&&(u=-1),o=0==(1&h)?0:3!=(a=t.andln(7)+i&7)&&5!==a||2!==u?h:-h,r[0].push(o),s=0==(1&u)?0:3!=(a=e.andln(7)+n&7)&&5!==a||2!==h?u:-u,r[1].push(s),2*i===o+1&&(i=1-i),2*n===s+1&&(n=1-n),t.iushrn(1),e.iushrn(1)}return r},i.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},i.parseBytes=function(t){return"string"==typeof t?i.toArray(t,"hex"):t},i.intFromLE=function(t){return new n(t,"hex","le")}},function(t,e,r){var i=e,n=r(14),o=r(5),s=r(41);i.assert=o,i.toArray=s.toArray,i.zero2=s.zero2,i.toHex=s.toHex,i.encode=s.encode,i.getNAF=function(t,e,r){var i=new Array(Math.max(t.bitLength(),r)+1);i.fill(0);for(var n=1<(n>>1)-1?(n>>1)-h:h,o.isubn(a)):a=0,i[s]=a,o.iushrn(1)}return i},i.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i=0,n=0;t.cmpn(-i)>0||e.cmpn(-n)>0;){var o,s,a,h=t.andln(3)+i&3,u=e.andln(3)+n&3;3===h&&(h=-1),3===u&&(u=-1),o=0==(1&h)?0:3!=(a=t.andln(7)+i&7)&&5!==a||2!==u?h:-h,r[0].push(o),s=0==(1&u)?0:3!=(a=e.andln(7)+n&7)&&5!==a||2!==h?u:-u,r[1].push(s),2*i===o+1&&(i=1-i),2*n===s+1&&(n=1-n),t.iushrn(1),e.iushrn(1)}return r},i.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},i.parseBytes=function(t){return"string"==typeof t?i.toArray(t,"hex"):t},i.intFromLE=function(t){return new n(t,"hex","le")}},function(t,e){t.exports=g},function(t,e,r){var i=r(5),n=r(0);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function s(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function h(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=n,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n>6|192,r[i++]=63&s|128):o(t,n)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++n)),r[i++]=s>>18|240,r[i++]=s>>12&63|128,r[i++]=s>>6&63|128,r[i++]=63&s|128):(r[i++]=s>>12|224,r[i++]=s>>6&63|128,r[i++]=63&s|128)}else for(n=0;n>>0}return s},e.split32=function(t,e){for(var r=new Array(4*t.length),i=0,n=0;i>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,i){return t+e+r+i>>>0},e.sum32_5=function(t,e,r,i,n){return t+e+r+i+n>>>0},e.sum64=function(t,e,r,i){var n=t[e],o=i+t[e+1]>>>0,s=(o>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,i){return(e+i>>>0>>0},e.sum64_lo=function(t,e,r,i){return e+i>>>0},e.sum64_4_hi=function(t,e,r,i,n,o,s,a){var h=0,u=e;return h+=(u=u+i>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,r,i,n,o,s,a){return e+i+o+a>>>0},e.sum64_5_hi=function(t,e,r,i,n,o,s,a,h,u){var f=0,l=e;return f+=(l=l+i>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,r,i,n,o,s,a,h,u){return e+i+o+a+u>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},function(t,e,r){(function(t){!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(113).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e){var r,i,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var h,u=[],f=!1,l=-1;function c(){f&&h&&(f=!1,h.length?u=h.concat(u):l=-1,u.length&&d())}function d(){if(!f){var t=a(c);f=!0;for(var e=u.length;e;){for(h=u,u=[];++l1)for(var r=1;r=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e,r){var i=r(1).Buffer,n=r(44).Transform,o=r(49).StringDecoder;function s(t){n.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(0)(s,n),s.prototype.update=function(t,e,r){"string"==typeof t&&(t=i.from(t,e));var n=this._update(t);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(t,e,r){var i;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){i=t}finally{r(i)}},s.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},s.prototype._finalOrDigest=function(t){var e=this.__final()||i.alloc(0);return t&&(e=this._toString(e,t,!0)),e},s.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var i=this._decoder.write(t);return r&&(i+=this._decoder.end()),i},t.exports=s},function(t,e){t.exports=v},function(t,e,r){(function(e,i){var n=r(1).Buffer,o=e.crypto||e.msCrypto;o&&o.getRandomValues?t.exports=function(t,e){if(t>4294967295)throw new RangeError("requested too many random bytes");var r=n.allocUnsafe(t);if(t>0)if(t>65536)for(var s=0;s=0&&(o=r.type.substring(s));var a=t(e,r.components);i.isArray(a)&&e?n.push("tuple("+a.join(",")+")"+o):e?n.push("("+a+")"):n.push("("+a.join(",")+")"+o)}else n.push(r.type)})),n},u=function(t){if(!o.isHexStrict(t))throw new Error("The parameter must be a valid HEX string.");var e="",r=0,i=t.length;for("0x"===t.substring(0,2)&&(r=2);r7?r+=t[i].toUpperCase():r+=t[i];return r},toHex:o.toHex,toBN:o.toBN,bytesToHex:o.bytesToHex,hexToBytes:o.hexToBytes,hexToNumberString:o.hexToNumberString,hexToNumber:o.hexToNumber,toDecimal:o.hexToNumber,numberToHex:o.numberToHex,fromDecimal:o.numberToHex,hexToUtf8:o.hexToUtf8,hexToString:o.hexToUtf8,toUtf8:o.hexToUtf8,utf8ToHex:o.utf8ToHex,stringToHex:o.utf8ToHex,fromUtf8:o.utf8ToHex,hexToAscii:u,toAscii:u,asciiToHex:f,fromAscii:f,unitMap:n.unitMap,toWei:function(t,e){if(e=l(e),!o.isBN(t)&&!i.isString(t))throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return o.isBN(t)?n.toWei(t,e):n.toWei(t,e).toString(10)},fromWei:function(t,e){if(e=l(e),!o.isBN(t)&&!i.isString(t))throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return o.isBN(t)?n.fromWei(t,e):n.fromWei(t,e).toString(10)},padLeft:o.leftPad,leftPad:o.leftPad,padRight:o.rightPad,rightPad:o.rightPad,toTwosComplement:o.toTwosComplement,isBloom:o.isBloom,isUserEthereumAddressInBloom:o.isUserEthereumAddressInBloom,isContractAddressInBloom:o.isContractAddressInBloom,isTopic:o.isTopic,isTopicInBloom:o.isTopicInBloom,isInBloom:o.isInBloom}},function(t,e,r){var i=r(1).Buffer;function n(t,e){this._block=i.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}n.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=i.from(t,e));for(var r=this._block,n=this._blockSize,o=t.length,s=this._len,a=0;a=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(4294967295&r)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=n},function(t,e){t.exports=y},function(t,e){t.exports=w},function(t,e,r){r.d(e,"a",(function(){return c})),r.d(e,"d",(function(){return d})),r.d(e,"c",(function(){return p})),r.d(e,"b",(function(){return m}));var i=r(21),n=r.n(i),o=r(59),s=r.n(o),a=r(106),h=r.n(a),u=r(6),f=r(33);function l(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}var c=function t(e,r){var i=e;if("number"==typeof i&&(i=Array.from({length:i},(function(t,e){return e}))),r>i.length||r<=0)return[];if(r===i.length)return[i];if(1===r)return i.reduce((function(t,e){return[].concat(s()(t),[[e]])}),[]);for(var n=[],o=[],a=0;a<=i.length-r+1;a+=1){o=t(i.slice(a+1),r-1);for(var h=0;h=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=i.join32(t,0,t.length-r,this.endian);for(var n=0;n>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;o0&&t.compare(h)<0;var e}function c(t){var e=new Uint8Array(t);return void 0===o.getRandomValues?i.from(a.randomBytes(t)):(o.getRandomValues(e),i.from(e))}function d(t){return new Promise((function(e){var r=a.createHash("sha512").update(t).digest();e(new Uint8Array(r))}))}function p(t){return function(e,r,n){return new Promise((function(o){if(s)return s.importKey("raw",r,{name:"AES-CBC"},!1,[t]).then((function(r){var i={name:"AES-CBC",iv:e};return s[t](i,r,n)})).then((function(t){o(i.from(new Uint8Array(t)))}));if("encrypt"===t){var h=a.createCipheriv("aes-256-cbc",r,e);h.update(n),o(h.final())}else if("decrypt"===t){var u=a.createDecipheriv("aes-256-cbc",r,e);u.update(n),o(u.final())}}))}}var m=p("encrypt"),v=p("decrypt");e.generatePrivate=function(){for(var t=c(32);!l(t);)t=c(32);return t};var g=e.getPublic=function(t){return f(32===t.length,"Bad private key"),f(l(t),"Bad private key"),i.from(n.keyFromPrivate(t).getPublic("arr"))};e.getPublicCompressed=function(t){return f(32===t.length,"Bad private key"),f(l(t),"Bad private key"),i.from(n.keyFromPrivate(t).getPublic(!0,"arr"))},e.sign=function(t,e){return new Promise((function(r){f(32===t.length,"Bad private key"),f(l(t),"Bad private key"),f(e.length>0,"Message should not be empty"),f(e.length<=32,"Message is too long"),r(i.from(n.sign(e,t,{canonical:!0}).toDER()))}))},e.verify=function(t,e,r){return new Promise((function(i,o){f(65===t.length||33===t.length,"Bad public key"),65===t.length&&f(4===t[0],"Bad public key"),33===t.length&&f(2===t[0]||3===t[0],"Bad public key"),f(e.length>0,"Message should not be empty"),f(e.length<=32,"Message is too long"),n.verify(e,r,t)?i(null):o(new Error("Bad signature"))}))};var y=e.derive=function(t,e){return new Promise((function(r){f(i.isBuffer(t),"Bad private key"),f(i.isBuffer(e),"Bad public key"),f(32===t.length,"Bad private key"),f(l(t),"Bad private key"),f(65===e.length||33===e.length,"Bad public key"),65===e.length&&f(4===e[0],"Bad public key"),33===e.length&&f(2===e[0]||3===e[0],"Bad public key");var o=n.keyFromPrivate(t),s=n.keyFromPublic(e),a=o.derive(s.getPublic());r(i.from(a.toArray()))}))};e.encrypt=function(t,e,r){var n,o,s,h;return r=r||{},new Promise((function(e){for(var i=r.ephemPrivateKey||c(32);!l(i);)i=r.ephemPrivateKey||c(32);o=g(i),e(y(i,t))})).then((function(t){return d(t)})).then((function(t){n=r.iv||c(16);var i=t.slice(0,32);return h=t.slice(32),m(n,i,e)})).then((function(t){s=t;var e=i.concat([n,o,s]);return function(t,e){return new Promise((function(r){var n=a.createHmac("sha256",i.from(t));n.update(e),r(n.digest())}))}(h,e)})).then((function(t){return{iv:n,ephemPublicKey:o,ciphertext:s,mac:t}}))},e.decrypt=function(t,e){var r;return y(t,e.ephemPublicKey).then((function(t){return d(t)})).then((function(t){r=t.slice(0,32);var n,o,s,h=t.slice(32),u=i.concat([e.iv,e.ephemPublicKey,e.ciphertext]);return n=h,o=u,s=e.mac,new Promise((function(t){var e=a.createHmac("sha256",i.from(n));e.update(o),t(function(t,e){if(t.length!==e.length)return!1;for(var r=0,i=0;i0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=h,h.prototype.point=function(){throw new Error("Not implemented")},h.prototype.validate=function(){throw new Error("Not implemented")},h.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),i=o(e,1),n=(1<=h;e--)u=(u<<1)+i[e];s.push(u)}for(var f=this.jpoint(null,null,null),l=this.jpoint(null,null,null),c=n;c>0;c--){for(h=0;h=0;u--){for(e=0;u>=0&&0===s[u];u--)e++;if(u>=0&&e++,h=h.dblp(e),u<0)break;var f=s[u];a(0!==f),h="affine"===t.type?f>0?h.mixedAdd(n[f-1>>1]):h.mixedAdd(n[-f-1>>1].neg()):f>0?h.add(n[f-1>>1]):h.add(n[-f-1>>1].neg())}return"affine"===t.type?h.toP():h},h.prototype._wnafMulAdd=function(t,e,r,i,n){for(var a=this._wnafT1,h=this._wnafT2,u=this._wnafT3,f=0,l=0;l=1;l-=2){var d=l-1,p=l;if(1===a[d]&&1===a[p]){var m=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(m[1]=e[d].add(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].add(e[p].neg())):(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],g=s(r[d],r[p]);f=Math.max(g[0].length,f),u[d]=new Array(f),u[p]=new Array(f);for(var y=0;y=0;l--){for(var S=0;l>=0;){var x=!0;for(y=0;y=0&&S++,M=M.dblp(S),l<0)break;for(y=0;y0?k=h[y][A-1>>1]:A<0&&(k=h[y][-A-1>>1].neg()),M="affine"===k.type?M.mixedAdd(k):M.add(k))}}for(l=0;l=Math.ceil((t.bitLength()+1)/e.step)},u.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n>>24]^f[p>>>16&255]^l[m>>>8&255]^c[255&v]^e[g++],s=u[p>>>24]^f[m>>>16&255]^l[v>>>8&255]^c[255&d]^e[g++],a=u[m>>>24]^f[v>>>16&255]^l[d>>>8&255]^c[255&p]^e[g++],h=u[v>>>24]^f[d>>>16&255]^l[p>>>8&255]^c[255&m]^e[g++],d=o,p=s,m=a,v=h;return o=(i[d>>>24]<<24|i[p>>>16&255]<<16|i[m>>>8&255]<<8|i[255&v])^e[g++],s=(i[p>>>24]<<24|i[m>>>16&255]<<16|i[v>>>8&255]<<8|i[255&d])^e[g++],a=(i[m>>>24]<<24|i[v>>>16&255]<<16|i[d>>>8&255]<<8|i[255&p])^e[g++],h=(i[v>>>24]<<24|i[d>>>16&255]<<16|i[p>>>8&255]<<8|i[255&m])^e[g++],[o>>>=0,s>>>=0,a>>>=0,h>>>=0]}var a=[0,1,2,4,8,16,32,64,128,27,54],h=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],s=0,a=0,h=0;h<256;++h){var u=a^a<<1^a<<2^a<<3^a<<4;u=u>>>8^255&u^99,r[s]=u,i[u]=s;var f=t[s],l=t[f],c=t[l],d=257*t[u]^16843008*u;n[0][s]=d<<24|d>>>8,n[1][s]=d<<16|d>>>16,n[2][s]=d<<8|d>>>24,n[3][s]=d,d=16843009*c^65537*l^257*f^16843008*s,o[0][u]=d<<24|d>>>8,o[1][u]=d<<16|d>>>16,o[2][u]=d<<8|d>>>24,o[3][u]=d,0===s?s=a=1:(s=f^t[t[t[c^f]]],a^=t[t[a]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}}();function u(t){this._key=n(t),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,i=4*(r+1),n=[],o=0;o>>24,s=h.SBOX[s>>>24]<<24|h.SBOX[s>>>16&255]<<16|h.SBOX[s>>>8&255]<<8|h.SBOX[255&s],s^=a[o/e|0]<<24):e>6&&o%e==4&&(s=h.SBOX[s>>>24]<<24|h.SBOX[s>>>16&255]<<16|h.SBOX[s>>>8&255]<<8|h.SBOX[255&s]),n[o]=n[o-e]^s}for(var u=[],f=0;f>>24]]^h.INV_SUB_MIX[1][h.SBOX[c>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[c>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&c]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=u},u.prototype.encryptBlockRaw=function(t){return s(t=n(t),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},u.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=i.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},u.prototype.decryptBlock=function(t){var e=(t=n(t))[1];t[1]=t[3],t[3]=e;var r=s(t,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),o=i.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},u.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=u},function(t,e,r){var i=r(1).Buffer,n=r(43);t.exports=function(t,e,r,o){if(i.isBuffer(t)||(t=i.from(t,"binary")),e&&(i.isBuffer(e)||(e=i.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=r/8,a=i.alloc(s),h=i.alloc(o||0),u=i.alloc(0);s>0||o>0;){var f=new n;f.update(u),f.update(t),e&&f.update(e),u=f.digest();var l=0;if(s>0){var c=a.length-s;l=Math.min(s,u.length),u.copy(a,c,0,l),s-=l}if(l0){var d=h.length-o,p=Math.min(o,u.length-l);u.copy(h,d,l,l+p),o-=p}}return u.fill(0),{key:a,iv:h}}},function(t,e,r){var i=r(14),n=r(9),o=n.getNAF,s=n.getJSF,a=n.assert;function h(t,e){this.type=t,this.p=new i(e.p,16),this.red=e.prime?i.red(e.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=e.n&&new i(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=h,h.prototype.point=function(){throw new Error("Not implemented")},h.prototype.validate=function(){throw new Error("Not implemented")},h.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),i=o(e,1,this._bitLength),n=(1<=h;e--)u=(u<<1)+i[e];s.push(u)}for(var f=this.jpoint(null,null,null),l=this.jpoint(null,null,null),c=n;c>0;c--){for(h=0;h=0;u--){for(e=0;u>=0&&0===s[u];u--)e++;if(u>=0&&e++,h=h.dblp(e),u<0)break;var f=s[u];a(0!==f),h="affine"===t.type?f>0?h.mixedAdd(n[f-1>>1]):h.mixedAdd(n[-f-1>>1].neg()):f>0?h.add(n[f-1>>1]):h.add(n[-f-1>>1].neg())}return"affine"===t.type?h.toP():h},h.prototype._wnafMulAdd=function(t,e,r,i,n){for(var a=this._wnafT1,h=this._wnafT2,u=this._wnafT3,f=0,l=0;l=1;l-=2){var d=l-1,p=l;if(1===a[d]&&1===a[p]){var m=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(m[1]=e[d].add(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].add(e[p].neg())):(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],g=s(r[d],r[p]);f=Math.max(g[0].length,f),u[d]=new Array(f),u[p]=new Array(f);for(var y=0;y=0;l--){for(var S=0;l>=0;){var x=!0;for(y=0;y=0&&S++,M=M.dblp(S),l<0)break;for(y=0;y0?k=h[y][A-1>>1]:A<0&&(k=h[y][-A-1>>1].neg()),M="affine"===k.type?M.mixedAdd(k):M.add(k))}}for(l=0;l=Math.ceil((t.bitLength()+1)/e.step)},u.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n>8,s=255&n;o?r.push(o,s):r.push(s)}return r},i.zero2=n,i.toHex=o,i.encode=function(t,e){return"hex"===e?o(t):t}},function(t,e,r){var i,n=e,o=r(25),s=r(61),a=r(8).assert;function h(t){"short"===t.type?this.curve=new s.short(t):"edwards"===t.type?this.curve=new s.edwards(t):this.curve=new s.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new h(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=h,u("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:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("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:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("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:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("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:o.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"]}),u("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:o.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"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("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:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=r(124)}catch(t){i=void 0}u("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:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},function(t,e,r){var i=r(0),n=r(66),o=r(1).Buffer,s=new Array(16);function a(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function h(t,e){return t<>>32-e}function u(t,e,r,i,n,o,s){return h(t+(e&r|~e&i)+n+o|0,s)+e|0}function f(t,e,r,i,n,o,s){return h(t+(e&i|r&~i)+n+o|0,s)+e|0}function l(t,e,r,i,n,o,s){return h(t+(e^r^i)+n+o|0,s)+e|0}function c(t,e,r,i,n,o,s){return h(t+(r^(e|~i))+n+o|0,s)+e|0}i(a,n),a.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,i=this._b,n=this._c,o=this._d;r=u(r,i,n,o,t[0],3614090360,7),o=u(o,r,i,n,t[1],3905402710,12),n=u(n,o,r,i,t[2],606105819,17),i=u(i,n,o,r,t[3],3250441966,22),r=u(r,i,n,o,t[4],4118548399,7),o=u(o,r,i,n,t[5],1200080426,12),n=u(n,o,r,i,t[6],2821735955,17),i=u(i,n,o,r,t[7],4249261313,22),r=u(r,i,n,o,t[8],1770035416,7),o=u(o,r,i,n,t[9],2336552879,12),n=u(n,o,r,i,t[10],4294925233,17),i=u(i,n,o,r,t[11],2304563134,22),r=u(r,i,n,o,t[12],1804603682,7),o=u(o,r,i,n,t[13],4254626195,12),n=u(n,o,r,i,t[14],2792965006,17),r=f(r,i=u(i,n,o,r,t[15],1236535329,22),n,o,t[1],4129170786,5),o=f(o,r,i,n,t[6],3225465664,9),n=f(n,o,r,i,t[11],643717713,14),i=f(i,n,o,r,t[0],3921069994,20),r=f(r,i,n,o,t[5],3593408605,5),o=f(o,r,i,n,t[10],38016083,9),n=f(n,o,r,i,t[15],3634488961,14),i=f(i,n,o,r,t[4],3889429448,20),r=f(r,i,n,o,t[9],568446438,5),o=f(o,r,i,n,t[14],3275163606,9),n=f(n,o,r,i,t[3],4107603335,14),i=f(i,n,o,r,t[8],1163531501,20),r=f(r,i,n,o,t[13],2850285829,5),o=f(o,r,i,n,t[2],4243563512,9),n=f(n,o,r,i,t[7],1735328473,14),r=l(r,i=f(i,n,o,r,t[12],2368359562,20),n,o,t[5],4294588738,4),o=l(o,r,i,n,t[8],2272392833,11),n=l(n,o,r,i,t[11],1839030562,16),i=l(i,n,o,r,t[14],4259657740,23),r=l(r,i,n,o,t[1],2763975236,4),o=l(o,r,i,n,t[4],1272893353,11),n=l(n,o,r,i,t[7],4139469664,16),i=l(i,n,o,r,t[10],3200236656,23),r=l(r,i,n,o,t[13],681279174,4),o=l(o,r,i,n,t[0],3936430074,11),n=l(n,o,r,i,t[3],3572445317,16),i=l(i,n,o,r,t[6],76029189,23),r=l(r,i,n,o,t[9],3654602809,4),o=l(o,r,i,n,t[12],3873151461,11),n=l(n,o,r,i,t[15],530742520,16),r=c(r,i=l(i,n,o,r,t[2],3299628645,23),n,o,t[0],4096336452,6),o=c(o,r,i,n,t[7],1126891415,10),n=c(n,o,r,i,t[14],2878612391,15),i=c(i,n,o,r,t[5],4237533241,21),r=c(r,i,n,o,t[12],1700485571,6),o=c(o,r,i,n,t[3],2399980690,10),n=c(n,o,r,i,t[10],4293915773,15),i=c(i,n,o,r,t[1],2240044497,21),r=c(r,i,n,o,t[8],1873313359,6),o=c(o,r,i,n,t[15],4264355552,10),n=c(n,o,r,i,t[6],2734768916,15),i=c(i,n,o,r,t[13],1309151649,21),r=c(r,i,n,o,t[4],4149444226,6),o=c(o,r,i,n,t[11],3174756917,10),n=c(n,o,r,i,t[2],718787259,15),i=c(i,n,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+o|0},a.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 t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=a},function(t,e,r){t.exports=n;var i=r(45).EventEmitter;function n(){i.call(this)}r(0)(n,i),n.Readable=r(46),n.Writable=r(140),n.Duplex=r(141),n.Transform=r(142),n.PassThrough=r(143),n.Stream=n,n.prototype.pipe=function(t,e){var r=this;function n(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",n),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",h));var s=!1;function a(){s||(s=!0,t.end())}function h(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function u(t){if(f(),0===i.listenerCount(this,"error"))throw t}function f(){r.removeListener("data",n),t.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",h),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),t.removeListener("close",f)}return r.on("error",u),t.on("error",u),r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t}},function(t,e,r){var i,n="object"==typeof Reflect?Reflect:null,o=n&&"function"==typeof n.apply?n.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};i=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}t.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var h=10;function u(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function f(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function l(t,e,r,i){var n,o,s,a;if(u(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=f(t))>0&&s.length>n&&!s.warned){s.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=t,h.type=e,h.count=s.length,a=h,console&&console.warn&&console.warn(a)}return t}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=c.bind(i);return n.listener=r,i.wrapFn=n,n}function p(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var h=n[t];if(void 0===h)return!1;if("function"==typeof h)o(h,this,e);else{var u=h.length,f=v(h,u);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},a.prototype.listeners=function(t){return p(this,t,!0)},a.prototype.rawListeners=function(t){return p(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},function(t,e,r){(e=t.exports=r(67)).Stream=e,e.Readable=e,e.Writable=r(48),e.Duplex=r(18),e.Transform=r(70),e.PassThrough=r(139)},function(t,e,r){var i=r(2),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=s),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},function(t,e,r){(function(e,i,n){var o=r(36);function s(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(void 0),i=i.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=y;var a,h=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?i:o.nextTick;y.WritableState=g;var u=Object.create(r(28));u.inherits=r(0);var f,l={deprecate:r(137)},c=r(68),d=r(47).Buffer,p=n.Uint8Array||function(){},m=r(69);function v(){}function g(t,e){a=a||r(18),t=t||{};var i=e instanceof a;this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var n=t.highWaterMark,u=t.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i&&(u||0===u)?u:f,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 l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,i,n){--e.pendingcb,r?(o.nextTick(n,i),o.nextTick(x,t,e),t._writableState.errorEmitted=!0,t.emit("error",i)):(n(i),t._writableState.errorEmitted=!0,t.emit("error",i),x(t,e))}(t,r,i,e,n);else{var s=_(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||M(t,r),i?h(w,t,r,s,n):w(t,r,s,n)}}(e,t)},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 s(this)}function y(t){if(a=a||r(18),!(f.call(y,this)||this instanceof a))return new y(t);this._writableState=new g(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),c.call(this)}function b(t,e,r,i,n,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function w(t,e,r,i){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,i(),x(t,e)}function M(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,n=new Array(i),o=e.corkedRequestsFree;o.entry=r;for(var a=0,h=!0;r;)n[a]=r,r.isBuf||(h=!1),r=r.next,a+=1;n.allBuffers=h,b(t,e,!0,e.length,n,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new s(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,f=r.encoding,l=r.callback;if(b(t,e,!1,e.objectMode?1:u.length,u,f,l),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function _(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function S(t,e){t._final((function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),x(t,e)}))}function x(t,e){var r=_(e);return r&&(function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(S,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}u.inherits(y,c),g.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(g.prototype,"buffer",{get:l.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(t){return!!f.call(this,t)||this===y&&t&&t._writableState instanceof g}})):f=function(t){return t instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(t,e,r){var i,n=this._writableState,s=!1,a=!n.objectMode&&(i=t,d.isBuffer(i)||i instanceof p);return a&&!d.isBuffer(t)&&(t=function(t){return d.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=v),n.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),o.nextTick(e,r)}(this,r):(a||function(t,e,r,i){var n=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),o.nextTick(i,s),n=!1),n}(this,n,t,r))&&(n.pendingcb++,s=function(t,e,r,i,n,o){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=d.from(e,r)),e}(e,i,n);i!==s&&(r=!0,n="buffer",i=s)}var a=e.objectMode?1:i.length;e.length+=a;var h=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(t,e,r){var i=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||function(t,e,r){e.ending=!0,x(t,e),r&&(e.finished?o.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,i,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,r(13),r(135).setImmediate,r(7))},function(t,e,r){var i=r(138).Buffer,n=i.isEncoding||function(t){switch((t=""+t)&&t.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}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===n||!n(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=h,this.end=u,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=f,this.end=l,e=3;break;default:return this.write=c,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function h(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function c(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(n>0&&(t.lastNeed=n-1),n):--i=0?(n>0&&(t.lastNeed=n-2),n):--i=0?(n>0&&(2===n?n=0:t.lastNeed=n-3),n):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,r){var i=r(2).Buffer,n=r(0),o=r(66),s=new Array(16),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],h=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],f=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],l=[0,1518500249,1859775393,2400959708,2840853838],c=[1352829926,1548603684,1836072691,2053994217,0];function d(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(t,e){return t<>>32-e}function m(t,e,r,i,n,o,s,a){return p(t+(e^r^i)+o+s|0,a)+n|0}function v(t,e,r,i,n,o,s,a){return p(t+(e&r|~e&i)+o+s|0,a)+n|0}function g(t,e,r,i,n,o,s,a){return p(t+((e|~r)^i)+o+s|0,a)+n|0}function y(t,e,r,i,n,o,s,a){return p(t+(e&i|r&~i)+o+s|0,a)+n|0}function b(t,e,r,i,n,o,s,a){return p(t+(e^(r|~i))+o+s|0,a)+n|0}n(d,o),d.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,i=0|this._b,n=0|this._c,o=0|this._d,d=0|this._e,w=0|this._a,M=0|this._b,_=0|this._c,S=0|this._d,x=0|this._e,k=0;k<80;k+=1){var A,E;k<16?(A=m(r,i,n,o,d,t[a[k]],l[0],u[k]),E=b(w,M,_,S,x,t[h[k]],c[0],f[k])):k<32?(A=v(r,i,n,o,d,t[a[k]],l[1],u[k]),E=y(w,M,_,S,x,t[h[k]],c[1],f[k])):k<48?(A=g(r,i,n,o,d,t[a[k]],l[2],u[k]),E=g(w,M,_,S,x,t[h[k]],c[2],f[k])):k<64?(A=y(r,i,n,o,d,t[a[k]],l[3],u[k]),E=v(w,M,_,S,x,t[h[k]],c[3],f[k])):(A=b(r,i,n,o,d,t[a[k]],l[4],u[k]),E=m(w,M,_,S,x,t[h[k]],c[4],f[k])),r=d,d=o,o=p(n,10),n=i,i=A,w=x,x=S,S=p(_,10),_=M,M=E}var B=this._b+n+S|0;this._b=this._c+o+x|0,this._c=this._d+d+w|0,this._d=this._e+r+M|0,this._e=this._a+i+_|0,this._a=B},d.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 t=i.alloc?i.alloc(20):new i(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=d},function(t,e,r){(e=t.exports=function(t){t=t.toLowerCase();var r=e[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r}).sha=r(144),e.sha1=r(145),e.sha224=r(146),e.sha256=r(71),e.sha384=r(147),e.sha512=r(72)},function(t,e,r){var i=r(5);function n(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}t.exports=n,n.prototype._init=function(){},n.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},n.prototype._buffer=function(t,e){for(var r=Math.min(this.buffer.length-this.bufferOff,t.length-e),i=0;i0;i--)e+=this._buffer(t,e),r+=this._flushBuffer(n,r);return e+=this._buffer(t,e),n},n.prototype.final=function(t){var e,r;return t&&(e=this.update(t)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},n.prototype._pad=function(t,e){if(0===e)return!1;for(;e=0||!r.umod(t.prime1)||!r.umod(t.prime2);)r=new i(n(e));return r}t.exports=o,o.getr=s}).call(this,r(2).Buffer)},function(t,e,r){var i,n=e,o=r(25),s=r(90),a=r(9).assert;function h(t){"short"===t.type?this.curve=new s.short(t):"edwards"===t.type?this.curve=new s.edwards(t):this.curve=new s.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new h(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=h,u("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:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("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:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("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:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("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:o.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"]}),u("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:o.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"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("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:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=r(181)}catch(t){i=void 0}u("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:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},function(t,e,r){(function(t){!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(210).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e,r){(function(t,r){var i;!function(){var n="object"==typeof self&&self.self===self&&self||"object"==typeof t&&t.global===t&&t||this||{},o=n._,s=Array.prototype,a=Object.prototype,h="undefined"!=typeof Symbol?Symbol.prototype:null,u=s.push,f=s.slice,l=a.toString,c=a.hasOwnProperty,d=Array.isArray,p=Object.keys,m=Object.create,v=function(){},g=function t(e){return e instanceof t?e:this instanceof t?void(this._wrapped=e):new t(e)};e.nodeType?n._=g:(!r.nodeType&&r.exports&&(e=r.exports=g),e._=g),g.VERSION="1.9.1";var y,b=function(t,e,r){if(void 0===e)return t;switch(null==r?3:r){case 1:return function(r){return t.call(e,r)};case 3:return function(r,i,n){return t.call(e,r,i,n)};case 4:return function(r,i,n,o){return t.call(e,r,i,n,o)}}return function(){return t.apply(e,arguments)}},w=function(t,e,r){return g.iteratee!==y?g.iteratee(t,e):null==t?g.identity:g.isFunction(t)?b(t,e,r):g.isObject(t)&&!g.isArray(t)?g.matcher(t):g.property(t)};g.iteratee=y=function(t,e){return w(t,e,1/0)};var M=function(t,e){return e=null==e?t.length-1:+e,function(){for(var r=Math.max(arguments.length-e,0),i=Array(r),n=0;n=0&&e<=A};g.each=g.forEach=function(t,e,r){var i,n;if(e=b(e,r),B(t))for(i=0,n=t.length;i0?0:s-1;for(n||(i=e[o?o[a]:a],a+=t);a>=0&&a=3;return e(t,b(r,n,4),i,o)}};g.reduce=g.foldl=g.inject=O(1),g.reduceRight=g.foldr=O(-1),g.find=g.detect=function(t,e,r){var i=(B(t)?g.findIndex:g.findKey)(t,e,r);if(void 0!==i&&-1!==i)return t[i]},g.filter=g.select=function(t,e,r){var i=[];return e=w(e,r),g.each(t,(function(t,r,n){e(t,r,n)&&i.push(t)})),i},g.reject=function(t,e,r){return g.filter(t,g.negate(w(e)),r)},g.every=g.all=function(t,e,r){e=w(e,r);for(var i=!B(t)&&g.keys(t),n=(i||t).length,o=0;o=0},g.invoke=M((function(t,e,r){var i,n;return g.isFunction(e)?n=e:g.isArray(e)&&(i=e.slice(0,-1),e=e[e.length-1]),g.map(t,(function(t){var o=n;if(!o){if(i&&i.length&&(t=k(t,i)),null==t)return;o=t[e]}return null==o?o:o.apply(t,r)}))})),g.pluck=function(t,e){return g.map(t,g.property(e))},g.where=function(t,e){return g.filter(t,g.matcher(e))},g.findWhere=function(t,e){return g.find(t,g.matcher(e))},g.max=function(t,e,r){var i,n,o=-1/0,s=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,h=(t=B(t)?t:g.values(t)).length;ao&&(o=i);else e=w(e,r),g.each(t,(function(t,r,i){((n=e(t,r,i))>s||n===-1/0&&o===-1/0)&&(o=t,s=n)}));return o},g.min=function(t,e,r){var i,n,o=1/0,s=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,h=(t=B(t)?t:g.values(t)).length;ai||void 0===r)return 1;if(r0?0:n-1;o>=0&&o0?s=o>=0?o:Math.max(o+a,s):a=o>=0?Math.min(o+1,a):o+a+1;else if(r&&o&&a)return i[o=r(i,n)]===n?o:-1;if(n!=n)return(o=e(f.call(i,s,a),g.isNaN))>=0?o+s:-1;for(o=t>0?s:a-1;o>=0&&oe?(i&&(clearTimeout(i),i=null),a=u,s=t.apply(n,o),i||(n=o=null)):i||!1===r.trailing||(i=setTimeout(h,f)),s};return u.cancel=function(){clearTimeout(i),a=0,i=n=o=null},u},g.debounce=function(t,e,r){var i,n,o=function(e,r){i=null,r&&(n=t.apply(e,r))},s=M((function(s){if(i&&clearTimeout(i),r){var a=!i;i=setTimeout(o,e),a&&(n=t.apply(this,s))}else i=g.delay(o,e,this,s);return n}));return s.cancel=function(){clearTimeout(i),i=null},s},g.wrap=function(t,e){return g.partial(e,t)},g.negate=function(t){return function(){return!t.apply(this,arguments)}},g.compose=function(){var t=arguments,e=t.length-1;return function(){for(var r=e,i=t[e].apply(this,arguments);r--;)i=t[r].call(this,i);return i}},g.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},g.before=function(t,e){var r;return function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=null),r}},g.once=g.partial(g.before,2),g.restArguments=M;var P=!{toString:null}.propertyIsEnumerable("toString"),L=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],q=function(t,e){var r=L.length,i=t.constructor,n=g.isFunction(i)&&i.prototype||a,o="constructor";for(x(t,o)&&!g.contains(e,o)&&e.push(o);r--;)(o=L[r])in t&&t[o]!==n[o]&&!g.contains(e,o)&&e.push(o)};g.keys=function(t){if(!g.isObject(t))return[];if(p)return p(t);var e=[];for(var r in t)x(t,r)&&e.push(r);return P&&q(t,e),e},g.allKeys=function(t){if(!g.isObject(t))return[];var e=[];for(var r in t)e.push(r);return P&&q(t,e),e},g.values=function(t){for(var e=g.keys(t),r=e.length,i=Array(r),n=0;n1&&(i=b(i,e[1])),e=g.allKeys(t)):(i=z,e=T(e,!1,!1),t=Object(t));for(var n=0,o=e.length;n1&&(r=e[1])):(e=g.map(T(e,!1,!1),String),i=function(t,r){return!g.contains(e,r)}),g.pick(t,i,r)})),g.defaults=D(g.allKeys,!0),g.create=function(t,e){var r=_(t);return e&&g.extendOwn(r,e),r},g.clone=function(t){return g.isObject(t)?g.isArray(t)?t.slice():g.extend({},t):t},g.tap=function(t,e){return e(t),t},g.isMatch=function(t,e){var r=g.keys(e),i=r.length;if(null==t)return!i;for(var n=Object(t),o=0;o":">",'"':""","'":"'","`":"`"},W=g.invert(Z),K=function(t){var e=function(e){return t[e]},r="(?:"+g.keys(t).join("|")+")",i=RegExp(r),n=RegExp(r,"g");return function(t){return t=null==t?"":""+t,i.test(t)?t.replace(n,e):t}};g.escape=K(Z),g.unescape=K(W),g.result=function(t,e,r){g.isArray(e)||(e=[e]);var i=e.length;if(!i)return g.isFunction(r)?r.call(t):r;for(var n=0;n/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var G=/(.)^/,Y={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},J=/\\|'|\r|\n|\u2028|\u2029/g,X=function(t){return"\\"+Y[t]};g.template=function(t,e,r){!e&&r&&(e=r),e=g.defaults({},e,g.templateSettings);var i,n=RegExp([(e.escape||G).source,(e.interpolate||G).source,(e.evaluate||G).source].join("|")+"|$","g"),o=0,s="__p+='";t.replace(n,(function(e,r,i,n,a){return s+=t.slice(o,a).replace(J,X),o=a+e.length,r?s+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":i?s+="'+\n((__t=("+i+"))==null?'':__t)+\n'":n&&(s+="';\n"+n+"\n__p+='"),e})),s+="';\n",e.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{i=new Function(e.variable||"obj","_",s)}catch(t){throw t.source=s,t}var a=function(t){return i.call(this,t,g)},h=e.variable||"obj";return a.source="function("+h+"){\n"+s+"}",a},g.chain=function(t){var e=g(t);return e._chain=!0,e};var $=function(t,e){return t._chain?g(e).chain():e};g.mixin=function(t){return g.each(g.functions(t),(function(e){var r=g[e]=t[e];g.prototype[e]=function(){var t=[this._wrapped];return u.apply(t,arguments),$(this,r.apply(g,t))}})),g},g.mixin(g),g.each(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=s[t];g.prototype[t]=function(){var r=this._wrapped;return e.apply(r,arguments),"shift"!==t&&"splice"!==t||0!==r.length||delete r[0],$(this,r)}})),g.each(["concat","join","slice"],(function(t){var e=s[t];g.prototype[t]=function(){return $(this,e.apply(this._wrapped,arguments))}})),g.prototype.value=function(){return this._wrapped},g.prototype.valueOf=g.prototype.toJSON=g.prototype.value,g.prototype.toString=function(){return String(this._wrapped)},void 0===(i=function(){return g}.apply(e,[]))||(r.exports=i)}()}).call(this,r(7),r(4)(t))},function(t,e){t.exports=T},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){var i=e;i.base=r(35),i.short=r(115),i.mont=r(116),i.edwards=r(117)},function(t,e,r){var i=r(11).rotr32;function n(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function s(t,e,r){return t^e^r}e.ft_1=function(t,e,r,i){return 0===t?n(e,r,i):1===t||3===t?s(e,r,i):2===t?o(e,r,i):void 0},e.ch32=n,e.maj32=o,e.p32=s,e.s0_256=function(t){return i(t,2)^i(t,13)^i(t,22)},e.s1_256=function(t){return i(t,6)^i(t,11)^i(t,25)},e.g0_256=function(t){return i(t,7)^i(t,18)^t>>>3},e.g1_256=function(t){return i(t,17)^i(t,19)^t>>>10}},function(t,e,r){var i=r(11),n=r(26),o=r(62),s=r(5),a=i.sum32,h=i.sum32_4,u=i.sum32_5,f=o.ch32,l=o.maj32,c=o.s0_256,d=o.s1_256,p=o.g0_256,m=o.g1_256,v=n.BlockHash,g=[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];function y(){if(!(this instanceof y))return new y;v.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}i.inherits(y,v),t.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}t.exports=s,s.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},s.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(i=r,r=e,e=null),r&&(r=n.toArray(r,i||"hex"),this._update(r));for(var o=[];o.length=this._blockSize;){for(var o=this._blockOffset;o0;++s)this._length[s]+=a,(a=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*a);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},function(t,e,r){(function(e,i){var n=r(36);t.exports=b;var o,s=r(60);b.ReadableState=y,r(45).EventEmitter;var a=function(t,e){return t.listeners(e).length},h=r(68),u=r(47).Buffer,f=e.Uint8Array||function(){},l=Object.create(r(28));l.inherits=r(0);var c=r(132),d=void 0;d=c&&c.debuglog?c.debuglog("stream"):function(){};var p,m=r(133),v=r(69);l.inherits(b,h);var g=["error","close","destroy","pause","resume"];function y(t,e){t=t||{};var i=e instanceof(o=o||r(18));this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,s=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,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.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=r(49).StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function b(t){if(o=o||r(18),!(this instanceof b))return new b(t);this._readableState=new y(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),h.call(this)}function w(t,e,r,i,n){var o,s=t._readableState;return null===e?(s.reading=!1,function(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,S(t)}}(t,s)):(n||(o=function(t,e){var r,i;return i=e,u.isBuffer(i)||i instanceof f||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(s,e)),o?t.emit("error",o):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),i?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):M(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?M(t,s,e,!1):k(t,s)):M(t,s,e,!1))):i||(s.reading=!1)),function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=8388608?t=8388608:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function S(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(d("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?n.nextTick(x,t):x(t))}function x(t){d("emit readable"),t.emit("readable"),O(t)}function k(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(A,t,e))}function A(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var i;return to.length?o.length:t;if(s===o.length?n+=o:n+=o.slice(0,t),0==(t-=s)){s===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++i}return e.length-=i,n}(t,e):function(t,e){var r=u.allocUnsafe(t),i=e.head,n=1;for(i.data.copy(r),t-=i.data.length;i=i.next;){var o=i.data,s=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,s),0==(t-=s)){s===o.length?(++n,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=o.slice(s));break}++n}return e.length-=n,r}(t,e),i}(t,e.buffer,e.decoder),r);var r}function I(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,n.nextTick(T,e,t))}function T(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function j(t,e){for(var r=0,i=t.length;r=e.highWaterMark||e.ended))return d("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?I(this):S(this),null;if(0===(t=_(t,e))&&e.ended)return 0===e.length&&I(this),null;var i,n=e.needReadable;return d("need readable",n),(0===e.length||e.length-t0?R(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&I(this)),null!==i&&this.emit("data",i),i},b.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(t,e){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,e);var h=e&&!1===e.end||t===i.stdout||t===i.stderr?y:u;function u(){d("onend"),t.end()}o.endEmitted?n.nextTick(h):r.once("end",h),t.on("unpipe",(function e(i,n){d("onunpipe"),i===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d("cleanup"),t.removeListener("close",v),t.removeListener("finish",g),t.removeListener("drain",f),t.removeListener("error",m),t.removeListener("unpipe",e),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",p),l=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}));var f=function(t){return function(){var e=t._readableState;d("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,O(t))}}(r);t.on("drain",f);var l=!1,c=!1;function p(e){d("ondata"),c=!1,!1!==t.write(e)||c||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==j(o.pipes,t))&&!l&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,c=!0),r.pause())}function m(e){d("onerror",e),y(),t.removeListener("error",m),0===a(t,"error")&&t.emit("error",e)}function v(){t.removeListener("finish",g),y()}function g(){d("onfinish"),t.removeListener("close",v),y()}function y(){d("unpipe"),r.unpipe(t)}return r.on("data",p),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?s(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",m),t.once("close",v),t.once("finish",g),t.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),t},b.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function c(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}i(h,n),h.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},h.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,h=0|this._e,p=0|this._f,m=0|this._g,v=0|this._h,g=0;g<16;++g)r[g]=t.readInt32BE(4*g);for(;g<64;++g)r[g]=0|(((e=r[g-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[g-7]+d(r[g-15])+r[g-16];for(var y=0;y<64;++y){var b=v+c(h)+u(h,p,m)+s[y]+r[y]|0,w=l(i)+f(i,n,o)|0;v=m,m=p,p=h,h=a+b|0,a=o,o=n,n=i,i=b+w|0}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=h+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=v+this._h|0},h.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=h},function(t,e,r){var i=r(0),n=r(20),o=r(1).Buffer,s=[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],a=new Array(160);function h(){this.init(),this._w=a,n.call(this,128,112)}function u(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function l(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function c(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function m(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function v(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function g(t,e){return t>>>0>>0?1:0}i(h,n),h.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},h.prototype._update=function(t){for(var e=this._w,r=0|this._ah,i=0|this._bh,n=0|this._ch,o=0|this._dh,a=0|this._eh,h=0|this._fh,y=0|this._gh,b=0|this._hh,w=0|this._al,M=0|this._bl,_=0|this._cl,S=0|this._dl,x=0|this._el,k=0|this._fl,A=0|this._gl,E=0|this._hl,B=0;B<32;B+=2)e[B]=t.readInt32BE(4*B),e[B+1]=t.readInt32BE(4*B+4);for(;B<160;B+=2){var O=e[B-30],R=e[B-30+1],I=d(O,R),T=p(R,O),j=m(O=e[B-4],R=e[B-4+1]),C=v(R,O),N=e[B-14],P=e[B-14+1],L=e[B-32],q=e[B-32+1],D=T+P|0,U=I+N+g(D,T)|0;U=(U=U+j+g(D=D+C|0,C)|0)+L+g(D=D+q|0,q)|0,e[B]=U,e[B+1]=D}for(var F=0;F<160;F+=2){U=e[F],D=e[F+1];var z=f(r,i,n),H=f(w,M,_),Z=l(r,w),W=l(w,r),K=c(a,x),V=c(x,a),G=s[F],Y=s[F+1],J=u(a,h,y),X=u(x,k,A),$=E+V|0,Q=b+K+g($,E)|0;Q=(Q=(Q=Q+J+g($=$+X|0,X)|0)+G+g($=$+Y|0,Y)|0)+U+g($=$+D|0,D)|0;var tt=W+H|0,et=Z+z+g(tt,W)|0;b=y,E=A,y=h,A=k,h=a,k=x,a=o+Q+g(x=S+$|0,S)|0,o=n,S=_,n=i,_=M,i=r,M=w,r=Q+et+g(w=$+tt|0,$)|0}this._al=this._al+w|0,this._bl=this._bl+M|0,this._cl=this._cl+_|0,this._dl=this._dl+S|0,this._el=this._el+x|0,this._fl=this._fl+k|0,this._gl=this._gl+A|0,this._hl=this._hl+E|0,this._ah=this._ah+r+g(this._al,w)|0,this._bh=this._bh+i+g(this._bl,M)|0,this._ch=this._ch+n+g(this._cl,_)|0,this._dh=this._dh+o+g(this._dl,S)|0,this._eh=this._eh+a+g(this._el,x)|0,this._fh=this._fh+h+g(this._fl,k)|0,this._gh=this._gh+y+g(this._gl,A)|0,this._hh=this._hh+b+g(this._hl,E)|0},h.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=h},function(t,e,r){var i=r(0),n=r(148),o=r(15),s=r(1).Buffer,a=r(74),h=r(50),u=r(51),f=s.alloc(128);function l(t,e){o.call(this,"digest"),"string"==typeof e&&(e=s.from(e));var r="sha512"===t||"sha384"===t?128:64;this._alg=t,this._key=e,e.length>r?e=("rmd160"===t?new h:u(t)).update(e).digest():e.lengthr||o!=o)throw new TypeError("Bad key length")}}).call(this,r(2).Buffer)},function(t,e,r){(function(e){var r;r=e.browser||parseInt(e.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary",t.exports=r}).call(this,r(13))},function(t,e,r){var i=r(74),n=r(50),o=r(51),s=r(77),a=r(78),h=r(1).Buffer,u=h.alloc(128),f={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function l(t,e,r){var s=function(t){return"rmd160"===t||"ripemd160"===t?function(t){return(new n).update(t).digest()}:"md5"===t?i:function(e){return o(t).update(e).digest()}}(t),a="sha512"===t||"sha384"===t?128:64;e.length>a?e=s(e):e.length>>0},e.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},e.ip=function(t,e,r,i){for(var n=0,o=0,s=6;s>=0;s-=2){for(var a=0;a<=24;a+=8)n<<=1,n|=e>>>a+s&1;for(a=0;a<=24;a+=8)n<<=1,n|=t>>>a+s&1}for(s=6;s>=0;s-=2){for(a=1;a<=25;a+=8)o<<=1,o|=e>>>a+s&1;for(a=1;a<=25;a+=8)o<<=1,o|=t>>>a+s&1}r[i+0]=n>>>0,r[i+1]=o>>>0},e.rip=function(t,e,r,i){for(var n=0,o=0,s=0;s<4;s++)for(var a=24;a>=0;a-=8)n<<=1,n|=e>>>a+s&1,n<<=1,n|=t>>>a+s&1;for(s=4;s<8;s++)for(a=24;a>=0;a-=8)o<<=1,o|=e>>>a+s&1,o<<=1,o|=t>>>a+s&1;r[i+0]=n>>>0,r[i+1]=o>>>0},e.pc1=function(t,e,r,i){for(var n=0,o=0,s=7;s>=5;s--){for(var a=0;a<=24;a+=8)n<<=1,n|=e>>a+s&1;for(a=0;a<=24;a+=8)n<<=1,n|=t>>a+s&1}for(a=0;a<=24;a+=8)n<<=1,n|=e>>a+s&1;for(s=1;s<=3;s++){for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1;for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1}for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1;r[i+0]=n>>>0,r[i+1]=o>>>0},e.r28shl=function(t,e){return t<>>28-e};var i=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];e.pc2=function(t,e,r,n){for(var o=0,s=0,a=i.length>>>1,h=0;h>>i[h]&1;for(h=a;h>>i[h]&1;r[n+0]=o>>>0,r[n+1]=s>>>0},e.expand=function(t,e,r){var i=0,n=0;i=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)i<<=6,i|=t>>>o&63;for(o=11;o>=3;o-=4)n|=t>>>o&63,n<<=6;n|=(31&t)<<1|t>>>31,e[r+0]=i>>>0,e[r+1]=n>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];e.substitute=function(t,e){for(var r=0,i=0;i<4;i++)r<<=4,r|=n[64*i+(t>>>18-6*i&63)];for(i=0;i<4;i++)r<<=4,r|=n[256+64*i+(e>>>18-6*i&63)];return r>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];e.permute=function(t){for(var e=0,r=0;r>>o[r]&1;return e>>>0},e.padSplit=function(t,e,r){for(var i=t.toString(2);i.length>>1];r=o.r28shl(r,a),n=o.r28shl(n,a),o.pc2(r,n,t.keys,s)}},h.prototype._update=function(t,e,r,i){var n=this._desState,s=o.readUInt32BE(t,e),a=o.readUInt32BE(t,e+4);o.ip(s,a,n.tmp,0),s=n.tmp[0],a=n.tmp[1],"encrypt"===this.type?this._encrypt(n,s,a,n.tmp,0):this._decrypt(n,s,a,n.tmp,0),s=n.tmp[0],a=n.tmp[1],o.writeUInt32BE(r,s,i),o.writeUInt32BE(r,a,i+4)},h.prototype._pad=function(t,e){for(var r=t.length-e,i=e;i>>0,s=c}o.rip(a,s,i,n)},h.prototype._decrypt=function(t,e,r,i,n){for(var s=r,a=e,h=t.keys.length-2;h>=0;h-=2){var u=t.keys[h],f=t.keys[h+1];o.expand(s,t.tmp,0),u^=t.tmp[0],f^=t.tmp[1];var l=o.substitute(u,f),c=s;s=(a^o.permute(l))>>>0,a=c}o.rip(s,a,i,n)}},function(t,e,r){var i=r(29),n=r(1).Buffer,o=r(83);function s(t){var e=t._cipher.encryptBlockRaw(t._prev);return o(t._prev),e}e.encrypt=function(t,e){var r=Math.ceil(e.length/16),o=t._cache.length;t._cache=n.concat([t._cache,n.allocUnsafe(16*r)]);for(var a=0;at;)r.ishrn(1);if(r.isEven()&&r.iadd(a),r.testn(1)||r.iadd(h),e.cmp(h)){if(!e.cmp(u))for(;r.mod(f).cmp(l);)r.iadd(d)}else for(;r.mod(o).cmp(c);)r.iadd(d);if(m(p=r.shrn(1))&&m(r)&&v(p)&&v(r)&&s.test(p)&&s.test(r))return r}}},function(t,e,r){(function(t){!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(167).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e,r){var i=r(168),n=r(24);function o(t){this.rand=t||new n.Rand}t.exports=o,o.create=function(t){return new o(t)},o.prototype._randbelow=function(t){var e=t.bitLength(),r=Math.ceil(e/8);do{var n=new i(this.rand.generate(r))}while(n.cmp(t)>=0);return n},o.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},o.prototype.test=function(t,e,r){var n=t.bitLength(),o=i.mont(t),s=new i(1).toRed(o);e||(e=Math.max(1,n/48|0));for(var a=t.subn(1),h=0;!a.testn(h);h++);for(var u=t.shrn(h),f=a.toRed(o);e>0;e--){var l=this._randrange(new i(2),a);r&&r(l);var c=l.toRed(o).redPow(u);if(0!==c.cmp(s)&&0!==c.cmp(f)){for(var d=1;d0;e--){var f=this._randrange(new i(2),s),l=t.gcd(f);if(0!==l.cmpn(1))return l;var c=f.toRed(n).redPow(h);if(0!==c.cmp(o)&&0!==c.cmp(u)){for(var d=1;d=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e,r){var i=r(0),n=r(31).Reporter,o=r(2).Buffer;function s(t,e){n.call(this,e),o.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function a(t,e){if(Array.isArray(t))this.length=0,this.value=t.map((function(t){return t instanceof a||(t=new a(t,e)),this.length+=t.length,t}),this);else if("number"==typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=o.byteLength(t);else{if(!o.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}i(s,n),e.DecoderBuffer=s,s.prototype.save=function(){return{offset:this.offset,reporter:n.prototype.save.call(this)}},s.prototype.restore=function(t){var e=new s(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,n.prototype.restore.call(this,t.reporter),e},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},s.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");var r=new s(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+t,this.offset+=t,r},s.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},e.EncoderBuffer=a,a.prototype.join=function(t,e){return t||(t=new o(this.length)),e||(e=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(t,e),e+=r.length})):("number"==typeof this.value?t[e]=this.value:"string"==typeof this.value?t.write(this.value,e):o.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length)),t}},function(t,e,r){var i=e;i._reverse=function(t){var e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);var i=t[r];e[i]=r})),e},i.der=r(196)},function(t,e,r){var i=r(0),n=r(30),o=n.base,s=n.bignum,a=n.constants.der;function h(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new u,this.tree._init(t.body)}function u(t){o.Node.call(this,"der",t)}function f(t,e){var r=t.readUInt8(e);if(t.isError(r))return r;var i=a.tagClass[r>>6],n=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=t.readUInt8(e),t.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:a.tag[r]}}function l(t,e,r){var i=t.readUInt8(r);if(t.isError(i))return i;if(!e&&128===i)return null;if(0==(128&i))return i;var n=127&i;if(n>4)return t.error("length octect is too long");i=0;for(var o=0;o=31?i.error("Multi-octet tag encoding unsupported"):(e||(n|=32),n|a.tagClassByName[r||"universal"]<<6)}(t,e,r,this.reporter);if(i.length<128)return(o=new n(2))[0]=s,o[1]=i.length,this._createEncoderBuffer([o,i]);for(var h=1,u=i.length;u>=256;u>>=8)h++;(o=new n(2+h))[0]=s,o[1]=128|h,u=1+h;for(var f=i.length;f>0;u--,f>>=8)o[u]=255&f;return this._createEncoderBuffer([o,i])},u.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){for(var r=new n(2*t.length),i=0;i=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}var o=0;for(i=0;i=128;s>>=7)o++}var a=new n(o),h=a.length-1;for(i=t.length-1;i>=0;i--)for(s=t[i],a[h--]=127&s;(s>>=7)>0;)a[h--]=128|127&s;return this._createEncoderBuffer(a)},u.prototype._encodeTime=function(t,e){var r,i=new Date(t);return"gentime"===e?r=[f(i.getFullYear()),f(i.getUTCMonth()+1),f(i.getUTCDate()),f(i.getUTCHours()),f(i.getUTCMinutes()),f(i.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[f(i.getFullYear()%100),f(i.getUTCMonth()+1),f(i.getUTCDate()),f(i.getUTCHours()),f(i.getUTCMinutes()),f(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!n.isBuffer(t)){var r=t.toArray();!t.sign&&128&r[0]&&r.unshift(0),t=new n(r)}if(n.isBuffer(t)){var i=t.length;0===t.length&&i++;var o=new n(i);return t.copy(o),0===t.length&&(o[0]=0),this._createEncoderBuffer(o)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);i=1;for(var s=t;s>=256;s>>=8)i++;for(s=(o=new Array(i)).length-1;s>=0;s--)o[s]=255&t,t>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(new n(o))},u.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},u.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},u.prototype._skipDefault=function(t,e,r){var i,n=this._baseState;if(null===n.default)return!1;var o=t.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,e,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;i7&&t[r].toUpperCase()!==t[r]||parseInt(e[r],16)<=7&&t[r].toLowerCase()!==t[r])return!1;return!0},p=function(t){var e="";t=(t=(t=(t=(t=s.encode(t)).replace(/^(?:\u0000)*/,"")).split("").reverse().join("")).replace(/^(?:\u0000)*/,"")).split("").reverse().join("");for(var r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return"0x"+e.join("")},isHex:function(t){return(i.isString(t)||i.isNumber(t))&&/^(-0x|0x)?[0-9a-f]*$/i.test(t)},isHexStrict:g,leftPad:function(t,e,r){var i=/^0x/i.test(t)||"number"==typeof t,n=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(i?"0x":"")+new Array(n).join(r||"0")+t},rightPad:function(t,e,r){var i=/^0x/i.test(t)||"number"==typeof t,n=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(i?"0x":"")+t+new Array(n).join(r||"0")},toTwosComplement:function(t){return"0x"+l(t).toTwos(256).toString(16,64)},sha3:b,sha3Raw:function(t){return null===(t=b(t))?y:t}}}).call(this,r(2).Buffer)},function(t,e,r){(function(t){!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(218).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e,r){(function(t){var i=r(10),n=r.n(i),o=r(21),s=r.n(o),a=r(22),h=r.n(a),u=r(104),f=r.n(u),l=r(105),c=r.n(l),d=r(3),p=r.n(d),m=r(34),v=r(32),g=r(16),y=r.n(g),b=r(19),w=r(6),M=r(33),_=r(23);function S(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function x(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},r=t.enableLogging,i=void 0!==r&&r,n=t.metadataHost,o=void 0===n?"https://metadata.tor.us":n;f()(this,e),this.ec=new v.ec("secp256k1"),this.metadataHost=o,y.a.setDefaultLevel("DEBUG"),i||y.a.disableAll()}var r,i,o;return c()(e,[{key:"retrieveShares",value:(o=h()(n.a.mark((function e(r,i,o,s,a){var u,f,l,c,d,v,g,S,k=this;return n.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(u=[],f=Object(m.generatePrivate)(),l=Object(m.getPublic)(f).toString("hex"),c=l.slice(2,66),d=l.slice(66),v=Object(b.keccak256)(a),g=0;g=3*~~(r.length/4)+1?Promise.resolve(t):Promise.reject(new Error("invalid"))})).then((function(e){for(var u=[],l=[],c=0;c=1+~~(r.length/2)&&h)){e.next=32;break}for(u=[],l=[],c=0;c0?(o[c].result.keys.sort((function(t,e){return new p.a(t.Index,16).cmp(new p.a(e.Index,16))})),o[c].result.keys[0].Metadata?(d={ephemPublicKey:t.from(o[c].result.keys[0].Metadata.ephemPublicKey,"hex"),iv:t.from(o[c].result.keys[0].Metadata.iv,"hex"),mac:t.from(o[c].result.keys[0].Metadata.mac,"hex"),mode:t.from(o[c].result.keys[0].Metadata.mode,"hex")},u.push(Object(m.decrypt)(f,x({},d,{ciphertext:t.from(atob(o[c].result.keys[0].Share).padStart(64,"0"),"hex")})).catch((function(t){return y.a.debug("share decryption",t)})))):u.push(Promise.resolve(t.from(o[c].result.keys[0].Share.padStart(64,"0"),"hex")))):u.push(Promise.resolve(void 0)),l.push(new p.a(i[c],16));return e.next=8,Promise.all(u);case 8:if(v=e.sent,!s.resolved){e.next=11;break}return e.abrupt("return",void 0);case 11:g=v.reduce((function(t,e,r){return e&&t.push({index:l[r],value:new p.a(e)}),t}),[]),b=Object(_.a)(g.length,1+~~(r.length/2)),M=function(e){var r=b[e],i=g.filter((function(t,e){return r.includes(e)})),n=i.map((function(t){return t.value})),o=i.map((function(t){return t.index})),s=k.lagrangeInterpolation(n,o),a=Object(m.getPublic)(t.from(s.toString(16,64),"hex")).toString("hex"),u=a.slice(2,66),f=a.slice(66);if(0===new p.a(u,16).cmp(new p.a(h.X,16))&&0===new p.a(f,16).cmp(new p.a(h.Y,16)))return w=s,"break"},S=0;case 15:if(!(S3&&void 0!==arguments[3]&&arguments[3];return Object(_.c)(t,o,s).then((function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.keyResult,n=r.errorResult;if(n)return Object(_.b)(t,e,void 0,void 0,o,s).then((function(e){return Object(_.c)(t,o,s)}));if(i)return{keyResult:i};throw new Error("node results do not match")})).then(h()(n.a.mark((function t(){var e,r,o,s,h,u,f,l,c=arguments;return n.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},!(r=e.keyResult)){t.next=13;break}return o=r.keys[0],s=o.pub_key_X,h=o.pub_key_Y,t.next=5,i.getMetadata({pub_key_X:s,pub_key_Y:h});case 5:if(u=t.sent,f=i.ec.keyFromPublic({x:s.toString(16),y:h.toString(16)}).getPublic().add(i.ec.keyFromPrivate(u.toString(16)).getPublic()),s=f.getX().toString(16),h=f.getY().toString(16),l=i.generateAddressFromPubKey(f.getX(),f.getY()),a){t.next=12;break}return t.abrupt("return",l);case 12:return t.abrupt("return",{address:l,X:s,Y:h});case 13:throw new Error("node results do not match");case 14:case"end":return t.stop()}}),t)}))))}}]),e}();e.a=k}).call(this,r(2).Buffer)},function(t,e){t.exports=M},function(t,e){t.exports=S},function(t,e){t.exports=m.a},function(t,e,r){r.r(e);var i=r(103);e.default=i.a},function(t,e,r){e.byteLength=function(t){var e=u(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,i=u(t),s=i[0],a=i[1],h=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),f=0,l=a>0?s-4:s;for(r=0;r>16&255,h[f++]=e>>8&255,h[f++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,h[f++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,h[f++]=e>>8&255,h[f++]=255&e),h},e.fromByteArray=function(t){for(var e,r=t.length,n=r%3,o=[],s=0,a=r-n;sa?a:s+16383));return 1===n?(e=t[r-1],o.push(i[e>>2]+i[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],o.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"=")),o.join("")};for(var i=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,h=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var n,o,s=[],a=e;a>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,i,n){var o,s,a=8*n-i-1,h=(1<>1,f=-7,l=r?n-1:0,c=r?-1:1,d=t[e+l];for(l+=c,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+t[e+l],l+=c,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=i;f>0;s=256*s+t[e+l],l+=c,f-=8);if(0===o)o=1-u;else{if(o===h)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),o-=u}return(d?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,r,i,n,o){var s,a,h,u=8*o-n-1,f=(1<>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-s))<1&&(s--,h*=2),(e+=s+l>=1?c/h:c*Math.pow(2,1-l))*h>=2&&(s++,h/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*h-1)*Math.pow(2,n),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,n),s=0));n>=8;t[r+d]=255&a,d+=p,a/=256,n-=8);for(s=s<0;t[r+d]=255&s,d+=p,s/=256,u-=8);t[r+d-p]|=128*m}},function(t,e){},function(t,e,r){var i=e;i.version=r(112).version,i.utils=r(8),i.rand=r(24),i.curve=r(61),i.curves=r(42),i.ec=r(125),i.eddsa=r(128)},function(t){t.exports=JSON.parse('{"_from":"elliptic@6.5.1","_id":"elliptic@6.5.1","_inBundle":false,"_integrity":"sha512-xvJINNLbTeWQjrl6X+7eQCrIy/YPv5XCpKW6kB5mKvtnGILoLDcySuwomfdzt0BMdLNVnuRNTuzKNHj0bva1Cg==","_location":"/eccrypto/elliptic","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"elliptic@6.5.1","name":"elliptic","escapedName":"elliptic","rawSpec":"6.5.1","saveSpec":null,"fetchSpec":"6.5.1"},"_requiredBy":["/eccrypto"],"_resolved":"https://registry.npmjs.org/elliptic/-/elliptic-6.5.1.tgz","_shasum":"c380f5f909bf1b9b4428d028cd18d3b0efd6b52b","_spec":"elliptic@6.5.1","_where":"/home/chai/source/repos/torus/torus.js/node_modules/eccrypto","author":{"name":"Fedor Indutny","email":"fedor@indutny.com"},"bugs":{"url":"https://github.com/indutny/elliptic/issues"},"bundleDependencies":false,"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":false,"description":"EC cryptography","devDependencies":{"brfs":"^1.4.3","coveralls":"^3.0.4","grunt":"^1.0.4","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":"^9.0.1","istanbul":"^0.4.2","jscs":"^3.0.7","jshint":"^2.6.0","mocha":"^6.1.4"},"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.5.1"}')},function(t,e){},function(t,e){},function(t,e,r){var i=r(8),n=r(12),o=r(0),s=r(35),a=i.assert;function h(t){s.call(this,"short",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.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(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(t,e,r,i){s.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(e,16),this.y=new n(r,16),i&&(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 f(t,e,r,i){s.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(e,16),this.y=new n(r,16),this.z=new n(i,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}o(h,s),t.exports=h,h.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new n(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);e=(e=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(t.lambda)r=new n(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new n(t.a,16),b:new n(t.b,16)}})):this._getEndoBasis(r)}}},h.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:n.mont(t),r=new n(2).toRed(e).redInvm(),i=r.redNeg(),o=new n(3).toRed(e).redNeg().redSqrt().redMul(r);return[i.redAdd(o).fromRed(),i.redSub(o).fromRed()]},h.prototype._getEndoBasis=function(t){for(var e,r,i,o,s,a,h,u,f,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),c=t,d=this.n.clone(),p=new n(1),m=new n(0),v=new n(0),g=new n(1),y=0;0!==c.cmpn(0);){var b=d.div(c);u=d.sub(b.mul(c)),f=v.sub(b.mul(p));var w=g.sub(b.mul(m));if(!i&&u.cmp(l)<0)e=h.neg(),r=p,i=u.neg(),o=f;else if(i&&2==++y)break;h=u,d=c,c=u,v=p,p=f,g=m,m=w}s=u.neg(),a=f;var M=i.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(M)>=0&&(s=e,a=r),i.negative&&(i=i.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:i,b:o},{a:s,b:a}]},h.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=n.mul(r.a),a=o.mul(i.a),h=n.mul(r.b),u=o.mul(i.b);return{k1:t.sub(s).sub(a),k2:h.add(u).neg()}},h.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=i.fromRed().isOdd();return(e&&!o||!e&&o)&&(i=i.redNeg()),this.point(t,i)},h.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},h.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o":""},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},u.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(t){return t=new n(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},u.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},u.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},u.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(f,s.BasePoint),h.prototype.jpoint=function(t,e,r){return new f(this,t,e,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=i.redSub(n),h=o.redSub(s);if(0===a.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),f=u.redMul(a),l=i.redMul(u),c=h.redSqr().redIAdd(f).redISub(l).redISub(l),d=h.redMul(l.redISub(c)).redISub(o.redMul(f)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(c,d,p)},f.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(i),a=n.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=s.redSqr(),u=h.redMul(s),f=r.redMul(h),l=a.redSqr().redIAdd(u).redISub(f).redISub(f),c=a.redMul(f.redISub(l)).redISub(n.redMul(u)),d=this.z.redMul(s);return this.curve.jpoint(l,c,d)},f.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(t,e,r){var i=r(12),n=r(0),o=r(35),s=r(8);function a(t){o.call(this,"mont",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function h(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(e,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(a,o),t.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),i=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===i.redSqrt().redSqr().cmp(i)},n(h,o.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},a.prototype.point=function(t,e){return new h(this,t,e)},a.prototype.pointFromJSON=function(t){return h.fromJSON(this,t)},h.prototype.precompute=function(){},h.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},h.fromJSON=function(t,e){return new h(t,e[0],e[1]||t.one)},h.prototype.inspect=function(){return this.isInfinity()?"":""},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},h.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),i=t.redMul(e),n=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},h.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),s=n.redMul(i),a=e.z.redMul(o.redAdd(s).redSqr()),h=e.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,h)},h.prototype.mul=function(t){for(var e=t.clone(),r=this,i=this.curve.point(null,null),n=[];0!==e.cmpn(0);e.iushrn(1))n.push(e.andln(1));for(var o=n.length-1;o>=0;o--)0===n[o]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},h.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},h.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},h.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(t,e,r){var i=r(8),n=r(12),o=r(0),s=r(35),a=i.assert;function h(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,s.call(this,"edwards",t),this.a=new n(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function u(t,e,r,i,o){s.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new n(e,16),this.y=new n(r,16),this.z=i?new n(i,16):this.curve.one,this.t=o&&new n(o,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(h,s),t.exports=h,h.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},h.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},h.prototype.jpoint=function(t,e,r,i){return this.point(t,e,r,i)},h.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=i.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var h=a.fromRed().isOdd();return(e&&!h||!e&&h)&&(a=a.redNeg()),this.point(t,a)},h.prototype.pointFromY=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=i.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},h.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),i=e.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===i.cmp(n)},o(u,s.BasePoint),h.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},h.prototype.point=function(t,e,r,i){return new u(this,t,e,r,i)},u.fromJSON=function(t,e){return new u(t,e[0],e[1],e[2])},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(t),n=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=i.redAdd(e),s=o.redSub(r),a=i.redSub(e),h=n.redMul(s),u=o.redMul(a),f=n.redMul(a),l=s.redMul(o);return this.curve.point(h,u,l,f)},u.prototype._projDbl=function(){var t,e,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var s=(u=this.curve._mulA(n)).redAdd(o);if(this.zOne)t=i.redSub(n).redSub(o).redMul(s.redSub(this.curve.two)),e=s.redMul(u.redSub(o)),r=s.redSqr().redSub(s).redSub(s);else{var a=this.z.redSqr(),h=s.redSub(a).redISub(a);t=i.redSub(n).redISub(o).redMul(h),e=s.redMul(u.redSub(o)),r=s.redMul(h)}}else{var u=n.redAdd(o);a=this.curve._mulC(this.z).redSqr(),h=u.redSub(a).redSub(a),t=this.curve._mulC(i.redISub(u)).redMul(h),e=this.curve._mulC(u).redMul(n.redISub(o)),r=u.redMul(h)}return this.curve.point(t,e,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),n=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),s=n.redSub(i),a=n.redAdd(i),h=r.redAdd(e),u=o.redMul(s),f=a.redMul(h),l=o.redMul(h),c=s.redMul(a);return this.curve.point(u,f,c,l)},u.prototype._projAdd=function(t){var e,r,i=this.z.redMul(t.z),n=i.redSqr(),o=this.x.redMul(t.x),s=this.y.redMul(t.y),a=this.curve.d.redMul(o).redMul(s),h=n.redSub(a),u=n.redAdd(a),f=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(s),l=i.redMul(h).redMul(f);return this.curve.twisted?(e=i.redMul(u).redMul(s.redSub(this.curve._mulA(o))),r=h.redMul(u)):(e=i.redMul(u).redMul(s.redSub(o)),r=this.curve._mulC(h).redMul(u)),this.curve.point(l,e,r)},u.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},u.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},u.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},u.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(i),0===this.x.cmp(e))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},function(t,e,r){e.sha1=r(119),e.sha224=r(120),e.sha256=r(63),e.sha384=r(121),e.sha512=r(64)},function(t,e,r){var i=r(11),n=r(26),o=r(62),s=i.rotl32,a=i.sum32,h=i.sum32_5,u=o.ft_1,f=n.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function c(){if(!(this instanceof c))return new c;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}i.inherits(c,f),t.exports=c,c.blockSize=512,c.outSize=160,c.hmacStrength=80,c.padLength=64,c.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;ithis.blockSize&&(t=(new this.Hash).update(t).digest()),n(t.length<=this.blockSize);for(var e=t.length;e0))return s.iaddn(1),this.keyFromPrivate(s)}},l.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},l.prototype.sign=function(t,e,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new i(t,16));for(var s=this.n.byteLength(),a=e.getPrivate().toArray("be",s),h=t.toArray("be",s),u=new n({hash:this.hash,entropy:a,nonce:h,pers:o.pers,persEnc:o.persEnc||"utf8"}),l=this.n.sub(new i(1)),c=0;;c++){var d=o.k?o.k(c):new i(u.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(l)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var m=p.getX(),v=m.umod(this.n);if(0!==v.cmpn(0)){var g=d.invm(this.n).mul(v.mul(e.getPrivate()).iadd(t));if(0!==(g=g.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==m.cmp(v)?2:0);return o.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),y^=1),new f({r:v,s:g,recoveryParam:y})}}}}}},l.prototype.verify=function(t,e,r,n){t=this._truncateToN(new i(t,16)),r=this.keyFromPublic(r,n);var o=(e=new f(e,"hex")).r,s=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,h=s.invm(this.n),u=h.mul(t).umod(this.n),l=h.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),l)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(u,r.getPublic(),l)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},l.prototype.recoverPubKey=function(t,e,r,n){h((3&r)===r,"The recovery param is more than two bits"),e=new f(e,n);var o=this.n,s=new i(t),a=e.r,u=e.s,l=1&r,c=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),l):this.curve.pointFromX(a,l);var d=e.r.invm(o),p=o.sub(s).mul(d).umod(o),m=u.mul(d).umod(o);return this.g.mulAdd(p,a,m)},l.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new f(e,i)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(t,e,n)}catch(t){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},function(t,e,r){var i=r(12),n=r(8).assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new i(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?n(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return""}},function(t,e,r){var i=r(12),n=r(8),o=n.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new i(t.r,16),this.s=new i(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function h(t,e){var r=t[e.place++];if(!(128&r))return r;for(var i=15&r,n=0,o=0,s=e.place;o>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=s,s.prototype._importDER=function(t,e){t=n.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;if(h(t,r)+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=h(t,r),s=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var u=h(t,r);if(t.length!==u+r.place)return!1;var f=t.slice(r.place,u+r.place);return 0===s[0]&&128&s[1]&&(s=s.slice(1)),0===f[0]&&128&f[1]&&(f=f.slice(1)),this.r=new i(s),this.s=new i(f),this.recoveryParam=null,!0},s.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=u(e),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];f(i,e.length),(i=i.concat(e)).push(2),f(i,r.length);var o=i.concat(r),s=[48];return f(s,o.length),s=s.concat(o),n.encode(s,t)}},function(t,e,r){var i=r(25),n=r(42),o=r(8),s=o.assert,a=o.parseBytes,h=r(129),u=r(130);function f(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof f))return new f(t);t=n[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=i.sha512}t.exports=f,f.prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),i=this.hashInt(r.messagePrefix(),t),n=this.g.mul(i),o=this.encodePoint(n),s=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),h=i.add(s).umod(this.curve.n);return this.makeSignature({R:n,S:h,Rencoded:o})},f.prototype.verify=function(t,e,r){t=a(t),e=this.makeSignature(e);var i=this.keyFromPublic(r),n=this.hashInt(e.Rencoded(),i.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(i.pub().mul(n)).eq(o)},f.prototype.hashInt=function(){for(var t=this.hash(),e=0;e0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;for(var e,r,n=i.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=n,r=s,o.data.copy(e,r),s+=o.data.length,o=o.next;return n},t}(),n&&n.inspect&&n.inspect.custom&&(t.exports.prototype[n.inspect.custom]=function(){var t=n.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,r){(function(t){var i=void 0!==t&&t||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(n.call(setTimeout,i,arguments),clearTimeout)},e.setInterval=function(){return new o(n.call(setInterval,i,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(i,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(136),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(7))},function(t,e,r){(function(t,e){!function(t,r){if(!t.setImmediate){var i,n,o,s,a,h=1,u={},f=!1,l=t.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(t);c=c&&c.setTimeout?c:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick((function(){p(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&p(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),i=function(e){t.postMessage(s+e,"*")}):t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},i=function(t){o.port2.postMessage(t)}):l&&"onreadystatechange"in l.createElement("script")?(n=l.documentElement,i=function(t){var e=l.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,n.removeChild(e),e=null},n.appendChild(e)}):i=function(t){setTimeout(p,0,t)},c.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r>>2}function f(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}i(h,n),h.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},h.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,h=0|this._e,l=0;l<16;++l)r[l]=t.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var c=0;c<80;++c){var d=~~(c/20),p=0|((e=i)<<5|e>>>27)+f(d,n,o,a)+h+r[c]+s[d];h=a,a=o,o=u(n),n=i,i=p}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=h+this._e|0},h.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=h},function(t,e,r){var i=r(0),n=r(20),o=r(1).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function h(){this.init(),this._w=a,n.call(this,64,56)}function u(t){return t<<5|t>>>27}function f(t){return t<<30|t>>>2}function l(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}i(h,n),h.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},h.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,h=0|this._e,c=0;c<16;++c)r[c]=t.readInt32BE(4*c);for(;c<80;++c)r[c]=(e=r[c-3]^r[c-8]^r[c-14]^r[c-16])<<1|e>>>31;for(var d=0;d<80;++d){var p=~~(d/20),m=u(i)+l(p,n,o,a)+h+r[d]+s[p]|0;h=a,a=o,o=f(n),n=i,i=m}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=h+this._e|0},h.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=h},function(t,e,r){var i=r(0),n=r(71),o=r(20),s=r(1).Buffer,a=new Array(64);function h(){this.init(),this._w=a,o.call(this,64,56)}i(h,n),h.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},h.prototype._hash=function(){var t=s.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=h},function(t,e,r){var i=r(0),n=r(72),o=r(20),s=r(1).Buffer,a=new Array(160);function h(){this.init(),this._w=a,o.call(this,128,112)}i(h,n),h.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},h.prototype._hash=function(){var t=s.allocUnsafe(48);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=h},function(t,e,r){var i=r(0),n=r(1).Buffer,o=r(15),s=n.alloc(128);function a(t,e){o.call(this,"digest"),"string"==typeof e&&(e=n.from(e)),this._alg=t,this._key=e,e.length>64?e=t(e):e.length<64&&(e=n.concat([e,s],64));for(var r=this._ipad=n.allocUnsafe(64),i=this._opad=n.allocUnsafe(64),a=0;a<64;a++)r[a]=54^e[a],i[a]=92^e[a];this._hash=[r]}i(a,o),a.prototype._update=function(t){this._hash.push(t)},a.prototype._final=function(){var t=this._alg(n.concat(this._hash));return this._alg(n.concat([this._opad,t]))},t.exports=a},function(t,e,r){t.exports=r(75)},function(t,e,r){(function(e,i){var n,o=r(77),s=r(78),a=r(79),h=r(1).Buffer,u=e.crypto&&e.crypto.subtle,f={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},l=[];function c(t,e,r,i,n){return u.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then((function(t){return u.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:n}},t,i<<3)})).then((function(t){return h.from(t)}))}t.exports=function(t,r,d,p,m,v){"function"==typeof m&&(v=m,m=void 0);var g=f[(m=m||"sha1").toLowerCase()];if(!g||"function"!=typeof e.Promise)return i.nextTick((function(){var e;try{e=a(t,r,d,p,m)}catch(t){return v(t)}v(null,e)}));if(o(t,r,d,p),"function"!=typeof v)throw new Error("No callback provided to pbkdf2");h.isBuffer(t)||(t=h.from(t,s)),h.isBuffer(r)||(r=h.from(r,s)),function(t,e){t.then((function(t){i.nextTick((function(){e(null,t)}))}),(function(t){i.nextTick((function(){e(t)}))}))}(function(t){if(e.process&&!e.process.browser)return Promise.resolve(!1);if(!u||!u.importKey||!u.deriveBits)return Promise.resolve(!1);if(void 0!==l[t])return l[t];var r=c(n=n||h.alloc(8),n,10,128,t).then((function(){return!0})).catch((function(){return!1}));return l[t]=r,r}(g).then((function(e){return e?c(t,r,d,p,g):a(t,r,d,p,m)})),v)}}).call(this,r(7),r(13))},function(t,e,r){var i=r(152),n=r(53),o=r(54),s=r(165),a=r(38);function h(t,e,r){if(t=t.toLowerCase(),o[t])return n.createCipheriv(t,e,r);if(s[t])return new i({key:e,iv:r,mode:t});throw new TypeError("invalid suite type")}function u(t,e,r){if(t=t.toLowerCase(),o[t])return n.createDecipheriv(t,e,r);if(s[t])return new i({key:e,iv:r,mode:t,decrypt:!0});throw new TypeError("invalid suite type")}e.createCipher=e.Cipher=function(t,e){var r,i;if(t=t.toLowerCase(),o[t])r=o[t].key,i=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,i=s[t].iv}var n=a(e,!1,r,i);return h(t,n.key,n.iv)},e.createCipheriv=e.Cipheriv=h,e.createDecipher=e.Decipher=function(t,e){var r,i;if(t=t.toLowerCase(),o[t])r=o[t].key,i=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,i=s[t].iv}var n=a(e,!1,r,i);return u(t,n.key,n.iv)},e.createDecipheriv=e.Decipheriv=u,e.listCiphers=e.getCiphers=function(){return Object.keys(s).concat(n.getCiphers())}},function(t,e,r){var i=r(15),n=r(153),o=r(0),s=r(1).Buffer,a={"des-ede3-cbc":n.CBC.instantiate(n.EDE),"des-ede3":n.EDE,"des-ede-cbc":n.CBC.instantiate(n.EDE),"des-ede":n.EDE,"des-cbc":n.CBC.instantiate(n.DES),"des-ecb":n.DES};function h(t){i.call(this);var e,r=t.mode.toLowerCase(),n=a[r];e=t.decrypt?"decrypt":"encrypt";var o=t.key;s.isBuffer(o)||(o=s.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=s.concat([o,o.slice(0,8)]));var h=t.iv;s.isBuffer(h)||(h=s.from(h)),this._des=n.create({key:o,iv:h,type:e})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],t.exports=h,o(h,i),h.prototype._update=function(t){return s.from(this._des.update(t))},h.prototype._final=function(){return s.from(this._des.final())}},function(t,e,r){e.utils=r(80),e.Cipher=r(52),e.DES=r(81),e.CBC=r(154),e.EDE=r(155)},function(t,e,r){var i=r(5),n=r(0),o={};function s(t){i.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},c.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),r=-1;++r>s%8,t._prev=o(t._prev,r?i:n);return a}function o(t,e){var r=t.length,n=-1,o=i.allocUnsafe(t.length);for(t=i.concat([t,i.from([e])]);++n>7;return o}e.encrypt=function(t,e,r){for(var o=e.length,s=i.allocUnsafe(o),a=-1;++a>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function s(t){this.h=t,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}s.prototype.ghash=function(t){for(var e=-1;++e0;e--)i[e]=i[e]>>>1|(1&i[e-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=o(n)},s.prototype.update=function(t){var e;for(this.cache=i.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},s.prototype.final=function(t,e){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,t,0,e])),this.state},t.exports=s},function(t,e,r){var i=r(85),n=r(1).Buffer,o=r(54),s=r(86),a=r(15),h=r(37),u=r(38);function f(t,e,r){a.call(this),this._cache=new l,this._last=void 0,this._cipher=new h.AES(e),this._prev=n.from(r),this._mode=t,this._autopadding=!0}function l(){this.cache=n.allocUnsafe(0)}function c(t,e,r){var a=o[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=n.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof e&&(e=n.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);return"stream"===a.type?new s(a.module,e,r,!0):"auth"===a.type?new i(a.module,e,r,!0):new f(a.module,e,r)}r(0)(f,a),f.prototype._update=function(t){var e,r;this._cache.add(t);for(var i=[];e=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,e),i.push(r);return n.concat(i)},f.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");for(var r=-1;++r16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},e.createDecipher=function(t,e){var r=o[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=u(e,!1,r.key,r.iv);return c(t,i.key,i.iv)},e.createDecipheriv=c},function(t,e){e["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}},function(t,e,r){(function(t){var i=r(87),n=r(170),o=r(171),s={binary:!0,hex:!0,base64:!0};e.DiffieHellmanGroup=e.createDiffieHellmanGroup=e.getDiffieHellman=function(e){var r=new t(n[e].prime,"hex"),i=new t(n[e].gen,"hex");return new o(r,i)},e.createDiffieHellman=e.DiffieHellman=function e(r,n,a,h){return t.isBuffer(n)||void 0===s[n]?e(r,"binary",n,a):(n=n||"binary",h=h||"binary",a=a||new t([2]),t.isBuffer(a)||(a=new t(a,h)),"number"==typeof r?new o(i(r,a),a,!0):(t.isBuffer(r)||(r=new t(r,n)),new o(r,a,!0)))}}).call(this,r(2).Buffer)},function(t,e){},function(t,e,r){(function(t){!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(169).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e){},function(t){t.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},function(t,e,r){(function(e){var i=r(88),n=new(r(89)),o=new i(24),s=new i(11),a=new i(10),h=new i(3),u=new i(7),f=r(87),l=r(17);function c(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this._pub=new i(t),this}function d(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this._priv=new i(t),this}t.exports=m;var p={};function m(t,e,r){this.setGenerator(e),this.__prime=new i(t),this._prime=i.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=c,this.setPrivateKey=d):this._primeCode=8}function v(t,r){var i=new e(t.toArray());return r?i.toString(r):i}Object.defineProperty(m.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(t,e){var r=e.toString("hex"),i=[r,t.toString(16)].join("_");if(i in p)return p[i];var l,c=0;if(t.isEven()||!f.simpleSieve||!f.fermatTest(t)||!n.test(t))return c+=1,c+="02"===r||"05"===r?8:4,p[i]=c,c;switch(n.test(t.shrn(1))||(c+=2),r){case"02":t.mod(o).cmp(s)&&(c+=8);break;case"05":(l=t.mod(a)).cmp(h)&&l.cmp(u)&&(c+=8);break;default:c+=4}return p[i]=c,c}(this.__prime,this.__gen)),this._primeCode}}),m.prototype.generateKeys=function(){return this._priv||(this._priv=new i(l(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},m.prototype.computeSecret=function(t){var r=(t=(t=new i(t)).toRed(this._prime)).redPow(this._priv).fromRed(),n=new e(r.toArray()),o=this.getPrime();if(n.length0&&r.ishrn(i),r}function l(t,r,n){var o,s;do{for(o=new e(0);8*o.length=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e){},function(t){t.exports=JSON.parse('{"_from":"elliptic@^6.5.2","_id":"elliptic@6.5.2","_inBundle":false,"_integrity":"sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==","_location":"/elliptic","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"elliptic@^6.5.2","name":"elliptic","escapedName":"elliptic","rawSpec":"^6.5.2","saveSpec":null,"fetchSpec":"^6.5.2"},"_requiredBy":["/","/browserify-sign","/create-ecdh","/eth-lib","/secp256k1"],"_resolved":"https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz","_shasum":"05c5678d7173c049d8ca433552224a495d0e3762","_spec":"elliptic@^6.5.2","_where":"/home/chai/source/repos/torus/torus.js","author":{"name":"Fedor Indutny","email":"fedor@indutny.com"},"bugs":{"url":"https://github.com/indutny/elliptic/issues"},"bundleDependencies":false,"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":false,"description":"EC cryptography","devDependencies":{"brfs":"^1.4.3","coveralls":"^3.0.8","grunt":"^1.0.4","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":"^9.0.1","istanbul":"^0.4.2","jscs":"^3.0.7","jshint":"^2.10.3","mocha":"^6.2.2"},"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.5.2"}')},function(t,e){},function(t,e,r){var i=r(9),n=r(14),o=r(0),s=r(39),a=i.assert;function h(t){s.call(this,"short",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.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(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(t,e,r,i){s.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(e,16),this.y=new n(r,16),i&&(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 f(t,e,r,i){s.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(e,16),this.y=new n(r,16),this.z=new n(i,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}o(h,s),t.exports=h,h.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new n(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);e=(e=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(t.lambda)r=new n(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new n(t.a,16),b:new n(t.b,16)}})):this._getEndoBasis(r)}}},h.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:n.mont(t),r=new n(2).toRed(e).redInvm(),i=r.redNeg(),o=new n(3).toRed(e).redNeg().redSqrt().redMul(r);return[i.redAdd(o).fromRed(),i.redSub(o).fromRed()]},h.prototype._getEndoBasis=function(t){for(var e,r,i,o,s,a,h,u,f,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),c=t,d=this.n.clone(),p=new n(1),m=new n(0),v=new n(0),g=new n(1),y=0;0!==c.cmpn(0);){var b=d.div(c);u=d.sub(b.mul(c)),f=v.sub(b.mul(p));var w=g.sub(b.mul(m));if(!i&&u.cmp(l)<0)e=h.neg(),r=p,i=u.neg(),o=f;else if(i&&2==++y)break;h=u,d=c,c=u,v=p,p=f,g=m,m=w}s=u.neg(),a=f;var M=i.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(M)>=0&&(s=e,a=r),i.negative&&(i=i.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:i,b:o},{a:s,b:a}]},h.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=n.mul(r.a),a=o.mul(i.a),h=n.mul(r.b),u=o.mul(i.b);return{k1:t.sub(s).sub(a),k2:h.add(u).neg()}},h.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=i.fromRed().isOdd();return(e&&!o||!e&&o)&&(i=i.redNeg()),this.point(t,i)},h.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},h.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o":""},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},u.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(t){return t=new n(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},u.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},u.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},u.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(f,s.BasePoint),h.prototype.jpoint=function(t,e,r){return new f(this,t,e,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=i.redSub(n),h=o.redSub(s);if(0===a.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),f=u.redMul(a),l=i.redMul(u),c=h.redSqr().redIAdd(f).redISub(l).redISub(l),d=h.redMul(l.redISub(c)).redISub(o.redMul(f)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(c,d,p)},f.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(i),a=n.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=s.redSqr(),u=h.redMul(s),f=r.redMul(h),l=a.redSqr().redIAdd(u).redISub(f).redISub(f),c=a.redMul(f.redISub(l)).redISub(n.redMul(u)),d=this.z.redMul(s);return this.curve.jpoint(l,c,d)},f.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(t,e,r){var i=r(14),n=r(0),o=r(39),s=r(9);function a(t){o.call(this,"mont",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function h(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(e,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(a,o),t.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),i=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===i.redSqrt().redSqr().cmp(i)},n(h,o.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},a.prototype.point=function(t,e){return new h(this,t,e)},a.prototype.pointFromJSON=function(t){return h.fromJSON(this,t)},h.prototype.precompute=function(){},h.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},h.fromJSON=function(t,e){return new h(t,e[0],e[1]||t.one)},h.prototype.inspect=function(){return this.isInfinity()?"":""},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},h.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),i=t.redMul(e),n=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},h.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),s=n.redMul(i),a=e.z.redMul(o.redAdd(s).redSqr()),h=e.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,h)},h.prototype.mul=function(t){for(var e=t.clone(),r=this,i=this.curve.point(null,null),n=[];0!==e.cmpn(0);e.iushrn(1))n.push(e.andln(1));for(var o=n.length-1;o>=0;o--)0===n[o]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},h.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},h.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},h.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(t,e,r){var i=r(9),n=r(14),o=r(0),s=r(39),a=i.assert;function h(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,s.call(this,"edwards",t),this.a=new n(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function u(t,e,r,i,o){s.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new n(e,16),this.y=new n(r,16),this.z=i?new n(i,16):this.curve.one,this.t=o&&new n(o,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(h,s),t.exports=h,h.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},h.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},h.prototype.jpoint=function(t,e,r,i){return this.point(t,e,r,i)},h.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=i.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var h=a.fromRed().isOdd();return(e&&!h||!e&&h)&&(a=a.redNeg()),this.point(t,a)},h.prototype.pointFromY=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=i.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},h.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),i=e.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===i.cmp(n)},o(u,s.BasePoint),h.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},h.prototype.point=function(t,e,r,i){return new u(this,t,e,r,i)},u.fromJSON=function(t,e){return new u(t,e[0],e[1],e[2])},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(t),n=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=i.redAdd(e),s=o.redSub(r),a=i.redSub(e),h=n.redMul(s),u=o.redMul(a),f=n.redMul(a),l=s.redMul(o);return this.curve.point(h,u,l,f)},u.prototype._projDbl=function(){var t,e,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var s=(u=this.curve._mulA(n)).redAdd(o);if(this.zOne)t=i.redSub(n).redSub(o).redMul(s.redSub(this.curve.two)),e=s.redMul(u.redSub(o)),r=s.redSqr().redSub(s).redSub(s);else{var a=this.z.redSqr(),h=s.redSub(a).redISub(a);t=i.redSub(n).redISub(o).redMul(h),e=s.redMul(u.redSub(o)),r=s.redMul(h)}}else{var u=n.redAdd(o);a=this.curve._mulC(this.z).redSqr(),h=u.redSub(a).redSub(a),t=this.curve._mulC(i.redISub(u)).redMul(h),e=this.curve._mulC(u).redMul(n.redISub(o)),r=u.redMul(h)}return this.curve.point(t,e,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),n=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),s=n.redSub(i),a=n.redAdd(i),h=r.redAdd(e),u=o.redMul(s),f=a.redMul(h),l=o.redMul(h),c=s.redMul(a);return this.curve.point(u,f,c,l)},u.prototype._projAdd=function(t){var e,r,i=this.z.redMul(t.z),n=i.redSqr(),o=this.x.redMul(t.x),s=this.y.redMul(t.y),a=this.curve.d.redMul(o).redMul(s),h=n.redSub(a),u=n.redAdd(a),f=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(s),l=i.redMul(h).redMul(f);return this.curve.twisted?(e=i.redMul(u).redMul(s.redSub(this.curve._mulA(o))),r=h.redMul(u)):(e=i.redMul(u).redMul(s.redSub(o)),r=this.curve._mulC(h).redMul(u)),this.curve.point(l,e,r)},u.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},u.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},u.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},u.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(i),0===this.x.cmp(e))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},function(t,e){t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(t,e,r){var i=r(14),n=r(65),o=r(9),s=r(56),a=r(24),h=o.assert,u=r(183),f=r(184);function l(t){if(!(this instanceof l))return new l(t);"string"==typeof t&&(h(s.hasOwnProperty(t),"Unknown curve "+t),t=s[t]),t instanceof s.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=l,l.prototype.keyPair=function(t){return new u(this,t)},l.prototype.keyFromPrivate=function(t,e){return u.fromPrivate(this,t,e)},l.prototype.keyFromPublic=function(t,e){return u.fromPublic(this,t,e)},l.prototype.genKeyPair=function(t){t||(t={});for(var e=new n({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new i(2));;){var s=new i(e.generate(r));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},l.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},l.prototype.sign=function(t,e,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new i(t,16));for(var s=this.n.byteLength(),a=e.getPrivate().toArray("be",s),h=t.toArray("be",s),u=new n({hash:this.hash,entropy:a,nonce:h,pers:o.pers,persEnc:o.persEnc||"utf8"}),l=this.n.sub(new i(1)),c=0;;c++){var d=o.k?o.k(c):new i(u.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(l)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var m=p.getX(),v=m.umod(this.n);if(0!==v.cmpn(0)){var g=d.invm(this.n).mul(v.mul(e.getPrivate()).iadd(t));if(0!==(g=g.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==m.cmp(v)?2:0);return o.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),y^=1),new f({r:v,s:g,recoveryParam:y})}}}}}},l.prototype.verify=function(t,e,r,n){t=this._truncateToN(new i(t,16)),r=this.keyFromPublic(r,n);var o=(e=new f(e,"hex")).r,s=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,h=s.invm(this.n),u=h.mul(t).umod(this.n),l=h.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),l)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(u,r.getPublic(),l)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},l.prototype.recoverPubKey=function(t,e,r,n){h((3&r)===r,"The recovery param is more than two bits"),e=new f(e,n);var o=this.n,s=new i(t),a=e.r,u=e.s,l=1&r,c=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),l):this.curve.pointFromX(a,l);var d=e.r.invm(o),p=o.sub(s).mul(d).umod(o),m=u.mul(d).umod(o);return this.g.mulAdd(p,a,m)},l.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new f(e,i)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(t,e,n)}catch(t){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},function(t,e,r){var i=r(14),n=r(9).assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new i(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?n(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return""}},function(t,e,r){var i=r(14),n=r(9),o=n.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new i(t.r,16),this.s=new i(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function h(t,e){var r=t[e.place++];if(!(128&r))return r;for(var i=15&r,n=0,o=0,s=e.place;o>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=s,s.prototype._importDER=function(t,e){t=n.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;if(h(t,r)+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=h(t,r),s=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var u=h(t,r);if(t.length!==u+r.place)return!1;var f=t.slice(r.place,u+r.place);return 0===s[0]&&128&s[1]&&(s=s.slice(1)),0===f[0]&&128&f[1]&&(f=f.slice(1)),this.r=new i(s),this.s=new i(f),this.recoveryParam=null,!0},s.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=u(e),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];f(i,e.length),(i=i.concat(e)).push(2),f(i,r.length);var o=i.concat(r),s=[48];return f(s,o.length),s=s.concat(o),n.encode(s,t)}},function(t,e,r){var i=r(25),n=r(56),o=r(9),s=o.assert,a=o.parseBytes,h=r(186),u=r(187);function f(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof f))return new f(t);t=n[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=i.sha512}t.exports=f,f.prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),i=this.hashInt(r.messagePrefix(),t),n=this.g.mul(i),o=this.encodePoint(n),s=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),h=i.add(s).umod(this.curve.n);return this.makeSignature({R:n,S:h,Rencoded:o})},f.prototype.verify=function(t,e,r){t=a(t),e=this.makeSignature(e);var i=this.keyFromPublic(r),n=this.hashInt(e.Rencoded(),i.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(i.pub().mul(n)).eq(o)},f.prototype.hashInt=function(){for(var t=this.hash(),e=0;e=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e){},function(t,e,r){var i=r(30),n=r(0);function o(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}e.define=function(t,e){return new o(t,e)},o.prototype._createNamed=function(t){var e;try{e=r(193).runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(t){e=function(t){this._initNamed(t)}}return n(e,t),e.prototype._initNamed=function(e){t.call(this,e)},new e(this)},o.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(i.decoders[t])),this.decoders[t]},o.prototype.decode=function(t,e,r){return this._getDecoder(e).decode(t,r)},o.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(i.encoders[t])),this.encoders[t]},o.prototype.encode=function(t,e,r){return this._getEncoder(e).encode(t,r)}},function(t,e){},function(t,e,r){var i=r(0);function n(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function o(t,e){this.path=t,this.rethrow(e)}e.Reporter=n,n.prototype.isError=function(t){return t instanceof o},n.prototype.save=function(){var t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},n.prototype.restore=function(t){var e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},n.prototype.enterKey=function(t){return this._reporterState.path.push(t)},n.prototype.exitKey=function(t){var e=this._reporterState;e.path=e.path.slice(0,t-1)},n.prototype.leaveKey=function(t,e,r){var i=this._reporterState;this.exitKey(t),null!==i.obj&&(i.obj[e]=r)},n.prototype.path=function(){return this._reporterState.path.join("/")},n.prototype.enterObject=function(){var t=this._reporterState,e=t.obj;return t.obj={},e},n.prototype.leaveObject=function(t){var e=this._reporterState,r=e.obj;return e.obj=t,r},n.prototype.error=function(t){var e,r=this._reporterState,i=t instanceof o;if(e=i?t:new o(r.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),t.message||t,t.stack),!r.options.partial)throw e;return i||r.errors.push(e),e},n.prototype.wrapResult=function(t){var e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},i(o,Error),o.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},function(t,e,r){var i=r(31).Reporter,n=r(31).EncoderBuffer,o=r(31).DecoderBuffer,s=r(5),a=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],h=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);function u(t,e){var r={};this._baseState=r,r.enc=t,r.parent=e||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}t.exports=u;var f=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];u.prototype.clone=function(){var t=this._baseState,e={};f.forEach((function(r){e[r]=t[r]}));var r=new this.constructor(e.parent);return r._baseState=e,r},u.prototype._wrap=function(){var t=this._baseState;h.forEach((function(e){this[e]=function(){var r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}}),this)},u.prototype._init=function(t){var e=this._baseState;s(null===e.parent),t.call(this),e.children=e.children.filter((function(t){return t._baseState.parent===this}),this),s.equal(e.children.length,1,"Root node can have only one child")},u.prototype._useArgs=function(t){var e=this._baseState,r=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==r.length&&(s(null===e.children),e.children=r,r.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(s(null===e.args),e.args=t,e.reverseArgs=t.map((function(t){if("object"!=typeof t||t.constructor!==Object)return t;var e={};return Object.keys(t).forEach((function(r){r==(0|r)&&(r|=0);var i=t[r];e[i]=r})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){u.prototype[t]=function(){var e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}})),a.forEach((function(t){u.prototype[t]=function(){var e=this._baseState,r=Array.prototype.slice.call(arguments);return s(null===e.tag),e.tag=t,this._useArgs(r),this}})),u.prototype.use=function(t){s(t);var e=this._baseState;return s(null===e.use),e.use=t,this},u.prototype.optional=function(){return this._baseState.optional=!0,this},u.prototype.def=function(t){var e=this._baseState;return s(null===e.default),e.default=t,e.optional=!0,this},u.prototype.explicit=function(t){var e=this._baseState;return s(null===e.explicit&&null===e.implicit),e.explicit=t,this},u.prototype.implicit=function(t){var e=this._baseState;return s(null===e.explicit&&null===e.implicit),e.implicit=t,this},u.prototype.obj=function(){var t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},u.prototype.key=function(t){var e=this._baseState;return s(null===e.key),e.key=t,this},u.prototype.any=function(){return this._baseState.any=!0,this},u.prototype.choice=function(t){var e=this._baseState;return s(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map((function(e){return t[e]}))),this},u.prototype.contains=function(t){var e=this._baseState;return s(null===e.use),e.contains=t,this},u.prototype._decode=function(t,e){var r=this._baseState;if(null===r.parent)return t.wrapResult(r.children[0]._decode(t,e));var i,n=r.default,s=!0,a=null;if(null!==r.key&&(a=t.enterKey(r.key)),r.optional){var h=null;if(null!==r.explicit?h=r.explicit:null!==r.implicit?h=r.implicit:null!==r.tag&&(h=r.tag),null!==h||r.any){if(s=this._peekTag(t,h,r.any),t.isError(s))return s}else{var u=t.save();try{null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),s=!0}catch(t){s=!1}t.restore(u)}}if(r.obj&&s&&(i=t.enterObject()),s){if(null!==r.explicit){var f=this._decodeTag(t,r.explicit);if(t.isError(f))return f;t=f}var l=t.offset;if(null===r.use&&null===r.choice){r.any&&(u=t.save());var c=this._decodeTag(t,null!==r.implicit?r.implicit:r.tag,r.any);if(t.isError(c))return c;r.any?n=t.raw(u):t=c}if(e&&e.track&&null!==r.tag&&e.track(t.path(),l,t.length,"tagged"),e&&e.track&&null!==r.tag&&e.track(t.path(),t.offset,t.length,"content"),n=r.any?n:null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),t.isError(n))return n;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(t,e)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){var d=new o(n);n=this._getUse(r.contains,t._reporterState.obj)._decode(d,e)}}return r.obj&&s&&(n=t.leaveObject(i)),null===r.key||null===n&&!0!==s?null!==a&&t.exitKey(a):t.leaveKey(a,r.key,n),n},u.prototype._decodeGeneric=function(t,e,r){var i=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,i.args[0],r):/str$/.test(t)?this._decodeStr(e,t,r):"objid"===t&&i.args?this._decodeObjid(e,i.args[0],i.args[1],r):"objid"===t?this._decodeObjid(e,null,null,r):"gentime"===t||"utctime"===t?this._decodeTime(e,t,r):"null_"===t?this._decodeNull(e,r):"bool"===t?this._decodeBool(e,r):"objDesc"===t?this._decodeStr(e,t,r):"int"===t||"enum"===t?this._decodeInt(e,i.args&&i.args[0],r):null!==i.use?this._getUse(i.use,e._reporterState.obj)._decode(e,r):e.error("unknown tag: "+t)},u.prototype._getUse=function(t,e){var r=this._baseState;return r.useDecoder=this._use(t,e),s(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},u.prototype._decodeChoice=function(t,e){var r=this._baseState,i=null,n=!1;return Object.keys(r.choice).some((function(o){var s=t.save(),a=r.choice[o];try{var h=a._decode(t,e);if(t.isError(h))return!1;i={type:o,value:h},n=!0}catch(e){return t.restore(s),!1}return!0}),this),n?i:t.error("Choice not matched")},u.prototype._createEncoderBuffer=function(t){return new n(t,this.reporter)},u.prototype._encode=function(t,e,r){var i=this._baseState;if(null===i.default||i.default!==t){var n=this._encodeValue(t,e,r);if(void 0!==n&&!this._skipDefault(n,e,r))return n}},u.prototype._encodeValue=function(t,e,r){var n=this._baseState;if(null===n.parent)return n.children[0]._encode(t,e||new i);var o=null;if(this.reporter=e,n.optional&&void 0===t){if(null===n.default)return;t=n.default}var s=null,a=!1;if(n.any)o=this._createEncoderBuffer(t);else if(n.choice)o=this._encodeChoice(t,e);else if(n.contains)s=this._getUse(n.contains,r)._encode(t,e),a=!0;else if(n.children)s=n.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,e,t);if(null===r._baseState.key)return e.error("Child should have a key");var i=e.enterKey(r._baseState.key);if("object"!=typeof t)return e.error("Child expected, but input is not object");var n=r._encode(t[r._baseState.key],e,t);return e.leaveKey(i),n}),this).filter((function(t){return t})),s=this._createEncoderBuffer(s);else if("seqof"===n.tag||"setof"===n.tag){if(!n.args||1!==n.args.length)return e.error("Too many args for : "+n.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");var h=this.clone();h._baseState.implicit=null,s=this._createEncoderBuffer(t.map((function(r){var i=this._baseState;return this._getUse(i.args[0],t)._encode(r,e)}),h))}else null!==n.use?o=this._getUse(n.use,r)._encode(t,e):(s=this._encodePrimitive(n.tag,t),a=!0);if(!n.any&&null===n.choice){var u=null!==n.implicit?n.implicit:n.tag,f=null===n.implicit?"universal":"context";null===u?null===n.use&&e.error("Tag could be omitted only for .use()"):null===n.use&&(o=this._encodeComposite(u,a,f,s))}return null!==n.explicit&&(o=this._encodeComposite(n.explicit,!1,"context",o)),o},u.prototype._encodeChoice=function(t,e){var r=this._baseState,i=r.choice[t.type];return i||s(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),i._encode(t.value,e)},u.prototype._encodePrimitive=function(t,e){var r=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&r.args)return this._encodeObjid(e,r.reverseArgs[0],r.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,r.args&&r.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},u.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},u.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(t)}},function(t,e,r){var i=r(93);e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=i._reverse(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=i._reverse(e.tag)},function(t,e,r){var i=e;i.der=r(94),i.pem=r(198)},function(t,e,r){var i=r(0),n=r(2).Buffer,o=r(94);function s(t){o.call(this,t),this.enc="pem"}i(s,o),t.exports=s,s.prototype.decode=function(t,e){for(var r=t.toString().split(/[\r\n]+/g),i=e.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,a=-1,h=-1,u=0;u=e)throw new Error("invalid sig")}t.exports=function(t,r,h,u,f){var l=o(h);if("ec"===l.type){if("ecdsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");return function(t,e,r){var i=s[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var o=new n(i),a=r.data.subjectPrivateKey.data;return o.verify(e,t,a)}(t,r,l)}if("dsa"===l.type){if("dsa"!==u)throw new Error("wrong public key type");return function(t,e,r){var n=r.data.p,s=r.data.q,h=r.data.g,u=r.data.pub_key,f=o.signature.decode(t,"der"),l=f.s,c=f.r;a(l,s),a(c,s);var d=i.mont(n),p=l.invm(s);return 0===h.toRed(d).redPow(new i(e).mul(p).mod(s)).fromRed().mul(u.toRed(d).redPow(c.mul(p).mod(s)).fromRed()).mod(n).mod(s).cmp(c)}(t,r,l)}if("rsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");r=e.concat([f,r]);for(var c=l.modulus.byteLength(),d=[1],p=0;r.length+d.length+2=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e){},function(t,e,r){e.publicEncrypt=r(209),e.privateDecrypt=r(211),e.privateEncrypt=function(t,r){return e.publicEncrypt(t,r,!0)},e.publicDecrypt=function(t,r){return e.privateDecrypt(t,r,!0)}},function(t,e,r){var i=r(40),n=r(17),o=r(27),s=r(97),a=r(98),h=r(57),u=r(99),f=r(55),l=r(1).Buffer;t.exports=function(t,e,r){var c;c=t.padding?t.padding:r?1:4;var d,p=i(t);if(4===c)d=function(t,e){var r=t.modulus.byteLength(),i=e.length,u=o("sha1").update(l.alloc(0)).digest(),f=u.length,c=2*f;if(i>r-c-2)throw new Error("message too long");var d=l.alloc(r-i-c-2),p=r-f-1,m=n(f),v=a(l.concat([u,d,l.alloc(1,1),e],p),s(m,p)),g=a(m,s(v,f));return new h(l.concat([l.alloc(1),g,v],r))}(p,e);else if(1===c)d=function(t,e,r){var i,o=e.length,s=t.modulus.byteLength();if(o>s-11)throw new Error("message too long");return i=r?l.alloc(s-o-3,255):function(t){for(var e,r=l.allocUnsafe(t),i=0,o=n(2*t),s=0;i=0)throw new Error("data too long for modulus")}return r?f(d,p):u(d,p)}},function(t,e){},function(t,e,r){var i=r(40),n=r(97),o=r(98),s=r(57),a=r(55),h=r(27),u=r(99),f=r(1).Buffer;t.exports=function(t,e,r){var l;l=t.padding?t.padding:r?1:4;var c,d=i(t),p=d.modulus.byteLength();if(e.length>p||new s(e).cmp(d.modulus)>=0)throw new Error("decryption error");c=r?u(new s(e),d):a(e,d);var m=f.alloc(p-c.length);if(c=f.concat([m,c],p),4===l)return function(t,e){var r=t.modulus.byteLength(),i=h("sha1").update(f.alloc(0)).digest(),s=i.length;if(0!==e[0])throw new Error("decryption error");var a=e.slice(1,s+1),u=e.slice(s+1),l=o(a,n(u,s)),c=o(u,n(l,r-s-1));if(function(t,e){t=f.from(t),e=f.from(e);var r=0,i=t.length;t.length!==e.length&&(r++,i=Math.min(t.length,e.length));for(var n=-1;++n=e.length){o++;break}var s=e.slice(2,n-1);if(("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&o++,s.length<8&&o++,o)throw new Error("decryption error");return e.slice(n)}(0,c,r);if(3===l)return c;throw new Error("unknown padding")}},function(t,e,r){(function(t,i){function n(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=r(1),s=r(17),a=o.Buffer,h=o.kMaxLength,u=t.crypto||t.msCrypto,f=Math.pow(2,32)-1;function l(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>f||t<0)throw new TypeError("offset must be a uint32");if(t>h||t>e)throw new RangeError("offset out of range")}function c(t,e,r){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>f||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>h)throw new RangeError("buffer too small")}function d(t,e,r,n){if(i.browser){var o=t.buffer,a=new Uint8Array(o,e,r);return u.getRandomValues(a),n?void i.nextTick((function(){n(null,t)})):t}if(!n)return s(r).copy(t,e),t;s(r,(function(r,i){if(r)return n(r);i.copy(t,e),n(null,t)}))}u&&u.getRandomValues||!i.browser?(e.randomFill=function(e,r,i,n){if(!(a.isBuffer(e)||e instanceof t.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof r)n=r,r=0,i=e.length;else if("function"==typeof i)n=i,i=e.length-r;else if("function"!=typeof n)throw new TypeError('"cb" argument must be a function');return l(r,e.length),c(i,r,e.length),d(e,r,i,n)},e.randomFillSync=function(e,r,i){if(void 0===r&&(r=0),!(a.isBuffer(e)||e instanceof t.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return l(r,e.length),void 0===i&&(i=e.length-r),c(i,r,e.length),d(e,r,i)}):(e.randomFill=n,e.randomFillSync=n)}).call(this,r(7),r(13))},function(t,e,r){var i=r(214),n=r(100),o=new i(0),s=new i(-1),a={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"};function h(t){var e=t?t.toLowerCase():"ether",r=a[e];if("string"!=typeof r)throw new Error("[ethjs-unit] the unit provided "+t+" doesn't exists, please use the one of the following units "+JSON.stringify(a,null,2));return new i(r,10)}function u(t){if("string"==typeof t){if(!t.match(/^-?[0-9.]+$/))throw new Error("while converting number to string, invalid number value '"+t+"', should be a number matching (^-?[0-9.]+).");return t}if("number"==typeof t)return String(t);if("object"==typeof t&&t.toString&&(t.toTwos||t.dividedToIntegerBy))return t.toPrecision?String(t.toPrecision()):t.toString(10);throw new Error("while converting number to string, invalid number value '"+t+"' type "+typeof t+".")}t.exports={unitMap:a,numberToString:u,getValueOfUnit:h,fromWei:function(t,e,r){var i=n(t),u=i.lt(o),f=h(e),l=a[e].length-1||1,c=r||{};u&&(i=i.mul(s));for(var d=i.mod(f).toString(10);d.length2)throw new Error("[ethjs-unit] while converting number "+t+" to wei, too many decimal points");var c=l[0],d=l[1];if(c||(c="0"),d||(d="0"),d.length>o)throw new Error("[ethjs-unit] while converting number "+t+" to wei, too many decimal places");for(;d.length=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e,r){(function(t){!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(2).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],l=[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];function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,l=67108863&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[u]=0|l,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,h="le"===e,u=new t(o),f=this.clone();if(h){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],S=8191&_,x=_>>>13,k=0|s[5],A=8191&k,E=k>>>13,B=0|s[6],O=8191&B,R=B>>>13,I=0|s[7],T=8191&I,j=I>>>13,C=0|s[8],N=8191&C,P=C>>>13,L=0|s[9],q=8191&L,D=L>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],Z=8191&H,W=H>>>13,K=0|a[2],V=8191&K,G=K>>>13,Y=0|a[3],J=8191&Y,X=Y>>>13,$=0|a[4],Q=8191&$,tt=$>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ft=0|a[8],lt=8191&ft,ct=ft>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(c,F)|0))<<13)|0;u=((o=Math.imul(c,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var gt=(u+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,Z)|0))<<13)|0;u=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,o=Math.imul(y,z),i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var yt=(u+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(c,V)|0))<<13)|0;u=((o=o+Math.imul(c,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var bt=(u+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,X)|0)+Math.imul(c,J)|0))<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,z))+Math.imul(x,F)|0,o=Math.imul(x,z),i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,G)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,G)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;u=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(O,F),n=(n=Math.imul(O,z))+Math.imul(R,F)|0,o=Math.imul(R,z),i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,G)|0,i=i+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;u=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,z))+Math.imul(j,F)|0,o=Math.imul(j,z),i=i+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(u+(i=i+Math.imul(l,ht)|0)|0)+((8191&(n=(n=n+Math.imul(l,ut)|0)+Math.imul(c,ht)|0))<<13)|0;u=((o=o+Math.imul(c,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(P,F)|0,o=Math.imul(P,z),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,W)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,G)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;u=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,G)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,lt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var kt=(u+(i=i+Math.imul(l,pt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,pt)|0))<<13)|0;u=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,W))+Math.imul(D,Z)|0,o=Math.imul(D,W),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(g,lt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ct)|0;var At=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(D,V)|0,o=Math.imul(D,G),i=i+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,lt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ct)|0;var Et=(u+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,J),n=(n=Math.imul(q,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,ut)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,ct)|0;var Bt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,i=i+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ut)|0,i=i+Math.imul(A,lt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var Ot=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(u+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,ot),n=(n=Math.imul(q,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0,i=i+Math.imul(T,lt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ct)|0;var It=(u+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(D,ht)|0,o=Math.imul(D,ut),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ct)|0;var Tt=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,lt),n=(n=Math.imul(q,ct))+Math.imul(D,lt)|0,o=Math.imul(D,ct);var jt=(u+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ct=(u+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,mt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,mt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,h[0]=vt,h[1]=gt,h[2]=yt,h[3]=bt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=kt,h[10]=At,h[11]=Et,h[12]=Bt,h[13]=Ot,h[14]=Rt,h[15]=It,h[16]=Tt,h[17]=jt,h[18]=Ct,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new o(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;0==(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();i(v=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var l=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(4)(t))},function(t,e,r){var i=r(217);t.exports=function(t){return"string"!=typeof t?t:i(t)?t.slice(2):t}},function(t,e){t.exports=function(t){if("string"!=typeof t)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof t+", while checking isHexPrefixed.");return"0x"===t.slice(0,2)}},function(t,e){},function(t,e,r){!function(t){var e,r,i,n=String.fromCharCode;function o(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n=55296&&t<=57343)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function a(t,e){return n(t>>e&63|128)}function h(t){if(0==(4294967168&t))return n(t);var e="";return 0==(4294965248&t)?e=n(t>>6&31|192):0==(4294901760&t)?(s(t),e=n(t>>12&15|224),e+=a(t,6)):0==(4292870144&t)&&(e=n(t>>18&7|240),e+=a(t,12),e+=a(t,6)),e+n(63&t|128)}function u(){if(i>=r)throw Error("Invalid byte index");var t=255&e[i];if(i++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function f(){var t,n;if(i>r)throw Error("Invalid byte index");if(i==r)return!1;if(t=255&e[i],i++,0==(128&t))return t;if(192==(224&t)){if((n=(31&t)<<6|u())>=128)return n;throw Error("Invalid continuation byte")}if(224==(240&t)){if((n=(15&t)<<12|u()<<6|u())>=2048)return s(n),n;throw Error("Invalid continuation byte")}if(240==(248&t)&&(n=(7&t)<<18|u()<<12|u()<<6|u())>=65536&&n<=1114111)return n;throw Error("Invalid UTF-8 detected")}t.version="3.0.0",t.encode=function(t){for(var e=o(t),r=e.length,i=-1,n="";++i65535&&(o+=n((e-=65536)>>>10&1023|55296),e=56320|1023&e),o+=n(e);return o}(a)}}(e)},function(t,e){var r="0123456789abcdef".split(""),i=[1,256,65536,16777216],n=[0,8,16,24],o=[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],s=function(t){var e,r,i,n,s,a,h,u,f,l,c,d,p,m,v,g,y,b,w,M,_,S,x,k,A,E,B,O,R,I,T,j,C,N,P,L,q,D,U,F,z,H,Z,W,K,V,G,Y,J,X,$,Q,tt,et,rt,it,nt,ot,st,at,ht,ut,ft;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],h=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],f=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|h>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(h<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(u<<1|f>>>31),r=s^(f<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(l<<1|c>>>31),r=h^(c<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(d<<1|p>>>31),r=f^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(n<<1|s>>>31),r=c^(s<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,m=t[0],v=t[1],V=t[11]<<4|t[10]>>>28,G=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,R=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ht=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,N=t[2]<<1|t[3]>>>31,P=t[3]<<1|t[2]>>>31,g=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,Y=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,I=t[33]<<13|t[32]>>>19,T=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,q=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,$=t[35]<<15|t[34]>>>17,j=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,k=t[6]<<28|t[7]>>>4,A=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,W=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,E=t[18]<<20|t[19]>>>12,B=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,S=t[48]<<14|t[49]>>>18,x=t[49]<<14|t[48]>>>18,t[0]=m^~g&b,t[1]=v^~y&w,t[10]=k^~E&O,t[11]=A^~B&R,t[20]=N^~L&D,t[21]=P^~q&U,t[30]=W^~V&Y,t[31]=K^~G&J,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=g^~b&M,t[3]=y^~w&_,t[12]=E^~O&I,t[13]=B^~R&T,t[22]=L^~D&F,t[23]=q^~U&z,t[32]=V^~Y&X,t[33]=G^~J&$,t[42]=it^~ot&at,t[43]=nt^~st&ht,t[4]=b^~M&S,t[5]=w^~_&x,t[14]=O^~I&j,t[15]=R^~T&C,t[24]=D^~F&H,t[25]=U^~z&Z,t[34]=Y^~X&Q,t[35]=J^~$&tt,t[44]=ot^~at&ut,t[45]=st^~ht&ft,t[6]=M^~S&m,t[7]=_^~x&v,t[16]=I^~j&k,t[17]=T^~C&A,t[26]=F^~H&N,t[27]=z^~Z&P,t[36]=X^~Q&W,t[37]=$^~tt&K,t[46]=at^~ut&et,t[47]=ht^~ft&rt,t[8]=S^~m&g,t[9]=x^~v&y,t[18]=j^~k&E,t[19]=C^~A&B,t[28]=H^~N&L,t[29]=Z^~P&q,t[38]=Q^~W&V,t[39]=tt^~K&G,t[48]=ut^~et&it,t[49]=ft^~rt&nt,t[0]^=o[i],t[1]^=o[i+1]},a=function(t){return function(e){var o;if("0x"===e.slice(0,2)){o=[];for(var a=2,h=e.length;a>2]|=e[d]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(h[v>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=u){for(t.start=v-u,t.block=h[f],v=0;v>2]|=i[3&v],t.lastByteIndex===u)for(h[0]=h[f],v=1;v>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];g%f==0&&(s(c),v=0)}return"0x"+m}(function(t){return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e}(t),o)}};t.exports={keccak256:a(256),keccak512:a(512),keccak256s:a(256),keccak512s:a(512)}},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0});var i=r(222);function n(t){return!("string"!=typeof t||!/^(0x)?[0-9a-f]{512}$/i.test(t)||!/^(0x)?[0-9a-f]{512}$/.test(t)&&!/^(0x)?[0-9A-F]{512}$/.test(t))}function o(t,e){"object"==typeof e&&e.constructor===Uint8Array&&(e=i.bytesToHex(e));for(var r=i.keccak256(e).replace("0x",""),n=0;n<12;n+=4){var o=(parseInt(r.substr(n,2),16)<<8)+parseInt(r.substr(n+2,2),16)&2047,a=1<=48&&t<=57)return t-48;if(t>=65&&t<=70)return t-55;if(t>=97&&t<=102)return t-87;throw new Error("invalid bloom")}function a(t){return!("string"!=typeof t||!/^(0x)?[0-9a-f]{64}$/i.test(t)||!/^(0x)?[0-9a-f]{64}$/.test(t)&&!/^(0x)?[0-9A-F]{64}$/.test(t))}function h(t){return!("string"!=typeof t||!t.match(/^(0x)?[0-9a-fA-F]{40}$/)&&!t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/))}e.isBloom=n,e.isInBloom=o,e.isUserEthereumAddressInBloom=function(t,e){if(!n(t))throw new Error("Invalid bloom given");if(!h(e))throw new Error('Invalid ethereum address given: "'.concat(e,'"'));return o(t,i.padLeft(e,64))},e.isContractAddressInBloom=function(t,e){if(!n(t))throw new Error("Invalid bloom given");if(!h(e))throw new Error('Invalid contract address given: "'.concat(e,'"'));return o(t,e)},e.isTopicInBloom=function(t,e){if(!n(t))throw new Error("Invalid bloom given");if(!a(e))throw new Error("Invalid topic");return o(t,e)},e.isTopic=a,e.isAddress=h},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0});var i=r(223);function n(t){if(null==t)throw new Error("cannot convert null value to array");if("string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);if(!e)throw new Error("invalid hexidecimal string");if("0x"!==e[1])throw new Error("hex string must have 0x prefix");(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],i=0;i=256||parseInt(String(r))!=r)return!1}return!0}(t))return o(new Uint8Array(t));throw new Error("invalid arrayify value")}function o(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return o(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}e.keccak256=function(t){return"0x"+i.keccak_256(n(t))},e.padLeft=function(t,e){var r=/^0x/i.test(t)||"number"==typeof t,i=e-(t=t.toString().replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(r?"0x":"")+new Array(i).join("0")+t},e.bytesToHex=function(t){for(var e=[],r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return"0x".concat(e.join("").replace(/^0+/,""))},e.toByteArray=n},function(t,e,r){(function(i,n){var o;!function(){var s="input is invalid type",a="object"==typeof window,h=a?window:{};h.JS_SHA3_NO_WINDOW&&(a=!1);var u=!a&&"object"==typeof self;!h.JS_SHA3_NO_NODE_JS&&"object"==typeof i&&i.versions&&i.versions.node?h=n:u&&(h=self);var f=!h.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,l=r(224),c=!h.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),p=[4,1024,262144,67108864],m=[0,8,16,24],v=[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],g=[224,256,384,512],y=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],w={128:168,256:136};!h.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!c||!h.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var M=function(t,e,r){return function(i){return new P(t,e,t).update(i)[r]()}},_=function(t,e,r){return function(i,n){return new P(t,e,n).update(i)[r]()}},S=function(t,e,r){return function(e,i,n,o){return B["cshake"+t].update(e,i,n,o)[r]()}},x=function(t,e,r){return function(e,i,n,o){return B["kmac"+t].update(e,i,n,o)[r]()}},k=function(t,e,r,i){for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}function L(t,e,r){P.call(this,t,e,r)}P.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(s);if(null===t)throw new Error(s);if(c&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||c&&ArrayBuffer.isView(t)))throw new Error(s);e=!0}for(var i,n,o=this.blocks,a=this.byteCount,h=t.length,u=this.blockCount,f=0,l=this.s;f>2]|=t[f]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[i>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=a){for(this.start=i-a,this.block=o[u],i=0;i>=8);r>0;)n.unshift(r),r=255&(t>>=8),++i;return e?n.push(i):n.unshift(i),this.update(n),n.length},P.prototype.encodeString=function(t){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(s);if(null===t)throw new Error(s);if(c&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||c&&ArrayBuffer.isView(t)))throw new Error(s);e=!0}var i=0,n=t.length;if(e)i=n;else for(var o=0;o=57344?i+=3:(a=65536+((1023&a)<<10|1023&t.charCodeAt(++o)),i+=4)}return i+=this.encode(8*i),this.update(t),i},P.prototype.bytepad=function(t,e){for(var r=this.encode(e),i=0;i>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+d[15&t]+d[t>>12&15]+d[t>>8&15]+d[t>>20&15]+d[t>>16&15]+d[t>>28&15]+d[t>>24&15];s%e==0&&(q(r),o=0)}return n&&(t=r[o],a+=d[t>>4&15]+d[15&t],n>1&&(a+=d[t>>12&15]+d[t>>8&15]),n>2&&(a+=d[t>>20&15]+d[t>>16&15])),a},P.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var h=new Uint32Array(t);s>8&255,h[t+2]=e>>16&255,h[t+3]=e>>24&255;a%r==0&&q(i)}return o&&(t=a<<2,e=i[s],h[t]=255&e,o>1&&(h[t+1]=e>>8&255),o>2&&(h[t+2]=e>>16&255)),h},L.prototype=new P,L.prototype.finalize=function(){return this.encode(this.outputBits,!0),P.prototype.finalize.call(this)};var q=function(t){var e,r,i,n,o,s,a,h,u,f,l,c,d,p,m,g,y,b,w,M,_,S,x,k,A,E,B,O,R,I,T,j,C,N,P,L,q,D,U,F,z,H,Z,W,K,V,G,Y,J,X,$,Q,tt,et,rt,it,nt,ot,st,at,ht,ut,ft;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],u=t[5]^t[15]^t[25]^t[35]^t[45],f=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(c=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(h<<1|u>>>31),r=o^(u<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(f<<1|l>>>31),r=a^(l<<1|f>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(c<<1|d>>>31),r=u^(d<<1|c>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=f^(n<<1|o>>>31),r=l^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],m=t[1],V=t[11]<<4|t[10]>>>28,G=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,R=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ht=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,N=t[2]<<1|t[3]>>>31,P=t[3]<<1|t[2]>>>31,g=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,Y=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,I=t[33]<<13|t[32]>>>19,T=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,q=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,$=t[35]<<15|t[34]>>>17,j=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,k=t[6]<<28|t[7]>>>4,A=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,W=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,E=t[18]<<20|t[19]>>>12,B=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,S=t[48]<<14|t[49]>>>18,x=t[49]<<14|t[48]>>>18,t[0]=p^~g&b,t[1]=m^~y&w,t[10]=k^~E&O,t[11]=A^~B&R,t[20]=N^~L&D,t[21]=P^~q&U,t[30]=W^~V&Y,t[31]=K^~G&J,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=g^~b&M,t[3]=y^~w&_,t[12]=E^~O&I,t[13]=B^~R&T,t[22]=L^~D&F,t[23]=q^~U&z,t[32]=V^~Y&X,t[33]=G^~J&$,t[42]=it^~ot&at,t[43]=nt^~st&ht,t[4]=b^~M&S,t[5]=w^~_&x,t[14]=O^~I&j,t[15]=R^~T&C,t[24]=D^~F&H,t[25]=U^~z&Z,t[34]=Y^~X&Q,t[35]=J^~$&tt,t[44]=ot^~at&ut,t[45]=st^~ht&ft,t[6]=M^~S&p,t[7]=_^~x&m,t[16]=I^~j&k,t[17]=T^~C&A,t[26]=F^~H&N,t[27]=z^~Z&P,t[36]=X^~Q&W,t[37]=$^~tt&K,t[46]=at^~ut&et,t[47]=ht^~ft&rt,t[8]=S^~p&g,t[9]=x^~m&y,t[18]=j^~k&E,t[19]=C^~A&B,t[28]=H^~N&L,t[29]=Z^~P&q,t[38]=Q^~W&V,t[39]=tt^~K&G,t[48]=ut^~et&it,t[49]=ft^~rt&nt,t[0]^=v[i],t[1]^=v[i+1]};if(f)t.exports=B;else{for(R=0;R32||i256)throw new Error("Invalid uint"+i+" size");if((a=s(e)).bitLength()>i)throw new Error("Supplied uint exceeds width: "+i+" vs "+a.bitLength());if(a.lt(new n(0)))throw new Error("Supplied uint "+a.toString()+" is negative");return i?o.leftPad(a.toString("hex"),i/8*2):a}if(t.startsWith("int")){if(i%8||i<8||i>256)throw new Error("Invalid int"+i+" size");if((a=s(e)).bitLength()>i)throw new Error("Supplied int exceeds width: "+i+" vs "+a.bitLength());return a.lt(new n(0))?a.toTwos(i).toString("hex"):i?o.leftPad(a.toString("hex"),i/8*2):a}throw new Error("Unsupported or invalid type: "+t)},h=function(t){if(i.isArray(t))throw new Error("Autodetection of array types is not supported.");var e,r,s="";if(i.isObject(t)&&(t.hasOwnProperty("v")||t.hasOwnProperty("t")||t.hasOwnProperty("value")||t.hasOwnProperty("type"))?(e=t.hasOwnProperty("t")?t.t:t.type,s=t.hasOwnProperty("v")?t.v:t.value):(e=o.toHex(t,!0),s=o.toHex(t),e.startsWith("int")||e.startsWith("uint")||(e="bytes")),!e.startsWith("int")&&!e.startsWith("uint")||"string"!=typeof s||/^(-)?0x/i.test(s)||(s=new n(s)),i.isArray(s)){if((r=function(t){var e=/^\D+\d*\[(\d+)\]$/.exec(t);return e?parseInt(e[1],10):null}(e))&&s.length!==r)throw new Error(e+" is not matching the given array "+JSON.stringify(s));r=s.length}return i.isArray(s)?s.map((function(t){return a(e,t,r).toString("hex").replace("0x","")})).join(""):a(e,s,r).toString("hex").replace("0x","")};t.exports={soliditySha3:function(){var t=Array.prototype.slice.call(arguments),e=i.map(t,h);return o.sha3("0x"+e.join(""))},soliditySha3Raw:function(){return o.sha3Raw("0x"+i.map(Array.prototype.slice.call(arguments),h).join(""))}}}]).default}));Object(p.c)(j);var C=function t(e,r){if(e===r)return!0;if(e&&r&&"object"==typeof e&&"object"==typeof r){if(e.constructor!==r.constructor)return!1;var i,n,o;if(Array.isArray(e)){if((i=e.length)!=r.length)return!1;for(n=i;0!=n--;)if(!t(e[n],r[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if((i=(o=Object.keys(e)).length)!==Object.keys(r).length)return!1;for(n=i;0!=n--;)if(!Object.prototype.hasOwnProperty.call(r,o[n]))return!1;for(n=i;0!=n--;){var s=o[n];if(!t(e[s],r[s]))return!1}return!0}return e!=e&&r!=r},N=function(t,e){t||(t=30),e||(e="aA0");var r="";e.split("").forEach((function(t){isNaN(parseInt(t))?/[a-z]/.test(t)?r+="abcdefghijklmnopqrstuvwxyz":/[A-Z]/.test(t)?r+="ABCDEFGHIJKLMNOPQRSTUVWXYZ":r+="~!@#$%^&()_+-={}[];',":r+="0123456789"}));for(var i="",n=0;n>>2]>>>24-o%4*8&255;e[i+o>>>2]|=s<<24-(i+o)%4*8}else for(o=0;o>>2]=r[o>>>2];return this.sigBytes+=n,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var r,i=[],n=function(e){e=e;var r=987654321,i=4294967295;return function(){var n=((r=36969*(65535&r)+(r>>16)&i)<<16)+(e=18e3*(65535&e)+(e>>16)&i)&i;return n/=4294967296,(n+=.5)*(t.random()>.5?1:-1)}},o=0;o>>2]>>>24-n%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i>>3]|=parseInt(t.substr(i,2),16)<<24-i%8*4;return new s.init(r,e/2)}},u=a.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n>>2]>>>24-n%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;return new s.init(r,e)}},f=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(u.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return u.parse(unescape(encodeURIComponent(t)))}},l=n.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=f.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r=this._data,i=r.words,n=r.sigBytes,o=this.blockSize,a=n/(4*o),h=(a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*o,u=t.min(4*h,n);if(h){for(var f=0;f7&&t[r].toUpperCase()!==t[r]||parseInt(e[r],16)<=7&&t[r].toLowerCase()!==t[r])return!1;return!0},m=function(t){return t instanceof i||t&&t.constructor&&"BigNumber"===t.constructor.name},v=function(t){return"string"==typeof t||t&&t.constructor&&"String"===t.constructor.name},g=function(t){return"boolean"==typeof t};t.exports={padLeft:a,padRight:function(t,e,r){return t+new Array(e-t.length+1).join(r||"0")},toHex:f,toDecimal:function(t){return c(t).toNumber()},fromDecimal:u,toUtf8:function(t){var e="",r=0,i=t.length;for("0x"===t.substring(0,2)&&(r=2);r7?r+=t[i].toUpperCase():r+=t[i];return r},isFunction:function(t){return"function"==typeof t},isString:v,isObject:function(t){return null!==t&&!Array.isArray(t)&&"object"==typeof t},isBoolean:g,isArray:function(t){return Array.isArray(t)},isJson:function(t){try{return!!JSON.parse(t)}catch(t){return!1}},isBloom:function(t){return!(!/^(0x)?[0-9a-f]{512}$/i.test(t)||!/^(0x)?[0-9a-f]{512}$/.test(t)&&!/^(0x)?[0-9A-F]{512}$/.test(t))},isTopic:function(t){return!(!/^(0x)?[0-9a-f]{64}$/i.test(t)||!/^(0x)?[0-9a-f]{64}$/.test(t)&&!/^(0x)?[0-9A-F]{64}$/.test(t))}}},function(t,e,r){var i,n,o,s,a,h,u,f,l,c,d,p,m,v,g,y,b,w,M;t.exports=(i=r(1),r(20),void(i.lib.Cipher||(n=i,o=n.lib,s=o.Base,a=o.WordArray,h=o.BufferedBlockAlgorithm,u=n.enc,u.Utf8,f=u.Base64,l=n.algo.EvpKDF,c=o.Cipher=h.extend({cfg:s.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r),this._xformMode=t,this._key=e,this.reset()},reset:function(){h.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?M:b}return function(e){return{encrypt:function(r,i,n){return t(i).encrypt(e,r,i,n)},decrypt:function(r,i,n){return t(i).decrypt(e,r,i,n)}}}}()}),o.StreamCipher=c.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),d=n.mode={},p=o.BlockCipherMode=s.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),m=d.CBC=function(){var t=p.extend();function e(t,e,r){var i=this._iv;if(i){var n=i;this._iv=void 0}else n=this._prevBlock;for(var o=0;o>>2];t.sigBytes-=e}},o.BlockCipher=c.extend({cfg:c.cfg.extend({mode:m,padding:v}),reset:function(){c.reset.call(this);var t=this.cfg,e=t.iv,r=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=r.createEncryptor;else i=r.createDecryptor,this._minBufferSize=1;this._mode&&this._mode.__creator==i?this._mode.init(this,e&&e.words):(this._mode=i.call(r,this,e&&e.words),this._mode.__creator=i)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else e=this._process(!0),t.unpad(e);return e},blockSize:4}),g=o.CipherParams=s.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),y=(n.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,r=t.salt;if(r)var i=a.create([1398893684,1701076831]).concat(r).concat(e);else i=e;return i.toString(f)},parse:function(t){var e=f.parse(t),r=e.words;if(1398893684==r[0]&&1701076831==r[1]){var i=a.create(r.slice(2,4));r.splice(0,4),e.sigBytes-=16}return g.create({ciphertext:e,salt:i})}},b=o.SerializableCipher=s.extend({cfg:s.extend({format:y}),encrypt:function(t,e,r,i){i=this.cfg.extend(i);var n=t.createEncryptor(r,i),o=n.finalize(e),s=n.cfg;return g.create({ciphertext:o,key:r,iv:s.iv,algorithm:t,mode:s.mode,padding:s.padding,blockSize:t.blockSize,formatter:i.format})},decrypt:function(t,e,r,i){return i=this.cfg.extend(i),e=this._parse(e,i.format),t.createDecryptor(r,i).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),w=(n.kdf={}).OpenSSL={execute:function(t,e,r,i){i||(i=a.random(8));var n=l.create({keySize:e+r}).compute(t,i),o=a.create(n.words.slice(e),4*r);return n.sigBytes=4*e,g.create({key:n,iv:o,salt:i})}},M=o.PasswordBasedCipher=b.extend({cfg:b.cfg.extend({kdf:w}),encrypt:function(t,e,r,i){var n=(i=this.cfg.extend(i)).kdf.execute(r,t.keySize,t.ivSize);i.iv=n.iv;var o=b.encrypt.call(this,t,e,n.key,i);return o.mixIn(n),o},decrypt:function(t,e,r,i){i=this.cfg.extend(i),e=this._parse(e,i.format);var n=i.kdf.execute(r,t.keySize,t.ivSize,e.salt);return i.iv=n.iv,b.decrypt.call(this,t,e,n.key,i)}}))))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){t.exports=y},function(t,e){t.exports=w},function(t,e,r){r.d(e,"f",(function(){return b})),r.d(e,"a",(function(){return w})),r.d(e,"d",(function(){return M})),r.d(e,"e",(function(){return _})),r.d(e,"b",(function(){return S})),r.d(e,"c",(function(){return k}));var i=r(3),n=r.n(i),o=r(9),s=r.n(o),a=r(8),h=r.n(a),u=r(99),f=r.n(u),l=r(36),c=r(2),d=r.n(c),p=r(30),m=r(15);function v(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function g(t){for(var e=1;ei.maxOrderValue&&(r.fiatValue="Requested amount is higher than supported")}return n.selectedCurrency&&!i.validCurrencies.includes(n.selectedCurrency)&&(r.selectedCurrency="Unsupported currency"),n.selectedCryptoCurrency&&!i.validCryptoCurrencies.includes(n.selectedCryptoCurrency)&&(r.selectedCryptoCurrency="Unsupported cryptoCurrency"),{errors:r,isValid:0===Object.keys(r).length}},w=function(){return function(t,e,r){r((function(t){var r=e.error;return r?(Object(l.serializeError)(r),d.a.error("MetaMask - RPC Error: ".concat(r.message),r),t()):t()}))}};function M(t,e){var r="MetamaskInpageProvider - lost connection to ".concat(t);e&&(r+="\n".concat(e.stack)),d.a.warn(r),this.emit&&this.listenerCount&&this.listenerCount("error")>0&&this.emit("error",r)}var _=function(t,e){if(t instanceof Promise)return t;var r={configurable:!0,writable:!0,enumerable:!1};return Object.defineProperty(t,"then",g({},r,{value:function(r,i){return Promise.resolve().then((function(){return r(t[e])}),i)}})),Object.defineProperty(t,"catch",g({},r,{value:Promise.prototype.catch})),Object.defineProperty(t,"finally",g({},r,{value:Promise.prototype.finally})),t},S=function(){return f()()},x=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={mode:"cors",cache:"no-cache"},i=g({},r,{},e,{},{method:"GET"});return fetch(t,i).then((function(t){if(t.ok)return t.json();throw t}))},k=function(){var t=s()(n.a.mark((function t(e,r){var i,o,s,a;return n.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=r.version||p.b,t.prev=1,"staging"!==e&&"production"!==e||r.check){t.next=7;break}return t.next=5,x("".concat(m.a.api,"/latestversion?name=").concat(p.a,"&version=").concat(r.version||p.b));case 5:a=t.sent,s=a.data;case 7:t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),d.a.error(t.t0,"unable to fetch latest version");case 12:d.a.info("version used: ",s),t.t1=e,t.next="staging"===t.t1?16:"testing"===t.t1?19:"development"===t.t1?22:25;break;case 16:return i="https://staging.tor.us/v".concat(s),o="info",t.abrupt("break",28);case 19:return i="https://testing.tor.us",o="debug",t.abrupt("break",28);case 22:return i="https://localhost:3000",o="debug",t.abrupt("break",28);case 25:return i="https://app.tor.us/v".concat(s),o="error",t.abrupt("break",28);case 28:return t.abrupt("return",{torusUrl:i,logLevel:o});case 29:case"end":return t.stop()}}),t,null,[[1,9]])})));return function(e,r){return t.apply(this,arguments)}}()},function(t,e){var r,i,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var h,u=[],f=!1,l=-1;function c(){f&&h&&(f=!1,h.length?u=h.concat(u):l=-1,u.length&&d())}function d(){if(!f){var t=a(c);f=!0;for(var e=u.length;e;){for(h=u,u=[];++l1)for(var r=1;r=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(h.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(i)return U(t).length;e=(""+e).toLowerCase(),i=!0}}function m(t,e,r){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return k(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function v(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function g(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=h.from(e,i)),h.isBuffer(e))return 0===e.length?-1:y(t,e,r,i,n);if("number"==typeof e)return e&=255,h.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,i,n){var o,s=1,a=t.length,h=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,a/=2,h/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(n){var f=-1;for(o=r;oa&&(r=a-h),o=r;o>=0;o--){for(var l=!0,c=0;cn&&(i=n):i=n;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var s=0;s>8,n=r%256,o.push(n),o.push(i);return o}(e,t.length-r),t,r,i)}function k(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n239?4:u>223?3:u>191?2:1;if(n+l<=r)switch(l){case 1:u<128&&(f=u);break;case 2:128==(192&(o=t[n+1]))&&(h=(31&u)<<6|63&o)>127&&(f=h);break;case 3:o=t[n+1],s=t[n+2],128==(192&o)&&128==(192&s)&&(h=(15&u)<<12|(63&o)<<6|63&s)>2047&&(h<55296||h>57343)&&(f=h);break;case 4:o=t[n+1],s=t[n+2],a=t[n+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(h=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&h<1114112&&(f=h)}null===f?(f=65533,l=1):f>65535&&(f-=65536,i.push(f>>>10&1023|55296),f=56320|1023&f),i.push(f),n+=l}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",i=0;ii)&&(r=i);for(var n="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function T(t,e,r,i,n,o){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function j(t,e,r,i){e<0&&(e=65535+e+1);for(var n=0,o=Math.min(t.length-r,2);n>>8*(i?n:1-n)}function C(t,e,r,i){e<0&&(e=4294967295+e+1);for(var n=0,o=Math.min(t.length-r,4);n>>8*(i?n:3-n)&255}function N(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(t,e,r,i,o){return o||N(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function L(t,e,r,i,o){return o||N(t,0,r,8),n.write(t,e,r,i,52,8),r+8}e.Buffer=h,e.SlowBuffer=function(t){return+t!=t&&(t=0),h.alloc(+t)},e.INSPECT_MAX_BYTES=50,h.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),h.poolSize=8192,h._augment=function(t){return t.__proto__=h.prototype,t},h.from=function(t,e,r){return u(null,t,e,r)},h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0})),h.alloc=function(t,e,r){return function(t,e,r,i){return f(e),e<=0?a(t,e):void 0!==r?"string"==typeof i?a(t,e).fill(r,i):a(t,e).fill(r):a(t,e)}(null,t,e,r)},h.allocUnsafe=function(t){return l(null,t)},h.allocUnsafeSlow=function(t){return l(null,t)},h.isBuffer=function(t){return!(null==t||!t._isBuffer)},h.compare=function(t,e){if(!h.isBuffer(t)||!h.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,i=e.length,n=0,o=Math.min(r,i);n0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},h.prototype.compare=function(t,e,r,i,n){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(n>>>=0)-(i>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(i,n),f=t.slice(e,r),l=0;ln)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return M(this,t,e,r);case"latin1":case"binary":return _(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},h.prototype.slice=function(t,e){var r,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e0&&(n*=256);)i+=this[t+--e]*n;return i},h.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},h.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var i=this[t],n=1,o=0;++o=(n*=128)&&(i-=Math.pow(2,8*e)),i},h.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var i=e,n=1,o=this[t+--i];i>0&&(n*=256);)o+=this[t+--i]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*e)),o},h.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt32LE=function(t,e){return e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),n.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),n.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),n.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),n.read(this,t,!1,52,8)},h.prototype.writeUIntLE=function(t,e,r,i){t=+t,e|=0,r|=0,i||T(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+n]=t/o&255;return e+r},h.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,1,255,0),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},h.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},h.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},h.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):C(this,t,e,!0),e+4},h.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},h.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);T(this,t,e,r,n-1,-n)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},h.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);T(this,t,e,r,n-1,-n)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},h.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,1,127,-128),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},h.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},h.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},h.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):C(this,t,e,!0),e+4},h.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},h.prototype.writeFloatLE=function(t,e,r){return P(this,t,e,!0,r)},h.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},h.prototype.writeDoubleLE=function(t,e,r){return L(this,t,e,!0,r)},h.prototype.writeDoubleBE=function(t,e,r){return L(this,t,e,!1,r)},h.prototype.copy=function(t,e,r,i){if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--n)t[n+e]=this[n+r];else if(o<1e3||!h.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function F(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(q,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,i){for(var n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}}).call(this,r(7))},function(t,e,r){var i=r(34),n=r(5),o=r(41),s=r(77),a=function(t){i.config(o.ETH_BIGNUMBER_ROUNDING_MODE);var e=n.padLeft(n.toTwosComplement(t).toString(16),64);return new s(e)},h=function(t){var e=t.staticPart()||"0";return function(t){return"1"===new i(t.substr(0,1),16).toString(2).substr(0,1)}(e)?new i(e,16).minus(new i("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16)).minus(1):new i(e,16)},u=function(t){var e=t.staticPart()||"0";return new i(e,16)};t.exports={formatInputInt:a,formatInputBytes:function(t){var e=n.toHex(t).substr(2),r=Math.floor((e.length+63)/64);return e=n.padRight(e,64*r),new s(e)},formatInputDynamicBytes:function(t){var e=n.toHex(t).substr(2),r=e.length/2,i=Math.floor((e.length+63)/64);return e=n.padRight(e,64*i),new s(a(r).value+e)},formatInputString:function(t){var e=n.fromUtf8(t).substr(2),r=e.length/2,i=Math.floor((e.length+63)/64);return e=n.padRight(e,64*i),new s(a(r).value+e)},formatInputBool:function(t){return new s("000000000000000000000000000000000000000000000000000000000000000"+(t?"1":"0"))},formatInputReal:function(t){return a(new i(t).times(new i(2).pow(128)))},formatOutputInt:h,formatOutputUInt:u,formatOutputReal:function(t){return h(t).dividedBy(new i(2).pow(128))},formatOutputUReal:function(t){return u(t).dividedBy(new i(2).pow(128))},formatOutputBool:function(t){return"0000000000000000000000000000000000000000000000000000000000000001"===t.staticPart()},formatOutputBytes:function(t,e){var r=e.match(/^bytes([0-9]*)/),i=parseInt(r[1]);return"0x"+t.staticPart().slice(0,2*i)},formatOutputDynamicBytes:function(t){var e=2*new i(t.dynamicPart().slice(0,64),16).toNumber();return"0x"+t.dynamicPart().substr(64,e)},formatOutputString:function(t){var e=2*new i(t.dynamicPart().slice(0,64),16).toNumber();return n.toUtf8(t.dynamicPart().substr(64,e))},formatOutputAddress:function(t){var e=t.staticPart();return"0x"+e.slice(e.length-40,e.length)}}},function(t,e,r){var i=r(12),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=s),s.prototype=Object.create(n.prototype),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},function(t,e,r){var i,n=r(8),o=r.n(n),s={GOOGLE:"google",FACEBOOK:"facebook",TWITCH:"twitch",REDDIT:"reddit",DISCORD:"discord",MOONPAY:"moonpay",WYRE:"wyre",RAMPNETWORK:"rampnetwork"},a=Object.values(s),h=(i={},o()(i,s.RAMPNETWORK,{line1:"Bank transfer",line2:"0% - 2.5%",line3:"10,000\u20ac/purchase, 10,000\u20ac/mo",supportPage:"https://instant.ramp.network/",minOrderValue:1,maxOrderValue:1e4,validCurrencies:["GBP","EUR"],validCryptoCurrencies:["ETH","DAI","USDC"],includeFees:!0}),o()(i,s.MOONPAY,{line1:"Credit / Debit Card / Apple Pay",line2:"4.5% or 5 USD",line3:"2,000\u20ac/day, 10,000\u20ac/mo",supportPage:"https://help.moonpay.io/en/",minOrderValue:24.99,maxOrderValue:2e3,validCurrencies:["USD","EUR","GBP"],validCryptoCurrencies:["ETH","DAI","TUSD","USDC","USDT"],includeFees:!0}),o()(i,s.WYRE,{line1:"Apple Pay/Debit Card",line2:"1.5% + 30\xa2",line3:"$250/day",supportPage:"https://support.sendwyre.com/en/",minOrderValue:20,maxOrderValue:250,validCurrencies:["USD"],validCryptoCurrencies:["ETH","DAI","USDC"],includeFees:!1}),i);e.a={networkList:["mainnet","rinkeby","ropsten","kovan","goerli","localhost","matic"],enums:s,verifierList:a,supportedVerifierList:[s.GOOGLE,s.REDDIT,s.DISCORD],paymentProviders:h,api:"https://api.tor.us"}},function(t,e,r){var i=r(13),n=r(77),o=function(t){this._inputFormatter=t.inputFormatter,this._outputFormatter=t.outputFormatter};o.prototype.isType=function(t){throw"this method should be overrwritten for type "+t},o.prototype.staticPartLength=function(t){return(this.nestedTypes(t)||["[1]"]).map((function(t){return parseInt(t.slice(1,-1),10)||1})).reduce((function(t,e){return t*e}),32)},o.prototype.isDynamicArray=function(t){var e=this.nestedTypes(t);return!!e&&!e[e.length-1].match(/[0-9]{1,}/g)},o.prototype.isStaticArray=function(t){var e=this.nestedTypes(t);return!!e&&!!e[e.length-1].match(/[0-9]{1,}/g)},o.prototype.staticArrayLength=function(t){var e=this.nestedTypes(t);return e?parseInt(e[e.length-1].match(/[0-9]{1,}/g)||1):1},o.prototype.nestedName=function(t){var e=this.nestedTypes(t);return e?t.substr(0,t.length-e[e.length-1].length):t},o.prototype.isDynamicType=function(){return!1},o.prototype.nestedTypes=function(t){return t.match(/(\[[0-9]*\])/g)},o.prototype.encode=function(t,e){var r,n,o,s=this;return this.isDynamicArray(e)?(r=t.length,n=s.nestedName(e),(o=[]).push(i.formatInputInt(r).encode()),t.forEach((function(t){o.push(s.encode(t,n))})),o):this.isStaticArray(e)?function(){for(var r=s.staticArrayLength(e),i=s.nestedName(e),n=[],o=0;o1?(t[r[0]]=t[r[0]]||{},t[r[0]][r[1]]=e):t[r[0]]=e},o.prototype.buildCall=function(){var t=this,e=function(){var e=t.toPayload(Array.prototype.slice.call(arguments));return e.callback?t.requestManager.sendAsync(e,(function(r,i){e.callback(r,t.formatOutput(i))})):t.formatOutput(t.requestManager.send(e))};return e.request=this.request.bind(this),e},o.prototype.request=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));return t.format=this.formatOutput.bind(this),t},t.exports=o},function(t,e,r){var i=r(72),n=r(39),o="object"==typeof Reflect?Reflect:null,s=o&&"function"==typeof o.apply?o.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};function a(){n.call(this)}function h(t,e,r){try{s(t,e,r)}catch(t){setTimeout((function(){throw t}))}}function u(t,e){for(var r=new Array(e),i=0;i0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=n[t];if(void 0===a)return!1;if("function"==typeof a)h(a,this,e);else{var f=a.length,l=u(a,f);for(r=0;r>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a>>6*(3-a)&63));var h=i.charAt(64);if(h)for(;n.length%4;)n.push(h);return n.join("")},parse:function(t){var e=t.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o>>6-s%4*2;i[o>>>2]|=(a|h)<<24-o%4*8,o++}return n.create(i,o)}(t,e,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},o.enc.Base64)},function(t,e,r){var i;t.exports=(i=r(1),function(t){var e=i,r=e.lib,n=r.WordArray,o=r.Hasher,s=e.algo,a=[];!function(){for(var e=0;e<64;e++)a[e]=4294967296*t.abs(t.sin(e+1))|0}();var h=s.MD5=o.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var i=e+r,n=t[i];t[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var o=this._hash.words,s=t[e+0],h=t[e+1],d=t[e+2],p=t[e+3],m=t[e+4],v=t[e+5],g=t[e+6],y=t[e+7],b=t[e+8],w=t[e+9],M=t[e+10],_=t[e+11],S=t[e+12],x=t[e+13],k=t[e+14],A=t[e+15],E=o[0],B=o[1],O=o[2],R=o[3];E=u(E,B,O,R,s,7,a[0]),R=u(R,E,B,O,h,12,a[1]),O=u(O,R,E,B,d,17,a[2]),B=u(B,O,R,E,p,22,a[3]),E=u(E,B,O,R,m,7,a[4]),R=u(R,E,B,O,v,12,a[5]),O=u(O,R,E,B,g,17,a[6]),B=u(B,O,R,E,y,22,a[7]),E=u(E,B,O,R,b,7,a[8]),R=u(R,E,B,O,w,12,a[9]),O=u(O,R,E,B,M,17,a[10]),B=u(B,O,R,E,_,22,a[11]),E=u(E,B,O,R,S,7,a[12]),R=u(R,E,B,O,x,12,a[13]),O=u(O,R,E,B,k,17,a[14]),E=f(E,B=u(B,O,R,E,A,22,a[15]),O,R,h,5,a[16]),R=f(R,E,B,O,g,9,a[17]),O=f(O,R,E,B,_,14,a[18]),B=f(B,O,R,E,s,20,a[19]),E=f(E,B,O,R,v,5,a[20]),R=f(R,E,B,O,M,9,a[21]),O=f(O,R,E,B,A,14,a[22]),B=f(B,O,R,E,m,20,a[23]),E=f(E,B,O,R,w,5,a[24]),R=f(R,E,B,O,k,9,a[25]),O=f(O,R,E,B,p,14,a[26]),B=f(B,O,R,E,b,20,a[27]),E=f(E,B,O,R,x,5,a[28]),R=f(R,E,B,O,d,9,a[29]),O=f(O,R,E,B,y,14,a[30]),E=l(E,B=f(B,O,R,E,S,20,a[31]),O,R,v,4,a[32]),R=l(R,E,B,O,b,11,a[33]),O=l(O,R,E,B,_,16,a[34]),B=l(B,O,R,E,k,23,a[35]),E=l(E,B,O,R,h,4,a[36]),R=l(R,E,B,O,m,11,a[37]),O=l(O,R,E,B,y,16,a[38]),B=l(B,O,R,E,M,23,a[39]),E=l(E,B,O,R,x,4,a[40]),R=l(R,E,B,O,s,11,a[41]),O=l(O,R,E,B,p,16,a[42]),B=l(B,O,R,E,g,23,a[43]),E=l(E,B,O,R,w,4,a[44]),R=l(R,E,B,O,S,11,a[45]),O=l(O,R,E,B,A,16,a[46]),E=c(E,B=l(B,O,R,E,d,23,a[47]),O,R,s,6,a[48]),R=c(R,E,B,O,y,10,a[49]),O=c(O,R,E,B,k,15,a[50]),B=c(B,O,R,E,v,21,a[51]),E=c(E,B,O,R,S,6,a[52]),R=c(R,E,B,O,p,10,a[53]),O=c(O,R,E,B,M,15,a[54]),B=c(B,O,R,E,h,21,a[55]),E=c(E,B,O,R,b,6,a[56]),R=c(R,E,B,O,A,10,a[57]),O=c(O,R,E,B,g,15,a[58]),B=c(B,O,R,E,x,21,a[59]),E=c(E,B,O,R,m,6,a[60]),R=c(R,E,B,O,_,10,a[61]),O=c(O,R,E,B,d,15,a[62]),B=c(B,O,R,E,w,21,a[63]),o[0]=o[0]+E|0,o[1]=o[1]+B|0,o[2]=o[2]+O|0,o[3]=o[3]+R|0},_doFinalize:function(){var e=this._data,r=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;r[n>>>5]|=128<<24-n%32;var o=t.floor(i/4294967296),s=i;r[15+(n+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(n+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),e.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,h=a.words,u=0;u<4;u++){var f=h[u];h[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return a},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function u(t,e,r,i,n,o,s){var a=t+(e&r|~e&i)+n+s;return(a<>>32-o)+e}function f(t,e,r,i,n,o,s){var a=t+(e&i|r&~i)+n+s;return(a<>>32-o)+e}function l(t,e,r,i,n,o,s){var a=t+(e^r^i)+n+s;return(a<>>32-o)+e}function c(t,e,r,i,n,o,s){var a=t+(r^(e|~i))+n+s;return(a<>>32-o)+e}e.MD5=o._createHelper(h),e.HmacMD5=o._createHmacHelper(h)}(Math),i.MD5)},function(t,e){t.exports={InvalidNumberOfSolidityArgs:function(){return new Error("Invalid number of arguments to Solidity function")},InvalidNumberOfRPCParams:function(){return new Error("Invalid number of input parameters to RPC method")},InvalidConnection:function(t){return new Error("CONNECTION ERROR: Couldn't connect to node "+t+".")},InvalidProvider:function(){return new Error("Provider not set or invalid")},InvalidResponse:function(t){var e=t&&t.error&&t.error.message?t.error.message:"Invalid JSON RPC response: "+JSON.stringify(t);return new Error(e)},ConnectionTimeout:function(t){return new Error("CONNECTION TIMEOUT: timeout of "+t+" ms achived")}}},function(t,e,r){var i=r(5),n=function(t){this.name=t.name,this.getter=t.getter,this.setter=t.setter,this.outputFormatter=t.outputFormatter,this.inputFormatter=t.inputFormatter,this.requestManager=null};n.prototype.setRequestManager=function(t){this.requestManager=t},n.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter(t):t},n.prototype.formatOutput=function(t){return this.outputFormatter&&null!=t?this.outputFormatter(t):t},n.prototype.extractCallback=function(t){if(i.isFunction(t[t.length-1]))return t.pop()},n.prototype.attachToObject=function(t){var e={get:this.buildGet(),enumerable:!0},r=this.name.split("."),i=r[0];r.length>1&&(t[r[0]]=t[r[0]]||{},t=t[r[0]],i=r[1]),Object.defineProperty(t,i,e),t[o(i)]=this.buildAsyncGet()};var o=function(t){return"get"+t.charAt(0).toUpperCase()+t.slice(1)};n.prototype.buildGet=function(){var t=this;return function(){return t.formatOutput(t.requestManager.send({method:t.getter}))}},n.prototype.buildAsyncGet=function(){var t=this,e=function(e){t.requestManager.sendAsync({method:t.getter},(function(r,i){e(r,t.formatOutput(i))}))};return e.request=this.request.bind(this),e},n.prototype.request=function(){var t={method:this.getter,params:[],callback:this.extractCallback(Array.prototype.slice.call(arguments))};return t.format=this.formatOutput.bind(this),t},t.exports=n},function(t,e,r){var i=r(14).Buffer;function n(t,e){this._block=i.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}n.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=i.from(t,e));for(var r=this._block,n=this._blockSize,o=t.length,s=this._len,a=0;a=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(4294967295&r)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=n},function(t,e){t.exports=M},function(t,e){t.exports=S},function(t){t.exports=JSON.parse('{"a":"@toruslabs/torus-embed","b":"1.3.0"}')},function(t,e){t.exports=x},function(t,e,r){(function(e){var i=r(60),n=r(84),o=r(199),s=function(){},a=/^v?\.0/.test(e.version),h=function(t){return"function"==typeof t},u=function(t,e,r,u){u=i(u);var f=!1;t.on("close",(function(){f=!0})),n(t,{readable:e,writable:r},(function(t){if(t)return u(t);f=!0,u()}));var l=!1;return function(e){if(!f&&!l)return l=!0,function(t){return!!a&&!!o&&(t instanceof(o.ReadStream||s)||t instanceof(o.WriteStream||s))&&h(t.close)}(t)?t.close(s):function(t){return t.setHeader&&h(t.abort)}(t)?t.abort():h(t.destroy)?t.destroy():void u(e||new Error("stream was destroyed"))}},f=function(t){t()},l=function(t,e){return t.pipe(e)};t.exports=function(){var t,e=Array.prototype.slice.call(arguments),r=h(e[e.length-1]||s)&&e.pop()||s;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var i=e.map((function(n,o){var s=o0,(function(e){t||(t=e),e&&i.forEach(f),s||(i.forEach(f),r(t))}))}));return e.reduce(l)}}).call(this,r(11))},function(t,e,r){(function(t){function r(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===r(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===r(t)},e.isObject=function(t){return"object"==typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===r(t)},e.isError=function(t){return"[object Error]"===r(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=t.isBuffer}).call(this,r(12).Buffer)},function(t,e,r){var i;!function(n){var o,s,a=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,h=Math.ceil,u=Math.floor,f=" not a boolean or binary digit",l="number type has more than 15 significant digits",c="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",d=1e14,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],m=1e9;function v(t){var e=0|t;return t>0||t===e?e:e-1}function g(t){for(var e,r,i=1,n=t.length,o=t[0]+"";iu^r?1:-1;for(a=(h=n.length)<(u=o.length)?h:u,s=0;so[s]^r?1:-1;return h==u?0:h>u^r?1:-1}function b(t,e,r){return(t=x(t))>=e&&t<=r}function w(t){return"[object Array]"==Object.prototype.toString.call(t)}function M(t,e,r){for(var i,n,o=[0],s=0,a=t.length;sr-1&&(null==o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/r|0,o[i]%=r)}return o.reverse()}function _(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function S(t,e){var r,i;if(e<0){for(i="0.";++e;i+="0");t=i+t}else if(++e>(r=t.length)){for(i="0",e-=r;--e;i+="0");t+=i}else e15&&Y(B,l,t),o=!1):f.s=45===u.charCodeAt(0)?(u=u.slice(1),-1):1,u=Z(u,10,e,f.s)}else{if(t instanceof H)return f.s=t.s,f.e=t.e,f.c=(t=t.c)?t.slice():t,void(B=0);if((o="number"==typeof t)&&0*t==0){if(f.s=1/t<0?(t=-t,-1):1,t===~~t){for(i=0,n=t;n>=10;n/=10,i++);return f.e=i,f.c=[t],void(B=0)}u=t+""}else{if(!a.test(u=t+""))return s(f,u,o);f.s=45===u.charCodeAt(0)?(u=u.slice(1),-1):1}}for((i=u.indexOf("."))>-1&&(u=u.replace(".","")),(n=u.search(/e/i))>0?(i<0&&(i=n),i+=+u.slice(n+1),u=u.substring(0,n)):i<0&&(i=u.length),n=0;48===u.charCodeAt(n);n++);for(h=u.length;48===u.charCodeAt(--h););if(u=u.slice(n,h+1))if(h=u.length,o&&L&&h>15&&Y(B,l,f.s*t),(i=i-n-1)>P)f.c=f.e=null;else if(i=0&&(a=F,F=0,t=t.replace(".",""),u=(l=new H(i)).pow(t.length-d),F=a,l.c=M(S(g(u.c),u.e),10,e),l.e=l.c.length),s=a=(f=M(t,i,e)).length;0==f[--a];f.pop());if(!f[0])return"0";if(d<0?--s:(u.c=f,u.e=s,u.s=n,f=(u=r(u,l,p,m,e)).c,h=u.r,s=u.e),d=f[o=s+p+1],a=e/2,h=h||o<0||null!=f[o+1],h=m<4?(null!=d||h)&&(0==m||m==(u.s<0?3:2)):d>a||d==a&&(4==m||h||6==m&&1&f[o-1]||m==(u.s<0?8:7)),o<1||!f[0])t=h?S("1",-p):"0";else{if(f.length=o,h)for(--e;++f[--o]>e;)f[o]=0,o||(++s,f.unshift(1));for(a=f.length;!f[--a];);for(d=0,t="";d<=a;t+=c.charAt(f[d++]));t=S(t,s)}return t}function W(t,e,r,i){var n,o,s,a,h;if(r=null!=r&&q(r,0,8,i,"rounding mode")?0|r:T,!t.c)return t.toString();if(n=t.c[0],s=t.e,null==e)h=g(t.c),h=19==i||24==i&&s<=j?_(h,s):S(h,s);else if(o=(t=J(new H(t),e,r)).e,a=(h=g(t.c)).length,19==i||24==i&&(e<=o||o<=j)){for(;aa){if(--e>0)for(h+=".";e--;h+="0");}else if((e+=o-a)>0)for(o+1==a&&(h+=".");e--;h+="0");return t.s<0&&n?"-"+h:h}function K(t,e){var r,i,n=0;for(w(t[0])&&(t=t[0]),r=new H(t[0]);++nr||t!=x(t))&&Y(i,(n||"decimal places")+(tr?" out of range":" not an integer"),t),!0}function G(t,e,r){for(var i=1,n=e.length;!e[--n];e.pop());for(n=e[0];n>=10;n/=10,i++);return(r=i+14*r-1)>P?t.c=t.e=null:r=10;a/=10,n++);if((o=e-n)<0)o+=14,s=e,c=(f=m[l=0])/v[n-s-1]%10|0;else if((l=h((o+1)/14))>=m.length){if(!i)break t;for(;m.length<=l;m.push(0));f=c=0,n=1,s=(o%=14)-14+1}else{for(f=a=m[l],n=1;a>=10;a/=10,n++);c=(s=(o%=14)-14+n)<0?0:f/v[n-s-1]%10|0}if(i=i||e<0||null!=m[l+1]||(s<0?f:f%v[n-s-1]),i=r<4?(c||i)&&(0==r||r==(t.s<0?3:2)):c>5||5==c&&(4==r||i||6==r&&(o>0?s>0?f/v[n-s]:0:m[l-1])%10&1||r==(t.s<0?8:7)),e<1||!m[0])return m.length=0,i?(e-=t.e+1,m[0]=v[e%14],t.e=-e||0):m[0]=t.e=0,t;if(0==o?(m.length=l,a=1,l--):(m.length=l+1,a=v[14-o],m[l]=s>0?u(f/v[n-s]%v[s])*a:0),i)for(;;){if(0==l){for(o=1,s=m[0];s>=10;s/=10,o++);for(s=m[0]+=a,a=1;s>=10;s/=10,a++);o!=a&&(t.e++,m[0]==d&&(m[0]=1));break}if(m[l]+=a,m[l]!=d)break;m[l--]=0,a=1}for(o=m.length;0===m[--o];m.pop());}t.e>P?t.c=t.e=null:t.er)return null!=(t=n[r++])};return s(e="DECIMAL_PLACES")&&q(t,0,m,2,e)&&(I=0|t),i[e]=I,s(e="ROUNDING_MODE")&&q(t,0,8,2,e)&&(T=0|t),i[e]=T,s(e="EXPONENTIAL_AT")&&(w(t)?q(t[0],-m,0,2,e)&&q(t[1],0,m,2,e)&&(j=0|t[0],C=0|t[1]):q(t,-m,m,2,e)&&(j=-(C=0|(t<0?-t:t)))),i[e]=[j,C],s(e="RANGE")&&(w(t)?q(t[0],-m,-1,2,e)&&q(t[1],1,m,2,e)&&(N=0|t[0],P=0|t[1]):q(t,-m,m,2,e)&&(0|t?N=-(P=0|(t<0?-t:t)):L&&Y(2,e+" cannot be zero",t))),i[e]=[N,P],s(e="ERRORS")&&(t===!!t||1===t||0===t?(B=0,q=(L=!!t)?V:b):L&&Y(2,e+f,t)),i[e]=L,s(e="CRYPTO")&&(t===!!t||1===t||0===t?(D=!1,t&&!D&&L&&Y(2,"crypto unavailable",void 0)):L&&Y(2,e+f,t)),i[e]=D,s(e="MODULO_MODE")&&q(t,0,9,2,e)&&(U=0|t),i[e]=U,s(e="POW_PRECISION")&&q(t,0,m,2,e)&&(F=0|t),i[e]=F,s(e="FORMAT")&&("object"==typeof t?z=t:L&&Y(2,e+" not an object",t)),i[e]=z,i},H.max=function(){return K(arguments,O.lt)},H.min=function(){return K(arguments,O.gt)},H.random=(i=9007199254740992*Math.random()&2097151?function(){return u(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,r,n,o=0,s=[],a=new H(R);if(t=null!=t&&q(t,0,m,14)?0|t:I,r=h(t/14),D&&L&&Y(14,"crypto unavailable",void 0),!o)for(;o=10;n/=10,o++);o<14&&(e-=14-o)}return a.e=e,a.c=s,a}),r=function(){function t(t,e,r){var i,n,o,s,a=0,h=t.length,u=e%1e7,f=e/1e7|0;for(t=t.slice();h--;)a=((n=u*(o=t[h]%1e7)+(i=f*o+(s=t[h]/1e7|0)*u)%1e7*1e7+a)/r|0)+(i/1e7|0)+f*s,t[h]=n%r;return a&&t.unshift(a),t}function e(t,e,r,i){var n,o;if(r!=i)o=r>i?1:-1;else for(n=o=0;ne[n]?1:-1;break}return o}function r(t,e,r,i){for(var n=0;r--;)t[r]-=n,n=t[r]1;t.shift());}return function(i,n,o,s,a){var h,f,l,c,p,m,g,y,b,w,M,_,S,x,k,A,E,B=i.s==n.s?1:-1,O=i.c,R=n.c;if(!(O&&O[0]&&R&&R[0]))return new H(i.s&&n.s&&(O?!R||O[0]!=R[0]:R)?O&&0==O[0]||!R?0*B:B/0:NaN);for(b=(y=new H(B)).c=[],B=o+(f=i.e-n.e)+1,a||(a=d,f=v(i.e/14)-v(n.e/14),B=B/14|0),l=0;R[l]==(O[l]||0);l++);if(R[l]>(O[l]||0)&&f--,B<0)b.push(1),c=!0;else{for(x=O.length,A=R.length,l=0,B+=2,(p=u(a/(R[0]+1)))>1&&(R=t(R,p,a),O=t(O,p,a),A=R.length,x=O.length),S=A,M=(w=O.slice(0,A)).length;M=a/2&&k++;do{if(p=0,(h=e(R,w,A,M))<0){if(_=w[0],A!=M&&(_=_*a+(w[1]||0)),(p=u(_/k))>1)for(p>=a&&(p=a-1),g=(m=t(R,p,a)).length,M=w.length;1==e(m,w,g,M);)p--,r(m,A=10;B/=10,l++);J(y,o+(y.e=l+14*f-1)+1,s,c)}else y.e=f,y.r=+c;return y}}(),n=/^(-?)0([xbo])/i,o=/^([^.]+)\.$/,k=/^\.([^.]+)$/,A=/^-?(Infinity|NaN)$/,E=/^\s*\+|^\s+|\s+$/g,s=function(t,e,r,i){var s,a=r?e:e.replace(E,"");if(A.test(a))t.s=isNaN(a)?null:a<0?-1:1;else{if(!r&&(a=a.replace(n,(function(t,e,r){return s="x"==(r=r.toLowerCase())?16:"b"==r?2:8,i&&i!=s?t:e})),i&&(s=i,a=a.replace(o,"$1").replace(k,"0.$1")),e!=a))return new H(a,s);L&&Y(B,"not a"+(i?" base "+i:"")+" number",e),t.s=null}t.c=t.e=null,B=0},O.absoluteValue=O.abs=function(){var t=new H(this);return t.s<0&&(t.s=1),t},O.ceil=function(){return J(new H(this),this.e+1,2)},O.comparedTo=O.cmp=function(t,e){return B=1,y(this,new H(t,e))},O.decimalPlaces=O.dp=function(){var t,e,r=this.c;if(!r)return null;if(t=14*((e=r.length-1)-v(this.e/14)),e=r[e])for(;e%10==0;e/=10,t--);return t<0&&(t=0),t},O.dividedBy=O.div=function(t,e){return B=3,r(this,new H(t,e),I,T)},O.dividedToIntegerBy=O.divToInt=function(t,e){return B=4,r(this,new H(t,e),0,1)},O.equals=O.eq=function(t,e){return B=5,0===y(this,new H(t,e))},O.floor=function(){return J(new H(this),this.e+1,3)},O.greaterThan=O.gt=function(t,e){return B=6,y(this,new H(t,e))>0},O.greaterThanOrEqualTo=O.gte=function(t,e){return B=7,1===(e=y(this,new H(t,e)))||0===e},O.isFinite=function(){return!!this.c},O.isInteger=O.isInt=function(){return!!this.c&&v(this.e/14)>this.c.length-2},O.isNaN=function(){return!this.s},O.isNegative=O.isNeg=function(){return this.s<0},O.isZero=function(){return!!this.c&&0==this.c[0]},O.lessThan=O.lt=function(t,e){return B=8,y(this,new H(t,e))<0},O.lessThanOrEqualTo=O.lte=function(t,e){return B=9,-1===(e=y(this,new H(t,e)))||0===e},O.minus=O.sub=function(t,e){var r,i,n,o,s=this,a=s.s;if(B=10,e=(t=new H(t,e)).s,!a||!e)return new H(NaN);if(a!=e)return t.s=-e,s.plus(t);var h=s.e/14,u=t.e/14,f=s.c,l=t.c;if(!h||!u){if(!f||!l)return f?(t.s=-e,t):new H(l?s:NaN);if(!f[0]||!l[0])return l[0]?(t.s=-e,t):new H(f[0]?s:3==T?-0:0)}if(h=v(h),u=v(u),f=f.slice(),a=h-u){for((o=a<0)?(a=-a,n=f):(u=h,n=l),n.reverse(),e=a;e--;n.push(0));n.reverse()}else for(i=(o=(a=f.length)<(e=l.length))?a:e,a=e=0;e0)for(;e--;f[r++]=0);for(e=d-1;i>a;){if(f[--i]0?(s=o,r=h):(n=-n,r=a),r.reverse();n--;r.push(0));r.reverse()}for((n=a.length)-(e=h.length)<0&&(r=h,h=a,a=r,e=n),n=0;e;)n=(a[--e]=a[e]+h[e]+n)/d|0,a[e]%=d;return n&&(a.unshift(n),++s),G(t,a,s)},O.precision=O.sd=function(t){var e,r,i=this,n=i.c;if(null!=t&&t!==!!t&&1!==t&&0!==t&&(L&&Y(13,"argument"+f,t),t!=!!t&&(t=null)),!n)return null;if(e=14*(r=n.length-1)+1,r=n[r]){for(;r%10==0;r/=10,e--);for(r=n[0];r>=10;r/=10,e++);}return t&&i.e+1>e&&(e=i.e+1),e},O.round=function(t,e){var r=new H(this);return(null==t||q(t,0,m,15))&&J(r,~~t+this.e+1,null!=e&&q(e,0,8,15,"rounding mode")?0|e:T),r},O.shift=function(t){var e=this;return q(t,-9007199254740991,9007199254740991,16,"argument")?e.times("1e"+x(t)):new H(e.c&&e.c[0]&&(t<-9007199254740991||t>9007199254740991)?e.s*(t<0?0:1/0):e)},O.squareRoot=O.sqrt=function(){var t,e,i,n,o,s=this,a=s.c,h=s.s,u=s.e,f=I+4,l=new H("0.5");if(1!==h||!a||!a[0])return new H(!h||h<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(h=Math.sqrt(+s))||h==1/0?(((e=g(a)).length+u)%2==0&&(e+="0"),h=Math.sqrt(e),u=v((u+1)/2)-(u<0||u%2),i=new H(e=h==1/0?"1e"+u:(e=h.toExponential()).slice(0,e.indexOf("e")+1)+u)):i=new H(h+""),i.c[0])for((h=(u=i.e)+f)<3&&(h=0);;)if(o=i,i=l.times(o.plus(r(s,o,f,1))),g(o.c).slice(0,h)===(e=g(i.c)).slice(0,h)){if(i.e=0;){for(r=0,c=w[n]%1e7,p=w[n]/1e7|0,o=n+(s=h);o>n;)r=((u=c*(u=b[--s]%1e7)+(a=p*u+(f=b[s]/1e7|0)*c)%1e7*1e7+m[o]+r)/g|0)+(a/1e7|0)+p*f,m[o--]=u%g;m[o]=r}return r?++i:m.shift(),G(t,m,i)},O.toDigits=function(t,e){var r=new H(this);return t=null!=t&&q(t,1,m,18,"precision")?0|t:null,e=null!=e&&q(e,0,8,18,"rounding mode")?0|e:T,t?J(r,t,e):r},O.toExponential=function(t,e){return W(this,null!=t&&q(t,0,m,19)?1+~~t:null,e,19)},O.toFixed=function(t,e){return W(this,null!=t&&q(t,0,m,20)?~~t+this.e+1:null,e,20)},O.toFormat=function(t,e){var r=W(this,null!=t&&q(t,0,m,21)?~~t+this.e+1:null,e,21);if(this.c){var i,n=r.split("."),o=+z.groupSize,s=+z.secondaryGroupSize,a=z.groupSeparator,h=n[0],u=n[1],f=this.s<0,l=f?h.slice(1):h,c=l.length;if(s&&(i=o,o=s,s=i,c-=i),o>0&&c>0){for(i=c%o||o,h=l.substr(0,i);i0&&(h+=a+l.slice(i)),f&&(h="-"+h)}r=u?h+z.decimalSeparator+((s=+z.fractionGroupSize)?u.replace(new RegExp("\\d{"+s+"}\\B","g"),"$&"+z.fractionGroupSeparator):u):h}return r},O.toFraction=function(t){var e,i,n,o,s,a,h,u,f,l=L,c=this,d=c.c,m=new H(R),v=i=new H(R),y=h=new H(R);if(null!=t&&(L=!1,a=new H(t),L=l,(l=a.isInt())&&!a.lt(R)||(L&&Y(22,"max denominator "+(l?"out of range":"not an integer"),t),t=!l&&a.c&&J(a,a.e+1,1).gte(R)?a:null)),!d)return c.toString();for(f=g(d),o=m.e=f.length-c.e-1,m.c[0]=p[(s=o%14)<0?14+s:s],t=!t||a.cmp(m)>0?o>0?m:v:a,s=P,P=1/0,a=new H(f),h.c[0]=0;u=r(a,m,0,1),1!=(n=i.plus(u.times(y))).cmp(t);)i=y,y=n,v=h.plus(u.times(n=v)),h=n,m=a.minus(u.times(n=m)),a=n;return n=r(t.minus(i),y,0,1),h=h.plus(n.times(v)),i=i.plus(n.times(y)),h.s=v.s=c.s,e=r(v,y,o*=2,T).minus(c).abs().cmp(r(h,i,o,T).minus(c).abs())<1?[v.toString(),y.toString()]:[h.toString(),i.toString()],P=s,e},O.toNumber=function(){var t=this;return+t||(t.s?0*t.s:NaN)},O.toPower=O.pow=function(t){var e,r,i=u(t<0?-t:+t),n=this;if(!q(t,-9007199254740991,9007199254740991,23,"exponent")&&(!isFinite(t)||i>9007199254740991&&(t/=0)||parseFloat(t)!=t&&!(t=NaN)))return new H(Math.pow(+n,t));for(e=F?h(F/14+2):0,r=new H(R);;){if(i%2){if(!(r=r.times(n)).c)break;e&&r.c.length>e&&(r.c.length=e)}if(!(i=u(i/2)))break;n=n.times(n),e&&n.c&&n.c.length>e&&(n.c.length=e)}return t<0&&(r=R.div(r)),e?J(r,F,T):r},O.toPrecision=function(t,e){return W(this,null!=t&&q(t,1,m,24,"precision")?0|t:null,e,24)},O.toString=function(t){var e,r=this,i=r.s,n=r.e;return null===n?i?(e="Infinity",i<0&&(e="-"+e)):e="NaN":(e=g(r.c),e=null!=t&&q(t,2,64,25,"base")?Z(S(e,n),0|t,10,i):n<=j||n>=C?_(e,n):S(e,n),i<0&&r.c[0]&&(e="-"+e)),e},O.truncated=O.trunc=function(){return J(new H(this),this.e+1,1)},O.valueOf=O.toJSON=function(){return this.toString()},null!=e&&H.config(e),H}(),void 0===(i=function(){return o}.call(e,r,e,t))||(t.exports=i)}()},function(t,e,r){var i=r(118),n=r(76);t.exports=function(t,e){return e&&"hex"===e.encoding&&(t.length>2&&"0x"===t.substr(0,2)&&(t=t.substr(2)),t=i.enc.Hex.parse(t)),n(t,{outputLength:256}).toString()}},function(t,e,r){var i=r(58),n=i.EthereumRpcError,o=i.EthereumProviderError,s=r(83),a=s.serializeError,h=s.getMessageFromCode,u=r(191),f=r(59);t.exports={ethErrors:u,EthereumRpcError:n,EthereumProviderError:o,serializeError:a,getMessageFromCode:h,ERROR_CODES:f}},function(t,e,r){e.a={errors:{invalidParams:function(){return"MetaMask: Invalid request parameters. Please use ethereum.send(method: string, params: Array). For more details, see: https://eips.ethereum.org/EIPS/eip-1193"},sendSiteMetadata:function(){return"MetaMask: Failed to send site metadata. This is an internal error, please report this bug."},unsupportedSync:function(t){return"MetaMask: The MetaMask Web3 object does not support synchronous methods like ".concat(t," without a callback parameter.")}},warnings:{sendSyncDeprecation:'MetaMask: "ethereum.send(...)" will return result-resolving Promises for all methods starting in Q1 2020. For more information, see: https://medium.com/metamask/deprecating-synchronous-provider-methods-82f0edbc874b',enableDeprecation:'MetaMask: \'"ethereum.enable()" is deprecated and may be removed in the future. Please use "ethereum.send(\'eth_requestAccounts\')" instead. For more information, see: https://eips.ethereum.org/EIPS/eip-1102',isConnectedDeprecation:'MetaMask: "ethereum.isConnected()" is deprecated and may be removed in the future. Please listen for the relevant events instead. For more information, see: https://eips.ethereum.org/EIPS/eip-1193',sendAsyncDeprecation:'MetaMask: "ethereum.sendAsync(...)" is deprecated and may be removed in the future. Please use "ethereum.send(method: string, params: Array)" instead. For more information, see: https://eips.ethereum.org/EIPS/eip-1193',experimentalMethods:'MetaMask: "ethereum._metamask" exposes non-standard, experimental methods. They may be removed or changed without warning.'}}},function(t,e,r){(function(e){void 0===e||!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,r,i,n){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick((function(){t.call(null,r)}));case 3:return e.nextTick((function(){t.call(null,r,i)}));case 4:return e.nextTick((function(){t.call(null,r,i,n)}));default:for(o=new Array(a-1),s=0;s0&&s.length>n&&!s.warned){s.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=t,h.type=e,h.count=s.length,a=h,console&&console.warn&&console.warn(a)}return t}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=c.bind(i);return n.listener=r,i.wrapFn=n,n}function p(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var h=n[t];if(void 0===h)return!1;if("function"==typeof h)o(h,this,e);else{var u=h.length,f=v(h,u);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},a.prototype.listeners=function(t){return p(this,t,!0)},a.prototype.rawListeners=function(t){return p(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},function(t,e,r){var i,n,o,s,a,h;t.exports=(n=(i=h=r(1)).lib,o=n.Base,s=n.WordArray,(a=i.x64={}).Word=o.extend({init:function(t,e){this.high=t,this.low=e}}),a.WordArray=o.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:8*t.length},toX32:function(){for(var t=this.words,e=t.length,r=[],i=0;i=e&&i<=r?i-e+10:t})).join("")},s=function(t){for(var e,r=t;r.length>2;)e=r.slice(0,9),r=parseInt(e,10)%97+r.slice(e.length);return parseInt(r,10)%97},a=function(t){this._iban=t};a.fromAddress=function(t){var e=new i(t,16).toString(36),r=n(e,15);return a.fromBban(r.toUpperCase())},a.fromBban=function(t){var e=("0"+(98-s(o("XE00"+t)))).slice(-2);return new a("XE"+e+t)},a.createIndirect=function(t){return a.fromBban("ETH"+t.institution+t.identifier)},a.isValid=function(t){return new a(t).isValid()},a.prototype.isValid=function(){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(this._iban)&&1===s(o(this._iban))},a.prototype.isDirect=function(){return 34===this._iban.length||35===this._iban.length},a.prototype.isIndirect=function(){return 20===this._iban.length},a.prototype.checksum=function(){return this._iban.substr(2,2)},a.prototype.institution=function(){return this.isIndirect()?this._iban.substr(7,4):""},a.prototype.client=function(){return this.isIndirect()?this._iban.substr(11):""},a.prototype.address=function(){if(this.isDirect()){var t=this._iban.substr(4),e=new i(t,36);return n(e.toString(16),20)}return""},a.prototype.toString=function(){return this._iban},t.exports=a},function(t,e,r){var i=r(18),n=r(5),o=function(t){return null==t?null:0===(t=String(t)).indexOf("0x")?t:n.fromUtf8(t)},s=function(t,e){n.isString(t.options)||t.get((function(t,r){t&&e(t),n.isArray(r)&&r.forEach((function(t){e(null,t)}))}))},a=function(t){t.requestManager.startPolling({method:t.implementation.poll.call,params:[t.filterId]},t.filterId,(function(e,r){if(e)return t.callbacks.forEach((function(t){t(e)}));n.isArray(r)&&r.forEach((function(e){e=t.formatter?t.formatter(e):e,t.callbacks.forEach((function(t){t(null,e)}))}))}),t.stopWatching.bind(t))},h=function(t,e,r,h,u,f,l){var c=this,d={};return h.forEach((function(t){t.setRequestManager(r),t.attachToObject(d)})),this.requestManager=r,this.options=function(t,e){if(n.isString(t))return t;switch(t=t||{},e){case"eth":return t.topics=t.topics||[],t.topics=t.topics.map((function(t){return n.isArray(t)?t.map(o):o(t)})),{topics:t.topics,from:t.from,to:t.to,address:t.address,fromBlock:i.inputBlockNumberFormatter(t.fromBlock),toBlock:i.inputBlockNumberFormatter(t.toBlock)};case"shh":return t}}(t,e),this.implementation=d,this.filterId=null,this.callbacks=[],this.getLogsCallbacks=[],this.pollFilters=[],this.formatter=u,this.implementation.newFilter(this.options,(function(t,e){if(t)c.callbacks.forEach((function(e){e(t)})),"function"==typeof l&&l(t);else if(c.filterId=e,c.getLogsCallbacks.forEach((function(t){c.get(t)})),c.getLogsCallbacks=[],c.callbacks.forEach((function(t){s(c,t)})),c.callbacks.length>0&&a(c),"function"==typeof f)return c.watch(f)})),this};h.prototype.watch=function(t){return this.callbacks.push(t),this.filterId&&(s(this,t),a(this)),this},h.prototype.stopWatching=function(t){if(this.requestManager.stopPolling(this.filterId),this.callbacks=[],!t)return this.implementation.uninstallFilter(this.filterId);this.implementation.uninstallFilter(this.filterId,t)},h.prototype.get=function(t){var e=this;if(!n.isFunction(t)){if(null===this.filterId)throw new Error("Filter ID Error: filter().get() can't be chained synchronous, please provide a callback for the get() method.");return this.implementation.getLogs(this.filterId).map((function(t){return e.formatter?e.formatter(t):t}))}return null===this.filterId?this.getLogsCallbacks.push(t):this.implementation.getLogs(this.filterId,(function(r,i){r?t(r):t(null,i.map((function(t){return e.formatter?e.formatter(t):t})))})),this},t.exports=h},function(t,e,r){var i=r(21);t.exports={eth:function(){return[new i({name:"newFilter",call:function(t){switch(t[0]){case"latest":return t.shift(),this.params=0,"eth_newBlockFilter";case"pending":return t.shift(),this.params=0,"eth_newPendingTransactionFilter";default:return"eth_newFilter"}},params:1}),new i({name:"uninstallFilter",call:"eth_uninstallFilter",params:1}),new i({name:"getLogs",call:"eth_getFilterLogs",params:1}),new i({name:"poll",call:"eth_getFilterChanges",params:1})]},shh:function(){return[new i({name:"newFilter",call:"shh_newMessageFilter",params:1}),new i({name:"uninstallFilter",call:"shh_deleteMessageFilter",params:1}),new i({name:"getLogs",call:"shh_getFilterMessages",params:1}),new i({name:"poll",call:"shh_getFilterMessages",params:1})]}}},function(t,e){t.exports=E},function(t,e){t.exports=O},function(t,e,r){var i=r(17).Duplex,n=r(84),o=r(60),s={},l=function(t){Object(u.a)(r,t);var e=Object(f.a)(r);function r(t){var i,n=t.parent,o=t.name;return Object(a.a)(this,r),(i=e.call(this,{objectMode:!0}))._parent=n,i._name=o,i}return Object(h.a)(r,[{key:"_read",value:function(){}},{key:"_write",value:function(t,e,r){this._parent.push({name:this._name,data:t}),r()}}]),r}(i);t.exports=function(t){Object(u.a)(r,t);var e=Object(f.a)(r);function r(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(a.a)(this,r),(t=e.call(this,Object.assign({},i,{objectMode:!0})))._substreams={},t}return Object(h.a)(r,[{key:"createStream",value:function(t){if(!t)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[t])throw new Error('ObjectMultiplex - Substream for name "${name}" already exists');var e=new l({parent:this,name:t});return this._substreams[t]=e,function(t,e){var r=o(e);n(t,{readable:!1},r),n(t,{writable:!1},r)}(this,(function(t){e.destroy(t)})),e}},{key:"ignoreStream",value:function(t){if(!t)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[t])throw new Error('ObjectMultiplex - Substream for name "${name}" already exists');this._substreams[t]=s}},{key:"_read",value:function(){}},{key:"_write",value:function(t,e,r){var i=t.name,n=t.data;if(!i)return console.warn('ObjectMultiplex - malformed chunk without name "'.concat(t,'"')),r();var o=this._substreams[i];if(!o)return console.warn('ObjectMultiplex - orphaned data for stream "'.concat(i,'"')),r();o!==s&&o.push(n),r()}}]),r}(i)},function(t,e){t.exports=A},function(t,e,r){var i=r(12),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=s),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},function(t,e,r){(function(e,i,n){var o=r(38);function s(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(void 0),i=i.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=y;var a,h=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?i:o.nextTick;y.WritableState=g;var u=Object.create(r(33));u.inherits=r(4);var f,l={deprecate:r(111)},c=r(68),d=r(49).Buffer,p=n.Uint8Array||function(){},m=r(69);function v(){}function g(t,e){a=a||r(19),t=t||{};var i=e instanceof a;this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var n=t.highWaterMark,u=t.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i&&(u||0===u)?u:f,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 l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,i,n){--e.pendingcb,r?(o.nextTick(n,i),o.nextTick(x,t,e),t._writableState.errorEmitted=!0,t.emit("error",i)):(n(i),t._writableState.errorEmitted=!0,t.emit("error",i),x(t,e))}(t,r,i,e,n);else{var s=_(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||M(t,r),i?h(w,t,r,s,n):w(t,r,s,n)}}(e,t)},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 s(this)}function y(t){if(a=a||r(19),!(f.call(y,this)||this instanceof a))return new y(t);this._writableState=new g(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),c.call(this)}function b(t,e,r,i,n,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function w(t,e,r,i){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,i(),x(t,e)}function M(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,n=new Array(i),o=e.corkedRequestsFree;o.entry=r;for(var a=0,h=!0;r;)n[a]=r,r.isBuf||(h=!1),r=r.next,a+=1;n.allBuffers=h,b(t,e,!0,e.length,n,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new s(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,f=r.encoding,l=r.callback;if(b(t,e,!1,e.objectMode?1:u.length,u,f,l),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function _(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function S(t,e){t._final((function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),x(t,e)}))}function x(t,e){var r=_(e);return r&&(function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(S,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}u.inherits(y,c),g.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(g.prototype,"buffer",{get:l.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(t){return!!f.call(this,t)||this===y&&t&&t._writableState instanceof g}})):f=function(t){return t instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(t,e,r){var i,n=this._writableState,s=!1,a=!n.objectMode&&(i=t,d.isBuffer(i)||i instanceof p);return a&&!d.isBuffer(t)&&(t=function(t){return d.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=v),n.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),o.nextTick(e,r)}(this,r):(a||function(t,e,r,i){var n=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),o.nextTick(i,s),n=!1),n}(this,n,t,r))&&(n.pendingcb++,s=function(t,e,r,i,n,o){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=d.from(e,r)),e}(e,i,n);i!==s&&(r=!0,n="buffer",i=s)}var a=e.objectMode?1:i.length;e.length+=a;var h=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(t,e,r){var i=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||function(t,e,r){e.ending=!0,x(t,e),r&&(e.finished?o.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,i,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,r(11),r(70).setImmediate,r(7))},function(t,e,r){var i=r(112).Buffer,n=i.isEncoding||function(t){switch((t=""+t)&&t.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}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===n||!n(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=h,this.end=u,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=f,this.end=l,e=3;break;default:return this.write=c,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function h(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function c(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(n>0&&(t.lastNeed=n-1),n):--i=0?(n>0&&(t.lastNeed=n-2),n):--i=0?(n>0&&(2===n?n=0:t.lastNeed=n-3),n):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,r){var i,n,o,s,a,h,u,f;t.exports=(n=(i=f=r(1)).lib,o=n.WordArray,s=n.Hasher,a=i.algo,h=[],u=a.SHA1=s.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],o=r[2],s=r[3],a=r[4],u=0;u<80;u++){if(u<16)h[u]=0|t[e+u];else{var f=h[u-3]^h[u-8]^h[u-14]^h[u-16];h[u]=f<<1|f>>>31}var l=(i<<5|i>>>27)+a+h[u];l+=u<20?1518500249+(n&o|~n&s):u<40?1859775393+(n^o^s):u<60?(n&o|n&s|o&s)-1894007588:(n^o^s)-899497514,a=s,s=o,o=n<<30|n>>>2,n=i,i=l}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=Math.floor(r/4294967296),e[15+(i+64>>>9<<4)]=r,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=s.clone.call(this);return t._hash=this._hash.clone(),t}}),i.SHA1=s._createHelper(u),i.HmacSHA1=s._createHmacHelper(u),f.SHA1)},function(t,e,r){var i,n,o;t.exports=(n=(i=r(1)).lib.Base,o=i.enc.Utf8,void(i.algo.HMAC=n.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=o.parse(e));var r=t.blockSize,i=4*r;e.sigBytes>i&&(e=t.finalize(e)),e.clamp();for(var n=this._oKey=e.clone(),s=this._iKey=e.clone(),a=n.words,h=s.words,u=0;u",'"',"`"," ","\r","\n","\t"]),f=["'"].concat(u),l=["%","/","?",";","#"].concat(f),c=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=r(179);function b(t,e,r){if(t&&n.isObject(t)&&t instanceof o)return t;var i=new o;return i.parse(t,e,r),i}o.prototype.parse=function(t,e,r){if(!n.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),a=-1!==o&&o127?j+="x":j+=T[C];if(!j.match(d)){var P=R.slice(0,E),L=R.slice(E+1),q=T.match(p);q&&(P.push(q[1]),L.unshift(q[2])),L.length&&(b="/"+L.join(".")+b),this.hostname=P.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=i.toASCII(this.hostname));var D=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+D,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[_])for(E=0,I=f.length;E0)&&r.host.split("@"))&&(r.auth=O.shift(),r.host=r.hostname=O.shift())),r.search=t.search,r.query=t.query,n.isNull(r.pathname)&&n.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var k=S.slice(-1)[0],A=(r.host||t.host||S.length>1)&&("."===k||".."===k)||""===k,E=0,B=S.length;B>=0;B--)"."===(k=S[B])?S.splice(B,1):".."===k?(S.splice(B,1),E++):E&&(S.splice(B,1),E--);if(!M&&!_)for(;E--;E)S.unshift("..");!M||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),A&&"/"!==S.join("/").substr(-1)&&S.push("");var O,R=""===S[0]||S[0]&&"/"===S[0].charAt(0);return x&&(r.hostname=r.host=R?"":S.length?S.shift():"",(O=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=O.shift(),r.host=r.hostname=O.shift())),(M=M||r.host&&S.length)&&!R&&S.unshift(""),S.length?r.pathname=S.join("/"):(r.pathname=null,r.path=null),n.isNull(r.pathname)&&n.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){this.listeners={}}return t.prototype.addEventListener=function(t,e){t=t.toLowerCase(),this.listeners[t]=this.listeners[t]||[],this.listeners[t].push(e.handleEvent||e)},t.prototype.removeEventListener=function(t,e){if(t=t.toLowerCase(),this.listeners[t]){var r=this.listeners[t].indexOf(e.handleEvent||e);r<0||this.listeners[t].splice(r,1)}},t.prototype.dispatchEvent=function(t){var e=t.type.toLowerCase();if(t.target=this,this.listeners[e])for(var r=0,i=this.listeners[e];r=1e3&&t<=4999}(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');return e.call(this,t,i,n)}return r}(n)}},function(t){t.exports=JSON.parse('{"rpc":{"invalidInput":-32000,"resourceNotFound":-32001,"resourceUnavailable":-32002,"transactionRejected":-32003,"methodNotSupported":-32004,"parse":-32700,"invalidRequest":-32600,"methodNotFound":-32601,"invalidParams":-32602,"internal":-32603},"provider":{"userRejectedRequest":4001,"unauthorized":4100,"unsupportedMethod":4200}}')},function(t,e,r){var i=r(194);function n(t){var e=function e(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function o(t){var e=function e(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}t.exports=i(n),t.exports.strict=i(o),n.proto=n((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return n(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return o(this)},configurable:!0})}))},function(t,e,r){t.exports=n;var i=r(39).EventEmitter;function n(){i.call(this)}r(4)(n,i),n.Readable=r(17),n.Writable=r(195),n.Duplex=r(196),n.Transform=r(197),n.PassThrough=r(198),n.Stream=n,n.prototype.pipe=function(t,e){var r=this;function n(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",n),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",h));var s=!1;function a(){s||(s=!0,t.end())}function h(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function u(t){if(f(),0===i.listenerCount(this,"error"))throw t}function f(){r.removeListener("data",n),t.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",h),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),t.removeListener("close",f)}return r.on("error",u),t.on("error",u),r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t}},function(t,e,r){var i=r(17).Duplex,n=r(72).inherits;function o(t){i.call(this,{objectMode:!0}),this._name=t.name,this._target=t.target,this._targetWindow=t.targetWindow||window,this._origin=t.targetWindow?"*":location.origin,this._init=!1,this._haveSyn=!1,window.addEventListener("message",this._onMessage.bind(this),!1),this._write("SYN",null,s),this.cork()}function s(){}t.exports=o,n(o,i),o.prototype._onMessage=function(t){var e=t.data;if(("*"===this._origin||t.origin===this._origin)&&t.source===this._targetWindow&&"object"==typeof e&&e.target===this._name&&e.data)if(this._init)try{this.push(e.data)}catch(t){this.emit("error",t)}else"SYN"===e.data?(this._haveSyn=!0,this._write("ACK",null,s)):"ACK"===e.data&&(this._init=!0,this._haveSyn||this._write("ACK",null,s),this.uncork())},o.prototype._read=s,o.prototype._write=function(t,e,r){var i={target:this._target,data:t};this._targetWindow.postMessage(i,this._origin),r()}},function(t,e,r){var i=r(116);"undefined"!=typeof window&&void 0===window.Web3&&(window.Web3=i),t.exports=i},function(t,e){t.exports=k},function(t,e,r){var i=r(28),n=r.n(i),o=r(29),s=r.n(o),a=r(45),h=r.n(a),u=r(31),f=r.n(u),l=r(46),c=r.n(l),d=r(22);function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}var m=function(t){c()(i,t);var e,r=(e=i,function(){var t,r=f()(e);if(p()){var i=f()(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return h()(this,t)});function i(t){var e,o=t.url,s=t.target,a=t.features;return n()(this,i),(e=r.call(this)).url=o,e.target=s||"_blank",e.features=a||"directories=0,titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=700,width=1200",e.window=void 0,e.windowTimer={},e.iClosedWindow=!1,e._setupTimer(),e}return s()(i,[{key:"_setupTimer",value:function(){var t=this;this.windowTimer=setInterval((function(){t.window&&t.window.closed&&(clearInterval(t.windowTimer),t.iClosedWindow||t.emit("close"),t.iClosedWindow=!1,t.window=void 0),void 0===t.window&&clearInterval(t.windowTimer)}),500)}},{key:"open",value:function(){this.window=window.open(this.url,this.target,this.features)}},{key:"close",value:function(){this.iClosedWindow=!0,this.window&&this.window.close()}}]),i}(r.n(d).a);e.a=m},function(t,e,r){(function(e,i){var n=r(38);t.exports=b;var o,s=r(67);b.ReadableState=y,r(39).EventEmitter;var a=function(t,e){return t.listeners(e).length},h=r(68),u=r(49).Buffer,f=e.Uint8Array||function(){},l=Object.create(r(33));l.inherits=r(4);var c=r(107),d=void 0;d=c&&c.debuglog?c.debuglog("stream"):function(){};var p,m=r(108),v=r(69);l.inherits(b,h);var g=["error","close","destroy","pause","resume"];function y(t,e){t=t||{};var i=e instanceof(o=o||r(19));this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,s=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,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.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=r(51).StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function b(t){if(o=o||r(19),!(this instanceof b))return new b(t);this._readableState=new y(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),h.call(this)}function w(t,e,r,i,n){var o,s=t._readableState;return null===e?(s.reading=!1,function(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,S(t)}}(t,s)):(n||(o=function(t,e){var r,i;return i=e,u.isBuffer(i)||i instanceof f||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(s,e)),o?t.emit("error",o):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),i?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):M(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?M(t,s,e,!1):k(t,s)):M(t,s,e,!1))):i||(s.reading=!1)),function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=8388608?t=8388608:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function S(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(d("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?n.nextTick(x,t):x(t))}function x(t){d("emit readable"),t.emit("readable"),O(t)}function k(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(A,t,e))}function A(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var i;return to.length?o.length:t;if(s===o.length?n+=o:n+=o.slice(0,t),0==(t-=s)){s===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++i}return e.length-=i,n}(t,e):function(t,e){var r=u.allocUnsafe(t),i=e.head,n=1;for(i.data.copy(r),t-=i.data.length;i=i.next;){var o=i.data,s=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,s),0==(t-=s)){s===o.length?(++n,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=o.slice(s));break}++n}return e.length-=n,r}(t,e),i}(t,e.buffer,e.decoder),r);var r}function I(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,n.nextTick(T,e,t))}function T(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function j(t,e){for(var r=0,i=t.length;r=e.highWaterMark||e.ended))return d("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?I(this):S(this),null;if(0===(t=_(t,e))&&e.ended)return 0===e.length&&I(this),null;var i,n=e.needReadable;return d("need readable",n),(0===e.length||e.length-t0?R(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&I(this)),null!==i&&this.emit("data",i),i},b.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(t,e){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,e);var h=e&&!1===e.end||t===i.stdout||t===i.stderr?y:u;function u(){d("onend"),t.end()}o.endEmitted?n.nextTick(h):r.once("end",h),t.on("unpipe",(function e(i,n){d("onunpipe"),i===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d("cleanup"),t.removeListener("close",v),t.removeListener("finish",g),t.removeListener("drain",f),t.removeListener("error",m),t.removeListener("unpipe",e),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",p),l=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}));var f=function(t){return function(){var e=t._readableState;d("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,O(t))}}(r);t.on("drain",f);var l=!1,c=!1;function p(e){d("ondata"),c=!1,!1!==t.write(e)||c||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==j(o.pipes,t))&&!l&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,c=!0),r.pause())}function m(e){d("onerror",e),y(),t.removeListener("error",m),0===a(t,"error")&&t.emit("error",e)}function v(){t.removeListener("finish",g),y()}function g(){d("onfinish"),t.removeListener("close",v),y()}function y(){d("unpipe"),r.unpipe(t)}return r.on("data",p),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?s(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",m),t.once("close",v),t.once("finish",g),t.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),t},b.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(110),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(7))},function(t,e,r){t.exports=s;var i=r(19),n=Object.create(r(33));function o(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(!i)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=e&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length=o)return t;switch(t){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(t){return"[Circular]"}default:return t}})),h=i[r];r=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),p(r)?i.showHidden=r:r&&e._extend(i,r),y(i.showHidden)&&(i.showHidden=!1),y(i.depth)&&(i.depth=2),y(i.colors)&&(i.colors=!1),y(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=h),f(i,t,i.depth)}function h(t,e){var r=a.styles[e];return r?"\x1b["+a.colors[r][0]+"m"+t+"\x1b["+a.colors[r][1]+"m":t}function u(t,e){return t}function f(t,r,i){if(t.customInspect&&r&&S(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(i,t);return g(n)||(n=f(t,n,i)),n}var o=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(g(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return v(e)?t.stylize(""+e,"number"):p(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}(t,r);if(o)return o;var s=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),_(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(r);if(0===s.length){if(S(r)){var h=r.name?": "+r.name:"";return t.stylize("[Function"+h+"]","special")}if(b(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(M(r))return t.stylize(Date.prototype.toString.call(r),"date");if(_(r))return l(r)}var u,w="",x=!1,k=["{","}"];return d(r)&&(x=!0,k=["[","]"]),S(r)&&(w=" [Function"+(r.name?": "+r.name:"")+"]"),b(r)&&(w=" "+RegExp.prototype.toString.call(r)),M(r)&&(w=" "+Date.prototype.toUTCString.call(r)),_(r)&&(w=" "+l(r)),0!==s.length||x&&0!=r.length?i<0?b(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),u=x?function(t,e,r,i,n){for(var o=[],s=0,a=e.length;s60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(u,w,k)):k[0]+w+k[1]}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function c(t,e,r,i,n,o){var s,a,h;if((h=Object.getOwnPropertyDescriptor(e,n)||{value:e[n]}).get?a=h.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):h.set&&(a=t.stylize("[Setter]","special")),B(i,n)||(s="["+n+"]"),a||(t.seen.indexOf(h.value)<0?(a=m(r)?f(t,h.value,null):f(t,h.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),y(s)){if(o&&n.match(/^\d+$/))return a;(s=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function d(t){return Array.isArray(t)}function p(t){return"boolean"==typeof t}function m(t){return null===t}function v(t){return"number"==typeof t}function g(t){return"string"==typeof t}function y(t){return void 0===t}function b(t){return w(t)&&"[object RegExp]"===x(t)}function w(t){return"object"==typeof t&&null!==t}function M(t){return w(t)&&"[object Date]"===x(t)}function _(t){return w(t)&&("[object Error]"===x(t)||t instanceof Error)}function S(t){return"function"==typeof t}function x(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(r){if(y(o)&&(o=t.env.NODE_DEBUG||""),r=r.toUpperCase(),!s[r])if(new RegExp("\\b"+r+"\\b","i").test(o)){var i=t.pid;s[r]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",r,i,t)}}else s[r]=function(){};return s[r]},e.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=d,e.isBoolean=p,e.isNull=m,e.isNullOrUndefined=function(t){return null==t},e.isNumber=v,e.isString=g,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=y,e.isRegExp=b,e.isObject=w,e.isDate=M,e.isError=_,e.isFunction=S,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(114);var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E(){var t=new Date,e=[k(t.getHours()),k(t.getMinutes()),k(t.getSeconds())].join(":");return[t.getDate(),A[t.getMonth()],e].join(" ")}function B(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",E(),e.format.apply(e,arguments))},e.inherits=r(115),e._extend=function(t,e){if(!e||!w(e))return t;for(var r=Object.keys(e),i=r.length;i--;)t[r[i]]=e[r[i]];return t};var O="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function R(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(O&&t[O]){var e;if("function"!=typeof(e=t[O]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,O,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,i=new Promise((function(t,i){e=t,r=i})),n=[],o=0;o>>7)^(p<<14|p>>>18)^p>>>3,v=u[d-2],g=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;u[d]=m+u[d-7]+g+u[d-16]}var y=i&n^i&o^n&o,b=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),w=c+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&f^~a&l)+h[d]+u[d];c=l,l=f,f=a,a=s+w|0,s=o,o=n,n=i,i=w+(b+y)|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+f|0,r[6]=r[6]+l|0,r[7]=r[7]+c|0},_doFinalize:function(){var e=this._data,r=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;return r[n>>>5]|=128<<24-n%32,r[14+(n+64>>>9<<4)]=t.floor(i/4294967296),r[15+(n+64>>>9<<4)]=i,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=o._createHelper(f),e.HmacSHA256=o._createHmacHelper(f)}(Math),i.SHA256)},function(t,e,r){var i;t.exports=(i=r(1),r(40),function(){var t=i,e=t.lib.Hasher,r=t.x64,n=r.Word,o=r.WordArray,s=t.algo;function a(){return n.create.apply(n,arguments)}var h=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],u=[];!function(){for(var t=0;t<80;t++)u[t]=a()}();var f=s.SHA512=e.extend({_doReset:function(){this._hash=new o.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],o=r[2],s=r[3],a=r[4],f=r[5],l=r[6],c=r[7],d=i.high,p=i.low,m=n.high,v=n.low,g=o.high,y=o.low,b=s.high,w=s.low,M=a.high,_=a.low,S=f.high,x=f.low,k=l.high,A=l.low,E=c.high,B=c.low,O=d,R=p,I=m,T=v,j=g,C=y,N=b,P=w,L=M,q=_,D=S,U=x,F=k,z=A,H=E,Z=B,W=0;W<80;W++){var K=u[W];if(W<16)var V=K.high=0|t[e+2*W],G=K.low=0|t[e+2*W+1];else{var Y=u[W-15],J=Y.high,X=Y.low,$=(J>>>1|X<<31)^(J>>>8|X<<24)^J>>>7,Q=(X>>>1|J<<31)^(X>>>8|J<<24)^(X>>>7|J<<25),tt=u[W-2],et=tt.high,rt=tt.low,it=(et>>>19|rt<<13)^(et<<3|rt>>>29)^et>>>6,nt=(rt>>>19|et<<13)^(rt<<3|et>>>29)^(rt>>>6|et<<26),ot=u[W-7],st=ot.high,at=ot.low,ht=u[W-16],ut=ht.high,ft=ht.low;V=(V=(V=$+st+((G=Q+at)>>>0>>0?1:0))+it+((G+=nt)>>>0>>0?1:0))+ut+((G+=ft)>>>0>>0?1:0),K.high=V,K.low=G}var lt,ct=L&D^~L&F,dt=q&U^~q&z,pt=O&I^O&j^I&j,mt=R&T^R&C^T&C,vt=(O>>>28|R<<4)^(O<<30|R>>>2)^(O<<25|R>>>7),gt=(R>>>28|O<<4)^(R<<30|O>>>2)^(R<<25|O>>>7),yt=(L>>>14|q<<18)^(L>>>18|q<<14)^(L<<23|q>>>9),bt=(q>>>14|L<<18)^(q>>>18|L<<14)^(q<<23|L>>>9),wt=h[W],Mt=wt.high,_t=wt.low,St=H+yt+((lt=Z+bt)>>>0>>0?1:0),xt=gt+mt;H=F,Z=z,F=D,z=U,D=L,U=q,L=N+(St=(St=(St=St+ct+((lt+=dt)>>>0
      >>0?1:0))+Mt+((lt+=_t)>>>0<_t>>>0?1:0))+V+((lt+=G)>>>0>>0?1:0))+((q=P+lt|0)>>>0

      >>0?1:0)|0,N=j,P=C,j=I,C=T,I=O,T=R,O=St+(vt+pt+(xt>>>0>>0?1:0))+((R=lt+xt|0)>>>0>>0?1:0)|0}p=i.low=p+R,i.high=d+O+(p>>>0>>0?1:0),v=n.low=v+T,n.high=m+I+(v>>>0>>0?1:0),y=o.low=y+C,o.high=g+j+(y>>>0>>0?1:0),w=s.low=w+P,s.high=b+N+(w>>>0

      >>0?1:0),_=a.low=_+q,a.high=M+L+(_>>>0>>0?1:0),x=f.low=x+U,f.high=S+D+(x>>>0>>0?1:0),A=l.low=A+z,l.high=k+F+(A>>>0>>0?1:0),B=c.low=B+Z,c.high=E+H+(B>>>0>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[30+(i+128>>>10<<5)]=Math.floor(r/4294967296),e[31+(i+128>>>10<<5)]=r,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(f),t.HmacSHA512=e._createHmacHelper(f)}(),i.SHA512)},function(t,e,r){var i;t.exports=(i=r(1),r(40),function(t){var e=i,r=e.lib,n=r.WordArray,o=r.Hasher,s=e.x64.Word,a=e.algo,h=[],u=[],f=[];!function(){for(var t=1,e=0,r=0;r<24;r++){h[t+5*e]=(r+1)*(r+2)/2%64;var i=(2*t+3*e)%5;t=e%5,e=i}for(t=0;t<5;t++)for(e=0;e<5;e++)u[t+5*e]=e+(2*t+3*e)%5*5;for(var n=1,o=0;o<24;o++){for(var a=0,l=0,c=0;c<7;c++){if(1&n){var d=(1<>>24)|4278255360&(o<<24|o>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),(B=r[n]).high^=s,B.low^=o}for(var a=0;a<24;a++){for(var c=0;c<5;c++){for(var d=0,p=0,m=0;m<5;m++)d^=(B=r[c+5*m]).high,p^=B.low;var v=l[c];v.high=d,v.low=p}for(c=0;c<5;c++){var g=l[(c+4)%5],y=l[(c+1)%5],b=y.high,w=y.low;for(d=g.high^(b<<1|w>>>31),p=g.low^(w<<1|b>>>31),m=0;m<5;m++)(B=r[c+5*m]).high^=d,B.low^=p}for(var M=1;M<25;M++){var _=(B=r[M]).high,S=B.low,x=h[M];x<32?(d=_<>>32-x,p=S<>>32-x):(d=S<>>64-x,p=_<>>64-x);var k=l[u[M]];k.high=d,k.low=p}var A=l[0],E=r[0];for(A.high=E.high,A.low=E.low,c=0;c<5;c++)for(m=0;m<5;m++){var B=r[M=c+5*m],O=l[M],R=l[(c+1)%5+5*m],I=l[(c+2)%5+5*m];B.high=O.high^~R.high&I.high,B.low=O.low^~R.low&I.low}B=r[0];var T=f[a];B.high^=T.high,B.low^=T.low}},_doFinalize:function(){var e=this._data,r=e.words,i=(this._nDataBytes,8*e.sigBytes),o=32*this.blockSize;r[i>>>5]|=1<<24-i%32,r[(t.ceil((i+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*r.length,this._process();for(var s=this._state,a=this.cfg.outputLength/8,h=a/8,u=[],f=0;f>>24)|4278255360&(c<<24|c>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),u.push(d),u.push(c)}return new n.init(u,a)},clone:function(){for(var t=o.clone.call(this),e=t._state=this._state.slice(0),r=0;r<25;r++)e[r]=e[r].clone();return t}});e.SHA3=o._createHelper(c),e.HmacSHA3=o._createHmacHelper(c)}(Math),i.SHA3)},function(t,e,r){var i=r(5),n=function(t,e){this.value=t||"",this.offset=e};n.prototype.dynamicPartLength=function(){return this.dynamicPart().length/2},n.prototype.withOffset=function(t){return new n(this.value,t)},n.prototype.combine=function(t){return new n(this.value+t.value)},n.prototype.isDynamic=function(){return void 0!==this.offset},n.prototype.offsetAsBytes=function(){return this.isDynamic()?i.padLeft(i.toTwosComplement(this.offset).toString(16),64):""},n.prototype.staticPart=function(){return this.isDynamic()?this.offsetAsBytes():this.value},n.prototype.dynamicPart=function(){return this.isDynamic()?this.value:""},n.prototype.encode=function(){return this.staticPart()+this.dynamicPart()},n.encodeList=function(t){var e=32*t.length,r=t.map((function(t){if(!t.isDynamic())return t;var r=e;return e+=t.dynamicPartLength(),t.withOffset(r)}));return r.reduce((function(t,e){return t+e.dynamicPart()}),r.reduce((function(t,e){return t+e.staticPart()}),""))},t.exports=n},function(t,e,r){var i=r(5),n=r(55),o=r(18),s=r(35),a=r(43),h=r(44),u=function(t,e,r){this._requestManager=t,this._params=e.inputs,this._name=i.transformToFullName(e),this._address=r,this._anonymous=e.anonymous};u.prototype.types=function(t){return this._params.filter((function(e){return e.indexed===t})).map((function(t){return t.type}))},u.prototype.displayName=function(){return i.extractDisplayName(this._name)},u.prototype.typeName=function(){return i.extractTypeName(this._name)},u.prototype.signature=function(){return s(this._name)},u.prototype.encode=function(t,e){t=t||{},e=e||{};var r={};["fromBlock","toBlock"].filter((function(t){return void 0!==e[t]})).forEach((function(t){r[t]=o.inputBlockNumberFormatter(e[t])})),r.topics=[],r.address=this._address,this._anonymous||r.topics.push("0x"+this.signature());var s=this._params.filter((function(t){return!0===t.indexed})).map((function(e){var r=t[e.name];return null==r?null:i.isArray(r)?r.map((function(t){return"0x"+n.encodeParam(e.type,t)})):"0x"+n.encodeParam(e.type,r)}));return r.topics=r.topics.concat(s),r},u.prototype.decode=function(t){t.data=t.data||"",t.topics=t.topics||[];var e=(this._anonymous?t.topics:t.topics.slice(1)).map((function(t){return t.slice(2)})).join(""),r=n.decodeParams(this.types(!0),e),i=t.data.slice(2),s=n.decodeParams(this.types(!1),i),a=o.outputLogFormatter(t);return a.event=this.displayName(),a.address=t.address,a.args=this._params.reduce((function(t,e){return t[e.name]=e.indexed?r.shift():s.shift(),t}),{}),delete a.data,delete a.topics,a},u.prototype.execute=function(t,e,r){i.isFunction(arguments[arguments.length-1])&&(r=arguments[arguments.length-1],2===arguments.length&&(e=null),1===arguments.length&&(e=null,t={}));var n=this.encode(t,e),o=this.decode.bind(this);return new a(n,"eth",this._requestManager,h.eth(),o,r)},u.prototype.attachToContract=function(t){var e=this.execute.bind(this),r=this.displayName();t[r]||(t[r]=e),t[r][this.typeName()]=this.execute.bind(this,t)},t.exports=u},function(t,e,r){(function(t){var i=r(174),n=r(81),o=r(82),s=r(176),a=r(56),h=e;h.request=function(e,r){e="string"==typeof e?a.parse(e):o(e);var n=-1===t.location.protocol.search(/^https?:$/)?"http:":"",s=e.protocol||n,h=e.hostname||e.host,u=e.port,f=e.path||"/";h&&-1!==h.indexOf(":")&&(h="["+h+"]"),e.url=(h?s+"//"+h:"")+(u?":"+u:"")+f,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var l=new i(e);return r&&l.on("response",r),l},h.get=function(t,e){var r=h.request(t,e);return r.end(),r},h.ClientRequest=i,h.IncomingMessage=n.IncomingMessage,h.Agent=function(){},h.Agent.defaultMaxSockets=4,h.globalAgent=new h.Agent,h.STATUS_CODES=s,h.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,r(7))},function(t,e,r){(function(t){e.fetch=a(t.fetch)&&a(t.ReadableStream),e.writableStream=a(t.WritableStream),e.abortController=a(t.AbortController),e.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),e.blobConstructor=!0}catch(t){}var r;function i(){if(void 0!==r)return r;if(t.XMLHttpRequest){r=new t.XMLHttpRequest;try{r.open("GET",t.XDomainRequest?"/":"https://example.com")}catch(t){r=null}}else r=null;return r}function n(t){var e=i();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch(t){}return!1}var o=void 0!==t.ArrayBuffer,s=o&&a(t.ArrayBuffer.prototype.slice);function a(t){return"function"==typeof t}e.arraybuffer=e.fetch||o&&n("arraybuffer"),e.msstream=!e.fetch&&s&&n("ms-stream"),e.mozchunkedarraybuffer=!e.fetch&&o&&n("moz-chunked-arraybuffer"),e.overrideMimeType=e.fetch||!!i()&&a(i().overrideMimeType),e.vbArray=a(t.VBArray),r=null}).call(this,r(7))},function(t,e,r){(function(t,i,n){var o=r(80),s=r(4),a=r(17),h=e.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},u=e.IncomingMessage=function(e,r,s,h){var u=this;if(a.Readable.call(u),u._mode=s,u.headers={},u.rawHeaders=[],u.trailers={},u.rawTrailers=[],u.on("end",(function(){t.nextTick((function(){u.emit("close")}))})),"fetch"===s){if(u._fetchResponse=r,u.url=r.url,u.statusCode=r.status,u.statusMessage=r.statusText,r.headers.forEach((function(t,e){u.headers[e.toLowerCase()]=t,u.rawHeaders.push(e,t)})),o.writableStream){var f=new WritableStream({write:function(t){return new Promise((function(e,r){u._destroyed?r():u.push(new i(t))?e():u._resumeFetch=e}))},close:function(){n.clearTimeout(h),u._destroyed||u.push(null)},abort:function(t){u._destroyed||u.emit("error",t)}});try{return void r.body.pipeTo(f).catch((function(t){n.clearTimeout(h),u._destroyed||u.emit("error",t)}))}catch(t){}}var l=r.body.getReader();!function t(){l.read().then((function(e){if(!u._destroyed){if(e.done)return n.clearTimeout(h),void u.push(null);u.push(new i(e.value)),t()}})).catch((function(t){n.clearTimeout(h),u._destroyed||u.emit("error",t)}))}()}else if(u._xhr=e,u._pos=0,u.url=e.responseURL,u.statusCode=e.status,u.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(t){var e=t.match(/^([^:]+):\s*(.*)/);if(e){var r=e[1].toLowerCase();"set-cookie"===r?(void 0===u.headers[r]&&(u.headers[r]=[]),u.headers[r].push(e[2])):void 0!==u.headers[r]?u.headers[r]+=", "+e[2]:u.headers[r]=e[2],u.rawHeaders.push(e[1],e[2])}})),u._charset="x-user-defined",!o.overrideMimeType){var c=u.rawHeaders["mime-type"];if(c){var d=c.match(/;\s*charset=([^;])(;|$)/);d&&(u._charset=d[1].toLowerCase())}u._charset||(u._charset="utf-8")}};s(u,a.Readable),u.prototype._read=function(){var t=this._resumeFetch;t&&(this._resumeFetch=null,t())},u.prototype._onXHRProgress=function(){var t=this,e=t._xhr,r=null;switch(t._mode){case"text:vbarray":if(e.readyState!==h.DONE)break;try{r=new n.VBArray(e.responseBody).toArray()}catch(t){}if(null!==r){t.push(new i(r));break}case"text":try{r=e.responseText}catch(e){t._mode="text:vbarray";break}if(r.length>t._pos){var o=r.substr(t._pos);if("x-user-defined"===t._charset){for(var s=new i(o.length),a=0;at._pos&&(t.push(new i(new Uint8Array(u.result.slice(t._pos)))),t._pos=u.result.byteLength)},u.onload=function(){t.push(null)},u.readAsArrayBuffer(r)}t._xhr.readyState===h.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,r(11),r(12).Buffer,r(7))},function(t,e){t.exports=function(){for(var t={},e=0;e1&&void 0!==arguments[1]?arguments[1]:"Unspecified error message. This is a bug, please report it.";if(Number.isInteger(t)){var r=t.toString();if(i[r])return i[r].message;if(u(t))return"Unspecified server error."}return e}function h(t){if(!Number.isInteger(t))return!1;var e=t.toString();return!!i[e]||!!u(t)}function u(t){return t>=-32099&&t<=-32e3}function f(t){return t&&"object"==typeof t&&!Array.isArray(t)?Object.assign({},t):t}t.exports={getMessageFromCode:a,isValidCode:h,serializeError:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;if(!e||!Number.isInteger(e.code)||"string"!=typeof e.message)throw new Error("fallbackError must contain integer number code and string message.");if(t instanceof o)return t.serialize();var r={};return t&&h(t.code)?(r.code=t.code,t.message&&"string"==typeof t.message?(r.message=t.message,t.hasOwnProperty("data")&&(r.data=t.data)):(r.message=a(r.code),r.data={originalError:f(t)})):(r.code=e.code,r.message=t&&t.message?t.message:e.message,r.data={originalError:f(t)}),t&&t.stack&&(r.stack=t.stack),r},JSON_RPC_SERVER_ERROR_MESSAGE:"Unspecified server error."}},function(t,e,r){(function(e){var i=r(60),n=function(){};t.exports=function t(r,o,s){if("function"==typeof o)return t(r,null,o);o||(o={}),s=i(s||n);var a=r._writableState,h=r._readableState,u=o.readable||!1!==o.readable&&r.readable,f=o.writable||!1!==o.writable&&r.writable,l=!1,c=function(){r.writable||d()},d=function(){f=!1,u||s.call(r)},p=function(){u=!1,f||s.call(r)},m=function(t){s.call(r,t?new Error("exited with error code: "+t):null)},v=function(t){s.call(r,t)},g=function(){e.nextTick(y)},y=function(){if(!l)return(!u||h&&h.ended&&!h.destroyed)&&(!f||a&&a.ended&&!a.destroyed)?void 0:s.call(r,new Error("premature close"))},b=function(){r.req.on("finish",d)};return function(t){return t.setHeader&&"function"==typeof t.abort}(r)?(r.on("complete",d),r.on("abort",g),r.req?b():r.on("request",b)):f&&!a&&(r.on("end",c),r.on("close",c)),function(t){return t.stdio&&Array.isArray(t.stdio)&&3===t.stdio.length}(r)&&r.on("exit",m),r.on("end",p),r.on("finish",d),!1!==o.error&&r.on("error",v),r.on("close",g),function(){l=!0,r.removeListener("complete",d),r.removeListener("abort",g),r.removeListener("request",b),r.req&&r.req.removeListener("finish",d),r.removeListener("end",c),r.removeListener("close",c),r.removeListener("finish",d),r.removeListener("exit",m),r.removeListener("end",p),r.removeListener("error",v),r.removeListener("close",g)}}}).call(this,r(11))},function(t,e,r){var i=r(14).Buffer,n=r(61).Transform;function o(t){n.call(this),this._block=i.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(4)(o,n),o.prototype._transform=function(t,e,r){var i=null;try{this.update(t,e)}catch(t){i=t}r(i)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!i.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer")}(t),this._finalized)throw new Error("Digest already called");i.isBuffer(t)||(t=i.from(t,e));for(var r=this._block,n=0;this._blockOffset+t.length-n>=this._blockSize;){for(var o=this._blockOffset;o0;++s)this._length[s]+=a,(a=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*a);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},function(t,e,r){var i=r(4),n=r(27),o=r(14).Buffer,s=[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],a=new Array(64);function h(){this.init(),this._w=a,n.call(this,64,56)}function u(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function l(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function c(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}i(h,n),h.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},h.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,h=0|this._e,p=0|this._f,m=0|this._g,v=0|this._h,g=0;g<16;++g)r[g]=t.readInt32BE(4*g);for(;g<64;++g)r[g]=0|(((e=r[g-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[g-7]+d(r[g-15])+r[g-16];for(var y=0;y<64;++y){var b=v+c(h)+u(h,p,m)+s[y]+r[y]|0,w=l(i)+f(i,n,o)|0;v=m,m=p,p=h,h=a+b|0,a=o,o=n,n=i,i=b+w|0}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=h+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=v+this._h|0},h.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=h},function(t,e,r){var i=r(4),n=r(27),o=r(14).Buffer,s=[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],a=new Array(160);function h(){this.init(),this._w=a,n.call(this,128,112)}function u(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function l(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function c(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function m(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function v(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function g(t,e){return t>>>0>>0?1:0}i(h,n),h.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},h.prototype._update=function(t){for(var e=this._w,r=0|this._ah,i=0|this._bh,n=0|this._ch,o=0|this._dh,a=0|this._eh,h=0|this._fh,y=0|this._gh,b=0|this._hh,w=0|this._al,M=0|this._bl,_=0|this._cl,S=0|this._dl,x=0|this._el,k=0|this._fl,A=0|this._gl,E=0|this._hl,B=0;B<32;B+=2)e[B]=t.readInt32BE(4*B),e[B+1]=t.readInt32BE(4*B+4);for(;B<160;B+=2){var O=e[B-30],R=e[B-30+1],I=d(O,R),T=p(R,O),j=m(O=e[B-4],R=e[B-4+1]),C=v(R,O),N=e[B-14],P=e[B-14+1],L=e[B-32],q=e[B-32+1],D=T+P|0,U=I+N+g(D,T)|0;U=(U=U+j+g(D=D+C|0,C)|0)+L+g(D=D+q|0,q)|0,e[B]=U,e[B+1]=D}for(var F=0;F<160;F+=2){U=e[F],D=e[F+1];var z=f(r,i,n),H=f(w,M,_),Z=l(r,w),W=l(w,r),K=c(a,x),V=c(x,a),G=s[F],Y=s[F+1],J=u(a,h,y),X=u(x,k,A),$=E+V|0,Q=b+K+g($,E)|0;Q=(Q=(Q=Q+J+g($=$+X|0,X)|0)+G+g($=$+Y|0,Y)|0)+U+g($=$+D|0,D)|0;var tt=W+H|0,et=Z+z+g(tt,W)|0;b=y,E=A,y=h,A=k,h=a,k=x,a=o+Q+g(x=S+$|0,S)|0,o=n,S=_,n=i,_=M,i=r,M=w,r=Q+et+g(w=$+tt|0,$)|0}this._al=this._al+w|0,this._bl=this._bl+M|0,this._cl=this._cl+_|0,this._dl=this._dl+S|0,this._el=this._el+x|0,this._fl=this._fl+k|0,this._gl=this._gl+A|0,this._hl=this._hl+E|0,this._ah=this._ah+r+g(this._al,w)|0,this._bh=this._bh+i+g(this._bl,M)|0,this._ch=this._ch+n+g(this._cl,_)|0,this._dh=this._dh+o+g(this._dl,S)|0,this._eh=this._eh+a+g(this._el,x)|0,this._fh=this._fh+h+g(this._fl,k)|0,this._gh=this._gh+y+g(this._gl,A)|0,this._hh=this._hh+b+g(this._hl,E)|0},h.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=h},function(t,e,r){(function(t){var i,n=r(3),o=r.n(n),s=r(9),a=r.n(s),h=r(28),u=r.n(h),f=r(29),l=r.n(f),c=r(8),d=r.n(c),p=r(89),m=r.n(p),v=r(90),g=r.n(v),y=r(2),b=r.n(y),w=r(62),M=r.n(w),_=r(63),S=r.n(_),x=r(30),k=r(15),A=r(0),E=r(92),B=r(100),O=r(65),R=r(102),I=r(103),T=r(10);function j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function C(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},r=e.buttonPosition,i=void 0===r?"bottom-left":r;u()(this,t),d()(this,"paymentProviders",k.a.paymentProviders),this.buttonPosition=i,this.torusWidget={},this.torusMenuBtn={},this.torusLogin={},this.torusLoadingBtn={},this.torusUrl="",this.torusIframe={},this.torusLoginModal={},this.torusSpeedDial={},this.keyBtn={},this.styleLink={},this.isLoggedIn=!1,this.isInitalized=!1,this.torusButtonVisibility=!0,this.requestedVerifier="",this.currentVerifier="",this.enabledVerifiers={},this.Web3=S.a,this.torusAlert={},this.nodeDetailManager=new m.a,this.torusJs=new g.a}var e,r,i;return l()(t,[{key:"init",value:(i=a()(o.a.mark((function t(){var e,r,i,n,s,h,u,f,l,c,d,p,m,v,g,y,w,M,_,S,k,E,O=this,R=arguments;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=R.length>0&&void 0!==R[0]?R[0]:{},r=e.buildEnv,i=void 0===r?"production":r,n=e.enableLogging,s=void 0!==n&&n,h=e.enabledVerifiers,u=void 0===h?z:h,f=e.network,l=void 0===f?{host:"mainnet",chainId:1,networkName:"mainnet"}:f,c=e.showTorusButton,d=void 0===c||c,p=e.integrity,m=void 0===p?{check:!1,hash:H,version:x.b}:p,!this.isInitalized){t.next=3;break}return t.abrupt("return",Promise.reject(new Error("Already initialized")));case 3:return t.next=5,Object(T.c)(i,m);case 5:if(v=t.sent,g=v.torusUrl,y=v.logLevel,b.a.info(g,"url loaded"),this.torusUrl=g,this.enabledVerifiers=C({},z,{},u),b.a.setDefaultLevel(y),s?b.a.enableAll():b.a.disableAll(),this.torusButtonVisibility=d,this._createWidget(g),w=function(){window.document.body.appendChild(O.torusIframe)},M=function(){var t=a()(o.a.mark((function t(){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(A.d)(w);case 2:return t.next=4,Object(A.d)(O._setupWeb3.bind(O));case 4:return t.next=6,Object(A.d)(a()(o.a.mark((function t(){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,O._setProvider(l);case 2:O.isInitalized=!0;case 3:case"end":return t.stop()}}),t)}))));case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),"production"!==i||!m.check){t.next=38;break}return _="".concat(g,"/popup"),t.next=21,fetch(_,{cache:"reload"});case 21:if("max-age=3600"===(S=t.sent).headers.get("Cache-Control")){t.next=24;break}throw new Error("Unexpected Cache-Control headers, got ".concat(S.headers.get("Cache-Control")));case 24:return t.next=26,S.text();case 26:if(k=t.sent,E=Object(B.a)({algorithms:["sha384"]},k),b.a.info(E,"integrity"),E!==m.hash){t.next=34;break}return t.next=32,M();case 32:t.next=36;break;case 34:throw this._cleanUp(),new Error("Integrity check failed");case 36:t.next=40;break;case 38:return t.next=40,M();case 40:return t.abrupt("return",void 0);case 41:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"_checkThirdPartyCookies",value:function(){if(!Z)throw this._createAlert('

      Cookies Required

      Please enable cookies in your browser preferences to access Torus.

      For more info, click here

      '),new Error("Third party cookies not supported")}},{key:"login",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.verifier;if(!this.isInitalized)throw new Error("Call init() first");if(e&&!this.enabledVerifiers[e])throw new Error("Given verifier is not enabled");if(!e)return this.requestedVerifier="",this.ethereum.enable();if(k.a.verifierList.includes(e))return this.requestedVerifier=e,this.ethereum.enable();throw new Error("Unsupported verifier")}},{key:"logout",value:function(){var t=this;return new Promise((function(e,r){if(t.isLoggedIn){t.communicationMux.getStream("logout").write({name:"logOut"});var i=t.communicationMux.getStream("status");Object(A.b)(i,"data",(function(i){i.loggedIn?r(new Error("Some Error Occured")):(t.isLoggedIn=!1,t.currentVerifier="",t.requestedVerifier="",e())}))}else r(new Error("User has not logged in yet"))}))}},{key:"cleanUp",value:(r=a()(o.a.mark((function t(){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.isLoggedIn){t.next=3;break}return t.next=3,this.logout();case 3:this._cleanUp();case 4:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"_cleanUp",value:function(){function t(t){return t instanceof Element||t instanceof HTMLDocument}t(this.styleLink)&&window.document.body.contains(this.styleLink)&&(this.styleLink.remove(),this.styleLink={}),t(this.torusWidget)&&window.document.body.contains(this.torusWidget)&&(this.torusWidget.remove(),this.torusWidget={},this.torusLogin={},this.torusMenuBtn={},this.torusLoadingBtn={},this.torusLoginModal={}),t(this.torusIframe)&&window.document.body.contains(this.torusIframe)&&(this.torusIframe.remove(),this.torusIframe={}),t(this.torusAlert)&&window.document.body.contains(this.torusAlert)&&(this.torusAlert.remove(),this.torusAlert={}),this.isInitalized=!1}},{key:"_createAlert",value:function(t){var e=this;this.torusAlert=Object(A.c)(t);var r=Object(A.c)('x');this.torusAlert.appendChild(r),Object(A.d)((function(){window.document.body.appendChild(e.torusAlert)})),Object(A.d)((function(){r.addEventListener("click",(function(){e.torusAlert.remove()}))}))}},{key:"_createPopupBlockAlert",value:function(t){var e=this,r=Object(A.c)('

      Action Required

      You have a pending action that needs to be completed in a pop-up window

      '),i=Object(A.c)('
      ');r.appendChild(i),Object(A.d)((function(){window.document.body.appendChild(r)})),Object(A.d)((function(){i.addEventListener("click",(function(){e._handleWindow(t,{target:"_blank",features:"directories=0,titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=660,width=500"}),r.remove()}))}))}},{key:"_createWidget",value:function(t){var e=this,r=window.document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("type","text/css"),r.setAttribute("href","".concat(t,"/css/widget.css")),this.styleLink=r,this.torusWidget=Object(A.c)('
      ');var i=Object(A.c)('
      ');this.torusLoadingBtn=Object(A.c)(''),this.torusButtonVisibility||(this.torusLoadingBtn.style.display="none"),this.torusLoadingBtn.appendChild(i),this.torusWidget.appendChild(this.torusLoadingBtn),this.torusLogin=Object(A.c)(''),this.torusButtonVisibility||(this.torusLogin.style.display="none"),this.torusWidget.appendChild(this.torusLogin),this.torusMenuBtn=Object(A.c)(''),o=Object(A.c)('
      Copy public address to clipboard
      '),s=Object(A.c)('
      Copied!
      ');this.keyBtn=Object(A.c)('');var a=Object(A.c)('
    • ');a.appendChild(this.keyBtn),a.appendChild(o),a.appendChild(s);var h=Object(A.c)('
    • ');this.torusSpeedDial.appendChild(n),this.torusSpeedDial.appendChild(a),this.torusSpeedDial.appendChild(h),this.torusWidget.prepend(this.torusSpeedDial),this.torusLoginModal=Object(A.c)('
      '),this.torusLoginModal.style.display="none";var u=Object(A.c)('
      ×
      '),f=Object(A.c)('
      Login
      '),l=Object(A.c)('

      You are just one step away from your digital wallet

      ');this.googleLogin=Object(A.c)(''));var c=Object(A.c)('
        ');this.facebookLogin=Object(A.c)('
      • ')),this.twitchLogin=Object(A.c)('
      • '),this.redditLogin=Object(A.c)('
      • '),this.discordLogin=Object(A.c)('
      • '),this.enabledVerifiers[q]&&c.appendChild(this.facebookLogin),this.enabledVerifiers[D]&&c.appendChild(this.redditLogin),this.enabledVerifiers[U]&&c.appendChild(this.twitchLogin),this.enabledVerifiers[F]&&c.appendChild(this.discordLogin),this.enabledVerifiers[L]&&l.appendChild(this.googleLogin),l.appendChild(c);var d=Object(A.c)('
        By logging in, you accept Torus\' Terms and Conditions
        ');switch(l.appendChild(d),f.appendChild(l),u.appendChild(f),this.torusLoginModal.appendChild(u),this.torusWidget.appendChild(this.torusLoginModal),this.torusIframe=Object(A.c)('')),Object(A.d)((function(){window.document.head.appendChild(r),window.document.body.appendChild(e.torusWidget)})),Object(A.d)((function(){e.torusLogin.addEventListener("click",(function(){e._showLoginPopup(!1)})),n.addEventListener("click",(function(){e.showWallet(),e._toggleSpeedDial()})),h.addEventListener("click",(function(){e.showWallet("transfer"),e._toggleSpeedDial()})),e.keyBtn.addEventListener("click",(function(){var t=Object(A.c)(''));e.torusWidget.prepend(t),t.select(),t.setSelectionRange(0,99999),document.execCommand("copy"),e.torusWidget.removeChild(t),s.classList.add("active"),o.classList.add("active"),setTimeout((function(){s.classList.remove("active"),o.classList.remove("active"),e._toggleSpeedDial()}),1e3)})),e.torusMenuBtn.addEventListener("click",(function(){e._toggleSpeedDial()})),u.querySelector("#torus-login-modal__close").addEventListener("click",(function(){e.torusLoginModal.style.display="none",e.modalCloseHandler&&e.modalCloseHandler(),delete e.modalCloseHandler}))})),this.buttonPosition){case"top-left":this.torusWidget.style.top="34px",this.torusWidget.style.left="34px";break;case"top-right":this.torusWidget.style.top="34px",this.torusWidget.style.right="34px";break;case"bottom-right":this.torusWidget.style.bottom="34px",this.torusWidget.style.right="34px";break;case"bottom-left":default:this.torusWidget.style.bottom="34px",this.torusWidget.style.left="34px"}}},{key:"_updateKeyBtnAddress",value:function(t){this.keyBtn.innerText=t&&"".concat(t.slice(0,4),"..")}},{key:"_showLoggedOut",value:function(){this.torusMenuBtn.style.display="none",this.torusLogin.style.display=this.torusButtonVisibility?"block":"none",this.torusLoadingBtn.style.display="none",this.torusLoginModal.style.display="none",this.torusSpeedDial.style.display="none",this.torusSpeedDial.style.opacity="0"}},{key:"_showLoggingIn",value:function(){this.torusMenuBtn.style.display="none",this.torusLogin.style.display="none",this.torusLoadingBtn.style.display=this.torusButtonVisibility?"block":"none",this.torusLoginModal.style.display=""===this.requestedVerifier?"block":"none"}},{key:"_showLoggedIn",value:function(){this.torusMenuBtn.style.display=this.torusButtonVisibility?"block":"none",this.torusLogin.style.display="none",this.torusLoadingBtn.style.display="none",this.torusLoginModal.style.display="none"}},{key:"hideTorusButton",value:function(){this.torusButtonVisibility=!1,this.torusMenuBtn.style.display="none",this.torusLogin.style.display="none",this.torusLoadingBtn.style.display="none",this.torusSpeedDial.style.display="none",this.torusSpeedDial.style.opacity="0"}},{key:"showTorusButton",value:function(){this.torusButtonVisibility=!0,this.isLoggedIn?this._showLoggedIn():this._showLoggedOut()}},{key:"_setupWeb3",value:function(){var t=this;b.a.info("setupWeb3 running"),this.metamaskStream=new M.a({name:"embed_metamask",target:"iframe_metamask",targetWindow:this.torusIframe.contentWindow}),this.metamaskStream.setMaxListeners(100),this.communicationStream=new M.a({name:"embed_comm",target:"iframe_comm",targetWindow:this.torusIframe.contentWindow}),this.communicationStream.setMaxListeners(100);var e=new E.a(this.metamaskStream),r=function(t){var r=e[t];e[t]=function(t){if(t&&"eth_requestAccounts"===t)return e.enable();for(var i=arguments.length,n=new Array(i>1?i-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:{},o=n.result;if(e)setTimeout((function(){t._showLoggedOut(),i(e)}),50);else if(Array.isArray(o)&&o.length>0){var s=function(){if(""!==t.requestedVerifier&&t.currentVerifier!==t.requestedVerifier){var e=t.requestedVerifier;t.logout().then((function(n){t.requestedVerifier=e,t._showLoginPopup(!0,r,i)})).catch((function(t){return i(t)}))}else t._showLoggedIn(),r(o)};t.isLoggedIn?s():t.isLoginCallback=s}else t._showLoginPopup(!0,r,i)}))}))};var i=new Proxy(e,{deleteProperty:function(){return!0}});this.ethereum=i;var n=Object(I.a)(this.communicationStream);n.setMaxListeners(20),this.communicationMux=n,n.getStream("window").on("data",(function(e){"create_window"===e.name&&t._createPopupBlockAlert(e.data.preopenInstanceId)})),n.getStream("status").on("data",(function(e){e.loggedIn?(t.isLoggedIn=e.loggedIn,t.currentVerifier=e.verifier):t._showLoggedOut(),t.isLoginCallback&&(t.isLoginCallback(),delete t.isLoginCallback)})),this.provider=e,this.web3=new S.a(e),this.web3.setProvider=function(){b.a.debug("Torus - overrode web3.setProvider")},this.web3.currentProvider.isTorus=!0,e.on("accountsChanged",(function(e){t._updateKeyBtnAddress(e&&e[0]||"")})),Object(R.a)(this.provider._rpcEngine),b.a.debug("Torus - injected web3")}},{key:"_showLoginPopup",value:function(t,e,r){var i=this;if(this._showLoggingIn(),void 0===this.requestedVerifier||""===this.requestedVerifier){this.modalCloseHandler=function(){i._showLoggedOut(),r&&r(new Error("Modal has been closed"))};var n=function(n){i.requestedVerifier=n,i._showLoginPopup(t,e,r)};Object.keys(this.enabledVerifiers).forEach((function(t){i.enabledVerifiers[t]&&Object(A.a)(i["".concat(t,"Login")],"click",n,[t])}))}else{var o=this.communicationMux.getStream("oauth");Object(A.b)(o,"data",(function(t){var n=t.err,o=t.selectedAddress;n?(b.a.error(n),i._showLoggedOut(),r&&r(n)):(e&&e([Object(A.e)(o)]),i._showLoggedIn())}));var s=Object(T.b)();this._handleWindow(s),o.write({name:"oauth",data:{calledFromEmbed:t,verifier:this.requestedVerifier,preopenInstanceId:s}})}}},{key:"setProvider",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.host,i=void 0===r?"mainnet":r,n=e.chainId,o=void 0===n?1:n,s=e.networkName,a=void 0===s?"mainnet":s;return new Promise((function(e,r){var n=t.communicationMux.getStream("provider_change");Object(A.b)(n,"data",(function(t){var i=t.data,n=i.err,o=i.success;b.a.info(t),n?r(n):o?e():r(new Error("some error occured"))}));var s=Object(T.b)();t._handleWindow(s,{target:"_blank",features:"directories=0,titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=600,width=500"}),n.write({name:"show_provider_change",data:{network:{host:i,chainId:o,networkName:a},type:k.a.networkList.includes(i)?void 0:"rpc",preopenInstanceId:s,override:!1}})}))}},{key:"_setProvider",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.host,i=void 0===r?"mainnet":r,n=e.chainId,o=void 0===n?1:n,s=e.networkName,a=void 0===s?"mainnet":s;return new Promise((function(e,r){if(t.isInitalized)r(new Error("Already initialized"));else{var n=t.communicationMux.getStream("provider_change");Object(A.b)(n,"data",(function(t){b.a.info(t);var i=t.data,n=i.err,o=i.success;n?r(n):o?e():r(new Error("some error occured"))})),n.write({name:"show_provider_change",data:{network:{host:i,chainId:o,networkName:a},type:k.a.networkList.includes(i)?void 0:"rpc",override:!0}})}}))}},{key:"showWallet",value:function(t){var e=this,r=this.communicationMux.getStream("show_wallet"),i=t?"/".concat(t):"";r.write({name:"show_wallet",data:{path:i}}),Object(A.b)(r,"data",(function(t){if("show_wallet_instance"===t.name){var r=t.data.instanceId,n="".concat(e.torusUrl,"/wallet").concat(i,"?integrity=true&instanceId=").concat(r);new O.a({url:n}).open()}}))}},{key:"_toggleSpeedDial",value:function(){this.torusMenuBtn.classList.toggle("active");var t=this.torusMenuBtn.classList.contains("active"),e=this.torusSpeedDial;t&&(e.style.display="block"),e.style.opacity="0"===e.style.opacity?"1":"0",e.classList.toggle("active");var r=t?.05:1.2;e.style.transitionDelay="".concat(r,"s"),setTimeout((function(){for(var r=t?.05:.15,i=Object.values(e.children),n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=e.target,i=e.features;if(t){var n=this.communicationMux.getStream("window"),o="".concat(this.torusUrl,"/redirect?preopenInstanceId=").concat(t),s=new O.a({url:o,target:r,features:i});if(s.open(),!s.window)return void this._createPopupBlockAlert(t);n.write({name:"opened_window",data:{preopenInstanceId:t}});var a=function e(r){var i=r.preopenInstanceId,o=r.close;i===t&&o&&(s.close(),n.removeListener("data",e))};n.on("data",a),s.once("close",(function(){n.write({data:{preopenInstanceId:t,closed:!0}})}))}}},{key:"initiateTopup",value:function(t,e){var r=this;return new Promise((function(i,n){if(r.isInitalized){var o=Object(T.f)(t,e),s=o.errors;if(!o.isValid)return void n(new Error(JSON.stringify(s)));var a=r.communicationMux.getStream("topup");Object(A.b)(a,"data",(function(t){"topup_response"===t.name&&(t.data.success?i(t.data.success):n(new Error(t.data.error)))}));var h=Object(T.b)();r._handleWindow(h),a.write({name:"topup_request",data:{provider:t,params:e,preopenInstanceId:h}})}else n(new Error("User has not initialized in yet"))}))}}]),t}();e.a=W}).call(this,r(7))},function(t,e){t.exports=R},function(t,e){t.exports=j},function(t,e){t.exports=T},function(t,e,r){var i=r(64),n=r.n(i),o=r(28),s=r.n(o),a=r(29),h=r.n(a),u=r(48),f=r.n(u),l=r(45),c=r.n(l),d=r(31),p=r.n(d),m=r(46),v=r.n(m),g=r(36),y=r(93),b=r.n(y),w=r(94),M=r.n(w),_=r(95),S=r.n(_),x=r(96),k=r.n(x),A=r(2),E=r.n(A),B=r(47),O=r.n(B),R=r(97),I=r.n(R),T=r(98),j=r.n(T),C=r(32),N=r.n(C),P=r(22),L=r.n(P),q=r(37),D=r(10);function U(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}var F=function(t){v()(i,t);var e,r=(e=i,function(){var t,r=p()(e);if(U()){var i=p()(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return c()(this,t)});function i(t){var e;s()(this,i),(e=r.call(this))._state={sentWarnings:{isConnected:!1,sendAsync:!1,sendSync:!1},isConnected:void 0,accounts:void 0,isUnlocked:void 0},e.selectedAddress=null,e.networkVersion=void 0,e.chainId=void 0;var n=new O.a;e.mux=n,N()(t,n,t,e._handleDisconnect.bind(f()(e),"MetaMask")),e._publicConfigStore=new I.a({storageKey:"MetaMask-Config"}),e._publicConfigStore.subscribe((function(t){var r=JSON.parse(t);if("isUnlocked"in r&&r.isUnlocked!==e._state.isUnlocked)if(e._state.isUnlocked=r.isUnlocked,e._state.isUnlocked)try{e._sendAsync({method:"eth_accounts",params:[]},(function(){}),!0)}catch(t){}else e._handleAccountsChanged([]);if("selectedAddress"in r&&e.selectedAddress!==r.selectedAddress)try{e._sendAsync({method:"eth_accounts",params:[]},(function(){}),!0)}catch(t){}"chainId"in r&&r.chainId!==e.chainId&&(e.chainId=r.chainId,e.emit("chainChanged",e.chainId)),"networkVersion"in r&&r.networkVersion!==e.networkVersion&&(e.networkVersion=r.networkVersion,e.emit("networkChanged",e.networkVersion))})),N()(n.createStream("publicConfig"),j()(e._publicConfigStore),D.d.bind(f()(e),"MetaMask PublicConfigStore")),n.ignoreStream("phishing"),e.on("connect",(function(){e._state.isConnected=!0}));var o=k()();N()(o.stream,n.createStream("provider"),o.stream,e._handleDisconnect.bind(f()(e),"MetaMask RpcProvider"));var a=new M.a;return a.push(S()()),a.push(Object(D.a)()),a.push(o.middleware),e._rpcEngine=a,o.events.on("notification",(function(t){"wallet_accountsChanged"===t.method?e._handleAccountsChanged(t.result):"eth_subscription"===t.method&&e.emit("notification",t.params.result),e.emit("data",null,t)})),setTimeout((function(){return e.emit("connect")})),e}return h()(i,[{key:"send",value:function(t,e){var r,i=this,o=e,s=e;if("object"!==n()(t)||Array.isArray(t))"string"==typeof t&&"function"!=typeof s&&(void 0===s?s=[]:Array.isArray(s)||(s=[s]),r={method:t,params:s});else{if("function"==typeof s)return this._sendAsync(t,s);if(r=t,!s&&["eth_accounts","eth_coinbase","eth_uninstallFilter","net_version"].includes(r.method))return this._sendSync(r)}if(Array.isArray(r)||"function"==typeof s||"object"!==n()(r)||"string"!=typeof r.method)throw g.ethErrors.rpc.invalidRequest({message:q.a.errors.invalidParams(),data:[t,o]});return new Promise((function(t,e){try{i._sendAsync(r,function(t,e){return function(r,i){return r||i.error?e(r||i.error):Array.isArray(i)?t(i):t(i.result)}}(t,e))}catch(t){e(t)}}))}},{key:"sendAsync",value:function(t,e){this._sendAsync(t,e)}},{key:"_sendSync",value:function(t){var e;switch(t.method){case"eth_accounts":e=this.selectedAddress?[this.selectedAddress]:[];break;case"eth_coinbase":e=this.selectedAddress||null;break;case"eth_uninstallFilter":this._sendAsync(t,(function(){})),e=!0;break;case"net_version":e=this.networkVersion||null;break;default:throw new Error(q.a.errors.unsupportedSync(t.method))}return Object(D.e)({id:t.id,jsonrpc:t.jsonrpc,result:e},"result")}},{key:"_sendAsync",value:function(t,e){var r=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e,o=t;Array.isArray(o)||(o.jsonrpc||(o.jsonrpc="2.0"),"eth_accounts"!==o.method&&"eth_requestAccounts"!==o.method||(n=function(t,n){r._handleAccountsChanged(n.result||[],"eth_accounts"===o.method,i),e(t,n)})),this._rpcEngine.handle(o,n)}},{key:"_handleDisconnect",value:function(t,e){D.d.bind(this)(t,e),this._state.isConnected&&this.emit("close",{code:1011,reason:"MetaMask background communication error."}),this._state.isConnected=!1}},{key:"_handleAccountsChanged",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=t;Array.isArray(i)||(E.a.error("MetaMask: Received non-array accounts parameter. Please report this bug.",i),i=[]),b()(this._state.accounts,i)||(e&&!r&&E.a.error('MetaMask: "eth_accounts" unexpectedly updated accounts. Please report this bug.',i),this.emit("accountsChanged",i),this._state.accounts=i),this.selectedAddress!==i[0]&&(this.selectedAddress=i[0]||null)}}]),i}(L.a);e.a=F},function(t,e){t.exports=C},function(t,e,r){var i=r(192),n=r(22),o=r(36),s=o.serializeError,l=o.EthereumRpcError,p=o.ERROR_CODES;t.exports=function(t){Object(u.a)(r,t);var e=Object(f.a)(r);function r(){var t;return Object(a.a)(this,r),(t=e.call(this))._middleware=[],t}return Object(h.a)(r,[{key:"push",value:function(t){this._middleware.push(t)}},{key:"handle",value:function(t,e){Array.isArray(t)?this._handleBatch(t,e):this._handle(t,e)}},{key:"_handleBatch",value:function(){var t=Object(d.a)(c.a.mark((function t(e,r){return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.t0=r,t.next=4,Promise.all(e.map(this._promiseHandle.bind(this)));case 4:t.t1=t.sent,(0,t.t0)(null,t.t1),t.next=11;break;case 8:t.prev=8,t.t2=t.catch(0),r(t.t2);case 11:case"end":return t.stop()}}),t,this,[[0,8]])})));return function(e,r){return t.apply(this,arguments)}}()},{key:"_promiseHandle",value:function(t){var e=this;return new Promise((function(r,i){e._handle(t,(function(t,e){e?r(e):i(t||new l(p.rpc.internal,"JsonRpcEngine: Request handler returned neither error nor response."))}))}))}},{key:"_handle",value:function(t,e){var r=Object.assign({},t),i={id:r.id,jsonrpc:r.jsonrpc};this._runMiddleware(r,i,(function(t){var r=i._originalError;if(delete i._originalError,r)return delete i.result,e(r,i);e(t,i)}))}},{key:"_runMiddleware",value:function(t,e,r){var n=this;i.waterfall([function(r){return n._runMiddlewareDown(t,e,r)},function(r,i){var n=r.isComplete,o=r.returnHandlers;if(!("result"in e)&&!("error"in e)){var s="JsonRpcEngine: Response has no error or result for request:\n"+JSON.stringify(t,null,2);return i(new l(p.rpc.internal,s,t))}if(!n){var a="JsonRpcEngine: Nothing ended request:\n"+JSON.stringify(t,null,2);return i(new l(p.rpc.internal,a,t))}return i(null,o)},function(t,e){return n._runReturnHandlersUp(t,e)}],r)}},{key:"_runMiddlewareDown",value:function(t,e,r){var n=[],o=!1;i.mapSeries(this._middleware,(function(r,i){if(o)return i();function a(t){var r=t||e&&e.error;r&&(e.error=s(r),e._originalError=r),o=!0,i()}r(t,e,(function(t){e.error?a(e.error):(n.push(t),i())}),a)}),(function(t){if(t)return e.error=s(t),delete e.result,r(t,e);var i=n.filter(Boolean).reverse();r(null,{isComplete:o,returnHandlers:i})}))}},{key:"_runReturnHandlersUp",value:function(t,e){i.eachSeries(t,(function(t,e){return t(e)}),e)}}]),r}(n)},function(t,e,r){var i=r(193);t.exports=function(){return function(t,e,r,n){var o=t.id,s=i();t.id=s,e.id=s,r((function(r){t.id=o,e.id=o,r()}))}}},function(t,e,r){var i=r(22),n=r(17).Duplex;t.exports=function(){var t={},e=new n({objectMode:!0,read:function(){return!1},write:function(e,i,n){var o;try{e.id?function(e){var r=t[e.id];if(!r)throw new Error("StreamMiddleware - Unknown response id ".concat(e.id));delete t[e.id],Object.assign(r.res,e),setTimeout(r.end)}(e):function(t){r.emit("notification",t)}(e)}catch(t){o=t}n(o)}}),r=new i;return{events:r,middleware:function(r,i,n,o){e.push(r),t[r.id]={req:r,res:i,next:n,end:o}},stream:e}}},function(t,e,r){r(82);var i=r(22);t.exports=function(t){Object(u.a)(r,t);var e=Object(f.a)(r);function r(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(a.a)(this,r),(t=e.call(this))._state=i,t}return Object(h.a)(r,[{key:"getState",value:function(){return this._getState()}},{key:"putState",value:function(t){this._putState(t),this.emit("update",t)}},{key:"updateState",value:function(t){if(t&&"object"==typeof t){var e=this.getState(),r=Object.assign({},e,t);this.putState(r)}else this.putState(t)}},{key:"subscribe",value:function(t){this.on("update",t)}},{key:"unsubscribe",value:function(t){this.removeListener("update",t)}},{key:"_getState",value:function(){return this._state}},{key:"_putState",value:function(t){this._state=t}}]),r}(i)},function(t,e,r){var i=r(61).Duplex;t.exports=function(t){return new s(t)};var s=function(t){Object(u.a)(r,t);var e=Object(f.a)(r);function r(t){var i;return Object(a.a)(this,r),(i=e.call(this,{objectMode:!0})).resume(),i.handler=function(t){return i.push(t)},i.obsStore=t,i.obsStore.subscribe(i.handler),i}return Object(h.a)(r,[{key:"pipe",value:function(t,e){var r=i.prototype.pipe.call(this,t,e);return t.write(this.obsStore.getState()),r}},{key:"_write",value:function(t,e,r){this.obsStore.putState(t),r()}},{key:"_read",value:function(t){}},{key:"_destroy",value:function(t,e){this.obsStore.unsubscribe(this.handler),Object(n.a)(Object(o.a)(r.prototype),"_destroy",this).call(this,t,e)}}]),r}(i)},function(t,e){t.exports=N},function(t,e,r){var i=r(101),n=r.n(i),o=function(t,e){var r={};return t.algorithms.forEach((function(t){r[t]=function(t,e){return n()(t).update(e,"utf8").digest("base64")}(t,e)})),r};e.a=function(t,e){var r=function(t){return{algorithms:t.algorithms||["sha256"],delimiter:t.delimiter||" ",full:t.full||!1}}(t),i={hashes:o(r,e),integrity:void 0};return i.integrity=function(t,e){return""+Object.keys(e.hashes).map((function(t){return"".concat(t,"-").concat(e.hashes[t])})).join(t.delimiter)}(r,i),r.full?i:i.integrity}},function(t,e,r){var i=r(4),n=r(200),o=r(201),s=r(202),a=r(207);function h(t){a.call(this,"digest"),this._hash=t}i(h,a),h.prototype._update=function(t){this._hash.update(t)},h.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new n:"rmd160"===t||"ripemd160"===t?new o:new h(s(t))}},function(t,e,r){r.d(e,"a",(function(){return p}));var i=r(3),n=r.n(i),o=r(9),s=r.n(o),a=r(2),h=r.n(a),u=r(37).a.errors,f=function(t){return fetch(t,{method:"HEAD",mode:"same-origin"}).then((function(t){return 200===t.status})).catch((function(t){return!1}))},l=function(t){var e=t.document,r=e.querySelector('head > meta[property="og:site_name"]');if(r)return r.content;var i=e.querySelector('head > meta[name="title"]');return i?i.content:e.title&&e.title.length>0?e.title:t.location.hostname},c=function(){var t=s()(n.a.mark((function t(e){var r,i;return n.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.document,i=r.querySelector('head > link[rel="shortcut icon"]'),t.t0=i,!t.t0){t.next=7;break}return t.next=6,f(i.href);case 6:t.t0=t.sent;case 7:if(!t.t0){t.next=9;break}return t.abrupt("return",i.href);case 9:if(i=Array.from(r.querySelectorAll('head > link[rel="icon"]')).find((function(t){return Boolean(t.href)})),t.t1=i,!t.t1){t.next=15;break}return t.next=14,f(i.href);case 14:t.t1=t.sent;case 15:if(!t.t1){t.next=17;break}return t.abrupt("return",i.href);case 17:return t.abrupt("return",null);case 18:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),d=function(){var t=s()(n.a.mark((function t(){return n.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=l(window),t.next=3,c(window);case 3:return t.t1=t.sent,t.abrupt("return",{name:t.t0,icon:t.t1});case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),p=function(){var t=s()(n.a.mark((function t(e){var r;return n.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,d();case 3:r=t.sent,e.handle({method:"wallet_sendDomainMetadata",domainMetadata:r},(function(){})),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),h.a.error({message:u.sendSiteMetadata(),originalError:t.t0});case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e){return t.apply(this,arguments)}}()},function(t,e,r){r.d(e,"a",(function(){return a}));var i=r(47),n=r.n(i),o=r(32),s=r.n(o),a=function(t){var e=new n.a;return e.getStream=function(t){return this._substreams[t]?this._substreams[t]:this.createStream(t)},s()(t,e,t,(function(t){t&&console.error(t)})),e}},function(t,e,r){r.r(e);var i=r(88);e.default=i.a},function(t,e,r){e.byteLength=function(t){var e=u(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,i=u(t),s=i[0],a=i[1],h=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),f=0,l=a>0?s-4:s;for(r=0;r>16&255,h[f++]=e>>8&255,h[f++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,h[f++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,h[f++]=e>>8&255,h[f++]=255&e),h},e.fromByteArray=function(t){for(var e,r=t.length,n=r%3,o=[],s=0,a=r-n;sa?a:s+16383));return 1===n?(e=t[r-1],o.push(i[e>>2]+i[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],o.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"=")),o.join("")};for(var i=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,h=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var n,o,s=[],a=e;a>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,i,n){var o,s,a=8*n-i-1,h=(1<>1,f=-7,l=r?n-1:0,c=r?-1:1,d=t[e+l];for(l+=c,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+t[e+l],l+=c,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=i;f>0;s=256*s+t[e+l],l+=c,f-=8);if(0===o)o=1-u;else{if(o===h)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),o-=u}return(d?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,r,i,n,o){var s,a,h,u=8*o-n-1,f=(1<>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-s))<1&&(s--,h*=2),(e+=s+l>=1?c/h:c*Math.pow(2,1-l))*h>=2&&(s++,h/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*h-1)*Math.pow(2,n),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,n),s=0));n>=8;t[r+d]=255&a,d+=p,a/=256,n-=8);for(s=s<0;t[r+d]=255&s,d+=p,s/=256,u-=8);t[r+d-p]|=128*m}},function(t,e){},function(t,e,r){var i=r(49).Buffer,n=r(109);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;for(var e,r,n=i.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=n,r=s,o.data.copy(e,r),s+=o.data.length,o=o.next;return n},t}(),n&&n.inspect&&n.inspect.custom&&(t.exports.prototype[n.inspect.custom]=function(){var t=n.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,r){(function(t,e){!function(t,r){if(!t.setImmediate){var i,n,o,s,a,h=1,u={},f=!1,l=t.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(t);c=c&&c.setTimeout?c:t,"[object process]"==={}.toString.call(t.process)?i=function(){var t=d(arguments);return e.nextTick(p(m,t)),t}:function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&m(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),i=function(){var e=d(arguments);return t.postMessage(s+e,"*"),e}):t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){m(t.data)},i=function(){var t=d(arguments);return o.port2.postMessage(t),t}):l&&"onreadystatechange"in l.createElement("script")?(n=l.documentElement,i=function(){var t=d(arguments),e=l.createElement("script");return e.onreadystatechange=function(){m(t),e.onreadystatechange=null,n.removeChild(e),e=null},n.appendChild(e),t}):i=function(){var t=d(arguments);return setTimeout(p(m,t),0),t},c.setImmediate=i,c.clearImmediate=v}function d(t){return u[h]=p.apply(void 0,t),h++}function p(t){var e=[].slice.call(arguments,1);return function(){"function"==typeof t?t.apply(void 0,e):new Function(""+t)()}}function m(t){if(f)setTimeout(p(m,t),0);else{var e=u[t];if(e){f=!0;try{e()}finally{v(t),f=!1}}}}function v(t){delete u[t]}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,r(7),r(11))},function(t,e,r){(function(e){function r(t){try{if(!e.localStorage)return!1}catch(t){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(t,e){if(r("noDeprecation"))return t;var i=!1;return function(){if(!i){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}}}).call(this,r(7))},function(t,e,r){var i=r(12),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=s),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},function(t,e,r){t.exports=o;var i=r(71),n=Object.create(r(33));function o(t){if(!(this instanceof o))return new o(t);i.call(this,t)}n.inherits=r(4),n.inherits(o,i),o.prototype._transform=function(t,e,r){r(null,t)}},function(t,e){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e,r){var i=r(117),n=r(42),o=r(142),s=r(161),a=r(162),h=r(163),u=r(164),f=r(165),l=r(166),c=r(167),d=r(5),p=r(35),m=r(168),v=r(169),g=r(26),y=r(170),b=r(188),w=r(34);function M(t){this._requestManager=new i(t),this.currentProvider=t,this.eth=new o(this),this.db=new s(this),this.shh=new a(this),this.net=new h(this),this.personal=new u(this),this.bzz=new f(this),this.settings=new l,this.version={api:c.version},this.providers={HttpProvider:y,IpcProvider:b},this._extend=m(this),this._extend({properties:_()})}M.providers={HttpProvider:y,IpcProvider:b},M.prototype.setProvider=function(t){this._requestManager.setProvider(t),this.currentProvider=t},M.prototype.reset=function(t){this._requestManager.reset(t),this.settings=new l},M.prototype.BigNumber=w,M.prototype.toHex=d.toHex,M.prototype.toAscii=d.toAscii,M.prototype.toUtf8=d.toUtf8,M.prototype.fromAscii=d.fromAscii,M.prototype.fromUtf8=d.fromUtf8,M.prototype.toDecimal=d.toDecimal,M.prototype.fromDecimal=d.fromDecimal,M.prototype.toBigNumber=d.toBigNumber,M.prototype.toWei=d.toWei,M.prototype.fromWei=d.fromWei,M.prototype.isAddress=d.isAddress,M.prototype.isChecksumAddress=d.isChecksumAddress,M.prototype.toChecksumAddress=d.toChecksumAddress,M.prototype.isIBAN=d.isIBAN,M.prototype.padLeft=d.padLeft,M.prototype.padRight=d.padRight,M.prototype.sha3=function(t,e){return"0x"+p(t,e)},M.prototype.fromICAP=function(t){return new n(t).address()};var _=function(){return[new g({name:"version.node",getter:"web3_clientVersion"}),new g({name:"version.network",getter:"net_version",inputFormatter:d.toDecimal}),new g({name:"version.ethereum",getter:"eth_protocolVersion",inputFormatter:d.toDecimal}),new g({name:"version.whisper",getter:"shh_version",inputFormatter:d.toDecimal})]};M.prototype.isConnected=function(){return this.currentProvider&&this.currentProvider.isConnected()},M.prototype.createBatch=function(){return new v(this)},t.exports=M},function(t,e,r){var i=r(73),n=r(5),o=r(41),s=r(25),a=function(t){this.provider=t,this.polls={},this.timeout=null};a.prototype.send=function(t){if(!this.provider)return console.error(s.InvalidProvider()),null;var e=i.toPayload(t.method,t.params),r=this.provider.send(e);if(!i.isValidResponse(r))throw s.InvalidResponse(r);return r.result},a.prototype.sendAsync=function(t,e){if(!this.provider)return e(s.InvalidProvider());var r=i.toPayload(t.method,t.params);this.provider.sendAsync(r,(function(t,r){return t?e(t):i.isValidResponse(r)?void e(null,r.result):e(s.InvalidResponse(r))}))},a.prototype.sendBatch=function(t,e){if(!this.provider)return e(s.InvalidProvider());var r=i.toBatchPayload(t);this.provider.sendAsync(r,(function(t,r){return t?e(t):n.isArray(r)?void e(t,r):e(s.InvalidResponse(r))}))},a.prototype.setProvider=function(t){this.provider=t},a.prototype.startPolling=function(t,e,r,i){this.polls[e]={data:t,id:e,callback:r,uninstall:i},this.timeout||this.poll()},a.prototype.stopPolling=function(t){delete this.polls[t],0===Object.keys(this.polls).length&&this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},a.prototype.reset=function(t){for(var e in this.polls)t&&-1!==e.indexOf("syncPoll_")||(this.polls[e].uninstall(),delete this.polls[e]);0===Object.keys(this.polls).length&&this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},a.prototype.poll=function(){if(this.timeout=setTimeout(this.poll.bind(this),o.ETH_POLLING_TIMEOUT),0!==Object.keys(this.polls).length)if(this.provider){var t=[],e=[];for(var r in this.polls)t.push(this.polls[r].data),e.push(r);if(0!==t.length){var a=i.toBatchPayload(t),h={};a.forEach((function(t,r){h[t.id]=e[r]}));var u=this;this.provider.sendAsync(a,(function(t,e){if(!t){if(!n.isArray(e))throw s.InvalidResponse(e);e.map((function(t){var e=h[t.id];return!!u.polls[e]&&(t.callback=u.polls[e].callback,t)})).filter((function(t){return!!t})).filter((function(t){var e=i.isValidResponse(t);return e||t.callback(s.InvalidResponse(t)),e})).forEach((function(t){t.callback(null,t.result)}))}}))}}else console.error(s.InvalidProvider())},t.exports=a},function(t,e,r){var i;t.exports=(i=r(1),r(40),r(119),r(120),r(23),r(24),r(52),r(74),r(121),r(75),r(122),r(76),r(123),r(53),r(124),r(20),r(6),r(125),r(126),r(127),r(128),r(129),r(130),r(131),r(132),r(133),r(134),r(135),r(136),r(137),r(138),r(139),r(140),i)},function(t,e,r){var i;t.exports=(i=r(1),function(){if("function"==typeof ArrayBuffer){var t=i.lib.WordArray,e=t.init;(t.init=function(t){if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),(t instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),t instanceof Uint8Array){for(var r=t.byteLength,i=[],n=0;n>>2]|=t[n]<<24-n%4*8;e.call(this,i,r)}else e.apply(this,arguments)}).prototype=t}}(),i.lib.WordArray)},function(t,e,r){var i;t.exports=(i=r(1),function(){var t=i,e=t.lib.WordArray,r=t.enc;function n(t){return t<<8&4278255360|t>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n>>2]>>>16-n%4*8&65535;i.push(String.fromCharCode(o))}return i.join("")},parse:function(t){for(var r=t.length,i=[],n=0;n>>1]|=t.charCodeAt(n)<<16-n%2*16;return e.create(i,2*r)}},r.Utf16LE={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],o=0;o>>2]>>>16-o%4*8&65535);i.push(String.fromCharCode(s))}return i.join("")},parse:function(t){for(var r=t.length,i=[],o=0;o>>1]|=n(t.charCodeAt(o)<<16-o%2*16);return e.create(i,2*r)}}}(),i.enc.Utf16)},function(t,e,r){var i,n,o,s,a,h;t.exports=(h=r(1),r(74),n=(i=h).lib.WordArray,o=i.algo,s=o.SHA256,a=o.SHA224=s.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=s._doFinalize.call(this);return t.sigBytes-=4,t}}),i.SHA224=s._createHelper(a),i.HmacSHA224=s._createHmacHelper(a),h.SHA224)},function(t,e,r){var i,n,o,s,a,h,u,f;t.exports=(f=r(1),r(40),r(75),n=(i=f).x64,o=n.Word,s=n.WordArray,a=i.algo,h=a.SHA512,u=a.SHA384=h.extend({_doReset:function(){this._hash=new s.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var t=h._doFinalize.call(this);return t.sigBytes-=16,t}}),i.SHA384=h._createHelper(u),i.HmacSHA384=h._createHmacHelper(u),f.SHA384)},function(t,e,r){var i;t.exports=(i=r(1),function(t){var e=i,r=e.lib,n=r.WordArray,o=r.Hasher,s=e.algo,a=n.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),h=n.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),u=n.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=n.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),l=n.create([0,1518500249,1859775393,2400959708,2840853838]),c=n.create([1352829926,1548603684,1836072691,2053994217,0]),d=s.RIPEMD160=o.extend({_doReset:function(){this._hash=n.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var i=e+r,n=t[i];t[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var o,s,d,w,M,_,S,x,k,A,E,B=this._hash.words,O=l.words,R=c.words,I=a.words,T=h.words,j=u.words,C=f.words;for(_=o=B[0],S=s=B[1],x=d=B[2],k=w=B[3],A=M=B[4],r=0;r<80;r+=1)E=o+t[e+I[r]]|0,E+=r<16?p(s,d,w)+O[0]:r<32?m(s,d,w)+O[1]:r<48?v(s,d,w)+O[2]:r<64?g(s,d,w)+O[3]:y(s,d,w)+O[4],E=(E=b(E|=0,j[r]))+M|0,o=M,M=w,w=b(d,10),d=s,s=E,E=_+t[e+T[r]]|0,E+=r<16?y(S,x,k)+R[0]:r<32?g(S,x,k)+R[1]:r<48?v(S,x,k)+R[2]:r<64?m(S,x,k)+R[3]:p(S,x,k)+R[4],E=(E=b(E|=0,C[r]))+A|0,_=A,A=k,k=b(x,10),x=S,S=E;E=B[1]+d+k|0,B[1]=B[2]+w+A|0,B[2]=B[3]+M+_|0,B[3]=B[4]+o+S|0,B[4]=B[0]+s+x|0,B[0]=E},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process();for(var n=this._hash,o=n.words,s=0;s<5;s++){var a=o[s];o[s]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return n},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function p(t,e,r){return t^e^r}function m(t,e,r){return t&e|~t&r}function v(t,e,r){return(t|~e)^r}function g(t,e,r){return t&r|e&~r}function y(t,e,r){return t^(e|~r)}function b(t,e){return t<>>32-e}e.RIPEMD160=o._createHelper(d),e.HmacRIPEMD160=o._createHmacHelper(d)}(),i.RIPEMD160)},function(t,e,r){var i,n,o,s,a,h,u,f,l;t.exports=(l=r(1),r(52),r(53),o=(n=(i=l).lib).Base,s=n.WordArray,h=(a=i.algo).SHA1,u=a.HMAC,f=a.PBKDF2=o.extend({cfg:o.extend({keySize:4,hasher:h,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r=this.cfg,i=u.create(r.hasher,t),n=s.create(),o=s.create([1]),a=n.words,h=o.words,f=r.keySize,l=r.iterations;a.length>24&255)){var e=t>>16&255,r=t>>8&255,i=255&t;255===e?(e=0,255===r?(r=0,255===i?i=0:++i):++r):++e,t=0,t+=e<<16,t+=r<<8,t+=i}else t+=1<<24;return t}var r=t.Encryptor=t.extend({processBlock:function(t,r){var i=this._cipher,n=i.blockSize,o=this._iv,s=this._counter;o&&(s=this._counter=o.slice(0),this._iv=void 0),function(t){0===(t[0]=e(t[0]))&&(t[1]=e(t[1]))}(s);var a=s.slice(0);i.encryptBlock(a,0);for(var h=0;h>>2]|=n<<24-o%4*8,t.sigBytes+=n},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},i.pad.Ansix923)},function(t,e,r){var i;t.exports=(i=r(1),r(6),i.pad.Iso10126={pad:function(t,e){var r=4*e,n=r-t.sigBytes%r;t.concat(i.lib.WordArray.random(n-1)).concat(i.lib.WordArray.create([n<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},i.pad.Iso10126)},function(t,e,r){var i;t.exports=(i=r(1),r(6),i.pad.Iso97971={pad:function(t,e){t.concat(i.lib.WordArray.create([2147483648],1)),i.pad.ZeroPadding.pad(t,e)},unpad:function(t){i.pad.ZeroPadding.unpad(t),t.sigBytes--}},i.pad.Iso97971)},function(t,e,r){var i;t.exports=(i=r(1),r(6),i.pad.ZeroPadding={pad:function(t,e){var r=4*e;t.clamp(),t.sigBytes+=r-(t.sigBytes%r||r)},unpad:function(t){for(var e=t.words,r=t.sigBytes-1;!(e[r>>>2]>>>24-r%4*8&255);)r--;t.sigBytes=r+1}},i.pad.ZeroPadding)},function(t,e,r){var i;t.exports=(i=r(1),r(6),i.pad.NoPadding={pad:function(){},unpad:function(){}},i.pad.NoPadding)},function(t,e,r){var i,n,o,s;t.exports=(s=r(1),r(6),n=(i=s).lib.CipherParams,o=i.enc.Hex,i.format.Hex={stringify:function(t){return t.ciphertext.toString(o)},parse:function(t){var e=o.parse(t);return n.create({ciphertext:e})}},s.format.Hex)},function(t,e,r){var i;t.exports=(i=r(1),r(23),r(24),r(20),r(6),function(){var t=i,e=t.lib.BlockCipher,r=t.algo,n=[],o=[],s=[],a=[],h=[],u=[],f=[],l=[],c=[],d=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var r=0,i=0;for(e=0;e<256;e++){var p=i^i<<1^i<<2^i<<3^i<<4;p=p>>>8^255&p^99,n[r]=p,o[p]=r;var m=t[r],v=t[m],g=t[v],y=257*t[p]^16843008*p;s[r]=y<<24|y>>>8,a[r]=y<<16|y>>>16,h[r]=y<<8|y>>>24,u[r]=y,y=16843009*g^65537*v^257*m^16843008*r,f[p]=y<<24|y>>>8,l[p]=y<<16|y>>>16,c[p]=y<<8|y>>>24,d[p]=y,r?(r=m^t[t[t[g^m]]],i^=t[t[i]]):r=i=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],m=r.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,r=t.sigBytes/4,i=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],s=0;s6&&s%r==4&&(a=n[a>>>24]<<24|n[a>>>16&255]<<16|n[a>>>8&255]<<8|n[255&a]):(a=n[(a=a<<8|a>>>24)>>>24]<<24|n[a>>>16&255]<<16|n[a>>>8&255]<<8|n[255&a],a^=p[s/r|0]<<24),o[s]=o[s-r]^a}for(var h=this._invKeySchedule=[],u=0;u>>24]]^l[n[a>>>16&255]]^c[n[a>>>8&255]]^d[n[255&a]]}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,s,a,h,u,n)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,f,l,c,d,o),r=t[e+1],t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,i,n,o,s,a){for(var h=this._nRounds,u=t[e]^r[0],f=t[e+1]^r[1],l=t[e+2]^r[2],c=t[e+3]^r[3],d=4,p=1;p>>24]^n[f>>>16&255]^o[l>>>8&255]^s[255&c]^r[d++],v=i[f>>>24]^n[l>>>16&255]^o[c>>>8&255]^s[255&u]^r[d++],g=i[l>>>24]^n[c>>>16&255]^o[u>>>8&255]^s[255&f]^r[d++],y=i[c>>>24]^n[u>>>16&255]^o[f>>>8&255]^s[255&l]^r[d++];u=m,f=v,l=g,c=y}m=(a[u>>>24]<<24|a[f>>>16&255]<<16|a[l>>>8&255]<<8|a[255&c])^r[d++],v=(a[f>>>24]<<24|a[l>>>16&255]<<16|a[c>>>8&255]<<8|a[255&u])^r[d++],g=(a[l>>>24]<<24|a[c>>>16&255]<<16|a[u>>>8&255]<<8|a[255&f])^r[d++],y=(a[c>>>24]<<24|a[u>>>16&255]<<16|a[f>>>8&255]<<8|a[255&l])^r[d++],t[e]=m,t[e+1]=v,t[e+2]=g,t[e+3]=y},keySize:8});t.AES=e._createHelper(m)}(),i.AES)},function(t,e,r){var i;t.exports=(i=r(1),r(23),r(24),r(20),r(6),function(){var t=i,e=t.lib,r=e.WordArray,n=e.BlockCipher,o=t.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],h=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],f=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],l=o.DES=n.extend({_doReset:function(){for(var t=this._key.words,e=[],r=0;r<56;r++){var i=s[r]-1;e[r]=t[i>>>5]>>>31-i%32&1}for(var n=this._subKeys=[],o=0;o<16;o++){var u=n[o]=[],f=h[o];for(r=0;r<24;r++)u[r/6|0]|=e[(a[r]-1+f)%28]<<31-r%6,u[4+(r/6|0)]|=e[28+(a[r+24]-1+f)%28]<<31-r%6;for(u[0]=u[0]<<1|u[0]>>>31,r=1;r<7;r++)u[r]=u[r]>>>4*(r-1)+3;u[7]=u[7]<<5|u[7]>>>27}var l=this._invSubKeys=[];for(r=0;r<16;r++)l[r]=n[15-r]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,r){this._lBlock=t[e],this._rBlock=t[e+1],c.call(this,4,252645135),c.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),c.call(this,1,1431655765);for(var i=0;i<16;i++){for(var n=r[i],o=this._lBlock,s=this._rBlock,a=0,h=0;h<8;h++)a|=u[h][((s^n[h])&f[h])>>>0];this._lBlock=s,this._rBlock=o^a}var l=this._lBlock;this._lBlock=this._rBlock,this._rBlock=l,c.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),c.call(this,16,65535),c.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function c(t,e){var r=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=r,this._lBlock^=r<>>t^this._lBlock)&e;this._lBlock^=r,this._rBlock^=r<>>2]>>>24-s%4*8&255;o=(o+i[n]+a)%256;var h=i[n];i[n]=i[o],i[o]=h}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var t=this._S,e=this._i,r=this._j,i=0,n=0;n<4;n++){r=(r+t[e=(e+1)%256])%256;var o=t[e];t[e]=t[r],t[r]=o,i|=t[(t[e]+t[r])%256]<<24-8*n}return this._i=e,this._j=r,i}t.RC4=e._createHelper(n);var s=r.RC4Drop=n.extend({cfg:n.cfg.extend({drop:192}),_doReset:function(){n._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)o.call(this)}});t.RC4Drop=e._createHelper(s)}(),i.RC4)},function(t,e,r){var i;t.exports=(i=r(1),r(23),r(24),r(20),r(6),function(){var t=i,e=t.lib.StreamCipher,r=t.algo,n=[],o=[],s=[],a=r.Rabbit=e.extend({_doReset:function(){for(var t=this._key.words,e=this.cfg.iv,r=0;r<4;r++)t[r]=16711935&(t[r]<<8|t[r]>>>24)|4278255360&(t[r]<<24|t[r]>>>8);var i=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],n=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];for(this._b=0,r=0;r<4;r++)h.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(e){var o=e.words,s=o[0],a=o[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=u>>>16|4294901760&f,c=f<<16|65535&u;for(n[0]^=u,n[1]^=l,n[2]^=f,n[3]^=c,n[4]^=u,n[5]^=l,n[6]^=f,n[7]^=c,r=0;r<4;r++)h.call(this)}},_doProcessBlock:function(t,e){var r=this._X;h.call(this),n[0]=r[0]^r[5]>>>16^r[3]<<16,n[1]=r[2]^r[7]>>>16^r[5]<<16,n[2]=r[4]^r[1]>>>16^r[7]<<16,n[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)n[i]=16711935&(n[i]<<8|n[i]>>>24)|4278255360&(n[i]<<24|n[i]>>>8),t[e+i]^=n[i]},blockSize:4,ivSize:2});function h(){for(var t=this._X,e=this._C,r=0;r<8;r++)o[r]=e[r];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0,r=0;r<8;r++){var i=t[r]+e[r],n=65535&i,a=i>>>16,h=((n*n>>>17)+n*a>>>15)+a*a,u=((4294901760&i)*i|0)+((65535&i)*i|0);s[r]=h^u}t[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,t[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,t[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,t[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,t[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,t[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,t[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,t[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}t.Rabbit=e._createHelper(a)}(),i.Rabbit)},function(t,e,r){var i;t.exports=(i=r(1),r(23),r(24),r(20),r(6),function(){var t=i,e=t.lib.StreamCipher,r=t.algo,n=[],o=[],s=[],a=r.RabbitLegacy=e.extend({_doReset:function(){var t=this._key.words,e=this.cfg.iv,r=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],i=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var n=0;n<4;n++)h.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(e){var o=e.words,s=o[0],a=o[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=u>>>16|4294901760&f,c=f<<16|65535&u;for(i[0]^=u,i[1]^=l,i[2]^=f,i[3]^=c,i[4]^=u,i[5]^=l,i[6]^=f,i[7]^=c,n=0;n<4;n++)h.call(this)}},_doProcessBlock:function(t,e){var r=this._X;h.call(this),n[0]=r[0]^r[5]>>>16^r[3]<<16,n[1]=r[2]^r[7]>>>16^r[5]<<16,n[2]=r[4]^r[1]>>>16^r[7]<<16,n[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)n[i]=16711935&(n[i]<<8|n[i]>>>24)|4278255360&(n[i]<<24|n[i]>>>8),t[e+i]^=n[i]},blockSize:4,ivSize:2});function h(){for(var t=this._X,e=this._C,r=0;r<8;r++)o[r]=e[r];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0,r=0;r<8;r++){var i=t[r]+e[r],n=65535&i,a=i>>>16,h=((n*n>>>17)+n*a>>>15)+a*a,u=((4294901760&i)*i|0)+((65535&i)*i|0);s[r]=h^u}t[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,t[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,t[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,t[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,t[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,t[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,t[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,t[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}t.RabbitLegacy=e._createHelper(a)}(),i.RabbitLegacy)},function(t,e,r){(function(t,i){var n;!function(o){var s=(t&&t.exports,"object"==typeof i&&i);s.global!==s&&s.window;var a,h,u,f=String.fromCharCode;function l(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n=55296&&t<=57343)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function d(t,e){return f(t>>e&63|128)}function p(t){if(0==(4294967168&t))return f(t);var e="";return 0==(4294965248&t)?e=f(t>>6&31|192):0==(4294901760&t)?(c(t),e=f(t>>12&15|224),e+=d(t,6)):0==(4292870144&t)&&(e=f(t>>18&7|240),e+=d(t,12),e+=d(t,6)),e+f(63&t|128)}function m(){if(u>=h)throw Error("Invalid byte index");var t=255&a[u];if(u++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function v(){var t,e;if(u>h)throw Error("Invalid byte index");if(u==h)return!1;if(t=255&a[u],u++,0==(128&t))return t;if(192==(224&t)){if((e=(31&t)<<6|m())>=128)return e;throw Error("Invalid continuation byte")}if(224==(240&t)){if((e=(15&t)<<12|m()<<6|m())>=2048)return c(e),e;throw Error("Invalid continuation byte")}if(240==(248&t)&&(e=(7&t)<<18|m()<<12|m()<<6|m())>=65536&&e<=1114111)return e;throw Error("Invalid UTF-8 detected")}var g={version:"2.1.2",encode:function(t){for(var e=l(t),r=e.length,i=-1,n="";++i65535&&(n+=f((e-=65536)>>>10&1023|55296),e=56320|1023&e),n+=f(e);return n}(r)}};void 0===(n=function(){return g}.call(e,r,e,t))||(t.exports=n)}()}).call(this,r(54)(t),r(7))},function(t,e,r){var i=r(18),n=r(5),o=r(21),s=r(26),a=r(41),h=r(143),u=r(44),f=r(43),l=r(155),c=r(156),d=r(42),p=r(159),m=function(t){return n.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getBlockByHash":"eth_getBlockByNumber"},v=function(t){return n.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getTransactionByBlockHashAndIndex":"eth_getTransactionByBlockNumberAndIndex"},g=function(t){return n.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getUncleByBlockHashAndIndex":"eth_getUncleByBlockNumberAndIndex"},y=function(t){return n.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getBlockTransactionCountByHash":"eth_getBlockTransactionCountByNumber"},b=function(t){return n.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getUncleCountByBlockHash":"eth_getUncleCountByBlockNumber"};function w(t){this._requestManager=t._requestManager;var e=this;M().forEach((function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)})),_().forEach((function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)})),this.iban=d,this.sendIBANTransaction=p.bind(null,this)}Object.defineProperty(w.prototype,"defaultBlock",{get:function(){return a.defaultBlock},set:function(t){return a.defaultBlock=t,t}}),Object.defineProperty(w.prototype,"defaultAccount",{get:function(){return a.defaultAccount},set:function(t){return a.defaultAccount=t,t}});var M=function(){var t=new o({name:"getBalance",call:"eth_getBalance",params:2,inputFormatter:[i.inputAddressFormatter,i.inputDefaultBlockNumberFormatter],outputFormatter:i.outputBigNumberFormatter}),e=new o({name:"getStorageAt",call:"eth_getStorageAt",params:3,inputFormatter:[null,n.toHex,i.inputDefaultBlockNumberFormatter]}),r=new o({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[i.inputAddressFormatter,i.inputDefaultBlockNumberFormatter]}),s=new o({name:"getBlock",call:m,params:2,inputFormatter:[i.inputBlockNumberFormatter,function(t){return!!t}],outputFormatter:i.outputBlockFormatter}),a=new o({name:"getUncle",call:g,params:2,inputFormatter:[i.inputBlockNumberFormatter,n.toHex],outputFormatter:i.outputBlockFormatter}),h=new o({name:"getCompilers",call:"eth_getCompilers",params:0}),u=new o({name:"getBlockTransactionCount",call:y,params:1,inputFormatter:[i.inputBlockNumberFormatter],outputFormatter:n.toDecimal}),f=new o({name:"getBlockUncleCount",call:b,params:1,inputFormatter:[i.inputBlockNumberFormatter],outputFormatter:n.toDecimal}),l=new o({name:"getTransaction",call:"eth_getTransactionByHash",params:1,outputFormatter:i.outputTransactionFormatter}),c=new o({name:"getTransactionFromBlock",call:v,params:2,inputFormatter:[i.inputBlockNumberFormatter,n.toHex],outputFormatter:i.outputTransactionFormatter}),d=new o({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,outputFormatter:i.outputTransactionReceiptFormatter}),p=new o({name:"getTransactionCount",call:"eth_getTransactionCount",params:2,inputFormatter:[null,i.inputDefaultBlockNumberFormatter],outputFormatter:n.toDecimal}),w=new o({name:"sendRawTransaction",call:"eth_sendRawTransaction",params:1,inputFormatter:[null]}),M=new o({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[i.inputTransactionFormatter]}),_=new o({name:"signTransaction",call:"eth_signTransaction",params:1,inputFormatter:[i.inputTransactionFormatter]}),S=new o({name:"sign",call:"eth_sign",params:2,inputFormatter:[i.inputAddressFormatter,null]});return[t,e,r,s,a,h,u,f,l,c,d,p,new o({name:"call",call:"eth_call",params:2,inputFormatter:[i.inputCallFormatter,i.inputDefaultBlockNumberFormatter]}),new o({name:"estimateGas",call:"eth_estimateGas",params:1,inputFormatter:[i.inputCallFormatter],outputFormatter:n.toDecimal}),w,_,M,S,new o({name:"compile.solidity",call:"eth_compileSolidity",params:1}),new o({name:"compile.lll",call:"eth_compileLLL",params:1}),new o({name:"compile.serpent",call:"eth_compileSerpent",params:1}),new o({name:"submitWork",call:"eth_submitWork",params:3}),new o({name:"getWork",call:"eth_getWork",params:0})]},_=function(){return[new s({name:"coinbase",getter:"eth_coinbase"}),new s({name:"mining",getter:"eth_mining"}),new s({name:"hashrate",getter:"eth_hashrate",outputFormatter:n.toDecimal}),new s({name:"syncing",getter:"eth_syncing",outputFormatter:i.outputSyncingFormatter}),new s({name:"gasPrice",getter:"eth_gasPrice",outputFormatter:i.outputBigNumberFormatter}),new s({name:"accounts",getter:"eth_accounts"}),new s({name:"blockNumber",getter:"eth_blockNumber",outputFormatter:n.toDecimal}),new s({name:"protocolVersion",getter:"eth_protocolVersion"})]};w.prototype.contract=function(t){return new h(this,t)},w.prototype.filter=function(t,e,r){return new f(t,"eth",this._requestManager,u.eth(),i.outputLogFormatter,e,r)},w.prototype.namereg=function(){return this.contract(c.global.abi).at(c.global.address)},w.prototype.icapNamereg=function(){return this.contract(c.icap.abi).at(c.icap.address)},w.prototype.isSyncing=function(t){return new l(this._requestManager,t)},t.exports=w},function(t,e,r){var i=r(5),n=r(55),o=r(78),s=r(153),a=r(154),h=function(t,e){return t.filter((function(t){return"constructor"===t.type&&t.inputs.length===e.length})).map((function(t){return t.inputs.map((function(t){return t.type}))})).map((function(t){return n.encodeParams(t,e)}))[0]||""},u=function(t){t.abi.filter((function(t){return"function"===t.type})).map((function(e){return new s(t._eth,e,t.address)})).forEach((function(e){e.attachToContract(t)}))},f=function(t){var e=t.abi.filter((function(t){return"event"===t.type}));new a(t._eth._requestManager,e,t.address).attachToContract(t),e.map((function(e){return new o(t._eth._requestManager,e,t.address)})).forEach((function(e){e.attachToContract(t)}))},l=function(t,e){var r=0,i=!1,n=t._eth.filter("latest",(function(o){if(!o&&!i)if(++r>50){if(n.stopWatching((function(){})),i=!0,!e)throw new Error("Contract transaction couldn't be found after 50 blocks");e(new Error("Contract transaction couldn't be found after 50 blocks"))}else t._eth.getTransactionReceipt(t.transactionHash,(function(r,o){o&&o.blockHash&&!i&&t._eth.getCode(o.contractAddress,(function(r,s){if(!i&&s)if(n.stopWatching((function(){})),i=!0,s.length>3)t.address=o.contractAddress,u(t),f(t),e&&e(null,t);else{if(!e)throw new Error("The contract code couldn't be stored, please check your gas amount.");e(new Error("The contract code couldn't be stored, please check your gas amount."))}}))}))}))},c=function(t,e){this.eth=t,this.abi=e,this.new=function(){var t,r=new d(this.eth,this.abi),n={},o=Array.prototype.slice.call(arguments);i.isFunction(o[o.length-1])&&(t=o.pop());var s=o[o.length-1];if(i.isObject(s)&&!i.isArray(s)&&(n=o.pop()),n.value>0){var a=e.filter((function(t){return"constructor"===t.type&&t.inputs.length===o.length}))[0]||{};if(!a.payable)throw new Error("Cannot send value to non-payable constructor")}var u=h(this.abi,o);if(n.data+=u,t)this.eth.sendTransaction(n,(function(e,i){e?t(e):(r.transactionHash=i,t(null,r),l(r,t))}));else{var f=this.eth.sendTransaction(n);r.transactionHash=f,l(r)}return r},this.new.getData=this.getData.bind(this)};c.prototype.at=function(t,e){var r=new d(this.eth,this.abi,t);return u(r),f(r),e&&e(null,r),r},c.prototype.getData=function(){var t={},e=Array.prototype.slice.call(arguments),r=e[e.length-1];i.isObject(r)&&!i.isArray(r)&&(t=e.pop());var n=h(this.abi,e);return t.data+=n,t.data};var d=function(t,e,r){this._eth=t,this.transactionHash=null,this.address=r,this.abi=e};t.exports=c},function(t,e,r){var i=r(13),n=r(16),o=function(){this._inputFormatter=i.formatInputInt,this._outputFormatter=i.formatOutputAddress};(o.prototype=new n({})).constructor=o,o.prototype.isType=function(t){return!!t.match(/address(\[([0-9]*)\])?/)},t.exports=o},function(t,e,r){var i=r(13),n=r(16),o=function(){this._inputFormatter=i.formatInputBool,this._outputFormatter=i.formatOutputBool};(o.prototype=new n({})).constructor=o,o.prototype.isType=function(t){return!!t.match(/^bool(\[([0-9]*)\])*$/)},t.exports=o},function(t,e,r){var i=r(13),n=r(16),o=function(){this._inputFormatter=i.formatInputInt,this._outputFormatter=i.formatOutputInt};(o.prototype=new n({})).constructor=o,o.prototype.isType=function(t){return!!t.match(/^int([0-9]*)?(\[([0-9]*)\])*$/)},t.exports=o},function(t,e,r){var i=r(13),n=r(16),o=function(){this._inputFormatter=i.formatInputInt,this._outputFormatter=i.formatOutputUInt};(o.prototype=new n({})).constructor=o,o.prototype.isType=function(t){return!!t.match(/^uint([0-9]*)?(\[([0-9]*)\])*$/)},t.exports=o},function(t,e,r){var i=r(13),n=r(16),o=function(){this._inputFormatter=i.formatInputDynamicBytes,this._outputFormatter=i.formatOutputDynamicBytes};(o.prototype=new n({})).constructor=o,o.prototype.isType=function(t){return!!t.match(/^bytes(\[([0-9]*)\])*$/)},o.prototype.isDynamicType=function(){return!0},t.exports=o},function(t,e,r){var i=r(13),n=r(16),o=function(){this._inputFormatter=i.formatInputString,this._outputFormatter=i.formatOutputString};(o.prototype=new n({})).constructor=o,o.prototype.isType=function(t){return!!t.match(/^string(\[([0-9]*)\])*$/)},o.prototype.isDynamicType=function(){return!0},t.exports=o},function(t,e,r){var i=r(13),n=r(16),o=function(){this._inputFormatter=i.formatInputReal,this._outputFormatter=i.formatOutputReal};(o.prototype=new n({})).constructor=o,o.prototype.isType=function(t){return!!t.match(/real([0-9]*)?(\[([0-9]*)\])?/)},t.exports=o},function(t,e,r){var i=r(13),n=r(16),o=function(){this._inputFormatter=i.formatInputReal,this._outputFormatter=i.formatOutputUReal};(o.prototype=new n({})).constructor=o,o.prototype.isType=function(t){return!!t.match(/^ureal([0-9]*)?(\[([0-9]*)\])*$/)},t.exports=o},function(t,e,r){var i=r(13),n=r(16),o=function(){this._inputFormatter=i.formatInputBytes,this._outputFormatter=i.formatOutputBytes};(o.prototype=new n({})).constructor=o,o.prototype.isType=function(t){return!!t.match(/^bytes([0-9]{1,})(\[([0-9]*)\])*$/)},t.exports=o},function(t,e,r){var i=r(55),n=r(5),o=r(25),s=r(18),a=r(35),h=function(t,e,r){this._eth=t,this._inputTypes=e.inputs.map((function(t){return t.type})),this._outputTypes=e.outputs.map((function(t){return t.type})),this._constant="view"===e.stateMutability||"pure"===e.stateMutability||e.constant,this._payable="payable"===e.stateMutability||e.payable,this._name=n.transformToFullName(e),this._address=r};h.prototype.extractCallback=function(t){if(n.isFunction(t[t.length-1]))return t.pop()},h.prototype.extractDefaultBlock=function(t){if(t.length>this._inputTypes.length&&!n.isObject(t[t.length-1]))return s.inputDefaultBlockNumberFormatter(t.pop())},h.prototype.validateArgs=function(t){if(t.filter((function(t){return!(!0===n.isObject(t)&&!1===n.isArray(t)&&!1===n.isBigNumber(t))})).length!==this._inputTypes.length)throw o.InvalidNumberOfSolidityArgs()},h.prototype.toPayload=function(t){var e={};return t.length>this._inputTypes.length&&n.isObject(t[t.length-1])&&(e=t[t.length-1]),this.validateArgs(t),e.to=this._address,e.data="0x"+this.signature()+i.encodeParams(this._inputTypes,t),e},h.prototype.signature=function(){return a(this._name).slice(0,8)},h.prototype.unpackOutput=function(t){if(t){t=t.length>=2?t.slice(2):t;var e=i.decodeParams(this._outputTypes,t);return 1===e.length?e[0]:e}},h.prototype.call=function(){var t=Array.prototype.slice.call(arguments).filter((function(t){return void 0!==t})),e=this.extractCallback(t),r=this.extractDefaultBlock(t),i=this.toPayload(t);if(!e){var n=this._eth.call(i,r);return this.unpackOutput(n)}var o=this;this._eth.call(i,r,(function(t,r){if(t)return e(t,null);var i=null;try{i=o.unpackOutput(r)}catch(e){t=e}e(t,i)}))},h.prototype.sendTransaction=function(){var t=Array.prototype.slice.call(arguments).filter((function(t){return void 0!==t})),e=this.extractCallback(t),r=this.toPayload(t);if(r.value>0&&!this._payable)throw new Error("Cannot send value to non-payable function");if(!e)return this._eth.sendTransaction(r);this._eth.sendTransaction(r,e)},h.prototype.estimateGas=function(){var t=Array.prototype.slice.call(arguments),e=this.extractCallback(t),r=this.toPayload(t);if(!e)return this._eth.estimateGas(r);this._eth.estimateGas(r,e)},h.prototype.getData=function(){var t=Array.prototype.slice.call(arguments),e=this.toPayload(t);return e.data},h.prototype.displayName=function(){return n.extractDisplayName(this._name)},h.prototype.typeName=function(){return n.extractTypeName(this._name)},h.prototype.request=function(){var t=Array.prototype.slice.call(arguments),e=this.extractCallback(t),r=this.toPayload(t),i=this.unpackOutput.bind(this);return{method:this._constant?"eth_call":"eth_sendTransaction",callback:e,params:[r],format:i}},h.prototype.execute=function(){var t=!this._constant;return t?this.sendTransaction.apply(this,Array.prototype.slice.call(arguments)):this.call.apply(this,Array.prototype.slice.call(arguments))},h.prototype.attachToContract=function(t){var e=this.execute.bind(this);e.request=this.request.bind(this),e.call=this.call.bind(this),e.sendTransaction=this.sendTransaction.bind(this),e.estimateGas=this.estimateGas.bind(this),e.getData=this.getData.bind(this);var r=this.displayName();t[r]||(t[r]=e),t[r][this.typeName()]=e},t.exports=h},function(t,e,r){var i=r(35),n=r(78),o=r(18),s=r(5),a=r(43),h=r(44),u=function(t,e,r){this._requestManager=t,this._json=e,this._address=r};u.prototype.encode=function(t){t=t||{};var e={};return["fromBlock","toBlock"].filter((function(e){return void 0!==t[e]})).forEach((function(r){e[r]=o.inputBlockNumberFormatter(t[r])})),e.address=this._address,e},u.prototype.decode=function(t){t.data=t.data||"";var e=s.isArray(t.topics)&&s.isString(t.topics[0])?t.topics[0].slice(2):"",r=this._json.filter((function(t){return e===i(s.transformToFullName(t))}))[0];return r?new n(this._requestManager,r,this._address).decode(t):o.outputLogFormatter(t)},u.prototype.execute=function(t,e){s.isFunction(arguments[arguments.length-1])&&(e=arguments[arguments.length-1],1===arguments.length&&(t=null));var r=this.encode(t),i=this.decode.bind(this);return new a(r,"eth",this._requestManager,h.eth(),i,e)},u.prototype.attachToContract=function(t){var e=this.execute.bind(this);t.allEvents=e},t.exports=u},function(t,e,r){var i=r(18),n=r(5),o=1,s=function(t,e){return this.requestManager=t,this.pollId="syncPoll_"+o++,this.callbacks=[],this.addCallback(e),this.lastSyncState=!1,function(t){t.requestManager.startPolling({method:"eth_syncing",params:[]},t.pollId,(function(e,r){if(e)return t.callbacks.forEach((function(t){t(e)}));n.isObject(r)&&r.startingBlock&&(r=i.outputSyncingFormatter(r)),t.callbacks.forEach((function(e){t.lastSyncState!==r&&(!t.lastSyncState&&n.isObject(r)&&e(null,!0),setTimeout((function(){e(null,r)}),0),t.lastSyncState=r)}))}),t.stopWatching.bind(t))}(this),this};s.prototype.addCallback=function(t){return t&&this.callbacks.push(t),this},s.prototype.stopWatching=function(){this.requestManager.stopPolling(this.pollId),this.callbacks=[]},t.exports=s},function(t,e,r){var i=r(157),n=r(158);t.exports={global:{abi:i,address:"0xc6d9d2cd449a754c494264e1809c50e34d64562b"},icap:{abi:n,address:"0xa1a111bc074c9cfa781f0c38e63bd51c91b8af00"}}},function(t){t.exports=JSON.parse('[{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"name","outputs":[{"name":"o_name","type":"bytes32"}],"type":"function"},{"constant":true,"inputs":[{"name":"_name","type":"bytes32"}],"name":"owner","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":true,"inputs":[{"name":"_name","type":"bytes32"}],"name":"content","outputs":[{"name":"","type":"bytes32"}],"type":"function"},{"constant":true,"inputs":[{"name":"_name","type":"bytes32"}],"name":"addr","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"}],"name":"reserve","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"_name","type":"bytes32"}],"name":"subRegistrar","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"},{"name":"_newOwner","type":"address"}],"name":"transfer","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"},{"name":"_registrar","type":"address"}],"name":"setSubRegistrar","outputs":[],"type":"function"},{"constant":false,"inputs":[],"name":"Registrar","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"},{"name":"_a","type":"address"},{"name":"_primary","type":"bool"}],"name":"setAddress","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"},{"name":"_content","type":"bytes32"}],"name":"setContent","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"}],"name":"disown","outputs":[],"type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_name","type":"bytes32"},{"indexed":false,"name":"_winner","type":"address"}],"name":"AuctionEnded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_name","type":"bytes32"},{"indexed":false,"name":"_bidder","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"NewBid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"name","type":"bytes32"}],"name":"Changed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"name","type":"bytes32"},{"indexed":true,"name":"addr","type":"address"}],"name":"PrimaryChanged","type":"event"}]')},function(t){t.exports=JSON.parse('[{"constant":true,"inputs":[{"name":"_name","type":"bytes32"}],"name":"owner","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"},{"name":"_refund","type":"address"}],"name":"disown","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"_name","type":"bytes32"}],"name":"addr","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"}],"name":"reserve","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"},{"name":"_newOwner","type":"address"}],"name":"transfer","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"},{"name":"_a","type":"address"}],"name":"setAddr","outputs":[],"type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"name","type":"bytes32"}],"name":"Changed","type":"event"}]')},function(t,e,r){var i=r(42),n=r(160),o=function(t,e,r,i,o,s){var a=n;return t.contract(a).at(r).deposit(o,{from:e,value:i},s)};t.exports=function(t,e,r,n,s){var a=new i(r);if(!a.isValid())throw new Error("invalid iban address");if(a.isDirect())return function(t,e,r,i,n){return t.sendTransaction({address:r,from:e,value:i},n)}(t,e,a.address(),n,s);if(!s){var h=t.icapNamereg().addr(a.institution());return o(t,e,h,n,a.client())}t.icapNamereg().addr(a.institution(),(function(r,i){return o(t,e,i,n,a.client(),s)}))}},function(t){t.exports=JSON.parse('[{"constant":false,"inputs":[{"name":"from","type":"bytes32"},{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transfer","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"from","type":"bytes32"},{"name":"to","type":"address"},{"name":"indirectId","type":"bytes32"},{"name":"value","type":"uint256"}],"name":"icapTransfer","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"to","type":"bytes32"}],"name":"deposit","outputs":[],"payable":true,"type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"AnonymousDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"bytes32"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"bytes32"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"bytes32"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"indirectId","type":"bytes32"},{"indexed":false,"name":"value","type":"uint256"}],"name":"IcapTransfer","type":"event"}]')},function(t,e,r){var i=r(21);t.exports=function(t){this._requestManager=t._requestManager;var e=this;[new i({name:"putString",call:"db_putString",params:3}),new i({name:"getString",call:"db_getString",params:2}),new i({name:"putHex",call:"db_putHex",params:3}),new i({name:"getHex",call:"db_getHex",params:2})].forEach((function(r){r.attachToObject(e),r.setRequestManager(t._requestManager)}))}},function(t,e,r){var i=r(21),n=r(43),o=r(44),s=function(t){this._requestManager=t._requestManager;var e=this;a().forEach((function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)}))};s.prototype.newMessageFilter=function(t,e,r){return new n(t,"shh",this._requestManager,o.shh(),null,e,r)};var a=function(){return[new i({name:"version",call:"shh_version",params:0}),new i({name:"info",call:"shh_info",params:0}),new i({name:"setMaxMessageSize",call:"shh_setMaxMessageSize",params:1}),new i({name:"setMinPoW",call:"shh_setMinPoW",params:1}),new i({name:"markTrustedPeer",call:"shh_markTrustedPeer",params:1}),new i({name:"newKeyPair",call:"shh_newKeyPair",params:0}),new i({name:"addPrivateKey",call:"shh_addPrivateKey",params:1}),new i({name:"deleteKeyPair",call:"shh_deleteKeyPair",params:1}),new i({name:"hasKeyPair",call:"shh_hasKeyPair",params:1}),new i({name:"getPublicKey",call:"shh_getPublicKey",params:1}),new i({name:"getPrivateKey",call:"shh_getPrivateKey",params:1}),new i({name:"newSymKey",call:"shh_newSymKey",params:0}),new i({name:"addSymKey",call:"shh_addSymKey",params:1}),new i({name:"generateSymKeyFromPassword",call:"shh_generateSymKeyFromPassword",params:1}),new i({name:"hasSymKey",call:"shh_hasSymKey",params:1}),new i({name:"getSymKey",call:"shh_getSymKey",params:1}),new i({name:"deleteSymKey",call:"shh_deleteSymKey",params:1}),new i({name:"post",call:"shh_post",params:1,inputFormatter:[null]})]};t.exports=s},function(t,e,r){var i=r(5),n=r(26);t.exports=function(t){this._requestManager=t._requestManager;var e=this;[new n({name:"listening",getter:"net_listening"}),new n({name:"peerCount",getter:"net_peerCount",outputFormatter:i.toDecimal})].forEach((function(r){r.attachToObject(e),r.setRequestManager(t._requestManager)}))}},function(t,e,r){var i=r(21),n=r(26),o=r(18);t.exports=function(t){this._requestManager=t._requestManager;var e=this;(function(){var t=new i({name:"newAccount",call:"personal_newAccount",params:1,inputFormatter:[null]}),e=new i({name:"importRawKey",call:"personal_importRawKey",params:2}),r=new i({name:"sign",call:"personal_sign",params:3,inputFormatter:[null,o.inputAddressFormatter,null]}),n=new i({name:"ecRecover",call:"personal_ecRecover",params:2});return[t,e,new i({name:"unlockAccount",call:"personal_unlockAccount",params:3,inputFormatter:[o.inputAddressFormatter,null,null]}),n,r,new i({name:"sendTransaction",call:"personal_sendTransaction",params:2,inputFormatter:[o.inputTransactionFormatter,null]}),new i({name:"lockAccount",call:"personal_lockAccount",params:1,inputFormatter:[o.inputAddressFormatter]})]})().forEach((function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)})),[new n({name:"listAccounts",getter:"personal_listAccounts"})].forEach((function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)}))}},function(t,e,r){var i=r(21),n=r(26);t.exports=function(t){this._requestManager=t._requestManager;var e=this;[new i({name:"blockNetworkRead",call:"bzz_blockNetworkRead",params:1,inputFormatter:[null]}),new i({name:"syncEnabled",call:"bzz_syncEnabled",params:1,inputFormatter:[null]}),new i({name:"swapEnabled",call:"bzz_swapEnabled",params:1,inputFormatter:[null]}),new i({name:"download",call:"bzz_download",params:2,inputFormatter:[null,null]}),new i({name:"upload",call:"bzz_upload",params:2,inputFormatter:[null,null]}),new i({name:"retrieve",call:"bzz_retrieve",params:1,inputFormatter:[null]}),new i({name:"store",call:"bzz_store",params:2,inputFormatter:[null,null]}),new i({name:"get",call:"bzz_get",params:1,inputFormatter:[null]}),new i({name:"put",call:"bzz_put",params:2,inputFormatter:[null,null]}),new i({name:"modify",call:"bzz_modify",params:4,inputFormatter:[null,null,null,null]})].forEach((function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)})),[new n({name:"hive",getter:"bzz_hive"}),new n({name:"info",getter:"bzz_info"})].forEach((function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)}))}},function(t,e){t.exports=function(){this.defaultBlock="latest",this.defaultAccount=void 0}},function(t){t.exports=JSON.parse('{"version":"0.20.7"}')},function(t,e,r){var i=r(18),n=r(5),o=r(21),s=r(26);t.exports=function(t){var e=function(e){var r;e.property?(t[e.property]||(t[e.property]={}),r=t[e.property]):r=t,e.methods&&e.methods.forEach((function(e){e.attachToObject(r),e.setRequestManager(t._requestManager)})),e.properties&&e.properties.forEach((function(e){e.attachToObject(r),e.setRequestManager(t._requestManager)}))};return e.formatters=i,e.utils=n,e.Method=o,e.Property=s,e}},function(t,e,r){var i=r(73),n=r(25),o=function(t){this.requestManager=t._requestManager,this.requests=[]};o.prototype.add=function(t){this.requests.push(t)},o.prototype.execute=function(){var t=this.requests;this.requestManager.sendBatch(t,(function(e,r){r=r||[],t.map((function(t,e){return r[e]||{}})).forEach((function(e,r){if(t[r].callback){if(!i.isValidResponse(e))return t[r].callback(n.InvalidResponse(e));t[r].callback(null,t[r].format?t[r].format(e.result):e.result)}}))}))},t.exports=o},function(t,e,r){(function(e){var i=r(25);"undefined"!=typeof window&&window.XMLHttpRequest?XMLHttpRequest=window.XMLHttpRequest:XMLHttpRequest=r(171).XMLHttpRequest;var n=r(172).XMLHttpRequest,o=function(t,e,r,i,n){this.host=t||"http://localhost:8545",this.timeout=e||0,this.user=r,this.password=i,this.headers=n};o.prototype.prepareRequest=function(t){var r;if(t?(r=new n).timeout=this.timeout:r=new XMLHttpRequest,r.withCredentials=!0,r.open("POST",this.host,t),this.user&&this.password){var i="Basic "+new e(this.user+":"+this.password).toString("base64");r.setRequestHeader("Authorization",i)}return r.setRequestHeader("Content-Type","application/json"),this.headers&&this.headers.forEach((function(t){r.setRequestHeader(t.name,t.value)})),r},o.prototype.send=function(t){var e=this.prepareRequest(!1);try{e.send(JSON.stringify(t))}catch(t){throw i.InvalidConnection(this.host)}var r=e.responseText;try{r=JSON.parse(r)}catch(t){throw i.InvalidResponse(e.responseText)}return r},o.prototype.sendAsync=function(t,e){var r=this.prepareRequest(!0);r.onreadystatechange=function(){if(4===r.readyState&&1!==r.timeout){var t=r.responseText,n=null;try{t=JSON.parse(t)}catch(t){n=i.InvalidResponse(r.responseText)}e(n,t)}},r.ontimeout=function(){e(i.ConnectionTimeout(this.timeout))};try{r.send(JSON.stringify(t))}catch(t){e(i.InvalidConnection(this.host))}},o.prototype.isConnected=function(){try{return this.send({id:9999999999,jsonrpc:"2.0",method:"net_listening",params:[]}),!0}catch(t){return!1}},t.exports=o}).call(this,r(12).Buffer)},function(t,e,r){"undefined"==typeof XMLHttpRequest?e.XMLHttpRequest={}:e.XMLHttpRequest=XMLHttpRequest},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(173));var i=r(57);e.XMLHttpRequestEventTarget=i.XMLHttpRequestEventTarget},function(t,e,r){(function(t,i){var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=this&&this.__assign||Object.assign||function(t){for(var e,r=1,i=arguments.length;r=0)return this._url=this._parseUrl(e.headers.location),this._method="GET",this._loweredHeaders["content-type"]&&(delete this._headers[this._loweredHeaders["content-type"]],delete this._loweredHeaders["content-type"]),null!=this._headers["Content-Type"]&&delete this._headers["Content-Type"],delete this._headers["Content-Length"],this.upload._reset(),this._finalizeHeaders(),void this._sendHxxpRequest();this._response=e,this._response.on("data",(function(t){return i._onHttpResponseData(e,t)})),this._response.on("end",(function(){return i._onHttpResponseEnd(e)})),this._response.on("close",(function(){return i._onHttpResponseClose(e)})),this.responseUrl=this._url.href.split("#")[0],this.status=e.statusCode,this.statusText=a.STATUS_CODES[this.status],this._parseResponseHeaders(e);var n=this._responseHeaders["content-length"]||"";this._totalBytes=+n,this._lengthComputable=!!n,this._setReadyState(r.HEADERS_RECEIVED)}},r.prototype._onHttpResponseData=function(t,e){this._response===t&&(this._responseParts.push(new i(e)),this._loadedBytes+=e.length,this.readyState!==r.LOADING&&this._setReadyState(r.LOADING),this._dispatchProgress("progress"))},r.prototype._onHttpResponseEnd=function(t){this._response===t&&(this._parseResponse(),this._request=null,this._response=null,this._setReadyState(r.DONE),this._dispatchProgress("load"),this._dispatchProgress("loadend"))},r.prototype._onHttpResponseClose=function(t){if(this._response===t){var e=this._request;this._setError(),e.abort(),this._setReadyState(r.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend")}},r.prototype._onHttpTimeout=function(t){this._request===t&&(this._setError(),t.abort(),this._setReadyState(r.DONE),this._dispatchProgress("timeout"),this._dispatchProgress("loadend"))},r.prototype._onHttpRequestError=function(t,e){this._request===t&&(this._setError(),t.abort(),this._setReadyState(r.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend"))},r.prototype._dispatchProgress=function(t){var e=new r.ProgressEvent(t);e.lengthComputable=this._lengthComputable,e.loaded=this._loadedBytes,e.total=this._totalBytes,this.dispatchEvent(e)},r.prototype._setError=function(){this._request=null,this._response=null,this._responseHeaders=null,this._responseParts=null},r.prototype._parseUrl=function(t,e,r){var i=null==this.nodejsBaseUrl?t:f.resolve(this.nodejsBaseUrl,t),n=f.parse(i,!1,!0);n.hash=null;var o=(n.auth||"").split(":"),s=o[0],a=o[1];return(s||a||e||r)&&(n.auth=(e||s||"")+":"+(r||a||"")),n},r.prototype._parseResponseHeaders=function(t){for(var e in this._responseHeaders={},t.headers){var r=e.toLowerCase();this._privateHeaders[r]||(this._responseHeaders[r]=t.headers[e])}null!=this._mimeOverride&&(this._responseHeaders["content-type"]=this._mimeOverride)},r.prototype._parseResponse=function(){var t=i.concat(this._responseParts);switch(this._responseParts=null,this.responseType){case"json":this.responseText=null;try{this.response=JSON.parse(t.toString("utf-8"))}catch(t){this.response=null}return;case"buffer":return this.responseText=null,void(this.response=t);case"arraybuffer":this.responseText=null;for(var e=new ArrayBuffer(t.length),r=new Uint8Array(e),n=0;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,p=String.fromCharCode;function m(t){throw new RangeError(c[t])}function v(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function g(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+v((t=t.replace(l,".")).split("."),e).join(".")}function y(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+p(t)})).join("")}function w(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,r){var i=0;for(t=r?d(t/700):t>>1,t+=d(t/e);t>455;i+=36)t=d(t/35);return d(i+36*t/(t+38))}function _(t){var e,r,i,n,o,s,a,u,f,l,c,p=[],v=t.length,g=0,y=128,w=72;for((r=t.lastIndexOf("-"))<0&&(r=0),i=0;i=128&&m("not-basic"),p.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=v&&m("invalid-input"),((u=(c=t.charCodeAt(n++))-48<10?c-22:c-65<26?c-65:c-97<26?c-97:36)>=36||u>d((h-g)/s))&&m("overflow"),g+=u*s,!(u<(f=a<=w?1:a>=w+26?26:a-w));a+=36)s>d(h/(l=36-f))&&m("overflow"),s*=l;w=M(g-o,e=p.length+1,0==o),d(g/e)>h-y&&m("overflow"),y+=d(g/e),g%=e,p.splice(g++,0,y)}return b(p)}function S(t){var e,r,i,n,o,s,a,u,f,l,c,v,g,b,_,S=[];for(v=(t=y(t)).length,e=128,r=0,o=72,s=0;s=e&&cd((h-r)/(g=i+1))&&m("overflow"),r+=(a-e)*g,e=a,s=0;sh&&m("overflow"),c==e){for(u=r,f=36;!(u<(l=f<=o?1:f>=o+26?26:f-o));f+=36)_=u-l,b=36-l,S.push(p(w(l+_%b,0))),u=d(_/b);S.push(p(w(u,0))),o=M(r,g,i==n),r=0,++i}++r,++e}return S.join("")}a={version:"1.4.1",ucs2:{decode:y,encode:b},decode:_,encode:S,toASCII:function(t){return g(t,(function(t){return f.test(t)?"xn--"+S(t):t}))},toUnicode:function(t){return g(t,(function(t){return u.test(t)?_(t.slice(4).toLowerCase()):t}))}},void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()}).call(this,r(54)(t),r(7))},function(t,e,r){t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,r){e.decode=e.parse=r(180),e.encode=e.stringify=r(181)},function(t,e,r){function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,r,o){e=e||"&",r=r||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var h=1e3;o&&"number"==typeof o.maxKeys&&(h=o.maxKeys);var u=t.length;h>0&&u>h&&(u=h);for(var f=0;f=0?(l=m.substr(0,v),c=m.substr(v+1)):(l=m,c=""),d=decodeURIComponent(l),p=decodeURIComponent(c),i(s,d)?n(s[d])?s[d].push(p):s[d]=[s[d],p]:s[d]=p}return s};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,r){var i=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,r,a){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?o(s(t),(function(s){var a=encodeURIComponent(i(s))+r;return n(t[s])?o(t[s],(function(t){return a+encodeURIComponent(i(t))})).join(e):a+encodeURIComponent(i(t[s]))})).join(e):a?encodeURIComponent(i(a))+r+encodeURIComponent(i(t)):""};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var r=[],i=0;ie?1:0}function s(t,e,n){var s,h=function t(e,n,s,a){var h;if("object"==typeof e&&null!==e){for(h=0;h0)for(var n=0;n-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return u(e,t)},invalidInput:function(t){return u(h.rpc.invalidInput,t)},resourceNotFound:function(t){return u(h.rpc.resourceNotFound,t)},resourceUnavailable:function(t){return u(h.rpc.resourceUnavailable,t)},transactionRejected:function(t){return u(h.rpc.transactionRejected,t)},methodNotSupported:function(t){return u(h.rpc.methodNotSupported,t)}},provider:{userRejectedRequest:function(t){return f(h.provider.userRejectedRequest,t)},unauthorized:function(t){return f(h.provider.unauthorized,t)},unsupportedMethod:function(t){return f(h.provider.unsupportedMethod,t)},custom:function(t){if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");var e=t.code,r=t.message,i=t.data;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new s(e,r,i)}}}},function(t,e,r){(function(t,r,i,n){!function(e){function o(t,e){e|=0;for(var r=Math.max(t.length-e,0),i=Array(r),n=0;n-1&&t%1==0&&t<=9007199254740991}function j(t){return null!=t&&T(t.length)&&!function(t){if(!h(t))return!1;var e=I(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}(t)}var C={};function N(){}function P(t){return function(){if(null!==t){var e=t;t=null,e.apply(this,arguments)}}}var L="function"==typeof Symbol&&Symbol.iterator;function q(t){return null!=t&&"object"==typeof t}function D(t){return q(t)&&"[object Arguments]"==I(t)}var U=Object.prototype,F=U.hasOwnProperty,z=U.propertyIsEnumerable,H=D(function(){return arguments}())?D:function(t){return q(t)&&F.call(t,"callee")&&!z.call(t,"callee")},Z=Array.isArray,W="object"==typeof e&&e&&!e.nodeType&&e,K=W&&"object"==typeof n&&n&&!n.nodeType&&n,V=K&&K.exports===W?S.Buffer:void 0,G=(V?V.isBuffer:void 0)||function(){return!1},Y=/^(?:0|[1-9]\d*)$/;function J(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&Y.test(t))&&t>-1&&t%1==0&&t2&&(i=o(arguments,1)),e){var u={};At(n,(function(t,e){u[e]=t})),u[t]=i,a=!0,h=Object.create(null),r(e,u)}else n[t]=i,p(t)}));s++;var u=b(e[e.length-1]);e.length>1?u(n,i):u(i)}}(t,e)}))}function d(){if(0===u.length&&0===s)return r(null,n);for(;u.length&&s=0&&r.push(i)})),r}At(t,(function(e,r){if(!Z(e))return c(r,[e]),void f.push(r);var i=e.slice(0,e.length-1),n=i.length;if(0===n)return c(r,e),void f.push(r);l[r]=n,kt(i,(function(o){if(!t[o])throw new Error("async.auto task `"+r+"` has a non-existent dependency `"+o+"` in "+i.join(", "));var s,a,u;a=function(){0==--n&&c(r,e)},(u=h[s=o])||(u=h[s]=[]),u.push(a)}))})),function(){for(var t=0;f.length;)t++,kt(m(f.pop()),(function(t){0==--l[t]&&f.push(t)}));if(t!==i)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),d()};function Rt(t,e){for(var r=-1,i=null==t?0:t.length,n=Array(i);++r0?s:t);else if(o)r[e]=t;else{if(i=function(t){return(t=(t=(t=t.toString().replace(Yt,"")).match(Kt)[2].replace(" ",""))?t.split(Vt):[]).map((function(t){return function(t,e,r){var i;if((t=null==(i=t)?"":jt(i))&&(r||void 0===e))return t.replace(Wt,"");if(!t||!(e=jt(e)))return t;var n=Zt(t),o=Zt(e);return function(t,e,r){var i=t.length;return r=void 0===r?i:r,!e&&r>=i?t:function(t,e,r){var i=-1,n=t.length;e<0&&(e=-e>n?0:n+e),(r=r>n?n:r)<0&&(r+=n),n=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(n);++i-1;);return r}(n,o),function(t,e){for(var r=t.length;r--&&Bt(e,t[r],0)>-1;);return r}(n,o)+1).join("")}(t.replace(Gt,""))}))}(t),0===t.length&&!n&&0===i.length)throw new Error("autoInject task functions require explicit parameters.");n||i.pop(),r[e]=i.concat(s)}function s(e,r){var n=Rt(i,(function(t){return e[t]}));n.push(r),b(t).apply(null,n)}})),Ot(r,e)}function Xt(){this.head=this.tail=null,this.length=0}function $t(t,e){t.length=1,t.head=t.tail=e}function Qt(t,e,r){if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var i=b(t),n=0,o=[],s=!1;function a(t,e,r){if(null!=r&&"function"!=typeof r)throw new Error("task callback must be a function");if(f.started=!0,Z(t)||(t=[t]),0===t.length&&f.idle())return d((function(){f.drain()}));for(var i=0,n=t.length;i0&&o.splice(a,1),s.callback.apply(s,arguments),null!=e&&f.error(e,s.data)}n<=f.concurrency-f.buffer&&f.unsaturated(),f.idle()&&f.drain(),f.process()}}var u=!1,f={_tasks:new Xt,concurrency:e,payload:r,saturated:N,unsaturated:N,buffer:e/4,empty:N,drain:N,error:N,started:!1,paused:!1,push:function(t,e){a(t,!1,e)},kill:function(){f.drain=N,f._tasks.empty()},unshift:function(t,e){a(t,!0,e)},remove:function(t){f._tasks.remove(t)},process:function(){if(!u){for(u=!0;!f.paused&&n2&&(n=o(arguments,1)),i[e]=n,r(t)}))}),(function(t){r(t,i)}))}function Je(t,e){Ye(vt,t,e)}function Xe(t,e,r){Ye(lt(e),t,r)}var $e=function(t,e){var r=b(t);return Qt((function(t,e){r(t[0],e)}),e,1)},Qe=function(t,e){var r=$e(t,e);return r.push=function(t,e,i){if(null==i&&(i=N),"function"!=typeof i)throw new Error("task callback must be a function");if(r.started=!0,Z(t)||(t=[t]),0===t.length)return d((function(){r.drain()}));e=e||0;for(var n=r._tasks.head;n&&e>=n.priority;)n=n.next;for(var o=0,s=t.length;oi?1:0}bt(t,(function(t,e){i(t,(function(r,i){if(r)return e(r);e(null,{value:t,criteria:i})}))}),(function(t,e){if(t)return r(t);r(null,Rt(e.sort(n),Ie("value")))}))}function vr(t,e,r){var i=b(t);return a((function(n,o){var s,a=!1;n.push((function(){a||(o.apply(null,arguments),clearTimeout(s))})),s=setTimeout((function(){var e=t.name||"anonymous",i=new Error('Callback function "'+e+'" timed out.');i.code="ETIMEDOUT",r&&(i.info=r),a=!0,o(i)}),e),i.apply(null,n)}))}var gr=Math.ceil,yr=Math.max;function br(t,e,r,i){var n=b(r);_t(function(t,e,r,i){for(var n=-1,o=yr(gr((e-t)/1),0),s=Array(o);o--;)s[++n]=t,t+=1;return s}(0,t),e,n,i)}var wr=dt(br,1/0),Mr=dt(br,1);function _r(t,e,r,i){arguments.length<=3&&(i=r,r=e,e=Z(t)?[]:{}),i=P(i||N);var n=b(r);vt(t,(function(t,r,i){n(e,t,r,i)}),(function(t){i(t,e)}))}function Sr(t,e){var r,i=null;e=e||N,ke(t,(function(t,e){b(t)((function(t,n){r=arguments.length>2?o(arguments,1):n,i=t,e(!t)}))}),(function(){e(i,r)}))}function xr(t){return function(){return(t.unmemoized||t).apply(null,arguments)}}function kr(t,e,r){r=ft(r||N);var i=b(e);if(!t())return r(null);i((function e(n){if(n)return r(n);if(t())return i(e);var s=o(arguments,1);r.apply(null,[null].concat(s))}))}function Ar(t,e,r){kr((function(){return!t.apply(this,arguments)}),e,r)}var Er=function(t,e){if(e=P(e||N),!Z(t))return e(new Error("First argument to waterfall must be an array of functions"));if(!t.length)return e();var r=0;function i(e){var i=b(t[r++]);e.push(ft(n)),i.apply(null,e)}function n(n){if(n||r===t.length)return e.apply(null,arguments);i(o(arguments,1))}i([])},Br={apply:s,applyEach:wt,applyEachSeries:xt,asyncify:p,auto:Ot,autoInject:Jt,cargo:te,compose:ne,concat:ae,concatLimit:se,concatSeries:he,constant:ue,detect:de,detectLimit:pe,detectSeries:me,dir:ge,doDuring:ye,doUntil:we,doWhilst:be,during:Me,each:Se,eachLimit:xe,eachOf:vt,eachOfLimit:ct,eachOfSeries:ee,eachSeries:ke,ensureAsync:Ae,every:Be,everyLimit:Oe,everySeries:Re,filter:Ne,filterLimit:Pe,filterSeries:Le,forever:qe,groupBy:Ue,groupByLimit:De,groupBySeries:Fe,log:ze,map:bt,mapLimit:_t,mapSeries:St,mapValues:Ze,mapValuesLimit:He,mapValuesSeries:We,memoize:Ve,nextTick:Ge,parallel:Je,parallelLimit:Xe,priorityQueue:Qe,queue:$e,race:tr,reduce:re,reduceRight:er,reflect:rr,reflectAll:ir,reject:or,rejectLimit:sr,rejectSeries:ar,retry:ur,retryable:fr,seq:ie,series:lr,setImmediate:d,some:cr,someLimit:dr,someSeries:pr,sortBy:mr,timeout:vr,times:wr,timesLimit:br,timesSeries:Mr,transform:_r,tryEach:Sr,unmemoize:xr,until:Ar,waterfall:Er,whilst:kr,all:Be,allLimit:Oe,allSeries:Re,any:cr,anyLimit:dr,anySeries:pr,find:de,findLimit:pe,findSeries:me,forEach:Se,forEachSeries:ke,forEachLimit:xe,forEachOf:vt,forEachOfSeries:ee,forEachOfLimit:ct,inject:re,foldl:re,foldr:er,select:Ne,selectLimit:Pe,selectSeries:Le,wrapSync:p};e.default=Br,e.apply=s,e.applyEach=wt,e.applyEachSeries=xt,e.asyncify=p,e.auto=Ot,e.autoInject=Jt,e.cargo=te,e.compose=ne,e.concat=ae,e.concatLimit=se,e.concatSeries=he,e.constant=ue,e.detect=de,e.detectLimit=pe,e.detectSeries=me,e.dir=ge,e.doDuring=ye,e.doUntil=we,e.doWhilst=be,e.during=Me,e.each=Se,e.eachLimit=xe,e.eachOf=vt,e.eachOfLimit=ct,e.eachOfSeries=ee,e.eachSeries=ke,e.ensureAsync=Ae,e.every=Be,e.everyLimit=Oe,e.everySeries=Re,e.filter=Ne,e.filterLimit=Pe,e.filterSeries=Le,e.forever=qe,e.groupBy=Ue,e.groupByLimit=De,e.groupBySeries=Fe,e.log=ze,e.map=bt,e.mapLimit=_t,e.mapSeries=St,e.mapValues=Ze,e.mapValuesLimit=He,e.mapValuesSeries=We,e.memoize=Ve,e.nextTick=Ge,e.parallel=Je,e.parallelLimit=Xe,e.priorityQueue=Qe,e.queue=$e,e.race=tr,e.reduce=re,e.reduceRight=er,e.reflect=rr,e.reflectAll=ir,e.reject=or,e.rejectLimit=sr,e.rejectSeries=ar,e.retry=ur,e.retryable=fr,e.seq=ie,e.series=lr,e.setImmediate=d,e.some=cr,e.someLimit=dr,e.someSeries=pr,e.sortBy=mr,e.timeout=vr,e.times=wr,e.timesLimit=br,e.timesSeries=Mr,e.transform=_r,e.tryEach=Sr,e.unmemoize=xr,e.until=Ar,e.waterfall=Er,e.whilst=kr,e.all=Be,e.allLimit=Oe,e.allSeries=Re,e.any=cr,e.anyLimit=dr,e.anySeries=pr,e.find=de,e.findLimit=pe,e.findSeries=me,e.forEach=Se,e.forEachSeries=ke,e.forEachLimit=xe,e.forEachOf=vt,e.forEachOfSeries=ee,e.forEachOfLimit=ct,e.inject=re,e.foldl=re,e.foldr=er,e.select=Ne,e.selectLimit=Pe,e.selectSeries=Le,e.wrapSync=p,Object.defineProperty(e,"__esModule",{value:!0})}(e)}).call(this,r(70).setImmediate,r(11),r(7),r(54)(t))},function(t,e){var r=Math.floor(4294967295*Math.random());t.exports=function(){return r=(r+1)%4294967295}},function(t,e){t.exports=function t(e,r){if(e&&r)return t(e)(r);if("function"!=typeof e)throw new TypeError("need wrapper function");return Object.keys(e).forEach((function(t){i[t]=e[t]})),i;function i(){for(var t=new Array(arguments.length),r=0;r>>32-e}function u(t,e,r,i,n,o,s){return h(t+(e&r|~e&i)+n+o|0,s)+e|0}function f(t,e,r,i,n,o,s){return h(t+(e&i|r&~i)+n+o|0,s)+e|0}function l(t,e,r,i,n,o,s){return h(t+(e^r^i)+n+o|0,s)+e|0}function c(t,e,r,i,n,o,s){return h(t+(r^(e|~i))+n+o|0,s)+e|0}i(a,n),a.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,i=this._b,n=this._c,o=this._d;r=u(r,i,n,o,t[0],3614090360,7),o=u(o,r,i,n,t[1],3905402710,12),n=u(n,o,r,i,t[2],606105819,17),i=u(i,n,o,r,t[3],3250441966,22),r=u(r,i,n,o,t[4],4118548399,7),o=u(o,r,i,n,t[5],1200080426,12),n=u(n,o,r,i,t[6],2821735955,17),i=u(i,n,o,r,t[7],4249261313,22),r=u(r,i,n,o,t[8],1770035416,7),o=u(o,r,i,n,t[9],2336552879,12),n=u(n,o,r,i,t[10],4294925233,17),i=u(i,n,o,r,t[11],2304563134,22),r=u(r,i,n,o,t[12],1804603682,7),o=u(o,r,i,n,t[13],4254626195,12),n=u(n,o,r,i,t[14],2792965006,17),r=f(r,i=u(i,n,o,r,t[15],1236535329,22),n,o,t[1],4129170786,5),o=f(o,r,i,n,t[6],3225465664,9),n=f(n,o,r,i,t[11],643717713,14),i=f(i,n,o,r,t[0],3921069994,20),r=f(r,i,n,o,t[5],3593408605,5),o=f(o,r,i,n,t[10],38016083,9),n=f(n,o,r,i,t[15],3634488961,14),i=f(i,n,o,r,t[4],3889429448,20),r=f(r,i,n,o,t[9],568446438,5),o=f(o,r,i,n,t[14],3275163606,9),n=f(n,o,r,i,t[3],4107603335,14),i=f(i,n,o,r,t[8],1163531501,20),r=f(r,i,n,o,t[13],2850285829,5),o=f(o,r,i,n,t[2],4243563512,9),n=f(n,o,r,i,t[7],1735328473,14),r=l(r,i=f(i,n,o,r,t[12],2368359562,20),n,o,t[5],4294588738,4),o=l(o,r,i,n,t[8],2272392833,11),n=l(n,o,r,i,t[11],1839030562,16),i=l(i,n,o,r,t[14],4259657740,23),r=l(r,i,n,o,t[1],2763975236,4),o=l(o,r,i,n,t[4],1272893353,11),n=l(n,o,r,i,t[7],4139469664,16),i=l(i,n,o,r,t[10],3200236656,23),r=l(r,i,n,o,t[13],681279174,4),o=l(o,r,i,n,t[0],3936430074,11),n=l(n,o,r,i,t[3],3572445317,16),i=l(i,n,o,r,t[6],76029189,23),r=l(r,i,n,o,t[9],3654602809,4),o=l(o,r,i,n,t[12],3873151461,11),n=l(n,o,r,i,t[15],530742520,16),r=c(r,i=l(i,n,o,r,t[2],3299628645,23),n,o,t[0],4096336452,6),o=c(o,r,i,n,t[7],1126891415,10),n=c(n,o,r,i,t[14],2878612391,15),i=c(i,n,o,r,t[5],4237533241,21),r=c(r,i,n,o,t[12],1700485571,6),o=c(o,r,i,n,t[3],2399980690,10),n=c(n,o,r,i,t[10],4293915773,15),i=c(i,n,o,r,t[1],2240044497,21),r=c(r,i,n,o,t[8],1873313359,6),o=c(o,r,i,n,t[15],4264355552,10),n=c(n,o,r,i,t[6],2734768916,15),i=c(i,n,o,r,t[13],1309151649,21),r=c(r,i,n,o,t[4],4149444226,6),o=c(o,r,i,n,t[11],3174756917,10),n=c(n,o,r,i,t[2],718787259,15),i=c(i,n,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+o|0},a.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 t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=a},function(t,e,r){var i=r(12).Buffer,n=r(4),o=r(85),s=new Array(16),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],h=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],f=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],l=[0,1518500249,1859775393,2400959708,2840853838],c=[1352829926,1548603684,1836072691,2053994217,0];function d(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(t,e){return t<>>32-e}function m(t,e,r,i,n,o,s,a){return p(t+(e^r^i)+o+s|0,a)+n|0}function v(t,e,r,i,n,o,s,a){return p(t+(e&r|~e&i)+o+s|0,a)+n|0}function g(t,e,r,i,n,o,s,a){return p(t+((e|~r)^i)+o+s|0,a)+n|0}function y(t,e,r,i,n,o,s,a){return p(t+(e&i|r&~i)+o+s|0,a)+n|0}function b(t,e,r,i,n,o,s,a){return p(t+(e^(r|~i))+o+s|0,a)+n|0}n(d,o),d.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,i=0|this._b,n=0|this._c,o=0|this._d,d=0|this._e,w=0|this._a,M=0|this._b,_=0|this._c,S=0|this._d,x=0|this._e,k=0;k<80;k+=1){var A,E;k<16?(A=m(r,i,n,o,d,t[a[k]],l[0],u[k]),E=b(w,M,_,S,x,t[h[k]],c[0],f[k])):k<32?(A=v(r,i,n,o,d,t[a[k]],l[1],u[k]),E=y(w,M,_,S,x,t[h[k]],c[1],f[k])):k<48?(A=g(r,i,n,o,d,t[a[k]],l[2],u[k]),E=g(w,M,_,S,x,t[h[k]],c[2],f[k])):k<64?(A=y(r,i,n,o,d,t[a[k]],l[3],u[k]),E=v(w,M,_,S,x,t[h[k]],c[3],f[k])):(A=b(r,i,n,o,d,t[a[k]],l[4],u[k]),E=m(w,M,_,S,x,t[h[k]],c[4],f[k])),r=d,d=o,o=p(n,10),n=i,i=A,w=x,x=S,S=p(_,10),_=M,M=E}var B=this._b+n+S|0;this._b=this._c+o+x|0,this._c=this._d+d+w|0,this._d=this._e+r+M|0,this._e=this._a+i+_|0,this._a=B},d.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 t=i.alloc?i.alloc(20):new i(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=d},function(t,e,r){(e=t.exports=function(t){t=t.toLowerCase();var r=e[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r}).sha=r(203),e.sha1=r(204),e.sha224=r(205),e.sha256=r(86),e.sha384=r(206),e.sha512=r(87)},function(t,e,r){var i=r(4),n=r(27),o=r(14).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function h(){this.init(),this._w=a,n.call(this,64,56)}function u(t){return t<<30|t>>>2}function f(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}i(h,n),h.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},h.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,h=0|this._e,l=0;l<16;++l)r[l]=t.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var c=0;c<80;++c){var d=~~(c/20),p=0|((e=i)<<5|e>>>27)+f(d,n,o,a)+h+r[c]+s[d];h=a,a=o,o=u(n),n=i,i=p}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=h+this._e|0},h.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=h},function(t,e,r){var i=r(4),n=r(27),o=r(14).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function h(){this.init(),this._w=a,n.call(this,64,56)}function u(t){return t<<5|t>>>27}function f(t){return t<<30|t>>>2}function l(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}i(h,n),h.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},h.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,h=0|this._e,c=0;c<16;++c)r[c]=t.readInt32BE(4*c);for(;c<80;++c)r[c]=(e=r[c-3]^r[c-8]^r[c-14]^r[c-16])<<1|e>>>31;for(var d=0;d<80;++d){var p=~~(d/20),m=u(i)+l(p,n,o,a)+h+r[d]+s[p]|0;h=a,a=o,o=f(n),n=i,i=m}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=h+this._e|0},h.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=h},function(t,e,r){var i=r(4),n=r(86),o=r(27),s=r(14).Buffer,a=new Array(64);function h(){this.init(),this._w=a,o.call(this,64,56)}i(h,n),h.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},h.prototype._hash=function(){var t=s.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=h},function(t,e,r){var i=r(4),n=r(87),o=r(27),s=r(14).Buffer,a=new Array(160);function h(){this.init(),this._w=a,o.call(this,128,112)}i(h,n),h.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},h.prototype._hash=function(){var t=s.allocUnsafe(48);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=h},function(t,e,r){var i=r(14).Buffer,n=r(61).Transform,o=r(51).StringDecoder;function s(t){n.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(4)(s,n),s.prototype.update=function(t,e,r){"string"==typeof t&&(t=i.from(t,e));var n=this._update(t);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(t,e,r){var i;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){i=t}finally{r(i)}},s.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},s.prototype._finalOrDigest=function(t){var e=this.__final()||i.alloc(0);return t&&(e=this._toString(e,t,!0)),e},s.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var i=this._decoder.write(t);return r&&(i+=this._decoder.end()),i},t.exports=s}]).default})),L=Object(p.c)(P);e.default=L},747:function(t,e,r){"use strict";r.d(e,"a",(function(){return w}));var i,n,o,s,a={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},h=function(t){throw{name:"SyntaxError",message:t,at:i,text:o}},u=function(t){return t&&t!==n&&h("Expected '"+t+"' instead of '"+n+"'"),n=o.charAt(i),i+=1,n},f=function(){var t,e="";for("-"===n&&(e="-",u("-"));n>="0"&&n<="9";)e+=n,u();if("."===n)for(e+=".";u()&&n>="0"&&n<="9";)e+=n;if("e"===n||"E"===n)for(e+=n,u(),"-"!==n&&"+"!==n||(e+=n,u());n>="0"&&n<="9";)e+=n,u();if(t=+e,isFinite(t))return t;h("Bad number")},l=function(){var t,e,r,i="";if('"'===n)for(;u();){if('"'===n)return u(),i;if("\\"===n)if(u(),"u"===n){for(r=0,e=0;e<4&&(t=parseInt(u(),16),isFinite(t));e+=1)r=16*r+t;i+=String.fromCharCode(r)}else{if("string"!=typeof a[n])break;i+=a[n]}else i+=n}h("Bad string")},c=function(){for(;n&&n<=" ";)u()};s=function(){switch(c(),n){case"{":return function(){var t,e={};if("{"===n){if(u("{"),c(),"}"===n)return u("}"),e;for(;n;){if(t=l(),c(),u(":"),Object.hasOwnProperty.call(e,t)&&h('Duplicate key "'+t+'"'),e[t]=s(),c(),"}"===n)return u("}"),e;u(","),c()}}h("Bad object")}();case"[":return function(){var t=[];if("["===n){if(u("["),c(),"]"===n)return u("]"),t;for(;n;){if(t.push(s()),c(),"]"===n)return u("]"),t;u(","),c()}}h("Bad array")}();case'"':return l();case"-":return f();default:return n>="0"&&n<="9"?f():function(){switch(n){case"t":return u("t"),u("r"),u("u"),u("e"),!0;case"f":return u("f"),u("a"),u("l"),u("s"),u("e"),!1;case"n":return u("n"),u("u"),u("l"),u("l"),null}h("Unexpected '"+n+"'")}()}};var d,p,m,v=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,g={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function y(t){return v.lastIndex=0,v.test(t)?'"'+t.replace(v,(function(t){var e=g[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+t+'"'}var b="undefined"!=typeof JSON?JSON:{parse:function(t,e){var r;return o=t,i=0,n=" ",r=s(),c(),n&&h("Syntax error"),"function"==typeof e?function t(r,i){var n,o,s=r[i];if(s&&"object"==typeof s)for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(void 0!==(o=t(s,n))?s[n]=o:delete s[n]);return e.call(r,i,s)}({"":r},""):r},stringify:function(t,e,r){var i;if(d="",p="","number"==typeof r)for(i=0;i=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),f=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&t._extend(n,r),g(n.showHidden)&&(n.showHidden=!1),g(n.depth)&&(n.depth=2),g(n.colors)&&(n.colors=!1),g(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),c(n,e,n.depth)}function f(e,t){var r=s.styles[t];return r?"\x1b["+s.colors[r][0]+"m"+e+"\x1b["+s.colors[r][1]+"m":e}function u(e,t){return e}function c(e,r,n){if(e.customInspect&&r&&k(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return v(i)||(i=c(e,i,n)),i}var o=function(e,t){if(g(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return y(t)?e.stylize(""+t,"number"):p(t)?e.stylize(""+t,"boolean"):b(t)?e.stylize("null","null"):void 0}(e,r);if(o)return o;var a=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),E(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return h(r);if(0===a.length){if(k(r)){var f=r.name?": "+r.name:"";return e.stylize("[Function"+f+"]","special")}if(m(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return e.stylize(Date.prototype.toString.call(r),"date");if(E(r))return h(r)}var u,_="",A=!1,S=["{","}"];return d(r)&&(A=!0,S=["[","]"]),k(r)&&(_=" [Function"+(r.name?": "+r.name:"")+"]"),m(r)&&(_=" "+RegExp.prototype.toString.call(r)),w(r)&&(_=" "+Date.prototype.toUTCString.call(r)),E(r)&&(_=" "+h(r)),0!==a.length||A&&0!=r.length?n<0?m(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),u=A?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(u,_,S)):S[0]+_+S[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function l(e,t,r,n,i,o){var a,s,f;if((f=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=f.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):f.set&&(s=e.stylize("[Setter]","special")),M(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(f.value)<0?(s=b(r)?c(e,f.value,null):c(e,f.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),g(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function d(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function b(e){return null===e}function y(e){return"number"==typeof e}function v(e){return"string"==typeof e}function g(e){return void 0===e}function m(e){return _(e)&&"[object RegExp]"===A(e)}function _(e){return"object"==typeof e&&null!==e}function w(e){return _(e)&&"[object Date]"===A(e)}function E(e){return _(e)&&("[object Error]"===A(e)||e instanceof Error)}function k(e){return"function"==typeof e}function A(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(g(o)&&(o=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!a[r])if(new RegExp("\\b"+r+"\\b","i").test(o)){var n=e.pid;a[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,n,e)}}else a[r]=function(){};return a[r]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=d,t.isBoolean=p,t.isNull=b,t.isNullOrUndefined=function(e){return null==e},t.isNumber=y,t.isString=v,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=g,t.isRegExp=m,t.isObject=_,t.isDate=w,t.isError=E,t.isFunction=k,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(106);var x=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),x[e.getMonth()],t].join(" ")}function M(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",I(),t.format.apply(t,arguments))},t.inherits=r(107),t._extend=function(e,t){if(!t||!_(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var T="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(T&&e[T]){var t;if("function"!=typeof(t=e[T]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,T,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function f(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=s(e,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==t&&(i=s(e,t,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],c=[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],h=[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];function l(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,f=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,h=67108863&f,l=Math.min(u,t.length-1),d=Math.max(0,u-e.length+1);d<=l;d++){var p=u-d|0;c+=(a=(i=0|e.words[p])*(o=0|t.words[d])+h)/67108864|0,h=67108863&a}r.words[u]=0|h,f=0|c}return 0!==f?r.words[u]=0|f:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?u[6-f.length]+f+r:f+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=c[e],d=h[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(d).toString(e);r=(p=p.idivn(d)).isZero()?b+r:u[l-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,f="le"===t,u=new e(o),c=this.clone();if(f){for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),u[s]=a;for(;s=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},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,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},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,d=0|a[1],p=8191&d,b=d>>>13,y=0|a[2],v=8191&y,g=y>>>13,m=0|a[3],_=8191&m,w=m>>>13,E=0|a[4],k=8191&E,A=E>>>13,S=0|a[5],x=8191&S,I=S>>>13,M=0|a[6],T=8191&M,P=M>>>13,B=0|a[7],L=8191&B,R=B>>>13,O=0|a[8],C=8191&O,N=O>>>13,j=0|a[9],D=8191&j,q=j>>>13,U=0|s[0],F=8191&U,z=U>>>13,K=0|s[1],H=8191&K,V=K>>>13,Y=0|s[2],G=8191&Y,$=Y>>>13,W=0|s[3],Z=8191&W,J=W>>>13,X=0|s[4],Q=8191&X,ee=X>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],fe=8191&se,ue=se>>>13,ce=0|s[8],he=8191&ce,le=ce>>>13,de=0|s[9],pe=8191&de,be=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(u+(n=Math.imul(h,F))|0)+((8191&(i=(i=Math.imul(h,z))+Math.imul(l,F)|0))<<13)|0;u=((o=Math.imul(l,z))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,z))+Math.imul(b,F)|0,o=Math.imul(b,z);var ve=(u+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,V)|0)+Math.imul(l,H)|0))<<13)|0;u=((o=o+Math.imul(l,V)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(v,F),i=(i=Math.imul(v,z))+Math.imul(g,F)|0,o=Math.imul(g,z),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,V)|0;var ge=(u+(n=n+Math.imul(h,G)|0)|0)+((8191&(i=(i=i+Math.imul(h,$)|0)+Math.imul(l,G)|0))<<13)|0;u=((o=o+Math.imul(l,$)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(_,F),i=(i=Math.imul(_,z))+Math.imul(w,F)|0,o=Math.imul(w,z),n=n+Math.imul(v,H)|0,i=(i=i+Math.imul(v,V)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,V)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,$)|0;var me=(u+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(l,Z)|0))<<13)|0;u=((o=o+Math.imul(l,J)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(k,F),i=(i=Math.imul(k,z))+Math.imul(A,F)|0,o=Math.imul(A,z),n=n+Math.imul(_,H)|0,i=(i=i+Math.imul(_,V)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,V)|0,n=n+Math.imul(v,G)|0,i=(i=i+Math.imul(v,$)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,$)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,J)|0;var _e=(u+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(l,Q)|0))<<13)|0;u=((o=o+Math.imul(l,ee)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(x,F),i=(i=Math.imul(x,z))+Math.imul(I,F)|0,o=Math.imul(I,z),n=n+Math.imul(k,H)|0,i=(i=i+Math.imul(k,V)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(_,G)|0,i=(i=i+Math.imul(_,$)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,$)|0,n=n+Math.imul(v,Z)|0,i=(i=i+Math.imul(v,J)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0;var we=(u+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(l,re)|0))<<13)|0;u=((o=o+Math.imul(l,ne)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(T,F),i=(i=Math.imul(T,z))+Math.imul(P,F)|0,o=Math.imul(P,z),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,V)|0,n=n+Math.imul(k,G)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,$)|0,n=n+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,J)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,J)|0,n=n+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,ee)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0;var Ee=(u+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ae)|0)+Math.imul(l,oe)|0))<<13)|0;u=((o=o+Math.imul(l,ae)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,z))+Math.imul(R,F)|0,o=Math.imul(R,z),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,V)|0,n=n+Math.imul(x,G)|0,i=(i=i+Math.imul(x,$)|0)+Math.imul(I,G)|0,o=o+Math.imul(I,$)|0,n=n+Math.imul(k,Z)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,ee)|0,n=n+Math.imul(v,re)|0,i=(i=i+Math.imul(v,ne)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0;var ke=(u+(n=n+Math.imul(h,fe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ue)|0)+Math.imul(l,fe)|0))<<13)|0;u=((o=o+Math.imul(l,ue)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,z))+Math.imul(N,F)|0,o=Math.imul(N,z),n=n+Math.imul(L,H)|0,i=(i=i+Math.imul(L,V)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,V)|0,n=n+Math.imul(T,G)|0,i=(i=i+Math.imul(T,$)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,$)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,J)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(_,re)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ne)|0,n=n+Math.imul(v,oe)|0,i=(i=i+Math.imul(v,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(b,fe)|0,o=o+Math.imul(b,ue)|0;var Ae=(u+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,le)|0)+Math.imul(l,he)|0))<<13)|0;u=((o=o+Math.imul(l,le)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,z))+Math.imul(q,F)|0,o=Math.imul(q,z),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,n=n+Math.imul(L,G)|0,i=(i=i+Math.imul(L,$)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,$)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,J)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(k,re)|0,i=(i=i+Math.imul(k,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,n=n+Math.imul(v,fe)|0,i=(i=i+Math.imul(v,ue)|0)+Math.imul(g,fe)|0,o=o+Math.imul(g,ue)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(b,he)|0,o=o+Math.imul(b,le)|0;var Se=(u+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,be)|0)+Math.imul(l,pe)|0))<<13)|0;u=((o=o+Math.imul(l,be)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,V))+Math.imul(q,H)|0,o=Math.imul(q,V),n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,J)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,J)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(k,oe)|0,i=(i=i+Math.imul(k,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(_,fe)|0,i=(i=i+Math.imul(_,ue)|0)+Math.imul(w,fe)|0,o=o+Math.imul(w,ue)|0,n=n+Math.imul(v,he)|0,i=(i=i+Math.imul(v,le)|0)+Math.imul(g,he)|0,o=o+Math.imul(g,le)|0;var xe=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(D,G),i=(i=Math.imul(D,$))+Math.imul(q,G)|0,o=Math.imul(q,$),n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(k,fe)|0,i=(i=i+Math.imul(k,ue)|0)+Math.imul(A,fe)|0,o=o+Math.imul(A,ue)|0,n=n+Math.imul(_,he)|0,i=(i=i+Math.imul(_,le)|0)+Math.imul(w,he)|0,o=o+Math.imul(w,le)|0;var Ie=(u+(n=n+Math.imul(v,pe)|0)|0)+((8191&(i=(i=i+Math.imul(v,be)|0)+Math.imul(g,pe)|0))<<13)|0;u=((o=o+Math.imul(g,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,J))+Math.imul(q,Z)|0,o=Math.imul(q,J),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(L,re)|0,i=(i=i+Math.imul(L,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(I,fe)|0,o=o+Math.imul(I,ue)|0,n=n+Math.imul(k,he)|0,i=(i=i+Math.imul(k,le)|0)+Math.imul(A,he)|0,o=o+Math.imul(A,le)|0;var Me=(u+(n=n+Math.imul(_,pe)|0)|0)+((8191&(i=(i=i+Math.imul(_,be)|0)+Math.imul(w,pe)|0))<<13)|0;u=((o=o+Math.imul(w,be)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,ee))+Math.imul(q,Q)|0,o=Math.imul(q,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(L,oe)|0,i=(i=i+Math.imul(L,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,n=n+Math.imul(T,fe)|0,i=(i=i+Math.imul(T,ue)|0)+Math.imul(P,fe)|0,o=o+Math.imul(P,ue)|0,n=n+Math.imul(x,he)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(I,he)|0,o=o+Math.imul(I,le)|0;var Te=(u+(n=n+Math.imul(k,pe)|0)|0)+((8191&(i=(i=i+Math.imul(k,be)|0)+Math.imul(A,pe)|0))<<13)|0;u=((o=o+Math.imul(A,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(q,re)|0,o=Math.imul(q,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,n=n+Math.imul(L,fe)|0,i=(i=i+Math.imul(L,ue)|0)+Math.imul(R,fe)|0,o=o+Math.imul(R,ue)|0,n=n+Math.imul(T,he)|0,i=(i=i+Math.imul(T,le)|0)+Math.imul(P,he)|0,o=o+Math.imul(P,le)|0;var Pe=(u+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,be)|0)+Math.imul(I,pe)|0))<<13)|0;u=((o=o+Math.imul(I,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,ae))+Math.imul(q,oe)|0,o=Math.imul(q,ae),n=n+Math.imul(C,fe)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(N,fe)|0,o=o+Math.imul(N,ue)|0,n=n+Math.imul(L,he)|0,i=(i=i+Math.imul(L,le)|0)+Math.imul(R,he)|0,o=o+Math.imul(R,le)|0;var Be=(u+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,be)|0)+Math.imul(P,pe)|0))<<13)|0;u=((o=o+Math.imul(P,be)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(D,fe),i=(i=Math.imul(D,ue))+Math.imul(q,fe)|0,o=Math.imul(q,ue),n=n+Math.imul(C,he)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(N,he)|0,o=o+Math.imul(N,le)|0;var Le=(u+(n=n+Math.imul(L,pe)|0)|0)+((8191&(i=(i=i+Math.imul(L,be)|0)+Math.imul(R,pe)|0))<<13)|0;u=((o=o+Math.imul(R,be)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,n=Math.imul(D,he),i=(i=Math.imul(D,le))+Math.imul(q,he)|0,o=Math.imul(q,le);var Re=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,be)|0)+Math.imul(N,pe)|0))<<13)|0;u=((o=o+Math.imul(N,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Oe=(u+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,be))+Math.imul(q,pe)|0))<<13)|0;return u=((o=Math.imul(q,be))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,f[0]=ye,f[1]=ve,f[2]=ge,f[3]=me,f[4]=_e,f[5]=we,f[6]=Ee,f[7]=ke,f[8]=Ae,f[9]=Se,f[10]=xe,f[11]=Ie,f[12]=Me,f[13]=Te,f[14]=Pe,f[15]=Be,f[16]=Le,f[17]=Re,f[18]=Oe,0!==u&&(f[19]=u,r.length++),r};function p(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(d=l),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?d(this,e,t):r<63?l(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):p(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},b.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==c||u>=i);u--){var h=0|this.words[u];this.words[u]=c<<26-o|h>>>o,c=h&s}return f&&0!==c&&(f.words[f.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,f=n.length-i.length;if("mod"!==t){(s=new o(null)).length=f+1,s.words=new Array(s.length);for(var u=0;u=0;h--){var l=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(l=Math.min(l/a|0,67108863),n._ishlnsubmul(i,l,h);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=l)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),f=new o(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var l=0,d=1;0==(t.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(h)),i.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||f.isOdd())&&(s.iadd(c),f.isub(h)),s.iushrn(1),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(f)):(r.isub(t),s.isub(i),f.isub(a))}return{a:s,b:f,gcd:r.iushln(u)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),f=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;0==(t.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(f),a.iushrn(1);for(var h=0,l=1;0==(r.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new E(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function m(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}v.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},i(g,v),g.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},g.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new g;else if("p224"===e)t=new m;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return y[e]=t,t},E.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),f=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,u).cmp(f);)c.redIAdd(f);for(var h=this.pow(c,i),l=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=a;0!==d.cmp(s);){for(var b=d,y=0;0!==b.cmp(s);y++)b=b.redSqr();n(y=0;n--){for(var u=t.words[n],c=f-1;c>=0;c--){var h=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}f=26}return i},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new k(e)},i(k,E),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(27)(e))},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";var n=t,i=r(3),o=r(11),a=r(62);n.assert=o,n.toArray=a.toArray,n.zero2=a.zero2,n.toHex=a.toHex,n.encode=a.encode,n.getNAF=function(e,t){for(var r=[],n=1<=0;){var o;if(i.isOdd()){var a=i.andln(n-1);o=a>(n>>1)-1?(n>>1)-a:a,i.isubn(o)}else o=0;r.push(o);for(var s=0!==i.cmpn(0)&&0===i.andln(n-1)?t+1:1,f=1;f0||t.cmpn(-i)>0;){var o,a,s,f=e.andln(3)+n&3,u=t.andln(3)+i&3;3===f&&(f=-1),3===u&&(u=-1),o=0==(1&f)?0:3!==(s=e.andln(7)+n&7)&&5!==s||2!==u?f:-f,r[0].push(o),a=0==(1&u)?0:3!==(s=t.andln(7)+i&7)&&5!==s||2!==f?u:-u,r[1].push(a),2*n===o+1&&(n=1-n),2*i===a+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},function(e,t,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var f=10;function u(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,o,a,s;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=u(e))>0&&a.length>i&&!a.warned){a.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=a.length,s=f,console&&console.warn&&console.warn(s)}return e}function h(){for(var e=[],t=0;t0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var f=i[e];if(void 0===f)return!1;if("function"==typeof f)o(f,this,t);else{var u=f.length,c=b(f,u);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return d(this,e,!0)},s.prototype.rawListeners=function(e){return d(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t,r){"use strict";(function(e){var n=r(110),i=r(111),o=r(112);function a(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(f.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(n)return F(e).length;t=(""+t).toLowerCase(),n=!0}}function b(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return M(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=f.from(t,n)),f.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,i);if("number"==typeof t)return t&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,i){var o,a=1,s=e.length,f=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,f/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=r;os&&(r=s-f),o=r;o>=0;o--){for(var h=!0,l=0;li&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function S(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(o=e[i+1]))&&(f=(31&u)<<6|63&o)>127&&(c=f);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(f=(15&u)<<12|(63&o)<<6|63&a)>2047&&(f<55296||f>57343)&&(c=f);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(f=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&f<1114112&&(c=f)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(e){var t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);for(var r="",n=0;n0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},f.prototype.compare=function(e,t,r,n,i){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(n,i),c=e.slice(t,r),h=0;hi)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return m(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":return w(this,e,t,r);case"latin1":case"binary":return E(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function M(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,n,i,o){if(!f.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function O(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function C(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function N(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(e,t,r,n,o){return o||N(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function D(e,t,r,n,o){return o||N(e,0,r,8),i.write(e,t,r,n,52,8),r+8}f.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},f.prototype.readUInt8=function(e,t){return t||L(e,1,this.length),this[e]},f.prototype.readUInt16LE=function(e,t){return t||L(e,2,this.length),this[e]|this[e+1]<<8},f.prototype.readUInt16BE=function(e,t){return t||L(e,2,this.length),this[e]<<8|this[e+1]},f.prototype.readUInt32LE=function(e,t){return t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},f.prototype.readUInt32BE=function(e,t){return t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},f.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},f.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},f.prototype.readInt8=function(e,t){return t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},f.prototype.readInt16LE=function(e,t){t||L(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(e,t){t||L(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt32LE=function(e,t){return t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},f.prototype.readInt32BE=function(e,t){return t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},f.prototype.readFloatLE=function(e,t){return t||L(e,4,this.length),i.read(this,e,!0,23,4)},f.prototype.readFloatBE=function(e,t){return t||L(e,4,this.length),i.read(this,e,!1,23,4)},f.prototype.readDoubleLE=function(e,t){return t||L(e,8,this.length),i.read(this,e,!0,52,8)},f.prototype.readDoubleBE=function(e,t){return t||L(e,8,this.length),i.read(this,e,!1,52,8)},f.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||R(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},f.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,1,255,0),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},f.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},f.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},f.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):C(this,e,t,!0),t+4},f.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},f.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);R(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},f.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);R(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},f.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,1,127,-128),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},f.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},f.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},f.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):C(this,e,t,!0),t+4},f.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},f.prototype.writeFloatLE=function(e,t,r){return j(this,e,t,!0,r)},f.prototype.writeFloatBE=function(e,t,r){return j(this,e,t,!1,r)},f.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},f.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},f.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function z(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(4))},function(e,t,r){"use strict";var n=r(11),i=r(0);function o(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function f(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,r[n++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,a,s){var f=0,u=t;return f+=(u=u+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,f,u){var c=0,h=t;return c+=(h=h+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,f,u){return t+n+o+s+u>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var f,u=[],c=!1,h=-1;function l(){c&&f&&(c=!1,f.length?u=f.concat(u):h=-1,u.length&&d())}function d(){if(!c){var e=s(l);c=!0;for(var t=u.length;t;){for(f=u,u=[];++h1)for(var r=1;r=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(52),o=r(57),a=r(68),s=r(69),f=r(3),u=r(36),c=r(1).Buffer;Object.assign(t,r(70)),t.MAX_INTEGER=new f("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new f("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.SHA3_NULL_S=t.KECCAK256_NULL_S,t.KECCAK256_NULL=c.from(t.KECCAK256_NULL_S,"hex"),t.SHA3_NULL=t.KECCAK256_NULL,t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.SHA3_RLP_ARRAY_S=t.KECCAK256_RLP_ARRAY_S,t.KECCAK256_RLP_ARRAY=c.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.SHA3_RLP_ARRAY=t.KECCAK256_RLP_ARRAY,t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.SHA3_RLP_S=t.KECCAK256_RLP_S,t.KECCAK256_RLP=c.from(t.KECCAK256_RLP_S,"hex"),t.SHA3_RLP=t.KECCAK256_RLP,t.BN=f,t.rlp=s,t.secp256k1=o,t.zeros=function(e){return c.allocUnsafe(e).fill(0)},t.zeroAddress=function(){var e=t.zeros(20);return t.bufferToHex(e)},t.setLengthLeft=t.setLength=function(e,r,n){var i=t.zeros(r);return e=t.toBuffer(e),n?e.length0&&"0"===r.toString();)r=(e=e.slice(1))[0];return e},t.toBuffer=function(e){if(!c.isBuffer(e))if(Array.isArray(e))e=c.from(e);else if("string"==typeof e)e=t.isHexString(e)?c.from(t.padToEven(t.stripHexPrefix(e)),"hex"):c.from(e);else if("number"==typeof e)e=t.intToBuffer(e);else if(null==e)e=c.allocUnsafe(0);else if(f.isBN(e))e=e.toArrayLike(c);else{if(!e.toArray)throw new Error("invalid type");e=c.from(e.toArray())}return e},t.bufferToInt=function(e){return new f(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new f(e).fromTwos(256)},t.toUnsigned=function(e){return c.from(e.toTwos(256).toArray())},t.keccak=function(e,r){return e=t.toBuffer(e),r||(r=256),i("keccak"+r).update(e).digest()},t.keccak256=function(e){return t.keccak(e)},t.sha3=t.keccak,t.sha256=function(e){return e=t.toBuffer(e),u("sha256").update(e).digest()},t.ripemd160=function(e,r){e=t.toBuffer(e);var n=u("rmd160").update(e).digest();return!0===r?t.setLength(n,32):n},t.rlphash=function(e){return t.keccak(s.encode(e))},t.isValidPrivate=function(e){return o.privateKeyVerify(e)},t.isValidPublic=function(e,t){return 64===e.length?o.publicKeyVerify(c.concat([c.from([4]),e])):!!t&&o.publicKeyVerify(e)},t.pubToAddress=t.publicToAddress=function(e,r){return e=t.toBuffer(e),r&&64!==e.length&&(e=o.publicKeyConvert(e,!1).slice(1)),a(64===e.length),t.keccak(e).slice(-20)};var h=t.privateToPublic=function(e){return e=t.toBuffer(e),o.publicKeyCreate(e,!1).slice(1)};t.importPublic=function(e){return 64!==(e=t.toBuffer(e)).length&&(e=o.publicKeyConvert(e,!1).slice(1)),e},t.ecsign=function(e,t){var r=o.sign(e,t),n={};return n.r=r.signature.slice(0,32),n.s=r.signature.slice(32,64),n.v=r.recovery+27,n},t.hashPersonalMessage=function(e){var r=t.toBuffer("\x19Ethereum Signed Message:\n"+e.length.toString());return t.keccak(c.concat([r,e]))},t.ecrecover=function(e,r,n,i){var a=c.concat([t.setLength(n,32),t.setLength(i,32)],64),s=r-27;if(0!==s&&1!==s)throw new Error("Invalid signature v value");var f=o.recover(e,a,s);return o.publicKeyConvert(f,!1).slice(1)},t.toRpcSig=function(e,r,n){if(27!==e&&28!==e)throw new Error("Invalid recovery id");return t.bufferToHex(c.concat([t.setLengthLeft(r,32),t.setLengthLeft(n,32),t.toBuffer(e-27)]))},t.fromRpcSig=function(e){if(65!==(e=t.toBuffer(e)).length)throw new Error("Invalid signature length");var r=e[64];return r<27&&(r+=27),{v:r,r:e.slice(0,32),s:e.slice(32,64)}},t.privateToAddress=function(e){return t.publicToAddress(h(e))},t.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)},t.isZeroAddress=function(e){return t.zeroAddress()===t.addHexPrefix(e)},t.toChecksumAddress=function(e){e=t.stripHexPrefix(e).toLowerCase();for(var r=t.keccak(e).toString("hex"),n="0x",i=0;i=8?n+=e[i].toUpperCase():n+=e[i];return n},t.isValidChecksumAddress=function(e){return t.isValidAddress(e)&&t.toChecksumAddress(e)===e},t.generateAddress=function(e,r){return e=t.toBuffer(e),r=(r=new f(r)).isZero()?null:c.from(r.toArray()),t.rlphash([e,r]).slice(-20)},t.isPrecompiled=function(e){var r=t.unpad(e);return 1===r.length&&r[0]>=1&&r[0]<=8},t.addHexPrefix=function(e){return"string"!=typeof e||t.isHexPrefixed(e)?e:"0x"+e},t.isValidSignature=function(e,t,r,n){var i=new f("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),o=new f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===t.length&&32===r.length&&(27===e||28===e)&&(t=new f(t),r=new f(r),!(t.isZero()||t.gt(o)||r.isZero()||r.gt(o))&&(!1!==n||1!==new f(r).cmp(i)))},t.baToJSON=function(e){if(c.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var r=[],n=0;n=i.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===i.length||!r.length||a(r.length===i.length,"The field "+r.name+" must have byte length of "+r.length),e.raw[n]=i}e._fields.push(r.name),Object.defineProperty(e,r.name,{enumerable:!0,configurable:!0,get:i,set:o}),r.default&&(e[r.name]=r.default),r.alias&&Object.defineProperty(e,r.alias,{enumerable:!1,configurable:!0,set:o,get:i})})),i)if("string"==typeof i&&(i=c.from(t.stripHexPrefix(i),"hex")),c.isBuffer(i)&&(i=s.decode(i)),Array.isArray(i)){if(i.length>e._fields.length)throw new Error("wrong number of fields in data");i.forEach((function(r,n){e[e._fields[n]]=t.toBuffer(r)}))}else{if("object"!==(void 0===i?"undefined":n(i)))throw new Error("invalid data");var o=Object.keys(i);r.forEach((function(t){-1!==o.indexOf(t.name)&&(e[t.name]=i[t.name]),-1!==o.indexOf(t.alias)&&(e[t.alias]=i[t.alias])}))}}},function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,r(7).Buffer)},function(e,t,r){"use strict";var n=r(8),i=r(11);function o(){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}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o1&&"boolean"!=typeof t)throw new TypeError('"allowMissing" argument must be a boolean');var r=l(e);if(0===r.length)return d(e,t);for(var n=d("%"+r[0]+"%",t),i=1;i0||e===t?t:t-1}function g(e){for(var t,r,n=1,i=e.length,o=e[0]+"";nu^r?1:-1;for(s=(f=i.length)<(u=o.length)?f:u,a=0;ao[a]^r?1:-1;return f==u?0:f>u^r?1:-1}function _(e,t,r,n){if(er||e!==f(e))throw Error(u+(n||"Argument")+("number"==typeof e?er?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function w(e){var t=e.c.length-1;return v(e.e/l)==t&&e.c[t]%2!=0}function E(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function k(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else tN?v.c=v.e=null:e.e=10;h/=10,u++);return void(u>N?v.c=v.e=null:(v.e=u,v.c=[e]))}y=String(e)}else{if(!a.test(y=String(e)))return i(v,y,p);v.s=45==y.charCodeAt(0)?(y=y.slice(1),-1):1}(u=y.indexOf("."))>-1&&(y=y.replace(".","")),(h=y.search(/e/i))>0?(u<0&&(u=h),u+=+y.slice(h+1),y=y.substring(0,h)):u<0&&(u=y.length)}else{if(_(t,2,F.length,"Base"),10==t)return Y(v=new z(e),B+v.e+1,L);if(y=String(e),p="number"==typeof e){if(0*e!=0)return i(v,y,p,t);if(v.s=1/e<0?(y=y.slice(1),-1):1,z.DEBUG&&y.replace(/^0\.0*|\./,"").length>15)throw Error(c+e)}else v.s=45===y.charCodeAt(0)?(y=y.slice(1),-1):1;for(r=F.slice(0,t),u=h=0,b=y.length;hu){u=b;continue}}else if(!s&&(y==y.toUpperCase()&&(y=y.toLowerCase())||y==y.toLowerCase()&&(y=y.toUpperCase()))){s=!0,h=-1,u=0;continue}return i(v,String(e),p,t)}p=!1,(u=(y=n(y,t,10,v.s)).indexOf("."))>-1?y=y.replace(".",""):u=y.length}for(h=0;48===y.charCodeAt(h);h++);for(b=y.length;48===y.charCodeAt(--b););if(y=y.slice(h,++b)){if(b-=h,p&&z.DEBUG&&b>15&&(e>d||e!==f(e)))throw Error(c+v.s*e);if((u=u-h-1)>N)v.c=v.e=null;else if(u=O)?E(f,a):k(f,a,"0");else if(o=(e=Y(new z(e),t,r)).e,s=(f=g(e.c)).length,1==n||2==n&&(t<=o||o<=R)){for(;ss){if(--t>0)for(f+=".";t--;f+="0");}else if((t+=o-s)>0)for(o+1==s&&(f+=".");t--;f+="0");return e.s<0&&i?"-"+f:f}function H(e,t){for(var r,n=1,i=new z(e[0]);n=10;i/=10,n++);return(r=n+r*l-1)>N?e.c=e.e=null:r=10;u/=10,i++);if((o=t-i)<0)o+=l,a=t,b=(c=y[d=0])/v[i-a-1]%10|0;else if((d=s((o+1)/l))>=y.length){if(!n)break e;for(;y.length<=d;y.push(0));c=b=0,i=1,a=(o%=l)-l+1}else{for(c=u=y[d],i=1;u>=10;u/=10,i++);b=(a=(o%=l)-l+i)<0?0:c/v[i-a-1]%10|0}if(n=n||t<0||null!=y[d+1]||(a<0?c:c%v[i-a-1]),n=r<4?(b||n)&&(0==r||r==(e.s<0?3:2)):b>5||5==b&&(4==r||n||6==r&&(o>0?a>0?c/v[i-a]:0:y[d-1])%10&1||r==(e.s<0?8:7)),t<1||!y[0])return y.length=0,n?(t-=e.e+1,y[0]=v[(l-t%l)%l],e.e=-t||0):y[0]=e.e=0,e;if(0==o?(y.length=d,u=1,d--):(y.length=d+1,u=v[l-o],y[d]=a>0?f(c/v[i-a]%v[a])*u:0),n)for(;;){if(0==d){for(o=1,a=y[0];a>=10;a/=10,o++);for(a=y[0]+=u,u=1;a>=10;a/=10,u++);o!=u&&(e.e++,y[0]==h&&(y[0]=1));break}if(y[d]+=u,y[d]!=h)break;y[d--]=0,u=1}for(o=y.length;0===y[--o];y.pop());}e.e>N?e.c=e.e=null:e.e=O?E(t,r):k(t,r,"0"),e.s<0?"-"+t:t)}return z.clone=e,z.ROUND_UP=0,z.ROUND_DOWN=1,z.ROUND_CEIL=2,z.ROUND_FLOOR=3,z.ROUND_HALF_UP=4,z.ROUND_HALF_DOWN=5,z.ROUND_HALF_EVEN=6,z.ROUND_HALF_CEIL=7,z.ROUND_HALF_FLOOR=8,z.EUCLID=9,z.config=z.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(u+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(_(r=e[t],0,y,t),B=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(_(r=e[t],0,8,t),L=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(_(r[0],-y,0,t),_(r[1],0,y,t),R=r[0],O=r[1]):(_(r,-y,y,t),R=-(O=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)_(r[0],-y,-1,t),_(r[1],1,y,t),C=r[0],N=r[1];else{if(_(r,-y,y,t),!r)throw Error(u+t+" cannot be zero: "+r);C=-(N=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(u+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw j=!r,Error(u+"crypto unavailable");j=r}else j=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(_(r=e[t],0,9,t),D=r),e.hasOwnProperty(t="POW_PRECISION")&&(_(r=e[t],0,y,t),q=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(u+t+" not an object: "+r);U=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(u+t+" invalid: "+r);F=r}}return{DECIMAL_PLACES:B,ROUNDING_MODE:L,EXPONENTIAL_AT:[R,O],RANGE:[C,N],CRYPTO:j,MODULO_MODE:D,POW_PRECISION:q,FORMAT:U,ALPHABET:F}},z.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!z.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-y&&i<=y&&i===f(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%l)<1&&(t+=l),String(n[0]).length==t){for(t=0;t=h||r!==f(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(u+"Invalid BigNumber: "+e)},z.maximum=z.max=function(){return H(arguments,T.lt)},z.minimum=z.min=function(){return H(arguments,T.gt)},z.random=(o=9007199254740992*Math.random()&2097151?function(){return f(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,a,c=0,h=[],d=new z(P);if(null==e?e=B:_(e,0,y),i=s(e/l),j)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));c>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[c]=r[0],t[c+1]=r[1]):(h.push(a%1e14),c+=2);c=i/2}else{if(!crypto.randomBytes)throw j=!1,Error(u+"crypto unavailable");for(t=crypto.randomBytes(i*=7);c=9e15?crypto.randomBytes(7).copy(t,c):(h.push(a%1e14),c+=7);c=i/7}if(!j)for(;c=10;a/=10,c++);cr-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}return function(t,n,i,o,a){var s,f,u,c,h,l,d,p,b=t.indexOf("."),y=B,v=L;for(b>=0&&(c=q,q=0,t=t.replace(".",""),l=(p=new z(n)).pow(t.length-b),q=c,p.c=e(k(g(l.c),l.e,"0"),10,i,"0123456789"),p.e=p.c.length),u=c=(d=e(t,n,i,a?(s=F,"0123456789"):(s="0123456789",F))).length;0==d[--c];d.pop());if(!d[0])return s.charAt(0);if(b<0?--u:(l.c=d,l.e=u,l.s=o,d=(l=r(l,p,y,v,i)).c,h=l.r,u=l.e),b=d[f=u+y+1],c=i/2,h=h||f<0||null!=d[f+1],h=v<4?(null!=b||h)&&(0==v||v==(l.s<0?3:2)):b>c||b==c&&(4==v||h||6==v&&1&d[f-1]||v==(l.s<0?8:7)),f<1||!d[0])t=h?k(s.charAt(1),-y,s.charAt(0)):s.charAt(0);else{if(d.length=f,h)for(--i;++d[--f]>i;)d[f]=0,f||(++u,d=[1].concat(d));for(c=d.length;!d[--c];);for(b=0,t="";b<=c;t+=s.charAt(d[b++]));t=k(t,u,s.charAt(0))}return t}}(),r=function(){function e(e,t,r){var n,i,o,a,s=0,f=e.length,u=t%b,c=t/b|0;for(e=e.slice();f--;)s=((i=u*(o=e[f]%b)+(n=c*o+(a=e[f]/b|0)*u)%b*b+s)/r|0)+(n/b|0)+c*a,e[f]=i%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;it[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]1;e.splice(0,1));}return function(n,i,o,a,s){var u,c,d,p,b,y,g,m,_,w,E,k,A,S,x,I,M,T=n.s==i.s?1:-1,P=n.c,B=i.c;if(!(P&&P[0]&&B&&B[0]))return new z(n.s&&i.s&&(P?!B||P[0]!=B[0]:B)?P&&0==P[0]||!B?0*T:T/0:NaN);for(_=(m=new z(T)).c=[],T=o+(c=n.e-i.e)+1,s||(s=h,c=v(n.e/l)-v(i.e/l),T=T/l|0),d=0;B[d]==(P[d]||0);d++);if(B[d]>(P[d]||0)&&c--,T<0)_.push(1),p=!0;else{for(S=P.length,I=B.length,d=0,T+=2,(b=f(s/(B[0]+1)))>1&&(B=e(B,b,s),P=e(P,b,s),I=B.length,S=P.length),A=I,E=(w=P.slice(0,I)).length;E=s/2&&x++;do{if(b=0,(u=t(B,w,I,E))<0){if(k=w[0],I!=E&&(k=k*s+(w[1]||0)),(b=f(k/x))>1)for(b>=s&&(b=s-1),g=(y=e(B,b,s)).length,E=w.length;1==t(y,w,g,E);)b--,r(y,I=10;T/=10,d++);Y(m,o+(m.e=d+c*l-1)+1,a,p)}else m.e=c,m.r=+p;return m}}(),A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,S=/^([^.]+)\.$/,x=/^\.([^.]+)$/,I=/^-?(Infinity|NaN)$/,M=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(M,"");if(I.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(A,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(S,"$1").replace(x,"0.$1")),t!=o))return new z(o,i);if(z.DEBUG)throw Error(u+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},T.absoluteValue=T.abs=function(){var e=new z(this);return e.s<0&&(e.s=1),e},T.comparedTo=function(e,t){return m(this,new z(e,t))},T.decimalPlaces=T.dp=function(e,t){var r,n,i,o=this;if(null!=e)return _(e,0,y),null==t?t=L:_(t,0,8),Y(new z(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-v(this.e/l))*l,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},T.dividedBy=T.div=function(e,t){return r(this,new z(e,t),B,L)},T.dividedToIntegerBy=T.idiv=function(e,t){return r(this,new z(e,t),0,1)},T.exponentiatedBy=T.pow=function(e,t){var r,n,i,o,a,c,h,d,p=this;if((e=new z(e)).c&&!e.isInteger())throw Error(u+"Exponent not an integer: "+G(e));if(null!=t&&(t=new z(t)),a=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return d=new z(Math.pow(+G(p),a?2-w(e):+G(e))),t?d.mod(t):d;if(c=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new z(NaN);(n=!c&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||a&&p.c[1]>=24e7:p.c[0]<8e13||a&&p.c[0]<=9999975e7)))return o=p.s<0&&w(e)?-0:0,p.e>-1&&(o=1/o),new z(c?1/o:o);q&&(o=s(q/l+2))}for(a?(r=new z(.5),c&&(e.s=1),h=w(e)):h=(i=Math.abs(+G(e)))%2,d=new z(P);;){if(h){if(!(d=d.times(p)).c)break;o?d.c.length>o&&(d.c.length=o):n&&(d=d.mod(t))}if(i){if(0===(i=f(i/2)))break;h=i%2}else if(Y(e=e.times(r),e.e+1,1),e.e>14)h=w(e);else{if(0===(i=+G(e)))break;h=i%2}p=p.times(p),o?p.c&&p.c.length>o&&(p.c.length=o):n&&(p=p.mod(t))}return n?d:(c&&(d=P.div(d)),t?d.mod(t):o?Y(d,q,L,void 0):d)},T.integerValue=function(e){var t=new z(this);return null==e?e=L:_(e,0,8),Y(t,t.e+1,e)},T.isEqualTo=T.eq=function(e,t){return 0===m(this,new z(e,t))},T.isFinite=function(){return!!this.c},T.isGreaterThan=T.gt=function(e,t){return m(this,new z(e,t))>0},T.isGreaterThanOrEqualTo=T.gte=function(e,t){return 1===(t=m(this,new z(e,t)))||0===t},T.isInteger=function(){return!!this.c&&v(this.e/l)>this.c.length-2},T.isLessThan=T.lt=function(e,t){return m(this,new z(e,t))<0},T.isLessThanOrEqualTo=T.lte=function(e,t){return-1===(t=m(this,new z(e,t)))||0===t},T.isNaN=function(){return!this.s},T.isNegative=function(){return this.s<0},T.isPositive=function(){return this.s>0},T.isZero=function(){return!!this.c&&0==this.c[0]},T.minus=function(e,t){var r,n,i,o,a=this,s=a.s;if(t=(e=new z(e,t)).s,!s||!t)return new z(NaN);if(s!=t)return e.s=-t,a.plus(e);var f=a.e/l,u=e.e/l,c=a.c,d=e.c;if(!f||!u){if(!c||!d)return c?(e.s=-t,e):new z(d?a:NaN);if(!c[0]||!d[0])return d[0]?(e.s=-t,e):new z(c[0]?a:3==L?-0:0)}if(f=v(f),u=v(u),c=c.slice(),s=f-u){for((o=s<0)?(s=-s,i=c):(u=f,i=d),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(n=(o=(s=c.length)<(t=d.length))?s:t,s=t=0;t0)for(;t--;c[r++]=0);for(t=h-1;n>s;){if(c[--n]=0;){for(r=0,p=k[i]%_,y=k[i]/_|0,o=i+(a=f);o>i;)r=((u=p*(u=E[--a]%_)+(s=y*u+(c=E[a]/_|0)*p)%_*_+g[o]+r)/m|0)+(s/_|0)+y*c,g[o--]=u%m;g[o]=r}return r?++n:g.splice(0,1),V(e,g,n)},T.negated=function(){var e=new z(this);return e.s=-e.s||null,e},T.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new z(e,t)).s,!i||!t)return new z(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/l,a=e.e/l,s=n.c,f=e.c;if(!o||!a){if(!s||!f)return new z(i/0);if(!s[0]||!f[0])return f[0]?e:new z(s[0]?n:0*i)}if(o=v(o),a=v(a),s=s.slice(),i=o-a){for(i>0?(a=o,r=f):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(t=f.length)<0&&(r=f,f=s,s=r,t=i),i=0;t;)i=(s[--t]=s[t]+f[t]+i)/h|0,s[t]=h===s[t]?0:s[t]%h;return i&&(s=[i].concat(s),++a),V(e,s,a)},T.precision=T.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return _(e,1,y),null==t?t=L:_(t,0,8),Y(new z(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*l+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},T.shiftedBy=function(e){return _(e,-d,d),this.times("1e"+e)},T.squareRoot=T.sqrt=function(){var e,t,n,i,o,a=this,s=a.c,f=a.s,u=a.e,c=B+4,h=new z("0.5");if(1!==f||!s||!s[0])return new z(!f||f<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(f=Math.sqrt(+G(a)))||f==1/0?(((t=g(s)).length+u)%2==0&&(t+="0"),f=Math.sqrt(+t),u=v((u+1)/2)-(u<0||u%2),n=new z(t=f==1/0?"1e"+u:(t=f.toExponential()).slice(0,t.indexOf("e")+1)+u)):n=new z(f+""),n.c[0])for((f=(u=n.e)+c)<3&&(f=0);;)if(o=n,n=h.times(o.plus(r(a,o,c,1))),g(o.c).slice(0,f)===(t=g(n.c)).slice(0,f)){if(n.e0&&b>0){for(o=b%s||s,h=p.substr(0,o);o0&&(h+=c+p.slice(o)),d&&(h="-"+h)}n=l?h+(r.decimalSeparator||"")+((f=+r.fractionGroupSize)?l.replace(new RegExp("\\d{"+f+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):l):h}return(r.prefix||"")+n+(r.suffix||"")},T.toFraction=function(e){var t,n,i,o,a,s,f,c,h,d,b,y,v=this,m=v.c;if(null!=e&&(!(f=new z(e)).isInteger()&&(f.c||1!==f.s)||f.lt(P)))throw Error(u+"Argument "+(f.isInteger()?"out of range: ":"not an integer: ")+G(f));if(!m)return new z(v);for(t=new z(P),h=n=new z(P),i=c=new z(P),y=g(m),a=t.e=y.length-v.e-1,t.c[0]=p[(s=a%l)<0?l+s:s],e=!e||f.comparedTo(t)>0?a>0?t:h:f,s=N,N=1/0,f=new z(y),c.c[0]=0;d=r(f,t,0,1),1!=(o=n.plus(d.times(i))).comparedTo(e);)n=i,i=o,h=c.plus(d.times(o=h)),c=o,t=f.minus(d.times(o=t)),f=o;return o=r(e.minus(n),i,0,1),c=c.plus(o.times(h)),n=n.plus(o.times(i)),c.s=h.s=v.s,b=r(h,i,a*=2,L).minus(v).abs().comparedTo(r(c,n,a,L).minus(v).abs())<1?[h,i]:[c,n],N=s,b},T.toNumber=function(){return+G(this)},T.toPrecision=function(e,t){return null!=e&&_(e,1,y),K(this,e,t,2)},T.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=R||o>=O?E(g(r.c),o):k(g(r.c),o,"0"):10===e?t=k(g((r=Y(new z(r),B+o+1,L)).c),r.e,"0"):(_(e,2,F.length,"Base"),t=n(k(g(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},T.valueOf=T.toJSON=function(){return G(this)},T._isBigNumber=!0,null!=t&&z.set(t),z}()).default=o.BigNumber=o,void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},function(e,t,r){e.exports=i;var n=r(6).EventEmitter;function i(){n.call(this)}r(0)(i,n),i.Readable=r(32),i.Writable=r(120),i.Duplex=r(121),i.Transform=r(122),i.PassThrough=r(123),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",f));var a=!1;function s(){a||(a=!0,e.end())}function f(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",f),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",u),e.on("error",u),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},function(e,t,r){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,n)}));case 4:return t.nextTick((function(){e.call(null,r,n,i)}));default:for(o=new Array(s-1),a=0;a=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(117),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(4))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";var n=r(3),i=r(5),o=i.getNAF,a=i.getJSF,s=i.assert;function f(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=f,f.prototype.point=function(){throw new Error("Not implemented")},f.prototype.validate=function(){throw new Error("Not implemented")},f.prototype._fixedNafMul=function(e,t){s(e.precomputed);var r=e._getDoubles(),n=o(t,1),i=(1<=f;t--)u=(u<<1)+n[t];a.push(u)}for(var c=this.jpoint(null,null,null),h=this.jpoint(null,null,null),l=i;l>0;l--){for(f=0;f=0;u--){for(t=0;u>=0&&0===a[u];u--)t++;if(u>=0&&t++,f=f.dblp(t),u<0)break;var c=a[u];s(0!==c),f="affine"===e.type?c>0?f.mixedAdd(i[c-1>>1]):f.mixedAdd(i[-c-1>>1].neg()):c>0?f.add(i[c-1>>1]):f.add(i[-c-1>>1].neg())}return"affine"===e.type?f.toP():f},f.prototype._wnafMulAdd=function(e,t,r,n,i){for(var s=this._wnafT1,f=this._wnafT2,u=this._wnafT3,c=0,h=0;h=1;h-=2){var d=h-1,p=h;if(1===s[d]&&1===s[p]){var b=[t[d],null,null,t[p]];0===t[d].y.cmp(t[p].y)?(b[1]=t[d].add(t[p]),b[2]=t[d].toJ().mixedAdd(t[p].neg())):0===t[d].y.cmp(t[p].y.redNeg())?(b[1]=t[d].toJ().mixedAdd(t[p]),b[2]=t[d].add(t[p].neg())):(b[1]=t[d].toJ().mixedAdd(t[p]),b[2]=t[d].toJ().mixedAdd(t[p].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],v=a(r[d],r[p]);c=Math.max(v[0].length,c),u[d]=new Array(c),u[p]=new Array(c);for(var g=0;g=0;h--){for(var k=0;h>=0;){var A=!0;for(g=0;g=0&&k++,w=w.dblp(k),h<0)break;for(g=0;g0?S=f[g][x-1>>1]:x<0&&(S=f[g][-x-1>>1].neg()),w="affine"===S.type?w.mixedAdd(S):w.add(S))}}for(h=0;h=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i-1?n:o.nextTick;g.WritableState=v;var u=r(16);u.inherits=r(0);var c,h={deprecate:r(118)},l=r(54),d=r(33).Buffer,p=i.Uint8Array||function(){},b=r(55);function y(){}function v(e,t){s=s||r(10),e=e||{};var n=t instanceof s;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,u=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(u||0===u)?u:c,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 h=!1===e.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(A,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),A(e,t))}(e,r,n,t,i);else{var a=E(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||w(e,r),n?f(_,e,r,a,i):_(e,r,a,i)}}(t,e)},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 a(this)}function g(e){if(s=s||r(10),!(c.call(g,this)||this instanceof s))return new g(e);this._writableState=new v(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function m(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function _(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),A(e,t)}function w(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var s=0,f=!0;r;)i[s]=r,r.isBuf||(f=!1),r=r.next,s+=1;i.allBuffers=f,m(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,h=r.callback;if(m(e,t,!1,t.objectMode?1:u.length,u,c,h),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),A(e,t)}))}function A(e,t){var r=E(t);return r&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(k,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}u.inherits(g,l),v.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(v.prototype,"buffer",{get:h.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(e){return!!c.call(this,e)||this===g&&e&&e._writableState instanceof v}})):c=function(e){return e instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=e,d.isBuffer(n)||n instanceof p);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=y),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),o.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r)),t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var f=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,A(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),g.prototype.destroy=b.destroy,g.prototype._undestroy=b.undestroy,g.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(9),r(26).setImmediate,r(4))},function(e,t,r){"use strict";var n=r(1).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.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}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=f,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=h,t=3;break;default:return this.write=l,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function f(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function l(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";var n=r(0),i=r(132),o=r(133),a=r(134),s=r(139);function f(e){s.call(this,"digest"),this._hash=e}n(f,s),f.prototype._update=function(e){this._hash.update(e)},f.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new o:new f(a(e))}},function(e,t,r){"use strict";var n,i=t,o=r(38),a=r(64),s=r(5).assert;function f(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new f(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=f,u("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:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("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:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("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:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("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:o.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"]}),u("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:o.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"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("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:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(153)}catch(e){n=void 0}u("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:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},function(e,t,r){var n=t;n.utils=r(8),n.common=r(17),n.sha=r(147),n.ripemd=r(151),n.hmac=r(152),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(e,t,r){"use strict";var n=function(e,t){return function(){for(var r=this,n=t.promiseModule,i=new Array(arguments.length),o=0;o0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)f(s,this,t);else{var c=s.length,h=u(s,c);for(r=0;r0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):w(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?w(e,a,t,!1):x(e,a)):w(e,a,t,!1))):n||(a.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=E?e=E:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function A(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(S,e):S(e))}function S(e){d("emit readable"),e.emit("readable"),P(e)}function x(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(I,e,t))}function I(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;return eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=u.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t),n}(e,t.buffer,t.decoder),r);var r}function L(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function O(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?L(this):A(this),null;if(0===(e=k(e,t))&&t.ended)return 0===t.length&&L(this),null;var n,i=t.needReadable;return d("need readable",i),(0===t.length||t.length-e0?B(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&L(this)),null!==n&&this.emit("data",n),n},m.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},m.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,t);var f=t&&!1===t.end||e===n.stdout||e===n.stderr?g:u;function u(){d("onend"),e.end()}o.endEmitted?i.nextTick(f):r.once("end",f),e.on("unpipe",(function t(n,i){d("onunpipe"),n===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,d("cleanup"),e.removeListener("close",y),e.removeListener("finish",v),e.removeListener("drain",c),e.removeListener("error",b),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",g),r.removeListener("data",p),h=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}));var c=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,P(e))}}(r);e.on("drain",c);var h=!1,l=!1;function p(t){d("ondata"),l=!1,!1!==e.write(t)||l||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==O(o.pipes,e))&&!h&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,l=!0),r.pause())}function b(t){d("onerror",t),g(),e.removeListener("error",b),0===s(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",v),g()}function v(){d("onfinish"),e.removeListener("close",y),g()}function g(){d("unpipe"),r.unpipe(e)}return r.on("data",p),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",b),e.once("close",y),e.once("finish",v),e.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),e},m.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},function(e,t,r){var n=r(0),i=r(14),o=r(1).Buffer,a=[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],s=new Array(64);function f(){this.init(),this._w=s,i.call(this,64,56)}function u(e,t,r){return r^e&(t^r)}function c(e,t,r){return e&t|r&(e|t)}function h(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function l(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function d(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(f,i),f.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},f.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,f=0|this._e,p=0|this._f,b=0|this._g,y=0|this._h,v=0;v<16;++v)r[v]=e.readInt32BE(4*v);for(;v<64;++v)r[v]=0|(((t=r[v-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[v-7]+d(r[v-15])+r[v-16];for(var g=0;g<64;++g){var m=y+l(f)+u(f,p,b)+a[g]+r[g]|0,_=h(n)+c(n,i,o)|0;y=b,b=p,p=f,f=s+m|0,s=o,o=i,i=n,n=m+_|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=f+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=y+this._h|0},f.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=f},function(e,t,r){var n=r(0),i=r(14),o=r(1).Buffer,a=[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],s=new Array(160);function f(){this.init(),this._w=s,i.call(this,128,112)}function u(e,t,r){return r^e&(t^r)}function c(e,t,r){return e&t|r&(e|t)}function h(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function l(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function b(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function y(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function v(e,t){return e>>>0>>0?1:0}n(f,i),f.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},f.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,f=0|this._fh,g=0|this._gh,m=0|this._hh,_=0|this._al,w=0|this._bl,E=0|this._cl,k=0|this._dl,A=0|this._el,S=0|this._fl,x=0|this._gl,I=0|this._hl,M=0;M<32;M+=2)t[M]=e.readInt32BE(4*M),t[M+1]=e.readInt32BE(4*M+4);for(;M<160;M+=2){var T=t[M-30],P=t[M-30+1],B=d(T,P),L=p(P,T),R=b(T=t[M-4],P=t[M-4+1]),O=y(P,T),C=t[M-14],N=t[M-14+1],j=t[M-32],D=t[M-32+1],q=L+N|0,U=B+C+v(q,L)|0;U=(U=U+R+v(q=q+O|0,O)|0)+j+v(q=q+D|0,D)|0,t[M]=U,t[M+1]=q}for(var F=0;F<160;F+=2){U=t[F],q=t[F+1];var z=c(r,n,i),K=c(_,w,E),H=h(r,_),V=h(_,r),Y=l(s,A),G=l(A,s),$=a[F],W=a[F+1],Z=u(s,f,g),J=u(A,S,x),X=I+G|0,Q=m+Y+v(X,I)|0;Q=(Q=(Q=Q+Z+v(X=X+J|0,J)|0)+$+v(X=X+W|0,W)|0)+U+v(X=X+q|0,q)|0;var ee=V+K|0,te=H+z+v(ee,V)|0;m=g,I=x,g=f,x=S,f=s,S=A,s=o+Q+v(A=k+X|0,k)|0,o=i,k=E,i=n,E=w,n=r,w=_,r=Q+te+v(_=X+ee|0,X)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+E|0,this._dl=this._dl+k|0,this._el=this._el+A|0,this._fl=this._fl+S|0,this._gl=this._gl+x|0,this._hl=this._hl+I|0,this._ah=this._ah+r+v(this._al,_)|0,this._bh=this._bh+n+v(this._bl,w)|0,this._ch=this._ch+i+v(this._cl,E)|0,this._dh=this._dh+o+v(this._dl,k)|0,this._eh=this._eh+s+v(this._el,A)|0,this._fh=this._fh+f+v(this._fl,S)|0,this._gh=this._gh+g+v(this._gl,x)|0,this._hh=this._hh+m+v(this._hl,I)|0},f.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=f},function(e,t,r){"use strict";var n=t;function i(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(e,t){return"hex"===t?o(e):e}},function(e,t,r){var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict";var n=r(8),i=r(17),o=r(65),a=r(11),s=n.sum32,f=n.sum32_4,u=n.sum32_5,c=o.ch32,h=o.maj32,l=o.s0_256,d=o.s1_256,p=o.g0_256,b=o.g1_256,y=i.BlockHash,v=[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];function g(){if(!(this instanceof g))return new g;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=v,this.W=new Array(64)}n.inherits(g,y),e.exports=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n=0;u--)if(c[u]!==h[u])return!1;for(u=c.length-1;u>=0;u--)if(!m(e[s=c[u]],t[s],r,n))return!1;return!0}(e,t,r,n))}return r?e===t:e==t}function _(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function E(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&v(i,r,"Missing expected exception"+n);var o="string"==typeof n,s=!e&&i&&!r;if((!e&&a.isError(i)&&o&&w(i,r)||s)&&v(i,r,"Got unwanted exception"+n),e&&i&&r&&!w(i,r)||!e&&i)throw i}l.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return b(y(e.actual),128)+" "+e.operator+" "+b(y(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||v;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=p(t),o=n.indexOf("\n"+i);if(o>=0){var a=n.indexOf("\n",o+1);n=n.substring(a+1)}this.stack=n}}},a.inherits(l.AssertionError,Error),l.fail=v,l.ok=g,l.equal=function(e,t,r){e!=t&&v(e,t,r,"==",l.equal)},l.notEqual=function(e,t,r){e==t&&v(e,t,r,"!=",l.notEqual)},l.deepEqual=function(e,t,r){m(e,t,!1)||v(e,t,r,"deepEqual",l.deepEqual)},l.deepStrictEqual=function(e,t,r){m(e,t,!0)||v(e,t,r,"deepStrictEqual",l.deepStrictEqual)},l.notDeepEqual=function(e,t,r){m(e,t,!1)&&v(e,t,r,"notDeepEqual",l.notDeepEqual)},l.notDeepStrictEqual=function e(t,r,n){m(t,r,!0)&&v(t,r,n,"notDeepStrictEqual",e)},l.strictEqual=function(e,t,r){e!==t&&v(e,t,r,"===",l.strictEqual)},l.notStrictEqual=function(e,t,r){e===t&&v(e,t,r,"!==",l.notStrictEqual)},l.throws=function(e,t,r){E(!0,e,t,r)},l.doesNotThrow=function(e,t,r){E(!1,e,t,r)},l.ifError=function(e){if(e)throw e},l.strict=n((function e(t,r){t||v(t,!0,r,"==",e)}),l,{equal:l.strictEqual,deepEqual:l.deepStrictEqual,notEqual:l.notStrictEqual,notDeepEqual:l.notDeepStrictEqual}),l.strict.strict=l.strict;var k=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}}).call(this,r(4))},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(3);function i(e,t){if("00"===e.slice(0,2))throw new Error("invalid RLP: extra zeros");return parseInt(e,t)}function o(t,r){if(t<56)return e.from([t+r]);var n=s(t),i=s(r+55+n.length/2);return e.from(i+n,"hex")}function a(e){return"0x"===e.slice(0,2)}function s(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");var t=e.toString(16);return t.length%2?"0"+t:t}function f(t){if(!e.isBuffer(t)){if("string"==typeof t)return a(t)?e.from((i="string"!=typeof(o=t)?o:a(o)?o.slice(2):o).length%2?"0"+i:i,"hex"):e.from(t);if("number"==typeof t)return t?(r=s(t),e.from(r,"hex")):e.from([]);if(null==t)return e.from([]);if(t instanceof Uint8Array)return e.from(t);if(n.isBN(t))return e.from(t.toArray());throw new Error("invalid type")}var r,i,o;return t}t.encode=function t(r){if(Array.isArray(r)){for(var n=[],i=0;ir.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(s=r.slice(o,h)).length)throw new Error("invalid rlp, List has a invalid length");for(;s.length;)f=t(s),u.push(f.data),s=f.remainder;return{data:u,remainder:r.slice(h)}}(f(t));if(r)return n;if(0!==n.remainder.length)throw new Error("invalid remainder");return n.data},t.getLength=function(t){if(!t||0===t.length)return e.from([]);var r=f(t),n=r[0];if(n<=127)return r.length;if(n<=183)return n-127;if(n<=191)return n-182;if(n<=247)return n-191;var o=n-246;return o+i(r.slice(1,o).toString("hex"),16)}}).call(this,r(7).Buffer)},function(e,t,r){"use strict";(function(t){var n=r(71),i=r(162);function o(e){var t=e;if("string"!=typeof t)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof t+", while padToEven.");return t.length%2&&(t="0"+t),t}function a(e){return"0x"+e.toString(16)}e.exports={arrayContainsArray:function(e,t,r){if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof e+"'");if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof t+"'");return t[Boolean(r)?"some":"every"]((function(t){return e.indexOf(t)>=0}))},intToBuffer:function(e){var r=a(e);return new t(o(r.slice(2)),"hex")},getBinarySize:function(e){if("string"!=typeof e)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof e+"'.");return t.byteLength(e,"utf8")},isHexPrefixed:n,stripHexPrefix:i,padToEven:o,intToHex:a,fromAscii:function(e){for(var t="",r=0;r-1&&e%1==0&&e<=9007199254740991}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(t,r,f){if(f=(0,i.default)(f||n.default),e<=0||!t)return f(null);var u=(0,o.default)(t),c=!1,h=0,l=!1;function d(e,t){if(h-=1,e)c=!0,f(e);else{if(t===s.default||c&&h<=0)return c=!0,f(null);l||p()}}function p(){for(l=!0;h=e.params.length?e.params:"eth_getBlockByNumber"===e.method?e.params.slice(1):e.params.slice(0,t)}function a(e){switch(e.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":return 1;case"eth_getBlockByNumber":return 0;default:return}}function s(e){switch(e.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":return"fork";case"eth_gasPrice":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"eth_blockNumber":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":return"never"}}e.exports={cacheIdentifierForPayload:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!i(e))return null;var r=t.includeBlockRef?e.params:o(e);return e.method+":"+n(r)},canCache:i,blockTagForPayload:function(e){var t=a(e);return t>=e.params.length?null:e.params[t]},paramsWithoutBlockTag:o,blockTagParamIndex:a,cacheTypeForPayload:s}},function(e,t,r){var n="undefined"!=typeof JSON?JSON:r(197);e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r=t.space||"";"number"==typeof r&&(r=Array(r+1).join(" "));var a,s="boolean"==typeof t.cycles&&t.cycles,f=t.replacer||function(e,t){return t},u=t.cmp&&(a=t.cmp,function(e){return function(t,r){var n={key:t,value:e[t]},i={key:r,value:e[r]};return a(n,i)}}),c=[];return function e(t,a,h,l){var d=r?"\n"+new Array(l+1).join(r):"",p=r?": ":":";if(h&&h.toJSON&&"function"==typeof h.toJSON&&(h=h.toJSON()),void 0!==(h=f.call(t,a,h))){if("object"!=typeof h||null===h)return n.stringify(h);if(i(h)){for(var b=[],y=0;y0?t.on("sync",_):r>0&&0===n&&t.removeListener("sync",_)}}},function(e,t,r){e.exports=r(207)},function(e,t,r){"use strict";var n=r(230),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,a=Array.prototype.concat,s=Object.defineProperty,f=s&&function(){var e={};try{for(var t in s(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(e){return!1}}(),u=function(e,t,r,n){var i;t in e&&("function"!=typeof(i=n)||"[object Function]"!==o.call(i)||!n())||(f?s(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r)},c=function(e,t){var r=arguments.length>2?arguments[2]:{},o=n(t);i&&(o=a.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s=0&&"[object Function]"===n.call(e.callee)),r}},function(e,t,r){"use strict";var n=r(21),i=r(232),o=n.call(Function.call,String.prototype.replace),a=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,s=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;e.exports=function(){var e=i.ToString(i.CheckObjectCoercible(this));return o(o(e,a,""),s,"")}},function(e,t,r){"use strict";var n=r(22),i=r(242),o=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")?i(r):r}},function(e,t,r){"use strict";var n=r(90);e.exports=function(){return String.prototype.trim&&"\u200b"==="\u200b".trim()?String.prototype.trim:n}},function(e,t,r){var n=r(6),i=r(51);function o(e){n.EventEmitter.call(this),this.backoffStrategy_=e,this.maxNumberOfRetry_=-1,this.backoffNumber_=0,this.backoffDelay_=0,this.timeoutID_=-1,this.handlers={backoff:this.onBackoff_.bind(this)}}r(2).inherits(o,n.EventEmitter),o.prototype.failAfter=function(e){i.checkArgument(e>0,"Expected a maximum number of retry greater than 0 but got %s.",e),this.maxNumberOfRetry_=e},o.prototype.backoff=function(e){i.checkState(-1===this.timeoutID_,"Backoff in progress."),this.backoffNumber_===this.maxNumberOfRetry_?(this.emit("fail",e),this.reset()):(this.backoffDelay_=this.backoffStrategy_.next(),this.timeoutID_=setTimeout(this.handlers.backoff,this.backoffDelay_),this.emit("backoff",this.backoffNumber_,this.backoffDelay_,e))},o.prototype.onBackoff_=function(){this.timeoutID_=-1,this.emit("ready",this.backoffNumber_,this.backoffDelay_),this.backoffNumber_++},o.prototype.reset=function(){this.backoffNumber_=0,this.backoffStrategy_.reset(),clearTimeout(this.timeoutID_),this.timeoutID_=-1},e.exports=o},function(e,t,r){function n(e){return null!=e}function i(e){if(n((e=e||{}).initialDelay)&&e.initialDelay<1)throw new Error("The initial timeout must be greater than 0.");if(n(e.maxDelay)&&e.maxDelay<1)throw new Error("The maximal timeout must be greater than 0.");if(this.initialDelay_=e.initialDelay||100,this.maxDelay_=e.maxDelay||1e4,this.maxDelay_<=this.initialDelay_)throw new Error("The maximal backoff delay must be greater than the initial backoff delay.");if(n(e.randomisationFactor)&&(e.randomisationFactor<0||e.randomisationFactor>1))throw new Error("The randomisation factor must be between 0 and 1.");this.randomisationFactor_=e.randomisationFactor||0}r(6),r(2),i.prototype.getMaxDelay=function(){return this.maxDelay_},i.prototype.getInitialDelay=function(){return this.initialDelay_},i.prototype.next=function(){var e=this.next_(),t=1+Math.random()*this.randomisationFactor_;return Math.round(e*t)},i.prototype.next_=function(){throw new Error("BackoffStrategy.next_() unimplemented.")},i.prototype.reset=function(){this.reset_()},i.prototype.reset_=function(){throw new Error("BackoffStrategy.reset_() unimplemented.")},e.exports=i},function(e,t,r){var n=r(2),i=r(94);function o(e){i.call(this,e),this.backoffDelay_=0,this.nextBackoffDelay_=this.getInitialDelay()}n.inherits(o,i),o.prototype.next_=function(){var e=Math.min(this.nextBackoffDelay_,this.getMaxDelay());return this.nextBackoffDelay_+=this.backoffDelay_,this.backoffDelay_=e,e},o.prototype.reset_=function(){this.nextBackoffDelay_=this.getInitialDelay(),this.backoffDelay_=0},e.exports=o},function(e,t,r){"use strict";var n=r(6).EventEmitter,i=r(2).inherits,o=r(15),a=r(163),s=r(73),f=r(193),u=r(196),c=(r(84),r(19));function h(e){n.call(this),this.setMaxListeners(30),e=e||{};var t={sendAsync:this._handleAsync.bind(this)},r=e.blockTrackerProvider||t;this._blockTracker=e.blockTracker||new a({provider:r,pollingInterval:e.pollingInterval||4e3,setSkipCacheFlag:void 0===e.setSkipCacheFlag||e.setSkipCacheFlag}),this._ready=new u,this.currentBlock=null,this._providers=[]}function l(e){return e?{number:o.toBuffer(e.number),hash:o.toBuffer(e.hash),parentHash:o.toBuffer(e.parentHash),nonce:o.toBuffer(e.nonce),mixHash:o.toBuffer(e.mixHash),sha3Uncles:o.toBuffer(e.sha3Uncles),logsBloom:o.toBuffer(e.logsBloom),transactionsRoot:o.toBuffer(e.transactionsRoot),stateRoot:o.toBuffer(e.stateRoot),receiptsRoot:o.toBuffer(e.receiptRoot||e.receiptsRoot),miner:o.toBuffer(e.miner),difficulty:o.toBuffer(e.difficulty),totalDifficulty:o.toBuffer(e.totalDifficulty),size:o.toBuffer(e.size),extraData:o.toBuffer(e.extraData),gasLimit:o.toBuffer(e.gasLimit),gasUsed:o.toBuffer(e.gasUsed),timestamp:o.toBuffer(e.timestamp),transactions:e.transactions}:{}}e.exports=h,i(h,n),Object.defineProperty(h,"name",{value:"HttpProvider"}),h.prototype.start=function(){var e=this,t=this;t._ready.go(),t._blockTracker.on("latest",(function(r){t._getBlockByNumber(r,(function(r,n){if(r)e.emit("error",r);else if(n){var i=l(n);t._setCurrentBlock(i),t.emit("rawBlock",n),t.emit("latest",n)}}))})),t._blockTracker.on("sync",t.emit.bind(t,"sync")),t._blockTracker.on("error",t.emit.bind(t,"error")),t._running=!0,t.emit("start")},h.prototype.stop=function(){this._blockTracker.removeAllListeners(),this._running=!1,this.emit("stop")},h.prototype.isRunning=function(){return this._running},h.prototype.addProvider=function(e,t){"number"==typeof t?this._providers.splice(t,0,e):this._providers.push(e),e.setEngine(this)},h.prototype.removeProvider=function(e){var t=this._providers.indexOf(e);if(t<0)throw new Error("Provider not found.");this._providers.splice(t,1)},h.prototype.send=function(e){throw new Error("Web3ProviderEngine does not support synchronous requests.")},h.prototype.sendAsync=function(e,t){var r=this;r._ready.await((function(){Array.isArray(e)?s(e,r._handleAsync.bind(r),t):r._handleAsync(e,t)}))},h.prototype._getBlockByNumber=function(e,t){var r=c({method:"eth_getBlockByNumber",params:[e,!1],skipCache:!0});this._handleAsync(r,(function(e,r){return e?t(e):t(null,r.result)}))},h.prototype._handleAsync=function(e,t){var r=this,n=-1,i=null,o=null,a=[];function s(r,n){o=r,i=n,f(a,(function(e,t){e?e(o,i,t):t()}),(function(){var r={id:e.id,jsonrpc:e.jsonrpc,result:i};null!=o?(r.error={message:o.stack||o.message||o,code:-32e3},t(o,r)):t(null,r)}))}!function t(i){if(n+=1,a.unshift(i),n>=r._providers.length)s(new Error('Request for method "'+e.method+'" not handled by any subprovider. Please check your subprovider configuration to ensure this method is handled.'));else try{r._providers[n].handleRequest(e,t,s)}catch(e){s(e)}}()},h.prototype._setCurrentBlock=function(e){this.currentBlock=e,this.emit("block",e)}},function(e,t,r){"use strict";var n=r(45),i=r(201),o=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,(function(t){var r=t.blockTracker;return i(Object.assign({blockTracker:r},e))})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(n);e.exports=o},function(e,t,r){"use strict";var n=r(2).inherits,i=r(13);function o(e){e=e||{},this.staticResponses=e}e.exports=o,n(o,i),o.prototype.handleRequest=function(e,t,r){var n=this.staticResponses[e.method];"function"==typeof n?n(e,t,r):void 0!==n?setTimeout((function(){return r(null,n)})):t()}},function(e,t,r){"use strict";var n=r(45),i=r(86),o=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,(function(e){var t=e.blockTracker,r=e.provider;return e.engine,i({blockTracker:t,provider:r})})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(n);e.exports=o},function(e,t,r){"use strict";var n=r(73),i=r(2).inherits,o=r(13);function a(e){e=e||{},this.numberOfBlocks=e.numberOfBlocks||10,this.delayInBlocks=e.delayInBlocks||5}e.exports=a,i(a,o),a.prototype.handleRequest=function(e,t,r){if("eth_gasPrice"!==e.method)return t();var i=this;i.emitPayload({method:"eth_blockNumber"},(function(e,t){for(var o=parseInt(t.result,16)-i.delayInBlocks,a=[],s=0;s5e3&&this._backoff.reset(),this._socket.removeEventListener("close",this._handleSocketClose),this._socket.removeEventListener("message",this._handleSocketMessage),this._socket.removeEventListener("open",this._handleSocketOpen),this._socket=null,this._backoff.backoff()}},{key:"_handleSocketMessage",value:function(e){var t=void 0;try{t=JSON.parse(e.data)}catch(e){return void this._log("Received a message that is not valid JSON:",t)}if(void 0===t.id)return this.engine.emit("data",null,t);if(this._pendingRequests.has(t.id)){var r=this._pendingRequests.get(t.id),i=n(r,2),o=i[0],a=i[1];if(this._pendingRequests.delete(t.id),this._log("Received: "+o.method+" #"+t.id),t.error)return a(new Error(t.error.message));a(null,t.result)}}},{key:"_handleSocketOpen",value:function(){var e=this;this._log("Socket open."),this._connectTime=Date.now(),this._pendingRequests.forEach((function(t){var r=n(t,2),i=r[0],o=r[1];e._unhandledRequests.push([i,null,o])})),this._pendingRequests.clear(),this._unhandledRequests.splice(0,this._unhandledRequests.length).forEach((function(t){e.handleRequest.apply(e,t)}))}},{key:"_openSocket",value:function(){this._log("Opening socket..."),this._socket=new s(this._url,[],this._origin?{headers:{origin:this._origin}}:{}),this._socket.addEventListener("close",this._handleSocketClose),this._socket.addEventListener("message",this._handleSocketMessage),this._socket.addEventListener("open",this._handleSocketOpen)}}]),t}(f);Object.assign(c.prototype,a.prototype),e.exports=c}).call(this,r(4))},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){"use strict";var n=r(109),i=r(124);e.exports=function(e){var t=n(e),r=i(e);return function(e,n){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new t(1152,448,null,224,n);case"keccak256":return new t(1088,512,null,256,n);case"keccak384":return new t(832,768,null,384,n);case"keccak512":return new t(576,1024,null,512,n);case"sha3-224":return new t(1152,448,6,224,n);case"sha3-256":return new t(1088,512,6,256,n);case"sha3-384":return new t(832,768,6,384,n);case"sha3-512":return new t(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+e)}}}},function(e,t,r){"use strict";var n=r(1).Buffer,i=r(24).Transform,o=r(0);e.exports=function(e){function t(t,r,n,o,a){i.call(this,a),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=o,this._options=a,this._state=new e,this._state.initialize(t,r),this._finalized=!1}return o(t,i),t.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},t.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},t.prototype.update=function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return n.isBuffer(e)||(e=n.from(e,t)),this._state.absorb(e),this},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},function(e,t,r){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=u(e),a=n[0],s=n[1],f=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),c=0,h=s>0?a-4:a;for(r=0;r>16&255,f[c++]=t>>8&255,f[c++]=255&t;return 2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,f[c++]=255&t),1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,f[c++]=t>>8&255,f[c++]=255&t),f},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));return 1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,f=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var i,o,a=[],s=t;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,f=(1<>1,c=-7,h=r?i-1:0,l=r?-1:1,d=e[t+h];for(h+=l,o=d&(1<<-c)-1,d>>=-c,c+=s;c>0;o=256*o+e[t+h],h+=l,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+e[t+h],h+=l,c-=8);if(0===o)o=1-u;else{if(o===f)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=u}return(d?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,f,u=8*o-i-1,c=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-a))<1&&(a--,f*=2),(t+=a+h>=1?l/f:l*Math.pow(2,1-h))*f>=2&&(a++,f/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(t*f-1)*Math.pow(2,i),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;e[r+d]=255&a,d+=p,a/=256,u-=8);e[r+d-p]|=128*b}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t){},function(e,t,r){"use strict";var n=r(33).Buffer,i=r(116);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,i=n.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=i,r=a,o.data.copy(t,r),a+=o.data.length,o=o.next;return i},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i,o,a,s,f=1,u={},c=!1,h=e.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(e);l=l&&l.setTimeout?l:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){p(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),n=function(t){e.postMessage(a+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){o.port2.postMessage(e)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,n=function(e){var t=h.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):n=function(e){setTimeout(p,0,e)},l.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(i.p1600(this.state),this.count=0);return t},o.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},e.exports=o},function(e,t,r){"use strict";var n=[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];t.p1600=function(e){for(var t=0;t<24;++t){var r=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],s=e[4]^e[14]^e[24]^e[34]^e[44],f=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],c=e[7]^e[17]^e[27]^e[37]^e[47],h=e[8]^e[18]^e[28]^e[38]^e[48],l=e[9]^e[19]^e[29]^e[39]^e[49],d=h^(o<<1|a>>>31),p=l^(a<<1|o>>>31),b=e[0]^d,y=e[1]^p,v=e[10]^d,g=e[11]^p,m=e[20]^d,_=e[21]^p,w=e[30]^d,E=e[31]^p,k=e[40]^d,A=e[41]^p;d=r^(s<<1|f>>>31),p=i^(f<<1|s>>>31);var S=e[2]^d,x=e[3]^p,I=e[12]^d,M=e[13]^p,T=e[22]^d,P=e[23]^p,B=e[32]^d,L=e[33]^p,R=e[42]^d,O=e[43]^p;d=o^(u<<1|c>>>31),p=a^(c<<1|u>>>31);var C=e[4]^d,N=e[5]^p,j=e[14]^d,D=e[15]^p,q=e[24]^d,U=e[25]^p,F=e[34]^d,z=e[35]^p,K=e[44]^d,H=e[45]^p;d=s^(h<<1|l>>>31),p=f^(l<<1|h>>>31);var V=e[6]^d,Y=e[7]^p,G=e[16]^d,$=e[17]^p,W=e[26]^d,Z=e[27]^p,J=e[36]^d,X=e[37]^p,Q=e[46]^d,ee=e[47]^p;d=u^(r<<1|i>>>31),p=c^(i<<1|r>>>31);var te=e[8]^d,re=e[9]^p,ne=e[18]^d,ie=e[19]^p,oe=e[28]^d,ae=e[29]^p,se=e[38]^d,fe=e[39]^p,ue=e[48]^d,ce=e[49]^p,he=b,le=y,de=g<<4|v>>>28,pe=v<<4|g>>>28,be=m<<3|_>>>29,ye=_<<3|m>>>29,ve=E<<9|w>>>23,ge=w<<9|E>>>23,me=k<<18|A>>>14,_e=A<<18|k>>>14,we=S<<1|x>>>31,Ee=x<<1|S>>>31,ke=M<<12|I>>>20,Ae=I<<12|M>>>20,Se=T<<10|P>>>22,xe=P<<10|T>>>22,Ie=L<<13|B>>>19,Me=B<<13|L>>>19,Te=R<<2|O>>>30,Pe=O<<2|R>>>30,Be=N<<30|C>>>2,Le=C<<30|N>>>2,Re=j<<6|D>>>26,Oe=D<<6|j>>>26,Ce=U<<11|q>>>21,Ne=q<<11|U>>>21,je=F<<15|z>>>17,De=z<<15|F>>>17,qe=H<<29|K>>>3,Ue=K<<29|H>>>3,Fe=V<<28|Y>>>4,ze=Y<<28|V>>>4,Ke=$<<23|G>>>9,He=G<<23|$>>>9,Ve=W<<25|Z>>>7,Ye=Z<<25|W>>>7,Ge=J<<21|X>>>11,$e=X<<21|J>>>11,We=ee<<24|Q>>>8,Ze=Q<<24|ee>>>8,Je=te<<27|re>>>5,Xe=re<<27|te>>>5,Qe=ne<<20|ie>>>12,et=ie<<20|ne>>>12,tt=ae<<7|oe>>>25,rt=oe<<7|ae>>>25,nt=se<<8|fe>>>24,it=fe<<8|se>>>24,ot=ue<<14|ce>>>18,at=ce<<14|ue>>>18;e[0]=he^~ke&Ce,e[1]=le^~Ae&Ne,e[10]=Fe^~Qe&be,e[11]=ze^~et&ye,e[20]=we^~Re&Ve,e[21]=Ee^~Oe&Ye,e[30]=Je^~de&Se,e[31]=Xe^~pe&xe,e[40]=Be^~Ke&tt,e[41]=Le^~He&rt,e[2]=ke^~Ce&Ge,e[3]=Ae^~Ne&$e,e[12]=Qe^~be&Ie,e[13]=et^~ye&Me,e[22]=Re^~Ve&nt,e[23]=Oe^~Ye&it,e[32]=de^~Se&je,e[33]=pe^~xe&De,e[42]=Ke^~tt&ve,e[43]=He^~rt&ge,e[4]=Ce^~Ge&ot,e[5]=Ne^~$e&at,e[14]=be^~Ie&qe,e[15]=ye^~Me&Ue,e[24]=Ve^~nt&me,e[25]=Ye^~it&_e,e[34]=Se^~je&We,e[35]=xe^~De&Ze,e[44]=tt^~ve&Te,e[45]=rt^~ge&Pe,e[6]=Ge^~ot&he,e[7]=$e^~at&le,e[16]=Ie^~qe&Fe,e[17]=Me^~Ue&ze,e[26]=nt^~me&we,e[27]=it^~_e&Ee,e[36]=je^~We&Je,e[37]=De^~Ze&Xe,e[46]=ve^~Te&Be,e[47]=ge^~Pe&Le,e[8]=ot^~he&ke,e[9]=at^~le&Ae,e[18]=qe^~Fe&Qe,e[19]=Ue^~ze&et,e[28]=me^~we&Re,e[29]=_e^~Ee&Oe,e[38]=We^~Je&de,e[39]=Ze^~Xe&pe,e[48]=Te^~Be&Ke,e[49]=Pe^~Le&He,e[0]^=n[2*t],e[1]^=n[2*t+1]}}},function(e,t,r){"use strict";var n=r(128),i=r(129),o=r(58);function a(e,t){return void 0===e?t:(n.isBoolean(e,o.COMPRESSED_TYPE_INVALID),e)}e.exports=function(e){return{privateKeyVerify:function(t){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),32===t.length&&e.privateKeyVerify(t)},privateKeyExport:function(t,r){n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),r=a(r,!0);var s=e.privateKeyExport(t,r);return i.privateKeyExport(t,s,r)},privateKeyImport:function(t){if(n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),(t=i.privateKeyImport(t))&&32===t.length&&e.privateKeyVerify(t))return t;throw new Error(o.EC_PRIVATE_KEY_IMPORT_DER_FAIL)},privateKeyNegate:function(t){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),e.privateKeyNegate(t)},privateKeyModInverse:function(t){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),e.privateKeyModInverse(t)},privateKeyTweakAdd:function(t,r){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),e.privateKeyTweakAdd(t,r)},privateKeyTweakMul:function(t,r){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),e.privateKeyTweakMul(t,r)},publicKeyCreate:function(t,r){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),r=a(r,!0),e.publicKeyCreate(t,r)},publicKeyConvert:function(t,r){return n.isBuffer(t,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),r=a(r,!0),e.publicKeyConvert(t,r)},publicKeyVerify:function(t){return n.isBuffer(t,o.EC_PUBLIC_KEY_TYPE_INVALID),e.publicKeyVerify(t)},publicKeyTweakAdd:function(t,r,i){return n.isBuffer(t,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),i=a(i,!0),e.publicKeyTweakAdd(t,r,i)},publicKeyTweakMul:function(t,r,i){return n.isBuffer(t,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),i=a(i,!0),e.publicKeyTweakMul(t,r,i)},publicKeyCombine:function(t,r){n.isArray(t,o.EC_PUBLIC_KEYS_TYPE_INVALID),n.isLengthGTZero(t,o.EC_PUBLIC_KEYS_LENGTH_INVALID);for(var i=0;i=r)throw RangeError(n)}}).call(this,r(7).Buffer)},function(e,t,r){"use strict";var n=r(1).Buffer,i=r(130),o=n.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]),a=n.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]);t.privateKeyExport=function(e,t,r){var i=n.from(r?o:a);return e.copy(i,r?8:9),t.copy(i,r?181:214),i},t.privateKeyImport=function(e){var t=e.length,r=0;if(!(t2||t1?e[r+n-2]<<8:0);if(!(t<(r+=n)+i||t32||t1&&0===t[o]&&!(128&t[o+1]);--r,++o);for(var a=n.concat([n.from([0]),e.s]),s=33,f=0;s>1&&0===a[f]&&!(128&a[f+1]);--s,++f);return i.encode(t.slice(o),a.slice(f))},t.signatureImport=function(e){var t=n.alloc(32,0),r=n.alloc(32,0);try{var o=i.decode(e);if(33===o.r.length&&0===o.r[0]&&(o.r=o.r.slice(1)),o.r.length>32)throw new Error("R length is too long");if(33===o.s.length&&0===o.s[0]&&(o.s=o.s.slice(1)),o.s.length>32)throw new Error("S length is too long")}catch(e){return}return o.r.copy(t,32-o.r.length),o.s.copy(r,32-o.s.length),{r:t,s:r}},t.signatureImportLax=function(e){var t=n.alloc(32,0),r=n.alloc(32,0),i=e.length,o=0;if(48===e[o++]){var a=e[o++];if(!(128&a&&(o+=a-128)>i)&&2===e[o++]){var s=e[o++];if(128&s){if(o+(a=s-128)>i)return;for(;a>0&&0===e[o];o+=1,a-=1);for(s=0;a>0;o+=1,a-=1)s=(s<<8)+e[o]}if(!(s>i-o)){var f=o;if(o+=s,2===e[o++]){var u=e[o++];if(128&u){if(o+(a=u-128)>i)return;for(;a>0&&0===e[o];o+=1,a-=1);for(u=0;a>0;o+=1,a-=1)u=(u<<8)+e[o]}if(!(u>i-o)){var c=o;for(o+=u;s>0&&0===e[f];s-=1,f+=1);if(!(s>32)){var h=e.slice(f,f+s);for(h.copy(t,32-h.length);u>0&&0===e[c];u-=1,c+=1);if(!(u>32)){var l=e.slice(c,c+u);return l.copy(r,32-l.length),{r:t,s:r}}}}}}}}}},function(e,t,r){var n=r(1).Buffer;e.exports={check:function(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;var t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;var r=e[5+t];return 0!==r&&6+t+r===e.length&&!(128&e[4])&&!(t>1&&0===e[4]&&!(128&e[5]))&&!(128&e[t+6])&&!(r>1&&0===e[t+6]&&!(128&e[t+7]))},decode:function(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");var t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");var r=e[5+t];if(0===r)throw new Error("S length is zero");if(6+t+r!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(r>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}},encode:function(e,t){var r=e.length,i=t.length;if(0===r)throw new Error("R length is zero");if(0===i)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(i>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&t[0])throw new Error("S value is negative");if(r>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(i>1&&0===t[0]&&!(128&t[1]))throw new Error("S value excessively padded");var o=n.allocUnsafe(6+r+i);return o[0]=48,o[1]=o.length-2,o[2]=2,o[3]=e.length,e.copy(o,4),o[4+r]=2,o[5+r]=t.length,t.copy(o,6+r),o}}},function(e,t,r){"use strict";var n=r(1).Buffer,i=r(36),o=r(3),a=r(141).ec,s=r(58),f=new a("secp256k1"),u=f.curve;function c(e){var t=e[0];switch(t){case 2:case 3:return 33!==e.length?null:function(e,t){var r=new o(t);if(r.cmp(u.p)>=0)return null;var n=(r=r.toRed(u.red)).redSqr().redIMul(r).redIAdd(u.b).redSqrt();return 3===e!==n.isOdd()&&(n=n.redNeg()),f.keyPair({pub:{x:r,y:n}})}(t,e.slice(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,t,r){var n=new o(t),i=new o(r);if(n.cmp(u.p)>=0||i.cmp(u.p)>=0)return null;if(n=n.toRed(u.red),i=i.toRed(u.red),(6===e||7===e)&&i.isOdd()!==(7===e))return null;var a=n.redSqr().redIMul(n);return i.redSqr().redISub(a.redIAdd(u.b)).isZero()?f.keyPair({pub:{x:n,y:i}}):null}(t,e.slice(1,33),e.slice(33,65));default:return null}}t.privateKeyVerify=function(e){var t=new o(e);return t.cmp(u.n)<0&&!t.isZero()},t.privateKeyExport=function(e,t){var r=new o(e);if(r.cmp(u.n)>=0||r.isZero())throw new Error(s.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return n.from(f.keyFromPrivate(e).getPublic(t,!0))},t.privateKeyNegate=function(e){var t=new o(e);return t.isZero()?n.alloc(32):u.n.sub(t).umod(u.n).toArrayLike(n,"be",32)},t.privateKeyModInverse=function(e){var t=new o(e);if(t.cmp(u.n)>=0||t.isZero())throw new Error(s.EC_PRIVATE_KEY_RANGE_INVALID);return t.invm(u.n).toArrayLike(n,"be",32)},t.privateKeyTweakAdd=function(e,t){var r=new o(t);if(r.cmp(u.n)>=0)throw new Error(s.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(r.iadd(new o(e)),r.cmp(u.n)>=0&&r.isub(u.n),r.isZero())throw new Error(s.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return r.toArrayLike(n,"be",32)},t.privateKeyTweakMul=function(e,t){var r=new o(t);if(r.cmp(u.n)>=0||r.isZero())throw new Error(s.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);return r.imul(new o(e)),r.cmp(u.n)&&(r=r.umod(u.n)),r.toArrayLike(n,"be",32)},t.publicKeyCreate=function(e,t){var r=new o(e);if(r.cmp(u.n)>=0||r.isZero())throw new Error(s.EC_PUBLIC_KEY_CREATE_FAIL);return n.from(f.keyFromPrivate(e).getPublic(t,!0))},t.publicKeyConvert=function(e,t){var r=c(e);if(null===r)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);return n.from(r.getPublic(t,!0))},t.publicKeyVerify=function(e){return null!==c(e)},t.publicKeyTweakAdd=function(e,t,r){var i=c(e);if(null===i)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);if((t=new o(t)).cmp(u.n)>=0)throw new Error(s.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);var a=u.g.mul(t).add(i.pub);if(a.isInfinity())throw new Error(s.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return n.from(a.encode(!0,r))},t.publicKeyTweakMul=function(e,t,r){var i=c(e);if(null===i)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);if((t=new o(t)).cmp(u.n)>=0||t.isZero())throw new Error(s.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return n.from(i.pub.mul(t).encode(!0,r))},t.publicKeyCombine=function(e,t){for(var r=new Array(e.length),i=0;i=0||r.cmp(u.n)>=0)throw new Error(s.ECDSA_SIGNATURE_PARSE_FAIL);var i=n.from(e);return 1===r.cmp(f.nh)&&u.n.sub(r).toArrayLike(n,"be",32).copy(i,32),i},t.signatureExport=function(e){var t=e.slice(0,32),r=e.slice(32,64);if(new o(t).cmp(u.n)>=0||new o(r).cmp(u.n)>=0)throw new Error(s.ECDSA_SIGNATURE_PARSE_FAIL);return{r:t,s:r}},t.signatureImport=function(e){var t=new o(e.r);t.cmp(u.n)>=0&&(t=new o(0));var r=new o(e.s);return r.cmp(u.n)>=0&&(r=new o(0)),n.concat([t.toArrayLike(n,"be",32),r.toArrayLike(n,"be",32)])},t.sign=function(e,t,r,i){if("function"==typeof r){var a=r;r=function(r){var f=a(e,t,null,i,r);if(!n.isBuffer(f)||32!==f.length)throw new Error(s.ECDSA_SIGN_FAIL);return new o(f)}}var c=new o(t);if(c.cmp(u.n)>=0||c.isZero())throw new Error(s.ECDSA_SIGN_FAIL);var h=f.sign(e,t,{canonical:!0,k:r,pers:i});return{signature:n.concat([h.r.toArrayLike(n,"be",32),h.s.toArrayLike(n,"be",32)]),recovery:h.recoveryParam}},t.verify=function(e,t,r){var n={r:t.slice(0,32),s:t.slice(32,64)},i=new o(n.r),a=new o(n.s);if(i.cmp(u.n)>=0||a.cmp(u.n)>=0)throw new Error(s.ECDSA_SIGNATURE_PARSE_FAIL);if(1===a.cmp(f.nh)||i.isZero()||a.isZero())return!1;var h=c(r);if(null===h)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);return f.verify(e,n,{x:h.pub.x,y:h.pub.y})},t.recover=function(e,t,r,i){var a={r:t.slice(0,32),s:t.slice(32,64)},c=new o(a.r),h=new o(a.s);if(c.cmp(u.n)>=0||h.cmp(u.n)>=0)throw new Error(s.ECDSA_SIGNATURE_PARSE_FAIL);try{if(c.isZero()||h.isZero())throw new Error;var l=f.recoverPubKey(e,a,r);return n.from(l.encode(!0,i))}catch(e){throw new Error(s.ECDSA_RECOVER_FAIL)}},t.ecdh=function(e,r){var n=t.ecdhUnsafe(e,r,!0);return i("sha256").update(n).digest()},t.ecdhUnsafe=function(e,t,r){var i=c(e);if(null===i)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);var a=new o(t);if(a.cmp(u.n)>=0||a.isZero())throw new Error(s.ECDH_FAIL);return n.from(i.pub.mul(a).encode(!0,r))}},function(e,t,r){"use strict";var n=r(0),i=r(59),o=r(1).Buffer,a=new Array(16);function s(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function f(e,t){return e<>>32-t}function u(e,t,r,n,i,o,a){return f(e+(t&r|~t&n)+i+o|0,a)+t|0}function c(e,t,r,n,i,o,a){return f(e+(t&n|r&~n)+i+o|0,a)+t|0}function h(e,t,r,n,i,o,a){return f(e+(t^r^n)+i+o|0,a)+t|0}function l(e,t,r,n,i,o,a){return f(e+(r^(t|~n))+i+o|0,a)+t|0}n(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=u(r,n,i,o,e[0],3614090360,7),o=u(o,r,n,i,e[1],3905402710,12),i=u(i,o,r,n,e[2],606105819,17),n=u(n,i,o,r,e[3],3250441966,22),r=u(r,n,i,o,e[4],4118548399,7),o=u(o,r,n,i,e[5],1200080426,12),i=u(i,o,r,n,e[6],2821735955,17),n=u(n,i,o,r,e[7],4249261313,22),r=u(r,n,i,o,e[8],1770035416,7),o=u(o,r,n,i,e[9],2336552879,12),i=u(i,o,r,n,e[10],4294925233,17),n=u(n,i,o,r,e[11],2304563134,22),r=u(r,n,i,o,e[12],1804603682,7),o=u(o,r,n,i,e[13],4254626195,12),i=u(i,o,r,n,e[14],2792965006,17),r=c(r,n=u(n,i,o,r,e[15],1236535329,22),i,o,e[1],4129170786,5),o=c(o,r,n,i,e[6],3225465664,9),i=c(i,o,r,n,e[11],643717713,14),n=c(n,i,o,r,e[0],3921069994,20),r=c(r,n,i,o,e[5],3593408605,5),o=c(o,r,n,i,e[10],38016083,9),i=c(i,o,r,n,e[15],3634488961,14),n=c(n,i,o,r,e[4],3889429448,20),r=c(r,n,i,o,e[9],568446438,5),o=c(o,r,n,i,e[14],3275163606,9),i=c(i,o,r,n,e[3],4107603335,14),n=c(n,i,o,r,e[8],1163531501,20),r=c(r,n,i,o,e[13],2850285829,5),o=c(o,r,n,i,e[2],4243563512,9),i=c(i,o,r,n,e[7],1735328473,14),r=h(r,n=c(n,i,o,r,e[12],2368359562,20),i,o,e[5],4294588738,4),o=h(o,r,n,i,e[8],2272392833,11),i=h(i,o,r,n,e[11],1839030562,16),n=h(n,i,o,r,e[14],4259657740,23),r=h(r,n,i,o,e[1],2763975236,4),o=h(o,r,n,i,e[4],1272893353,11),i=h(i,o,r,n,e[7],4139469664,16),n=h(n,i,o,r,e[10],3200236656,23),r=h(r,n,i,o,e[13],681279174,4),o=h(o,r,n,i,e[0],3936430074,11),i=h(i,o,r,n,e[3],3572445317,16),n=h(n,i,o,r,e[6],76029189,23),r=h(r,n,i,o,e[9],3654602809,4),o=h(o,r,n,i,e[12],3873151461,11),i=h(i,o,r,n,e[15],530742520,16),r=l(r,n=h(n,i,o,r,e[2],3299628645,23),i,o,e[0],4096336452,6),o=l(o,r,n,i,e[7],1126891415,10),i=l(i,o,r,n,e[14],2878612391,15),n=l(n,i,o,r,e[5],4237533241,21),r=l(r,n,i,o,e[12],1700485571,6),o=l(o,r,n,i,e[3],2399980690,10),i=l(i,o,r,n,e[10],4293915773,15),n=l(n,i,o,r,e[1],2240044497,21),r=l(r,n,i,o,e[8],1873313359,6),o=l(o,r,n,i,e[15],4264355552,10),i=l(i,o,r,n,e[6],2734768916,15),n=l(n,i,o,r,e[13],1309151649,21),r=l(r,n,i,o,e[4],4149444226,6),o=l(o,r,n,i,e[11],3174756917,10),i=l(i,o,r,n,e[2],718787259,15),n=l(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},s.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 e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},function(e,t,r){"use strict";var n=r(7).Buffer,i=r(0),o=r(59),a=new Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],f=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],c=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],h=[0,1518500249,1859775393,2400959708,2840853838],l=[1352829926,1548603684,1836072691,2053994217,0];function d(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<>>32-t}function b(e,t,r,n,i,o,a,s){return p(e+(t^r^n)+o+a|0,s)+i|0}function y(e,t,r,n,i,o,a,s){return p(e+(t&r|~t&n)+o+a|0,s)+i|0}function v(e,t,r,n,i,o,a,s){return p(e+((t|~r)^n)+o+a|0,s)+i|0}function g(e,t,r,n,i,o,a,s){return p(e+(t&n|r&~n)+o+a|0,s)+i|0}function m(e,t,r,n,i,o,a,s){return p(e+(t^(r|~n))+o+a|0,s)+i|0}i(d,o),d.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,d=0|this._e,_=0|this._a,w=0|this._b,E=0|this._c,k=0|this._d,A=0|this._e,S=0;S<80;S+=1){var x,I;S<16?(x=b(r,n,i,o,d,e[s[S]],h[0],u[S]),I=m(_,w,E,k,A,e[f[S]],l[0],c[S])):S<32?(x=y(r,n,i,o,d,e[s[S]],h[1],u[S]),I=g(_,w,E,k,A,e[f[S]],l[1],c[S])):S<48?(x=v(r,n,i,o,d,e[s[S]],h[2],u[S]),I=v(_,w,E,k,A,e[f[S]],l[2],c[S])):S<64?(x=g(r,n,i,o,d,e[s[S]],h[3],u[S]),I=y(_,w,E,k,A,e[f[S]],l[3],c[S])):(x=m(r,n,i,o,d,e[s[S]],h[4],u[S]),I=b(_,w,E,k,A,e[f[S]],l[4],c[S])),r=d,d=o,o=p(i,10),i=n,n=x,_=A,A=k,k=p(E,10),E=w,w=I}var M=this._b+i+k|0;this._b=this._c+o+A|0,this._c=this._d+d+_|0,this._d=this._e+r+w|0,this._e=this._a+n+E|0,this._a=M},d.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 e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=d},function(e,t,r){(t=e.exports=function(e){e=e.toLowerCase();var r=t[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r}).sha=r(135),t.sha1=r(136),t.sha224=r(137),t.sha256=r(60),t.sha384=r(138),t.sha512=r(61)},function(e,t,r){var n=r(0),i=r(14),o=r(1).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function f(){this.init(),this._w=s,i.call(this,64,56)}function u(e){return e<<30|e>>>2}function c(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(f,i),f.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},f.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,f=0|this._e,h=0;h<16;++h)r[h]=e.readInt32BE(4*h);for(;h<80;++h)r[h]=r[h-3]^r[h-8]^r[h-14]^r[h-16];for(var l=0;l<80;++l){var d=~~(l/20),p=0|((t=n)<<5|t>>>27)+c(d,i,o,s)+f+r[l]+a[d];f=s,s=o,o=u(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=f+this._e|0},f.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=f},function(e,t,r){var n=r(0),i=r(14),o=r(1).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function f(){this.init(),this._w=s,i.call(this,64,56)}function u(e){return e<<5|e>>>27}function c(e){return e<<30|e>>>2}function h(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(f,i),f.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},f.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,f=0|this._e,l=0;l<16;++l)r[l]=e.readInt32BE(4*l);for(;l<80;++l)r[l]=(t=r[l-3]^r[l-8]^r[l-14]^r[l-16])<<1|t>>>31;for(var d=0;d<80;++d){var p=~~(d/20),b=u(n)+h(p,i,o,s)+f+r[d]+a[p]|0;f=s,s=o,o=c(i),i=n,n=b}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=f+this._e|0},f.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=f},function(e,t,r){var n=r(0),i=r(60),o=r(14),a=r(1).Buffer,s=new Array(64);function f(){this.init(),this._w=s,o.call(this,64,56)}n(f,i),f.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},f.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=f},function(e,t,r){var n=r(0),i=r(61),o=r(14),a=r(1).Buffer,s=new Array(160);function f(){this.init(),this._w=s,o.call(this,128,112)}n(f,i),f.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},f.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=f},function(e,t,r){var n=r(1).Buffer,i=r(24).Transform,o=r(35).StringDecoder;function a(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(0)(a,i),a.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=a},function(e,t){},function(e,t,r){"use strict";var n=t;n.version=r(142).version,n.utils=r(5),n.rand=r(63),n.curve=r(64),n.curves=r(37),n.ec=r(154),n.eddsa=r(158)},function(e){e.exports={_from:"elliptic@^6.4.1",_id:"elliptic@6.5.1",_inBundle:!1,_integrity:"sha512-xvJINNLbTeWQjrl6X+7eQCrIy/YPv5XCpKW6kB5mKvtnGILoLDcySuwomfdzt0BMdLNVnuRNTuzKNHj0bva1Cg==",_location:"/elliptic",_phantomChildren:{},_requested:{type:"range",registry:!0,raw:"elliptic@^6.4.1",name:"elliptic",escapedName:"elliptic",rawSpec:"^6.4.1",saveSpec:null,fetchSpec:"^6.4.1"},_requiredBy:["/browserify-sign","/create-ecdh","/secp256k1"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.5.1.tgz",_shasum:"c380f5f909bf1b9b4428d028cd18d3b0efd6b52b",_spec:"elliptic@^6.4.1",_where:"/Users/alex/Documents/Squarelink/SDKs/Web3/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:"^3.0.4",grunt:"^1.0.4","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":"^9.0.1",istanbul:"^0.4.2",jscs:"^3.0.7",jshint:"^2.6.0",mocha:"^6.1.4"},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.5.1"}},function(e,t){},function(e,t,r){"use strict";var n=r(5),i=r(3),o=r(0),a=r(28),s=n.assert;function f(e){a.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.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(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,n){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(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 c(e,t,r,n){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,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}o(f,a),e.exports=f,f.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(r)}}},f.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},f.prototype._getEndoBasis=function(e){for(var t,r,n,o,a,s,f,u,c,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=e,d=this.n.clone(),p=new i(1),b=new i(0),y=new i(0),v=new i(1),g=0;0!==l.cmpn(0);){var m=d.div(l);u=d.sub(m.mul(l)),c=y.sub(m.mul(p));var _=v.sub(m.mul(b));if(!n&&u.cmp(h)<0)t=f.neg(),r=p,n=u.neg(),o=c;else if(n&&2==++g)break;f=u,d=l,l=u,y=p,p=c,v=b,b=_}a=u.neg(),s=c;var w=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(w)>=0&&(a=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},f.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),f=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:f.add(u).neg()}},f.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},f.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},f.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},u.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},u.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},u.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},u.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(c,a.BasePoint),f.prototype.jpoint=function(e,t,r){return new c(this,e,t,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),f=o.redSub(a);if(0===s.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),c=u.redMul(s),h=n.redMul(u),l=f.redSqr().redIAdd(c).redISub(h).redISub(h),d=f.redMul(h.redISub(l)).redISub(o.redMul(c)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(l,d,p)},c.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=a.redSqr(),u=f.redMul(a),c=r.redMul(f),h=s.redSqr().redIAdd(u).redISub(c).redISub(c),l=s.redMul(c.redISub(h)).redISub(i.redMul(u)),d=this.z.redMul(a);return this.curve.jpoint(h,l,d)},c.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict";var n=r(3),i=r(0),o=r(28),a=r(5);function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function f(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(f,o.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},s.prototype.point=function(e,t){return new f(this,e,t)},s.prototype.pointFromJSON=function(e){return f.fromJSON(this,e)},f.prototype.precompute=function(){},f.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},f.fromJSON=function(e,t){return new f(e,t[0],t[1]||e.one)},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},f.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},f.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),f=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,f)},f.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},f.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},f.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";var n=r(5),i=r(3),o=r(0),a=r(28),s=n.assert;function f(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function u(e,t,r,n,o){a.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(f,a),e.exports=f,f.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},f.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},f.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},f.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var f=s.fromRed().isOdd();return(t&&!f||!t&&f)&&(s=s.redNeg()),this.point(e,s)},f.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},f.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(u,a.BasePoint),f.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},f.prototype.point=function(e,t,r,n){return new u(this,e,t,r,n)},u.fromJSON=function(e,t){return new u(e,t[0],t[1],t[2])},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),f=i.redMul(a),u=o.redMul(s),c=i.redMul(s),h=a.redMul(o);return this.curve.point(f,u,h,c)},u.prototype._projDbl=function(){var e,t,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(u=this.curve._mulA(i)).redAdd(o);if(this.zOne)e=n.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(u.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),f=a.redSub(s).redISub(s);e=n.redSub(i).redISub(o).redMul(f),t=a.redMul(u.redSub(o)),r=a.redMul(f)}}else{var u=i.redAdd(o);s=this.curve._mulC(this.z).redSqr(),f=u.redSub(s).redSub(s),e=this.curve._mulC(n.redISub(u)).redMul(f),t=this.curve._mulC(u).redMul(i.redISub(o)),r=u.redMul(f)}return this.curve.point(e,t,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),f=r.redAdd(t),u=o.redMul(a),c=s.redMul(f),h=o.redMul(f),l=a.redMul(s);return this.curve.point(u,c,l,h)},u.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),f=i.redSub(s),u=i.redAdd(s),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),h=n.redMul(f).redMul(c);return this.curve.twisted?(t=n.redMul(u).redMul(a.redSub(this.curve._mulA(o))),r=f.redMul(u)):(t=n.redMul(u).redMul(a.redSub(o)),r=this.curve._mulC(f).redMul(u)),this.curve.point(h,t,r)},u.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},u.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},u.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},u.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},function(e,t,r){"use strict";t.sha1=r(148),t.sha224=r(149),t.sha256=r(66),t.sha384=r(150),t.sha512=r(67)},function(e,t,r){"use strict";var n=r(8),i=r(17),o=r(65),a=n.rotl32,s=n.sum32,f=n.sum32_5,u=o.ft_1,c=i.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(l,c),e.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t0))return a.iaddn(1),this.keyFromPrivate(a)}},h.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},h.prototype.sign=function(e,t,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var a=this.n.byteLength(),s=t.getPrivate().toArray("be",a),f=e.toArray("be",a),u=new i({hash:this.hash,entropy:s,nonce:f,pers:o.pers,persEnc:o.persEnc||"utf8"}),h=this.n.sub(new n(1)),l=0;;l++){var d=o.k?o.k(l):new n(u.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(h)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var b=p.getX(),y=b.umod(this.n);if(0!==y.cmpn(0)){var v=d.invm(this.n).mul(y.mul(t.getPrivate()).iadd(e));if(0!==(v=v.umod(this.n)).cmpn(0)){var g=(p.getY().isOdd()?1:0)|(0!==b.cmp(y)?2:0);return o.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),g^=1),new c({r:y,s:v,recoveryParam:g})}}}}}},h.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new c(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,f=a.invm(this.n),u=f.mul(e).umod(this.n),h=f.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(u,r.getPublic(),h)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(u,r.getPublic(),h)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},h.prototype.recoverPubKey=function(e,t,r,i){f((3&r)===r,"The recovery param is more than two bits"),t=new c(t,i);var o=this.n,a=new n(e),s=t.r,u=t.s,h=1&r,l=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");s=l?this.curve.pointFromX(s.add(this.curve.n),h):this.curve.pointFromX(s,h);var d=t.r.invm(o),p=o.sub(a).mul(d).umod(o),b=u.mul(d).umod(o);return this.g.mulAdd(p,s,b)},h.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new c(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";var n=r(38),i=r(62),o=r(11);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=a,a.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);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(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length"}},function(e,t,r){"use strict";var n=r(3),i=r(5),o=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function f(e,t){var r=e[t.place++];if(!(128&r))return r;for(var n=15&r,i=0,o=0,a=t.place;o>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new s;if(48!==e[r.place++])return!1;if(f(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=f(e,r),a=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var u=f(e,r);if(e.length!==u+r.place)return!1;var c=e.slice(r.place,u+r.place);return 0===a[0]&&128&a[1]&&(a=a.slice(1)),0===c[0]&&128&c[1]&&(c=c.slice(1)),this.r=new n(a),this.s=new n(c),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=u(t),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];c(n,t.length),(n=n.concat(t)).push(2),c(n,r.length);var o=n.concat(r),a=[48];return c(a,o.length),a=a.concat(o),i.encode(a,e)}},function(e,t,r){"use strict";var n=r(38),i=r(37),o=r(5),a=o.assert,s=o.parseBytes,f=r(159),u=r(160);function c(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof c))return new c(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=c,c.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),f=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:f,Rencoded:o})},c.prototype.verify=function(e,t,r){e=s(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},c.prototype.hashInt=function(){for(var e=this.hash(),t=0;t0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,i),!t.provider)throw new Error("PollingBlockTracker - no provider specified.");var n=t.pollingInterval||2e4,o=t.retryTimeout||n/10,s=void 0===t.keepEventLoopActive||t.keepEventLoopActive,f=t.setSkipCacheFlag||!1;return(e=r.call(this,Object.assign({blockResetDuration:n},t)))._provider=t.provider,e._pollingInterval=n,e._retryTimeout=o,e._keepEventLoopActive=s,e._setSkipCacheFlag=f,e}return s(i,[{key:"checkForLatestBlock",value:function(){var e=h(c.mark((function e(){return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._updateLatestBlock();case 2:return e.next=4,this.getLatestBlock();case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_start",value:function(){var e=this;this._performSync().catch((function(t){return e.emit("error",t)}))}},{key:"_performSync",value:function(){var t=h(c.mark((function t(){var r;return c.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._isRunning){t.next=16;break}return t.prev=1,t.next=4,this._updateLatestBlock();case 4:return t.next=6,o(this._pollingInterval,!this._keepEventLoopActive);case 6:t.next=14;break;case 8:t.prev=8,t.t0=t.catch(1),r=new Error("PollingBlockTracker - encountered an error while attempting to update latest block:\n".concat(t.t0.stack));try{this.emit("error",r)}catch(e){console.error(r)}return t.next=14,o(this._retryTimeout,!this._keepEventLoopActive);case 14:t.next=0;break;case 16:case"end":return t.stop()}}),t,this,[[1,8]])})));return function(){return t.apply(this,arguments)}}()},{key:"_updateLatestBlock",value:function(){var e=h(c.mark((function e(){var t;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._fetchLatestBlock();case 2:t=e.sent,this._newPotentialLatest(t);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_fetchLatestBlock",value:function(){var e=h(c.mark((function e(){var t,r,i=this;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={jsonrpc:"2.0",id:1,method:"eth_blockNumber",params:[]},this._setSkipCacheFlag&&(t.skipCache=!0),e.next=4,n((function(e){return i._provider.sendAsync(t,e)}))();case 4:if(!(r=e.sent).error){e.next=7;break}throw new Error("PollingBlockTracker - encountered error fetching block:\n".concat(r.error));case 7:return e.abrupt("return",r.result);case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),i}(i)},function(e,t,r){r(72),r(39);var l=r(40),d=function(e,t){return e+t},p=["sync","latest"];function b(e){return Number.parseInt(e,16)}e.exports=function(e){"use strict";f(r,e);var t=u(r);function r(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,r),(e=t.call(this))._blockResetDuration=i.blockResetDuration||2e4,e._blockResetTimeout,e._currentBlock=null,e._isRunning=!1,e._onNewListener=e._onNewListener.bind(n(e)),e._onRemoveListener=e._onRemoveListener.bind(n(e)),e._resetCurrentBlock=e._resetCurrentBlock.bind(n(e)),e._setupInternalEvents(),e}return s(r,[{key:"isRunning",value:function(){return this._isRunning}},{key:"getCurrentBlock",value:function(){return this._currentBlock}},{key:"getLatestBlock",value:function(){var e=h(c.mark((function e(){var t=this;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._currentBlock){e.next=2;break}return e.abrupt("return",this._currentBlock);case 2:return e.next=4,new Promise((function(e){return t.once("latest",e)}));case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"removeAllListeners",value:function(e){e?i(o(r.prototype),"removeAllListeners",this).call(this,e):i(o(r.prototype),"removeAllListeners",this).call(this),this._setupInternalEvents(),this._onRemoveListener()}},{key:"_start",value:function(){}},{key:"_end",value:function(){}},{key:"_setupInternalEvents",value:function(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}},{key:"_onNewListener",value:function(e,t){p.includes(e)&&this._maybeStart()}},{key:"_onRemoveListener",value:function(e,t){this._getBlockTrackerEventCount()>0||this._maybeEnd()}},{key:"_maybeStart",value:function(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),this._start())}},{key:"_maybeEnd",value:function(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),this._end())}},{key:"_getBlockTrackerEventCount",value:function(){var e=this;return p.map((function(t){return e.listenerCount(t)})).reduce(d)}},{key:"_newPotentialLatest",value:function(e){var t=this._currentBlock;t&&b(e)<=b(t)||this._setCurrentBlock(e)}},{key:"_setCurrentBlock",value:function(e){var t=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:t,newBlock:e})}},{key:"_setupBlockResetTimeout",value:function(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}},{key:"_cancelBlockResetTimeout",value:function(){clearTimeout(this._blockResetTimeout)}},{key:"_resetCurrentBlock",value:function(){this._currentBlock=null}}]),r}(l)},function(e,t){e.exports=function(e){var t=(e=e||{}).max||Number.MAX_SAFE_INTEGER,r=void 0!==e.start?e.start:Math.floor(Math.random()*t);return function(){return r%=t,r++}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(t,r,o){return e(n.default,t,(0,i.default)(r),o)}};var n=o(r(74)),i=o(r(12));function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},function(e,t,r){var n=r(41),i=r(78);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,r){var n=r(75),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[s]=r:delete e[s]),i}},function(e,t){var r=Object.prototype.toString;e.exports=function(e){return r.call(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,o){(0,n.default)(t)(e,(0,i.default)(r),o)};var n=o(r(81)),i=o(r(12));function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if((0,n.default)(e))return function(e){var t=-1,r=e.length;return function(){return++t-1&&e%1==0&&e="0"&&n<="9";)t+=n,f();if("."===n)for(t+=".";f()&&n>="0"&&n<="9";)t+=n;if("e"===n||"E"===n)for(t+=n,f(),"-"!==n&&"+"!==n||(t+=n,f());n>="0"&&n<="9";)t+=n,f();if(e=+t,isFinite(e))return e;s("Bad number")},c=function(){var e,t,r,i="";if('"'===n)for(;f();){if('"'===n)return f(),i;if("\\"===n)if(f(),"u"===n){for(r=0,t=0;t<4&&(e=parseInt(f(),16),isFinite(e));t+=1)r=16*r+e;i+=String.fromCharCode(r)}else{if("string"!=typeof a[n])break;i+=a[n]}else i+=n}s("Bad string")},h=function(){for(;n&&n<=" ";)f()};o=function(){switch(h(),n){case"{":return function(){var e,t={};if("{"===n){if(f("{"),h(),"}"===n)return f("}"),t;for(;n;){if(e=c(),h(),f(":"),Object.hasOwnProperty.call(t,e)&&s('Duplicate key "'+e+'"'),t[e]=o(),h(),"}"===n)return f("}"),t;f(","),h()}}s("Bad object")}();case"[":return function(){var e=[];if("["===n){if(f("["),h(),"]"===n)return f("]"),e;for(;n;){if(e.push(o()),h(),"]"===n)return f("]"),e;f(","),h()}}s("Bad array")}();case'"':return c();case"-":return u();default:return n>="0"&&n<="9"?u():function(){switch(n){case"t":return f("t"),f("r"),f("u"),f("e"),!0;case"f":return f("f"),f("a"),f("l"),f("s"),f("e"),!1;case"n":return f("n"),f("u"),f("l"),f("l"),null}s("Unexpected '"+n+"'")}()}},e.exports=function(e,t){var a;return i=e,r=0,n=" ",a=o(),h(),n&&s("Syntax error"),"function"==typeof t?function e(r,n){var i,o,a=r[n];if(a&&"object"==typeof a)for(i in a)Object.prototype.hasOwnProperty.call(a,i)&&(void 0!==(o=e(a,i))?a[i]=o:delete a[i]);return t.call(r,n,a)}({"":a},""):a}},function(e,t){var r,n,i,o=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function s(e){return o.lastIndex=0,o.test(e)?'"'+e.replace(o,(function(e){var t=a[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}e.exports=function(e,t,o){var a;if(r="",n="","number"==typeof o)for(a=0;a"];e.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.blockTracker;if(!t)throw new Error("createBlockCacheMiddleware - No BlockTracker specified");var r=new f,o={perma:r,block:r,fork:r};return i(function(){var e=h(c.mark((function e(i,a,s){var f,u,h,l,d,p;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!i.skipCache){e.next=2;break}return e.abrupt("return",s());case 2:if(f=n.cacheTypeForPayload(i),u=o[f]){e.next=5;break}return e.abrupt("return",s());case 5:if(u.canCacheRequest(i)){e.next=7;break}return e.abrupt("return",s());case 7:if((l=n.blockTagForPayload(i))||(l="latest"),"earliest"!==l){e.next=12;break}h="0x00",e.next=20;break;case 12:if("latest"!==l){e.next=19;break}return e.next=15,t.getLatestBlock();case 15:d=e.sent,r.clearBefore(d),h=d,e.next=20;break;case 19:h=l;case 20:return e.next=22,u.get(i,h);case 22:if(void 0!==(p=e.sent)){e.next=30;break}return e.next=26,s();case 26:return e.next=28,u.set(i,h,a.result);case 28:e.next=31;break;case 30:a.result=p;case 31:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}())};var f=function(){"use strict";function e(){a(this,e),this.cache={}}return s(e,[{key:"getBlockCacheForPayload",value:function(e,t){var r=Number.parseInt(t,16),n=this.cache[r];if(!n){var i={};this.cache[r]=i,n=i}return n}},{key:"get",value:function(){var e=h(c.mark((function e(t,r){var i;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(i=this.getBlockCacheForPayload(t,r))){e.next=3;break}return e.abrupt("return",i[n.cacheIdentifierForPayload(t,!0)]);case 3:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"set",value:function(){var e=h(c.mark((function e(t,r,i){return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.canCacheResult(t,i)&&(this.getBlockCacheForPayload(t,r)[n.cacheIdentifierForPayload(t,!0)]=i);case 1:case"end":return e.stop()}}),e,this)})));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"canCacheRequest",value:function(e){return!!n.canCache(e)&&"pending"!==n.blockTagForPayload(e)}},{key:"canCacheResult",value:function(e,t){if(!o.includes(t))return!!(!["eth_getTransactionByHash","eth_getTransactionReceipt"].includes(e.method)||t&&t.blockHash&&"0x0000000000000000000000000000000000000000000000000000000000000000"!==t.blockHash)}},{key:"clearBefore",value:function(e){var t=this,r=Number.parseInt(e,16);Object.keys(t.cache).map(Number).filter((function(e){return e=e.params.length?e.params:"eth_getBlockByNumber"===e.method?e.params.slice(1):e.params.slice(0,t)}function a(e){switch(e.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":return 1;case"eth_getBlockByNumber":return 0;default:return}}function s(e){switch(e.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":case"test_permaCache":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":case"test_forkCache":return"fork";case"eth_gasPrice":case"eth_blockNumber":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"test_blockCache":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":case"test_neverCache":return"never"}}e.exports={cacheIdentifierForPayload:function(e,t){var r=t?o(e):e.params;return i(e)?e.method+":"+n(r):null},canCache:i,blockTagForPayload:function(e){var t=a(e);return t>=e.params.length?null:e.params[t]},paramsWithoutBlockTag:o,blockTagParamIndex:a,cacheTypeForPayload:s}},function(e,t,r){"use strict";var n=r(204),i=r(205);e.exports=function(e){if(!n(e.then))throw new TypeError("Expected a promise");return function(t){e.then((function(e){i(t,null,e)}),(function(e){i(t,e)}))}}},function(e,t,r){"use strict";var n=Object.prototype.toString;e.exports=function(e){return"[object Function]"===n.call(e)}},function(e,t,r){"use strict";(function(t){e.exports="function"==typeof t?t:function(){var e=[].slice.apply(arguments);e.splice(1,0,0),setTimeout.apply(null,e)}}).call(this,r(26).setImmediate)},function(e,t,r){"use strict";(function(e,r){var n=function(){function t(e){a(this,t),this.tasks=[],this.count=e}return s(t,[{key:"sched",value:function(){if(this.count>0&&this.tasks.length>0){this.count--;var e=this.tasks.shift();if(void 0===e)throw"Unexpected undefined value in tasks list";e()}}},{key:"acquire",value:function(){var t=this;return new Promise((function(n,i){t.tasks.push((function(){var e=!1;n((function(){e||(e=!0,t.count++,t.sched())}))})),e&&e.nextTick?e.nextTick(t.sched.bind(t)):r(t.sched.bind(t))}))}},{key:"use",value:function(e){return this.acquire().then((function(t){return e().then((function(e){return t(),e})).catch((function(e){throw t(),e}))}))}}]),t}();t.Semaphore=n,t.Mutex=function(e){f(r,e);var t=u(r);function r(){return a(this,r),t.call(this,1)}return r}(n)}).call(this,r(9),r(26).setImmediate)},function(e,t){e.exports=function(e){return function(t,r,n,i){var o=e[t.method];return void 0===o?n():"function"==typeof o?o(t,r,n,i):(r.result=o,void i())}}},function(e,t,r){var n=r(72),i=r(39),o=r(209),l=r(20),d=(l.bnToHex,l.hexToInt),p=l.incrementHexInt,b=l.minBlockRef,y=l.blockRefIsNumber;e.exports=function(e){"use strict";f(r,e);var t=u(r);function r(e){var i,o=e.provider,s=e.params;return a(this,r),(i=t.call(this)).type="log",i.ethQuery=new n(o),i.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},s),i.params.address&&(Array.isArray(i.params.address)||(i.params.address=[i.params.address]),i.params.address=i.params.address.map((function(e){return e.toLowerCase()}))),i}return s(r,[{key:"initialize",value:function(){var e=h(c.mark((function e(t){var r,n,i,o,a;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.currentBlock,n=this.params.fromBlock,["latest","pending"].includes(n)&&(n=r),"earliest"===n&&(n="0x0"),this.params.fromBlock=n,i=b(this.params.toBlock,r),o=Object.assign({},this.params,{toBlock:i}),e.next=7,this._fetchLogs(o);case 7:a=e.sent,this.addInitialResults(a);case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"update",value:function(){var e=h(c.mark((function e(t){var r,n,i,o,a,s,f=this;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.oldBlock,n=t.newBlock,i=n,o=r?p(r):n,a=Object.assign({},this.params,{fromBlock:o,toBlock:i}),e.next=6,this._fetchLogs(a);case 6:s=e.sent.filter((function(e){return f.matchLog(e)})),this.addResults(s);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_fetchLogs",value:function(){var e=h(c.mark((function e(t){var r=this;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i((function(e){return r.ethQuery.getLogs(t,e)}))();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"matchLog",value:function(e){if(d(this.params.fromBlock)>=d(e.blockNumber))return!1;if(y(this.params.toBlock)&&d(this.params.toBlock)<=d(e.blockNumber))return!1;var t=e.address&&e.address.toLowerCase();return!(this.params.address&&t&&!this.params.address.includes(t))&&this.params.topics.every((function(t,r){var n=e.topics[r];if(!n)return!1;n=n.toLowerCase();var i=Array.isArray(t)?t:[t];return!!i.includes(null)||(i=i.map((function(e){return e.toLowerCase()}))).includes(n)}))}}]),r}(o)},function(e,t,r){var n=r(47);e.exports=function(e){"use strict";f(r,e);var t=u(r);function r(){var e;return a(this,r),(e=t.call(this)).allResults=[],e}return s(r,[{key:"update",value:function(){var e=h(c.mark((function e(){return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("BaseFilterWithHistory - no update method specified");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"addResults",value:function(e){this.allResults=this.allResults.concat(e),i(o(r.prototype),"addResults",this).call(this,e)}},{key:"addInitialResults",value:function(e){this.allResults=this.allResults.concat(e),i(o(r.prototype),"addInitialResults",this).call(this,e)}},{key:"getAllResults",value:function(){return this.allResults}}]),r}(n)},function(e,t,r){var n=r(47),i=r(48),o=r(20).incrementHexInt;e.exports=function(e){"use strict";f(r,e);var t=u(r);function r(e){var n,i=e.provider;return e.params,a(this,r),(n=t.call(this)).type="block",n.provider=i,n}return s(r,[{key:"update",value:function(){var e=h(c.mark((function e(t){var r,n,a,s,f;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.oldBlock,n=t.newBlock,a=n,s=o(r),e.next=5,i({provider:this.provider,fromBlock:s,toBlock:a});case 5:f=e.sent.map((function(e){return e.hash})),this.addResults(f);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),r}(n)},function(e,t,r){var n=r(212),i=r(47),o=r(48),l=r(20).incrementHexInt;e.exports=function(e){"use strict";f(r,e);var t=u(r);function r(e){var n,i=e.provider;return e.params,a(this,r),(n=t.call(this)).type="tx",n.provider=i,n}return s(r,[{key:"update",value:function(){var e=h(c.mark((function e(t){var r,i,a,s,f;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.oldBlock,t.newBlock,i=r,a=l(r),e.next=5,o({provider:this.provider,fromBlock:a,toBlock:i});case 5:s=e.sent,f=n(s,(function(e){return e.transactions})),this.addResults(f);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),r}(i)},function(e,t,r){(function(e,r){var n="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",a="[object Array]",s="[object Boolean]",f="[object Date]",u="[object Error]",c="[object Function]",h="[object Map]",l="[object Number]",d="[object Object]",p="[object RegExp]",b="[object Set]",y="[object String]",v="[object Symbol]",g="[object ArrayBuffer]",m="[object DataView]",_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,w=/^\w*$/,E=/^\./,k=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,A=/\\(\\)?/g,S=/^\[object .+?Constructor\]$/,x=/^(?:0|[1-9]\d*)$/,I={};I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I[o]=I[a]=I[g]=I[s]=I[m]=I[f]=I[u]=I[c]=I[h]=I[l]=I[d]=I[p]=I[b]=I[y]=I["[object WeakMap]"]=!1;var M="object"==typeof e&&e&&e.Object===Object&&e,T="object"==typeof self&&self&&self.Object===Object&&self,P=M||T||Function("return this")(),B=t&&!t.nodeType&&t,L=B&&"object"==typeof r&&r&&!r.nodeType&&r,R=L&&L.exports===B&&M.process,O=function(){try{return R&&R.binding("util")}catch(e){}}(),C=O&&O.isTypedArray;function N(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r-1},we.prototype.set=function(e,t){var r=this.__data__,n=Se(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},Ee.prototype.clear=function(){this.__data__={hash:new _e,map:new(se||we),string:new _e}},Ee.prototype.delete=function(e){return Ce(this,e).delete(e)},Ee.prototype.get=function(e){return Ce(this,e).get(e)},Ee.prototype.has=function(e){return Ce(this,e).has(e)},Ee.prototype.set=function(e,t){return Ce(this,e).set(e,t),this},ke.prototype.add=ke.prototype.push=function(e){return this.__data__.set(e,n),this},ke.prototype.has=function(e){return this.__data__.has(e)},Ae.prototype.clear=function(){this.__data__=new we},Ae.prototype.delete=function(e){return this.__data__.delete(e)},Ae.prototype.get=function(e){return this.__data__.get(e)},Ae.prototype.has=function(e){return this.__data__.has(e)},Ae.prototype.set=function(e,t){var r=this.__data__;if(r instanceof we){var n=r.__data__;if(!se||n.length<199)return n.push([e,t]),this;r=this.__data__=new Ee(n)}return r.set(e,t),this};var xe,Ie=(xe=function(e,t){return e&&Me(e,t,nt)},function(e,t){if(null==e)return e;if(!Ze(e))return xe(e,t);for(var r=e.length,n=-1,i=Object(e);++ns))return!1;var u=o.get(e);if(u&&o.get(t))return u==t;var c=-1,h=!0,l=1&i?new ke:void 0;for(o.set(e,t),o.set(t,e);++c-1&&e%1==0&&e-1&&e%1==0&&e<=i}function Qe(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function et(e){return!!e&&"object"==typeof e}function tt(e){return"symbol"==typeof e||et(e)&&X.call(e)==v}var rt=C?function(e){return function(t){return e(t)}}(C):function(e){return et(e)&&Xe(e.length)&&!!I[X.call(e)]};function nt(e){return Ze(e)?function(e,t){var r=We(e)||$e(e)?function(e,t){for(var r=-1,n=Array(e);++r0&&n(f)?r>1?e(f,r-1,n,i,o):j(o,f):i||(o[o.length]=f)}return o}(function(e,t){return(We(e)?N:Le)(e,function(e){return"function"==typeof e?e:null==e?it:"object"==typeof e?We(e)?function(e,t){return Ue(e)&&Fe(t)?ze(He(e),t):function(r){var n=function(e,t,r){var n=null==e?void 0:Te(e,t);return void 0===n?void 0:n}(r,e);return void 0===n&&n===t?function(e,t){return null!=e&&function(e,t,r){for(var n,i=-1,o=(t=Ue(t,e)?[t]:Re(t)).length;++i2&&(n=(0,o.default)(arguments,1)),s[t]=n,r(e)}))}),(function(e){r(e,s)}))};var n=s(r(18)),i=s(r(30)),o=s(r(31)),a=s(r(12));function s(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},function(e,t,r){var n=r(15),i=r(217);function o(e){var t=new Error("Expect argument to be non-empty array");if("object"!=typeof e||!e.length)throw t;var r=e.map((function(e){return"bytes"===e.type?n.toBuffer(e.value):e.value})),o=e.map((function(e){return e.type})),a=e.map((function(e){if(!e.name)throw t;return e.type+" "+e.name}));return i.soliditySHA3(["bytes32","bytes32"],[i.soliditySHA3(new Array(e.length).fill("string"),a),i.soliditySHA3(o,r)])}function a(e,t){var r=n.toBuffer(t),i=n.fromRpcSig(r);return n.ecrecover(e,i.v,i.r,i.s)}function s(e){var t=n.toBuffer(e.data);return a(n.hashPersonalMessage(t),e.sig)}function f(e,t){for(var r=""+e;r.lengtho)throw new Error("Elements exceed array size: "+o);for(d in h=[],e=e.slice(0,e.lastIndexOf("[")),"string"==typeof r&&(r=JSON.parse(r)),r)h.push(l(e,r[d]));if("dynamic"===o){var p=l("uint256",r.length);h.unshift(p)}return t.concat(h)}if("bytes"===e)return r=t.from(r),h=t.concat([l("uint256",r.length),r]),r.length%32!=0&&(h=t.concat([h,n.zeros(32-r.length%32)])),h;if(e.startsWith("bytes")){if((o=s(e))<1||o>32)throw new Error("Invalid bytes width: "+o);return n.setLengthRight(r,32)}if(e.startsWith("uint")){if((o=s(e))%8||o<8||o>256)throw new Error("Invalid uint width: "+o);if((a=c(r)).bitLength()>o)throw new Error("Supplied uint exceeds width: "+o+" vs "+a.bitLength());if(a<0)throw new Error("Supplied uint is negative");return a.toArrayLike(t,"be",32)}if(e.startsWith("int")){if((o=s(e))%8||o<8||o>256)throw new Error("Invalid int width: "+o);if((a=c(r)).bitLength()>o)throw new Error("Supplied int exceeds width: "+o+" vs "+a.bitLength());return a.toTwos(256).toArrayLike(t,"be",32)}if(e.startsWith("ufixed")){if(o=f(e),(a=c(r))<0)throw new Error("Supplied ufixed is negative");return l("uint256",a.mul(new i(2).pow(new i(o[1]))))}if(e.startsWith("fixed"))return o=f(e),l("int256",c(r).mul(new i(2).pow(new i(o[1]))));throw new Error("Unsupported or invalid type: "+e)}function d(e,r,n){var o,a,s,f;if("string"==typeof e&&(e=p(e)),"address"===e.name)return d(e.rawType,r,n).toArrayLike(t,"be",20).toString("hex");if("bool"===e.name)return d(e.rawType,r,n).toString()===new i(1).toString();if("string"===e.name){var u=d(e.rawType,r,n);return t.from(u,"utf8").toString()}if(e.isArray){for(s=[],o=e.size,"dynamic"===e.size&&(n=d("uint256",r,n).toNumber(),o=d("uint256",r,n).toNumber(),n+=32),f=0;fe.size)throw new Error("Decoded int exceeds width: "+e.size+" vs "+a.bitLength());return a}if(e.name.startsWith("int")){if((a=new i(r.slice(n,n+32),16,"be").fromTwos(256)).bitLength()>e.size)throw new Error("Decoded uint exceeds width: "+e.size+" vs "+a.bitLength());return a}if(e.name.startsWith("ufixed")){if(o=new i(2).pow(new i(e.size[1])),!(a=d("uint256",r,n)).mod(o).isZero())throw new Error("Decimals not supported yet");return a.div(o)}if(e.name.startsWith("fixed")){if(o=new i(2).pow(new i(e.size[1])),!(a=d("int256",r,n)).mod(o).isZero())throw new Error("Decimals not supported yet");return a.div(o)}throw new Error("Unsupported or invalid type: "+e.name)}function p(e){var t,r,n;if(y(e)){t=u(e);var i=e.slice(0,e.lastIndexOf("["));return i=p(i),{isArray:!0,name:e,size:t,memoryUsage:"dynamic"===t?32:i.memoryUsage*t,subArray:i}}switch(e){case"address":n="uint160";break;case"bool":n="uint8";break;case"string":n="bytes"}if(r={rawType:n,name:e,memoryUsage:32},e.startsWith("bytes")&&"bytes"!==e||e.startsWith("uint")||e.startsWith("int")?r.size=s(e):(e.startsWith("ufixed")||e.startsWith("fixed"))&&(r.size=f(e)),e.startsWith("bytes")&&"bytes"!==e&&(r.size<1||r.size>32))throw new Error("Invalid bytes width: "+r.size);if((e.startsWith("uint")||e.startsWith("int"))&&(r.size%8||r.size<8||r.size>256))throw new Error("Invalid int/uint width: "+r.size);return r}function b(e){return"string"===e||"bytes"===e||"dynamic"===u(e)}function y(e){return e.lastIndexOf("]")===e.length-1}function v(e,t){return e.startsWith("address")||e.startsWith("bytes")?"0x"+t.toString("hex"):t.toString()}o.eventID=function(e,r){var i=e+"("+r.map(a).join(",")+")";return n.keccak256(t.from(i))},o.methodID=function(e,t){return o.eventID(e,t).slice(0,4)},o.rawEncode=function(e,r){var n=[],i=[],o=0;e.forEach((function(e){if(y(e)){var t=u(e);o+="dynamic"!==t?32*t:32}else o+=32}));for(var s=0;sl)throw new Error("Elements exceed array size: "+l)}var d=r.map((function(e){return o.solidityHexValue(h,e,256)}));return t.concat(d)}if("bytes"===e)return r;if("string"===e)return t.from(r,"utf8");if("bool"===e){i=i||8;var p=Array(i/4).join("0");return t.from(r?p+"1":p+"0","hex")}if("address"===e){var b=20;return i&&(b=i/8),n.setLengthLeft(r,b)}if(e.startsWith("bytes")){if((a=s(e))<1||a>32)throw new Error("Invalid bytes width: "+a);return n.setLengthRight(r,a)}if(e.startsWith("uint")){if((a=s(e))%8||a<8||a>256)throw new Error("Invalid uint width: "+a);if((f=c(r)).bitLength()>a)throw new Error("Supplied uint exceeds width: "+a+" vs "+f.bitLength());return i=i||a,f.toArrayLike(t,"be",i/8)}if(e.startsWith("int")){if((a=s(e))%8||a<8||a>256)throw new Error("Invalid int width: "+a);if((f=c(r)).bitLength()>a)throw new Error("Supplied int exceeds width: "+a+" vs "+f.bitLength());return i=i||a,f.toTwos(a).toArrayLike(t,"be",i/8)}throw new Error("Unsupported or invalid type: "+e)},o.solidityPack=function(e,r){if(e.length!==r.length)throw new Error("Number of types are not matching the values");for(var n=[],i=0;i="0"&&t<="9";)o+=e[a]-"0",a++;n=a-1,r.push(o)}else if("i"===i)r.push("int256");else{if("a"!==i)throw new Error("Unsupported or invalid type: "+i);r.push("int256[]")}}return r},o.toSerpent=function(e){for(var t=[],r=0;r0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e},t.stripZeros=t.unpad,t.toBuffer=function(e){if(!u.isBuffer(e))if(Array.isArray(e))e=u.from(e);else if("string"==typeof e)e=t.isHexString(e)?u.from(t.padToEven(t.stripHexPrefix(e)),"hex"):u.from(e);else if("number"==typeof e)e=t.intToBuffer(e);else if(null==e)e=u.allocUnsafe(0);else if(n.isBN(e))e=e.toArrayLike(u);else{if(!e.toArray)throw new Error("invalid type");e=u.from(e.toArray())}return e},t.bufferToInt=function(e){return new n(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new n(e).fromTwos(256)},t.toUnsigned=function(e){return u.from(e.toTwos(256).toArray())},t.keccak=function(e,r){return void 0===r&&(r=256),e=t.toBuffer(e),r||(r=256),o("keccak"+r).update(e).digest()},t.keccak256=function(e){return t.keccak(e)},t.sha256=function(e){return e=t.toBuffer(e),f("sha256").update(e).digest()},t.ripemd160=function(e,r){e=t.toBuffer(e);var n=f("rmd160").update(e).digest();return!0===r?t.setLength(n,32):n},t.rlphash=function(e){return t.keccak(i.encode(e))},t.isValidPrivate=function(e){return a.privateKeyVerify(e)},t.isValidPublic=function(e,t){return void 0===t&&(t=!1),64===e.length?a.publicKeyVerify(u.concat([u.from([4]),e])):!!t&&a.publicKeyVerify(e)},t.pubToAddress=function(e,r){return void 0===r&&(r=!1),e=t.toBuffer(e),r&&64!==e.length&&(e=a.publicKeyConvert(e,!1).slice(1)),s(64===e.length),t.keccak(e).slice(-20)},t.publicToAddress=t.pubToAddress,t.privateToPublic=function(e){return e=t.toBuffer(e),a.publicKeyCreate(e,!1).slice(1)},t.importPublic=function(e){return 64!==(e=t.toBuffer(e)).length&&(e=a.publicKeyConvert(e,!1).slice(1)),e},t.ecsign=function(e,t,r){var n=a.sign(e,t),i=n.recovery;return{r:n.signature.slice(0,32),s:n.signature.slice(32,64),v:r?i+(2*r+35):i+27}},t.hashPersonalMessage=function(e){var r=t.toBuffer("\x19Ethereum Signed Message:\n"+e.length.toString());return t.keccak(u.concat([r,e]))},t.ecrecover=function(e,r,n,i,o){var s=u.concat([t.setLength(n,32),t.setLength(i,32)],64),f=h(r,o);if(!l(f))throw new Error("Invalid signature v value");var c=a.recover(e,s,f);return a.publicKeyConvert(c,!1).slice(1)},t.toRpcSig=function(e,r,n,i){if(!l(h(e,i)))throw new Error("Invalid signature v value");return t.bufferToHex(u.concat([t.setLengthLeft(r,32),t.setLengthLeft(n,32),t.toBuffer(e)]))},t.fromRpcSig=function(e){var r=t.toBuffer(e);if(65!==r.length)throw new Error("Invalid signature length");var n=r[64];return n<27&&(n+=27),{v:n,r:r.slice(0,32),s:r.slice(32,64)}},t.privateToAddress=function(e){return t.publicToAddress(t.privateToPublic(e))},t.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)},t.isZeroAddress=function(e){return t.zeroAddress()===t.addHexPrefix(e)},t.toChecksumAddress=function(e){e=c.stripHexPrefix(e).toLowerCase();for(var r=t.keccak(e).toString("hex"),n="0x",i=0;i=8?n+=e[i].toUpperCase():n+=e[i];return n},t.isValidChecksumAddress=function(e){return t.isValidAddress(e)&&t.toChecksumAddress(e)===e},t.generateAddress=function(e,r){e=t.toBuffer(e);var i=new n(r);return i.isZero()?t.rlphash([e,null]).slice(-20):t.rlphash([e,u.from(i.toArray())]).slice(-20)},t.generateAddress2=function(e,r,n){var i=t.toBuffer(e),o=t.toBuffer(r),a=t.toBuffer(n);return s(20===i.length),s(32===o.length),t.keccak256(u.concat([u.from("ff","hex"),i,o,t.keccak256(a)])).slice(-20)},t.isPrecompiled=function(e){var r=t.unpad(e);return 1===r.length&&r[0]>=1&&r[0]<=8},t.addHexPrefix=function(e){return"string"!=typeof e||c.isHexPrefixed(e)?e:"0x"+e},t.isValidSignature=function(e,t,r,i,o){void 0===i&&(i=!0);var a=new n("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),s=new n("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==r.length)return!1;if(!l(h(e,o)))return!1;var f=new n(t),u=new n(r);return!(f.isZero()||f.gt(s)||u.isZero()||u.gt(s))&&(!i||1!==u.cmp(a))},t.baToJSON=function(e){if(u.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var r=[],n=0;n=i.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===i.length||!r.length||s(r.length===i.length,"The field "+r.name+" must have byte length of "+r.length),e.raw[n]=i}e._fields.push(r.name),Object.defineProperty(e,r.name,{enumerable:!0,configurable:!0,get:i,set:o}),r.default&&(e[r.name]=r.default),r.alias&&Object.defineProperty(e,r.alias,{enumerable:!1,configurable:!0,set:o,get:i})})),n)if("string"==typeof n&&(n=u.from(c.stripHexPrefix(n),"hex")),u.isBuffer(n)&&(n=i.decode(n)),Array.isArray(n)){if(n.length>e._fields.length)throw new Error("wrong number of fields in data");n.forEach((function(r,n){e[e._fields[n]]=t.toBuffer(r)}))}else{if("object"!=typeof n)throw new Error("invalid data");var o=Object.keys(n);r.forEach((function(t){-1!==o.indexOf(t.name)&&(e[t.name]=n[t.name]),-1!==o.indexOf(t.alias)&&(e[t.alias]=n[t.alias])}))}}},function(e,t,r){(function(t){!function(r){"use strict";var n=function(e){setTimeout(e,0)};void 0!==t&&t&&"function"==typeof t.nextTick&&(n=t.nextTick),e.exports=function(e){var t={capacity:e||1,current:0,queue:[],firstHere:!1,take:function(){if(!1===t.firstHere){t.current++,t.firstHere=!0;var e=1}else e=0;var r={n:1};"function"==typeof arguments[0]?r.task=arguments[0]:r.n=arguments[0],arguments.length>=2&&("function"==typeof arguments[1]?r.task=arguments[1]:r.n=arguments[1]);var n=r.task;if(r.task=function(){n(t.leave)},t.current+r.n-e>t.capacity)return 1===e&&(t.current--,t.firstHere=!1),t.queue.push(r);t.current+=r.n-e,r.task(t.leave),1===e&&(t.firstHere=!1)},leave:function(e){if(e=e||1,t.current-=e,t.queue.length){var r=t.queue[0];r.n+t.current>t.capacity||(t.queue.shift(),t.current+=r.n,n(r.task))}else if(t.current<0)throw new Error("leave called too many times.")},available:function(e){return e=e||1,t.current+e<=t.capacity}};return t}}()}).call(this,r(9))},function(e,t,r){"use strict";var n=r(19);e.exports=function(e,t,r){e.sendAsync(n({method:"eth_estimateGas",params:[t]}),(function(e,t){if(e)return"no contract code at given address"===e.message?r(null,"0xcf08"):r(e);r(null,t.result)}))}},function(e,t,r){"use strict";(function(t){var n=r(15),i=r(223),o=n.BN,a=new o("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),s=function(){function e(r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r=r||{};var i=[{name:"nonce",length:32,allowLess:!0,default:new t([])},{name:"gasPrice",length:32,allowLess:!0,default:new t([])},{name:"gasLimit",alias:"gas",length:32,allowLess:!0,default:new t([])},{name:"to",allowZero:!0,length:20,default:new t([])},{name:"value",length:32,allowLess:!0,default:new t([])},{name:"data",alias:"input",allowZero:!0,default:new t([])},{name:"v",allowZero:!0,default:new t([28])},{name:"r",length:32,allowZero:!0,allowLess:!0,default:new t([])},{name:"s",length:32,allowZero:!0,allowLess:!0,default:new t([])}];n.defineProperties(this,i,r),Object.defineProperty(this,"from",{enumerable:!0,configurable:!0,get:this.getSenderAddress.bind(this)});var o=n.bufferToInt(this.v),a=Math.floor((o-35)/2);a<0&&(a=0),this._chainId=a||r.chainId||0,this._homestead=!0}return e.prototype.toCreationAddress=function(){return""===this.to.toString("hex")},e.prototype.hash=function(e){void 0===e&&(e=!0);var t=void 0;if(e)t=this.raw;else if(this._chainId>0){var r=this.raw.slice();this.v=this._chainId,this.r=0,this.s=0,t=this.raw,this.raw=r}else t=this.raw.slice(0,6);return n.rlphash(t)},e.prototype.getChainId=function(){return this._chainId},e.prototype.getSenderAddress=function(){if(this._from)return this._from;var e=this.getSenderPublicKey();return this._from=n.publicToAddress(e),this._from},e.prototype.getSenderPublicKey=function(){if(!(this._senderPubKey&&this._senderPubKey.length||this.verifySignature()))throw new Error("Invalid Signature");return this._senderPubKey},e.prototype.verifySignature=function(){var e=this.hash(!1);if(this._homestead&&1===new o(this.s).cmp(a))return!1;try{var t=n.bufferToInt(this.v);this._chainId>0&&(t-=2*this._chainId+8),this._senderPubKey=n.ecrecover(e,t,this.r,this.s)}catch(e){return!1}return!!this._senderPubKey},e.prototype.sign=function(e){var t=this.hash(!1),r=n.ecsign(t,e);this._chainId>0&&(r.v+=2*this._chainId+8),Object.assign(this,r)},e.prototype.getDataFee=function(){for(var e=this.raw[5],t=new o(0),r=0;r0&&t.push(["gas limit is too low. Need at least "+this.getBaseFee()]),void 0===e||!1===e?0===t.length:t.join(" ")},e}();e.exports=s}).call(this,r(7).Buffer)},function(e){e.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(e,t,r){"use strict";var n=r(225),i=r(226),o=r(227),a=r(29);function s(e,t,r){var n=e;return i(t)?(r=t,"string"==typeof e&&(n={uri:e})):n=a(t,{uri:e}),n.callback=r,n}function f(e,t,r){return u(t=s(e,t,r))}function u(e){if(void 0===e.callback)throw new Error("callback argument missing");var t=!1,r=function(r,n,i){t||(t=!0,e.callback(r,n,i))};function n(){var e=void 0;if(e=c.response?c.response:c.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(c),v)try{e=JSON.parse(e)}catch(e){}return e}function i(e){return clearTimeout(h),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,r(e,g)}function a(){if(!u){var t;clearTimeout(h),t=e.useXDR&&void 0===c.status?200:1223===c.status?204:c.status;var i=g,a=null;return 0!==t?(i={body:n(),statusCode:t,method:d,headers:{},url:l,rawRequest:c},c.getAllResponseHeaders&&(i.headers=o(c.getAllResponseHeaders()))):a=new Error("Internal XMLHttpRequest Error"),r(a,i,i.body)}}var s,u,c=e.xhr||null;c||(c=e.cors||e.useXDR?new f.XDomainRequest:new f.XMLHttpRequest);var h,l=c.url=e.uri||e.url,d=c.method=e.method||"GET",p=e.body||e.data,b=c.headers=e.headers||{},y=!!e.sync,v=!1,g={body:void 0,headers:{},statusCode:0,method:d,url:l,rawRequest:c};if("json"in e&&!1!==e.json&&(v=!0,b.accept||b.Accept||(b.Accept="application/json"),"GET"!==d&&"HEAD"!==d&&(b["content-type"]||b["Content-Type"]||(b["Content-Type"]="application/json"),p=JSON.stringify(!0===e.json?p:e.json))),c.onreadystatechange=function(){4===c.readyState&&setTimeout(a,0)},c.onload=a,c.onerror=i,c.onprogress=function(){},c.onabort=function(){u=!0},c.ontimeout=i,c.open(d,l,!y,e.username,e.password),y||(c.withCredentials=!!e.withCredentials),!y&&e.timeout>0&&(h=setTimeout((function(){if(!u){u=!0,c.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",i(e)}}),e.timeout)),c.setRequestHeader)for(s in b)b.hasOwnProperty(s)&&c.setRequestHeader(s,b[s]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(c.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(c),c.send(p||null),c}e.exports=f,e.exports.default=f,f.XMLHttpRequest=n.XMLHttpRequest||function(){},f.XDomainRequest="withCredentials"in new f.XMLHttpRequest?f.XMLHttpRequest:n.XDomainRequest,function(e,t){for(var r=0;r0&&!i.call(e,0))for(var b=0;b0)for(var y=0;y>0},ToUint32:function(e){return this.ToNumber(e)>>>0},ToUint16:function(e){var t=this.ToNumber(e);if(b(t)||0===t||!y(t))return 0;var r=v(t)*Math.floor(Math.abs(t));return g(r,65536)},ToString:function(e){return s(e)},ToObject:function(e){return this.CheckObjectCoercible(e),i(e)},CheckObjectCoercible:function(e,t){if(null==e)throw new a(t||"Cannot call method on "+e);return e},IsCallable:w,SameValue:function(e,t){return e===t?0!==e||1/e==1/t:b(e)&&b(t)},Type:function(e){return null===e?"Null":void 0===e?"Undefined":"function"==typeof e||"object"==typeof e?"Object":"number"==typeof e?"Number":"boolean"==typeof e?"Boolean":"string"==typeof e?"String":void 0},IsPropertyDescriptor:function(e){return p(this,e)},IsAccessorDescriptor:function(e){return void 0!==e&&(d(this,"Property Descriptor","Desc",e),!(!k(e,"[[Get]]")&&!k(e,"[[Set]]")))},IsDataDescriptor:function(e){return void 0!==e&&(d(this,"Property Descriptor","Desc",e),!(!k(e,"[[Value]]")&&!k(e,"[[Writable]]")))},IsGenericDescriptor:function(e){return void 0!==e&&(d(this,"Property Descriptor","Desc",e),!this.IsAccessorDescriptor(e)&&!this.IsDataDescriptor(e))},FromPropertyDescriptor:function(e){if(void 0===e)return e;if(d(this,"Property Descriptor","Desc",e),this.IsDataDescriptor(e))return{value:e["[[Value]]"],writable:!!e["[[Writable]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]};if(this.IsAccessorDescriptor(e))return{get:e["[[Get]]"],set:e["[[Set]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]};throw new a("FromPropertyDescriptor must be called with a fully populated Property Descriptor")},ToPropertyDescriptor:function(e){if("Object"!==this.Type(e))throw new a("ToPropertyDescriptor requires an object");var t={};if(k(e,"enumerable")&&(t["[[Enumerable]]"]=this.ToBoolean(e.enumerable)),k(e,"configurable")&&(t["[[Configurable]]"]=this.ToBoolean(e.configurable)),k(e,"value")&&(t["[[Value]]"]=e.value),k(e,"writable")&&(t["[[Writable]]"]=this.ToBoolean(e.writable)),k(e,"get")){var r=e.get;if(void 0!==r&&!this.IsCallable(r))throw new TypeError("getter must be a function");t["[[Get]]"]=r}if(k(e,"set")){var n=e.set;if(void 0!==n&&!this.IsCallable(n))throw new a("setter must be a function");t["[[Set]]"]=n}if((k(t,"[[Get]]")||k(t,"[[Set]]"))&&(k(t,"[[Value]]")||k(t,"[[Writable]]")))throw new a("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t},"Abstract Equality Comparison":function(e,t){var r=this.Type(e),n=this.Type(t);return r===n?e===t:null==e&&null==t||("Number"===r&&"String"===n?this["Abstract Equality Comparison"](e,this.ToNumber(t)):"String"===r&&"Number"===n||"Boolean"===r?this["Abstract Equality Comparison"](this.ToNumber(e),t):"Boolean"===n?this["Abstract Equality Comparison"](e,this.ToNumber(t)):"String"!==r&&"Number"!==r||"Object"!==n?"Object"===r&&("String"===n||"Number"===n)&&this["Abstract Equality Comparison"](this.ToPrimitive(e),t):this["Abstract Equality Comparison"](e,this.ToPrimitive(t)))},"Strict Equality Comparison":function(e,t){var r=this.Type(e);return r===this.Type(t)&&("Undefined"===r||"Null"===r||e===t)},"Abstract Relational Comparison":function(e,t,r){if("Boolean"!==this.Type(r))throw new a("Assertion failed: LeftFirst argument must be a Boolean");var n,i;if(r?(n=this.ToPrimitive(e,u),i=this.ToPrimitive(t,u)):(i=this.ToPrimitive(t,u),n=this.ToPrimitive(e,u)),"String"!==this.Type(n)||"String"!==this.Type(i)){var o=this.ToNumber(n),s=this.ToNumber(i);if(b(o)||b(s))return;return(!y(o)||!y(s)||o!==s)&&(0!==o||0!==s)&&o!==1/0&&(s===1/0||s!==-1/0&&(o===-1/0||o864e13?NaN:u(new f(this.ToNumber(e)))},modulo:function(e,t){return g(e,t)}};e.exports=S},function(e,t,r){"use strict";(function(t){var n=t.Symbol,i=r(234);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}}).call(this,r(4))},function(e,t,r){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},function(e,t,r){"use strict";var n=r(22),i=n("%TypeError%"),o=n("%SyntaxError%"),a=r(49),s={"Property Descriptor":function(e,t){if("Object"!==e.Type(t))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in t)if(a(t,n)&&!r[n])return!1;var o=a(t,"[[Value]]"),s=a(t,"[[Get]]")||a(t,"[[Set]]");if(o&&s)throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}};e.exports=function(e,t,r,n){var a=s[t];if("function"!=typeof a)throw new o("unknown record type: "+t);if(!a(e,n))throw new i(r+" must be a "+t)}},function(e,t,r){"use strict";var n=r(22),i=r(49),o=n("%TypeError%");e.exports=function(e,t){if("Object"!==e.Type(t))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in t)if(i(t,n)&&!r[n])return!1;if(e.IsDataDescriptor(t)&&e.IsAccessorDescriptor(t))throw new o("Property Descriptors may not be both accessor and data descriptors");return!0}},function(e,t,r){"use strict";e.exports=Number.isNaN||function(e){return e!=e}},function(e,t,r){"use strict";var n=Number.isNaN||function(e){return e!=e};e.exports=Number.isFinite||function(e){return"number"==typeof e&&!n(e)&&e!==1/0&&e!==-1/0}},function(e,t,r){"use strict";e.exports=function(e){return e>=0?1:-1}},function(e,t,r){"use strict";e.exports=function(e,t){var r=e%t;return Math.floor(r>=0?r:r+t)}},function(e,t,r){"use strict";var n=r(91)("String.prototype.slice");e.exports=function(e,t){return e===t||!(e.length>t.length)&&n(t,0,e.length)===e}},function(e,t,r){"use strict";var n=r(21),i=r(22)("%Function%"),o=i.apply,a=i.call;e.exports=function(){return n.apply(a,arguments)},e.exports.apply=function(){return n.apply(o,arguments)}},function(e,t,r){"use strict";var n=Object.prototype.toString,i=r(244),o=r(50),a=function(e){var t;if((t=arguments.length>1?arguments[1]:"[object Date]"===n.call(e)?String:Number)===String||t===Number){var r,a,s=t===String?["toString","valueOf"]:["valueOf","toString"];for(a=0;a1?a(e,arguments[1]):a(e)}},function(e,t){e.exports=function(e){return null===e||"function"!=typeof e&&"object"!=typeof e}},function(e,t,r){"use strict";var n=r(88),i=r(92);e.exports=function(){var e=i();return n(String.prototype,{trim:e},{trim:function(){return String.prototype.trim!==e}}),e}},function(e,t,r){"use strict";var n=r(50),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,a=function(e,t,r){for(var n=0,i=e.length;n=3&&(o=r),"[object Array]"===i.call(e)?a(e,t,o):"string"==typeof e?s(e,t,o):f(e,t,o)}},function(e,t){},function(e,t,r){e.exports=r(249)},function(e,t,r){var n=r(0),i=function e(t,r,n){if(!(this instanceof e))return new e(t,r,n);this.message=t,this.code=r,void 0!==n&&(this.data=n)};n(i,Error);var o=function e(){if(!(this instanceof e))return new e;i.call(this,"Parse error",-32700)};n(o,i);var a=function e(){if(!(this instanceof e))return new e;i.call(this,"Invalid Request",-32600)};n(a,i);var s=function e(){if(!(this instanceof e))return new e;i.call(this,"Method not found",-32601)};n(s,i);var f=function e(){if(!(this instanceof e))return new e;i.call(this,"Invalid params",-32602)};n(f,i);var u=function e(t){var r;if(!(this instanceof e))return new e(t);r=t&&t.message?t.message:"Internal error",i.call(this,r,-32603)};n(u,i);var c=function e(t){if(t<-32099||t>-32e3)throw new Error("Invalid error code");if(!(this instanceof e))return new e(t);i.call(this,"Server error",t)};n(c,i),i.ParseError=o,i.InvalidRequest=a,i.MethodNotFound=s,i.InvalidParams=f,i.InternalError=u,i.ServerError=c,e.exports=i},function(e,t,r){var n=r(40),i=r(87),o=r(46),a=r(86),s=r(20),f=s.unsafeRandomBytes,u=s.incrementHexInt,l=r(48);function d(e){return{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}e.exports=function(e){var t=e.blockTracker,r=e.provider,s={},p=a({blockTracker:t,provider:r}),b=new n,y=i({eth_subscribe:o(function(){var e=h(c.mark((function e(n,i){var o,a,b,y,g;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=n.params[0],a=f(16),e.t0=o,e.next="newHeads"===e.t0?4:"logs"===e.t0?6:12;break;case 4:return b=function(e){var n=e.subId,i={type:o,destroy:function(){var e=h(c.mark((function e(){return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.removeListener("sync",i.update);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),update:function(){var e=h(c.mark((function e(t){var i,o,a,s;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.oldBlock,o=t.newBlock,a=o,s=u(i),e.next=4,l({provider:r,fromBlock:s,toBlock:a});case 4:e.sent.map(d).forEach((function(e){v(n,e)}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()};return t.on("sync",i.update),i}({subId:a}),e.abrupt("break",13);case 6:return y=n.params[1],e.next=9,p.newLogFilter(y);case 9:return g=e.sent,b=function(e){var t=e.subId,r=e.filter;return r.on("update",(function(e){return v(t,e)})),{type:o,destroy:function(){var e=h(c.mark((function e(){return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.uninstallFilter(r.idHex);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}}({subId:a,filter:g}),e.abrupt("break",13);case 12:throw new Error('SubscriptionManager - unsupported subscription type "'.concat(o,'"'));case 13:return e.abrupt("return",(s[a]=b,void(i.result=a)));case 14:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()),eth_unsubscribe:o(function(){var e=h(c.mark((function e(t,r){var n,i;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.params[0],i=s[n]){e.next=3;break}return e.abrupt("return",void(r.result=!1));case 3:return delete s[n],e.next=6,i.destroy();case 6:r.result=!0;case 7:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}())});return{events:b,middleware:y};function v(e,t){b.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:e,result:t}})}}},function(e,t,r){var n=r(93),i=r(254),o=r(95),a=r(255);e.exports.Backoff=n,e.exports.FunctionCall=a,e.exports.FibonacciStrategy=o,e.exports.ExponentialStrategy=i,e.exports.fibonacci=function(e){return new n(new o(e))},e.exports.exponential=function(e){return new n(new i(e))},e.exports.call=function(e,t,r){var n=Array.prototype.slice.call(arguments);return e=n[0],t=n.slice(1,n.length-1),r=n[n.length-1],new a(e,t,r)}},function(e,t,r){var n=r(2),i=e.exports=r(253);function o(e,t,r,i){r=r||"";var o=new e(n.format.apply(this,[r].concat(i)));throw Error.captureStackTrace(o,t),o}function a(e,t,r){o(i.IllegalArgumentError,e,t,r)}function s(e,t,r){o(i.IllegalStateError,e,t,r)}function f(e){var t=typeof e;if("object"==t){if(!e)return"null";if(e instanceof Array)return"array"}return t}function u(e){return function(t,r){var n=f(t);if(n==e)return t;a(arguments.callee,r||'Expected "'+e+'" but got "'+n+'".',Array.prototype.slice.call(arguments,2))}}e.exports.checkArgument=function(e,t){e||a(arguments.callee,t,Array.prototype.slice.call(arguments,2))},e.exports.checkState=function(e,t){e||s(arguments.callee,t,Array.prototype.slice.call(arguments,2))},e.exports.checkIsDef=function(e,t){if(void 0!==e)return e;a(arguments.callee,t||"Expected value to be defined but was undefined.",Array.prototype.slice.call(arguments,2))},e.exports.checkIsDefAndNotNull=function(e,t){if(null!=e)return e;a(arguments.callee,t||'Expected value to be defined and not null but got "'+f(e)+'".',Array.prototype.slice.call(arguments,2))},e.exports.checkIsString=u("string"),e.exports.checkIsArray=u("array"),e.exports.checkIsNumber=u("number"),e.exports.checkIsBoolean=u("boolean"),e.exports.checkIsFunction=u("function"),e.exports.checkIsObject=u("object")},function(e,t,r){var n=r(2);function i(e){Error.call(this,e),this.message=e}function o(e){Error.call(this,e),this.message=e}n.inherits(i,Error),i.prototype.name="IllegalArgumentError",n.inherits(o,Error),o.prototype.name="IllegalStateError",e.exports.IllegalStateError=o,e.exports.IllegalArgumentError=i},function(e,t,r){var n=r(2),i=r(51),o=r(94);function a(e){o.call(this,e),this.backoffDelay_=0,this.nextBackoffDelay_=this.getInitialDelay(),this.factor_=a.DEFAULT_FACTOR,e&&void 0!==e.factor&&(i.checkArgument(e.factor>1,"Exponential factor should be greater than 1 but got %s.",e.factor),this.factor_=e.factor)}n.inherits(a,o),a.DEFAULT_FACTOR=2,a.prototype.next_=function(){return this.backoffDelay_=Math.min(this.nextBackoffDelay_,this.getMaxDelay()),this.nextBackoffDelay_=this.backoffDelay_*this.factor_,this.backoffDelay_},a.prototype.reset_=function(){this.backoffDelay_=0,this.nextBackoffDelay_=this.getInitialDelay()},e.exports=a},function(e,t,r){var n=r(6),i=r(51),o=r(2),a=r(93),s=r(95);function f(e,t,r){n.EventEmitter.call(this),i.checkIsFunction(e,"Expected fn to be a function."),i.checkIsArray(t,"Expected args to be an array."),i.checkIsFunction(r,"Expected callback to be a function."),this.function_=e,this.arguments_=t,this.callback_=r,this.lastResult_=[],this.numRetries_=0,this.backoff_=null,this.strategy_=null,this.failAfter_=-1,this.retryPredicate_=f.DEFAULT_RETRY_PREDICATE_,this.state_=f.State_.PENDING}o.inherits(f,n.EventEmitter),f.State_={PENDING:0,RUNNING:1,COMPLETED:2,ABORTED:3},f.DEFAULT_RETRY_PREDICATE_=function(e){return!0},f.prototype.isPending=function(){return this.state_==f.State_.PENDING},f.prototype.isRunning=function(){return this.state_==f.State_.RUNNING},f.prototype.isCompleted=function(){return this.state_==f.State_.COMPLETED},f.prototype.isAborted=function(){return this.state_==f.State_.ABORTED},f.prototype.setStrategy=function(e){return i.checkState(this.isPending(),"FunctionCall in progress."),this.strategy_=e,this},f.prototype.retryIf=function(e){return i.checkState(this.isPending(),"FunctionCall in progress."),this.retryPredicate_=e,this},f.prototype.getLastResult=function(){return this.lastResult_.concat()},f.prototype.getNumRetries=function(){return this.numRetries_},f.prototype.failAfter=function(e){return i.checkState(this.isPending(),"FunctionCall in progress."),this.failAfter_=e,this},f.prototype.abort=function(){this.isCompleted()||this.isAborted()||(this.isRunning()&&this.backoff_.reset(),this.state_=f.State_.ABORTED,this.lastResult_=[new Error("Backoff aborted.")],this.emit("abort"),this.doCallback_())},f.prototype.start=function(e){i.checkState(!this.isAborted(),"FunctionCall is aborted."),i.checkState(this.isPending(),"FunctionCall already started.");var t=this.strategy_||new s;this.backoff_=e?e(t):new a(t),this.backoff_.on("ready",this.doCall_.bind(this,!0)),this.backoff_.on("fail",this.doCallback_.bind(this)),this.backoff_.on("backoff",this.handleBackoff_.bind(this)),this.failAfter_>0&&this.backoff_.failAfter(this.failAfter_),this.state_=f.State_.RUNNING,this.doCall_(!1)},f.prototype.doCall_=function(e){e&&this.numRetries_++;var t=["call"].concat(this.arguments_);n.EventEmitter.prototype.emit.apply(this,t);var r=this.handleFunctionCallback_.bind(this);this.function_.apply(null,this.arguments_.concat(r))},f.prototype.doCallback_=function(){this.callback_.apply(null,this.lastResult_)},f.prototype.handleFunctionCallback_=function(){if(!this.isAborted()){var e=Array.prototype.slice.call(arguments);this.lastResult_=e,n.EventEmitter.prototype.emit.apply(this,["callback"].concat(e));var t=e[0];t&&this.retryPredicate_(t)?this.backoff_.backoff(t):(this.state_=f.State_.COMPLETED,this.doCallback_())}},f.prototype.handleBackoff_=function(e,t,r){this.emit("backoff",e,t,r)},e.exports=f},function(e,t){},function(e,t,r){"use strict";r.r(t);var n,i=r(96),o=r.n(i),a=r(97),s=r.n(a),f=r(98),u=r.n(f),c=r(99),h=r.n(c),l=r(100),d=r.n(l),p=r(101),b=r.n(p),y=r(102),v=r.n(y),g=r(103),m=r.n(g),_=r(104),w=r.n(_),E=r(105),k=r.n(E),A=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),S=function(e){function t(t){var r=e.call(this,t)||this;return r.name="[Squarelink Error]",r}return A(t,e),t}(Error),x=function(){function e(e,t){this.url=e,this.params=t,this.open=!0,this._createIframe(),this._addCloseListeners(),this._addMessageListeners()}return e.prototype.close=function(){this.open&&(this.container.parentNode.removeChild(this.container),this.onClosed&&this.onClosed(this.error),this.open=!1)},e.prototype._addCloseListeners=function(){var e=this;this.container.addEventListener("click",(function(){e.close()}));var t=this;document.onkeydown=function(e){27==(e=e||window.event).keyCode&&t.open&&t.close()}},e.prototype._addMessageListeners=function(){var e=this,t=this,r=!1;window.addEventListener("message",(function(n){var i=n.data,o=i.origin,a=i.height,s=i.type,f=i.error;if("squarelink-iframe"===o){if("resize"===s)return void(t.iframe.style=I.iframe(a+"px","none"));"error"===s?(t.error=f,t.close()):"onload"!==s||r||(r=!0,e.iframe.contentWindow.postMessage({origin:"squarelink-web3-sdk",params:e.params},"*"))}}),!1)},e.prototype._createIframe=function(){var e=document.createElement("div");e.id="squarelink-iframe-container",e.style=I.container,e.innerHTML='';var t=document.createElement("iframe");t.src="https://squarelink.com/popup/?url="+encodeURI(this.url),t.id="squarelink-iframe",t.style=I.iframe(),t.onload=function(){var e=document.getElementById("squarelink-preloader");e.parentNode.removeChild(e)},e.appendChild(t),this.iframe=t,this.container=e,document.body.appendChild(e)},e}(),I={iframe:function(e,t){return void 0===e&&(e="200px"),void 0===t&&(t="3px solid #fff"),"\n position: absolute;\n height: "+e+";\n width: 360px;\n top: 50%;\n left: 50%;\n transform:\n translate(-50%, -50%);\n border: 0px transparent;\n border-radius: 10px;\n -webkit-border-radius: 10px;\n -moz-border-radius: 10px;\n border-radius: 10px;\n -khtml-border-radius: 10px;\n border: "+t+";\n z-index: 2147483647;\n box-shadow: 0 10px 30px 4px rgba(0,0,0,.33);\n background: none;\n "},container:"\n position: fixed;\n height: 100%;\n width: 100%;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 2147483647;\n background: rgba(0,0,0,0.5);\n "},M=function(e){var t=document.createElement("div");t.id="squarelink-preloader-container",t.style="\n position: fixed;\n height: 100%;\n width: 100%;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 2147483647;\n background: rgba(0,0,0,0.5);\n ",t.innerHTML='',document.body.appendChild(t),document.getElementById("squarelink-close-button").addEventListener("click",(function(){e.close()}))},T=function(e){var t=e.url,r=e.params,n=document.createElement("style");n.innerHTML="\n.squarelink-close {\n position: absolute;\n right: 50px;\n top: 30px;\n width: 10px;\n height: 25px;\n opacity: 0.6;\n z-index: 100;\n cursor: pointer;\n -webkit-transition-duration:0.5s;\n transition-duration:0.5s;\n}\n.squarelink-close:hover {\n opacity: 1;\n}\n.squarelink-close:before, .squarelink-close:after {\n position: absolute;\n left: 15px;\n content: ' ';\n height: 30px;\n width: 3px;\n background-color: #fff;\n}\n.squarelink-close:before {\n transform: rotate(45deg);\n}\n.squarelink-close:after {\n transform: rotate(-45deg);\n}\n\n.squarelink-preloader {\n display: inline-block;\n position: absolute;\n width: 64px;\n height: 64px;\n z-index: 2147483649;\n top: 50%;\n left: 50%;\n transform:\n translate(-50%, -50%);\n}\n.squarelink-preloader div {\n position: absolute;\n width: 13px;\n height: 13px;\n border-radius: 50%;\n background: #fff;\n animation: squarelink-preloader 1.2s linear infinite;\n}\n.squarelink-preloader div:nth-child(1) {\n top: 6px;\n left: 6px;\n animation-delay: 0s;\n}\n.squarelink-preloader div:nth-child(2) {\n top: 6px;\n left: 26px;\n animation-delay: -0.4s;\n}\n.squarelink-preloader div:nth-child(3) {\n top: 6px;\n left: 45px;\n animation-delay: -0.8s;\n}\n.squarelink-preloader div:nth-child(4) {\n top: 26px;\n left: 6px;\n animation-delay: -0.4s;\n}\n.squarelink-preloader div:nth-child(5) {\n top: 26px;\n left: 26px;\n animation-delay: -0.8s;\n}\n.squarelink-preloader div:nth-child(6) {\n top: 26px;\n left: 45px;\n animation-delay: -1.2s;\n}\n.squarelink-preloader div:nth-child(7) {\n top: 45px;\n left: 6px;\n animation-delay: -0.8s;\n}\n.squarelink-preloader div:nth-child(8) {\n top: 45px;\n left: 26px;\n animation-delay: -1.2s;\n}\n.squarelink-preloader div:nth-child(9) {\n top: 45px;\n left: 45px;\n animation-delay: -1.6s;\n}\n@keyframes squarelink-preloader {\n 0%, 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.5;\n }\n}",(document.head||document.getElementsByTagName("head")[0]).appendChild(n);var i=window.open("","_blank","scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=375,height=350,left=-500,top=150");if(!i||i.closed||void 0===i.closed){try{i.close()}catch(e){}return Promise.resolve({iframe:new x(t,r)})}return function(e){var t=e.url,r=e.popup,n=e.params;return new Promise((function(e,i){r.location.href=t;var o=!1;window.addEventListener("message",(function(t){if(!o){var i=t.data,a=i.origin,s=i.type;"squarelink"===a&&"onload"===s&&(o=!0,r.postMessage({origin:"squarelink-web3-sdk",params:n},"*"),r.focus(),M(r),e({popup:r}),window.removeEventListener("message",(function(){})))}}),!1)}))}({url:t,popup:i,params:r})},P=function(){return(P=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]5e5))throw new S("Please provide a valid Chain ID");if(void 0!==t.skipCache&&"boolean"!=typeof t.skipCache)throw new S("the `skipCache` paramter must be a boolean")}else{if(!this.NETWORKS[t])throw new S("Invalid network provided");if(this.NETWORKS[t].sdkVersion){var i=this.NETWORKS[t].sdkVersion,o="1.1.4".split("."),a=i.split(".");for(n=0;n<3;n++){if(parseInt(o[n])>parseInt(a[n]))return;if(parseInt(o[n])0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),f=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&t._extend(n,r),g(n.showHidden)&&(n.showHidden=!1),g(n.depth)&&(n.depth=2),g(n.colors)&&(n.colors=!1),g(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),c(n,e,n.depth)}function f(e,t){var r=s.styles[t];return r?"\x1b["+s.colors[r][0]+"m"+e+"\x1b["+s.colors[r][1]+"m":e}function u(e,t){return e}function c(e,r,n){if(e.customInspect&&r&&k(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return v(i)||(i=c(e,i,n)),i}var o=function(e,t){if(g(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return y(t)?e.stylize(""+t,"number"):p(t)?e.stylize(""+t,"boolean"):b(t)?e.stylize("null","null"):void 0}(e,r);if(o)return o;var a=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),E(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return h(r);if(0===a.length){if(k(r)){var f=r.name?": "+r.name:"";return e.stylize("[Function"+f+"]","special")}if(m(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return e.stylize(Date.prototype.toString.call(r),"date");if(E(r))return h(r)}var u,_="",A=!1,S=["{","}"];return d(r)&&(A=!0,S=["[","]"]),k(r)&&(_=" [Function"+(r.name?": "+r.name:"")+"]"),m(r)&&(_=" "+RegExp.prototype.toString.call(r)),w(r)&&(_=" "+Date.prototype.toUTCString.call(r)),E(r)&&(_=" "+h(r)),0!==a.length||A&&0!=r.length?n<0?m(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),u=A?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(u,_,S)):S[0]+_+S[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function l(e,t,r,n,i,o){var a,s,f;if((f=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=f.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):f.set&&(s=e.stylize("[Setter]","special")),M(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(f.value)<0?(s=b(r)?c(e,f.value,null):c(e,f.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),g(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function d(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function b(e){return null===e}function y(e){return"number"==typeof e}function v(e){return"string"==typeof e}function g(e){return void 0===e}function m(e){return _(e)&&"[object RegExp]"===A(e)}function _(e){return"object"==typeof e&&null!==e}function w(e){return _(e)&&"[object Date]"===A(e)}function E(e){return _(e)&&("[object Error]"===A(e)||e instanceof Error)}function k(e){return"function"==typeof e}function A(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(g(o)&&(o=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!a[r])if(new RegExp("\\b"+r+"\\b","i").test(o)){var n=e.pid;a[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,n,e)}}else a[r]=function(){};return a[r]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=d,t.isBoolean=p,t.isNull=b,t.isNullOrUndefined=function(e){return null==e},t.isNumber=y,t.isString=v,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=g,t.isRegExp=m,t.isObject=_,t.isDate=w,t.isError=E,t.isFunction=k,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(106);var x=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),x[e.getMonth()],t].join(" ")}function M(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",I(),t.format.apply(t,arguments))},t.inherits=r(107),t._extend=function(e,t){if(!t||!_(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var T="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(T&&e[T]){var t;if("function"!=typeof(t=e[T]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,T,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function f(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=s(e,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==t&&(i=s(e,t,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","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"],c=[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],h=[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];function l(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,f=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,h=67108863&f,l=Math.min(u,t.length-1),d=Math.max(0,u-e.length+1);d<=l;d++){var p=u-d|0;c+=(a=(i=0|e.words[p])*(o=0|t.words[d])+h)/67108864|0,h=67108863&a}r.words[u]=0|h,f=0|c}return 0!==f?r.words[u]=0|f:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?u[6-f.length]+f+r:f+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=c[e],d=h[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(d).toString(e);r=(p=p.idivn(d)).isZero()?b+r:u[l-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,f="le"===t,u=new e(o),c=this.clone();if(f){for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),u[s]=a;for(;s=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},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,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},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,d=0|a[1],p=8191&d,b=d>>>13,y=0|a[2],v=8191&y,g=y>>>13,m=0|a[3],_=8191&m,w=m>>>13,E=0|a[4],k=8191&E,A=E>>>13,S=0|a[5],x=8191&S,I=S>>>13,M=0|a[6],T=8191&M,P=M>>>13,B=0|a[7],L=8191&B,R=B>>>13,O=0|a[8],C=8191&O,N=O>>>13,j=0|a[9],D=8191&j,q=j>>>13,U=0|s[0],F=8191&U,z=U>>>13,K=0|s[1],H=8191&K,V=K>>>13,Y=0|s[2],G=8191&Y,$=Y>>>13,W=0|s[3],Z=8191&W,J=W>>>13,X=0|s[4],Q=8191&X,ee=X>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],fe=8191&se,ue=se>>>13,ce=0|s[8],he=8191&ce,le=ce>>>13,de=0|s[9],pe=8191&de,be=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(u+(n=Math.imul(h,F))|0)+((8191&(i=(i=Math.imul(h,z))+Math.imul(l,F)|0))<<13)|0;u=((o=Math.imul(l,z))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,z))+Math.imul(b,F)|0,o=Math.imul(b,z);var ve=(u+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,V)|0)+Math.imul(l,H)|0))<<13)|0;u=((o=o+Math.imul(l,V)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(v,F),i=(i=Math.imul(v,z))+Math.imul(g,F)|0,o=Math.imul(g,z),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,V)|0;var ge=(u+(n=n+Math.imul(h,G)|0)|0)+((8191&(i=(i=i+Math.imul(h,$)|0)+Math.imul(l,G)|0))<<13)|0;u=((o=o+Math.imul(l,$)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(_,F),i=(i=Math.imul(_,z))+Math.imul(w,F)|0,o=Math.imul(w,z),n=n+Math.imul(v,H)|0,i=(i=i+Math.imul(v,V)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,V)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,$)|0;var me=(u+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(l,Z)|0))<<13)|0;u=((o=o+Math.imul(l,J)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(k,F),i=(i=Math.imul(k,z))+Math.imul(A,F)|0,o=Math.imul(A,z),n=n+Math.imul(_,H)|0,i=(i=i+Math.imul(_,V)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,V)|0,n=n+Math.imul(v,G)|0,i=(i=i+Math.imul(v,$)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,$)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,J)|0;var _e=(u+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(l,Q)|0))<<13)|0;u=((o=o+Math.imul(l,ee)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(x,F),i=(i=Math.imul(x,z))+Math.imul(I,F)|0,o=Math.imul(I,z),n=n+Math.imul(k,H)|0,i=(i=i+Math.imul(k,V)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(_,G)|0,i=(i=i+Math.imul(_,$)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,$)|0,n=n+Math.imul(v,Z)|0,i=(i=i+Math.imul(v,J)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0;var we=(u+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(l,re)|0))<<13)|0;u=((o=o+Math.imul(l,ne)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(T,F),i=(i=Math.imul(T,z))+Math.imul(P,F)|0,o=Math.imul(P,z),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,V)|0,n=n+Math.imul(k,G)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,$)|0,n=n+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,J)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,J)|0,n=n+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,ee)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0;var Ee=(u+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ae)|0)+Math.imul(l,oe)|0))<<13)|0;u=((o=o+Math.imul(l,ae)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,z))+Math.imul(R,F)|0,o=Math.imul(R,z),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,V)|0,n=n+Math.imul(x,G)|0,i=(i=i+Math.imul(x,$)|0)+Math.imul(I,G)|0,o=o+Math.imul(I,$)|0,n=n+Math.imul(k,Z)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,ee)|0,n=n+Math.imul(v,re)|0,i=(i=i+Math.imul(v,ne)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0;var ke=(u+(n=n+Math.imul(h,fe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ue)|0)+Math.imul(l,fe)|0))<<13)|0;u=((o=o+Math.imul(l,ue)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,z))+Math.imul(N,F)|0,o=Math.imul(N,z),n=n+Math.imul(L,H)|0,i=(i=i+Math.imul(L,V)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,V)|0,n=n+Math.imul(T,G)|0,i=(i=i+Math.imul(T,$)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,$)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,J)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(_,re)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ne)|0,n=n+Math.imul(v,oe)|0,i=(i=i+Math.imul(v,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(b,fe)|0,o=o+Math.imul(b,ue)|0;var Ae=(u+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,le)|0)+Math.imul(l,he)|0))<<13)|0;u=((o=o+Math.imul(l,le)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,z))+Math.imul(q,F)|0,o=Math.imul(q,z),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,n=n+Math.imul(L,G)|0,i=(i=i+Math.imul(L,$)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,$)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,J)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(k,re)|0,i=(i=i+Math.imul(k,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,n=n+Math.imul(v,fe)|0,i=(i=i+Math.imul(v,ue)|0)+Math.imul(g,fe)|0,o=o+Math.imul(g,ue)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(b,he)|0,o=o+Math.imul(b,le)|0;var Se=(u+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,be)|0)+Math.imul(l,pe)|0))<<13)|0;u=((o=o+Math.imul(l,be)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,V))+Math.imul(q,H)|0,o=Math.imul(q,V),n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,J)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,J)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(k,oe)|0,i=(i=i+Math.imul(k,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(_,fe)|0,i=(i=i+Math.imul(_,ue)|0)+Math.imul(w,fe)|0,o=o+Math.imul(w,ue)|0,n=n+Math.imul(v,he)|0,i=(i=i+Math.imul(v,le)|0)+Math.imul(g,he)|0,o=o+Math.imul(g,le)|0;var xe=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(D,G),i=(i=Math.imul(D,$))+Math.imul(q,G)|0,o=Math.imul(q,$),n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(k,fe)|0,i=(i=i+Math.imul(k,ue)|0)+Math.imul(A,fe)|0,o=o+Math.imul(A,ue)|0,n=n+Math.imul(_,he)|0,i=(i=i+Math.imul(_,le)|0)+Math.imul(w,he)|0,o=o+Math.imul(w,le)|0;var Ie=(u+(n=n+Math.imul(v,pe)|0)|0)+((8191&(i=(i=i+Math.imul(v,be)|0)+Math.imul(g,pe)|0))<<13)|0;u=((o=o+Math.imul(g,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,J))+Math.imul(q,Z)|0,o=Math.imul(q,J),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(L,re)|0,i=(i=i+Math.imul(L,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(I,fe)|0,o=o+Math.imul(I,ue)|0,n=n+Math.imul(k,he)|0,i=(i=i+Math.imul(k,le)|0)+Math.imul(A,he)|0,o=o+Math.imul(A,le)|0;var Me=(u+(n=n+Math.imul(_,pe)|0)|0)+((8191&(i=(i=i+Math.imul(_,be)|0)+Math.imul(w,pe)|0))<<13)|0;u=((o=o+Math.imul(w,be)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,ee))+Math.imul(q,Q)|0,o=Math.imul(q,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(L,oe)|0,i=(i=i+Math.imul(L,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,n=n+Math.imul(T,fe)|0,i=(i=i+Math.imul(T,ue)|0)+Math.imul(P,fe)|0,o=o+Math.imul(P,ue)|0,n=n+Math.imul(x,he)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(I,he)|0,o=o+Math.imul(I,le)|0;var Te=(u+(n=n+Math.imul(k,pe)|0)|0)+((8191&(i=(i=i+Math.imul(k,be)|0)+Math.imul(A,pe)|0))<<13)|0;u=((o=o+Math.imul(A,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(q,re)|0,o=Math.imul(q,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,n=n+Math.imul(L,fe)|0,i=(i=i+Math.imul(L,ue)|0)+Math.imul(R,fe)|0,o=o+Math.imul(R,ue)|0,n=n+Math.imul(T,he)|0,i=(i=i+Math.imul(T,le)|0)+Math.imul(P,he)|0,o=o+Math.imul(P,le)|0;var Pe=(u+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,be)|0)+Math.imul(I,pe)|0))<<13)|0;u=((o=o+Math.imul(I,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,ae))+Math.imul(q,oe)|0,o=Math.imul(q,ae),n=n+Math.imul(C,fe)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(N,fe)|0,o=o+Math.imul(N,ue)|0,n=n+Math.imul(L,he)|0,i=(i=i+Math.imul(L,le)|0)+Math.imul(R,he)|0,o=o+Math.imul(R,le)|0;var Be=(u+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,be)|0)+Math.imul(P,pe)|0))<<13)|0;u=((o=o+Math.imul(P,be)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(D,fe),i=(i=Math.imul(D,ue))+Math.imul(q,fe)|0,o=Math.imul(q,ue),n=n+Math.imul(C,he)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(N,he)|0,o=o+Math.imul(N,le)|0;var Le=(u+(n=n+Math.imul(L,pe)|0)|0)+((8191&(i=(i=i+Math.imul(L,be)|0)+Math.imul(R,pe)|0))<<13)|0;u=((o=o+Math.imul(R,be)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,n=Math.imul(D,he),i=(i=Math.imul(D,le))+Math.imul(q,he)|0,o=Math.imul(q,le);var Re=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,be)|0)+Math.imul(N,pe)|0))<<13)|0;u=((o=o+Math.imul(N,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Oe=(u+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,be))+Math.imul(q,pe)|0))<<13)|0;return u=((o=Math.imul(q,be))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,f[0]=ye,f[1]=ve,f[2]=ge,f[3]=me,f[4]=_e,f[5]=we,f[6]=Ee,f[7]=ke,f[8]=Ae,f[9]=Se,f[10]=xe,f[11]=Ie,f[12]=Me,f[13]=Te,f[14]=Pe,f[15]=Be,f[16]=Le,f[17]=Re,f[18]=Oe,0!==u&&(f[19]=u,r.length++),r};function p(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(d=l),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?d(this,e,t):r<63?l(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):p(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},b.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==c||u>=i);u--){var h=0|this.words[u];this.words[u]=c<<26-o|h>>>o,c=h&s}return f&&0!==c&&(f.words[f.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,f=n.length-i.length;if("mod"!==t){(s=new o(null)).length=f+1,s.words=new Array(s.length);for(var u=0;u=0;h--){var l=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(l=Math.min(l/a|0,67108863),n._ishlnsubmul(i,l,h);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=l)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),f=new o(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var l=0,d=1;0==(t.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(h)),i.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||f.isOdd())&&(s.iadd(c),f.isub(h)),s.iushrn(1),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(f)):(r.isub(t),s.isub(i),f.isub(a))}return{a:s,b:f,gcd:r.iushln(u)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),f=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;0==(t.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(f),a.iushrn(1);for(var h=0,l=1;0==(r.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new E(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function m(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}v.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},i(g,v),g.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},g.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new g;else if("p224"===e)t=new m;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return y[e]=t,t},E.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),f=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,u).cmp(f);)c.redIAdd(f);for(var h=this.pow(c,i),l=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=a;0!==d.cmp(s);){for(var b=d,y=0;0!==b.cmp(s);y++)b=b.redSqr();n(y=0;n--){for(var u=t.words[n],c=f-1;c>=0;c--){var h=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}f=26}return i},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new k(e)},i(k,E),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(27)(e))},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";var n=t,i=r(3),o=r(11),a=r(62);n.assert=o,n.toArray=a.toArray,n.zero2=a.zero2,n.toHex=a.toHex,n.encode=a.encode,n.getNAF=function(e,t){for(var r=[],n=1<=0;){var o;if(i.isOdd()){var a=i.andln(n-1);o=a>(n>>1)-1?(n>>1)-a:a,i.isubn(o)}else o=0;r.push(o);for(var s=0!==i.cmpn(0)&&0===i.andln(n-1)?t+1:1,f=1;f0||t.cmpn(-i)>0;){var o,a,s,f=e.andln(3)+n&3,u=t.andln(3)+i&3;3===f&&(f=-1),3===u&&(u=-1),o=0==(1&f)?0:3!==(s=e.andln(7)+n&7)&&5!==s||2!==u?f:-f,r[0].push(o),a=0==(1&u)?0:3!==(s=t.andln(7)+i&7)&&5!==s||2!==f?u:-u,r[1].push(a),2*n===o+1&&(n=1-n),2*i===a+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},function(e,t,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var f=10;function u(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,o,a,s;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=u(e))>0&&a.length>i&&!a.warned){a.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=a.length,s=f,console&&console.warn&&console.warn(s)}return e}function h(){for(var e=[],t=0;t0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var f=i[e];if(void 0===f)return!1;if("function"==typeof f)o(f,this,t);else{var u=f.length,c=b(f,u);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return d(this,e,!0)},s.prototype.rawListeners=function(e){return d(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t,r){"use strict";(function(e){var n=r(110),i=r(111),o=r(112);function a(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(f.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(n)return F(e).length;t=(""+t).toLowerCase(),n=!0}}function b(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return M(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=f.from(t,n)),f.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,i);if("number"==typeof t)return t&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,i){var o,a=1,s=e.length,f=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,f/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=r;os&&(r=s-f),o=r;o>=0;o--){for(var h=!0,l=0;li&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function S(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(o=e[i+1]))&&(f=(31&u)<<6|63&o)>127&&(c=f);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(f=(15&u)<<12|(63&o)<<6|63&a)>2047&&(f<55296||f>57343)&&(c=f);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(f=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&f<1114112&&(c=f)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(e){var t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);for(var r="",n=0;n0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},f.prototype.compare=function(e,t,r,n,i){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(n,i),c=e.slice(t,r),h=0;hi)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return m(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":return w(this,e,t,r);case"latin1":case"binary":return E(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function M(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,n,i,o){if(!f.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function O(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function C(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function N(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(e,t,r,n,o){return o||N(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function D(e,t,r,n,o){return o||N(e,0,r,8),i.write(e,t,r,n,52,8),r+8}f.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},f.prototype.readUInt8=function(e,t){return t||L(e,1,this.length),this[e]},f.prototype.readUInt16LE=function(e,t){return t||L(e,2,this.length),this[e]|this[e+1]<<8},f.prototype.readUInt16BE=function(e,t){return t||L(e,2,this.length),this[e]<<8|this[e+1]},f.prototype.readUInt32LE=function(e,t){return t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},f.prototype.readUInt32BE=function(e,t){return t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},f.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},f.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},f.prototype.readInt8=function(e,t){return t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},f.prototype.readInt16LE=function(e,t){t||L(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(e,t){t||L(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt32LE=function(e,t){return t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},f.prototype.readInt32BE=function(e,t){return t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},f.prototype.readFloatLE=function(e,t){return t||L(e,4,this.length),i.read(this,e,!0,23,4)},f.prototype.readFloatBE=function(e,t){return t||L(e,4,this.length),i.read(this,e,!1,23,4)},f.prototype.readDoubleLE=function(e,t){return t||L(e,8,this.length),i.read(this,e,!0,52,8)},f.prototype.readDoubleBE=function(e,t){return t||L(e,8,this.length),i.read(this,e,!1,52,8)},f.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||R(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},f.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,1,255,0),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},f.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},f.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},f.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):C(this,e,t,!0),t+4},f.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},f.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);R(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},f.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);R(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},f.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,1,127,-128),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},f.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},f.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},f.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):C(this,e,t,!0),t+4},f.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},f.prototype.writeFloatLE=function(e,t,r){return j(this,e,t,!0,r)},f.prototype.writeFloatBE=function(e,t,r){return j(this,e,t,!1,r)},f.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},f.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},f.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function z(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(4))},function(e,t,r){"use strict";var n=r(11),i=r(0);function o(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function f(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,r[n++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,a,s){var f=0,u=t;return f+=(u=u+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,f,u){var c=0,h=t;return c+=(h=h+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,f,u){return t+n+o+s+u>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var f,u=[],c=!1,h=-1;function l(){c&&f&&(c=!1,f.length?u=f.concat(u):h=-1,u.length&&d())}function d(){if(!c){var e=s(l);c=!0;for(var t=u.length;t;){for(f=u,u=[];++h1)for(var r=1;r=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(52),o=r(57),a=r(68),s=r(69),f=r(3),u=r(36),c=r(1).Buffer;Object.assign(t,r(70)),t.MAX_INTEGER=new f("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new f("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.SHA3_NULL_S=t.KECCAK256_NULL_S,t.KECCAK256_NULL=c.from(t.KECCAK256_NULL_S,"hex"),t.SHA3_NULL=t.KECCAK256_NULL,t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.SHA3_RLP_ARRAY_S=t.KECCAK256_RLP_ARRAY_S,t.KECCAK256_RLP_ARRAY=c.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.SHA3_RLP_ARRAY=t.KECCAK256_RLP_ARRAY,t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.SHA3_RLP_S=t.KECCAK256_RLP_S,t.KECCAK256_RLP=c.from(t.KECCAK256_RLP_S,"hex"),t.SHA3_RLP=t.KECCAK256_RLP,t.BN=f,t.rlp=s,t.secp256k1=o,t.zeros=function(e){return c.allocUnsafe(e).fill(0)},t.zeroAddress=function(){var e=t.zeros(20);return t.bufferToHex(e)},t.setLengthLeft=t.setLength=function(e,r,n){var i=t.zeros(r);return e=t.toBuffer(e),n?e.length0&&"0"===r.toString();)r=(e=e.slice(1))[0];return e},t.toBuffer=function(e){if(!c.isBuffer(e))if(Array.isArray(e))e=c.from(e);else if("string"==typeof e)e=t.isHexString(e)?c.from(t.padToEven(t.stripHexPrefix(e)),"hex"):c.from(e);else if("number"==typeof e)e=t.intToBuffer(e);else if(null==e)e=c.allocUnsafe(0);else if(f.isBN(e))e=e.toArrayLike(c);else{if(!e.toArray)throw new Error("invalid type");e=c.from(e.toArray())}return e},t.bufferToInt=function(e){return new f(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new f(e).fromTwos(256)},t.toUnsigned=function(e){return c.from(e.toTwos(256).toArray())},t.keccak=function(e,r){return e=t.toBuffer(e),r||(r=256),i("keccak"+r).update(e).digest()},t.keccak256=function(e){return t.keccak(e)},t.sha3=t.keccak,t.sha256=function(e){return e=t.toBuffer(e),u("sha256").update(e).digest()},t.ripemd160=function(e,r){e=t.toBuffer(e);var n=u("rmd160").update(e).digest();return!0===r?t.setLength(n,32):n},t.rlphash=function(e){return t.keccak(s.encode(e))},t.isValidPrivate=function(e){return o.privateKeyVerify(e)},t.isValidPublic=function(e,t){return 64===e.length?o.publicKeyVerify(c.concat([c.from([4]),e])):!!t&&o.publicKeyVerify(e)},t.pubToAddress=t.publicToAddress=function(e,r){return e=t.toBuffer(e),r&&64!==e.length&&(e=o.publicKeyConvert(e,!1).slice(1)),a(64===e.length),t.keccak(e).slice(-20)};var h=t.privateToPublic=function(e){return e=t.toBuffer(e),o.publicKeyCreate(e,!1).slice(1)};t.importPublic=function(e){return 64!==(e=t.toBuffer(e)).length&&(e=o.publicKeyConvert(e,!1).slice(1)),e},t.ecsign=function(e,t){var r=o.sign(e,t),n={};return n.r=r.signature.slice(0,32),n.s=r.signature.slice(32,64),n.v=r.recovery+27,n},t.hashPersonalMessage=function(e){var r=t.toBuffer("\x19Ethereum Signed Message:\n"+e.length.toString());return t.keccak(c.concat([r,e]))},t.ecrecover=function(e,r,n,i){var a=c.concat([t.setLength(n,32),t.setLength(i,32)],64),s=r-27;if(0!==s&&1!==s)throw new Error("Invalid signature v value");var f=o.recover(e,a,s);return o.publicKeyConvert(f,!1).slice(1)},t.toRpcSig=function(e,r,n){if(27!==e&&28!==e)throw new Error("Invalid recovery id");return t.bufferToHex(c.concat([t.setLengthLeft(r,32),t.setLengthLeft(n,32),t.toBuffer(e-27)]))},t.fromRpcSig=function(e){if(65!==(e=t.toBuffer(e)).length)throw new Error("Invalid signature length");var r=e[64];return r<27&&(r+=27),{v:r,r:e.slice(0,32),s:e.slice(32,64)}},t.privateToAddress=function(e){return t.publicToAddress(h(e))},t.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)},t.isZeroAddress=function(e){return t.zeroAddress()===t.addHexPrefix(e)},t.toChecksumAddress=function(e){e=t.stripHexPrefix(e).toLowerCase();for(var r=t.keccak(e).toString("hex"),n="0x",i=0;i=8?n+=e[i].toUpperCase():n+=e[i];return n},t.isValidChecksumAddress=function(e){return t.isValidAddress(e)&&t.toChecksumAddress(e)===e},t.generateAddress=function(e,r){return e=t.toBuffer(e),r=(r=new f(r)).isZero()?null:c.from(r.toArray()),t.rlphash([e,r]).slice(-20)},t.isPrecompiled=function(e){var r=t.unpad(e);return 1===r.length&&r[0]>=1&&r[0]<=8},t.addHexPrefix=function(e){return"string"!=typeof e||t.isHexPrefixed(e)?e:"0x"+e},t.isValidSignature=function(e,t,r,n){var i=new f("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),o=new f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===t.length&&32===r.length&&(27===e||28===e)&&(t=new f(t),r=new f(r),!(t.isZero()||t.gt(o)||r.isZero()||r.gt(o))&&(!1!==n||1!==new f(r).cmp(i)))},t.baToJSON=function(e){if(c.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var r=[],n=0;n=i.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===i.length||!r.length||a(r.length===i.length,"The field "+r.name+" must have byte length of "+r.length),e.raw[n]=i}e._fields.push(r.name),Object.defineProperty(e,r.name,{enumerable:!0,configurable:!0,get:i,set:o}),r.default&&(e[r.name]=r.default),r.alias&&Object.defineProperty(e,r.alias,{enumerable:!1,configurable:!0,set:o,get:i})})),i)if("string"==typeof i&&(i=c.from(t.stripHexPrefix(i),"hex")),c.isBuffer(i)&&(i=s.decode(i)),Array.isArray(i)){if(i.length>e._fields.length)throw new Error("wrong number of fields in data");i.forEach((function(r,n){e[e._fields[n]]=t.toBuffer(r)}))}else{if("object"!==(void 0===i?"undefined":n(i)))throw new Error("invalid data");var o=Object.keys(i);r.forEach((function(t){-1!==o.indexOf(t.name)&&(e[t.name]=i[t.name]),-1!==o.indexOf(t.alias)&&(e[t.alias]=i[t.alias])}))}}},function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,r(7).Buffer)},function(e,t,r){"use strict";var n=r(8),i=r(11);function o(){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}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o1&&"boolean"!=typeof t)throw new TypeError('"allowMissing" argument must be a boolean');var r=l(e);if(0===r.length)return d(e,t);for(var n=d("%"+r[0]+"%",t),i=1;i0||e===t?t:t-1}function g(e){for(var t,r,n=1,i=e.length,o=e[0]+"";nu^r?1:-1;for(s=(f=i.length)<(u=o.length)?f:u,a=0;ao[a]^r?1:-1;return f==u?0:f>u^r?1:-1}function _(e,t,r,n){if(er||e!==f(e))throw Error(u+(n||"Argument")+("number"==typeof e?er?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function w(e){var t=e.c.length-1;return v(e.e/l)==t&&e.c[t]%2!=0}function E(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function k(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else tN?v.c=v.e=null:e.e=10;h/=10,u++);return void(u>N?v.c=v.e=null:(v.e=u,v.c=[e]))}y=String(e)}else{if(!a.test(y=String(e)))return i(v,y,p);v.s=45==y.charCodeAt(0)?(y=y.slice(1),-1):1}(u=y.indexOf("."))>-1&&(y=y.replace(".","")),(h=y.search(/e/i))>0?(u<0&&(u=h),u+=+y.slice(h+1),y=y.substring(0,h)):u<0&&(u=y.length)}else{if(_(t,2,F.length,"Base"),10==t)return Y(v=new z(e),B+v.e+1,L);if(y=String(e),p="number"==typeof e){if(0*e!=0)return i(v,y,p,t);if(v.s=1/e<0?(y=y.slice(1),-1):1,z.DEBUG&&y.replace(/^0\.0*|\./,"").length>15)throw Error(c+e)}else v.s=45===y.charCodeAt(0)?(y=y.slice(1),-1):1;for(r=F.slice(0,t),u=h=0,b=y.length;hu){u=b;continue}}else if(!s&&(y==y.toUpperCase()&&(y=y.toLowerCase())||y==y.toLowerCase()&&(y=y.toUpperCase()))){s=!0,h=-1,u=0;continue}return i(v,String(e),p,t)}p=!1,(u=(y=n(y,t,10,v.s)).indexOf("."))>-1?y=y.replace(".",""):u=y.length}for(h=0;48===y.charCodeAt(h);h++);for(b=y.length;48===y.charCodeAt(--b););if(y=y.slice(h,++b)){if(b-=h,p&&z.DEBUG&&b>15&&(e>d||e!==f(e)))throw Error(c+v.s*e);if((u=u-h-1)>N)v.c=v.e=null;else if(u=O)?E(f,a):k(f,a,"0");else if(o=(e=Y(new z(e),t,r)).e,s=(f=g(e.c)).length,1==n||2==n&&(t<=o||o<=R)){for(;ss){if(--t>0)for(f+=".";t--;f+="0");}else if((t+=o-s)>0)for(o+1==s&&(f+=".");t--;f+="0");return e.s<0&&i?"-"+f:f}function H(e,t){for(var r,n=1,i=new z(e[0]);n=10;i/=10,n++);return(r=n+r*l-1)>N?e.c=e.e=null:r=10;u/=10,i++);if((o=t-i)<0)o+=l,a=t,b=(c=y[d=0])/v[i-a-1]%10|0;else if((d=s((o+1)/l))>=y.length){if(!n)break e;for(;y.length<=d;y.push(0));c=b=0,i=1,a=(o%=l)-l+1}else{for(c=u=y[d],i=1;u>=10;u/=10,i++);b=(a=(o%=l)-l+i)<0?0:c/v[i-a-1]%10|0}if(n=n||t<0||null!=y[d+1]||(a<0?c:c%v[i-a-1]),n=r<4?(b||n)&&(0==r||r==(e.s<0?3:2)):b>5||5==b&&(4==r||n||6==r&&(o>0?a>0?c/v[i-a]:0:y[d-1])%10&1||r==(e.s<0?8:7)),t<1||!y[0])return y.length=0,n?(t-=e.e+1,y[0]=v[(l-t%l)%l],e.e=-t||0):y[0]=e.e=0,e;if(0==o?(y.length=d,u=1,d--):(y.length=d+1,u=v[l-o],y[d]=a>0?f(c/v[i-a]%v[a])*u:0),n)for(;;){if(0==d){for(o=1,a=y[0];a>=10;a/=10,o++);for(a=y[0]+=u,u=1;a>=10;a/=10,u++);o!=u&&(e.e++,y[0]==h&&(y[0]=1));break}if(y[d]+=u,y[d]!=h)break;y[d--]=0,u=1}for(o=y.length;0===y[--o];y.pop());}e.e>N?e.c=e.e=null:e.e=O?E(t,r):k(t,r,"0"),e.s<0?"-"+t:t)}return z.clone=e,z.ROUND_UP=0,z.ROUND_DOWN=1,z.ROUND_CEIL=2,z.ROUND_FLOOR=3,z.ROUND_HALF_UP=4,z.ROUND_HALF_DOWN=5,z.ROUND_HALF_EVEN=6,z.ROUND_HALF_CEIL=7,z.ROUND_HALF_FLOOR=8,z.EUCLID=9,z.config=z.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(u+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(_(r=e[t],0,y,t),B=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(_(r=e[t],0,8,t),L=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(_(r[0],-y,0,t),_(r[1],0,y,t),R=r[0],O=r[1]):(_(r,-y,y,t),R=-(O=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)_(r[0],-y,-1,t),_(r[1],1,y,t),C=r[0],N=r[1];else{if(_(r,-y,y,t),!r)throw Error(u+t+" cannot be zero: "+r);C=-(N=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(u+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw j=!r,Error(u+"crypto unavailable");j=r}else j=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(_(r=e[t],0,9,t),D=r),e.hasOwnProperty(t="POW_PRECISION")&&(_(r=e[t],0,y,t),q=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(u+t+" not an object: "+r);U=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(u+t+" invalid: "+r);F=r}}return{DECIMAL_PLACES:B,ROUNDING_MODE:L,EXPONENTIAL_AT:[R,O],RANGE:[C,N],CRYPTO:j,MODULO_MODE:D,POW_PRECISION:q,FORMAT:U,ALPHABET:F}},z.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!z.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-y&&i<=y&&i===f(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%l)<1&&(t+=l),String(n[0]).length==t){for(t=0;t=h||r!==f(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(u+"Invalid BigNumber: "+e)},z.maximum=z.max=function(){return H(arguments,T.lt)},z.minimum=z.min=function(){return H(arguments,T.gt)},z.random=(o=9007199254740992*Math.random()&2097151?function(){return f(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,a,c=0,h=[],d=new z(P);if(null==e?e=B:_(e,0,y),i=s(e/l),j)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));c>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[c]=r[0],t[c+1]=r[1]):(h.push(a%1e14),c+=2);c=i/2}else{if(!crypto.randomBytes)throw j=!1,Error(u+"crypto unavailable");for(t=crypto.randomBytes(i*=7);c=9e15?crypto.randomBytes(7).copy(t,c):(h.push(a%1e14),c+=7);c=i/7}if(!j)for(;c=10;a/=10,c++);cr-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}return function(t,n,i,o,a){var s,f,u,c,h,l,d,p,b=t.indexOf("."),y=B,v=L;for(b>=0&&(c=q,q=0,t=t.replace(".",""),l=(p=new z(n)).pow(t.length-b),q=c,p.c=e(k(g(l.c),l.e,"0"),10,i,"0123456789"),p.e=p.c.length),u=c=(d=e(t,n,i,a?(s=F,"0123456789"):(s="0123456789",F))).length;0==d[--c];d.pop());if(!d[0])return s.charAt(0);if(b<0?--u:(l.c=d,l.e=u,l.s=o,d=(l=r(l,p,y,v,i)).c,h=l.r,u=l.e),b=d[f=u+y+1],c=i/2,h=h||f<0||null!=d[f+1],h=v<4?(null!=b||h)&&(0==v||v==(l.s<0?3:2)):b>c||b==c&&(4==v||h||6==v&&1&d[f-1]||v==(l.s<0?8:7)),f<1||!d[0])t=h?k(s.charAt(1),-y,s.charAt(0)):s.charAt(0);else{if(d.length=f,h)for(--i;++d[--f]>i;)d[f]=0,f||(++u,d=[1].concat(d));for(c=d.length;!d[--c];);for(b=0,t="";b<=c;t+=s.charAt(d[b++]));t=k(t,u,s.charAt(0))}return t}}(),r=function(){function e(e,t,r){var n,i,o,a,s=0,f=e.length,u=t%b,c=t/b|0;for(e=e.slice();f--;)s=((i=u*(o=e[f]%b)+(n=c*o+(a=e[f]/b|0)*u)%b*b+s)/r|0)+(n/b|0)+c*a,e[f]=i%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;it[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]1;e.splice(0,1));}return function(n,i,o,a,s){var u,c,d,p,b,y,g,m,_,w,E,k,A,S,x,I,M,T=n.s==i.s?1:-1,P=n.c,B=i.c;if(!(P&&P[0]&&B&&B[0]))return new z(n.s&&i.s&&(P?!B||P[0]!=B[0]:B)?P&&0==P[0]||!B?0*T:T/0:NaN);for(_=(m=new z(T)).c=[],T=o+(c=n.e-i.e)+1,s||(s=h,c=v(n.e/l)-v(i.e/l),T=T/l|0),d=0;B[d]==(P[d]||0);d++);if(B[d]>(P[d]||0)&&c--,T<0)_.push(1),p=!0;else{for(S=P.length,I=B.length,d=0,T+=2,(b=f(s/(B[0]+1)))>1&&(B=e(B,b,s),P=e(P,b,s),I=B.length,S=P.length),A=I,E=(w=P.slice(0,I)).length;E=s/2&&x++;do{if(b=0,(u=t(B,w,I,E))<0){if(k=w[0],I!=E&&(k=k*s+(w[1]||0)),(b=f(k/x))>1)for(b>=s&&(b=s-1),g=(y=e(B,b,s)).length,E=w.length;1==t(y,w,g,E);)b--,r(y,I=10;T/=10,d++);Y(m,o+(m.e=d+c*l-1)+1,a,p)}else m.e=c,m.r=+p;return m}}(),A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,S=/^([^.]+)\.$/,x=/^\.([^.]+)$/,I=/^-?(Infinity|NaN)$/,M=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(M,"");if(I.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(A,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(S,"$1").replace(x,"0.$1")),t!=o))return new z(o,i);if(z.DEBUG)throw Error(u+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},T.absoluteValue=T.abs=function(){var e=new z(this);return e.s<0&&(e.s=1),e},T.comparedTo=function(e,t){return m(this,new z(e,t))},T.decimalPlaces=T.dp=function(e,t){var r,n,i,o=this;if(null!=e)return _(e,0,y),null==t?t=L:_(t,0,8),Y(new z(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-v(this.e/l))*l,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},T.dividedBy=T.div=function(e,t){return r(this,new z(e,t),B,L)},T.dividedToIntegerBy=T.idiv=function(e,t){return r(this,new z(e,t),0,1)},T.exponentiatedBy=T.pow=function(e,t){var r,n,i,o,a,c,h,d,p=this;if((e=new z(e)).c&&!e.isInteger())throw Error(u+"Exponent not an integer: "+G(e));if(null!=t&&(t=new z(t)),a=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return d=new z(Math.pow(+G(p),a?2-w(e):+G(e))),t?d.mod(t):d;if(c=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new z(NaN);(n=!c&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||a&&p.c[1]>=24e7:p.c[0]<8e13||a&&p.c[0]<=9999975e7)))return o=p.s<0&&w(e)?-0:0,p.e>-1&&(o=1/o),new z(c?1/o:o);q&&(o=s(q/l+2))}for(a?(r=new z(.5),c&&(e.s=1),h=w(e)):h=(i=Math.abs(+G(e)))%2,d=new z(P);;){if(h){if(!(d=d.times(p)).c)break;o?d.c.length>o&&(d.c.length=o):n&&(d=d.mod(t))}if(i){if(0===(i=f(i/2)))break;h=i%2}else if(Y(e=e.times(r),e.e+1,1),e.e>14)h=w(e);else{if(0===(i=+G(e)))break;h=i%2}p=p.times(p),o?p.c&&p.c.length>o&&(p.c.length=o):n&&(p=p.mod(t))}return n?d:(c&&(d=P.div(d)),t?d.mod(t):o?Y(d,q,L,void 0):d)},T.integerValue=function(e){var t=new z(this);return null==e?e=L:_(e,0,8),Y(t,t.e+1,e)},T.isEqualTo=T.eq=function(e,t){return 0===m(this,new z(e,t))},T.isFinite=function(){return!!this.c},T.isGreaterThan=T.gt=function(e,t){return m(this,new z(e,t))>0},T.isGreaterThanOrEqualTo=T.gte=function(e,t){return 1===(t=m(this,new z(e,t)))||0===t},T.isInteger=function(){return!!this.c&&v(this.e/l)>this.c.length-2},T.isLessThan=T.lt=function(e,t){return m(this,new z(e,t))<0},T.isLessThanOrEqualTo=T.lte=function(e,t){return-1===(t=m(this,new z(e,t)))||0===t},T.isNaN=function(){return!this.s},T.isNegative=function(){return this.s<0},T.isPositive=function(){return this.s>0},T.isZero=function(){return!!this.c&&0==this.c[0]},T.minus=function(e,t){var r,n,i,o,a=this,s=a.s;if(t=(e=new z(e,t)).s,!s||!t)return new z(NaN);if(s!=t)return e.s=-t,a.plus(e);var f=a.e/l,u=e.e/l,c=a.c,d=e.c;if(!f||!u){if(!c||!d)return c?(e.s=-t,e):new z(d?a:NaN);if(!c[0]||!d[0])return d[0]?(e.s=-t,e):new z(c[0]?a:3==L?-0:0)}if(f=v(f),u=v(u),c=c.slice(),s=f-u){for((o=s<0)?(s=-s,i=c):(u=f,i=d),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(n=(o=(s=c.length)<(t=d.length))?s:t,s=t=0;t0)for(;t--;c[r++]=0);for(t=h-1;n>s;){if(c[--n]=0;){for(r=0,p=k[i]%_,y=k[i]/_|0,o=i+(a=f);o>i;)r=((u=p*(u=E[--a]%_)+(s=y*u+(c=E[a]/_|0)*p)%_*_+g[o]+r)/m|0)+(s/_|0)+y*c,g[o--]=u%m;g[o]=r}return r?++n:g.splice(0,1),V(e,g,n)},T.negated=function(){var e=new z(this);return e.s=-e.s||null,e},T.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new z(e,t)).s,!i||!t)return new z(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/l,a=e.e/l,s=n.c,f=e.c;if(!o||!a){if(!s||!f)return new z(i/0);if(!s[0]||!f[0])return f[0]?e:new z(s[0]?n:0*i)}if(o=v(o),a=v(a),s=s.slice(),i=o-a){for(i>0?(a=o,r=f):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(t=f.length)<0&&(r=f,f=s,s=r,t=i),i=0;t;)i=(s[--t]=s[t]+f[t]+i)/h|0,s[t]=h===s[t]?0:s[t]%h;return i&&(s=[i].concat(s),++a),V(e,s,a)},T.precision=T.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return _(e,1,y),null==t?t=L:_(t,0,8),Y(new z(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*l+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},T.shiftedBy=function(e){return _(e,-d,d),this.times("1e"+e)},T.squareRoot=T.sqrt=function(){var e,t,n,i,o,a=this,s=a.c,f=a.s,u=a.e,c=B+4,h=new z("0.5");if(1!==f||!s||!s[0])return new z(!f||f<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(f=Math.sqrt(+G(a)))||f==1/0?(((t=g(s)).length+u)%2==0&&(t+="0"),f=Math.sqrt(+t),u=v((u+1)/2)-(u<0||u%2),n=new z(t=f==1/0?"1e"+u:(t=f.toExponential()).slice(0,t.indexOf("e")+1)+u)):n=new z(f+""),n.c[0])for((f=(u=n.e)+c)<3&&(f=0);;)if(o=n,n=h.times(o.plus(r(a,o,c,1))),g(o.c).slice(0,f)===(t=g(n.c)).slice(0,f)){if(n.e0&&b>0){for(o=b%s||s,h=p.substr(0,o);o0&&(h+=c+p.slice(o)),d&&(h="-"+h)}n=l?h+(r.decimalSeparator||"")+((f=+r.fractionGroupSize)?l.replace(new RegExp("\\d{"+f+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):l):h}return(r.prefix||"")+n+(r.suffix||"")},T.toFraction=function(e){var t,n,i,o,a,s,f,c,h,d,b,y,v=this,m=v.c;if(null!=e&&(!(f=new z(e)).isInteger()&&(f.c||1!==f.s)||f.lt(P)))throw Error(u+"Argument "+(f.isInteger()?"out of range: ":"not an integer: ")+G(f));if(!m)return new z(v);for(t=new z(P),h=n=new z(P),i=c=new z(P),y=g(m),a=t.e=y.length-v.e-1,t.c[0]=p[(s=a%l)<0?l+s:s],e=!e||f.comparedTo(t)>0?a>0?t:h:f,s=N,N=1/0,f=new z(y),c.c[0]=0;d=r(f,t,0,1),1!=(o=n.plus(d.times(i))).comparedTo(e);)n=i,i=o,h=c.plus(d.times(o=h)),c=o,t=f.minus(d.times(o=t)),f=o;return o=r(e.minus(n),i,0,1),c=c.plus(o.times(h)),n=n.plus(o.times(i)),c.s=h.s=v.s,b=r(h,i,a*=2,L).minus(v).abs().comparedTo(r(c,n,a,L).minus(v).abs())<1?[h,i]:[c,n],N=s,b},T.toNumber=function(){return+G(this)},T.toPrecision=function(e,t){return null!=e&&_(e,1,y),K(this,e,t,2)},T.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=R||o>=O?E(g(r.c),o):k(g(r.c),o,"0"):10===e?t=k(g((r=Y(new z(r),B+o+1,L)).c),r.e,"0"):(_(e,2,F.length,"Base"),t=n(k(g(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},T.valueOf=T.toJSON=function(){return G(this)},T._isBigNumber=!0,null!=t&&z.set(t),z}()).default=o.BigNumber=o,void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},function(e,t,r){e.exports=i;var n=r(6).EventEmitter;function i(){n.call(this)}r(0)(i,n),i.Readable=r(32),i.Writable=r(120),i.Duplex=r(121),i.Transform=r(122),i.PassThrough=r(123),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",f));var a=!1;function s(){a||(a=!0,e.end())}function f(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",f),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",u),e.on("error",u),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},function(e,t,r){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,n)}));case 4:return t.nextTick((function(){e.call(null,r,n,i)}));default:for(o=new Array(s-1),a=0;a=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(117),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(4))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";var n=r(3),i=r(5),o=i.getNAF,a=i.getJSF,s=i.assert;function f(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=f,f.prototype.point=function(){throw new Error("Not implemented")},f.prototype.validate=function(){throw new Error("Not implemented")},f.prototype._fixedNafMul=function(e,t){s(e.precomputed);var r=e._getDoubles(),n=o(t,1),i=(1<=f;t--)u=(u<<1)+n[t];a.push(u)}for(var c=this.jpoint(null,null,null),h=this.jpoint(null,null,null),l=i;l>0;l--){for(f=0;f=0;u--){for(t=0;u>=0&&0===a[u];u--)t++;if(u>=0&&t++,f=f.dblp(t),u<0)break;var c=a[u];s(0!==c),f="affine"===e.type?c>0?f.mixedAdd(i[c-1>>1]):f.mixedAdd(i[-c-1>>1].neg()):c>0?f.add(i[c-1>>1]):f.add(i[-c-1>>1].neg())}return"affine"===e.type?f.toP():f},f.prototype._wnafMulAdd=function(e,t,r,n,i){for(var s=this._wnafT1,f=this._wnafT2,u=this._wnafT3,c=0,h=0;h=1;h-=2){var d=h-1,p=h;if(1===s[d]&&1===s[p]){var b=[t[d],null,null,t[p]];0===t[d].y.cmp(t[p].y)?(b[1]=t[d].add(t[p]),b[2]=t[d].toJ().mixedAdd(t[p].neg())):0===t[d].y.cmp(t[p].y.redNeg())?(b[1]=t[d].toJ().mixedAdd(t[p]),b[2]=t[d].add(t[p].neg())):(b[1]=t[d].toJ().mixedAdd(t[p]),b[2]=t[d].toJ().mixedAdd(t[p].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],v=a(r[d],r[p]);c=Math.max(v[0].length,c),u[d]=new Array(c),u[p]=new Array(c);for(var g=0;g=0;h--){for(var k=0;h>=0;){var A=!0;for(g=0;g=0&&k++,w=w.dblp(k),h<0)break;for(g=0;g0?S=f[g][x-1>>1]:x<0&&(S=f[g][-x-1>>1].neg()),w="affine"===S.type?w.mixedAdd(S):w.add(S))}}for(h=0;h=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i-1?n:o.nextTick;g.WritableState=v;var u=r(16);u.inherits=r(0);var c,h={deprecate:r(118)},l=r(54),d=r(33).Buffer,p=i.Uint8Array||function(){},b=r(55);function y(){}function v(e,t){s=s||r(10),e=e||{};var n=t instanceof s;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,u=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(u||0===u)?u:c,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 h=!1===e.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(A,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),A(e,t))}(e,r,n,t,i);else{var a=E(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||w(e,r),n?f(_,e,r,a,i):_(e,r,a,i)}}(t,e)},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 a(this)}function g(e){if(s=s||r(10),!(c.call(g,this)||this instanceof s))return new g(e);this._writableState=new v(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function m(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function _(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),A(e,t)}function w(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var s=0,f=!0;r;)i[s]=r,r.isBuf||(f=!1),r=r.next,s+=1;i.allBuffers=f,m(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,h=r.callback;if(m(e,t,!1,t.objectMode?1:u.length,u,c,h),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),A(e,t)}))}function A(e,t){var r=E(t);return r&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(k,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}u.inherits(g,l),v.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(v.prototype,"buffer",{get:h.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(e){return!!c.call(this,e)||this===g&&e&&e._writableState instanceof v}})):c=function(e){return e instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=e,d.isBuffer(n)||n instanceof p);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=y),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),o.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r)),t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var f=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,A(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),g.prototype.destroy=b.destroy,g.prototype._undestroy=b.undestroy,g.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(9),r(26).setImmediate,r(4))},function(e,t,r){"use strict";var n=r(1).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.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}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=f,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=h,t=3;break;default:return this.write=l,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function f(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function l(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";var n=r(0),i=r(132),o=r(133),a=r(134),s=r(139);function f(e){s.call(this,"digest"),this._hash=e}n(f,s),f.prototype._update=function(e){this._hash.update(e)},f.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new o:new f(a(e))}},function(e,t,r){"use strict";var n,i=t,o=r(38),a=r(64),s=r(5).assert;function f(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new f(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=f,u("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:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("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:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("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:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("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:o.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"]}),u("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:o.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"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("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:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(153)}catch(e){n=void 0}u("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:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},function(e,t,r){var n=t;n.utils=r(8),n.common=r(17),n.sha=r(147),n.ripemd=r(151),n.hmac=r(152),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(e,t,r){"use strict";var n=function(e,t){return function(){for(var r=this,n=t.promiseModule,i=new Array(arguments.length),o=0;o0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)f(s,this,t);else{var c=s.length,h=u(s,c);for(r=0;r0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):w(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?w(e,a,t,!1):x(e,a)):w(e,a,t,!1))):n||(a.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=E?e=E:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function A(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(S,e):S(e))}function S(e){d("emit readable"),e.emit("readable"),P(e)}function x(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(I,e,t))}function I(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;return eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=u.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t),n}(e,t.buffer,t.decoder),r);var r}function L(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function O(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?L(this):A(this),null;if(0===(e=k(e,t))&&t.ended)return 0===t.length&&L(this),null;var n,i=t.needReadable;return d("need readable",i),(0===t.length||t.length-e0?B(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&L(this)),null!==n&&this.emit("data",n),n},m.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},m.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,t);var f=t&&!1===t.end||e===n.stdout||e===n.stderr?g:u;function u(){d("onend"),e.end()}o.endEmitted?i.nextTick(f):r.once("end",f),e.on("unpipe",(function t(n,i){d("onunpipe"),n===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,d("cleanup"),e.removeListener("close",y),e.removeListener("finish",v),e.removeListener("drain",c),e.removeListener("error",b),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",g),r.removeListener("data",p),h=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}));var c=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,P(e))}}(r);e.on("drain",c);var h=!1,l=!1;function p(t){d("ondata"),l=!1,!1!==e.write(t)||l||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==O(o.pipes,e))&&!h&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,l=!0),r.pause())}function b(t){d("onerror",t),g(),e.removeListener("error",b),0===s(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",v),g()}function v(){d("onfinish"),e.removeListener("close",y),g()}function g(){d("unpipe"),r.unpipe(e)}return r.on("data",p),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",b),e.once("close",y),e.once("finish",v),e.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),e},m.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},function(e,t,r){var n=r(0),i=r(14),o=r(1).Buffer,a=[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],s=new Array(64);function f(){this.init(),this._w=s,i.call(this,64,56)}function u(e,t,r){return r^e&(t^r)}function c(e,t,r){return e&t|r&(e|t)}function h(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function l(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function d(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(f,i),f.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},f.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,f=0|this._e,p=0|this._f,b=0|this._g,y=0|this._h,v=0;v<16;++v)r[v]=e.readInt32BE(4*v);for(;v<64;++v)r[v]=0|(((t=r[v-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[v-7]+d(r[v-15])+r[v-16];for(var g=0;g<64;++g){var m=y+l(f)+u(f,p,b)+a[g]+r[g]|0,_=h(n)+c(n,i,o)|0;y=b,b=p,p=f,f=s+m|0,s=o,o=i,i=n,n=m+_|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=f+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=y+this._h|0},f.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=f},function(e,t,r){var n=r(0),i=r(14),o=r(1).Buffer,a=[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],s=new Array(160);function f(){this.init(),this._w=s,i.call(this,128,112)}function u(e,t,r){return r^e&(t^r)}function c(e,t,r){return e&t|r&(e|t)}function h(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function l(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function b(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function y(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function v(e,t){return e>>>0>>0?1:0}n(f,i),f.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},f.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,f=0|this._fh,g=0|this._gh,m=0|this._hh,_=0|this._al,w=0|this._bl,E=0|this._cl,k=0|this._dl,A=0|this._el,S=0|this._fl,x=0|this._gl,I=0|this._hl,M=0;M<32;M+=2)t[M]=e.readInt32BE(4*M),t[M+1]=e.readInt32BE(4*M+4);for(;M<160;M+=2){var T=t[M-30],P=t[M-30+1],B=d(T,P),L=p(P,T),R=b(T=t[M-4],P=t[M-4+1]),O=y(P,T),C=t[M-14],N=t[M-14+1],j=t[M-32],D=t[M-32+1],q=L+N|0,U=B+C+v(q,L)|0;U=(U=U+R+v(q=q+O|0,O)|0)+j+v(q=q+D|0,D)|0,t[M]=U,t[M+1]=q}for(var F=0;F<160;F+=2){U=t[F],q=t[F+1];var z=c(r,n,i),K=c(_,w,E),H=h(r,_),V=h(_,r),Y=l(s,A),G=l(A,s),$=a[F],W=a[F+1],Z=u(s,f,g),J=u(A,S,x),X=I+G|0,Q=m+Y+v(X,I)|0;Q=(Q=(Q=Q+Z+v(X=X+J|0,J)|0)+$+v(X=X+W|0,W)|0)+U+v(X=X+q|0,q)|0;var ee=V+K|0,te=H+z+v(ee,V)|0;m=g,I=x,g=f,x=S,f=s,S=A,s=o+Q+v(A=k+X|0,k)|0,o=i,k=E,i=n,E=w,n=r,w=_,r=Q+te+v(_=X+ee|0,X)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+E|0,this._dl=this._dl+k|0,this._el=this._el+A|0,this._fl=this._fl+S|0,this._gl=this._gl+x|0,this._hl=this._hl+I|0,this._ah=this._ah+r+v(this._al,_)|0,this._bh=this._bh+n+v(this._bl,w)|0,this._ch=this._ch+i+v(this._cl,E)|0,this._dh=this._dh+o+v(this._dl,k)|0,this._eh=this._eh+s+v(this._el,A)|0,this._fh=this._fh+f+v(this._fl,S)|0,this._gh=this._gh+g+v(this._gl,x)|0,this._hh=this._hh+m+v(this._hl,I)|0},f.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=f},function(e,t,r){"use strict";var n=t;function i(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(e,t){return"hex"===t?o(e):e}},function(e,t,r){var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict";var n=r(8),i=r(17),o=r(65),a=r(11),s=n.sum32,f=n.sum32_4,u=n.sum32_5,c=o.ch32,h=o.maj32,l=o.s0_256,d=o.s1_256,p=o.g0_256,b=o.g1_256,y=i.BlockHash,v=[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];function g(){if(!(this instanceof g))return new g;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=v,this.W=new Array(64)}n.inherits(g,y),e.exports=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n=0;u--)if(c[u]!==h[u])return!1;for(u=c.length-1;u>=0;u--)if(!m(e[s=c[u]],t[s],r,n))return!1;return!0}(e,t,r,n))}return r?e===t:e==t}function _(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function E(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&v(i,r,"Missing expected exception"+n);var o="string"==typeof n,s=!e&&i&&!r;if((!e&&a.isError(i)&&o&&w(i,r)||s)&&v(i,r,"Got unwanted exception"+n),e&&i&&r&&!w(i,r)||!e&&i)throw i}l.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return b(y(e.actual),128)+" "+e.operator+" "+b(y(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||v;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=p(t),o=n.indexOf("\n"+i);if(o>=0){var a=n.indexOf("\n",o+1);n=n.substring(a+1)}this.stack=n}}},a.inherits(l.AssertionError,Error),l.fail=v,l.ok=g,l.equal=function(e,t,r){e!=t&&v(e,t,r,"==",l.equal)},l.notEqual=function(e,t,r){e==t&&v(e,t,r,"!=",l.notEqual)},l.deepEqual=function(e,t,r){m(e,t,!1)||v(e,t,r,"deepEqual",l.deepEqual)},l.deepStrictEqual=function(e,t,r){m(e,t,!0)||v(e,t,r,"deepStrictEqual",l.deepStrictEqual)},l.notDeepEqual=function(e,t,r){m(e,t,!1)&&v(e,t,r,"notDeepEqual",l.notDeepEqual)},l.notDeepStrictEqual=function e(t,r,n){m(t,r,!0)&&v(t,r,n,"notDeepStrictEqual",e)},l.strictEqual=function(e,t,r){e!==t&&v(e,t,r,"===",l.strictEqual)},l.notStrictEqual=function(e,t,r){e===t&&v(e,t,r,"!==",l.notStrictEqual)},l.throws=function(e,t,r){E(!0,e,t,r)},l.doesNotThrow=function(e,t,r){E(!1,e,t,r)},l.ifError=function(e){if(e)throw e},l.strict=n((function e(t,r){t||v(t,!0,r,"==",e)}),l,{equal:l.strictEqual,deepEqual:l.deepStrictEqual,notEqual:l.notStrictEqual,notDeepEqual:l.notDeepStrictEqual}),l.strict.strict=l.strict;var k=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}}).call(this,r(4))},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(3);function i(e,t){if("00"===e.slice(0,2))throw new Error("invalid RLP: extra zeros");return parseInt(e,t)}function o(t,r){if(t<56)return e.from([t+r]);var n=s(t),i=s(r+55+n.length/2);return e.from(i+n,"hex")}function a(e){return"0x"===e.slice(0,2)}function s(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");var t=e.toString(16);return t.length%2?"0"+t:t}function f(t){if(!e.isBuffer(t)){if("string"==typeof t)return a(t)?e.from((i="string"!=typeof(o=t)?o:a(o)?o.slice(2):o).length%2?"0"+i:i,"hex"):e.from(t);if("number"==typeof t)return t?(r=s(t),e.from(r,"hex")):e.from([]);if(null==t)return e.from([]);if(t instanceof Uint8Array)return e.from(t);if(n.isBN(t))return e.from(t.toArray());throw new Error("invalid type")}var r,i,o;return t}t.encode=function t(r){if(Array.isArray(r)){for(var n=[],i=0;ir.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(s=r.slice(o,h)).length)throw new Error("invalid rlp, List has a invalid length");for(;s.length;)f=t(s),u.push(f.data),s=f.remainder;return{data:u,remainder:r.slice(h)}}(f(t));if(r)return n;if(0!==n.remainder.length)throw new Error("invalid remainder");return n.data},t.getLength=function(t){if(!t||0===t.length)return e.from([]);var r=f(t),n=r[0];if(n<=127)return r.length;if(n<=183)return n-127;if(n<=191)return n-182;if(n<=247)return n-191;var o=n-246;return o+i(r.slice(1,o).toString("hex"),16)}}).call(this,r(7).Buffer)},function(e,t,r){"use strict";(function(t){var n=r(71),i=r(162);function o(e){var t=e;if("string"!=typeof t)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof t+", while padToEven.");return t.length%2&&(t="0"+t),t}function a(e){return"0x"+e.toString(16)}e.exports={arrayContainsArray:function(e,t,r){if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof e+"'");if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof t+"'");return t[Boolean(r)?"some":"every"]((function(t){return e.indexOf(t)>=0}))},intToBuffer:function(e){var r=a(e);return new t(o(r.slice(2)),"hex")},getBinarySize:function(e){if("string"!=typeof e)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof e+"'.");return t.byteLength(e,"utf8")},isHexPrefixed:n,stripHexPrefix:i,padToEven:o,intToHex:a,fromAscii:function(e){for(var t="",r=0;r-1&&e%1==0&&e<=9007199254740991}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(t,r,f){if(f=(0,i.default)(f||n.default),e<=0||!t)return f(null);var u=(0,o.default)(t),c=!1,h=0,l=!1;function d(e,t){if(h-=1,e)c=!0,f(e);else{if(t===s.default||c&&h<=0)return c=!0,f(null);l||p()}}function p(){for(l=!0;h=e.params.length?e.params:"eth_getBlockByNumber"===e.method?e.params.slice(1):e.params.slice(0,t)}function a(e){switch(e.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":return 1;case"eth_getBlockByNumber":return 0;default:return}}function s(e){switch(e.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":return"fork";case"eth_gasPrice":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"eth_blockNumber":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":return"never"}}e.exports={cacheIdentifierForPayload:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!i(e))return null;var r=t.includeBlockRef?e.params:o(e);return e.method+":"+n(r)},canCache:i,blockTagForPayload:function(e){var t=a(e);return t>=e.params.length?null:e.params[t]},paramsWithoutBlockTag:o,blockTagParamIndex:a,cacheTypeForPayload:s}},function(e,t,r){var n="undefined"!=typeof JSON?JSON:r(197);e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r=t.space||"";"number"==typeof r&&(r=Array(r+1).join(" "));var a,s="boolean"==typeof t.cycles&&t.cycles,f=t.replacer||function(e,t){return t},u=t.cmp&&(a=t.cmp,function(e){return function(t,r){var n={key:t,value:e[t]},i={key:r,value:e[r]};return a(n,i)}}),c=[];return function e(t,a,h,l){var d=r?"\n"+new Array(l+1).join(r):"",p=r?": ":":";if(h&&h.toJSON&&"function"==typeof h.toJSON&&(h=h.toJSON()),void 0!==(h=f.call(t,a,h))){if("object"!=typeof h||null===h)return n.stringify(h);if(i(h)){for(var b=[],y=0;y0?t.on("sync",_):r>0&&0===n&&t.removeListener("sync",_)}}},function(e,t,r){e.exports=r(207)},function(e,t,r){"use strict";var n=r(230),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,a=Array.prototype.concat,s=Object.defineProperty,f=s&&function(){var e={};try{for(var t in s(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(e){return!1}}(),u=function(e,t,r,n){var i;t in e&&("function"!=typeof(i=n)||"[object Function]"!==o.call(i)||!n())||(f?s(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r)},c=function(e,t){var r=arguments.length>2?arguments[2]:{},o=n(t);i&&(o=a.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s=0&&"[object Function]"===n.call(e.callee)),r}},function(e,t,r){"use strict";var n=r(21),i=r(232),o=n.call(Function.call,String.prototype.replace),a=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,s=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;e.exports=function(){var e=i.ToString(i.CheckObjectCoercible(this));return o(o(e,a,""),s,"")}},function(e,t,r){"use strict";var n=r(22),i=r(242),o=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")?i(r):r}},function(e,t,r){"use strict";var n=r(90);e.exports=function(){return String.prototype.trim&&"\u200b"==="\u200b".trim()?String.prototype.trim:n}},function(e,t,r){var n=r(6),i=r(51);function o(e){n.EventEmitter.call(this),this.backoffStrategy_=e,this.maxNumberOfRetry_=-1,this.backoffNumber_=0,this.backoffDelay_=0,this.timeoutID_=-1,this.handlers={backoff:this.onBackoff_.bind(this)}}r(2).inherits(o,n.EventEmitter),o.prototype.failAfter=function(e){i.checkArgument(e>0,"Expected a maximum number of retry greater than 0 but got %s.",e),this.maxNumberOfRetry_=e},o.prototype.backoff=function(e){i.checkState(-1===this.timeoutID_,"Backoff in progress."),this.backoffNumber_===this.maxNumberOfRetry_?(this.emit("fail",e),this.reset()):(this.backoffDelay_=this.backoffStrategy_.next(),this.timeoutID_=setTimeout(this.handlers.backoff,this.backoffDelay_),this.emit("backoff",this.backoffNumber_,this.backoffDelay_,e))},o.prototype.onBackoff_=function(){this.timeoutID_=-1,this.emit("ready",this.backoffNumber_,this.backoffDelay_),this.backoffNumber_++},o.prototype.reset=function(){this.backoffNumber_=0,this.backoffStrategy_.reset(),clearTimeout(this.timeoutID_),this.timeoutID_=-1},e.exports=o},function(e,t,r){function n(e){return null!=e}function i(e){if(n((e=e||{}).initialDelay)&&e.initialDelay<1)throw new Error("The initial timeout must be greater than 0.");if(n(e.maxDelay)&&e.maxDelay<1)throw new Error("The maximal timeout must be greater than 0.");if(this.initialDelay_=e.initialDelay||100,this.maxDelay_=e.maxDelay||1e4,this.maxDelay_<=this.initialDelay_)throw new Error("The maximal backoff delay must be greater than the initial backoff delay.");if(n(e.randomisationFactor)&&(e.randomisationFactor<0||e.randomisationFactor>1))throw new Error("The randomisation factor must be between 0 and 1.");this.randomisationFactor_=e.randomisationFactor||0}r(6),r(2),i.prototype.getMaxDelay=function(){return this.maxDelay_},i.prototype.getInitialDelay=function(){return this.initialDelay_},i.prototype.next=function(){var e=this.next_(),t=1+Math.random()*this.randomisationFactor_;return Math.round(e*t)},i.prototype.next_=function(){throw new Error("BackoffStrategy.next_() unimplemented.")},i.prototype.reset=function(){this.reset_()},i.prototype.reset_=function(){throw new Error("BackoffStrategy.reset_() unimplemented.")},e.exports=i},function(e,t,r){var n=r(2),i=r(94);function o(e){i.call(this,e),this.backoffDelay_=0,this.nextBackoffDelay_=this.getInitialDelay()}n.inherits(o,i),o.prototype.next_=function(){var e=Math.min(this.nextBackoffDelay_,this.getMaxDelay());return this.nextBackoffDelay_+=this.backoffDelay_,this.backoffDelay_=e,e},o.prototype.reset_=function(){this.nextBackoffDelay_=this.getInitialDelay(),this.backoffDelay_=0},e.exports=o},function(e,t,r){"use strict";var n=r(6).EventEmitter,i=r(2).inherits,o=r(15),a=r(163),s=r(73),f=r(193),u=r(196),c=(r(84),r(19));function h(e){n.call(this),this.setMaxListeners(30),e=e||{};var t={sendAsync:this._handleAsync.bind(this)},r=e.blockTrackerProvider||t;this._blockTracker=e.blockTracker||new a({provider:r,pollingInterval:e.pollingInterval||4e3,setSkipCacheFlag:void 0===e.setSkipCacheFlag||e.setSkipCacheFlag}),this._ready=new u,this.currentBlock=null,this._providers=[]}function l(e){return e?{number:o.toBuffer(e.number),hash:o.toBuffer(e.hash),parentHash:o.toBuffer(e.parentHash),nonce:o.toBuffer(e.nonce),mixHash:o.toBuffer(e.mixHash),sha3Uncles:o.toBuffer(e.sha3Uncles),logsBloom:o.toBuffer(e.logsBloom),transactionsRoot:o.toBuffer(e.transactionsRoot),stateRoot:o.toBuffer(e.stateRoot),receiptsRoot:o.toBuffer(e.receiptRoot||e.receiptsRoot),miner:o.toBuffer(e.miner),difficulty:o.toBuffer(e.difficulty),totalDifficulty:o.toBuffer(e.totalDifficulty),size:o.toBuffer(e.size),extraData:o.toBuffer(e.extraData),gasLimit:o.toBuffer(e.gasLimit),gasUsed:o.toBuffer(e.gasUsed),timestamp:o.toBuffer(e.timestamp),transactions:e.transactions}:{}}e.exports=h,i(h,n),Object.defineProperty(h,"name",{value:"HttpProvider"}),h.prototype.start=function(){var e=this,t=this;t._ready.go(),t._blockTracker.on("latest",(function(r){t._getBlockByNumber(r,(function(r,n){if(r)e.emit("error",r);else if(n){var i=l(n);t._setCurrentBlock(i),t.emit("rawBlock",n),t.emit("latest",n)}}))})),t._blockTracker.on("sync",t.emit.bind(t,"sync")),t._blockTracker.on("error",t.emit.bind(t,"error")),t._running=!0,t.emit("start")},h.prototype.stop=function(){this._blockTracker.removeAllListeners(),this._running=!1,this.emit("stop")},h.prototype.isRunning=function(){return this._running},h.prototype.addProvider=function(e,t){"number"==typeof t?this._providers.splice(t,0,e):this._providers.push(e),e.setEngine(this)},h.prototype.removeProvider=function(e){var t=this._providers.indexOf(e);if(t<0)throw new Error("Provider not found.");this._providers.splice(t,1)},h.prototype.send=function(e){throw new Error("Web3ProviderEngine does not support synchronous requests.")},h.prototype.sendAsync=function(e,t){var r=this;r._ready.await((function(){Array.isArray(e)?s(e,r._handleAsync.bind(r),t):r._handleAsync(e,t)}))},h.prototype._getBlockByNumber=function(e,t){var r=c({method:"eth_getBlockByNumber",params:[e,!1],skipCache:!0});this._handleAsync(r,(function(e,r){return e?t(e):t(null,r.result)}))},h.prototype._handleAsync=function(e,t){var r=this,n=-1,i=null,o=null,a=[];function s(r,n){o=r,i=n,f(a,(function(e,t){e?e(o,i,t):t()}),(function(){var r={id:e.id,jsonrpc:e.jsonrpc,result:i};null!=o?(r.error={message:o.stack||o.message||o,code:-32e3},t(o,r)):t(null,r)}))}!function t(i){if(n+=1,a.unshift(i),n>=r._providers.length)s(new Error('Request for method "'+e.method+'" not handled by any subprovider. Please check your subprovider configuration to ensure this method is handled.'));else try{r._providers[n].handleRequest(e,t,s)}catch(e){s(e)}}()},h.prototype._setCurrentBlock=function(e){this.currentBlock=e,this.emit("block",e)}},function(e,t,r){"use strict";var n=r(45),i=r(201),o=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,(function(t){var r=t.blockTracker;return i(Object.assign({blockTracker:r},e))})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(n);e.exports=o},function(e,t,r){"use strict";var n=r(2).inherits,i=r(13);function o(e){e=e||{},this.staticResponses=e}e.exports=o,n(o,i),o.prototype.handleRequest=function(e,t,r){var n=this.staticResponses[e.method];"function"==typeof n?n(e,t,r):void 0!==n?setTimeout((function(){return r(null,n)})):t()}},function(e,t,r){"use strict";var n=r(45),i=r(86),o=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,(function(e){var t=e.blockTracker,r=e.provider;return e.engine,i({blockTracker:t,provider:r})})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(n);e.exports=o},function(e,t,r){"use strict";var n=r(73),i=r(2).inherits,o=r(13);function a(e){e=e||{},this.numberOfBlocks=e.numberOfBlocks||10,this.delayInBlocks=e.delayInBlocks||5}e.exports=a,i(a,o),a.prototype.handleRequest=function(e,t,r){if("eth_gasPrice"!==e.method)return t();var i=this;i.emitPayload({method:"eth_blockNumber"},(function(e,t){for(var o=parseInt(t.result,16)-i.delayInBlocks,a=[],s=0;s5e3&&this._backoff.reset(),this._socket.removeEventListener("close",this._handleSocketClose),this._socket.removeEventListener("message",this._handleSocketMessage),this._socket.removeEventListener("open",this._handleSocketOpen),this._socket=null,this._backoff.backoff()}},{key:"_handleSocketMessage",value:function(e){var t=void 0;try{t=JSON.parse(e.data)}catch(e){return void this._log("Received a message that is not valid JSON:",t)}if(void 0===t.id)return this.engine.emit("data",null,t);if(this._pendingRequests.has(t.id)){var r=this._pendingRequests.get(t.id),i=n(r,2),o=i[0],a=i[1];if(this._pendingRequests.delete(t.id),this._log("Received: "+o.method+" #"+t.id),t.error)return a(new Error(t.error.message));a(null,t.result)}}},{key:"_handleSocketOpen",value:function(){var e=this;this._log("Socket open."),this._connectTime=Date.now(),this._pendingRequests.forEach((function(t){var r=n(t,2),i=r[0],o=r[1];e._unhandledRequests.push([i,null,o])})),this._pendingRequests.clear(),this._unhandledRequests.splice(0,this._unhandledRequests.length).forEach((function(t){e.handleRequest.apply(e,t)}))}},{key:"_openSocket",value:function(){this._log("Opening socket..."),this._socket=new s(this._url,[],this._origin?{headers:{origin:this._origin}}:{}),this._socket.addEventListener("close",this._handleSocketClose),this._socket.addEventListener("message",this._handleSocketMessage),this._socket.addEventListener("open",this._handleSocketOpen)}}]),t}(f);Object.assign(c.prototype,a.prototype),e.exports=c}).call(this,r(4))},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){"use strict";var n=r(109),i=r(124);e.exports=function(e){var t=n(e),r=i(e);return function(e,n){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new t(1152,448,null,224,n);case"keccak256":return new t(1088,512,null,256,n);case"keccak384":return new t(832,768,null,384,n);case"keccak512":return new t(576,1024,null,512,n);case"sha3-224":return new t(1152,448,6,224,n);case"sha3-256":return new t(1088,512,6,256,n);case"sha3-384":return new t(832,768,6,384,n);case"sha3-512":return new t(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+e)}}}},function(e,t,r){"use strict";var n=r(1).Buffer,i=r(24).Transform,o=r(0);e.exports=function(e){function t(t,r,n,o,a){i.call(this,a),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=o,this._options=a,this._state=new e,this._state.initialize(t,r),this._finalized=!1}return o(t,i),t.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},t.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},t.prototype.update=function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return n.isBuffer(e)||(e=n.from(e,t)),this._state.absorb(e),this},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},function(e,t,r){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=u(e),a=n[0],s=n[1],f=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),c=0,h=s>0?a-4:a;for(r=0;r>16&255,f[c++]=t>>8&255,f[c++]=255&t;return 2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,f[c++]=255&t),1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,f[c++]=t>>8&255,f[c++]=255&t),f},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));return 1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,f=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var i,o,a=[],s=t;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,f=(1<>1,c=-7,h=r?i-1:0,l=r?-1:1,d=e[t+h];for(h+=l,o=d&(1<<-c)-1,d>>=-c,c+=s;c>0;o=256*o+e[t+h],h+=l,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+e[t+h],h+=l,c-=8);if(0===o)o=1-u;else{if(o===f)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=u}return(d?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,f,u=8*o-i-1,c=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-a))<1&&(a--,f*=2),(t+=a+h>=1?l/f:l*Math.pow(2,1-h))*f>=2&&(a++,f/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(t*f-1)*Math.pow(2,i),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;e[r+d]=255&a,d+=p,a/=256,u-=8);e[r+d-p]|=128*b}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t){},function(e,t,r){"use strict";var n=r(33).Buffer,i=r(116);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,i=n.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=i,r=a,o.data.copy(t,r),a+=o.data.length,o=o.next;return i},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i,o,a,s,f=1,u={},c=!1,h=e.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(e);l=l&&l.setTimeout?l:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){p(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),n=function(t){e.postMessage(a+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){o.port2.postMessage(e)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,n=function(e){var t=h.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):n=function(e){setTimeout(p,0,e)},l.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(i.p1600(this.state),this.count=0);return t},o.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},e.exports=o},function(e,t,r){"use strict";var n=[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];t.p1600=function(e){for(var t=0;t<24;++t){var r=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],s=e[4]^e[14]^e[24]^e[34]^e[44],f=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],c=e[7]^e[17]^e[27]^e[37]^e[47],h=e[8]^e[18]^e[28]^e[38]^e[48],l=e[9]^e[19]^e[29]^e[39]^e[49],d=h^(o<<1|a>>>31),p=l^(a<<1|o>>>31),b=e[0]^d,y=e[1]^p,v=e[10]^d,g=e[11]^p,m=e[20]^d,_=e[21]^p,w=e[30]^d,E=e[31]^p,k=e[40]^d,A=e[41]^p;d=r^(s<<1|f>>>31),p=i^(f<<1|s>>>31);var S=e[2]^d,x=e[3]^p,I=e[12]^d,M=e[13]^p,T=e[22]^d,P=e[23]^p,B=e[32]^d,L=e[33]^p,R=e[42]^d,O=e[43]^p;d=o^(u<<1|c>>>31),p=a^(c<<1|u>>>31);var C=e[4]^d,N=e[5]^p,j=e[14]^d,D=e[15]^p,q=e[24]^d,U=e[25]^p,F=e[34]^d,z=e[35]^p,K=e[44]^d,H=e[45]^p;d=s^(h<<1|l>>>31),p=f^(l<<1|h>>>31);var V=e[6]^d,Y=e[7]^p,G=e[16]^d,$=e[17]^p,W=e[26]^d,Z=e[27]^p,J=e[36]^d,X=e[37]^p,Q=e[46]^d,ee=e[47]^p;d=u^(r<<1|i>>>31),p=c^(i<<1|r>>>31);var te=e[8]^d,re=e[9]^p,ne=e[18]^d,ie=e[19]^p,oe=e[28]^d,ae=e[29]^p,se=e[38]^d,fe=e[39]^p,ue=e[48]^d,ce=e[49]^p,he=b,le=y,de=g<<4|v>>>28,pe=v<<4|g>>>28,be=m<<3|_>>>29,ye=_<<3|m>>>29,ve=E<<9|w>>>23,ge=w<<9|E>>>23,me=k<<18|A>>>14,_e=A<<18|k>>>14,we=S<<1|x>>>31,Ee=x<<1|S>>>31,ke=M<<12|I>>>20,Ae=I<<12|M>>>20,Se=T<<10|P>>>22,xe=P<<10|T>>>22,Ie=L<<13|B>>>19,Me=B<<13|L>>>19,Te=R<<2|O>>>30,Pe=O<<2|R>>>30,Be=N<<30|C>>>2,Le=C<<30|N>>>2,Re=j<<6|D>>>26,Oe=D<<6|j>>>26,Ce=U<<11|q>>>21,Ne=q<<11|U>>>21,je=F<<15|z>>>17,De=z<<15|F>>>17,qe=H<<29|K>>>3,Ue=K<<29|H>>>3,Fe=V<<28|Y>>>4,ze=Y<<28|V>>>4,Ke=$<<23|G>>>9,He=G<<23|$>>>9,Ve=W<<25|Z>>>7,Ye=Z<<25|W>>>7,Ge=J<<21|X>>>11,$e=X<<21|J>>>11,We=ee<<24|Q>>>8,Ze=Q<<24|ee>>>8,Je=te<<27|re>>>5,Xe=re<<27|te>>>5,Qe=ne<<20|ie>>>12,et=ie<<20|ne>>>12,tt=ae<<7|oe>>>25,rt=oe<<7|ae>>>25,nt=se<<8|fe>>>24,it=fe<<8|se>>>24,ot=ue<<14|ce>>>18,at=ce<<14|ue>>>18;e[0]=he^~ke&Ce,e[1]=le^~Ae&Ne,e[10]=Fe^~Qe&be,e[11]=ze^~et&ye,e[20]=we^~Re&Ve,e[21]=Ee^~Oe&Ye,e[30]=Je^~de&Se,e[31]=Xe^~pe&xe,e[40]=Be^~Ke&tt,e[41]=Le^~He&rt,e[2]=ke^~Ce&Ge,e[3]=Ae^~Ne&$e,e[12]=Qe^~be&Ie,e[13]=et^~ye&Me,e[22]=Re^~Ve&nt,e[23]=Oe^~Ye&it,e[32]=de^~Se&je,e[33]=pe^~xe&De,e[42]=Ke^~tt&ve,e[43]=He^~rt&ge,e[4]=Ce^~Ge&ot,e[5]=Ne^~$e&at,e[14]=be^~Ie&qe,e[15]=ye^~Me&Ue,e[24]=Ve^~nt&me,e[25]=Ye^~it&_e,e[34]=Se^~je&We,e[35]=xe^~De&Ze,e[44]=tt^~ve&Te,e[45]=rt^~ge&Pe,e[6]=Ge^~ot&he,e[7]=$e^~at&le,e[16]=Ie^~qe&Fe,e[17]=Me^~Ue&ze,e[26]=nt^~me&we,e[27]=it^~_e&Ee,e[36]=je^~We&Je,e[37]=De^~Ze&Xe,e[46]=ve^~Te&Be,e[47]=ge^~Pe&Le,e[8]=ot^~he&ke,e[9]=at^~le&Ae,e[18]=qe^~Fe&Qe,e[19]=Ue^~ze&et,e[28]=me^~we&Re,e[29]=_e^~Ee&Oe,e[38]=We^~Je&de,e[39]=Ze^~Xe&pe,e[48]=Te^~Be&Ke,e[49]=Pe^~Le&He,e[0]^=n[2*t],e[1]^=n[2*t+1]}}},function(e,t,r){"use strict";var n=r(128),i=r(129),o=r(58);function a(e,t){return void 0===e?t:(n.isBoolean(e,o.COMPRESSED_TYPE_INVALID),e)}e.exports=function(e){return{privateKeyVerify:function(t){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),32===t.length&&e.privateKeyVerify(t)},privateKeyExport:function(t,r){n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),r=a(r,!0);var s=e.privateKeyExport(t,r);return i.privateKeyExport(t,s,r)},privateKeyImport:function(t){if(n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),(t=i.privateKeyImport(t))&&32===t.length&&e.privateKeyVerify(t))return t;throw new Error(o.EC_PRIVATE_KEY_IMPORT_DER_FAIL)},privateKeyNegate:function(t){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),e.privateKeyNegate(t)},privateKeyModInverse:function(t){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),e.privateKeyModInverse(t)},privateKeyTweakAdd:function(t,r){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),e.privateKeyTweakAdd(t,r)},privateKeyTweakMul:function(t,r){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),e.privateKeyTweakMul(t,r)},publicKeyCreate:function(t,r){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),r=a(r,!0),e.publicKeyCreate(t,r)},publicKeyConvert:function(t,r){return n.isBuffer(t,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),r=a(r,!0),e.publicKeyConvert(t,r)},publicKeyVerify:function(t){return n.isBuffer(t,o.EC_PUBLIC_KEY_TYPE_INVALID),e.publicKeyVerify(t)},publicKeyTweakAdd:function(t,r,i){return n.isBuffer(t,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),i=a(i,!0),e.publicKeyTweakAdd(t,r,i)},publicKeyTweakMul:function(t,r,i){return n.isBuffer(t,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),i=a(i,!0),e.publicKeyTweakMul(t,r,i)},publicKeyCombine:function(t,r){n.isArray(t,o.EC_PUBLIC_KEYS_TYPE_INVALID),n.isLengthGTZero(t,o.EC_PUBLIC_KEYS_LENGTH_INVALID);for(var i=0;i=r)throw RangeError(n)}}).call(this,r(7).Buffer)},function(e,t,r){"use strict";var n=r(1).Buffer,i=r(130),o=n.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]),a=n.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]);t.privateKeyExport=function(e,t,r){var i=n.from(r?o:a);return e.copy(i,r?8:9),t.copy(i,r?181:214),i},t.privateKeyImport=function(e){var t=e.length,r=0;if(!(t2||t1?e[r+n-2]<<8:0);if(!(t<(r+=n)+i||t32||t1&&0===t[o]&&!(128&t[o+1]);--r,++o);for(var a=n.concat([n.from([0]),e.s]),s=33,f=0;s>1&&0===a[f]&&!(128&a[f+1]);--s,++f);return i.encode(t.slice(o),a.slice(f))},t.signatureImport=function(e){var t=n.alloc(32,0),r=n.alloc(32,0);try{var o=i.decode(e);if(33===o.r.length&&0===o.r[0]&&(o.r=o.r.slice(1)),o.r.length>32)throw new Error("R length is too long");if(33===o.s.length&&0===o.s[0]&&(o.s=o.s.slice(1)),o.s.length>32)throw new Error("S length is too long")}catch(e){return}return o.r.copy(t,32-o.r.length),o.s.copy(r,32-o.s.length),{r:t,s:r}},t.signatureImportLax=function(e){var t=n.alloc(32,0),r=n.alloc(32,0),i=e.length,o=0;if(48===e[o++]){var a=e[o++];if(!(128&a&&(o+=a-128)>i)&&2===e[o++]){var s=e[o++];if(128&s){if(o+(a=s-128)>i)return;for(;a>0&&0===e[o];o+=1,a-=1);for(s=0;a>0;o+=1,a-=1)s=(s<<8)+e[o]}if(!(s>i-o)){var f=o;if(o+=s,2===e[o++]){var u=e[o++];if(128&u){if(o+(a=u-128)>i)return;for(;a>0&&0===e[o];o+=1,a-=1);for(u=0;a>0;o+=1,a-=1)u=(u<<8)+e[o]}if(!(u>i-o)){var c=o;for(o+=u;s>0&&0===e[f];s-=1,f+=1);if(!(s>32)){var h=e.slice(f,f+s);for(h.copy(t,32-h.length);u>0&&0===e[c];u-=1,c+=1);if(!(u>32)){var l=e.slice(c,c+u);return l.copy(r,32-l.length),{r:t,s:r}}}}}}}}}},function(e,t,r){var n=r(1).Buffer;e.exports={check:function(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;var t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;var r=e[5+t];return 0!==r&&6+t+r===e.length&&!(128&e[4])&&!(t>1&&0===e[4]&&!(128&e[5]))&&!(128&e[t+6])&&!(r>1&&0===e[t+6]&&!(128&e[t+7]))},decode:function(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");var t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");var r=e[5+t];if(0===r)throw new Error("S length is zero");if(6+t+r!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(r>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}},encode:function(e,t){var r=e.length,i=t.length;if(0===r)throw new Error("R length is zero");if(0===i)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(i>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&t[0])throw new Error("S value is negative");if(r>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(i>1&&0===t[0]&&!(128&t[1]))throw new Error("S value excessively padded");var o=n.allocUnsafe(6+r+i);return o[0]=48,o[1]=o.length-2,o[2]=2,o[3]=e.length,e.copy(o,4),o[4+r]=2,o[5+r]=t.length,t.copy(o,6+r),o}}},function(e,t,r){"use strict";var n=r(1).Buffer,i=r(36),o=r(3),a=r(141).ec,s=r(58),f=new a("secp256k1"),u=f.curve;function c(e){var t=e[0];switch(t){case 2:case 3:return 33!==e.length?null:function(e,t){var r=new o(t);if(r.cmp(u.p)>=0)return null;var n=(r=r.toRed(u.red)).redSqr().redIMul(r).redIAdd(u.b).redSqrt();return 3===e!==n.isOdd()&&(n=n.redNeg()),f.keyPair({pub:{x:r,y:n}})}(t,e.slice(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,t,r){var n=new o(t),i=new o(r);if(n.cmp(u.p)>=0||i.cmp(u.p)>=0)return null;if(n=n.toRed(u.red),i=i.toRed(u.red),(6===e||7===e)&&i.isOdd()!==(7===e))return null;var a=n.redSqr().redIMul(n);return i.redSqr().redISub(a.redIAdd(u.b)).isZero()?f.keyPair({pub:{x:n,y:i}}):null}(t,e.slice(1,33),e.slice(33,65));default:return null}}t.privateKeyVerify=function(e){var t=new o(e);return t.cmp(u.n)<0&&!t.isZero()},t.privateKeyExport=function(e,t){var r=new o(e);if(r.cmp(u.n)>=0||r.isZero())throw new Error(s.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return n.from(f.keyFromPrivate(e).getPublic(t,!0))},t.privateKeyNegate=function(e){var t=new o(e);return t.isZero()?n.alloc(32):u.n.sub(t).umod(u.n).toArrayLike(n,"be",32)},t.privateKeyModInverse=function(e){var t=new o(e);if(t.cmp(u.n)>=0||t.isZero())throw new Error(s.EC_PRIVATE_KEY_RANGE_INVALID);return t.invm(u.n).toArrayLike(n,"be",32)},t.privateKeyTweakAdd=function(e,t){var r=new o(t);if(r.cmp(u.n)>=0)throw new Error(s.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(r.iadd(new o(e)),r.cmp(u.n)>=0&&r.isub(u.n),r.isZero())throw new Error(s.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return r.toArrayLike(n,"be",32)},t.privateKeyTweakMul=function(e,t){var r=new o(t);if(r.cmp(u.n)>=0||r.isZero())throw new Error(s.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);return r.imul(new o(e)),r.cmp(u.n)&&(r=r.umod(u.n)),r.toArrayLike(n,"be",32)},t.publicKeyCreate=function(e,t){var r=new o(e);if(r.cmp(u.n)>=0||r.isZero())throw new Error(s.EC_PUBLIC_KEY_CREATE_FAIL);return n.from(f.keyFromPrivate(e).getPublic(t,!0))},t.publicKeyConvert=function(e,t){var r=c(e);if(null===r)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);return n.from(r.getPublic(t,!0))},t.publicKeyVerify=function(e){return null!==c(e)},t.publicKeyTweakAdd=function(e,t,r){var i=c(e);if(null===i)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);if((t=new o(t)).cmp(u.n)>=0)throw new Error(s.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);var a=u.g.mul(t).add(i.pub);if(a.isInfinity())throw new Error(s.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return n.from(a.encode(!0,r))},t.publicKeyTweakMul=function(e,t,r){var i=c(e);if(null===i)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);if((t=new o(t)).cmp(u.n)>=0||t.isZero())throw new Error(s.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return n.from(i.pub.mul(t).encode(!0,r))},t.publicKeyCombine=function(e,t){for(var r=new Array(e.length),i=0;i=0||r.cmp(u.n)>=0)throw new Error(s.ECDSA_SIGNATURE_PARSE_FAIL);var i=n.from(e);return 1===r.cmp(f.nh)&&u.n.sub(r).toArrayLike(n,"be",32).copy(i,32),i},t.signatureExport=function(e){var t=e.slice(0,32),r=e.slice(32,64);if(new o(t).cmp(u.n)>=0||new o(r).cmp(u.n)>=0)throw new Error(s.ECDSA_SIGNATURE_PARSE_FAIL);return{r:t,s:r}},t.signatureImport=function(e){var t=new o(e.r);t.cmp(u.n)>=0&&(t=new o(0));var r=new o(e.s);return r.cmp(u.n)>=0&&(r=new o(0)),n.concat([t.toArrayLike(n,"be",32),r.toArrayLike(n,"be",32)])},t.sign=function(e,t,r,i){if("function"==typeof r){var a=r;r=function(r){var f=a(e,t,null,i,r);if(!n.isBuffer(f)||32!==f.length)throw new Error(s.ECDSA_SIGN_FAIL);return new o(f)}}var c=new o(t);if(c.cmp(u.n)>=0||c.isZero())throw new Error(s.ECDSA_SIGN_FAIL);var h=f.sign(e,t,{canonical:!0,k:r,pers:i});return{signature:n.concat([h.r.toArrayLike(n,"be",32),h.s.toArrayLike(n,"be",32)]),recovery:h.recoveryParam}},t.verify=function(e,t,r){var n={r:t.slice(0,32),s:t.slice(32,64)},i=new o(n.r),a=new o(n.s);if(i.cmp(u.n)>=0||a.cmp(u.n)>=0)throw new Error(s.ECDSA_SIGNATURE_PARSE_FAIL);if(1===a.cmp(f.nh)||i.isZero()||a.isZero())return!1;var h=c(r);if(null===h)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);return f.verify(e,n,{x:h.pub.x,y:h.pub.y})},t.recover=function(e,t,r,i){var a={r:t.slice(0,32),s:t.slice(32,64)},c=new o(a.r),h=new o(a.s);if(c.cmp(u.n)>=0||h.cmp(u.n)>=0)throw new Error(s.ECDSA_SIGNATURE_PARSE_FAIL);try{if(c.isZero()||h.isZero())throw new Error;var l=f.recoverPubKey(e,a,r);return n.from(l.encode(!0,i))}catch(e){throw new Error(s.ECDSA_RECOVER_FAIL)}},t.ecdh=function(e,r){var n=t.ecdhUnsafe(e,r,!0);return i("sha256").update(n).digest()},t.ecdhUnsafe=function(e,t,r){var i=c(e);if(null===i)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);var a=new o(t);if(a.cmp(u.n)>=0||a.isZero())throw new Error(s.ECDH_FAIL);return n.from(i.pub.mul(a).encode(!0,r))}},function(e,t,r){"use strict";var n=r(0),i=r(59),o=r(1).Buffer,a=new Array(16);function s(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function f(e,t){return e<>>32-t}function u(e,t,r,n,i,o,a){return f(e+(t&r|~t&n)+i+o|0,a)+t|0}function c(e,t,r,n,i,o,a){return f(e+(t&n|r&~n)+i+o|0,a)+t|0}function h(e,t,r,n,i,o,a){return f(e+(t^r^n)+i+o|0,a)+t|0}function l(e,t,r,n,i,o,a){return f(e+(r^(t|~n))+i+o|0,a)+t|0}n(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=u(r,n,i,o,e[0],3614090360,7),o=u(o,r,n,i,e[1],3905402710,12),i=u(i,o,r,n,e[2],606105819,17),n=u(n,i,o,r,e[3],3250441966,22),r=u(r,n,i,o,e[4],4118548399,7),o=u(o,r,n,i,e[5],1200080426,12),i=u(i,o,r,n,e[6],2821735955,17),n=u(n,i,o,r,e[7],4249261313,22),r=u(r,n,i,o,e[8],1770035416,7),o=u(o,r,n,i,e[9],2336552879,12),i=u(i,o,r,n,e[10],4294925233,17),n=u(n,i,o,r,e[11],2304563134,22),r=u(r,n,i,o,e[12],1804603682,7),o=u(o,r,n,i,e[13],4254626195,12),i=u(i,o,r,n,e[14],2792965006,17),r=c(r,n=u(n,i,o,r,e[15],1236535329,22),i,o,e[1],4129170786,5),o=c(o,r,n,i,e[6],3225465664,9),i=c(i,o,r,n,e[11],643717713,14),n=c(n,i,o,r,e[0],3921069994,20),r=c(r,n,i,o,e[5],3593408605,5),o=c(o,r,n,i,e[10],38016083,9),i=c(i,o,r,n,e[15],3634488961,14),n=c(n,i,o,r,e[4],3889429448,20),r=c(r,n,i,o,e[9],568446438,5),o=c(o,r,n,i,e[14],3275163606,9),i=c(i,o,r,n,e[3],4107603335,14),n=c(n,i,o,r,e[8],1163531501,20),r=c(r,n,i,o,e[13],2850285829,5),o=c(o,r,n,i,e[2],4243563512,9),i=c(i,o,r,n,e[7],1735328473,14),r=h(r,n=c(n,i,o,r,e[12],2368359562,20),i,o,e[5],4294588738,4),o=h(o,r,n,i,e[8],2272392833,11),i=h(i,o,r,n,e[11],1839030562,16),n=h(n,i,o,r,e[14],4259657740,23),r=h(r,n,i,o,e[1],2763975236,4),o=h(o,r,n,i,e[4],1272893353,11),i=h(i,o,r,n,e[7],4139469664,16),n=h(n,i,o,r,e[10],3200236656,23),r=h(r,n,i,o,e[13],681279174,4),o=h(o,r,n,i,e[0],3936430074,11),i=h(i,o,r,n,e[3],3572445317,16),n=h(n,i,o,r,e[6],76029189,23),r=h(r,n,i,o,e[9],3654602809,4),o=h(o,r,n,i,e[12],3873151461,11),i=h(i,o,r,n,e[15],530742520,16),r=l(r,n=h(n,i,o,r,e[2],3299628645,23),i,o,e[0],4096336452,6),o=l(o,r,n,i,e[7],1126891415,10),i=l(i,o,r,n,e[14],2878612391,15),n=l(n,i,o,r,e[5],4237533241,21),r=l(r,n,i,o,e[12],1700485571,6),o=l(o,r,n,i,e[3],2399980690,10),i=l(i,o,r,n,e[10],4293915773,15),n=l(n,i,o,r,e[1],2240044497,21),r=l(r,n,i,o,e[8],1873313359,6),o=l(o,r,n,i,e[15],4264355552,10),i=l(i,o,r,n,e[6],2734768916,15),n=l(n,i,o,r,e[13],1309151649,21),r=l(r,n,i,o,e[4],4149444226,6),o=l(o,r,n,i,e[11],3174756917,10),i=l(i,o,r,n,e[2],718787259,15),n=l(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},s.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 e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},function(e,t,r){"use strict";var n=r(7).Buffer,i=r(0),o=r(59),a=new Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],f=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],c=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],h=[0,1518500249,1859775393,2400959708,2840853838],l=[1352829926,1548603684,1836072691,2053994217,0];function d(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<>>32-t}function b(e,t,r,n,i,o,a,s){return p(e+(t^r^n)+o+a|0,s)+i|0}function y(e,t,r,n,i,o,a,s){return p(e+(t&r|~t&n)+o+a|0,s)+i|0}function v(e,t,r,n,i,o,a,s){return p(e+((t|~r)^n)+o+a|0,s)+i|0}function g(e,t,r,n,i,o,a,s){return p(e+(t&n|r&~n)+o+a|0,s)+i|0}function m(e,t,r,n,i,o,a,s){return p(e+(t^(r|~n))+o+a|0,s)+i|0}i(d,o),d.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,d=0|this._e,_=0|this._a,w=0|this._b,E=0|this._c,k=0|this._d,A=0|this._e,S=0;S<80;S+=1){var x,I;S<16?(x=b(r,n,i,o,d,e[s[S]],h[0],u[S]),I=m(_,w,E,k,A,e[f[S]],l[0],c[S])):S<32?(x=y(r,n,i,o,d,e[s[S]],h[1],u[S]),I=g(_,w,E,k,A,e[f[S]],l[1],c[S])):S<48?(x=v(r,n,i,o,d,e[s[S]],h[2],u[S]),I=v(_,w,E,k,A,e[f[S]],l[2],c[S])):S<64?(x=g(r,n,i,o,d,e[s[S]],h[3],u[S]),I=y(_,w,E,k,A,e[f[S]],l[3],c[S])):(x=m(r,n,i,o,d,e[s[S]],h[4],u[S]),I=b(_,w,E,k,A,e[f[S]],l[4],c[S])),r=d,d=o,o=p(i,10),i=n,n=x,_=A,A=k,k=p(E,10),E=w,w=I}var M=this._b+i+k|0;this._b=this._c+o+A|0,this._c=this._d+d+_|0,this._d=this._e+r+w|0,this._e=this._a+n+E|0,this._a=M},d.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 e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=d},function(e,t,r){(t=e.exports=function(e){e=e.toLowerCase();var r=t[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r}).sha=r(135),t.sha1=r(136),t.sha224=r(137),t.sha256=r(60),t.sha384=r(138),t.sha512=r(61)},function(e,t,r){var n=r(0),i=r(14),o=r(1).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function f(){this.init(),this._w=s,i.call(this,64,56)}function u(e){return e<<30|e>>>2}function c(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(f,i),f.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},f.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,f=0|this._e,h=0;h<16;++h)r[h]=e.readInt32BE(4*h);for(;h<80;++h)r[h]=r[h-3]^r[h-8]^r[h-14]^r[h-16];for(var l=0;l<80;++l){var d=~~(l/20),p=0|((t=n)<<5|t>>>27)+c(d,i,o,s)+f+r[l]+a[d];f=s,s=o,o=u(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=f+this._e|0},f.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=f},function(e,t,r){var n=r(0),i=r(14),o=r(1).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function f(){this.init(),this._w=s,i.call(this,64,56)}function u(e){return e<<5|e>>>27}function c(e){return e<<30|e>>>2}function h(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(f,i),f.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},f.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,f=0|this._e,l=0;l<16;++l)r[l]=e.readInt32BE(4*l);for(;l<80;++l)r[l]=(t=r[l-3]^r[l-8]^r[l-14]^r[l-16])<<1|t>>>31;for(var d=0;d<80;++d){var p=~~(d/20),b=u(n)+h(p,i,o,s)+f+r[d]+a[p]|0;f=s,s=o,o=c(i),i=n,n=b}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=f+this._e|0},f.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=f},function(e,t,r){var n=r(0),i=r(60),o=r(14),a=r(1).Buffer,s=new Array(64);function f(){this.init(),this._w=s,o.call(this,64,56)}n(f,i),f.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},f.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=f},function(e,t,r){var n=r(0),i=r(61),o=r(14),a=r(1).Buffer,s=new Array(160);function f(){this.init(),this._w=s,o.call(this,128,112)}n(f,i),f.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},f.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=f},function(e,t,r){var n=r(1).Buffer,i=r(24).Transform,o=r(35).StringDecoder;function a(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(0)(a,i),a.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=a},function(e,t){},function(e,t,r){"use strict";var n=t;n.version=r(142).version,n.utils=r(5),n.rand=r(63),n.curve=r(64),n.curves=r(37),n.ec=r(154),n.eddsa=r(158)},function(e){e.exports={_from:"elliptic@^6.4.1",_id:"elliptic@6.5.1",_inBundle:!1,_integrity:"sha512-xvJINNLbTeWQjrl6X+7eQCrIy/YPv5XCpKW6kB5mKvtnGILoLDcySuwomfdzt0BMdLNVnuRNTuzKNHj0bva1Cg==",_location:"/elliptic",_phantomChildren:{},_requested:{type:"range",registry:!0,raw:"elliptic@^6.4.1",name:"elliptic",escapedName:"elliptic",rawSpec:"^6.4.1",saveSpec:null,fetchSpec:"^6.4.1"},_requiredBy:["/browserify-sign","/create-ecdh","/secp256k1"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.5.1.tgz",_shasum:"c380f5f909bf1b9b4428d028cd18d3b0efd6b52b",_spec:"elliptic@^6.4.1",_where:"/Users/alex/Documents/Squarelink/SDKs/Web3/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:"^3.0.4",grunt:"^1.0.4","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":"^9.0.1",istanbul:"^0.4.2",jscs:"^3.0.7",jshint:"^2.6.0",mocha:"^6.1.4"},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.5.1"}},function(e,t){},function(e,t,r){"use strict";var n=r(5),i=r(3),o=r(0),a=r(28),s=n.assert;function f(e){a.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.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(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,n){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(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 c(e,t,r,n){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,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}o(f,a),e.exports=f,f.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(r)}}},f.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},f.prototype._getEndoBasis=function(e){for(var t,r,n,o,a,s,f,u,c,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=e,d=this.n.clone(),p=new i(1),b=new i(0),y=new i(0),v=new i(1),g=0;0!==l.cmpn(0);){var m=d.div(l);u=d.sub(m.mul(l)),c=y.sub(m.mul(p));var _=v.sub(m.mul(b));if(!n&&u.cmp(h)<0)t=f.neg(),r=p,n=u.neg(),o=c;else if(n&&2==++g)break;f=u,d=l,l=u,y=p,p=c,v=b,b=_}a=u.neg(),s=c;var w=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(w)>=0&&(a=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},f.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),f=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:f.add(u).neg()}},f.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},f.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},f.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},u.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},u.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},u.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},u.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(c,a.BasePoint),f.prototype.jpoint=function(e,t,r){return new c(this,e,t,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),f=o.redSub(a);if(0===s.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),c=u.redMul(s),h=n.redMul(u),l=f.redSqr().redIAdd(c).redISub(h).redISub(h),d=f.redMul(h.redISub(l)).redISub(o.redMul(c)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(l,d,p)},c.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=a.redSqr(),u=f.redMul(a),c=r.redMul(f),h=s.redSqr().redIAdd(u).redISub(c).redISub(c),l=s.redMul(c.redISub(h)).redISub(i.redMul(u)),d=this.z.redMul(a);return this.curve.jpoint(h,l,d)},c.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict";var n=r(3),i=r(0),o=r(28),a=r(5);function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function f(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(f,o.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},s.prototype.point=function(e,t){return new f(this,e,t)},s.prototype.pointFromJSON=function(e){return f.fromJSON(this,e)},f.prototype.precompute=function(){},f.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},f.fromJSON=function(e,t){return new f(e,t[0],t[1]||e.one)},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},f.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},f.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),f=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,f)},f.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},f.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},f.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";var n=r(5),i=r(3),o=r(0),a=r(28),s=n.assert;function f(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function u(e,t,r,n,o){a.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(f,a),e.exports=f,f.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},f.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},f.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},f.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var f=s.fromRed().isOdd();return(t&&!f||!t&&f)&&(s=s.redNeg()),this.point(e,s)},f.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},f.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(u,a.BasePoint),f.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},f.prototype.point=function(e,t,r,n){return new u(this,e,t,r,n)},u.fromJSON=function(e,t){return new u(e,t[0],t[1],t[2])},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),f=i.redMul(a),u=o.redMul(s),c=i.redMul(s),h=a.redMul(o);return this.curve.point(f,u,h,c)},u.prototype._projDbl=function(){var e,t,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(u=this.curve._mulA(i)).redAdd(o);if(this.zOne)e=n.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(u.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),f=a.redSub(s).redISub(s);e=n.redSub(i).redISub(o).redMul(f),t=a.redMul(u.redSub(o)),r=a.redMul(f)}}else{var u=i.redAdd(o);s=this.curve._mulC(this.z).redSqr(),f=u.redSub(s).redSub(s),e=this.curve._mulC(n.redISub(u)).redMul(f),t=this.curve._mulC(u).redMul(i.redISub(o)),r=u.redMul(f)}return this.curve.point(e,t,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),f=r.redAdd(t),u=o.redMul(a),c=s.redMul(f),h=o.redMul(f),l=a.redMul(s);return this.curve.point(u,c,l,h)},u.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),f=i.redSub(s),u=i.redAdd(s),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),h=n.redMul(f).redMul(c);return this.curve.twisted?(t=n.redMul(u).redMul(a.redSub(this.curve._mulA(o))),r=f.redMul(u)):(t=n.redMul(u).redMul(a.redSub(o)),r=this.curve._mulC(f).redMul(u)),this.curve.point(h,t,r)},u.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},u.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},u.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},u.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},function(e,t,r){"use strict";t.sha1=r(148),t.sha224=r(149),t.sha256=r(66),t.sha384=r(150),t.sha512=r(67)},function(e,t,r){"use strict";var n=r(8),i=r(17),o=r(65),a=n.rotl32,s=n.sum32,f=n.sum32_5,u=o.ft_1,c=i.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(l,c),e.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t0))return a.iaddn(1),this.keyFromPrivate(a)}},h.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},h.prototype.sign=function(e,t,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var a=this.n.byteLength(),s=t.getPrivate().toArray("be",a),f=e.toArray("be",a),u=new i({hash:this.hash,entropy:s,nonce:f,pers:o.pers,persEnc:o.persEnc||"utf8"}),h=this.n.sub(new n(1)),l=0;;l++){var d=o.k?o.k(l):new n(u.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(h)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var b=p.getX(),y=b.umod(this.n);if(0!==y.cmpn(0)){var v=d.invm(this.n).mul(y.mul(t.getPrivate()).iadd(e));if(0!==(v=v.umod(this.n)).cmpn(0)){var g=(p.getY().isOdd()?1:0)|(0!==b.cmp(y)?2:0);return o.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),g^=1),new c({r:y,s:v,recoveryParam:g})}}}}}},h.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new c(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,f=a.invm(this.n),u=f.mul(e).umod(this.n),h=f.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(u,r.getPublic(),h)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(u,r.getPublic(),h)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},h.prototype.recoverPubKey=function(e,t,r,i){f((3&r)===r,"The recovery param is more than two bits"),t=new c(t,i);var o=this.n,a=new n(e),s=t.r,u=t.s,h=1&r,l=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");s=l?this.curve.pointFromX(s.add(this.curve.n),h):this.curve.pointFromX(s,h);var d=t.r.invm(o),p=o.sub(a).mul(d).umod(o),b=u.mul(d).umod(o);return this.g.mulAdd(p,s,b)},h.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new c(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";var n=r(38),i=r(62),o=r(11);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=a,a.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);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(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length"}},function(e,t,r){"use strict";var n=r(3),i=r(5),o=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function f(e,t){var r=e[t.place++];if(!(128&r))return r;for(var n=15&r,i=0,o=0,a=t.place;o>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new s;if(48!==e[r.place++])return!1;if(f(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=f(e,r),a=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var u=f(e,r);if(e.length!==u+r.place)return!1;var c=e.slice(r.place,u+r.place);return 0===a[0]&&128&a[1]&&(a=a.slice(1)),0===c[0]&&128&c[1]&&(c=c.slice(1)),this.r=new n(a),this.s=new n(c),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=u(t),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];c(n,t.length),(n=n.concat(t)).push(2),c(n,r.length);var o=n.concat(r),a=[48];return c(a,o.length),a=a.concat(o),i.encode(a,e)}},function(e,t,r){"use strict";var n=r(38),i=r(37),o=r(5),a=o.assert,s=o.parseBytes,f=r(159),u=r(160);function c(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof c))return new c(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=c,c.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),f=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:f,Rencoded:o})},c.prototype.verify=function(e,t,r){e=s(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},c.prototype.hashInt=function(){for(var e=this.hash(),t=0;t0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,i),!t.provider)throw new Error("PollingBlockTracker - no provider specified.");var n=t.pollingInterval||2e4,o=t.retryTimeout||n/10,s=void 0===t.keepEventLoopActive||t.keepEventLoopActive,f=t.setSkipCacheFlag||!1;return(e=r.call(this,Object.assign({blockResetDuration:n},t)))._provider=t.provider,e._pollingInterval=n,e._retryTimeout=o,e._keepEventLoopActive=s,e._setSkipCacheFlag=f,e}return s(i,[{key:"checkForLatestBlock",value:function(){var e=h(c.mark((function e(){return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._updateLatestBlock();case 2:return e.next=4,this.getLatestBlock();case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_start",value:function(){var e=this;this._performSync().catch((function(t){return e.emit("error",t)}))}},{key:"_performSync",value:function(){var t=h(c.mark((function t(){var r;return c.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._isRunning){t.next=16;break}return t.prev=1,t.next=4,this._updateLatestBlock();case 4:return t.next=6,o(this._pollingInterval,!this._keepEventLoopActive);case 6:t.next=14;break;case 8:t.prev=8,t.t0=t.catch(1),r=new Error("PollingBlockTracker - encountered an error while attempting to update latest block:\n".concat(t.t0.stack));try{this.emit("error",r)}catch(e){console.error(r)}return t.next=14,o(this._retryTimeout,!this._keepEventLoopActive);case 14:t.next=0;break;case 16:case"end":return t.stop()}}),t,this,[[1,8]])})));return function(){return t.apply(this,arguments)}}()},{key:"_updateLatestBlock",value:function(){var e=h(c.mark((function e(){var t;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._fetchLatestBlock();case 2:t=e.sent,this._newPotentialLatest(t);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_fetchLatestBlock",value:function(){var e=h(c.mark((function e(){var t,r,i=this;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={jsonrpc:"2.0",id:1,method:"eth_blockNumber",params:[]},this._setSkipCacheFlag&&(t.skipCache=!0),e.next=4,n((function(e){return i._provider.sendAsync(t,e)}))();case 4:if(!(r=e.sent).error){e.next=7;break}throw new Error("PollingBlockTracker - encountered error fetching block:\n".concat(r.error));case 7:return e.abrupt("return",r.result);case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),i}(i)},function(e,t,r){r(72),r(39);var l=r(40),d=function(e,t){return e+t},p=["sync","latest"];function b(e){return Number.parseInt(e,16)}e.exports=function(e){"use strict";f(r,e);var t=u(r);function r(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,r),(e=t.call(this))._blockResetDuration=i.blockResetDuration||2e4,e._blockResetTimeout,e._currentBlock=null,e._isRunning=!1,e._onNewListener=e._onNewListener.bind(n(e)),e._onRemoveListener=e._onRemoveListener.bind(n(e)),e._resetCurrentBlock=e._resetCurrentBlock.bind(n(e)),e._setupInternalEvents(),e}return s(r,[{key:"isRunning",value:function(){return this._isRunning}},{key:"getCurrentBlock",value:function(){return this._currentBlock}},{key:"getLatestBlock",value:function(){var e=h(c.mark((function e(){var t=this;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._currentBlock){e.next=2;break}return e.abrupt("return",this._currentBlock);case 2:return e.next=4,new Promise((function(e){return t.once("latest",e)}));case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"removeAllListeners",value:function(e){e?i(o(r.prototype),"removeAllListeners",this).call(this,e):i(o(r.prototype),"removeAllListeners",this).call(this),this._setupInternalEvents(),this._onRemoveListener()}},{key:"_start",value:function(){}},{key:"_end",value:function(){}},{key:"_setupInternalEvents",value:function(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}},{key:"_onNewListener",value:function(e,t){p.includes(e)&&this._maybeStart()}},{key:"_onRemoveListener",value:function(e,t){this._getBlockTrackerEventCount()>0||this._maybeEnd()}},{key:"_maybeStart",value:function(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),this._start())}},{key:"_maybeEnd",value:function(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),this._end())}},{key:"_getBlockTrackerEventCount",value:function(){var e=this;return p.map((function(t){return e.listenerCount(t)})).reduce(d)}},{key:"_newPotentialLatest",value:function(e){var t=this._currentBlock;t&&b(e)<=b(t)||this._setCurrentBlock(e)}},{key:"_setCurrentBlock",value:function(e){var t=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:t,newBlock:e})}},{key:"_setupBlockResetTimeout",value:function(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}},{key:"_cancelBlockResetTimeout",value:function(){clearTimeout(this._blockResetTimeout)}},{key:"_resetCurrentBlock",value:function(){this._currentBlock=null}}]),r}(l)},function(e,t){e.exports=function(e){var t=(e=e||{}).max||Number.MAX_SAFE_INTEGER,r=void 0!==e.start?e.start:Math.floor(Math.random()*t);return function(){return r%=t,r++}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(t,r,o){return e(n.default,t,(0,i.default)(r),o)}};var n=o(r(74)),i=o(r(12));function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},function(e,t,r){var n=r(41),i=r(78);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,r){var n=r(75),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[s]=r:delete e[s]),i}},function(e,t){var r=Object.prototype.toString;e.exports=function(e){return r.call(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,o){(0,n.default)(t)(e,(0,i.default)(r),o)};var n=o(r(81)),i=o(r(12));function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if((0,n.default)(e))return function(e){var t=-1,r=e.length;return function(){return++t-1&&e%1==0&&e="0"&&n<="9";)t+=n,f();if("."===n)for(t+=".";f()&&n>="0"&&n<="9";)t+=n;if("e"===n||"E"===n)for(t+=n,f(),"-"!==n&&"+"!==n||(t+=n,f());n>="0"&&n<="9";)t+=n,f();if(e=+t,isFinite(e))return e;s("Bad number")},c=function(){var e,t,r,i="";if('"'===n)for(;f();){if('"'===n)return f(),i;if("\\"===n)if(f(),"u"===n){for(r=0,t=0;t<4&&(e=parseInt(f(),16),isFinite(e));t+=1)r=16*r+e;i+=String.fromCharCode(r)}else{if("string"!=typeof a[n])break;i+=a[n]}else i+=n}s("Bad string")},h=function(){for(;n&&n<=" ";)f()};o=function(){switch(h(),n){case"{":return function(){var e,t={};if("{"===n){if(f("{"),h(),"}"===n)return f("}"),t;for(;n;){if(e=c(),h(),f(":"),Object.hasOwnProperty.call(t,e)&&s('Duplicate key "'+e+'"'),t[e]=o(),h(),"}"===n)return f("}"),t;f(","),h()}}s("Bad object")}();case"[":return function(){var e=[];if("["===n){if(f("["),h(),"]"===n)return f("]"),e;for(;n;){if(e.push(o()),h(),"]"===n)return f("]"),e;f(","),h()}}s("Bad array")}();case'"':return c();case"-":return u();default:return n>="0"&&n<="9"?u():function(){switch(n){case"t":return f("t"),f("r"),f("u"),f("e"),!0;case"f":return f("f"),f("a"),f("l"),f("s"),f("e"),!1;case"n":return f("n"),f("u"),f("l"),f("l"),null}s("Unexpected '"+n+"'")}()}},e.exports=function(e,t){var a;return i=e,r=0,n=" ",a=o(),h(),n&&s("Syntax error"),"function"==typeof t?function e(r,n){var i,o,a=r[n];if(a&&"object"==typeof a)for(i in a)Object.prototype.hasOwnProperty.call(a,i)&&(void 0!==(o=e(a,i))?a[i]=o:delete a[i]);return t.call(r,n,a)}({"":a},""):a}},function(e,t){var r,n,i,o=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function s(e){return o.lastIndex=0,o.test(e)?'"'+e.replace(o,(function(e){var t=a[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}e.exports=function(e,t,o){var a;if(r="",n="","number"==typeof o)for(a=0;a"];e.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.blockTracker;if(!t)throw new Error("createBlockCacheMiddleware - No BlockTracker specified");var r=new f,o={perma:r,block:r,fork:r};return i(function(){var e=h(c.mark((function e(i,a,s){var f,u,h,l,d,p;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!i.skipCache){e.next=2;break}return e.abrupt("return",s());case 2:if(f=n.cacheTypeForPayload(i),u=o[f]){e.next=5;break}return e.abrupt("return",s());case 5:if(u.canCacheRequest(i)){e.next=7;break}return e.abrupt("return",s());case 7:if((l=n.blockTagForPayload(i))||(l="latest"),"earliest"!==l){e.next=12;break}h="0x00",e.next=20;break;case 12:if("latest"!==l){e.next=19;break}return e.next=15,t.getLatestBlock();case 15:d=e.sent,r.clearBefore(d),h=d,e.next=20;break;case 19:h=l;case 20:return e.next=22,u.get(i,h);case 22:if(void 0!==(p=e.sent)){e.next=30;break}return e.next=26,s();case 26:return e.next=28,u.set(i,h,a.result);case 28:e.next=31;break;case 30:a.result=p;case 31:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}())};var f=function(){"use strict";function e(){a(this,e),this.cache={}}return s(e,[{key:"getBlockCacheForPayload",value:function(e,t){var r=Number.parseInt(t,16),n=this.cache[r];if(!n){var i={};this.cache[r]=i,n=i}return n}},{key:"get",value:function(){var e=h(c.mark((function e(t,r){var i;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(i=this.getBlockCacheForPayload(t,r))){e.next=3;break}return e.abrupt("return",i[n.cacheIdentifierForPayload(t,!0)]);case 3:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"set",value:function(){var e=h(c.mark((function e(t,r,i){return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.canCacheResult(t,i)&&(this.getBlockCacheForPayload(t,r)[n.cacheIdentifierForPayload(t,!0)]=i);case 1:case"end":return e.stop()}}),e,this)})));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"canCacheRequest",value:function(e){return!!n.canCache(e)&&"pending"!==n.blockTagForPayload(e)}},{key:"canCacheResult",value:function(e,t){if(!o.includes(t))return!!(!["eth_getTransactionByHash","eth_getTransactionReceipt"].includes(e.method)||t&&t.blockHash&&"0x0000000000000000000000000000000000000000000000000000000000000000"!==t.blockHash)}},{key:"clearBefore",value:function(e){var t=this,r=Number.parseInt(e,16);Object.keys(t.cache).map(Number).filter((function(e){return e=e.params.length?e.params:"eth_getBlockByNumber"===e.method?e.params.slice(1):e.params.slice(0,t)}function a(e){switch(e.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":return 1;case"eth_getBlockByNumber":return 0;default:return}}function s(e){switch(e.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":case"test_permaCache":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":case"test_forkCache":return"fork";case"eth_gasPrice":case"eth_blockNumber":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"test_blockCache":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":case"test_neverCache":return"never"}}e.exports={cacheIdentifierForPayload:function(e,t){var r=t?o(e):e.params;return i(e)?e.method+":"+n(r):null},canCache:i,blockTagForPayload:function(e){var t=a(e);return t>=e.params.length?null:e.params[t]},paramsWithoutBlockTag:o,blockTagParamIndex:a,cacheTypeForPayload:s}},function(e,t,r){"use strict";var n=r(204),i=r(205);e.exports=function(e){if(!n(e.then))throw new TypeError("Expected a promise");return function(t){e.then((function(e){i(t,null,e)}),(function(e){i(t,e)}))}}},function(e,t,r){"use strict";var n=Object.prototype.toString;e.exports=function(e){return"[object Function]"===n.call(e)}},function(e,t,r){"use strict";(function(t){e.exports="function"==typeof t?t:function(){var e=[].slice.apply(arguments);e.splice(1,0,0),setTimeout.apply(null,e)}}).call(this,r(26).setImmediate)},function(e,t,r){"use strict";(function(e,r){var n=function(){function t(e){a(this,t),this.tasks=[],this.count=e}return s(t,[{key:"sched",value:function(){if(this.count>0&&this.tasks.length>0){this.count--;var e=this.tasks.shift();if(void 0===e)throw"Unexpected undefined value in tasks list";e()}}},{key:"acquire",value:function(){var t=this;return new Promise((function(n,i){t.tasks.push((function(){var e=!1;n((function(){e||(e=!0,t.count++,t.sched())}))})),e&&e.nextTick?e.nextTick(t.sched.bind(t)):r(t.sched.bind(t))}))}},{key:"use",value:function(e){return this.acquire().then((function(t){return e().then((function(e){return t(),e})).catch((function(e){throw t(),e}))}))}}]),t}();t.Semaphore=n,t.Mutex=function(e){f(r,e);var t=u(r);function r(){return a(this,r),t.call(this,1)}return r}(n)}).call(this,r(9),r(26).setImmediate)},function(e,t){e.exports=function(e){return function(t,r,n,i){var o=e[t.method];return void 0===o?n():"function"==typeof o?o(t,r,n,i):(r.result=o,void i())}}},function(e,t,r){var n=r(72),i=r(39),o=r(209),l=r(20),d=(l.bnToHex,l.hexToInt),p=l.incrementHexInt,b=l.minBlockRef,y=l.blockRefIsNumber;e.exports=function(e){"use strict";f(r,e);var t=u(r);function r(e){var i,o=e.provider,s=e.params;return a(this,r),(i=t.call(this)).type="log",i.ethQuery=new n(o),i.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},s),i.params.address&&(Array.isArray(i.params.address)||(i.params.address=[i.params.address]),i.params.address=i.params.address.map((function(e){return e.toLowerCase()}))),i}return s(r,[{key:"initialize",value:function(){var e=h(c.mark((function e(t){var r,n,i,o,a;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.currentBlock,n=this.params.fromBlock,["latest","pending"].includes(n)&&(n=r),"earliest"===n&&(n="0x0"),this.params.fromBlock=n,i=b(this.params.toBlock,r),o=Object.assign({},this.params,{toBlock:i}),e.next=7,this._fetchLogs(o);case 7:a=e.sent,this.addInitialResults(a);case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"update",value:function(){var e=h(c.mark((function e(t){var r,n,i,o,a,s,f=this;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.oldBlock,n=t.newBlock,i=n,o=r?p(r):n,a=Object.assign({},this.params,{fromBlock:o,toBlock:i}),e.next=6,this._fetchLogs(a);case 6:s=e.sent.filter((function(e){return f.matchLog(e)})),this.addResults(s);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_fetchLogs",value:function(){var e=h(c.mark((function e(t){var r=this;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i((function(e){return r.ethQuery.getLogs(t,e)}))();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"matchLog",value:function(e){if(d(this.params.fromBlock)>=d(e.blockNumber))return!1;if(y(this.params.toBlock)&&d(this.params.toBlock)<=d(e.blockNumber))return!1;var t=e.address&&e.address.toLowerCase();return!(this.params.address&&t&&!this.params.address.includes(t))&&this.params.topics.every((function(t,r){var n=e.topics[r];if(!n)return!1;n=n.toLowerCase();var i=Array.isArray(t)?t:[t];return!!i.includes(null)||(i=i.map((function(e){return e.toLowerCase()}))).includes(n)}))}}]),r}(o)},function(e,t,r){var n=r(47);e.exports=function(e){"use strict";f(r,e);var t=u(r);function r(){var e;return a(this,r),(e=t.call(this)).allResults=[],e}return s(r,[{key:"update",value:function(){var e=h(c.mark((function e(){return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("BaseFilterWithHistory - no update method specified");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"addResults",value:function(e){this.allResults=this.allResults.concat(e),i(o(r.prototype),"addResults",this).call(this,e)}},{key:"addInitialResults",value:function(e){this.allResults=this.allResults.concat(e),i(o(r.prototype),"addInitialResults",this).call(this,e)}},{key:"getAllResults",value:function(){return this.allResults}}]),r}(n)},function(e,t,r){var n=r(47),i=r(48),o=r(20).incrementHexInt;e.exports=function(e){"use strict";f(r,e);var t=u(r);function r(e){var n,i=e.provider;return e.params,a(this,r),(n=t.call(this)).type="block",n.provider=i,n}return s(r,[{key:"update",value:function(){var e=h(c.mark((function e(t){var r,n,a,s,f;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.oldBlock,n=t.newBlock,a=n,s=o(r),e.next=5,i({provider:this.provider,fromBlock:s,toBlock:a});case 5:f=e.sent.map((function(e){return e.hash})),this.addResults(f);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),r}(n)},function(e,t,r){var n=r(212),i=r(47),o=r(48),l=r(20).incrementHexInt;e.exports=function(e){"use strict";f(r,e);var t=u(r);function r(e){var n,i=e.provider;return e.params,a(this,r),(n=t.call(this)).type="tx",n.provider=i,n}return s(r,[{key:"update",value:function(){var e=h(c.mark((function e(t){var r,i,a,s,f;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.oldBlock,t.newBlock,i=r,a=l(r),e.next=5,o({provider:this.provider,fromBlock:a,toBlock:i});case 5:s=e.sent,f=n(s,(function(e){return e.transactions})),this.addResults(f);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),r}(i)},function(e,t,r){(function(e,r){var n="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",a="[object Array]",s="[object Boolean]",f="[object Date]",u="[object Error]",c="[object Function]",h="[object Map]",l="[object Number]",d="[object Object]",p="[object RegExp]",b="[object Set]",y="[object String]",v="[object Symbol]",g="[object ArrayBuffer]",m="[object DataView]",_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,w=/^\w*$/,E=/^\./,k=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,A=/\\(\\)?/g,S=/^\[object .+?Constructor\]$/,x=/^(?:0|[1-9]\d*)$/,I={};I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I[o]=I[a]=I[g]=I[s]=I[m]=I[f]=I[u]=I[c]=I[h]=I[l]=I[d]=I[p]=I[b]=I[y]=I["[object WeakMap]"]=!1;var M="object"==typeof e&&e&&e.Object===Object&&e,T="object"==typeof self&&self&&self.Object===Object&&self,P=M||T||Function("return this")(),B=t&&!t.nodeType&&t,L=B&&"object"==typeof r&&r&&!r.nodeType&&r,R=L&&L.exports===B&&M.process,O=function(){try{return R&&R.binding("util")}catch(e){}}(),C=O&&O.isTypedArray;function N(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r-1},we.prototype.set=function(e,t){var r=this.__data__,n=Se(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},Ee.prototype.clear=function(){this.__data__={hash:new _e,map:new(se||we),string:new _e}},Ee.prototype.delete=function(e){return Ce(this,e).delete(e)},Ee.prototype.get=function(e){return Ce(this,e).get(e)},Ee.prototype.has=function(e){return Ce(this,e).has(e)},Ee.prototype.set=function(e,t){return Ce(this,e).set(e,t),this},ke.prototype.add=ke.prototype.push=function(e){return this.__data__.set(e,n),this},ke.prototype.has=function(e){return this.__data__.has(e)},Ae.prototype.clear=function(){this.__data__=new we},Ae.prototype.delete=function(e){return this.__data__.delete(e)},Ae.prototype.get=function(e){return this.__data__.get(e)},Ae.prototype.has=function(e){return this.__data__.has(e)},Ae.prototype.set=function(e,t){var r=this.__data__;if(r instanceof we){var n=r.__data__;if(!se||n.length<199)return n.push([e,t]),this;r=this.__data__=new Ee(n)}return r.set(e,t),this};var xe,Ie=(xe=function(e,t){return e&&Me(e,t,nt)},function(e,t){if(null==e)return e;if(!Ze(e))return xe(e,t);for(var r=e.length,n=-1,i=Object(e);++ns))return!1;var u=o.get(e);if(u&&o.get(t))return u==t;var c=-1,h=!0,l=1&i?new ke:void 0;for(o.set(e,t),o.set(t,e);++c-1&&e%1==0&&e-1&&e%1==0&&e<=i}function Qe(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function et(e){return!!e&&"object"==typeof e}function tt(e){return"symbol"==typeof e||et(e)&&X.call(e)==v}var rt=C?function(e){return function(t){return e(t)}}(C):function(e){return et(e)&&Xe(e.length)&&!!I[X.call(e)]};function nt(e){return Ze(e)?function(e,t){var r=We(e)||$e(e)?function(e,t){for(var r=-1,n=Array(e);++r0&&n(f)?r>1?e(f,r-1,n,i,o):j(o,f):i||(o[o.length]=f)}return o}(function(e,t){return(We(e)?N:Le)(e,function(e){return"function"==typeof e?e:null==e?it:"object"==typeof e?We(e)?function(e,t){return Ue(e)&&Fe(t)?ze(He(e),t):function(r){var n=function(e,t,r){var n=null==e?void 0:Te(e,t);return void 0===n?void 0:n}(r,e);return void 0===n&&n===t?function(e,t){return null!=e&&function(e,t,r){for(var n,i=-1,o=(t=Ue(t,e)?[t]:Re(t)).length;++i2&&(n=(0,o.default)(arguments,1)),s[t]=n,r(e)}))}),(function(e){r(e,s)}))};var n=s(r(18)),i=s(r(30)),o=s(r(31)),a=s(r(12));function s(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},function(e,t,r){var n=r(15),i=r(217);function o(e){var t=new Error("Expect argument to be non-empty array");if("object"!=typeof e||!e.length)throw t;var r=e.map((function(e){return"bytes"===e.type?n.toBuffer(e.value):e.value})),o=e.map((function(e){return e.type})),a=e.map((function(e){if(!e.name)throw t;return e.type+" "+e.name}));return i.soliditySHA3(["bytes32","bytes32"],[i.soliditySHA3(new Array(e.length).fill("string"),a),i.soliditySHA3(o,r)])}function a(e,t){var r=n.toBuffer(t),i=n.fromRpcSig(r);return n.ecrecover(e,i.v,i.r,i.s)}function s(e){var t=n.toBuffer(e.data);return a(n.hashPersonalMessage(t),e.sig)}function f(e,t){for(var r=""+e;r.lengtho)throw new Error("Elements exceed array size: "+o);for(d in h=[],e=e.slice(0,e.lastIndexOf("[")),"string"==typeof r&&(r=JSON.parse(r)),r)h.push(l(e,r[d]));if("dynamic"===o){var p=l("uint256",r.length);h.unshift(p)}return t.concat(h)}if("bytes"===e)return r=t.from(r),h=t.concat([l("uint256",r.length),r]),r.length%32!=0&&(h=t.concat([h,n.zeros(32-r.length%32)])),h;if(e.startsWith("bytes")){if((o=s(e))<1||o>32)throw new Error("Invalid bytes width: "+o);return n.setLengthRight(r,32)}if(e.startsWith("uint")){if((o=s(e))%8||o<8||o>256)throw new Error("Invalid uint width: "+o);if((a=c(r)).bitLength()>o)throw new Error("Supplied uint exceeds width: "+o+" vs "+a.bitLength());if(a<0)throw new Error("Supplied uint is negative");return a.toArrayLike(t,"be",32)}if(e.startsWith("int")){if((o=s(e))%8||o<8||o>256)throw new Error("Invalid int width: "+o);if((a=c(r)).bitLength()>o)throw new Error("Supplied int exceeds width: "+o+" vs "+a.bitLength());return a.toTwos(256).toArrayLike(t,"be",32)}if(e.startsWith("ufixed")){if(o=f(e),(a=c(r))<0)throw new Error("Supplied ufixed is negative");return l("uint256",a.mul(new i(2).pow(new i(o[1]))))}if(e.startsWith("fixed"))return o=f(e),l("int256",c(r).mul(new i(2).pow(new i(o[1]))));throw new Error("Unsupported or invalid type: "+e)}function d(e,r,n){var o,a,s,f;if("string"==typeof e&&(e=p(e)),"address"===e.name)return d(e.rawType,r,n).toArrayLike(t,"be",20).toString("hex");if("bool"===e.name)return d(e.rawType,r,n).toString()===new i(1).toString();if("string"===e.name){var u=d(e.rawType,r,n);return t.from(u,"utf8").toString()}if(e.isArray){for(s=[],o=e.size,"dynamic"===e.size&&(n=d("uint256",r,n).toNumber(),o=d("uint256",r,n).toNumber(),n+=32),f=0;fe.size)throw new Error("Decoded int exceeds width: "+e.size+" vs "+a.bitLength());return a}if(e.name.startsWith("int")){if((a=new i(r.slice(n,n+32),16,"be").fromTwos(256)).bitLength()>e.size)throw new Error("Decoded uint exceeds width: "+e.size+" vs "+a.bitLength());return a}if(e.name.startsWith("ufixed")){if(o=new i(2).pow(new i(e.size[1])),!(a=d("uint256",r,n)).mod(o).isZero())throw new Error("Decimals not supported yet");return a.div(o)}if(e.name.startsWith("fixed")){if(o=new i(2).pow(new i(e.size[1])),!(a=d("int256",r,n)).mod(o).isZero())throw new Error("Decimals not supported yet");return a.div(o)}throw new Error("Unsupported or invalid type: "+e.name)}function p(e){var t,r,n;if(y(e)){t=u(e);var i=e.slice(0,e.lastIndexOf("["));return i=p(i),{isArray:!0,name:e,size:t,memoryUsage:"dynamic"===t?32:i.memoryUsage*t,subArray:i}}switch(e){case"address":n="uint160";break;case"bool":n="uint8";break;case"string":n="bytes"}if(r={rawType:n,name:e,memoryUsage:32},e.startsWith("bytes")&&"bytes"!==e||e.startsWith("uint")||e.startsWith("int")?r.size=s(e):(e.startsWith("ufixed")||e.startsWith("fixed"))&&(r.size=f(e)),e.startsWith("bytes")&&"bytes"!==e&&(r.size<1||r.size>32))throw new Error("Invalid bytes width: "+r.size);if((e.startsWith("uint")||e.startsWith("int"))&&(r.size%8||r.size<8||r.size>256))throw new Error("Invalid int/uint width: "+r.size);return r}function b(e){return"string"===e||"bytes"===e||"dynamic"===u(e)}function y(e){return e.lastIndexOf("]")===e.length-1}function v(e,t){return e.startsWith("address")||e.startsWith("bytes")?"0x"+t.toString("hex"):t.toString()}o.eventID=function(e,r){var i=e+"("+r.map(a).join(",")+")";return n.keccak256(t.from(i))},o.methodID=function(e,t){return o.eventID(e,t).slice(0,4)},o.rawEncode=function(e,r){var n=[],i=[],o=0;e.forEach((function(e){if(y(e)){var t=u(e);o+="dynamic"!==t?32*t:32}else o+=32}));for(var s=0;sl)throw new Error("Elements exceed array size: "+l)}var d=r.map((function(e){return o.solidityHexValue(h,e,256)}));return t.concat(d)}if("bytes"===e)return r;if("string"===e)return t.from(r,"utf8");if("bool"===e){i=i||8;var p=Array(i/4).join("0");return t.from(r?p+"1":p+"0","hex")}if("address"===e){var b=20;return i&&(b=i/8),n.setLengthLeft(r,b)}if(e.startsWith("bytes")){if((a=s(e))<1||a>32)throw new Error("Invalid bytes width: "+a);return n.setLengthRight(r,a)}if(e.startsWith("uint")){if((a=s(e))%8||a<8||a>256)throw new Error("Invalid uint width: "+a);if((f=c(r)).bitLength()>a)throw new Error("Supplied uint exceeds width: "+a+" vs "+f.bitLength());return i=i||a,f.toArrayLike(t,"be",i/8)}if(e.startsWith("int")){if((a=s(e))%8||a<8||a>256)throw new Error("Invalid int width: "+a);if((f=c(r)).bitLength()>a)throw new Error("Supplied int exceeds width: "+a+" vs "+f.bitLength());return i=i||a,f.toTwos(a).toArrayLike(t,"be",i/8)}throw new Error("Unsupported or invalid type: "+e)},o.solidityPack=function(e,r){if(e.length!==r.length)throw new Error("Number of types are not matching the values");for(var n=[],i=0;i="0"&&t<="9";)o+=e[a]-"0",a++;n=a-1,r.push(o)}else if("i"===i)r.push("int256");else{if("a"!==i)throw new Error("Unsupported or invalid type: "+i);r.push("int256[]")}}return r},o.toSerpent=function(e){for(var t=[],r=0;r0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e},t.stripZeros=t.unpad,t.toBuffer=function(e){if(!u.isBuffer(e))if(Array.isArray(e))e=u.from(e);else if("string"==typeof e)e=t.isHexString(e)?u.from(t.padToEven(t.stripHexPrefix(e)),"hex"):u.from(e);else if("number"==typeof e)e=t.intToBuffer(e);else if(null==e)e=u.allocUnsafe(0);else if(n.isBN(e))e=e.toArrayLike(u);else{if(!e.toArray)throw new Error("invalid type");e=u.from(e.toArray())}return e},t.bufferToInt=function(e){return new n(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new n(e).fromTwos(256)},t.toUnsigned=function(e){return u.from(e.toTwos(256).toArray())},t.keccak=function(e,r){return void 0===r&&(r=256),e=t.toBuffer(e),r||(r=256),o("keccak"+r).update(e).digest()},t.keccak256=function(e){return t.keccak(e)},t.sha256=function(e){return e=t.toBuffer(e),f("sha256").update(e).digest()},t.ripemd160=function(e,r){e=t.toBuffer(e);var n=f("rmd160").update(e).digest();return!0===r?t.setLength(n,32):n},t.rlphash=function(e){return t.keccak(i.encode(e))},t.isValidPrivate=function(e){return a.privateKeyVerify(e)},t.isValidPublic=function(e,t){return void 0===t&&(t=!1),64===e.length?a.publicKeyVerify(u.concat([u.from([4]),e])):!!t&&a.publicKeyVerify(e)},t.pubToAddress=function(e,r){return void 0===r&&(r=!1),e=t.toBuffer(e),r&&64!==e.length&&(e=a.publicKeyConvert(e,!1).slice(1)),s(64===e.length),t.keccak(e).slice(-20)},t.publicToAddress=t.pubToAddress,t.privateToPublic=function(e){return e=t.toBuffer(e),a.publicKeyCreate(e,!1).slice(1)},t.importPublic=function(e){return 64!==(e=t.toBuffer(e)).length&&(e=a.publicKeyConvert(e,!1).slice(1)),e},t.ecsign=function(e,t,r){var n=a.sign(e,t),i=n.recovery;return{r:n.signature.slice(0,32),s:n.signature.slice(32,64),v:r?i+(2*r+35):i+27}},t.hashPersonalMessage=function(e){var r=t.toBuffer("\x19Ethereum Signed Message:\n"+e.length.toString());return t.keccak(u.concat([r,e]))},t.ecrecover=function(e,r,n,i,o){var s=u.concat([t.setLength(n,32),t.setLength(i,32)],64),f=h(r,o);if(!l(f))throw new Error("Invalid signature v value");var c=a.recover(e,s,f);return a.publicKeyConvert(c,!1).slice(1)},t.toRpcSig=function(e,r,n,i){if(!l(h(e,i)))throw new Error("Invalid signature v value");return t.bufferToHex(u.concat([t.setLengthLeft(r,32),t.setLengthLeft(n,32),t.toBuffer(e)]))},t.fromRpcSig=function(e){var r=t.toBuffer(e);if(65!==r.length)throw new Error("Invalid signature length");var n=r[64];return n<27&&(n+=27),{v:n,r:r.slice(0,32),s:r.slice(32,64)}},t.privateToAddress=function(e){return t.publicToAddress(t.privateToPublic(e))},t.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)},t.isZeroAddress=function(e){return t.zeroAddress()===t.addHexPrefix(e)},t.toChecksumAddress=function(e){e=c.stripHexPrefix(e).toLowerCase();for(var r=t.keccak(e).toString("hex"),n="0x",i=0;i=8?n+=e[i].toUpperCase():n+=e[i];return n},t.isValidChecksumAddress=function(e){return t.isValidAddress(e)&&t.toChecksumAddress(e)===e},t.generateAddress=function(e,r){e=t.toBuffer(e);var i=new n(r);return i.isZero()?t.rlphash([e,null]).slice(-20):t.rlphash([e,u.from(i.toArray())]).slice(-20)},t.generateAddress2=function(e,r,n){var i=t.toBuffer(e),o=t.toBuffer(r),a=t.toBuffer(n);return s(20===i.length),s(32===o.length),t.keccak256(u.concat([u.from("ff","hex"),i,o,t.keccak256(a)])).slice(-20)},t.isPrecompiled=function(e){var r=t.unpad(e);return 1===r.length&&r[0]>=1&&r[0]<=8},t.addHexPrefix=function(e){return"string"!=typeof e||c.isHexPrefixed(e)?e:"0x"+e},t.isValidSignature=function(e,t,r,i,o){void 0===i&&(i=!0);var a=new n("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),s=new n("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==r.length)return!1;if(!l(h(e,o)))return!1;var f=new n(t),u=new n(r);return!(f.isZero()||f.gt(s)||u.isZero()||u.gt(s))&&(!i||1!==u.cmp(a))},t.baToJSON=function(e){if(u.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var r=[],n=0;n=i.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===i.length||!r.length||s(r.length===i.length,"The field "+r.name+" must have byte length of "+r.length),e.raw[n]=i}e._fields.push(r.name),Object.defineProperty(e,r.name,{enumerable:!0,configurable:!0,get:i,set:o}),r.default&&(e[r.name]=r.default),r.alias&&Object.defineProperty(e,r.alias,{enumerable:!1,configurable:!0,set:o,get:i})})),n)if("string"==typeof n&&(n=u.from(c.stripHexPrefix(n),"hex")),u.isBuffer(n)&&(n=i.decode(n)),Array.isArray(n)){if(n.length>e._fields.length)throw new Error("wrong number of fields in data");n.forEach((function(r,n){e[e._fields[n]]=t.toBuffer(r)}))}else{if("object"!=typeof n)throw new Error("invalid data");var o=Object.keys(n);r.forEach((function(t){-1!==o.indexOf(t.name)&&(e[t.name]=n[t.name]),-1!==o.indexOf(t.alias)&&(e[t.alias]=n[t.alias])}))}}},function(e,t,r){(function(t){!function(r){"use strict";var n=function(e){setTimeout(e,0)};void 0!==t&&t&&"function"==typeof t.nextTick&&(n=t.nextTick),e.exports=function(e){var t={capacity:e||1,current:0,queue:[],firstHere:!1,take:function(){if(!1===t.firstHere){t.current++,t.firstHere=!0;var e=1}else e=0;var r={n:1};"function"==typeof arguments[0]?r.task=arguments[0]:r.n=arguments[0],arguments.length>=2&&("function"==typeof arguments[1]?r.task=arguments[1]:r.n=arguments[1]);var n=r.task;if(r.task=function(){n(t.leave)},t.current+r.n-e>t.capacity)return 1===e&&(t.current--,t.firstHere=!1),t.queue.push(r);t.current+=r.n-e,r.task(t.leave),1===e&&(t.firstHere=!1)},leave:function(e){if(e=e||1,t.current-=e,t.queue.length){var r=t.queue[0];r.n+t.current>t.capacity||(t.queue.shift(),t.current+=r.n,n(r.task))}else if(t.current<0)throw new Error("leave called too many times.")},available:function(e){return e=e||1,t.current+e<=t.capacity}};return t}}()}).call(this,r(9))},function(e,t,r){"use strict";var n=r(19);e.exports=function(e,t,r){e.sendAsync(n({method:"eth_estimateGas",params:[t]}),(function(e,t){if(e)return"no contract code at given address"===e.message?r(null,"0xcf08"):r(e);r(null,t.result)}))}},function(e,t,r){"use strict";(function(t){var n=r(15),i=r(223),o=n.BN,a=new o("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),s=function(){function e(r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r=r||{};var i=[{name:"nonce",length:32,allowLess:!0,default:new t([])},{name:"gasPrice",length:32,allowLess:!0,default:new t([])},{name:"gasLimit",alias:"gas",length:32,allowLess:!0,default:new t([])},{name:"to",allowZero:!0,length:20,default:new t([])},{name:"value",length:32,allowLess:!0,default:new t([])},{name:"data",alias:"input",allowZero:!0,default:new t([])},{name:"v",allowZero:!0,default:new t([28])},{name:"r",length:32,allowZero:!0,allowLess:!0,default:new t([])},{name:"s",length:32,allowZero:!0,allowLess:!0,default:new t([])}];n.defineProperties(this,i,r),Object.defineProperty(this,"from",{enumerable:!0,configurable:!0,get:this.getSenderAddress.bind(this)});var o=n.bufferToInt(this.v),a=Math.floor((o-35)/2);a<0&&(a=0),this._chainId=a||r.chainId||0,this._homestead=!0}return e.prototype.toCreationAddress=function(){return""===this.to.toString("hex")},e.prototype.hash=function(e){void 0===e&&(e=!0);var t=void 0;if(e)t=this.raw;else if(this._chainId>0){var r=this.raw.slice();this.v=this._chainId,this.r=0,this.s=0,t=this.raw,this.raw=r}else t=this.raw.slice(0,6);return n.rlphash(t)},e.prototype.getChainId=function(){return this._chainId},e.prototype.getSenderAddress=function(){if(this._from)return this._from;var e=this.getSenderPublicKey();return this._from=n.publicToAddress(e),this._from},e.prototype.getSenderPublicKey=function(){if(!(this._senderPubKey&&this._senderPubKey.length||this.verifySignature()))throw new Error("Invalid Signature");return this._senderPubKey},e.prototype.verifySignature=function(){var e=this.hash(!1);if(this._homestead&&1===new o(this.s).cmp(a))return!1;try{var t=n.bufferToInt(this.v);this._chainId>0&&(t-=2*this._chainId+8),this._senderPubKey=n.ecrecover(e,t,this.r,this.s)}catch(e){return!1}return!!this._senderPubKey},e.prototype.sign=function(e){var t=this.hash(!1),r=n.ecsign(t,e);this._chainId>0&&(r.v+=2*this._chainId+8),Object.assign(this,r)},e.prototype.getDataFee=function(){for(var e=this.raw[5],t=new o(0),r=0;r0&&t.push(["gas limit is too low. Need at least "+this.getBaseFee()]),void 0===e||!1===e?0===t.length:t.join(" ")},e}();e.exports=s}).call(this,r(7).Buffer)},function(e){e.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(e,t,r){"use strict";var n=r(225),i=r(226),o=r(227),a=r(29);function s(e,t,r){var n=e;return i(t)?(r=t,"string"==typeof e&&(n={uri:e})):n=a(t,{uri:e}),n.callback=r,n}function f(e,t,r){return u(t=s(e,t,r))}function u(e){if(void 0===e.callback)throw new Error("callback argument missing");var t=!1,r=function(r,n,i){t||(t=!0,e.callback(r,n,i))};function n(){var e=void 0;if(e=c.response?c.response:c.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(c),v)try{e=JSON.parse(e)}catch(e){}return e}function i(e){return clearTimeout(h),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,r(e,g)}function a(){if(!u){var t;clearTimeout(h),t=e.useXDR&&void 0===c.status?200:1223===c.status?204:c.status;var i=g,a=null;return 0!==t?(i={body:n(),statusCode:t,method:d,headers:{},url:l,rawRequest:c},c.getAllResponseHeaders&&(i.headers=o(c.getAllResponseHeaders()))):a=new Error("Internal XMLHttpRequest Error"),r(a,i,i.body)}}var s,u,c=e.xhr||null;c||(c=e.cors||e.useXDR?new f.XDomainRequest:new f.XMLHttpRequest);var h,l=c.url=e.uri||e.url,d=c.method=e.method||"GET",p=e.body||e.data,b=c.headers=e.headers||{},y=!!e.sync,v=!1,g={body:void 0,headers:{},statusCode:0,method:d,url:l,rawRequest:c};if("json"in e&&!1!==e.json&&(v=!0,b.accept||b.Accept||(b.Accept="application/json"),"GET"!==d&&"HEAD"!==d&&(b["content-type"]||b["Content-Type"]||(b["Content-Type"]="application/json"),p=JSON.stringify(!0===e.json?p:e.json))),c.onreadystatechange=function(){4===c.readyState&&setTimeout(a,0)},c.onload=a,c.onerror=i,c.onprogress=function(){},c.onabort=function(){u=!0},c.ontimeout=i,c.open(d,l,!y,e.username,e.password),y||(c.withCredentials=!!e.withCredentials),!y&&e.timeout>0&&(h=setTimeout((function(){if(!u){u=!0,c.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",i(e)}}),e.timeout)),c.setRequestHeader)for(s in b)b.hasOwnProperty(s)&&c.setRequestHeader(s,b[s]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(c.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(c),c.send(p||null),c}e.exports=f,e.exports.default=f,f.XMLHttpRequest=n.XMLHttpRequest||function(){},f.XDomainRequest="withCredentials"in new f.XMLHttpRequest?f.XMLHttpRequest:n.XDomainRequest,function(e,t){for(var r=0;r0&&!i.call(e,0))for(var b=0;b0)for(var y=0;y>0},ToUint32:function(e){return this.ToNumber(e)>>>0},ToUint16:function(e){var t=this.ToNumber(e);if(b(t)||0===t||!y(t))return 0;var r=v(t)*Math.floor(Math.abs(t));return g(r,65536)},ToString:function(e){return s(e)},ToObject:function(e){return this.CheckObjectCoercible(e),i(e)},CheckObjectCoercible:function(e,t){if(null==e)throw new a(t||"Cannot call method on "+e);return e},IsCallable:w,SameValue:function(e,t){return e===t?0!==e||1/e==1/t:b(e)&&b(t)},Type:function(e){return null===e?"Null":void 0===e?"Undefined":"function"==typeof e||"object"==typeof e?"Object":"number"==typeof e?"Number":"boolean"==typeof e?"Boolean":"string"==typeof e?"String":void 0},IsPropertyDescriptor:function(e){return p(this,e)},IsAccessorDescriptor:function(e){return void 0!==e&&(d(this,"Property Descriptor","Desc",e),!(!k(e,"[[Get]]")&&!k(e,"[[Set]]")))},IsDataDescriptor:function(e){return void 0!==e&&(d(this,"Property Descriptor","Desc",e),!(!k(e,"[[Value]]")&&!k(e,"[[Writable]]")))},IsGenericDescriptor:function(e){return void 0!==e&&(d(this,"Property Descriptor","Desc",e),!this.IsAccessorDescriptor(e)&&!this.IsDataDescriptor(e))},FromPropertyDescriptor:function(e){if(void 0===e)return e;if(d(this,"Property Descriptor","Desc",e),this.IsDataDescriptor(e))return{value:e["[[Value]]"],writable:!!e["[[Writable]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]};if(this.IsAccessorDescriptor(e))return{get:e["[[Get]]"],set:e["[[Set]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]};throw new a("FromPropertyDescriptor must be called with a fully populated Property Descriptor")},ToPropertyDescriptor:function(e){if("Object"!==this.Type(e))throw new a("ToPropertyDescriptor requires an object");var t={};if(k(e,"enumerable")&&(t["[[Enumerable]]"]=this.ToBoolean(e.enumerable)),k(e,"configurable")&&(t["[[Configurable]]"]=this.ToBoolean(e.configurable)),k(e,"value")&&(t["[[Value]]"]=e.value),k(e,"writable")&&(t["[[Writable]]"]=this.ToBoolean(e.writable)),k(e,"get")){var r=e.get;if(void 0!==r&&!this.IsCallable(r))throw new TypeError("getter must be a function");t["[[Get]]"]=r}if(k(e,"set")){var n=e.set;if(void 0!==n&&!this.IsCallable(n))throw new a("setter must be a function");t["[[Set]]"]=n}if((k(t,"[[Get]]")||k(t,"[[Set]]"))&&(k(t,"[[Value]]")||k(t,"[[Writable]]")))throw new a("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t},"Abstract Equality Comparison":function(e,t){var r=this.Type(e),n=this.Type(t);return r===n?e===t:null==e&&null==t||("Number"===r&&"String"===n?this["Abstract Equality Comparison"](e,this.ToNumber(t)):"String"===r&&"Number"===n||"Boolean"===r?this["Abstract Equality Comparison"](this.ToNumber(e),t):"Boolean"===n?this["Abstract Equality Comparison"](e,this.ToNumber(t)):"String"!==r&&"Number"!==r||"Object"!==n?"Object"===r&&("String"===n||"Number"===n)&&this["Abstract Equality Comparison"](this.ToPrimitive(e),t):this["Abstract Equality Comparison"](e,this.ToPrimitive(t)))},"Strict Equality Comparison":function(e,t){var r=this.Type(e);return r===this.Type(t)&&("Undefined"===r||"Null"===r||e===t)},"Abstract Relational Comparison":function(e,t,r){if("Boolean"!==this.Type(r))throw new a("Assertion failed: LeftFirst argument must be a Boolean");var n,i;if(r?(n=this.ToPrimitive(e,u),i=this.ToPrimitive(t,u)):(i=this.ToPrimitive(t,u),n=this.ToPrimitive(e,u)),"String"!==this.Type(n)||"String"!==this.Type(i)){var o=this.ToNumber(n),s=this.ToNumber(i);if(b(o)||b(s))return;return(!y(o)||!y(s)||o!==s)&&(0!==o||0!==s)&&o!==1/0&&(s===1/0||s!==-1/0&&(o===-1/0||o864e13?NaN:u(new f(this.ToNumber(e)))},modulo:function(e,t){return g(e,t)}};e.exports=S},function(e,t,r){"use strict";(function(t){var n=t.Symbol,i=r(234);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}}).call(this,r(4))},function(e,t,r){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},function(e,t,r){"use strict";var n=r(22),i=n("%TypeError%"),o=n("%SyntaxError%"),a=r(49),s={"Property Descriptor":function(e,t){if("Object"!==e.Type(t))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in t)if(a(t,n)&&!r[n])return!1;var o=a(t,"[[Value]]"),s=a(t,"[[Get]]")||a(t,"[[Set]]");if(o&&s)throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}};e.exports=function(e,t,r,n){var a=s[t];if("function"!=typeof a)throw new o("unknown record type: "+t);if(!a(e,n))throw new i(r+" must be a "+t)}},function(e,t,r){"use strict";var n=r(22),i=r(49),o=n("%TypeError%");e.exports=function(e,t){if("Object"!==e.Type(t))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in t)if(i(t,n)&&!r[n])return!1;if(e.IsDataDescriptor(t)&&e.IsAccessorDescriptor(t))throw new o("Property Descriptors may not be both accessor and data descriptors");return!0}},function(e,t,r){"use strict";e.exports=Number.isNaN||function(e){return e!=e}},function(e,t,r){"use strict";var n=Number.isNaN||function(e){return e!=e};e.exports=Number.isFinite||function(e){return"number"==typeof e&&!n(e)&&e!==1/0&&e!==-1/0}},function(e,t,r){"use strict";e.exports=function(e){return e>=0?1:-1}},function(e,t,r){"use strict";e.exports=function(e,t){var r=e%t;return Math.floor(r>=0?r:r+t)}},function(e,t,r){"use strict";var n=r(91)("String.prototype.slice");e.exports=function(e,t){return e===t||!(e.length>t.length)&&n(t,0,e.length)===e}},function(e,t,r){"use strict";var n=r(21),i=r(22)("%Function%"),o=i.apply,a=i.call;e.exports=function(){return n.apply(a,arguments)},e.exports.apply=function(){return n.apply(o,arguments)}},function(e,t,r){"use strict";var n=Object.prototype.toString,i=r(244),o=r(50),a=function(e){var t;if((t=arguments.length>1?arguments[1]:"[object Date]"===n.call(e)?String:Number)===String||t===Number){var r,a,s=t===String?["toString","valueOf"]:["valueOf","toString"];for(a=0;a1?a(e,arguments[1]):a(e)}},function(e,t){e.exports=function(e){return null===e||"function"!=typeof e&&"object"!=typeof e}},function(e,t,r){"use strict";var n=r(88),i=r(92);e.exports=function(){var e=i();return n(String.prototype,{trim:e},{trim:function(){return String.prototype.trim!==e}}),e}},function(e,t,r){"use strict";var n=r(50),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,a=function(e,t,r){for(var n=0,i=e.length;n=3&&(o=r),"[object Array]"===i.call(e)?a(e,t,o):"string"==typeof e?s(e,t,o):f(e,t,o)}},function(e,t){},function(e,t,r){e.exports=r(249)},function(e,t,r){var n=r(0),i=function e(t,r,n){if(!(this instanceof e))return new e(t,r,n);this.message=t,this.code=r,void 0!==n&&(this.data=n)};n(i,Error);var o=function e(){if(!(this instanceof e))return new e;i.call(this,"Parse error",-32700)};n(o,i);var a=function e(){if(!(this instanceof e))return new e;i.call(this,"Invalid Request",-32600)};n(a,i);var s=function e(){if(!(this instanceof e))return new e;i.call(this,"Method not found",-32601)};n(s,i);var f=function e(){if(!(this instanceof e))return new e;i.call(this,"Invalid params",-32602)};n(f,i);var u=function e(t){var r;if(!(this instanceof e))return new e(t);r=t&&t.message?t.message:"Internal error",i.call(this,r,-32603)};n(u,i);var c=function e(t){if(t<-32099||t>-32e3)throw new Error("Invalid error code");if(!(this instanceof e))return new e(t);i.call(this,"Server error",t)};n(c,i),i.ParseError=o,i.InvalidRequest=a,i.MethodNotFound=s,i.InvalidParams=f,i.InternalError=u,i.ServerError=c,e.exports=i},function(e,t,r){var n=r(40),i=r(87),o=r(46),a=r(86),s=r(20),f=s.unsafeRandomBytes,u=s.incrementHexInt,l=r(48);function d(e){return{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}e.exports=function(e){var t=e.blockTracker,r=e.provider,s={},p=a({blockTracker:t,provider:r}),b=new n,y=i({eth_subscribe:o(function(){var e=h(c.mark((function e(n,i){var o,a,b,y,g;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=n.params[0],a=f(16),e.t0=o,e.next="newHeads"===e.t0?4:"logs"===e.t0?6:12;break;case 4:return b=function(e){var n=e.subId,i={type:o,destroy:function(){var e=h(c.mark((function e(){return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.removeListener("sync",i.update);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),update:function(){var e=h(c.mark((function e(t){var i,o,a,s;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.oldBlock,o=t.newBlock,a=o,s=u(i),e.next=4,l({provider:r,fromBlock:s,toBlock:a});case 4:e.sent.map(d).forEach((function(e){v(n,e)}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()};return t.on("sync",i.update),i}({subId:a}),e.abrupt("break",13);case 6:return y=n.params[1],e.next=9,p.newLogFilter(y);case 9:return g=e.sent,b=function(e){var t=e.subId,r=e.filter;return r.on("update",(function(e){return v(t,e)})),{type:o,destroy:function(){var e=h(c.mark((function e(){return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.uninstallFilter(r.idHex);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}}({subId:a,filter:g}),e.abrupt("break",13);case 12:throw new Error('SubscriptionManager - unsupported subscription type "'.concat(o,'"'));case 13:return e.abrupt("return",(s[a]=b,void(i.result=a)));case 14:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()),eth_unsubscribe:o(function(){var e=h(c.mark((function e(t,r){var n,i;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.params[0],i=s[n]){e.next=3;break}return e.abrupt("return",void(r.result=!1));case 3:return delete s[n],e.next=6,i.destroy();case 6:r.result=!0;case 7:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}())});return{events:b,middleware:y};function v(e,t){b.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:e,result:t}})}}},function(e,t,r){var n=r(93),i=r(254),o=r(95),a=r(255);e.exports.Backoff=n,e.exports.FunctionCall=a,e.exports.FibonacciStrategy=o,e.exports.ExponentialStrategy=i,e.exports.fibonacci=function(e){return new n(new o(e))},e.exports.exponential=function(e){return new n(new i(e))},e.exports.call=function(e,t,r){var n=Array.prototype.slice.call(arguments);return e=n[0],t=n.slice(1,n.length-1),r=n[n.length-1],new a(e,t,r)}},function(e,t,r){var n=r(2),i=e.exports=r(253);function o(e,t,r,i){r=r||"";var o=new e(n.format.apply(this,[r].concat(i)));throw Error.captureStackTrace(o,t),o}function a(e,t,r){o(i.IllegalArgumentError,e,t,r)}function s(e,t,r){o(i.IllegalStateError,e,t,r)}function f(e){var t=typeof e;if("object"==t){if(!e)return"null";if(e instanceof Array)return"array"}return t}function u(e){return function(t,r){var n=f(t);if(n==e)return t;a(arguments.callee,r||'Expected "'+e+'" but got "'+n+'".',Array.prototype.slice.call(arguments,2))}}e.exports.checkArgument=function(e,t){e||a(arguments.callee,t,Array.prototype.slice.call(arguments,2))},e.exports.checkState=function(e,t){e||s(arguments.callee,t,Array.prototype.slice.call(arguments,2))},e.exports.checkIsDef=function(e,t){if(void 0!==e)return e;a(arguments.callee,t||"Expected value to be defined but was undefined.",Array.prototype.slice.call(arguments,2))},e.exports.checkIsDefAndNotNull=function(e,t){if(null!=e)return e;a(arguments.callee,t||'Expected value to be defined and not null but got "'+f(e)+'".',Array.prototype.slice.call(arguments,2))},e.exports.checkIsString=u("string"),e.exports.checkIsArray=u("array"),e.exports.checkIsNumber=u("number"),e.exports.checkIsBoolean=u("boolean"),e.exports.checkIsFunction=u("function"),e.exports.checkIsObject=u("object")},function(e,t,r){var n=r(2);function i(e){Error.call(this,e),this.message=e}function o(e){Error.call(this,e),this.message=e}n.inherits(i,Error),i.prototype.name="IllegalArgumentError",n.inherits(o,Error),o.prototype.name="IllegalStateError",e.exports.IllegalStateError=o,e.exports.IllegalArgumentError=i},function(e,t,r){var n=r(2),i=r(51),o=r(94);function a(e){o.call(this,e),this.backoffDelay_=0,this.nextBackoffDelay_=this.getInitialDelay(),this.factor_=a.DEFAULT_FACTOR,e&&void 0!==e.factor&&(i.checkArgument(e.factor>1,"Exponential factor should be greater than 1 but got %s.",e.factor),this.factor_=e.factor)}n.inherits(a,o),a.DEFAULT_FACTOR=2,a.prototype.next_=function(){return this.backoffDelay_=Math.min(this.nextBackoffDelay_,this.getMaxDelay()),this.nextBackoffDelay_=this.backoffDelay_*this.factor_,this.backoffDelay_},a.prototype.reset_=function(){this.backoffDelay_=0,this.nextBackoffDelay_=this.getInitialDelay()},e.exports=a},function(e,t,r){var n=r(6),i=r(51),o=r(2),a=r(93),s=r(95);function f(e,t,r){n.EventEmitter.call(this),i.checkIsFunction(e,"Expected fn to be a function."),i.checkIsArray(t,"Expected args to be an array."),i.checkIsFunction(r,"Expected callback to be a function."),this.function_=e,this.arguments_=t,this.callback_=r,this.lastResult_=[],this.numRetries_=0,this.backoff_=null,this.strategy_=null,this.failAfter_=-1,this.retryPredicate_=f.DEFAULT_RETRY_PREDICATE_,this.state_=f.State_.PENDING}o.inherits(f,n.EventEmitter),f.State_={PENDING:0,RUNNING:1,COMPLETED:2,ABORTED:3},f.DEFAULT_RETRY_PREDICATE_=function(e){return!0},f.prototype.isPending=function(){return this.state_==f.State_.PENDING},f.prototype.isRunning=function(){return this.state_==f.State_.RUNNING},f.prototype.isCompleted=function(){return this.state_==f.State_.COMPLETED},f.prototype.isAborted=function(){return this.state_==f.State_.ABORTED},f.prototype.setStrategy=function(e){return i.checkState(this.isPending(),"FunctionCall in progress."),this.strategy_=e,this},f.prototype.retryIf=function(e){return i.checkState(this.isPending(),"FunctionCall in progress."),this.retryPredicate_=e,this},f.prototype.getLastResult=function(){return this.lastResult_.concat()},f.prototype.getNumRetries=function(){return this.numRetries_},f.prototype.failAfter=function(e){return i.checkState(this.isPending(),"FunctionCall in progress."),this.failAfter_=e,this},f.prototype.abort=function(){this.isCompleted()||this.isAborted()||(this.isRunning()&&this.backoff_.reset(),this.state_=f.State_.ABORTED,this.lastResult_=[new Error("Backoff aborted.")],this.emit("abort"),this.doCallback_())},f.prototype.start=function(e){i.checkState(!this.isAborted(),"FunctionCall is aborted."),i.checkState(this.isPending(),"FunctionCall already started.");var t=this.strategy_||new s;this.backoff_=e?e(t):new a(t),this.backoff_.on("ready",this.doCall_.bind(this,!0)),this.backoff_.on("fail",this.doCallback_.bind(this)),this.backoff_.on("backoff",this.handleBackoff_.bind(this)),this.failAfter_>0&&this.backoff_.failAfter(this.failAfter_),this.state_=f.State_.RUNNING,this.doCall_(!1)},f.prototype.doCall_=function(e){e&&this.numRetries_++;var t=["call"].concat(this.arguments_);n.EventEmitter.prototype.emit.apply(this,t);var r=this.handleFunctionCallback_.bind(this);this.function_.apply(null,this.arguments_.concat(r))},f.prototype.doCallback_=function(){this.callback_.apply(null,this.lastResult_)},f.prototype.handleFunctionCallback_=function(){if(!this.isAborted()){var e=Array.prototype.slice.call(arguments);this.lastResult_=e,n.EventEmitter.prototype.emit.apply(this,["callback"].concat(e));var t=e[0];t&&this.retryPredicate_(t)?this.backoff_.backoff(t):(this.state_=f.State_.COMPLETED,this.doCallback_())}},f.prototype.handleBackoff_=function(e,t,r){this.emit("backoff",e,t,r)},e.exports=f},function(e,t){},function(e,t,r){"use strict";r.r(t);var n,i=r(96),o=r.n(i),a=r(97),s=r.n(a),f=r(98),u=r.n(f),c=r(99),h=r.n(c),l=r(100),d=r.n(l),p=r(101),b=r.n(p),y=r(102),v=r.n(y),g=r(103),m=r.n(g),_=r(104),w=r.n(_),E=r(105),k=r.n(E),A=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),S=function(e){function t(t){var r=e.call(this,t)||this;return r.name="[Squarelink Error]",r}return A(t,e),t}(Error),x=function(){function e(e,t){this.url=e,this.params=t,this.open=!0,this._createIframe(),this._addCloseListeners(),this._addMessageListeners()}return e.prototype.close=function(){this.open&&(this.container.parentNode.removeChild(this.container),this.onClosed&&this.onClosed(this.error),this.open=!1)},e.prototype._addCloseListeners=function(){var e=this;this.container.addEventListener("click",(function(){e.close()}));var t=this;document.onkeydown=function(e){27==(e=e||window.event).keyCode&&t.open&&t.close()}},e.prototype._addMessageListeners=function(){var e=this,t=this,r=!1;window.addEventListener("message",(function(n){var i=n.data,o=i.origin,a=i.height,s=i.type,f=i.error;if("squarelink-iframe"===o){if("resize"===s)return void(t.iframe.style=I.iframe(a+"px","none"));"error"===s?(t.error=f,t.close()):"onload"!==s||r||(r=!0,e.iframe.contentWindow.postMessage({origin:"squarelink-web3-sdk",params:e.params},"*"))}}),!1)},e.prototype._createIframe=function(){var e=document.createElement("div");e.id="squarelink-iframe-container",e.style=I.container,e.innerHTML='';var t=document.createElement("iframe");t.src="https://squarelink.com/popup/?url="+encodeURI(this.url),t.id="squarelink-iframe",t.style=I.iframe(),t.onload=function(){var e=document.getElementById("squarelink-preloader");e.parentNode.removeChild(e)},e.appendChild(t),this.iframe=t,this.container=e,document.body.appendChild(e)},e}(),I={iframe:function(e,t){return void 0===e&&(e="200px"),void 0===t&&(t="3px solid #fff"),"\n position: absolute;\n height: "+e+";\n width: 360px;\n top: 50%;\n left: 50%;\n transform:\n translate(-50%, -50%);\n border: 0px transparent;\n border-radius: 10px;\n -webkit-border-radius: 10px;\n -moz-border-radius: 10px;\n border-radius: 10px;\n -khtml-border-radius: 10px;\n border: "+t+";\n z-index: 2147483647;\n box-shadow: 0 10px 30px 4px rgba(0,0,0,.33);\n background: none;\n "},container:"\n position: fixed;\n height: 100%;\n width: 100%;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 2147483647;\n background: rgba(0,0,0,0.5);\n "},M=function(e){var t=document.createElement("div");t.id="squarelink-preloader-container",t.style="\n position: fixed;\n height: 100%;\n width: 100%;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 2147483647;\n background: rgba(0,0,0,0.5);\n ",t.innerHTML='',document.body.appendChild(t),document.getElementById("squarelink-close-button").addEventListener("click",(function(){e.close()}))},T=function(e){var t=e.url,r=e.params,n=document.createElement("style");n.innerHTML="\n.squarelink-close {\n position: absolute;\n right: 50px;\n top: 30px;\n width: 10px;\n height: 25px;\n opacity: 0.6;\n z-index: 100;\n cursor: pointer;\n -webkit-transition-duration:0.5s;\n transition-duration:0.5s;\n}\n.squarelink-close:hover {\n opacity: 1;\n}\n.squarelink-close:before, .squarelink-close:after {\n position: absolute;\n left: 15px;\n content: ' ';\n height: 30px;\n width: 3px;\n background-color: #fff;\n}\n.squarelink-close:before {\n transform: rotate(45deg);\n}\n.squarelink-close:after {\n transform: rotate(-45deg);\n}\n\n.squarelink-preloader {\n display: inline-block;\n position: absolute;\n width: 64px;\n height: 64px;\n z-index: 2147483649;\n top: 50%;\n left: 50%;\n transform:\n translate(-50%, -50%);\n}\n.squarelink-preloader div {\n position: absolute;\n width: 13px;\n height: 13px;\n border-radius: 50%;\n background: #fff;\n animation: squarelink-preloader 1.2s linear infinite;\n}\n.squarelink-preloader div:nth-child(1) {\n top: 6px;\n left: 6px;\n animation-delay: 0s;\n}\n.squarelink-preloader div:nth-child(2) {\n top: 6px;\n left: 26px;\n animation-delay: -0.4s;\n}\n.squarelink-preloader div:nth-child(3) {\n top: 6px;\n left: 45px;\n animation-delay: -0.8s;\n}\n.squarelink-preloader div:nth-child(4) {\n top: 26px;\n left: 6px;\n animation-delay: -0.4s;\n}\n.squarelink-preloader div:nth-child(5) {\n top: 26px;\n left: 26px;\n animation-delay: -0.8s;\n}\n.squarelink-preloader div:nth-child(6) {\n top: 26px;\n left: 45px;\n animation-delay: -1.2s;\n}\n.squarelink-preloader div:nth-child(7) {\n top: 45px;\n left: 6px;\n animation-delay: -0.8s;\n}\n.squarelink-preloader div:nth-child(8) {\n top: 45px;\n left: 26px;\n animation-delay: -1.2s;\n}\n.squarelink-preloader div:nth-child(9) {\n top: 45px;\n left: 45px;\n animation-delay: -1.6s;\n}\n@keyframes squarelink-preloader {\n 0%, 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.5;\n }\n}",(document.head||document.getElementsByTagName("head")[0]).appendChild(n);var i=window.open("","_blank","scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=375,height=350,left=-500,top=150");if(!i||i.closed||void 0===i.closed){try{i.close()}catch(e){}return Promise.resolve({iframe:new x(t,r)})}return function(e){var t=e.url,r=e.popup,n=e.params;return new Promise((function(e,i){r.location.href=t;var o=!1;window.addEventListener("message",(function(t){if(!o){var i=t.data,a=i.origin,s=i.type;"squarelink"===a&&"onload"===s&&(o=!0,r.postMessage({origin:"squarelink-web3-sdk",params:n},"*"),r.focus(),M(r),e({popup:r}),window.removeEventListener("message",(function(){})))}}),!1)}))}({url:t,popup:i,params:r})},P=function(){return(P=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]5e5))throw new S("Please provide a valid Chain ID");if(void 0!==t.skipCache&&"boolean"!=typeof t.skipCache)throw new S("the `skipCache` paramter must be a boolean")}else{if(!this.NETWORKS[t])throw new S("Invalid network provided");if(this.NETWORKS[t].sdkVersion){var i=this.NETWORKS[t].sdkVersion,o="1.1.4".split("."),a=i.split(".");for(n=0;n<3;n++){if(parseInt(o[n])>parseInt(a[n]))return;if(parseInt(o[n])0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&void 0!==arguments[0]?arguments[0]:{},t=new u(s);return t.params=[e],i.sendFortmaticAsyncWrapper.call(l,t)}};var u=function e(t,r){(0,o.default)(this,e),this.id=(0,i.randomId)(),this.method=t,this.params=r?[r]:[{}]}},function(e,t,r){var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6)),a=n(r(9)),i=n(r(1)),s=n(r(10)),c=r(11),u=n(r(12)),l=r(2),f=function(){function e(t,r){if((0,i.default)(this,e),this.fortmaticClient=t,this.requests={},this.queue=[],this.account=null,this.network=null,this.isFortmatic=!0,this.overlayReady=!1,this.isLoggedIn=!1,this.postMessages={FORTMATIC_HANDLE_BATCH_REQUEST:"FORTMATIC_HANDLE_BATCH_REQUEST",FORTMATIC_HANDLE_REQUEST:"FORTMATIC_HANDLE_REQUEST",FORTMATIC_HANDLE_FORTMATIC_REQUEST:"FORTMATIC_HANDLE_FORTMATIC_REQUEST",FORTMATIC_HANDLE_RESPONSE:"FORTMATIC_HANDLE_RESPONSE",FORTMATIC_OVERLAY_READY:"FORTMATIC_OVERLAY_READY",FORTMATIC_SHOW_OVERLAY:"FORTMATIC_SHOW_OVERLAY",FORTMATIC_HIDE_OVERLAY:"FORTMATIC_HIDE_OVERLAY",FORTMATIC_USER_DENIED:"FORTMATIC_USER_DENIED",FORTMATIC_USER_LOGOUT:"FORTMATIC_USER_LOGOUT",FORTMATIC_UNAUTHORIZED_API_KEY:"FORTMATIC_UNAUTHORIZED_API_KEY"},!r.API_KEY)throw new Error("Please provide a Fortmatic API key that you acquired from the developer dashboard.");this.options={API_KEY:r.API_KEY,ETH_NETWORK:r.ETH_NETWORK,DOMAIN_ORIGIN:window.location?window.location.origin:"",version:c.version},this.queryParams=btoa(JSON.stringify(this.options)),this.constructPostMessage(),this.overlay=this.createOverlay(),this.listenMessage()}return(0,s.default)(e,[{key:"constructPostMessage",value:function(){var e=this;Object.keys(this.postMessages).map((function(t){e.postMessages[t]+="-".concat(e.queryParams)}))}},{key:"createOverlay",value:function(){var e=this;return new Promise((function(t,r){var n=function(){if(function(){var t=!0,r=!1,n=void 0;try{for(var o,a=document.getElementsByClassName("fortmatic-iframe")[Symbol.iterator]();!(t=(o=a.next()).done);t=!0)if(o.value.src.includes(e.queryParams))return!1}catch(e){r=!0,n=e}finally{try{t||null==a.return||a.return()}finally{if(r)throw n}}return!0}()){var r=document.createElement("style");r.innerHTML=u.default.css,r.type="text/css",document.head.appendChild(r);var n=document.createElement("iframe");n.className="fortmatic-iframe",n.src="".concat(e.fortmaticClient,"/send?params=").concat(e.queryParams),document.body.appendChild(n);var o=document.createElement("img");o.src="https://static.fortmatic.com/assets/trans.gif",document.body.appendChild(o),t({iframe:n})}else console.error("Fortmatic: Duplicate instances found.")};["loaded","interactive","complete"].indexOf(document.readyState)>-1?n():window.addEventListener("load",n.bind(e),!1)}))}},{key:"showOverlay",value:function(){var e=(0,a.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.overlay;case 2:e.sent.iframe.style.display="block";case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"hideOverlay",value:function(){var e=(0,a.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.overlay;case 2:e.sent.iframe.style.display="none";case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"sendAsync",value:function(e,t){e.length>0?this.enqueue({payload:{id:(0,l.randomId)(),batch:e.map((function(e){return e.id=(0,l.randomId)(),e})),method:"eth_batchRequest"},cb:t}):this.enqueue({payload:e,cb:t})}},{key:"sendFortmaticAsync",value:function(e,t){this.enqueue({payload:e,cb:t,isNative:!0})}},{key:"send",value:function(e,t){if("string"==typeof e)return l.sendAsyncWrapper.call(this,e,t);if(!t){console.warn("Non-async web3 methods will be deprecated in web3 > 1.0, and are not supported by the Fortmatic provider. An async method to be used instead."),this.sendAsync(e,(function(){}));var r={};switch(e.method){case"eth_accounts":r=this.account?[this.account]:[];break;case"eth_coinbase":r=this.account;break;case"net_version":r=this.network||(this.options.API_KEY.startsWith("pk_live")?1:4);break;case"eth_uninstallFilter":r=!0;break;default:r={}}return{id:e.id,jsonrpc:e.jsonrpc,result:r}}this.sendAsync(e,t)}},{key:"enqueue",value:function(e){this.queue.push(e),this.overlayReady&&this.dequeue()}},{key:"dequeue",value:function(){var e=(0,a.default)(o.default.mark((function e(){var t,r,n,a=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==this.queue.length){e.next=2;break}return e.abrupt("return");case 2:if(!(t=this.queue.shift())){e.next=11;break}return r=t.payload,n=t.cb,r.id=(0,l.randomId)(),e.next=9,this.postMessage(t.isNative?this.postMessages.FORTMATIC_HANDLE_FORTMATIC_REQUEST:this.postMessages.FORTMATIC_HANDLE_REQUEST,t.payload);case 9:r.batch&&r.batch.length>0?(r.batch.forEach((function(e){a.requests[e.id]={parentId:r.id,payload:e,cb:function(e,t){var n=a.requests[r.id].batchResponse;if(e&&e.response&&!(0,l.findExistingResponse)(n,e.response.id))throw n.push({jsonrpc:"2.0",id:e.response.id,error:{code:e.response.code,message:e.response.message}}),a.requests[r.id].cb(null,n),e.response;if(t&&t.result&&!(0,l.findExistingResponse)(n,t.id))return n.push(t);throw new Error("Fortmatic: unexpected callback behavior")}}})),this.requests[r.id]={payload:r,cb:n,batchResponse:[]}):this.requests[r.id]={payload:r,cb:n},this.dequeue();case 11:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"postMessage",value:function(){var e=(0,a.default)(o.default.mark((function e(t,r){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.overlay;case 2:if(!(n=e.sent).iframe.contentWindow){e.next=7;break}n.iframe.contentWindow.postMessage({msgType:t,payload:r},"*"),e.next=8;break;case 7:throw new Error("Fortmatic: Modal is not ready.");case 8:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"enable",value:function(){return l.sendAsyncWrapper.call(this,"eth_accounts")}},{key:"listenMessage",value:function(){var e=this;window.addEventListener("message",(function(t){if(t.origin===e.fortmaticClient){var r=t.data.response?t.data.response.id:null;switch(t.data.msgType){case e.postMessages.FORTMATIC_OVERLAY_READY:e.overlayReady=!0,e.dequeue();break;case e.postMessages.FORTMATIC_HANDLE_RESPONSE:try{e.requests[r].cb(null,t.data.response);var n=e.requests[r].parentId;n&&e.requests[n].payload.batch.length===e.requests[n].batchResponse.length&&e.requests[n].cb(null,e.requests[n].batchResponse),"eth_accounts"===e.requests[r].payload.method?e.account=t.data.response.result[0]:"eth_coinbase"===e.requests[r].payload.method?e.account=t.data.response.result:"net_version"===e.requests[r].payload.method&&(e.network=t.data.response.result)}catch(e){}e.isLoggedIn=!0,e.dequeue();break;case e.postMessages.FORTMATIC_HIDE_OVERLAY:e.hideOverlay();break;case e.postMessages.FORTMATIC_SHOW_OVERLAY:e.showOverlay();break;case e.postMessages.FORTMATIC_USER_LOGOUT:e.account=null,e.network=null,e.isLoggedIn=!1;break;case e.postMessages.FORTMATIC_UNAUTHORIZED_API_KEY:throw e.overlayReady=!1,new Error("Given API key is not authorized to access the resource.");case e.postMessages.FORTMATIC_USER_DENIED:if(r){var o=t.data.response&&t.data.response.message?t.data.response.message:"Fortmatic: Modal was closed without executing action!",a=t.data.response&&t.data.response.code?t.data.response.code:1;e.requests[r].cb({message:o,code:a,response:t.data.response})}else e.queue.forEach((function(e){return e.cb({message:"Fortmatic: Modal was closed without executing action!",code:1})}));e.dequeue()}}}))}}]),e}();t.default=f},function(e,t,r){e.exports=r(7)},function(e,t,r){var n=function(){return this||"object"==typeof self&&self}()||Function("return this")(),o=n.regeneratorRuntime&&Object.getOwnPropertyNames(n).indexOf("regeneratorRuntime")>=0,a=o&&n.regeneratorRuntime;if(n.regeneratorRuntime=void 0,e.exports=r(8),o)n.regeneratorRuntime=a;else try{delete n.regeneratorRuntime}catch(e){n.regeneratorRuntime=void 0}},function(e,t){!function(t){var r,n=Object.prototype,o=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag",u="object"==typeof e,l=t.regeneratorRuntime;if(l)u&&(e.exports=l);else{(l=t.regeneratorRuntime=u?e.exports:{}).wrap=_;var f="suspendedStart",d="suspendedYield",p="executing",h="completed",m={},y={};y[i]=function(){return this};var v=Object.getPrototypeOf,g=v&&v(v(k([])));g&&g!==n&&o.call(g,i)&&(y=g);var b=A.prototype=w.prototype=Object.create(y);T.prototype=b.constructor=A,A.constructor=T,A[c]=T.displayName="GeneratorFunction",l.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===T||"GeneratorFunction"===(t.displayName||t.name))},l.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,A):(e.__proto__=A,c in e||(e[c]="GeneratorFunction")),e.prototype=Object.create(b),e},l.awrap=function(e){return{__await:e}},O(R.prototype),R.prototype[s]=function(){return this},l.AsyncIterator=R,l.async=function(e,t,r,n){var o=new R(_(e,t,r,n));return l.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},O(b),b[c]="Generator",b[i]=function(){return this},b.toString=function(){return"[object Generator]"},l.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},l.values=k,F.prototype={constructor:F,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(M),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=r)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,o){return s.type="throw",s.arg=e,t.next=n,o&&(t.method="next",t.arg=r),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),M(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;M(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),m}}}function _(e,t,r,n){var o=t&&t.prototype instanceof w?t:w,a=Object.create(o.prototype),i=new F(n||[]);return a._invoke=function(e,t,r){var n=f;return function(o,a){if(n===p)throw new Error("Generator is already running");if(n===h){if("throw"===o)throw a;return L()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var s=x(i,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var c=E(e,t,r);if("normal"===c.type){if(n=r.done?h:d,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=h,r.method="throw",r.arg=c.arg)}}}(e,r,i),a}function E(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}function w(){}function T(){}function A(){}function O(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function R(e){var t;this._invoke=function(r,n){function a(){return new Promise((function(t,a){!function t(r,n,a,i){var s=E(e[r],e,n);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&o.call(u,"__await")?Promise.resolve(u.__await).then((function(e){t("next",e,a,i)}),(function(e){t("throw",e,a,i)})):Promise.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return t("throw",e,a,i)}))}i(s.arg)}(r,n,t,a)}))}return t=t?t.then(a,a):a()}}function x(e,t){var n=e.iterator[t.method];if(n===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=r,x(e,t),"throw"===t.method))return m;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var o=E(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,m;var a=o.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,m):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,m)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function M(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function F(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function k(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n (https://fortmatic.com/)",license:"MIT",repository:{type:"git",url:"https://github.com/fortmatic/fortmatic-js"},keywords:["Auth","Login","Web3","Crypto","Ethereum","MetaMask","Wallet","Blockchain","Dapp"],homepage:"https://www.fortmatic.com",ava:{require:["@babel/register"],files:["test/**/*.spec.js"],babel:{testOptions:{presets:["@babel/env"],plugins:["@babel/plugin-proposal-function-bind","@babel/plugin-transform-runtime"]}},verbose:!0},nyc:{all:!1,"check-coverage":!0,"per-file":!0,lines:80,statements:80,functions:80,branches:80,include:["src/**/*.js"],exclude:["*/style.js"],require:[],reporter:["html","lcov"]},dependencies:{"@babel/runtime":"7.3.4"},devDependencies:{"@babel/core":"7.3.4","@babel/plugin-proposal-function-bind":"7.2.0","@babel/plugin-transform-modules-commonjs":"7.2.0","@babel/plugin-transform-runtime":"7.3.4","@babel/preset-env":"7.3.4","@babel/register":"7.0.0",ava:"2.2.0","babel-eslint":"10.0.1","babel-loader":"8.0.5",eslint:"5.9.0",lodash:"4.17.11",nyc:"13.1.0",sinon:"7.1.1",webpack:"4.26.1","webpack-cli":"3.1.2"}}},function(e,t,r){t.css="\n .fortmatic-iframe {\n display: none;\n position: fixed;\n top: 0;\n right: 0;\n width: 100%;\n height: 100%;\n border: none;\n border-radius: 0;\n z-index: 2147483647;\n }\n"}])}))),a=Object(n.c)(o);t.default=a}}]); \ No newline at end of file +(this.webpackJsonpbridge=this.webpackJsonpbridge||[]).push([[14],{716:function(e,t,r){"use strict";r.r(t),r.d(t,"__moduleExports",(function(){return o}));var n=r(714),o=(r(0),r(330),r(73),Object(n.b)((function(e){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,r){function n(){return Math.floor(9e4*Math.random())+1e4}Object.defineProperty(t,"__esModule",{value:!0}),t.sendAsyncWrapper=function(e,t){var r=this;return new Promise((function(o,a){r.sendAsync({jsonrpc:"2.0",id:n(),method:e,params:t||[]},(function(e,t){e?a(e):o(t.result)}))}))},t.sendFortmaticAsyncWrapper=function(e){var t=this;return new Promise((function(r,n){t.getProvider().sendFortmaticAsync(e,(function(e,t){e?n(e):r(t?t.result:{})}))}))},t.randomId=n,t.findExistingResponse=function(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=new u(s);return t.params=[e],i.sendFortmaticAsyncWrapper.call(l,t)}};var u=function e(t,r){(0,o.default)(this,e),this.id=(0,i.randomId)(),this.method=t,this.params=r?[r]:[{}]}},function(e,t,r){var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6)),a=n(r(9)),i=n(r(1)),s=n(r(10)),c=r(11),u=n(r(12)),l=r(2),f=function(){function e(t,r){if((0,i.default)(this,e),this.fortmaticClient=t,this.requests={},this.queue=[],this.account=null,this.network=null,this.isFortmatic=!0,this.overlayReady=!1,this.isLoggedIn=!1,this.postMessages={FORTMATIC_HANDLE_BATCH_REQUEST:"FORTMATIC_HANDLE_BATCH_REQUEST",FORTMATIC_HANDLE_REQUEST:"FORTMATIC_HANDLE_REQUEST",FORTMATIC_HANDLE_FORTMATIC_REQUEST:"FORTMATIC_HANDLE_FORTMATIC_REQUEST",FORTMATIC_HANDLE_RESPONSE:"FORTMATIC_HANDLE_RESPONSE",FORTMATIC_OVERLAY_READY:"FORTMATIC_OVERLAY_READY",FORTMATIC_SHOW_OVERLAY:"FORTMATIC_SHOW_OVERLAY",FORTMATIC_HIDE_OVERLAY:"FORTMATIC_HIDE_OVERLAY",FORTMATIC_USER_DENIED:"FORTMATIC_USER_DENIED",FORTMATIC_USER_LOGOUT:"FORTMATIC_USER_LOGOUT",FORTMATIC_UNAUTHORIZED_API_KEY:"FORTMATIC_UNAUTHORIZED_API_KEY"},!r.API_KEY)throw new Error("Please provide a Fortmatic API key that you acquired from the developer dashboard.");this.options={API_KEY:r.API_KEY,ETH_NETWORK:r.ETH_NETWORK,DOMAIN_ORIGIN:window.location?window.location.origin:"",version:c.version},this.queryParams=btoa(JSON.stringify(this.options)),this.constructPostMessage(),this.overlay=this.createOverlay(),this.listenMessage()}return(0,s.default)(e,[{key:"constructPostMessage",value:function(){var e=this;Object.keys(this.postMessages).map((function(t){e.postMessages[t]+="-".concat(e.queryParams)}))}},{key:"createOverlay",value:function(){var e=this;return new Promise((function(t,r){var n=function(){if(function(){var t=!0,r=!1,n=void 0;try{for(var o,a=document.getElementsByClassName("fortmatic-iframe")[Symbol.iterator]();!(t=(o=a.next()).done);t=!0)if(o.value.src.includes(e.queryParams))return!1}catch(e){r=!0,n=e}finally{try{t||null==a.return||a.return()}finally{if(r)throw n}}return!0}()){var r=document.createElement("style");r.innerHTML=u.default.css,r.type="text/css",document.head.appendChild(r);var n=document.createElement("iframe");n.className="fortmatic-iframe",n.src="".concat(e.fortmaticClient,"/send?params=").concat(e.queryParams),document.body.appendChild(n);var o=document.createElement("img");o.src="https://static.fortmatic.com/assets/trans.gif",document.body.appendChild(o),t({iframe:n})}else console.error("Fortmatic: Duplicate instances found.")};["loaded","interactive","complete"].indexOf(document.readyState)>-1?n():window.addEventListener("load",n.bind(e),!1)}))}},{key:"showOverlay",value:function(){var e=(0,a.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.overlay;case 2:e.sent.iframe.style.display="block";case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"hideOverlay",value:function(){var e=(0,a.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.overlay;case 2:e.sent.iframe.style.display="none";case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"sendAsync",value:function(e,t){e.length>0?this.enqueue({payload:{id:(0,l.randomId)(),batch:e.map((function(e){return e.id=(0,l.randomId)(),e})),method:"eth_batchRequest"},cb:t}):this.enqueue({payload:e,cb:t})}},{key:"sendFortmaticAsync",value:function(e,t){this.enqueue({payload:e,cb:t,isNative:!0})}},{key:"send",value:function(e,t){if("string"==typeof e)return l.sendAsyncWrapper.call(this,e,t);if(!t){console.warn("Non-async web3 methods will be deprecated in web3 > 1.0, and are not supported by the Fortmatic provider. An async method to be used instead."),this.sendAsync(e,(function(){}));var r={};switch(e.method){case"eth_accounts":r=this.account?[this.account]:[];break;case"eth_coinbase":r=this.account;break;case"net_version":r=this.network||(this.options.API_KEY.startsWith("pk_live")?1:4);break;case"eth_uninstallFilter":r=!0;break;default:r={}}return{id:e.id,jsonrpc:e.jsonrpc,result:r}}this.sendAsync(e,t)}},{key:"enqueue",value:function(e){this.queue.push(e),this.overlayReady&&this.dequeue()}},{key:"dequeue",value:function(){var e=(0,a.default)(o.default.mark((function e(){var t,r,n,a=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==this.queue.length){e.next=2;break}return e.abrupt("return");case 2:if(!(t=this.queue.shift())){e.next=11;break}return r=t.payload,n=t.cb,r.id=(0,l.randomId)(),e.next=9,this.postMessage(t.isNative?this.postMessages.FORTMATIC_HANDLE_FORTMATIC_REQUEST:this.postMessages.FORTMATIC_HANDLE_REQUEST,t.payload);case 9:r.batch&&r.batch.length>0?(r.batch.forEach((function(e){a.requests[e.id]={parentId:r.id,payload:e,cb:function(e,t){var n=a.requests[r.id].batchResponse;if(e&&e.response&&!(0,l.findExistingResponse)(n,e.response.id))throw n.push({jsonrpc:"2.0",id:e.response.id,error:{code:e.response.code,message:e.response.message}}),a.requests[r.id].cb(null,n),e.response;if(t&&t.result&&!(0,l.findExistingResponse)(n,t.id))return n.push(t);throw new Error("Fortmatic: unexpected callback behavior")}}})),this.requests[r.id]={payload:r,cb:n,batchResponse:[]}):this.requests[r.id]={payload:r,cb:n},this.dequeue();case 11:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"postMessage",value:function(){var e=(0,a.default)(o.default.mark((function e(t,r){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.overlay;case 2:if(!(n=e.sent).iframe.contentWindow){e.next=7;break}n.iframe.contentWindow.postMessage({msgType:t,payload:r},"*"),e.next=8;break;case 7:throw new Error("Fortmatic: Modal is not ready.");case 8:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"enable",value:function(){return l.sendAsyncWrapper.call(this,"eth_accounts")}},{key:"listenMessage",value:function(){var e=this;window.addEventListener("message",(function(t){if(t.origin===e.fortmaticClient){var r=t.data.response?t.data.response.id:null;switch(t.data.msgType){case e.postMessages.FORTMATIC_OVERLAY_READY:e.overlayReady=!0,e.dequeue();break;case e.postMessages.FORTMATIC_HANDLE_RESPONSE:try{e.requests[r].cb(null,t.data.response);var n=e.requests[r].parentId;n&&e.requests[n].payload.batch.length===e.requests[n].batchResponse.length&&e.requests[n].cb(null,e.requests[n].batchResponse),"eth_accounts"===e.requests[r].payload.method?e.account=t.data.response.result[0]:"eth_coinbase"===e.requests[r].payload.method?e.account=t.data.response.result:"net_version"===e.requests[r].payload.method&&(e.network=t.data.response.result)}catch(e){}e.isLoggedIn=!0,e.dequeue();break;case e.postMessages.FORTMATIC_HIDE_OVERLAY:e.hideOverlay();break;case e.postMessages.FORTMATIC_SHOW_OVERLAY:e.showOverlay();break;case e.postMessages.FORTMATIC_USER_LOGOUT:e.account=null,e.network=null,e.isLoggedIn=!1;break;case e.postMessages.FORTMATIC_UNAUTHORIZED_API_KEY:throw e.overlayReady=!1,new Error("Given API key is not authorized to access the resource.");case e.postMessages.FORTMATIC_USER_DENIED:if(r){var o=t.data.response&&t.data.response.message?t.data.response.message:"Fortmatic: Modal was closed without executing action!",a=t.data.response&&t.data.response.code?t.data.response.code:1;e.requests[r].cb({message:o,code:a,response:t.data.response})}else e.queue.forEach((function(e){return e.cb({message:"Fortmatic: Modal was closed without executing action!",code:1})}));e.dequeue()}}}))}}]),e}();t.default=f},function(e,t,r){e.exports=r(7)},function(e,t,r){var n=function(){return this||"object"==typeof self&&self}()||Function("return this")(),o=n.regeneratorRuntime&&Object.getOwnPropertyNames(n).indexOf("regeneratorRuntime")>=0,a=o&&n.regeneratorRuntime;if(n.regeneratorRuntime=void 0,e.exports=r(8),o)n.regeneratorRuntime=a;else try{delete n.regeneratorRuntime}catch(e){n.regeneratorRuntime=void 0}},function(e,t){!function(t){var r,n=Object.prototype,o=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag",u="object"==typeof e,l=t.regeneratorRuntime;if(l)u&&(e.exports=l);else{(l=t.regeneratorRuntime=u?e.exports:{}).wrap=_;var f="suspendedStart",d="suspendedYield",p="executing",h="completed",m={},y={};y[i]=function(){return this};var v=Object.getPrototypeOf,g=v&&v(v(k([])));g&&g!==n&&o.call(g,i)&&(y=g);var b=A.prototype=w.prototype=Object.create(y);T.prototype=b.constructor=A,A.constructor=T,A[c]=T.displayName="GeneratorFunction",l.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===T||"GeneratorFunction"===(t.displayName||t.name))},l.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,A):(e.__proto__=A,c in e||(e[c]="GeneratorFunction")),e.prototype=Object.create(b),e},l.awrap=function(e){return{__await:e}},O(R.prototype),R.prototype[s]=function(){return this},l.AsyncIterator=R,l.async=function(e,t,r,n){var o=new R(_(e,t,r,n));return l.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},O(b),b[c]="Generator",b[i]=function(){return this},b.toString=function(){return"[object Generator]"},l.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},l.values=k,F.prototype={constructor:F,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(M),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=r)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,o){return s.type="throw",s.arg=e,t.next=n,o&&(t.method="next",t.arg=r),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),M(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;M(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),m}}}function _(e,t,r,n){var o=t&&t.prototype instanceof w?t:w,a=Object.create(o.prototype),i=new F(n||[]);return a._invoke=function(e,t,r){var n=f;return function(o,a){if(n===p)throw new Error("Generator is already running");if(n===h){if("throw"===o)throw a;return L()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var s=x(i,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var c=E(e,t,r);if("normal"===c.type){if(n=r.done?h:d,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=h,r.method="throw",r.arg=c.arg)}}}(e,r,i),a}function E(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}function w(){}function T(){}function A(){}function O(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function R(e){var t;this._invoke=function(r,n){function a(){return new Promise((function(t,a){!function t(r,n,a,i){var s=E(e[r],e,n);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&o.call(u,"__await")?Promise.resolve(u.__await).then((function(e){t("next",e,a,i)}),(function(e){t("throw",e,a,i)})):Promise.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return t("throw",e,a,i)}))}i(s.arg)}(r,n,t,a)}))}return t=t?t.then(a,a):a()}}function x(e,t){var n=e.iterator[t.method];if(n===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=r,x(e,t),"throw"===t.method))return m;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var o=E(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,m;var a=o.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,m):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,m)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function M(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function F(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function k(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n (https://fortmatic.com/)",license:"MIT",repository:{type:"git",url:"https://github.com/fortmatic/fortmatic-js"},keywords:["Auth","Login","Web3","Crypto","Ethereum","MetaMask","Wallet","Blockchain","Dapp"],homepage:"https://www.fortmatic.com",ava:{require:["@babel/register"],files:["test/**/*.spec.js"],babel:{testOptions:{presets:["@babel/env"],plugins:["@babel/plugin-proposal-function-bind","@babel/plugin-transform-runtime"]}},verbose:!0},nyc:{all:!1,"check-coverage":!0,"per-file":!0,lines:80,statements:80,functions:80,branches:80,include:["src/**/*.js"],exclude:["*/style.js"],require:[],reporter:["html","lcov"]},dependencies:{"@babel/runtime":"7.3.4"},devDependencies:{"@babel/core":"7.3.4","@babel/plugin-proposal-function-bind":"7.2.0","@babel/plugin-transform-modules-commonjs":"7.2.0","@babel/plugin-transform-runtime":"7.3.4","@babel/preset-env":"7.3.4","@babel/register":"7.0.0",ava:"2.2.0","babel-eslint":"10.0.1","babel-loader":"8.0.5",eslint:"5.9.0",lodash:"4.17.11",nyc:"13.1.0",sinon:"7.1.1",webpack:"4.26.1","webpack-cli":"3.1.2"}}},function(e,t,r){t.css="\n .fortmatic-iframe {\n display: none;\n position: fixed;\n top: 0;\n right: 0;\n width: 100%;\n height: 100%;\n border: none;\n border-radius: 0;\n z-index: 2147483647;\n }\n"}])}))),a=Object(n.c)(o);t.default=a}}]); \ No newline at end of file diff --git a/static/js/15.ca3f9ed0.chunk.js b/bridge/static/js/15.79ad0e86.chunk.js similarity index 99% rename from static/js/15.ca3f9ed0.chunk.js rename to bridge/static/js/15.79ad0e86.chunk.js index fba25e4..f1d8e67 100644 --- a/static/js/15.ca3f9ed0.chunk.js +++ b/bridge/static/js/15.79ad0e86.chunk.js @@ -1 +1 @@ -(this.webpackJsonpbridge=this.webpackJsonpbridge||[]).push([[15],{713:function(t,e,r){"use strict";r.r(e),function(t,n){r.d(e,"Authereum",(function(){return vr})),r.d(e,"AuthereumProvider",(function(){return ur})),r.d(e,"AuthereumSigner",(function(){return yr})),r.d(e,"version",(function(){return C}));var i=r(83),o=r(12),s=r.n(o),a=r(186),u=r(21),h=r(30),c=r(32),l=r(33),f=r(189),d=r(38),p=r(712),m=(r(0),r(328),r(73),r(52),r(735)),v=r(802),g=(r(372),r(371),r(734)),y=(r(724),r(10),r(448),r(451)),w=r.n(y),b=Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.DATA_CLONE_ERROR=e.MESSAGE=e.REJECTED=e.FULFILLED=e.REPLY=e.CALL=e.HANDSHAKE_REPLY=e.HANDSHAKE=void 0,e.HANDSHAKE="handshake",e.HANDSHAKE_REPLY="handshake-reply",e.CALL="call",e.REPLY="reply",e.FULFILLED="fulfilled",e.REJECTED="rejected",e.MESSAGE="message",e.DATA_CLONE_ERROR="DataCloneError"}));Object(p.c)(b),b.DATA_CLONE_ERROR,b.MESSAGE,b.REJECTED,b.FULFILLED,b.REPLY,b.CALL,b.HANDSHAKE_REPLY,b.HANDSHAKE;var _=Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ERR_NO_IFRAME_SRC=e.ERR_NOT_IN_IFRAME=e.ERR_CONNECTION_TIMEOUT=e.ERR_CONNECTION_DESTROYED=void 0,e.ERR_CONNECTION_DESTROYED="ConnectionDestroyed",e.ERR_CONNECTION_TIMEOUT="ConnectionTimeout",e.ERR_NOT_IN_IFRAME="NotInIframe",e.ERR_NO_IFRAME_SRC="NoIframeSrc"}));Object(p.c)(_),_.ERR_NO_IFRAME_SRC,_.ERR_NOT_IN_IFRAME,_.ERR_CONNECTION_TIMEOUT,_.ERR_CONNECTION_DESTROYED;var M=Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default=function(){var t=[],e=!1;return{destroy:function(){e=!0,t.forEach((function(t){t()}))},onDestroy:function(r){e?r():t.push(r)}}},t.exports=e.default}));Object(p.c)(M);var k=Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r={"http:":"80","https:":"443"},n=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,i=["file:","data:"];e.default=function(t){if(t&&i.find((function(e){return t.startsWith(e)})))return"null";var e,o,s,a=document.location,u=n.exec(t);return u?(e=u[1]?u[1]:a.protocol,o=u[2],s=u[4]):(e=a.protocol,o=a.hostname,s=a.port),"".concat(e,"//").concat(o).concat(s&&s!==r[e]?":".concat(s):"")},t.exports=e.default}));Object(p.c)(k);var S=Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default=function(t){return function(){if(t){for(var e,r=arguments.length,n=new Array(r),i=0;i0&&void 0!==arguments[0]?arguments[0]:{},e=t.parentOrigin,s=void 0===e?"*":e,a=t.methods,u=void 0===a?{}:a,h=t.timeout,c=t.debug,l=(0,o.default)(c);if(window===window.top){var f=new Error("connectToParent() must be called within an iframe");throw f.code=_.ERR_NOT_IN_IFRAME,f}var d=(0,r.default)(),p=d.destroy,m=d.onDestroy,v=window,g=v.parent,y=new Promise((function(t,e){var r;void 0!==h&&(r=setTimeout((function(){var t=new Error("Connection to parent timed out after ".concat(h,"ms"));t.code=_.ERR_CONNECTION_TIMEOUT,e(t),p()}),h));var o=function e(o){try{clearTimeout()}catch(t){return}if(o.source===g&&o.data.penpal===b.HANDSHAKE_REPLY)if("*"===s||s===o.origin){l("Child: Received handshake reply"),v.removeEventListener(b.MESSAGE,e);var a={localName:"Child",local:v,remote:g,originForSending:"null"===o.origin?"*":o.origin,originForReceiving:o.origin},h={},c=(0,n.default)(a,u,l);m(c);var f=(0,i.default)(h,a,o.data.methodNames,p,l);m(f),clearTimeout(r),t(h)}else l("Child received handshake reply from origin ".concat(o.origin," which did not match expected origin ").concat(s))};v.addEventListener(b.MESSAGE,o),m((function(){v.removeEventListener(b.MESSAGE,o);var t=new Error("Connection destroyed");t.code=_.ERR_CONNECTION_DESTROYED,e(t)})),l("Child: Sending handshake"),g.postMessage({penpal:b.HANDSHAKE,methodNames:Object.keys(u)},s)}));return{promise:y,destroy:p}},t.exports=e.default}));Object(p.c)(N);var P=Object(p.c)(Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=i(O),n=i(N);function i(t){return t&&t.__esModule?t:{default:t}}var o={ERR_CONNECTION_DESTROYED:_.ERR_CONNECTION_DESTROYED,ERR_CONNECTION_TIMEOUT:_.ERR_CONNECTION_TIMEOUT,ERR_NOT_IN_IFRAME:_.ERR_NOT_IN_IFRAME,ERR_NO_IFRAME_SRC:_.ERR_NO_IFRAME_SRC,connectToChild:r.default,connectToParent:n.default};e.default=o,t.exports=e.default}))),R=Object(p.b)((function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,n,o,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,o||t,s),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i>>0,n=0;n0)for(r=0;r=0?r?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}var F=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,H=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,G={},z={};function W(t,e,r,n){var i=n;"string"==typeof n&&(i=function(){return this[n]()}),t&&(z[t]=i),e&&(z[e[0]]=function(){return B(i.apply(this,arguments),e[1],e[2])}),r&&(z[r]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function q(t,e){return t.isValid()?(e=K(e,t.localeData()),G[e]=G[e]||function(t){var e,r,n,i=t.match(F);for(e=0,r=i.length;e=0&&H.test(t);)t=t.replace(H,n),H.lastIndex=0,r-=1;return t}var Y=/\d/,V=/\d\d/,Z=/\d{3}/,J=/\d{4}/,$=/[+-]?\d{6}/,X=/\d\d?/,Q=/\d\d\d\d?/,tt=/\d\d\d\d\d\d?/,et=/\d{1,3}/,rt=/\d{1,4}/,nt=/[+-]?\d{1,6}/,it=/\d+/,ot=/[+-]?\d+/,st=/Z|[+-]\d\d:?\d\d/gi,at=/Z|[+-]\d\d(?::?\d\d)?/gi,ut=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ht={};function ct(t,e,r){ht[t]=N(e)?e:function(t,n){return t&&r?r:e}}function lt(t,e){return c(ht,t)?ht[t](e._strict,e._locale):new RegExp(ft(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(t,e,r,n,i){return e||r||n||i}))))}function ft(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var dt={};function pt(t,e){var r,n=e;for("string"==typeof t&&(t=[t]),a(e)&&(n=function(t,r){r[e]=k(t)}),r=0;r68?1900:2e3)};var wt,bt=_t("FullYear",!0);function _t(t,e){return function(r){return null!=r?(kt(this,t,r),n.updateOffset(this,e),this):Mt(this,t)}}function Mt(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function kt(t,e,r){t.isValid()&&!isNaN(r)&&("FullYear"===e&&yt(t.year())&&1===t.month()&&29===t.date()?t._d["set"+(t._isUTC?"UTC":"")+e](r,t.month(),St(r,t.month())):t._d["set"+(t._isUTC?"UTC":"")+e](r))}function St(t,e){if(isNaN(t)||isNaN(e))return NaN;var r=(e%12+12)%12;return t+=(e-r)/12,1===r?yt(t)?29:28:31-r%7%2}wt=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e=0?(a=new Date(t+400,e,r,n,i,o,s),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,r,n,i,o,s),a}function Dt(t){var e;if(t<100&&t>=0){var r=Array.prototype.slice.call(arguments);r[0]=t+400,e=new Date(Date.UTC.apply(null,r)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)}else e=new Date(Date.UTC.apply(null,arguments));return e}function jt(t,e,r){var n=7+e-r;return-(7+Dt(t,0,n).getUTCDay()-e)%7+n-1}function Lt(t,e,r,n,i){var o,s,a=1+7*(e-1)+(7+r-n)%7+jt(t,n,i);return a<=0?s=gt(o=t-1)+a:a>gt(t)?(o=t+1,s=a-gt(t)):(o=t,s=a),{year:o,dayOfYear:s}}function Ut(t,e,r){var n,i,o=jt(t.year(),e,r),s=Math.floor((t.dayOfYear()-o-1)/7)+1;return s<1?n=s+Bt(i=t.year()-1,e,r):s>Bt(t.year(),e,r)?(n=s-Bt(t.year(),e,r),i=t.year()+1):(i=t.year(),n=s),{week:n,year:i}}function Bt(t,e,r){var n=jt(t,e,r),i=jt(t+1,e,r);return(gt(t)-n+i)/7}function Ft(t,e){return t.slice(e,7).concat(t.slice(0,e))}W("w",["ww",2],"wo","week"),W("W",["WW",2],"Wo","isoWeek"),C("week","w"),C("isoWeek","W"),U("week",5),U("isoWeek",5),ct("w",X),ct("ww",X,V),ct("W",X),ct("WW",X,V),mt(["w","ww","W","WW"],(function(t,e,r,n){e[n.substr(0,1)]=k(t)})),W("d",0,"do","day"),W("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),W("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),W("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),W("e",0,0,"weekday"),W("E",0,0,"isoWeekday"),C("day","d"),C("weekday","e"),C("isoWeekday","E"),U("day",11),U("weekday",11),U("isoWeekday",11),ct("d",X),ct("e",X),ct("E",X),ct("dd",(function(t,e){return e.weekdaysMinRegex(t)})),ct("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),ct("dddd",(function(t,e){return e.weekdaysRegex(t)})),mt(["dd","ddd","dddd"],(function(t,e,r,n){var i=r._locale.weekdaysParse(t,n,r._strict);null!=i?e.d=i:d(r).invalidWeekday=t})),mt(["d","e","E"],(function(t,e,r,n){e[n]=k(t)}));var Ht="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Gt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),zt="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Wt(t,e,r){var n,i,o,s=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)o=f([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(o,"").toLocaleLowerCase();return r?"dddd"===e?-1!==(i=wt.call(this._weekdaysParse,s))?i:null:"ddd"===e?-1!==(i=wt.call(this._shortWeekdaysParse,s))?i:null:-1!==(i=wt.call(this._minWeekdaysParse,s))?i:null:"dddd"===e?-1!==(i=wt.call(this._weekdaysParse,s))||-1!==(i=wt.call(this._shortWeekdaysParse,s))||-1!==(i=wt.call(this._minWeekdaysParse,s))?i:null:"ddd"===e?-1!==(i=wt.call(this._shortWeekdaysParse,s))||-1!==(i=wt.call(this._weekdaysParse,s))||-1!==(i=wt.call(this._minWeekdaysParse,s))?i:null:-1!==(i=wt.call(this._minWeekdaysParse,s))||-1!==(i=wt.call(this._weekdaysParse,s))||-1!==(i=wt.call(this._shortWeekdaysParse,s))?i:null}var qt=ut,Kt=ut,Yt=ut;function Vt(){function t(t,e){return e.length-t.length}var e,r,n,i,o,s=[],a=[],u=[],h=[];for(e=0;e<7;e++)r=f([2e3,1]).day(e),n=this.weekdaysMin(r,""),i=this.weekdaysShort(r,""),o=this.weekdays(r,""),s.push(n),a.push(i),u.push(o),h.push(n),h.push(i),h.push(o);for(s.sort(t),a.sort(t),u.sort(t),h.sort(t),e=0;e<7;e++)a[e]=ft(a[e]),u[e]=ft(u[e]),h[e]=ft(h[e]);this._weekdaysRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Zt(){return this.hours()%12||12}function Jt(t,e){W(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function $t(t,e){return e._meridiemParse}W("H",["HH",2],0,"hour"),W("h",["hh",2],0,Zt),W("k",["kk",2],0,(function(){return this.hours()||24})),W("hmm",0,0,(function(){return""+Zt.apply(this)+B(this.minutes(),2)})),W("hmmss",0,0,(function(){return""+Zt.apply(this)+B(this.minutes(),2)+B(this.seconds(),2)})),W("Hmm",0,0,(function(){return""+this.hours()+B(this.minutes(),2)})),W("Hmmss",0,0,(function(){return""+this.hours()+B(this.minutes(),2)+B(this.seconds(),2)})),Jt("a",!0),Jt("A",!1),C("hour","h"),U("hour",13),ct("a",$t),ct("A",$t),ct("H",X),ct("h",X),ct("k",X),ct("HH",X,V),ct("hh",X,V),ct("kk",X,V),ct("hmm",Q),ct("hmmss",tt),ct("Hmm",Q),ct("Hmmss",tt),pt(["H","HH"],3),pt(["k","kk"],(function(t,e,r){var n=k(t);e[3]=24===n?0:n})),pt(["a","A"],(function(t,e,r){r._isPm=r._locale.isPM(t),r._meridiem=t})),pt(["h","hh"],(function(t,e,r){e[3]=k(t),d(r).bigHour=!0})),pt("hmm",(function(t,e,r){var n=t.length-2;e[3]=k(t.substr(0,n)),e[4]=k(t.substr(n)),d(r).bigHour=!0})),pt("hmmss",(function(t,e,r){var n=t.length-4,i=t.length-2;e[3]=k(t.substr(0,n)),e[4]=k(t.substr(n,2)),e[5]=k(t.substr(i)),d(r).bigHour=!0})),pt("Hmm",(function(t,e,r){var n=t.length-2;e[3]=k(t.substr(0,n)),e[4]=k(t.substr(n))})),pt("Hmmss",(function(t,e,r){var n=t.length-4,i=t.length-2;e[3]=k(t.substr(0,n)),e[4]=k(t.substr(n,2)),e[5]=k(t.substr(i))}));var Xt,Qt=_t("Hours",!0),te={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:At,monthsShort:Et,week:{dow:0,doy:6},weekdays:Ht,weekdaysMin:zt,weekdaysShort:Gt,meridiemParse:/[ap]\.?m?\.?/i},ee={},re={};function ne(t){return t?t.toLowerCase().replace("_","-"):t}function ie(e){var r=null;if(!ee[e]&&t&&t.exports)try{r=Xt._abbr,Object(p.e)("./locale/"+e),oe(r)}catch(t){}return ee[e]}function oe(t,e){var r;return t&&((r=s(e)?ae(t):se(t,e))?Xt=r:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),Xt._abbr}function se(t,e){if(null!==e){var r,n=te;if(e.abbr=t,null!=ee[t])O("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=ee[t]._config;else if(null!=e.parentLocale)if(null!=ee[e.parentLocale])n=ee[e.parentLocale]._config;else{if(null==(r=ie(e.parentLocale)))return re[e.parentLocale]||(re[e.parentLocale]=[]),re[e.parentLocale].push({name:t,config:e}),null;n=r._config}return ee[t]=new R(P(n,e)),re[t]&&re[t].forEach((function(t){se(t.name,t.config)})),oe(t),ee[t]}return delete ee[t],null}function ae(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Xt;if(!i(t)){if(e=ie(t))return e;t=[t]}return function(t){for(var e,r,n,i,o=0;o0;){if(n=ie(i.slice(0,e).join("-")))return n;if(r&&r.length>=e&&S(i,r,!0)>=e-1)break;e--}o++}return Xt}(t)}function ue(t){var e,r=t._a;return r&&-2===d(t).overflow&&(e=r[1]<0||r[1]>11?1:r[2]<1||r[2]>St(r[0],r[1])?2:r[3]<0||r[3]>24||24===r[3]&&(0!==r[4]||0!==r[5]||0!==r[6])?3:r[4]<0||r[4]>59?4:r[5]<0||r[5]>59?5:r[6]<0||r[6]>999?6:-1,d(t)._overflowDayOfYear&&(e<0||e>2)&&(e=2),d(t)._overflowWeeks&&-1===e&&(e=7),d(t)._overflowWeekday&&-1===e&&(e=8),d(t).overflow=e),t}function he(t,e,r){return null!=t?t:null!=e?e:r}function ce(t){var e,r,i,o,s,a=[];if(!t._d){for(i=function(t){var e=new Date(n.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}(t),t._w&&null==t._a[2]&&null==t._a[1]&&function(t){var e,r,n,i,o,s,a,u;if(null!=(e=t._w).GG||null!=e.W||null!=e.E)o=1,s=4,r=he(e.GG,t._a[0],Ut(xe(),1,4).year),n=he(e.W,1),((i=he(e.E,1))<1||i>7)&&(u=!0);else{o=t._locale._week.dow,s=t._locale._week.doy;var h=Ut(xe(),o,s);r=he(e.gg,t._a[0],h.year),n=he(e.w,h.week),null!=e.d?((i=e.d)<0||i>6)&&(u=!0):null!=e.e?(i=e.e+o,(e.e<0||e.e>6)&&(u=!0)):i=o}n<1||n>Bt(r,o,s)?d(t)._overflowWeeks=!0:null!=u?d(t)._overflowWeekday=!0:(a=Lt(r,n,i,o,s),t._a[0]=a.year,t._dayOfYear=a.dayOfYear)}(t),null!=t._dayOfYear&&(s=he(t._a[0],i[0]),(t._dayOfYear>gt(s)||0===t._dayOfYear)&&(d(t)._overflowDayOfYear=!0),r=Dt(s,0,t._dayOfYear),t._a[1]=r.getUTCMonth(),t._a[2]=r.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=a[e]=i[e];for(;e<7;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[3]&&0===t._a[4]&&0===t._a[5]&&0===t._a[6]&&(t._nextDay=!0,t._a[3]=0),t._d=(t._useUTC?Dt:Ct).apply(null,a),o=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[3]=24),t._w&&void 0!==t._w.d&&t._w.d!==o&&(d(t).weekdayMismatch=!0)}}var le=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,fe=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,de=/Z|[+-]\d\d(?::?\d\d)?/,pe=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],me=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],ve=/^\/?Date\((\-?\d+)/i;function ge(t){var e,r,n,i,o,s,a=t._i,u=le.exec(a)||fe.exec(a);if(u){for(d(t).iso=!0,e=0,r=pe.length;e0&&d(t).unusedInput.push(s),a=a.slice(a.indexOf(r)+r.length),h+=r.length),z[o]?(r?d(t).empty=!1:d(t).unusedTokens.push(o),vt(o,r,t)):t._strict&&!r&&d(t).unusedTokens.push(o);d(t).charsLeftOver=u-h,a.length>0&&d(t).unusedInput.push(a),t._a[3]<=12&&!0===d(t).bigHour&&t._a[3]>0&&(d(t).bigHour=void 0),d(t).parsedDateParts=t._a.slice(0),d(t).meridiem=t._meridiem,t._a[3]=function(t,e,r){var n;return null==r?e:null!=t.meridiemHour?t.meridiemHour(e,r):null!=t.isPM?((n=t.isPM(r))&&e<12&&(e+=12),n||12!==e||(e=0),e):e}(t._locale,t._a[3],t._meridiem),ce(t),ue(t)}else _e(t);else ge(t)}function ke(t){var e=t._i,r=t._f;return t._locale=t._locale||ae(t._l),null===e||void 0===r&&""===e?v({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),_(e)?new b(ue(e)):(u(e)?t._d=e:i(r)?function(t){var e,r,n,i,o;if(0===t._f.length)return d(t).invalidFormat=!0,void(t._d=new Date(NaN));for(i=0;ithis?this:t:v()}));function Te(t,e){var r,n;if(1===e.length&&i(e[0])&&(e=e[0]),!e.length)return xe();for(r=e[0],n=1;n=0?new Date(t+400,e,r)-126227808e5:new Date(t,e,r).valueOf()}function tr(t,e,r){return t<100&&t>=0?Date.UTC(t+400,e,r)-126227808e5:Date.UTC(t,e,r)}function er(t,e){W(0,[t,t.length],0,e)}function rr(t,e,r,n,i){var o;return null==t?Ut(this,n,i).year:(e>(o=Bt(t,n,i))&&(e=o),nr.call(this,t,e,r,n,i))}function nr(t,e,r,n,i){var o=Lt(t,e,r,n,i),s=Dt(o.year,0,o.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}W(0,["gg",2],0,(function(){return this.weekYear()%100})),W(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),er("gggg","weekYear"),er("ggggg","weekYear"),er("GGGG","isoWeekYear"),er("GGGGG","isoWeekYear"),C("weekYear","gg"),C("isoWeekYear","GG"),U("weekYear",1),U("isoWeekYear",1),ct("G",ot),ct("g",ot),ct("GG",X,V),ct("gg",X,V),ct("GGGG",rt,J),ct("gggg",rt,J),ct("GGGGG",nt,$),ct("ggggg",nt,$),mt(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,r,n){e[n.substr(0,2)]=k(t)})),mt(["gg","GG"],(function(t,e,r,i){e[i]=n.parseTwoDigitYear(t)})),W("Q",0,"Qo","quarter"),C("quarter","Q"),U("quarter",7),ct("Q",Y),pt("Q",(function(t,e){e[1]=3*(k(t)-1)})),W("D",["DD",2],"Do","date"),C("date","D"),U("date",9),ct("D",X),ct("DD",X,V),ct("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),pt(["D","DD"],2),pt("Do",(function(t,e){e[2]=k(t.match(X)[0])}));var ir=_t("Date",!0);W("DDD",["DDDD",3],"DDDo","dayOfYear"),C("dayOfYear","DDD"),U("dayOfYear",4),ct("DDD",et),ct("DDDD",Z),pt(["DDD","DDDD"],(function(t,e,r){r._dayOfYear=k(t)})),W("m",["mm",2],0,"minute"),C("minute","m"),U("minute",14),ct("m",X),ct("mm",X,V),pt(["m","mm"],4);var or=_t("Minutes",!1);W("s",["ss",2],0,"second"),C("second","s"),U("second",15),ct("s",X),ct("ss",X,V),pt(["s","ss"],5);var sr,ar=_t("Seconds",!1);for(W("S",0,0,(function(){return~~(this.millisecond()/100)})),W(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),W(0,["SSS",3],0,"millisecond"),W(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),W(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),W(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),W(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),W(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),W(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),C("millisecond","ms"),U("millisecond",16),ct("S",et,Y),ct("SS",et,V),ct("SSS",et,Z),sr="SSSS";sr.length<=9;sr+="S")ct(sr,it);function ur(t,e){e[6]=k(1e3*("0."+t))}for(sr="S";sr.length<=9;sr+="S")pt(sr,ur);var hr=_t("Milliseconds",!1);W("z",0,0,"zoneAbbr"),W("zz",0,0,"zoneName");var cr=b.prototype;function lr(t){return t}cr.add=Ke,cr.calendar=function(t,e){var r=t||xe(),i=je(r,this).startOf("day"),o=n.calendarFormat(this,i)||"sameElse",s=e&&(N(e[o])?e[o].call(this,r):e[o]);return this.format(s||this.localeData().calendar(o,this,xe(r)))},cr.clone=function(){return new b(this)},cr.diff=function(t,e,r){var n,i,o;if(!this.isValid())return NaN;if(!(n=je(t,this)).isValid())return NaN;switch(i=6e4*(n.utcOffset()-this.utcOffset()),e=D(e)){case"year":o=Ve(this,n)/12;break;case"month":o=Ve(this,n);break;case"quarter":o=Ve(this,n)/3;break;case"second":o=(this-n)/1e3;break;case"minute":o=(this-n)/6e4;break;case"hour":o=(this-n)/36e5;break;case"day":o=(this-n-i)/864e5;break;case"week":o=(this-n-i)/6048e5;break;default:o=this-n}return r?o:M(o)},cr.endOf=function(t){var e;if(void 0===(t=D(t))||"millisecond"===t||!this.isValid())return this;var r=this._isUTC?tr:Qe;switch(t){case"year":e=r(this.year()+1,0,1)-1;break;case"quarter":e=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=r(this.year(),this.month()+1,1)-1;break;case"week":e=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=36e5-Xe(e+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":e=this._d.valueOf(),e+=6e4-Xe(e,6e4)-1;break;case"second":e=this._d.valueOf(),e+=1e3-Xe(e,1e3)-1}return this._d.setTime(e),n.updateOffset(this,!0),this},cr.format=function(t){t||(t=this.isUtc()?n.defaultFormatUtc:n.defaultFormat);var e=q(this,t);return this.localeData().postformat(e)},cr.from=function(t,e){return this.isValid()&&(_(t)&&t.isValid()||xe(t).isValid())?He({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},cr.fromNow=function(t){return this.from(xe(),t)},cr.to=function(t,e){return this.isValid()&&(_(t)&&t.isValid()||xe(t).isValid())?He({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},cr.toNow=function(t){return this.to(xe(),t)},cr.get=function(t){return N(this[t=D(t)])?this[t]():this},cr.invalidAt=function(){return d(this).overflow},cr.isAfter=function(t,e){var r=_(t)?t:xe(t);return!(!this.isValid()||!r.isValid())&&("millisecond"===(e=D(e)||"millisecond")?this.valueOf()>r.valueOf():r.valueOf()9999?q(r,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):N(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",q(r,"Z")):q(r,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},cr.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var r="["+t+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i=e+'[")]';return this.format(r+n+"-MM-DD[T]HH:mm:ss.SSS"+i)},cr.toJSON=function(){return this.isValid()?this.toISOString():null},cr.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},cr.unix=function(){return Math.floor(this.valueOf()/1e3)},cr.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},cr.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},cr.year=bt,cr.isLeapYear=function(){return yt(this.year())},cr.weekYear=function(t){return rr.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},cr.isoWeekYear=function(t){return rr.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},cr.quarter=cr.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},cr.month=Nt,cr.daysInMonth=function(){return St(this.year(),this.month())},cr.week=cr.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},cr.isoWeek=cr.isoWeeks=function(t){var e=Ut(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},cr.weeksInYear=function(){var t=this.localeData()._week;return Bt(this.year(),t.dow,t.doy)},cr.isoWeeksInYear=function(){return Bt(this.year(),1,4)},cr.date=ir,cr.day=cr.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=function(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}(t,this.localeData()),this.add(t-e,"d")):e},cr.weekday=function(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},cr.isoWeekday=function(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=function(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7},cr.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},cr.hour=cr.hours=Qt,cr.minute=cr.minutes=or,cr.second=cr.seconds=ar,cr.millisecond=cr.milliseconds=hr,cr.utcOffset=function(t,e,r){var i,o=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=De(at,t)))return this}else Math.abs(t)<16&&!r&&(t*=60);return!this._isUTC&&e&&(i=Le(this)),this._offset=t,this._isUTC=!0,null!=i&&this.add(i,"m"),o!==t&&(!e||this._changeInProgress?qe(this,He(t-o,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?o:Le(this)},cr.utc=function(t){return this.utcOffset(0,t)},cr.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Le(this),"m")),this},cr.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=De(st,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this},cr.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?xe(t).utcOffset():0,(this.utcOffset()-t)%60==0)},cr.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},cr.isLocal=function(){return!!this.isValid()&&!this._isUTC},cr.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},cr.isUtc=Ue,cr.isUTC=Ue,cr.zoneAbbr=function(){return this._isUTC?"UTC":""},cr.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},cr.dates=A("dates accessor is deprecated. Use date instead.",ir),cr.months=A("months accessor is deprecated. Use month instead",Nt),cr.years=A("years accessor is deprecated. Use year instead",bt),cr.zone=A("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()})),cr.isDSTShifted=A("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var t={};if(y(t,this),(t=ke(t))._a){var e=t._isUTC?f(t._a):xe(t._a);this._isDSTShifted=this.isValid()&&S(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}));var fr=R.prototype;function dr(t,e,r,n){var i=ae(),o=f().set(n,e);return i[r](o,t)}function pr(t,e,r){if(a(t)&&(e=t,t=void 0),t=t||"",null!=e)return dr(t,e,r,"month");var n,i=[];for(n=0;n<12;n++)i[n]=dr(t,n,r,"month");return i}function mr(t,e,r,n){"boolean"==typeof t?(a(e)&&(r=e,e=void 0),e=e||""):(r=e=t,t=!1,a(e)&&(r=e,e=void 0),e=e||"");var i,o=ae(),s=t?o._week.dow:0;if(null!=r)return dr(e,(r+s)%7,n,"day");var u=[];for(i=0;i<7;i++)u[i]=dr(e,(i+s)%7,n,"day");return u}fr.calendar=function(t,e,r){var n=this._calendar[t]||this._calendar.sameElse;return N(n)?n.call(e,r):n},fr.longDateFormat=function(t){var e=this._longDateFormat[t],r=this._longDateFormat[t.toUpperCase()];return e||!r?e:(this._longDateFormat[t]=r.replace(/MMMM|MM|DD|dddd/g,(function(t){return t.slice(1)})),this._longDateFormat[t])},fr.invalidDate=function(){return this._invalidDate},fr.ordinal=function(t){return this._ordinal.replace("%d",t)},fr.preparse=lr,fr.postformat=lr,fr.relativeTime=function(t,e,r,n){var i=this._relativeTime[r];return N(i)?i(t,e,r,n):i.replace(/%d/i,t)},fr.pastFuture=function(t,e){var r=this._relativeTime[t>0?"future":"past"];return N(r)?r(e):r.replace(/%s/i,e)},fr.set=function(t){var e,r;for(r in t)N(e=t[r])?this[r]=e:this["_"+r]=e;this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},fr.months=function(t,e){return t?i(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||xt).test(e)?"format":"standalone"][t.month()]:i(this._months)?this._months:this._months.standalone},fr.monthsShort=function(t,e){return t?i(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[xt.test(e)?"format":"standalone"][t.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},fr.monthsParse=function(t,e,r){var n,i,o;if(this._monthsParseExact)return Tt.call(this,t,e,r);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(i=f([2e3,n]),r&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),r||this._monthsParse[n]||(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[n]=new RegExp(o.replace(".",""),"i")),r&&"MMMM"===e&&this._longMonthsParse[n].test(t))return n;if(r&&"MMM"===e&&this._shortMonthsParse[n].test(t))return n;if(!r&&this._monthsParse[n].test(t))return n}},fr.monthsRegex=function(t){return this._monthsParseExact?(c(this,"_monthsRegex")||It.call(this),t?this._monthsStrictRegex:this._monthsRegex):(c(this,"_monthsRegex")||(this._monthsRegex=Rt),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},fr.monthsShortRegex=function(t){return this._monthsParseExact?(c(this,"_monthsRegex")||It.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(c(this,"_monthsShortRegex")||(this._monthsShortRegex=Pt),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},fr.week=function(t){return Ut(t,this._week.dow,this._week.doy).week},fr.firstDayOfYear=function(){return this._week.doy},fr.firstDayOfWeek=function(){return this._week.dow},fr.weekdays=function(t,e){var r=i(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?Ft(r,this._week.dow):t?r[t.day()]:r},fr.weekdaysMin=function(t){return!0===t?Ft(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin},fr.weekdaysShort=function(t){return!0===t?Ft(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort},fr.weekdaysParse=function(t,e,r){var n,i,o;if(this._weekdaysParseExact)return Wt.call(this,t,e,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(i=f([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[n]=new RegExp(o.replace(".",""),"i")),r&&"dddd"===e&&this._fullWeekdaysParse[n].test(t))return n;if(r&&"ddd"===e&&this._shortWeekdaysParse[n].test(t))return n;if(r&&"dd"===e&&this._minWeekdaysParse[n].test(t))return n;if(!r&&this._weekdaysParse[n].test(t))return n}},fr.weekdaysRegex=function(t){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Vt.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(c(this,"_weekdaysRegex")||(this._weekdaysRegex=qt),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},fr.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Vt.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(c(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Kt),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},fr.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Vt.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(c(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Yt),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},fr.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},fr.meridiem=function(t,e,r){return t>11?r?"pm":"PM":r?"am":"AM"},oe("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===k(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),n.lang=A("moment.lang is deprecated. Use moment.locale instead.",oe),n.langData=A("moment.langData is deprecated. Use moment.localeData instead.",ae);var vr=Math.abs;function gr(t,e,r,n){var i=He(e,r);return t._milliseconds+=n*i._milliseconds,t._days+=n*i._days,t._months+=n*i._months,t._bubble()}function yr(t){return t<0?Math.floor(t):Math.ceil(t)}function wr(t){return 4800*t/146097}function br(t){return 146097*t/4800}function _r(t){return function(){return this.as(t)}}var Mr=_r("ms"),kr=_r("s"),Sr=_r("m"),xr=_r("h"),Ar=_r("d"),Er=_r("w"),Tr=_r("M"),Or=_r("Q"),Nr=_r("y");function Pr(t){return function(){return this.isValid()?this._data[t]:NaN}}var Rr=Pr("milliseconds"),Ir=Pr("seconds"),Cr=Pr("minutes"),Dr=Pr("hours"),jr=Pr("days"),Lr=Pr("months"),Ur=Pr("years"),Br=Math.round,Fr={ss:44,s:45,m:45,h:22,d:26,M:11};function Hr(t,e,r,n,i){return i.relativeTime(e||1,!!r,t,n)}var Gr=Math.abs;function zr(t){return(t>0)-(t<0)||+t}function Wr(){if(!this.isValid())return this.localeData().invalidDate();var t,e,r=Gr(this._milliseconds)/1e3,n=Gr(this._days),i=Gr(this._months);t=M(r/60),e=M(t/60),r%=60,t%=60;var o=M(i/12),s=i%=12,a=n,u=e,h=t,c=r?r.toFixed(3).replace(/\.?0+$/,""):"",l=this.asSeconds();if(!l)return"P0D";var f=l<0?"-":"",d=zr(this._months)!==zr(l)?"-":"",p=zr(this._days)!==zr(l)?"-":"",m=zr(this._milliseconds)!==zr(l)?"-":"";return f+"P"+(o?d+o+"Y":"")+(s?d+s+"M":"")+(a?p+a+"D":"")+(u||h||c?"T":"")+(u?m+u+"H":"")+(h?m+h+"M":"")+(c?m+c+"S":"")}var qr=Ne.prototype;return qr.isValid=function(){return this._isValid},qr.abs=function(){var t=this._data;return this._milliseconds=vr(this._milliseconds),this._days=vr(this._days),this._months=vr(this._months),t.milliseconds=vr(t.milliseconds),t.seconds=vr(t.seconds),t.minutes=vr(t.minutes),t.hours=vr(t.hours),t.months=vr(t.months),t.years=vr(t.years),this},qr.add=function(t,e){return gr(this,t,e,1)},qr.subtract=function(t,e){return gr(this,t,e,-1)},qr.as=function(t){if(!this.isValid())return NaN;var e,r,n=this._milliseconds;if("month"===(t=D(t))||"quarter"===t||"year"===t)switch(e=this._days+n/864e5,r=this._months+wr(e),t){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(e=this._days+Math.round(br(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return 24*e+n/36e5;case"minute":return 1440*e+n/6e4;case"second":return 86400*e+n/1e3;case"millisecond":return Math.floor(864e5*e)+n;default:throw new Error("Unknown unit "+t)}},qr.asMilliseconds=Mr,qr.asSeconds=kr,qr.asMinutes=Sr,qr.asHours=xr,qr.asDays=Ar,qr.asWeeks=Er,qr.asMonths=Tr,qr.asQuarters=Or,qr.asYears=Nr,qr.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},qr._bubble=function(){var t,e,r,n,i,o=this._milliseconds,s=this._days,a=this._months,u=this._data;return o>=0&&s>=0&&a>=0||o<=0&&s<=0&&a<=0||(o+=864e5*yr(br(a)+s),s=0,a=0),u.milliseconds=o%1e3,t=M(o/1e3),u.seconds=t%60,e=M(t/60),u.minutes=e%60,r=M(e/60),u.hours=r%24,s+=M(r/24),a+=i=M(wr(s)),s-=yr(br(i)),n=M(a/12),a%=12,u.days=s,u.months=a,u.years=n,this},qr.clone=function(){return He(this)},qr.get=function(t){return t=D(t),this.isValid()?this[t+"s"]():NaN},qr.milliseconds=Rr,qr.seconds=Ir,qr.minutes=Cr,qr.hours=Dr,qr.days=jr,qr.weeks=function(){return M(this.days()/7)},qr.months=Lr,qr.years=Ur,qr.humanize=function(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),r=function(t,e,r){var n=He(t).abs(),i=Br(n.as("s")),o=Br(n.as("m")),s=Br(n.as("h")),a=Br(n.as("d")),u=Br(n.as("M")),h=Br(n.as("y")),c=i<=Fr.ss&&["s",i]||i0,c[4]=r,Hr.apply(null,c)}(this,!t,e);return t&&(r=e.pastFuture(+this,r)),e.postformat(r)},qr.toISOString=Wr,qr.toString=Wr,qr.toJSON=Wr,qr.locale=Ze,qr.localeData=$e,qr.toIsoString=A("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Wr),qr.lang=Je,W("X",0,0,"unix"),W("x",0,0,"valueOf"),ct("x",ot),ct("X",/[+-]?\d+(\.\d{1,3})?/),pt("X",(function(t,e,r){r._d=new Date(1e3*parseFloat(t,10))})),pt("x",(function(t,e,r){r._d=new Date(k(t))})),n.version="2.24.0",e=xe,n.fn=cr,n.min=function(){var t=[].slice.call(arguments,0);return Te("isBefore",t)},n.max=function(){var t=[].slice.call(arguments,0);return Te("isAfter",t)},n.now=function(){return Date.now?Date.now():+new Date},n.utc=f,n.unix=function(t){return xe(1e3*t)},n.months=function(t,e){return pr(t,e,"months")},n.isDate=u,n.locale=oe,n.invalid=v,n.duration=He,n.isMoment=_,n.weekdays=function(t,e,r){return mr(t,e,r,"weekdays")},n.parseZone=function(){return xe.apply(null,arguments).parseZone()},n.localeData=ae,n.isDuration=Pe,n.monthsShort=function(t,e){return pr(t,e,"monthsShort")},n.weekdaysMin=function(t,e,r){return mr(t,e,r,"weekdaysMin")},n.defineLocale=se,n.updateLocale=function(t,e){if(null!=e){var r,n,i=te;null!=(n=ie(t))&&(i=n._config),(r=new R(e=P(i,e))).parentLocale=ee[t],ee[t]=r,oe(t)}else null!=ee[t]&&(null!=ee[t].parentLocale?ee[t]=ee[t].parentLocale:null!=ee[t]&&delete ee[t]);return ee[t]},n.locales=function(){return E(ee)},n.weekdaysShort=function(t,e,r){return mr(t,e,r,"weekdaysShort")},n.normalizeUnits=D,n.relativeTimeRounding=function(t){return void 0===t?Br:"function"==typeof t&&(Br=t,!0)},n.relativeTimeThreshold=function(t,e){return void 0!==Fr[t]&&(void 0===e?Fr[t]:(Fr[t]=e,"s"===t&&(Fr.ss=e-1),!0))},n.calendarFormat=function(t,e){var r=t.diff(e,"days",!0);return r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse"},n.prototype=cr,n.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},n}()})),C="0.0.4-beta.157",D=Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){function e(){for(var e=arguments.length,r=new Array(e),n=0;n1?r-1:0),i=1;i1&&void 0!==arguments[1]?arguments[1]:t.length;if(!e)throw new Error("arity is undefined");return function(){for(var r=this,n=arguments.length,i=new Array(n),o=0;o1?e-1:0),i=1;i1?r:r[0])},t.apply(r,i)}))}},t.exports=e.default}));Object(p.c)(H);var G=Object(p.c)(Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=s(D),n=s(j),i=s(F),o=s(H);function s(t){return t&&t.__esModule?t:{default:t}}e.default=(0,o.default)((function(t,e){if(e=(0,r.default)(e),!Array.isArray(t))return e(new Error("First argument to waterfall must be an array of functions"));if(!t.length)return e();var o=0;function s(e){(0,i.default)(t[o++]).apply(void 0,Object(d.a)(e).concat([(0,n.default)(a)]))}function a(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a=r._providers.length)a(new Error('Request for method "'+t.method+'" not handled by any subprovider. Please check your subprovider configuration to ensure this method is handled.'));else try{r._providers[n].handleRequest(t,e,a)}catch(t){a(t)}}()},$.prototype._setCurrentBlock=function(t){this.currentBlock=t,this.emit("block",t)};var X=Q;function Q(){}Q.prototype.setEngine=function(t){var e=this;e.engine||(e.engine=t,t.on("block",(function(t){e.currentBlock=t})),t.on("start",(function(){e.start()})),t.on("stop",(function(){e.stop()})))},Q.prototype.handleRequest=function(t,e,r){throw new Error("Subproviders should override `handleRequest`.")},Q.prototype.emitPayload=function(t,e){this.engine.sendAsync(Y(t),e)},Q.prototype.stop=function(){},Q.prototype.start=function(){};var tt=g.c.inherits,et=/^[0-9A-Fa-f]+$/g,rt=nt;function nt(t){this.nonceLock=Object(v.c)(1),t.getAccounts&&(this.getAccounts=t.getAccounts),t.processTransaction&&(this.processTransaction=t.processTransaction),t.processSignTransaction&&(this.processSignTransaction=t.processSignTransaction),t.processMessage&&(this.processMessage=t.processMessage),t.processPersonalMessage&&(this.processPersonalMessage=t.processPersonalMessage),t.processTypedMessage&&(this.processTypedMessage=t.processTypedMessage),this.approveTransaction=t.approveTransaction||this.autoApprove,this.approveMessage=t.approveMessage||this.autoApprove,this.approvePersonalMessage=t.approvePersonalMessage||this.autoApprove,this.approveTypedMessage=t.approveTypedMessage||this.autoApprove,this.signTransaction=t.signTransaction||st("signTransaction"),this.signMessage=t.signMessage||st("signMessage"),this.signPersonalMessage=t.signPersonalMessage||st("signPersonalMessage"),this.signTypedMessage=t.signTypedMessage||st("signTypedMessage"),t.recoverPersonalSignature&&(this.recoverPersonalSignature=t.recoverPersonalSignature),t.publishTransaction&&(this.publishTransaction=t.publishTransaction),this.estimateGas=t.estimateGas||this.estimateGas,this.getGasPrice=t.getGasPrice||this.getGasPrice}function it(t){return t.toLowerCase()}function ot(t){return"string"==typeof t&&"0x"===t.slice(0,2)&&t.slice(2).match(et)}function st(t){return function(e,r){r(new Error('ProviderEngine - HookedWalletSubprovider - Must provide "'+t+'" fn in constructor options'))}}tt(nt,X),nt.prototype.handleRequest=function(t,e,r){var n,i,o,s,a,u=this;switch(u._parityRequests={},u._parityRequestCount=0,t.method){case"eth_coinbase":return void u.getAccounts((function(t,e){if(t)return r(t);var n=e[0]||null;r(null,n)}));case"eth_accounts":return void u.getAccounts((function(t,e){if(t)return r(t);r(null,e)}));case"eth_sendTransaction":return n=t.params[0],void Object(v.p)([function(t){return u.validateTransaction(n,t)},function(t){return u.processTransaction(n,t)}],r);case"eth_signTransaction":return n=t.params[0],void Object(v.p)([function(t){return u.validateTransaction(n,t)},function(t){return u.processSignTransaction(n,t)}],r);case"eth_sign":return a=t.params[0],s=t.params[1],o=t.params[2]||{},i=Object(v.h)(o,{from:a,data:s}),void Object(v.p)([function(t){return u.validateMessage(i,t)},function(t){return u.processMessage(i,t)}],r);case"personal_sign":return function(){var e=t.params[0];if(function(t){var e=v.d.addHexPrefix(t);return!v.d.isValidAddress(e)&&ot(t)}(t.params[1])&&function(t){var e=v.d.addHexPrefix(t);return v.d.isValidAddress(e)}(e)){"[message, address]. This was previously handled incorrectly, ","and has been corrected automatically. ","Please switch this param order for smooth behavior in the future.",console.warn("The eth_personalSign method requires params ordered [message, address]. This was previously handled incorrectly, and has been corrected automatically. Please switch this param order for smooth behavior in the future."),a=t.params[0],s=t.params[1]}else s=t.params[0],a=t.params[1];o=t.params[2]||{},i=Object(v.h)(o,{from:a,data:s}),Object(v.p)([function(t){return u.validatePersonalMessage(i,t)},function(t){return u.processPersonalMessage(i,t)}],r)}();case"personal_ecRecover":return function(){s=t.params[0];var e=t.params[1];o=t.params[2]||{},i=Object(v.h)(o,{sig:e,data:s}),u.recoverPersonalSignature(i,r)}();case"eth_signTypedData":return s=t.params[0],a=t.params[1],o=t.params[2]||{},i=Object(v.h)(o,{from:a,data:s}),void Object(v.p)([function(t){return u.validateTypedMessage(i,t)},function(t){return u.processTypedMessage(i,t)}],r);case"parity_postTransaction":return n=t.params[0],void u.parityPostTransaction(n,r);case"parity_postSign":return a=t.params[0],s=t.params[1],void u.parityPostSign(a,s,r);case"parity_checkRequest":return function(){var e=t.params[0];u.parityCheckRequest(e,r)}();case"parity_defaultAccount":return void u.getAccounts((function(t,e){if(t)return r(t);var n=e[0]||null;r(null,n)}));default:return void e()}},nt.prototype.getAccounts=function(t){t(null,[])},nt.prototype.processTransaction=function(t,e){var r=this;Object(v.p)([function(e){return r.approveTransaction(t,e)},function(t,e){return r.checkApproval("transaction",t,e)},function(e){return r.finalizeAndSubmitTx(t,e)}],e)},nt.prototype.processSignTransaction=function(t,e){var r=this;Object(v.p)([function(e){return r.approveTransaction(t,e)},function(t,e){return r.checkApproval("transaction",t,e)},function(e){return r.finalizeTx(t,e)}],e)},nt.prototype.processMessage=function(t,e){var r=this;Object(v.p)([function(e){return r.approveMessage(t,e)},function(t,e){return r.checkApproval("message",t,e)},function(e){return r.signMessage(t,e)}],e)},nt.prototype.processPersonalMessage=function(t,e){var r=this;Object(v.p)([function(e){return r.approvePersonalMessage(t,e)},function(t,e){return r.checkApproval("message",t,e)},function(e){return r.signPersonalMessage(t,e)}],e)},nt.prototype.processTypedMessage=function(t,e){var r=this;Object(v.p)([function(e){return r.approveTypedMessage(t,e)},function(t,e){return r.checkApproval("message",t,e)},function(e){return r.signTypedMessage(t,e)}],e)},nt.prototype.autoApprove=function(t,e){e(null,!0)},nt.prototype.checkApproval=function(t,e,r){r(e?null:new Error("User denied "+t+" signature."))},nt.prototype.parityPostTransaction=function(t,e){var r=this,n="0x".concat(r._parityRequestCount.toString(16));r._parityRequestCount++,r.emitPayload({method:"eth_sendTransaction",params:[t]},(function(t,e){if(t)r._parityRequests[n]={error:t};else{var i=e.result;r._parityRequests[n]=i}})),e(null,n)},nt.prototype.parityPostSign=function(t,e,r){var n=this,i="0x".concat(n._parityRequestCount.toString(16));n._parityRequestCount++,n.emitPayload({method:"eth_sign",params:[t,e]},(function(t,e){if(t)n._parityRequests[i]={error:t};else{var r=e.result;n._parityRequests[i]=r}})),r(null,i)},nt.prototype.parityCheckRequest=function(t,e){var r=this._parityRequests[t]||null;return r?r.error?e(r.error):void e(null,r):e(null,null)},nt.prototype.recoverPersonalSignature=function(t,e){var r;try{r=v.o.recoverPersonalSignature(t)}catch(t){return e(t)}e(null,r)},nt.prototype.validateTransaction=function(t,e){if(void 0===t.from)return e(new Error("Undefined address - from address required to sign transaction."));this.validateSender(t.from,(function(r,n){return r?e(r):n?void e():e(new Error('Unknown address - unable to sign transaction for this address: "'.concat(t.from,'"')))}))},nt.prototype.validateMessage=function(t,e){if(void 0===t.from)return e(new Error("Undefined address - from address required to sign message."));this.validateSender(t.from,(function(r,n){return r?e(r):n?void e():e(new Error('Unknown address - unable to sign message for this address: "'.concat(t.from,'"')))}))},nt.prototype.validatePersonalMessage=function(t,e){return void 0===t.from?e(new Error("Undefined address - from address required to sign personal message.")):void 0===t.data?e(new Error("Undefined message - message required to sign personal message.")):ot(t.data)?void this.validateSender(t.from,(function(r,n){return r?e(r):n?void e():e(new Error('Unknown address - unable to sign message for this address: "'.concat(t.from,'"')))})):e(new Error("HookedWalletSubprovider - validateMessage - message was not encoded as hex."))},nt.prototype.validateTypedMessage=function(t,e){return void 0===t.from?e(new Error("Undefined address - from address required to sign typed data.")):void 0===t.data?e(new Error("Undefined data - message required to sign typed data.")):void this.validateSender(t.from,(function(r,n){return r?e(r):n?void e():e(new Error('Unknown address - unable to sign message for this address: "'.concat(t.from,'"')))}))},nt.prototype.validateSender=function(t,e){if(!t)return e(null,!1);this.getAccounts((function(r,n){if(r)return e(r);var i=-1!==n.map(it).indexOf(t.toLowerCase());e(null,i)}))},nt.prototype.finalizeAndSubmitTx=function(t,e){var r=this;r.nonceLock.take((function(){Object(v.p)([r.fillInTxExtras.bind(r,t),r.signTransaction.bind(r),r.publishTransaction.bind(r)],(function(t,n){if(r.nonceLock.leave(),t)return e(t);e(null,n)}))}))},nt.prototype.finalizeTx=function(t,e){var r=this;r.nonceLock.take((function(){Object(v.p)([r.fillInTxExtras.bind(r,t),r.signTransaction.bind(r)],(function(n,i){if(r.nonceLock.leave(),n)return e(n);e(null,{raw:i,tx:t})}))}))},nt.prototype.publishTransaction=function(t,e){this.emitPayload({method:"eth_sendRawTransaction",params:[t]},(function(t,r){if(t)return e(t);e(null,r.result)}))},nt.prototype.estimateGas=function(t,e){!function(t,e,r){t.sendAsync(Y({method:"eth_estimateGas",params:[e]}),(function(t,e){if(t)return"no contract code at given address"===t.message?r(null,"0xcf08"):r(t);r(null,e.result)}))}(this.engine,t,e)},nt.prototype.getGasPrice=function(t){this.emitPayload({method:"eth_gasPrice",params:[]},(function(e,r){if(e)return t(e);t(null,r.result)}))},nt.prototype.fillInTxExtras=function(t,e){var r=this,n=t.from,i={};void 0===t.gasPrice&&(i.gasPrice=r.getGasPrice.bind(r)),void 0===t.nonce&&(i.nonce=r.emitPayload.bind(r,{method:"eth_getTransactionCount",params:[n,"pending"]})),void 0===t.gas&&(i.gas=r.estimateGas.bind(r,function(t){return{from:t.from,to:t.to,value:t.value,data:t.data,gas:t.gas,gasPrice:t.gasPrice,nonce:t.nonce}}(t))),Object(v.n)(i,(function(r,n){if(r)return e(r);var i={};n.gasPrice&&(i.gasPrice=n.gasPrice),n.nonce&&(i.nonce=n.nonce.result),n.gas&&(i.gas=n.gas),e(null,Object(v.h)(t,i))}))};var at="undefined"!=typeof window?window:void 0!==p.d?p.d:"undefined"!=typeof self?self:{},ut=Object.prototype.toString,ht=function(t){return t.replace(/^\s+|\s+$/g,"")},ct=dt,lt=dt;function ft(t,e,r){var n=t;return function(t){var e=ut.call(t);return"[object Function]"===e||"function"==typeof t&&"[object RegExp]"!==e||"undefined"!=typeof window&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)}(e)?(r=e,"string"==typeof t&&(n={uri:t})):n=Object(v.h)(e,{uri:t}),n.callback=r,n}function dt(t,e,r){return pt(e=ft(t,e,r))}function pt(t){if(void 0===t.callback)throw new Error("callback argument missing");var e=!1,r=function(r,n,i){e||(e=!0,t.callback(r,n,i))};function n(){var t=void 0;if(t=u.response?u.response:u.responseText||function(t){try{if("document"===t.responseType)return t.responseXML;var e=t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;if(""===t.responseType&&!e)return t.responseXML}catch(t){}return null}(u),m)try{t=JSON.parse(t)}catch(t){}return t}function i(t){return clearTimeout(h),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,r(t,v)}function o(){if(!a){var e;clearTimeout(h),e=t.useXDR&&void 0===u.status?200:1223===u.status?204:u.status;var i=v,o=null;return 0!==e?(i={body:n(),statusCode:e,method:l,headers:{},url:c,rawRequest:u},u.getAllResponseHeaders&&(i.headers=function(t){if(!t)return{};for(var e,r={},n=ht(t).split("\n"),i=0;i0&&(h=setTimeout((function(){if(!a){a=!0,u.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",i(t)}}),t.timeout)),u.setRequestHeader)for(s in d)d.hasOwnProperty(s)&&u.setRequestHeader(s,d[s]);else if(t.headers&&!function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(u.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(u),u.send(f||null),u}dt.XMLHttpRequest=at.XMLHttpRequest||function(){},dt.XDomainRequest="withCredentials"in new dt.XMLHttpRequest?dt.XMLHttpRequest:at.XDomainRequest,function(t,e){for(var r=0;re?1:0}function _t(t,e,r){var n,i=function t(e,r,n,i){var o;if("object"==typeof e&&null!==e){for(o=0;o0)for(var n=0;n=1e3&&t<=4999}(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');return e.call(this,t,n,i)}return r}(kt)},At=Object.freeze({__proto__:null,default:{4001:{standard:"EIP 1193",message:"User rejected the request."},4100:{standard:"EIP 1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP 1193",message:"The requested method is not supported by this Ethereum provider."},"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."}}}),Et={parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},Tt={userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200},Ot={jsonRpc:Et,eth:Tt},Nt=Object.freeze({__proto__:null,jsonRpc:Et,eth:Tt,default:Ot}),Pt=Object(p.f)(At),Rt=Object(p.f)(Nt),It=Rt.jsonRpc.internal,Ct=xt.JsonRpcError,Dt={code:It,message:jt(It)};function jt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Unspecified error message. This is bug, please report it.";if(Number.isInteger(t)){var r=t.toString();if(Pt[r])return Pt[r].message;if(Ut(t))return"Unspecified server error."}return e}function Lt(t){if(!Number.isInteger(t))return!1;var e=t.toString();return!!Pt[e]||!!Ut(t)}function Ut(t){return t>=-32099&&t<=-32e3}function Bt(t){return t&&"object"==typeof t&&!Array.isArray(t)?Object.assign({},t):t}var Ft=xt.JsonRpcError,Ht=xt.EthJsonRpcError,Gt=jt;function zt(t,e,r){return new Ft(t,e||Gt(t),r)}function Wt(t,e,r){return new Ht(t,e||Gt(t),r)}var qt={errors:{parse:function(t,e){return zt(Rt.jsonRpc.parse,t,e)},invalidRequest:function(t,e){return zt(Rt.jsonRpc.invalidRequest,t,e)},invalidParams:function(t,e){return zt(Rt.jsonRpc.invalidParams,t,e)},methodNotFound:function(t,e){return zt(Rt.jsonRpc.methodNotFound,t,e)},internal:function(t,e){return zt(Rt.jsonRpc.internal,t,e)},server:function(t,e,r){if(!Number.isInteger(t)||t>-32e3||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32000');return zt(t,e,r)},eth:{userRejectedRequest:function(t,e){return Wt(Rt.eth.userRejectedRequest,t,e)},unauthorized:function(t,e){return Wt(Rt.eth.unauthorized,t,e)},unsupportedMethod:function(t,e){return Wt(Rt.eth.unsupportedMethod,t,e)},custom:function(t,e,r){if(!e||"string"!=typeof e)throw new Error('"message" must be a nonempty string');return new Ht(t,e,r)}}},JsonRpcError:xt.JsonRpcError,EthJsonRpcError:xt.EthJsonRpcError,serializeError:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Dt;if(!e||!Number.isInteger(e.code)||"string"!=typeof e.message)throw new Error("fallbackError must contain integer number code and string message.");if("object"==typeof t&&t instanceof Ct)return t.serialize();var r={};return t&&Lt(t.code)?(r.code=t.code,t.message&&"string"==typeof t.message?(r.message=t.message,t.hasOwnProperty("data")&&(r.data=t.data)):(r.message=jt(r.code),r.data={originalError:Bt(t)})):(r.code=e.code,r.message=t&&t.message?t.message:e.message,r.data={originalError:Bt(t)}),t&&t.stack&&(r.stack=t.stack),r},getMessageFromCode:jt,ERROR_CODES:Rt},Kt=Object(p.f)(mt),Yt=n.browser?ct:Kt,Vt=g.c.inherits,Zt=qt.errors,Jt=$t;function $t(t){this.rpcUrl=t.rpcUrl}Vt($t,X),$t.prototype.handleRequest=function(t,e,r){var n=this.rpcUrl,i=Y(t);Yt({uri:n,method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(i),rejectUnauthorized:!1,timeout:2e4},(function(t,e,n){if(t)return r(Zt.internal(t));switch(e.statusCode){case 405:return r(Zt.methodNotFound());case 504:return r(Zt.internal("Gateway timeout. The request took too long to process. This can happen when querying logs over too wide a block range."));case 429:return function(){var t=new Error("Too Many Requests");return r(Zt.internal(t))}();default:if(200!=e.statusCode)return r(Zt.internal(e.body))}var i;try{i=JSON.parse(n)}catch(t){return console.error(t.stack),r(Zt.internal(t))}if(i.error)return r(i.error);r(null,i.result)}))};var Xt=function(t){Object(c.a)(r,t);var e=Object(l.a)(r);function r(t){var n;if(Object(u.a)(this,r),n=e.call(this),!t)throw new Error("JsonRpcEngineMiddlewareSubprovider - no constructorFn specified");return n._constructorFn=t,Object(a.a)(n)}return Object(h.a)(r,[{key:"setEngine",value:function(t){if(this.middleware)throw new Error("JsonRpcEngineMiddlewareSubprovider - subprovider added to engine twice");var e=t._blockTracker,r=this._constructorFn({engine:t,provider:t,blockTracker:e});if(!r)throw new Error("JsonRpcEngineMiddlewareSubprovider - _constructorFn did not return middleware");if("function"!=typeof r)throw new Error("JsonRpcEngineMiddlewareSubprovider - specified middleware is not a function");this.middleware=r}},{key:"handleRequest",value:function(t,e,r){var n={id:t.id};this.middleware(t,n,(function(t){e((function(e,r,i){e?(delete n.result,n.error={message:e.message||e}):n.result=r,t?t(i):i()}))}),(function(t){if(t)return r(t);r(null,n.result)}))}}]),r}(X),Qt=function(t){Object(c.a)(r,t);var e=Object(l.a)(r);function r(){return Object(u.a)(this,r),e.call(this,(function(t){var e=t.blockTracker,r=t.provider,n=t.engine,i=Object(v.f)({blockTracker:e,provider:r}),o=i.events,s=i.middleware;return o.on("notification",(function(t){return n.emit("data",null,t)})),s}))}return r}(Xt),te=function(t){Object(c.a)(r,t);var e=Object(l.a)(r);function r(){return Object(u.a)(this,r),e.call(this,(function(t){var e=t.blockTracker,r=t.provider;t.engine;return Object(v.g)({blockTracker:e,provider:r})}))}return r}(Xt),ee=function(t,e){return function(){for(var r=this,n=arguments.length,i=new Array(n),o=0;o=0&&e<=x};v.each=v.forEach=function(t,e,r){var n,i;if(e=y(e,r),E(t))for(n=0,i=t.length;n0?0:s-1;for(i||(n=e[o?o[a]:a],a+=t);a>=0&&a=3;return e(t,y(r,i,4),n,o)}};v.reduce=v.foldl=v.inject=T(1),v.reduceRight=v.foldr=T(-1),v.find=v.detect=function(t,e,r){var n=(E(t)?v.findIndex:v.findKey)(t,e,r);if(void 0!==n&&-1!==n)return t[n]},v.filter=v.select=function(t,e,r){var n=[];return e=w(e,r),v.each(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n},v.reject=function(t,e,r){return v.filter(t,v.negate(w(e)),r)},v.every=v.all=function(t,e,r){e=w(e,r);for(var n=!E(t)&&v.keys(t),i=(n||t).length,o=0;o=0},v.invoke=b((function(t,e,r){var n,i;return v.isFunction(e)?i=e:v.isArray(e)&&(n=e.slice(0,-1),e=e[e.length-1]),v.map(t,(function(t){var o=i;if(!o){if(n&&n.length&&(t=S(t,n)),null==t)return;o=t[e]}return null==o?o:o.apply(t,r)}))})),v.pluck=function(t,e){return v.map(t,v.property(e))},v.where=function(t,e){return v.filter(t,v.matcher(e))},v.findWhere=function(t,e){return v.find(t,v.matcher(e))},v.max=function(t,e,r){var n,i,o=-1/0,s=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,u=(t=E(t)?t:v.values(t)).length;ao&&(o=n);else e=w(e,r),v.each(t,(function(t,r,n){((i=e(t,r,n))>s||i===-1/0&&o===-1/0)&&(o=t,s=i)}));return o},v.min=function(t,e,r){var n,i,o=1/0,s=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,u=(t=E(t)?t:v.values(t)).length;an||void 0===r)return 1;if(r0?0:i-1;o>=0&&o0?s=o>=0?o:Math.max(o+a,s):a=o>=0?Math.min(o+1,a):o+a+1;else if(r&&o&&a)return n[o=r(n,i)]===i?o:-1;if(i!=i)return(o=e(u.call(n,s,a),v.isNaN))>=0?o+s:-1;for(o=t>0?s:a-1;o>=0&&oe?(n&&(clearTimeout(n),n=null),a=h,s=t.apply(i,o),n||(i=o=null)):n||!1===r.trailing||(n=setTimeout(u,c)),s};return h.cancel=function(){clearTimeout(n),a=0,n=i=o=null},h},v.debounce=function(t,e,r){var n,i,o=function(e,r){n=null,r&&(i=t.apply(e,r))},s=b((function(s){if(n&&clearTimeout(n),r){var a=!n;n=setTimeout(o,e),a&&(i=t.apply(this,s))}else n=v.delay(o,e,this,s);return i}));return s.cancel=function(){clearTimeout(n),n=null},s},v.wrap=function(t,e){return v.partial(e,t)},v.negate=function(t){return function(){return!t.apply(this,arguments)}},v.compose=function(){var t=arguments,e=t.length-1;return function(){for(var r=e,n=t[e].apply(this,arguments);r--;)n=t[r].call(this,n);return n}},v.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},v.before=function(t,e){var r;return function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=null),r}},v.once=v.partial(v.before,2),v.restArguments=b;var D=!{toString:null}.propertyIsEnumerable("toString"),j=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],L=function(t,e){var r=j.length,n=t.constructor,i=v.isFunction(n)&&n.prototype||o,s="constructor";for(k(t,s)&&!v.contains(e,s)&&e.push(s);r--;)(s=j[r])in t&&t[s]!==i[s]&&!v.contains(e,s)&&e.push(s)};v.keys=function(t){if(!v.isObject(t))return[];if(f)return f(t);var e=[];for(var r in t)k(t,r)&&e.push(r);return D&&L(t,e),e},v.allKeys=function(t){if(!v.isObject(t))return[];var e=[];for(var r in t)e.push(r);return D&&L(t,e),e},v.values=function(t){for(var e=v.keys(t),r=e.length,n=Array(r),i=0;i1&&(n=y(n,e[1])),e=v.allKeys(t)):(n=H,e=P(e,!1,!1),t=Object(t));for(var i=0,o=e.length;i1&&(r=e[1])):(e=v.map(P(e,!1,!1),String),n=function(t,r){return!v.contains(e,r)}),v.pick(t,n,r)})),v.defaults=U(v.allKeys,!0),v.create=function(t,e){var r=_(t);return e&&v.extendOwn(r,e),r},v.clone=function(t){return v.isObject(t)?v.isArray(t)?t.slice():v.extend({},t):t},v.tap=function(t,e){return e(t),t},v.isMatch=function(t,e){var r=v.keys(e),n=r.length;if(null==t)return!n;for(var i=Object(t),o=0;o":">",'"':""","'":"'","`":"`"},W=v.invert(z),q=function(t){var e=function(e){return t[e]},r="(?:"+v.keys(t).join("|")+")",n=RegExp(r),i=RegExp(r,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(i,e):t}};v.escape=q(z),v.unescape=q(W),v.result=function(t,e,r){v.isArray(e)||(e=[e]);var n=e.length;if(!n)return v.isFunction(r)?r.call(t):r;for(var i=0;i/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var Y=/(.)^/,V={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Z=/\\|'|\r|\n|\u2028|\u2029/g,J=function(t){return"\\"+V[t]};v.template=function(t,e,r){!e&&r&&(e=r),e=v.defaults({},e,v.templateSettings);var n,i=RegExp([(e.escape||Y).source,(e.interpolate||Y).source,(e.evaluate||Y).source].join("|")+"|$","g"),o=0,s="__p+='";t.replace(i,(function(e,r,n,i,a){return s+=t.slice(o,a).replace(Z,J),o=a+e.length,r?s+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?s+="'+\n((__t=("+n+"))==null?'':__t)+\n'":i&&(s+="';\n"+i+"\n__p+='"),e})),s+="';\n",e.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{n=new Function(e.variable||"obj","_",s)}catch(t){throw t.source=s,t}var a=function(t){return n.call(this,t,v)},u=e.variable||"obj";return a.source="function("+u+"){\n"+s+"}",a},v.chain=function(t){var e=v(t);return e._chain=!0,e};var $=function(t,e){return t._chain?v(e).chain():e};v.mixin=function(t){return v.each(v.functions(t),(function(e){var r=v[e]=t[e];v.prototype[e]=function(){var t=[this._wrapped];return a.apply(t,arguments),$(this,r.apply(v,t))}})),v},v.mixin(v),v.each(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=i[t];v.prototype[t]=function(){var r=this._wrapped;return e.apply(r,arguments),"shift"!==t&&"splice"!==t||0!==r.length||delete r[0],$(this,r)}})),v.each(["concat","join","slice"],(function(t){var e=i[t];v.prototype[t]=function(){return $(this,e.apply(this._wrapped,arguments))}})),v.prototype.value=function(){return this._wrapped},v.prototype.valueOf=v.prototype.toJSON=v.prototype.value,v.prototype.toString=function(){return String(this._wrapped)}}()})),ie=(ne._,Object(p.b)((function(t){!function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{o=Object(p.e)("buffer").Buffer}catch(t){}function s(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function a(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return i}i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initArray=function(t,e,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},i.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,u=Math.min(o,o-s)+r,h=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var u=["","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"],h=[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],c=[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];function l(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h>>26,l=67108863&u,f=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=f;d++){var p=h-d|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}i.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?u[6-l.length]+l+n:l+n,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(n=o.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var f=h[t],d=c[t];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);n=(p=p.idivn(d)).isZero()?m+n:u[f-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(t,e){return r(void 0!==o),this.toArrayLike(o,t,e)},i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var n=t/26|0,i=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,w=0|s[3],b=8191&w,_=w>>>13,M=0|s[4],k=8191&M,S=M>>>13,x=0|s[5],A=8191&x,E=x>>>13,T=0|s[6],O=8191&T,N=T>>>13,P=0|s[7],R=8191&P,I=P>>>13,C=0|s[8],D=8191&C,j=C>>>13,L=0|s[9],U=8191&L,B=L>>>13,F=0|a[0],H=8191&F,G=F>>>13,z=0|a[1],W=8191&z,q=z>>>13,K=0|a[2],Y=8191&K,V=K>>>13,Z=0|a[3],J=8191&Z,$=Z>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],lt=8191&ct,ft=ct>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(l,H))|0)+((8191&(i=(i=Math.imul(l,G))+Math.imul(f,H)|0))<<13)|0;h=((o=Math.imul(f,G))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,H),i=(i=Math.imul(p,G))+Math.imul(m,H)|0,o=Math.imul(m,G);var gt=(h+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,q)|0)+Math.imul(f,W)|0))<<13)|0;h=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,H),i=(i=Math.imul(g,G))+Math.imul(y,H)|0,o=Math.imul(y,G),n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,q)|0;var yt=(h+(n=n+Math.imul(l,Y)|0)|0)+((8191&(i=(i=i+Math.imul(l,V)|0)+Math.imul(f,Y)|0))<<13)|0;h=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(b,H),i=(i=Math.imul(b,G))+Math.imul(_,H)|0,o=Math.imul(_,G),n=n+Math.imul(g,W)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,q)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,V)|0;var wt=(h+(n=n+Math.imul(l,J)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(f,J)|0))<<13)|0;h=((o=o+Math.imul(f,$)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,H),i=(i=Math.imul(k,G))+Math.imul(S,H)|0,o=Math.imul(S,G),n=n+Math.imul(b,W)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,V)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,$)|0;var bt=(h+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(f,Q)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(A,H),i=(i=Math.imul(A,G))+Math.imul(E,H)|0,o=Math.imul(E,G),n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,q)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,q)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(f,rt)|0))<<13)|0;h=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(O,H),i=(i=Math.imul(O,G))+Math.imul(N,H)|0,o=Math.imul(N,G),n=n+Math.imul(A,W)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,q)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,V)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,V)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Mt=(h+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,st)|0)+Math.imul(f,ot)|0))<<13)|0;h=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,H),i=(i=Math.imul(R,G))+Math.imul(I,H)|0,o=Math.imul(I,G),n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,q)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,V)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,V)|0,n=n+Math.imul(k,J)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var kt=(h+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(f,ut)|0))<<13)|0;h=((o=o+Math.imul(f,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,G))+Math.imul(j,H)|0,o=Math.imul(j,G),n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,q)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,q)|0,n=n+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,V)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,$)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var St=(h+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ft)|0)+Math.imul(f,lt)|0))<<13)|0;h=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,H),i=(i=Math.imul(U,G))+Math.imul(B,H)|0,o=Math.imul(B,G),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,q)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,q)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,V)|0,n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,$)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ft)|0;var xt=(h+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(f,pt)|0))<<13)|0;h=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,q))+Math.imul(B,W)|0,o=Math.imul(B,q),n=n+Math.imul(D,Y)|0,i=(i=i+Math.imul(D,V)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,$)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(g,lt)|0,i=(i=i+Math.imul(g,ft)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ft)|0;var At=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(U,Y),i=(i=Math.imul(U,V))+Math.imul(B,Y)|0,o=Math.imul(B,V),n=n+Math.imul(D,J)|0,i=(i=i+Math.imul(D,$)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,$)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ft)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ft)|0;var Et=(h+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(U,J),i=(i=Math.imul(U,$))+Math.imul(B,J)|0,o=Math.imul(B,$),n=n+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ht)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ft)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ft)|0;var Tt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,tt))+Math.imul(B,Q)|0,o=Math.imul(B,tt),n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(O,ut)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(A,lt)|0,i=(i=i+Math.imul(A,ft)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ft)|0;var Ot=(h+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(B,rt)|0,o=Math.imul(B,nt),n=n+Math.imul(D,ot)|0,i=(i=i+Math.imul(D,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,ft)|0;var Nt=(h+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;h=((o=o+Math.imul(E,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(B,ot)|0,o=Math.imul(B,st),n=n+Math.imul(D,ut)|0,i=(i=i+Math.imul(D,ht)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ft)|0)+Math.imul(I,lt)|0,o=o+Math.imul(I,ft)|0;var Pt=(h+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ht))+Math.imul(B,ut)|0,o=Math.imul(B,ht),n=n+Math.imul(D,lt)|0,i=(i=i+Math.imul(D,ft)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ft)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,lt),i=(i=Math.imul(U,ft))+Math.imul(B,lt)|0,o=Math.imul(B,ft);var It=(h+(n=n+Math.imul(D,pt)|0)|0)+((8191&(i=(i=i+Math.imul(D,mt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863;var Ct=(h+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,mt))+Math.imul(B,pt)|0))<<13)|0;return h=((o=Math.imul(B,mt))+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=vt,u[1]=gt,u[2]=yt,u[3]=wt,u[4]=bt,u[5]=_t,u[6]=Mt,u[7]=kt,u[8]=St,u[9]=xt,u[10]=At,u[11]=Et,u[12]=Tt,u[13]=Ot,u[14]=Nt,u[15]=Pt,u[16]=Rt,u[17]=It,u[18]=Ct,0!==h&&(u[19]=h,r.length++),r};function d(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(f=l),i.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?f(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):d(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=i.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,n[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=i/67108864|0,e+=o>>>26,this.words[n]=67108863&o}return 0!==e&&(this.words[n]=e,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new i(1);for(var r=this,n=0;n=0);var e,n=t%26,i=(t-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(e=0;e>>26-n}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==c||h>=i);h--){var l=0|this.words[h];this.words[h]=c<<26-o|l>>>o,c=l&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<=0);var e=t%26,n=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),o=t,s=0|o.words[o.length-1];0!==(r=26-this._countBits(s))&&(o=o.ushln(r),n.iushln(r),s=0|o.words[o.length-1]);var a,u=n.length-o.length;if("mod"!==e){(a=new i(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;l--){var f=67108864*(0|n.words[o.length+l])+(0|n.words[o.length+l-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(o,f,l);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(o,1,l),n.isZero()||(n.negative^=1);a&&(a.words[l]=f)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},i.prototype.divmod=function(t,e,n){return r(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(o=a.div.neg()),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(o=a.div.neg()),{div:o,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e);var o,s,a},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(e*n+(0|this.words[i]))%t;return n},i.prototype.idivn=function(t){r(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),s=new i(0),a=new i(0),u=new i(1),h=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++h;for(var c=n.clone(),l=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(c),s.isub(l)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(l)),a.iushrn(1),u.iushrn(1);e.cmp(n)>=0?(e.isub(n),o.isub(a),s.isub(u)):(n.isub(e),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:n.iushln(h)}},i.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,s=new i(1),a=new i(0),u=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var h=0,c=1;0==(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,f=1;0==(n.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(n.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(n)>=0?(e.isub(n),s.isub(a)):(n.isub(e),a.isub(s))}return(o=0===e.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(t),o},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)e=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new M(t)},i.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}g.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new w;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},M.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var n=this.m.add(new i(1)).iushrn(2);return this.pow(t,n)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new i(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var l=this.pow(c,o),f=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();r(v=0;n--){for(var h=e.words[n],c=u-1;c>=0;c--){var l=h>>c&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==s?(s<<=1,s|=l,(4===++a||0===n&&0===c)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}u=26}return o},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new k(t)},n(k,M),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,p.d)}))),oe=Object(p.b)((function(t){!function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{o=Object(p.e)("buffer").Buffer}catch(t){}function s(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function a(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return i}i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initArray=function(t,e,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},i.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,u=Math.min(o,o-s)+r,h=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var u=["","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"],h=[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],c=[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];function l(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h>>26,l=67108863&u,f=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=f;d++){var p=h-d|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}i.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?u[6-l.length]+l+n:l+n,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(n=o.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var f=h[t],d=c[t];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);n=(p=p.idivn(d)).isZero()?m+n:u[f-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(t,e){return r(void 0!==o),this.toArrayLike(o,t,e)},i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var n=t/26|0,i=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,w=0|s[3],b=8191&w,_=w>>>13,M=0|s[4],k=8191&M,S=M>>>13,x=0|s[5],A=8191&x,E=x>>>13,T=0|s[6],O=8191&T,N=T>>>13,P=0|s[7],R=8191&P,I=P>>>13,C=0|s[8],D=8191&C,j=C>>>13,L=0|s[9],U=8191&L,B=L>>>13,F=0|a[0],H=8191&F,G=F>>>13,z=0|a[1],W=8191&z,q=z>>>13,K=0|a[2],Y=8191&K,V=K>>>13,Z=0|a[3],J=8191&Z,$=Z>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],lt=8191&ct,ft=ct>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(l,H))|0)+((8191&(i=(i=Math.imul(l,G))+Math.imul(f,H)|0))<<13)|0;h=((o=Math.imul(f,G))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,H),i=(i=Math.imul(p,G))+Math.imul(m,H)|0,o=Math.imul(m,G);var gt=(h+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,q)|0)+Math.imul(f,W)|0))<<13)|0;h=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,H),i=(i=Math.imul(g,G))+Math.imul(y,H)|0,o=Math.imul(y,G),n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,q)|0;var yt=(h+(n=n+Math.imul(l,Y)|0)|0)+((8191&(i=(i=i+Math.imul(l,V)|0)+Math.imul(f,Y)|0))<<13)|0;h=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(b,H),i=(i=Math.imul(b,G))+Math.imul(_,H)|0,o=Math.imul(_,G),n=n+Math.imul(g,W)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,q)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,V)|0;var wt=(h+(n=n+Math.imul(l,J)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(f,J)|0))<<13)|0;h=((o=o+Math.imul(f,$)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,H),i=(i=Math.imul(k,G))+Math.imul(S,H)|0,o=Math.imul(S,G),n=n+Math.imul(b,W)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,V)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,$)|0;var bt=(h+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(f,Q)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(A,H),i=(i=Math.imul(A,G))+Math.imul(E,H)|0,o=Math.imul(E,G),n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,q)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,q)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(f,rt)|0))<<13)|0;h=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(O,H),i=(i=Math.imul(O,G))+Math.imul(N,H)|0,o=Math.imul(N,G),n=n+Math.imul(A,W)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,q)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,V)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,V)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Mt=(h+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,st)|0)+Math.imul(f,ot)|0))<<13)|0;h=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,H),i=(i=Math.imul(R,G))+Math.imul(I,H)|0,o=Math.imul(I,G),n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,q)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,V)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,V)|0,n=n+Math.imul(k,J)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var kt=(h+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(f,ut)|0))<<13)|0;h=((o=o+Math.imul(f,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,G))+Math.imul(j,H)|0,o=Math.imul(j,G),n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,q)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,q)|0,n=n+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,V)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,$)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var St=(h+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ft)|0)+Math.imul(f,lt)|0))<<13)|0;h=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,H),i=(i=Math.imul(U,G))+Math.imul(B,H)|0,o=Math.imul(B,G),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,q)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,q)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,V)|0,n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,$)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ft)|0;var xt=(h+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(f,pt)|0))<<13)|0;h=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,q))+Math.imul(B,W)|0,o=Math.imul(B,q),n=n+Math.imul(D,Y)|0,i=(i=i+Math.imul(D,V)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,$)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(g,lt)|0,i=(i=i+Math.imul(g,ft)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ft)|0;var At=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(U,Y),i=(i=Math.imul(U,V))+Math.imul(B,Y)|0,o=Math.imul(B,V),n=n+Math.imul(D,J)|0,i=(i=i+Math.imul(D,$)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,$)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ft)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ft)|0;var Et=(h+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(U,J),i=(i=Math.imul(U,$))+Math.imul(B,J)|0,o=Math.imul(B,$),n=n+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ht)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ft)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ft)|0;var Tt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,tt))+Math.imul(B,Q)|0,o=Math.imul(B,tt),n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(O,ut)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(A,lt)|0,i=(i=i+Math.imul(A,ft)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ft)|0;var Ot=(h+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(B,rt)|0,o=Math.imul(B,nt),n=n+Math.imul(D,ot)|0,i=(i=i+Math.imul(D,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,ft)|0;var Nt=(h+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;h=((o=o+Math.imul(E,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(B,ot)|0,o=Math.imul(B,st),n=n+Math.imul(D,ut)|0,i=(i=i+Math.imul(D,ht)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ft)|0)+Math.imul(I,lt)|0,o=o+Math.imul(I,ft)|0;var Pt=(h+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ht))+Math.imul(B,ut)|0,o=Math.imul(B,ht),n=n+Math.imul(D,lt)|0,i=(i=i+Math.imul(D,ft)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ft)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,lt),i=(i=Math.imul(U,ft))+Math.imul(B,lt)|0,o=Math.imul(B,ft);var It=(h+(n=n+Math.imul(D,pt)|0)|0)+((8191&(i=(i=i+Math.imul(D,mt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863;var Ct=(h+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,mt))+Math.imul(B,pt)|0))<<13)|0;return h=((o=Math.imul(B,mt))+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=vt,u[1]=gt,u[2]=yt,u[3]=wt,u[4]=bt,u[5]=_t,u[6]=Mt,u[7]=kt,u[8]=St,u[9]=xt,u[10]=At,u[11]=Et,u[12]=Tt,u[13]=Ot,u[14]=Nt,u[15]=Pt,u[16]=Rt,u[17]=It,u[18]=Ct,0!==h&&(u[19]=h,r.length++),r};function d(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(f=l),i.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?f(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):d(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=i.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,n[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=i/67108864|0,e+=o>>>26,this.words[n]=67108863&o}return 0!==e&&(this.words[n]=e,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new i(1);for(var r=this,n=0;n=0);var e,n=t%26,i=(t-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(e=0;e>>26-n}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==c||h>=i);h--){var l=0|this.words[h];this.words[h]=c<<26-o|l>>>o,c=l&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<=0);var e=t%26,n=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),o=t,s=0|o.words[o.length-1];0!==(r=26-this._countBits(s))&&(o=o.ushln(r),n.iushln(r),s=0|o.words[o.length-1]);var a,u=n.length-o.length;if("mod"!==e){(a=new i(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;l--){var f=67108864*(0|n.words[o.length+l])+(0|n.words[o.length+l-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(o,f,l);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(o,1,l),n.isZero()||(n.negative^=1);a&&(a.words[l]=f)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},i.prototype.divmod=function(t,e,n){return r(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(o=a.div.neg()),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(o=a.div.neg()),{div:o,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e);var o,s,a},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(e*n+(0|this.words[i]))%t;return n},i.prototype.idivn=function(t){r(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),s=new i(0),a=new i(0),u=new i(1),h=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++h;for(var c=n.clone(),l=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(c),s.isub(l)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(l)),a.iushrn(1),u.iushrn(1);e.cmp(n)>=0?(e.isub(n),o.isub(a),s.isub(u)):(n.isub(e),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:n.iushln(h)}},i.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,s=new i(1),a=new i(0),u=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var h=0,c=1;0==(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,f=1;0==(n.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(n.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(n)>=0?(e.isub(n),s.isub(a)):(n.isub(e),a.isub(s))}return(o=0===e.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(t),o},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)e=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new M(t)},i.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}g.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new w;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},M.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var n=this.m.add(new i(1)).iushrn(2);return this.pow(t,n)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new i(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var l=this.pow(c,o),f=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();r(v=0;n--){for(var h=e.words[n],c=u-1;c>=0;c--){var l=h>>c&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==s?(s<<=1,s|=l,(4===++a||0===n&&0===c)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}u=26}return o},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new k(t)},n(k,M),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,p.d)})),se=function(t){if("string"==typeof t||"number"==typeof t){var e=new oe(1),r=String(t).toLowerCase().trim(),n="0x"===r.substr(0,2)||"-0x"===r.substr(0,3),i=Object(v.i)(r);if("-"===i.substr(0,1)&&(i=Object(v.i)(i.slice(1)),e=new oe(-1,10)),!(i=""===i?"0":i).match(/^-?[0-9]+$/)&&i.match(/^[0-9A-Fa-f]+$/)||i.match(/^[a-fA-F]+$/)||!0===n&&i.match(/^[0-9A-Fa-f]+$/))return new oe(i,16).mul(e);if((i.match(/^-?[0-9]+$/)||""===i)&&!1===n)return new oe(i,10).mul(e)}else if("object"==typeof t&&t.toString&&!t.pop&&!t.push&&t.toString(10).match(/^-?[0-9]+$/)&&(t.mul||t.dividedToIntegerBy))return new oe(t.toString(10),10);throw new Error("[number-to-bn] while converting number "+JSON.stringify(t)+" to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.")};new ie(0),new ie(-1);var ae=Object(p.b)((function(t,e){!function(t){var e,r,n,i=String.fromCharCode;function o(t){for(var e,r,n=[],i=0,o=t.length;i=55296&&e<=56319&&i=55296&&t<=57343)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function a(t,e){return i(t>>e&63|128)}function u(t){if(0==(4294967168&t))return i(t);var e="";return 0==(4294965248&t)?e=i(t>>6&31|192):0==(4294901760&t)?(s(t),e=i(t>>12&15|224),e+=a(t,6)):0==(4292870144&t)&&(e=i(t>>18&7|240),e+=a(t,12),e+=a(t,6)),e+i(63&t|128)}function h(){if(n>=r)throw Error("Invalid byte index");var t=255&e[n];if(n++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function c(){var t,i;if(n>r)throw Error("Invalid byte index");if(n==r)return!1;if(t=255&e[n],n++,0==(128&t))return t;if(192==(224&t)){if((i=(31&t)<<6|h())>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&t)){if((i=(15&t)<<12|h()<<6|h())>=2048)return s(i),i;throw Error("Invalid continuation byte")}if(240==(248&t)&&(i=(7&t)<<18|h()<<12|h()<<6|h())>=65536&&i<=1114111)return i;throw Error("Invalid UTF-8 detected")}t.version="3.0.0",t.encode=function(t){for(var e=o(t),r=e.length,n=-1,i="";++n65535&&(o+=i((e-=65536)>>>10&1023|55296),e=56320|1023&e),o+=i(e);return o}(a)}}(e)})),ue="0123456789abcdef".split(""),he=[1,256,65536,16777216],ce=[0,8,16,24],le=[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],fe=function(t){var e,r,n,i,o,s,a,u,h,c,l,f,d,p,m,v,g,y,w,b,_,M,k,S,x,A,E,T,O,N,P,R,I,C,D,j,L,U,B,F,H,G,z,W,q,K,Y,V,Z,J,$,X,Q,tt,et,rt,nt,it,ot,st,at,ut,ht;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],h=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(u<<1|h>>>31),r=o^(h<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(c<<1|l>>>31),r=a^(l<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(f<<1|d>>>31),r=h^(d<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(i<<1|o>>>31),r=l^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],m=t[1],K=t[11]<<4|t[10]>>>28,Y=t[10]<<4|t[11]>>>28,T=t[20]<<3|t[21]>>>29,O=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,G=t[40]<<18|t[41]>>>14,z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,D=t[3]<<1|t[2]>>>31,v=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,V=t[22]<<10|t[23]>>>22,Z=t[23]<<10|t[22]>>>22,N=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ht=t[43]<<2|t[42]>>>30,tt=t[5]<<30|t[4]>>>2,et=t[4]<<30|t[5]>>>2,j=t[14]<<6|t[15]>>>26,L=t[15]<<6|t[14]>>>26,y=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,J=t[34]<<15|t[35]>>>17,$=t[35]<<15|t[34]>>>17,R=t[45]<<29|t[44]>>>3,I=t[44]<<29|t[45]>>>3,S=t[6]<<28|t[7]>>>4,x=t[7]<<28|t[6]>>>4,rt=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,U=t[26]<<25|t[27]>>>7,B=t[27]<<25|t[26]>>>7,b=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,X=t[47]<<24|t[46]>>>8,Q=t[46]<<24|t[47]>>>8,W=t[8]<<27|t[9]>>>5,q=t[9]<<27|t[8]>>>5,A=t[18]<<20|t[19]>>>12,E=t[19]<<20|t[18]>>>12,it=t[29]<<7|t[28]>>>25,ot=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,H=t[39]<<8|t[38]>>>24,M=t[48]<<14|t[49]>>>18,k=t[49]<<14|t[48]>>>18,t[0]=p^~v&y,t[1]=m^~g&w,t[10]=S^~A&T,t[11]=x^~E&O,t[20]=C^~j&U,t[21]=D^~L&B,t[30]=W^~K&V,t[31]=q^~Y&Z,t[40]=tt^~rt&it,t[41]=et^~nt&ot,t[2]=v^~y&b,t[3]=g^~w&_,t[12]=A^~T&N,t[13]=E^~O&P,t[22]=j^~U&F,t[23]=L^~B&H,t[32]=K^~V&J,t[33]=Y^~Z&$,t[42]=rt^~it&st,t[43]=nt^~ot&at,t[4]=y^~b&M,t[5]=w^~_&k,t[14]=T^~N&R,t[15]=O^~P&I,t[24]=U^~F&G,t[25]=B^~H&z,t[34]=V^~J&X,t[35]=Z^~$&Q,t[44]=it^~st&ut,t[45]=ot^~at&ht,t[6]=b^~M&p,t[7]=_^~k&m,t[16]=N^~R&S,t[17]=P^~I&x,t[26]=F^~G&C,t[27]=H^~z&D,t[36]=J^~X&W,t[37]=$^~Q&q,t[46]=st^~ut&tt,t[47]=at^~ht&et,t[8]=M^~p&v,t[9]=k^~m&g,t[18]=R^~S&A,t[19]=I^~x&E,t[28]=G^~C&j,t[29]=z^~D&L,t[38]=X^~W&K,t[39]=Q^~q&Y,t[48]=ut^~tt&rt,t[49]=ht^~et&nt,t[0]^=le[n],t[1]^=le[n+1]},de=function(t){return function(e){var r;if("0x"===e.slice(0,2)){r=[];for(var n=2,i=e.length;n>2]|=e[h]<>2]|=r<>2]|=(192|r>>6)<>2]|=(128|63&r)<=57344?(i[f>>2]|=(224|r>>12)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<=o){for(t.start=f-o,t.block=i[s],f=0;f>2]|=he[3&f],t.lastByteIndex===o)for(i[0]=i[s],f=1;f>4&15]+ue[15&c]+ue[c>>12&15]+ue[c>>8&15]+ue[c>>20&15]+ue[c>>16&15]+ue[c>>28&15]+ue[c>>24&15];d%s==0&&(fe(u),f=0)}return"0x"+l}(function(t){return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e}(t),r)}},pe={keccak256:de(256),keccak512:de(512),keccak256s:de(256),keccak512s:de(512)},me=function(t){return t instanceof v.a||t&&t.constructor&&"BN"===t.constructor.name},ve=function(t){return t&&t.constructor&&"BigNumber"===t.constructor.name},ge=function(t){try{return se.apply(null,arguments)}catch(e){throw new Error(e+' Given value: "'+t+'"')}},ye=function(t){return!!/^(0x)?[0-9a-f]{40}$/i.test(t)&&(!(!/^(0x|0X)?[0-9a-f]{40}$/.test(t)&&!/^(0x|0X)?[0-9A-F]{40}$/.test(t))||we(t))},we=function(t){t=t.replace(/^0x/i,"");for(var e=Se(t.toLowerCase()).replace(/^0x/i,""),r=0;r<40;r++)if(parseInt(e[r],16)>7&&t[r].toUpperCase()!==t[r]||parseInt(e[r],16)<=7&&t[r].toLowerCase()!==t[r])return!1;return!0},be=function(t){var e="";t=(t=(t=(t=(t=ae.encode(t)).replace(/^(?:\u0000)*/,"")).split("").reverse().join("")).replace(/^(?:\u0000)*/,"")).split("").reverse().join("");for(var r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return"0x"+e.join("")},isHex:function(t){return(ne.isString(t)||ne.isNumber(t))&&/^(-0x|0x)?[0-9a-f]*$/i.test(t)},isHexStrict:ke,leftPad:function(t,e,r){var n=/^0x/i.test(t)||"number"==typeof t,i=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(i).join(r||"0")+t},rightPad:function(t,e,r){var n=/^0x/i.test(t)||"number"==typeof t,i=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(i).join(r||"0")},toTwosComplement:function(t){return"0x"+ge(t).toTwos(256).toString(16,64)},sha3:Se},Ae=(m.c,[xe.BN,xe.isBN,xe.isBigNumber,xe.isHex,xe.isHexStrict,xe.sha3,xe.sha3,xe.isAddress,xe.checkAddressChecksum,xe.toHex,xe.toBN,xe.bytesToHex,xe.hexToBytes,xe.hexToNumberString,xe.hexToNumber,xe.hexToNumber,xe.numberToHex,xe.numberToHex,xe.hexToUtf8,xe.hexToUtf8,xe.hexToUtf8,xe.utf8ToHex,xe.utf8ToHex,xe.utf8ToHex,xe.leftPad,xe.leftPad,xe.rightPad,xe.rightPad,xe.toTwosComplement][5]);Object(p.c)(Object(p.b)((function(t,e){t.exports=function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){var u="function"==typeof p.e&&p.e;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var c=r[s]={exports:{}};e[s][0].call(c.exports,(function(t){return i(e[s][1][t]||t)}),c,c.exports,t,e,r,n)}return r[s].exports}for(var o="function"==typeof p.e&&p.e,s=0;sa[t]||console.log.apply(console,e)}function c(){for(var t=[],e=0;e>4]+u[15&n])}return e.join("")}}),l={16:10,24:12,32:14},f=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],p=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],m=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],v=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],g=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],y=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],w=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],b=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],_=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],M=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],k=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],S=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],x=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],A=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function E(t){for(var e=[],r=0;r>2,this._Ke[r][e%4]=o[e],this._Kd[t-r][e%4]=o[e];for(var s,a=0,u=i;u>16&255]<<24^d[s>>8&255]<<16^d[255&s]<<8^d[s>>24&255]^f[a]<<24,a+=1,8!=i)for(e=1;e>8&255]<<8^d[s>>16&255]<<16^d[s>>24&255]<<24,e=i/2+1;e>2,c=u%4,this._Ke[h][c]=o[e],this._Kd[t-h][c]=o[e++],u++}for(var h=1;h>24&255]^S[s>>16&255]^x[s>>8&255]^A[255&s]},T.prototype.encrypt=function(t){if(16!=t.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var e=this._Ke.length-1,r=[0,0,0,0],n=E(t),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var o=1;o>24&255]^v[n[(i+1)%4]>>16&255]^g[n[(i+2)%4]>>8&255]^y[255&n[(i+3)%4]]^this._Ke[o][i];n=r.slice()}var a,u=s(16);for(i=0;i<4;i++)a=this._Ke[e][i],u[4*i]=255&(d[n[i]>>24&255]^a>>24),u[4*i+1]=255&(d[n[(i+1)%4]>>16&255]^a>>16),u[4*i+2]=255&(d[n[(i+2)%4]>>8&255]^a>>8),u[4*i+3]=255&(d[255&n[(i+3)%4]]^a);return u},T.prototype.decrypt=function(t){if(16!=t.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var e=this._Kd.length-1,r=[0,0,0,0],n=E(t),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var o=1;o>24&255]^b[n[(i+3)%4]>>16&255]^_[n[(i+2)%4]>>8&255]^M[255&n[(i+1)%4]]^this._Kd[o][i];n=r.slice()}var a,u=s(16);for(i=0;i<4;i++)a=this._Kd[e][i],u[4*i]=255&(p[n[i]>>24&255]^a>>24),u[4*i+1]=255&(p[n[(i+3)%4]>>16&255]^a>>16),u[4*i+2]=255&(p[n[(i+2)%4]>>8&255]^a>>8),u[4*i+3]=255&(p[255&n[(i+1)%4]]^a);return u};var O=function t(e){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new T(e)};O.prototype.encrypt=function(t){if((t=o(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=s(t.length),r=s(16),n=0;n>=8},I.prototype.setBytes=function(t){if(16!=(t=o(t,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=t},I.prototype.increment=function(){for(var t=15;0<=t;t--){if(255!==this._counter[t]){this._counter[t]++;break}this._counter[t]=0}};var C=function t(e,r){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",r instanceof I||(r=new I(r)),this._counter=r,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new T(e)};C.prototype.encrypt=function(t){for(var e=o(t,!0),r=0;r>>26-a&67108863,26<=(a+=24)&&(a-=26,o++);else if("le"===r)for(o=i=0;i>>26-a&67108863,26<=(a+=24)&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r>>26-o&4194303,26<=(o+=24)&&(o-=26,n++);r+6!==e&&(i=a(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0];for(var n=0,i=this.length=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,h=0,c=r;c"};var h=["","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"],c=[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],l=[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];function f(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;n=(r.length=n)-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h>>26,l=67108863&u,f=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=f;d++){var p=h-d|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,26<=(i+=2)&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&2<=t&&t<=36){var f=c[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:h[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:2>>=13),64<=e&&(r+=7,e>>>=7),8<=e&&(r+=4,e>>>=4),2<=e&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;r=this.length>t.length?(e=this,t):(e=t,this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&0<=t);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),0>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&0<=t);var r=t/26|0,i=t%26;return this._expand(1+r),this.words[r]=e?this.words[r]|1<t.length?(r=this,t):(r=t,this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;n=0>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,w=0|s[3],b=8191&w,_=w>>>13,M=0|s[4],k=8191&M,S=M>>>13,x=0|s[5],A=8191&x,E=x>>>13,T=0|s[6],O=8191&T,N=T>>>13,P=0|s[7],R=8191&P,I=P>>>13,C=0|s[8],D=8191&C,j=C>>>13,L=0|s[9],U=8191&L,B=L>>>13,F=0|a[0],H=8191&F,G=F>>>13,z=0|a[1],W=8191&z,q=z>>>13,K=0|a[2],Y=8191&K,V=K>>>13,Z=0|a[3],J=8191&Z,$=Z>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],lt=8191&ct,ft=ct>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(l,H))|0)+((8191&(i=(i=Math.imul(l,G))+Math.imul(f,H)|0))<<13)|0;h=((o=Math.imul(f,G))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,H),i=(i=Math.imul(p,G))+Math.imul(m,H)|0,o=Math.imul(m,G);var gt=(h+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,q)|0)+Math.imul(f,W)|0))<<13)|0;h=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,H),i=(i=Math.imul(g,G))+Math.imul(y,H)|0,o=Math.imul(y,G),n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,q)|0;var yt=(h+(n=n+Math.imul(l,Y)|0)|0)+((8191&(i=(i=i+Math.imul(l,V)|0)+Math.imul(f,Y)|0))<<13)|0;h=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(b,H),i=(i=Math.imul(b,G))+Math.imul(_,H)|0,o=Math.imul(_,G),n=n+Math.imul(g,W)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,q)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,V)|0;var wt=(h+(n=n+Math.imul(l,J)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(f,J)|0))<<13)|0;h=((o=o+Math.imul(f,$)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,H),i=(i=Math.imul(k,G))+Math.imul(S,H)|0,o=Math.imul(S,G),n=n+Math.imul(b,W)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,V)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,$)|0;var bt=(h+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(f,Q)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(A,H),i=(i=Math.imul(A,G))+Math.imul(E,H)|0,o=Math.imul(E,G),n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,q)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,q)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(f,rt)|0))<<13)|0;h=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(O,H),i=(i=Math.imul(O,G))+Math.imul(N,H)|0,o=Math.imul(N,G),n=n+Math.imul(A,W)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,q)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,V)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,V)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Mt=(h+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,st)|0)+Math.imul(f,ot)|0))<<13)|0;h=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,H),i=(i=Math.imul(R,G))+Math.imul(I,H)|0,o=Math.imul(I,G),n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,q)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,V)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,V)|0,n=n+Math.imul(k,J)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var kt=(h+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(f,ut)|0))<<13)|0;h=((o=o+Math.imul(f,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,G))+Math.imul(j,H)|0,o=Math.imul(j,G),n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,q)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,q)|0,n=n+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,V)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,$)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var St=(h+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ft)|0)+Math.imul(f,lt)|0))<<13)|0;h=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,H),i=(i=Math.imul(U,G))+Math.imul(B,H)|0,o=Math.imul(B,G),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,q)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,q)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,V)|0,n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,$)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ft)|0;var xt=(h+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(f,pt)|0))<<13)|0;h=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,q))+Math.imul(B,W)|0,o=Math.imul(B,q),n=n+Math.imul(D,Y)|0,i=(i=i+Math.imul(D,V)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,$)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(g,lt)|0,i=(i=i+Math.imul(g,ft)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ft)|0;var At=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(U,Y),i=(i=Math.imul(U,V))+Math.imul(B,Y)|0,o=Math.imul(B,V),n=n+Math.imul(D,J)|0,i=(i=i+Math.imul(D,$)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,$)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ft)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ft)|0;var Et=(h+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(U,J),i=(i=Math.imul(U,$))+Math.imul(B,J)|0,o=Math.imul(B,$),n=n+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ht)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ft)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ft)|0;var Tt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,tt))+Math.imul(B,Q)|0,o=Math.imul(B,tt),n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(O,ut)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(A,lt)|0,i=(i=i+Math.imul(A,ft)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ft)|0;var Ot=(h+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(B,rt)|0,o=Math.imul(B,nt),n=n+Math.imul(D,ot)|0,i=(i=i+Math.imul(D,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,ft)|0;var Nt=(h+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;h=((o=o+Math.imul(E,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(B,ot)|0,o=Math.imul(B,st),n=n+Math.imul(D,ut)|0,i=(i=i+Math.imul(D,ht)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ft)|0)+Math.imul(I,lt)|0,o=o+Math.imul(I,ft)|0;var Pt=(h+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ht))+Math.imul(B,ut)|0,o=Math.imul(B,ht),n=n+Math.imul(D,lt)|0,i=(i=i+Math.imul(D,ft)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ft)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,lt),i=(i=Math.imul(U,ft))+Math.imul(B,lt)|0,o=Math.imul(B,ft);var It=(h+(n=n+Math.imul(D,pt)|0)|0)+((8191&(i=(i=i+Math.imul(D,mt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863;var Ct=(h+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,mt))+Math.imul(B,pt)|0))<<13)|0;return h=((o=Math.imul(B,mt))+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=vt,u[1]=gt,u[2]=yt,u[3]=wt,u[4]=bt,u[5]=_t,u[6]=Mt,u[7]=kt,u[8]=St,u[9]=xt,u[10]=At,u[11]=Et,u[12]=Tt,u[13]=Ot,u[14]=Nt,u[15]=Pt,u[16]=Rt,u[17]=It,u[18]=Ct,0!==h&&(u[19]=h,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=f),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?f(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n>>26-r<<26-r;if(0!=r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!=i){for(e=this.length-1;0<=e;e--)this.words[e+i]=this.words[e];for(e=0;e>>o<s)for(this.length-=s,h=0;h>>o,c=l&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&0<=t);var e=t%26,r=(t-e)/26,i=1<>>e<>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),i=a=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=1+u,a.words=new Array(a.length);for(var h=0;hthis.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;0<=i;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var c=r.clone(),l=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(0>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),1t.length)return 1;if(this.lengththis.n;);var n=e>>22,i=o}i>>>=22,0===(t.words[n-10]=i)&&10>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new w;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return 0<=r.cmp(this.m)&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var l=this.pow(c,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();n(v>c&1;i!==r[0]&&(i=this.sqr(i)),0!=l||0!==s?(s<<=1,s|=l,(4==++a||0===n&&0===c)&&(i=this.mul(i,r[s]),s=a=0)):a=0}u=26}return i},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},i(k,M),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return 0<=i.cmp(this.m)?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return 0<=i.cmp(this.m)?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:11}],10:[function(t,e,r){(function(t){e.exports=function(e){var r=new Uint8Array(e);return(t.crypto||t.msCrypto).getRandomValues(r),r}}).call(this,void 0!==p.d?p.d:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(t,e,r){},{}],12:[function(t,e,r){var n=r;n.version=t("../package.json").version,n.utils=t("./elliptic/utils"),n.rand=t("brorand"),n.curve=t("./elliptic/curve"),n.curves=t("./elliptic/curves"),n.ec=t("./elliptic/ec"),n.eddsa=t("./elliptic/eddsa")},{"../package.json":25,"./elliptic/curve":15,"./elliptic/curves":18,"./elliptic/ec":19,"./elliptic/eddsa":22,"./elliptic/utils":24,brorand:10}],13:[function(t,e,r){var n=t("bn.js"),i=t("../utils"),o=i.getNAF,s=i.getJSF,a=i.assert;function u(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||0>1]):u.mixedAdd(i[-c-1>>1].neg()):0>1]):u.add(i[-c-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,n,i){for(var a=this._wnafT1,u=this._wnafT2,h=this._wnafT3,c=0,l=0;l>1]:A<0&&(x=u[y][-A-1>>1].neg()),_="affine"===x.type?_.mixedAdd(x):_.add(x))}}for(l=0;l=Math.ceil((t.bitLength()+1)/e.step)},h.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i":""},h.prototype.isInfinity=function(){return this.inf},h.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},h.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},h.prototype.getX=function(){return this.x.fromRed()},h.prototype.getY=function(){return this.y.fromRed()},h.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},h.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},h.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},h.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},h.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},h.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(c,s.BasePoint),u.prototype.jpoint=function(t,e,r){return new c(this,t,e,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),c=h.redMul(a),l=n.redMul(h),f=u.redSqr().redIAdd(c).redISub(l).redISub(l),d=u.redMul(l.redISub(f)).redISub(o.redMul(c)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(f,d,p)},c.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),h=u.redMul(s),c=r.redMul(u),l=a.redSqr().redIAdd(h).redISub(c).redISub(c),f=a.redMul(c.redISub(l)).redISub(i.redMul(h)),d=this.z.redMul(s);return this.curve.jpoint(l,f,d)},c.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":24,"./base":13,"bn.js":9,inherits:39}],18:[function(t,e,r){var n,i=r,o=t("hash.js"),s=t("./curve"),a=t("./utils").assert;function u(t){"short"===t.type?this.curve=new s.short(t):"edwards"===t.type?this.curve=new s.edwards(t):this.curve=new s.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function h(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new u(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,h("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:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),h("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:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),h("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:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),h("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:o.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"]}),h("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:o.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"]}),h("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),h("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:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=t("./precomputed/secp256k1")}catch(t){n=void 0}h("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:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},{"./curve":15,"./precomputed/secp256k1":23,"./utils":24,"hash.js":26}],19:[function(t,e,r){var n=t("bn.js"),i=t("hmac-drbg"),o=t("../utils"),s=t("../curves"),a=t("brorand"),u=o.assert,h=t("./key"),c=t("./signature");function l(t){if(!(this instanceof l))return new l(t);"string"==typeof t&&(u(s.hasOwnProperty(t),"Unknown curve "+t),t=s[t]),t instanceof s.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}(e.exports=l).prototype.keyPair=function(t){return new h(this,t)},l.prototype.keyFromPrivate=function(t,e){return h.fromPrivate(this,t,e)},l.prototype.keyFromPublic=function(t,e){return h.fromPublic(this,t,e)},l.prototype.genKeyPair=function(t){t=t||{};for(var e=new i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(e.generate(r));if(!(0>1;if(0<=a.cmp(this.curve.p.umod(this.curve.n))&&f)throw new Error("Unable to find sencond key candinate");a=f?this.curve.pointFromX(a.add(this.curve.n),l):this.curve.pointFromX(a,l);var d=e.r.invm(o),p=o.sub(s).mul(d).umod(o),m=h.mul(d).umod(o);return this.g.mulAdd(p,a,m)},l.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new c(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},{"../curves":18,"../utils":24,"./key":20,"./signature":21,"bn.js":9,brorand:10,"hmac-drbg":38}],20:[function(t,e,r){var n=t("bn.js"),i=t("../utils").assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}(e.exports=o).fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return""}},{"../utils":24,"bn.js":9}],21:[function(t,e,r){var n=t("bn.js"),i=t("../utils"),o=i.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function u(t,e){var r=t[e.place++];if(!(128&r))return r;for(var n=15&r,i=0,o=0,s=e.place;o>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}(e.exports=s).prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;if(u(t,r)+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=u(t,r),s=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var h=u(t,r);if(t.length!==h+r.place)return!1;var c=t.slice(r.place,h+r.place);return 0===s[0]&&128&s[1]&&(s=s.slice(1)),0===c[0]&&128&c[1]&&(c=c.slice(1)),this.r=new n(s),this.s=new n(c),!(this.recoveryParam=null)},s.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=h(e),r=h(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];c(n,e.length),(n=n.concat(e)).push(2),c(n,r.length);var o=n.concat(r),s=[48];return c(s,o.length),s=s.concat(o),i.encode(s,t)}},{"../utils":24,"bn.js":9}],22:[function(t,e,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],23:[function(t,e,r){e.exports=void 0},{}],24:[function(t,e,r){var n=r,i=t("bn.js"),o=t("minimalistic-assert"),s=t("minimalistic-crypto-utils");n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<>1)-1>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0;0=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;othis.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e>>3},r.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},{"../utils":37}],37:[function(t,e,r){var n=t("minimalistic-assert"),i=t("inherits");function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function a(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}r.inherits=i,r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n>8,s=255&i;o?r.push(o,s):r.push(s)}else for(n=0;n>>0}return s},r.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},r.rotr32=function(t,e){return t>>>e|t<<32-e},r.rotl32=function(t,e){return t<>>32-e},r.sum32=function(t,e){return t+e>>>0},r.sum32_3=function(t,e,r){return t+e+r>>>0},r.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},r.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},r.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,s=(o>>0,t[e+1]=o},r.sum64_hi=function(t,e,r,n){return(e+n>>>0>>0},r.sum64_lo=function(t,e,r,n){return e+n>>>0},r.sum64_4_hi=function(t,e,r,n,i,o,s,a){var u=0,h=e;return u+=(h=h+n>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(t,e,r,n,i,o,s,a){return e+n+o+a>>>0},r.sum64_5_hi=function(t,e,r,n,i,o,s,a,u,h){var c=0,l=e;return c+=(l=l+n>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(t,e,r,n,i,o,s,a,u,h){return e+n+o+a+h>>>0},r.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},r.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},r.shr64_hi=function(t,e,r){return t>>>r},r.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},{inherits:39,"minimalistic-assert":41}],38:[function(t,e,r){var n=t("hash.js"),i=t("minimalistic-crypto-utils"),o=t("minimalistic-assert");function s(t){if(!(this instanceof s))return new s(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}(e.exports=s).prototype._init=function(t,e,r){var n=t.concat(e).concat(r);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(t.concat(r||[])),this._reseed=1},s.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}_.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,a=this.byteCount,u=this.blockCount,h=0,c=this.s;h>2]|=t[h]<>2]|=n<>2]|=(192|n>>6)<>2]|=(224|n>>12)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];a%e==0&&(M(r),s=0)}return i&&(t=r[s],0>4&15]+o[15&t]),1>12&15]+o[t>>8&15]),2>20&15]+o[t>>16&15])),u},_.prototype.buffer=_.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&M(n)}return o&&(t=a<<2,e=n[s],0>8&255),2>16&255)),u};var M=function(t){var e,r,n,i,o,s,u,h,c,l,f,d,p,m,v,g,y,w,b,_,M,k,S,x,A,E,T,O,N,P,R,I,C,D,j,L,U,B,F,H,G,z,W,q,K,Y,V,Z,J,$,X,Q,tt,et,rt,nt,it,ot,st,at,ut,ht,ct;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(h<<1|c>>>31),r=o^(c<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(l<<1|f>>>31),r=u^(f<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(d<<1|p>>>31),r=c^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(i<<1|o>>>31),r=f^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,m=t[0],v=t[1],Y=t[11]<<4|t[10]>>>28,V=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,N=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,D=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,g=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,Z=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,P=t[33]<<13|t[32]>>>19,R=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,ct=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,U=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,b=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,X=t[35]<<15|t[34]>>>17,I=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,A=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,E=t[18]<<20|t[19]>>>12,T=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,H=t[38]<<8|t[39]>>>24,G=t[39]<<8|t[38]>>>24,k=t[48]<<14|t[49]>>>18,S=t[49]<<14|t[48]>>>18,t[0]=m^~g&w,t[1]=v^~y&b,t[10]=x^~E&O,t[11]=A^~T&N,t[20]=D^~L&B,t[21]=j^~U&F,t[30]=q^~Y&Z,t[31]=K^~V&J,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=g^~w&_,t[3]=y^~b&M,t[12]=E^~O&P,t[13]=T^~N&R,t[22]=L^~B&H,t[23]=U^~F&G,t[32]=Y^~Z&$,t[33]=V^~J&X,t[42]=nt^~ot&at,t[43]=it^~st&ut,t[4]=w^~_&k,t[5]=b^~M&S,t[14]=O^~P&I,t[15]=N^~R&C,t[24]=B^~H&z,t[25]=F^~G&W,t[34]=Z^~$&Q,t[35]=J^~X&tt,t[44]=ot^~at&ht,t[45]=st^~ut&ct,t[6]=_^~k&m,t[7]=M^~S&v,t[16]=P^~I&x,t[17]=R^~C&A,t[26]=H^~z&D,t[27]=G^~W&j,t[36]=$^~Q&q,t[37]=X^~tt&K,t[46]=at^~ht&et,t[47]=ut^~ct&rt,t[8]=k^~m&g,t[9]=S^~v&y,t[18]=I^~x&E,t[19]=C^~A&T,t[28]=z^~D&L,t[29]=W^~j&U,t[38]=Q^~q&Y,t[39]=tt^~K&V,t[48]=ht^~et&nt,t[49]=ct^~rt&it,t[0]^=a[n],t[1]^=a[n+1]};if(i)e.exports=p;else for(v=0;v>8,s=255&i;o?r.push(o,s):r.push(s)}return r},n.zero2=i,n.toHex=o,n.encode=function(t,e){return"hex"===e?o(t):t}},{}],43:[function(t,e,r){e.exports={browser:!0}},{}],44:[function(t,e,r){(function(t){function n(t){var e=[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],r=1779033703,n=3144134277,i=1013904242,o=2773480762,s=1359893119,a=2600822924,u=528734635,h=1541459225,c=new Array(64);function l(t){for(var l=0,f=t.length;64<=f;){var d,p,m,v,g,y=r,w=n,b=i,_=o,M=s,k=a,S=u,x=h;for(p=0;p<16;p++)m=l+4*p,c[p]=(255&t[m])<<24|(255&t[m+1])<<16|(255&t[m+2])<<8|255&t[m+3];for(p=16;p<64;p++)v=((d=c[p-2])>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,g=((d=c[p-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3,c[p]=(v+c[p-7]|0)+(g+c[p-16]|0)|0;for(p=0;p<64;p++)v=(((M>>>6|M<<26)^(M>>>11|M<<21)^(M>>>25|M<<7))+(M&k^~M&S)|0)+(x+(e[p]+c[p]|0)|0)|0,g=((y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10))+(y&w^y&b^w&b)|0,x=S,S=k,k=M,M=_+v|0,_=b,b=w,w=y,y=v+g|0;r=r+y|0,n=n+w|0,i=i+b|0,o=o+_|0,s=s+M|0,a=a+k|0,u=u+S|0,h=h+x|0,l+=64,f-=64}}l(t);var f,d=t.length%64,p=t.length/536870912|0,m=t.length<<3,v=d<56?56:120,g=t.slice(t.length-d,t.length);for(g.push(128),f=1+d;f>>24&255),g.push(p>>>16&255),g.push(p>>>8&255),g.push(p>>>0&255),g.push(m>>>24&255),g.push(m>>>16&255),g.push(m>>>8&255),g.push(m>>>0&255),l(g),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,h>>>24&255,h>>>16&255,h>>>8&255,h>>>0&255]}function i(t,e,r){var i;t=t.length<=64?t:n(t);var o=64+e.length+4,s=new Array(o),a=new Array(64),u=[];for(i=0;i<64;i++)s[i]=54;for(i=0;i>>32-e}function a(t,e){h(t,0,e,0,16);for(var r=8;0>0&255),m.push(v[r]>>8&255),m.push(v[r]>>16&255),m.push(v[r]>>24&255);var g=i(e,m,f);return d(null,1,g)}I(t)}()}var d,p;d=this,p=2147483647,void 0!==r?e.exports=f:d&&(d.scrypt&&(d._scrypt=d.scrypt),d.scrypt=f)}).call(this,t("timers").setImmediate)},{timers:46}],45:[function(t,e,r){(function(t,e,r){!function(e,r){if(!e.setImmediate){var n,i,o,s,a=1,u={},h=!1,c=e.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(e);l=l&&l.setTimeout?l:e,n="[object process]"==={}.toString.call(e.process)?function(){var e=f(arguments);return t.nextTick(d(p,e)),e}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(s="setImmediate$"+Math.random()+"$",e.addEventListener?e.addEventListener("message",v,!1):e.attachEvent("onmessage",v),function(){var t=f(arguments);return e.postMessage(s+t,"*"),t}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},function(){var t=f(arguments);return o.port2.postMessage(t),t}):c&&"onreadystatechange"in c.createElement("script")?(i=c.documentElement,function(){var t=f(arguments),e=c.createElement("script");return e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e),t}):function(){var t=f(arguments);return setTimeout(d(p,t),0),t},l.setImmediate=n,l.clearImmediate=m}function f(t){return u[a]=d.apply(r,t),a++}function d(t){var e=[].slice.call(arguments,1);return function(){"function"==typeof t?t.apply(r,e):new Function(""+t)()}}function p(t){if(h)setTimeout(d(p,t),0);else{var e=u[t];if(e){h=!0;try{e()}finally{m(t),h=!1}}}}function m(t){delete u[t]}function v(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&p(+t.data.slice(s.length))}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,t("_process"),void 0!==p.d?p.d:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("timers").clearImmediate)},{_process:43,timers:46}],46:[function(t,e,r){(function(t){e.exports={setImmediate:t.setImmediate}}).call(this,void 0!==p.d?p.d:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],47:[function(t,e,r){(function(t){var r;if(t.crypto&&crypto.getRandomValues){var n=new Uint8Array(16);r=function(){return crypto.getRandomValues(n),n}}if(!r){var i=new Array(16);r=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),i[e]=t>>>((3&e)<<3)&255;return i}}e.exports=r}).call(this,void 0!==p.d?p.d:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],48:[function(t,e,r){for(var n=t("./rng"),i=[],o={},s=0;s<256;s++)i[s]=(s+256).toString(16).substr(1),o[i[s]]=s;function a(t,e){var r=e||0,n=i;return n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]}var u=n(),h=[1|u[0],u[1],u[2],u[3],u[4],u[5]],c=16383&(u[6]<<8|u[7]),l=0,f=0;function d(t,e,r){var i=e&&r||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null);var o=(t=t||{}).random||(t.rng||n)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var s=0;s<16;s++)e[i+s]=o[s];return e||a(o)}var p=d;p.v1=function(t,e,r){var n=e&&r||0,i=e||[],o=void 0!==(t=t||{}).clockseq?t.clockseq:c,s=void 0!==t.msecs?t.msecs:(new Date).getTime(),u=void 0!==t.nsecs?t.nsecs:f+1,d=s-l+(u-f)/1e4;if(d<0&&void 0===t.clockseq&&(o=o+1&16383),(d<0||l>>24&255,i[n++]=p>>>16&255,i[n++]=p>>>8&255,i[n++]=255&p;var m=s/4294967296*1e4&268435455;i[n++]=m>>>8&255,i[n++]=255&m,i[n++]=m>>>24&15|16,i[n++]=m>>>16&255,i[n++]=o>>>8|128,i[n++]=255&o;for(var v=t.node||h,g=0;g<6;g++)i[n+g]=v[g];return e||a(i)},p.v4=d,p.parse=function(t,e,r){var n=e&&r||0,i=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,(function(t){i<16&&(e[n+i++]=o[t])}));i<16;)e[n+i++]=0;return e},p.unparse=a,e.exports=p},{"./rng":47}],49:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});try{e.exports.XMLHttpRequest=XMLHttpRequest}catch(t){console.log("Warning: XMLHttpRequest is not defined"),e.exports.XMLHttpRequest=null}},{}],50:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("../utils/properties"),i=(o.isProvider=function(t){return n.isType(t,"Provider")},o);function o(){n.setType(this,"Provider")}r.Provider=i},{"../utils/properties":74}],51:[function(t,e,r){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s=t("../utils/address"),a=t("../utils/bignumber"),u=t("../utils/bytes"),h=t("../constants"),c=t("../utils/hash"),l=t("../utils/networks"),f=t("../utils/properties"),d=t("../utils/rlp"),p=t("../utils/transaction"),m=t("../utils/utf8"),v=t("../utils/web"),g=o(t("../errors")),y=t("./abstract-provider");function w(t,e){var r={};for(var n in t)try{var i=t[n](e[n]);void 0!==i&&(r[n]=i)}catch(t){throw t.checkKey=n,t.checkValue=e[n],t}return r}function b(t,e){return function(r){return null==r?e:t(r)}}function _(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");var r=[];return e.forEach((function(e){r.push(t(e))})),r}}function M(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),32===u.hexDataLength(t))?t.toLowerCase():(g.throwError("invalid hash",g.INVALID_ARGUMENT,{arg:"hash",value:t}),null)}function k(t){return a.bigNumberify(t).toNumber()}function S(t){if(!u.isHexString(t))throw new Error("invalid uint256");for(;t.length<66;)t="0x0"+t.substring(2);return t}function x(t){if(null==t)return"latest";if("earliest"===t)return"0x0";if("latest"===t||"pending"===t)return t;if("number"==typeof t)return u.hexStripZeros(u.hexlify(t));if(u.isHexString(t))return u.hexStripZeros(t);throw new Error("invalid blockTag")}var A={hash:M,blockHash:b(M,null),blockNumber:b(k,null),transactionIndex:b(k,null),confirmations:b(k,null),from:s.getAddress,gasPrice:a.bigNumberify,gasLimit:a.bigNumberify,to:b(s.getAddress,null),value:a.bigNumberify,nonce:k,data:u.hexlify,r:b(S),s:b(S),v:b(k),creates:b(s.getAddress,null),raw:b(u.hexlify)};function E(t){if(null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&a.bigNumberify(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=s.getContractAddress(t)),!t.raw&&t.v&&t.r&&t.s){var e=[u.stripZeros(u.hexlify(t.nonce)),u.stripZeros(u.hexlify(t.gasPrice)),u.stripZeros(u.hexlify(t.gasLimit)),t.to||"0x",u.stripZeros(u.hexlify(t.value||"0x")),u.hexlify(t.data||"0x"),u.stripZeros(u.hexlify(t.v||"0x")),u.stripZeros(u.hexlify(t.r)),u.stripZeros(u.hexlify(t.s))];t.raw=d.encode(e)}var r=w(A,t),n=t.networkId;return null!=t.chainId&&null==n&&null==r.v&&(n=t.chainId),u.isHexString(n)&&(n=a.bigNumberify(n).toNumber()),"number"!=typeof n&&null!=r.v&&((n=(r.v-35)/2)<0&&(n=0),n=parseInt(n)),"number"!=typeof n&&(n=0),r.networkId=n,null==r.chainId&&null!=n&&(r.chainId=n),r.blockHash&&"x"===r.blockHash.replace(/0/g,"")&&(r.blockHash=null),r}var T={hash:M,parentHash:M,number:k,timestamp:k,nonce:b(u.hexlify),difficulty:function(t){var e=a.bigNumberify(t);try{return e.toNumber()}catch(t){}return null},gasLimit:a.bigNumberify,gasUsed:a.bigNumberify,miner:s.getAddress,extraData:u.hexlify,transactions:b(_(M))},O=f.shallowCopy(T);function N(t,e){return null!=t.author&&null==t.miner&&(t.miner=t.author),w(e?O:T,t)}O.transactions=b(_(E));var P={from:b(s.getAddress),nonce:b(k),gasLimit:b(a.bigNumberify),gasPrice:b(a.bigNumberify),to:b(s.getAddress),value:b(a.bigNumberify),data:b(u.hexlify)};function R(t){return w(P,t)}var I={transactionLogIndex:b(k),transactionIndex:k,blockNumber:k,transactionHash:M,address:s.getAddress,topics:_(M),data:u.hexlify,logIndex:k,blockHash:M},C={to:b(s.getAddress,null),from:b(s.getAddress,null),contractAddress:b(s.getAddress,null),transactionIndex:k,root:b(M),gasUsed:a.bigNumberify,logsBloom:b(u.hexlify),blockHash:M,transactionHash:M,logs:_((function(t){return w(I,t)})),blockNumber:k,confirmations:b(k,null),cumulativeGasUsed:a.bigNumberify,status:b(k)};function D(t){return Array.isArray(t)?t.forEach((function(t){D(t)})):null!=t&&M(t),t}var j,L={fromBlock:b(x,void 0),toBlock:b(x,void 0),address:b(s.getAddress,void 0),topics:b(D,void 0)},U={blockHash:b(M,void 0),address:b(s.getAddress,void 0),topics:b(D,void 0)},B={blockNumber:b(k),blockHash:b(M),transactionIndex:k,removed:b((function(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===t)return!0;if("false"===t)return!1}throw new Error("invaid boolean - "+t)})),address:s.getAddress,data:(j=u.hexlify,function(t){return t?j(t):"0x"}),topics:_(M),transactionHash:M,logIndex:k};function F(t){return w(B,t)}function H(t){return t.map((function(t){return"string"==typeof t?t:Array.isArray(t)?(t.forEach((function(t){null!==t&&32!==u.hexDataLength(t)&&g.throwError("invalid topic",g.INVALID_ARGUMENT,{argument:"topic",value:t})})),t.join(",")):null===t?"":g.throwError("invalid topic value",g.INVALID_ARGUMENT,{argument:"topic",value:t})})).join("&")}function G(t){if("string"==typeof t){if(20===u.hexDataLength(t))return"address:"+s.getAddress(t);if(t=t.toLowerCase(),32===u.hexDataLength(t))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter::"+H(t);if(t&&"object"==typeof t)return"filter:"+(t.address||"")+":"+H(t.topics||[])}throw new Error("invalid event - "+t)}function z(){return(new Date).getTime()}var W,q=(i(K,W=y.Provider),K.prototype._doPoll=function(){var t=this;this.getBlockNumber().then((function(e){if(t.polling&&(t._setFastBlockNumber(e),e!==t._lastBlockNumber)){-2===t._emitted.block&&(t._emitted.block=e-1);for(var r=t._emitted.block+1;r<=e;r++)t.emit("block",r);t._emitted.block!==e&&(t._emitted.block=e,Object.keys(t._emitted).forEach((function(r){if("block"!==r){var n=t._emitted[r];"pending"!==n&&122*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((function(e){return(null==t._fastBlockNumber||e>t._fastBlockNumber)&&(t._fastBlockNumber=e),t._fastBlockNumber}))),this._fastBlockNumberPromise},K.prototype._setFastBlockNumber=function(t){null!=this._fastBlockNumber&&tthis._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))},K.prototype.waitForTransaction=function(t,e){var r=this;return null==e&&(e=1),this.getTransactionReceipt(t).then((function(n){return 0===e||n&&n.confirmations>=e?n:new Promise((function(n){r.on(t,(function i(o){o.confirmations(e=e.substring(64)).length)return null;var n=m.toUtf8String("0x"+e.substring(0,2*r));return i.resolveName(n).then((function(e){return e!=t?null:n}))}))},K.checkTransactionResponse=function(t){return E(t)},K.prototype.doPoll=function(){},K.prototype.perform=function(t,e){return g.throwError(t+" not implemented",g.NOT_IMPLEMENTED,{operation:t}),null},K.prototype._startPending=function(){g.warn("WARNING: this provider does not support pending events")},K.prototype._stopPending=function(){},K.prototype._addEventListener=function(t,e,r){this._events.push({tag:G(t),listener:e,once:r}),"pending"===t&&this._startPending(),this.polling=!0},K.prototype.on=function(t,e){return this._addEventListener(t,e,!1),this},K.prototype.once=function(t,e){return this._addEventListener(t,e,!0),this},K.prototype.addEventListener=function(t,e){return this.on(t,e)},K.prototype.emit=function(t){for(var e=this,r=[],n=1;nt.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},E);function E(t,e){return x.call(this,t,"null","",e,!1)||this}var T,O=(i(N,T=_),N.prototype.encode=function(t){try{var e=h.bigNumberify(t);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(e.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),e.lt(r))throw new Error("out-of-bounds")}else if(e.lt(s.Zero)||e.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),c.padZeros(c.arrayify(e),32)}catch(e){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},N.prototype.decode=function(t,e){t.length>1]>>4&&(e[i]=e[i].toUpperCase()),8<=(15&r[i>>1])&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var c={},l=0;l<10;l++)c[String(l)]=String(l);for(l=0;l<26;l++)c[String.fromCharCode(65+l)]=String(10+l);var f,d=Math.floor((f=9007199254740991,Math.log10?Math.log10(f):Math.log(f)/Math.LN10));function p(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=c[t]}));e.length>=d;){var r=e.substring(0,d);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function m(t){var e=null;if("string"!=typeof t&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=h(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:t}),e=new i.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});return e}r.getAddress=m,r.getIcapAddress=function(t){for(var e=new i.default.BN(m(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e},r.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return m("0x"+s.keccak256(a.encode([m(t.from),o.stripZeros(o.hexlify(e))])).substring(26))},r.getCreate2Address=function(t){var e=t.initCodeHash;t.initCode&&(e?s.keccak256(t.initCode)!==e&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:t}):e=s.keccak256(t.initCode)),e||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:t});var r=m(t.from),n=o.arrayify(t.salt);return 32!==n.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:t}),m("0x"+s.keccak256(o.concat(["0xff",r,n,e])).substring(26))}},{"../errors":5,"./bytes":64,"./keccak256":71,"./rlp":76,"bn.js":9}],61:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("../utils/bytes");e.exports={decode:function(t){t=atob(t);for(var e=[],r=0;r>=8;for(;0>=8}for(var a=0;t[a]===this._leader&&a>4]+l[15&u])}return"0x"+n.join("")}return i.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function d(t,e){for(c(t)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function p(t){var e=0,r="0x",n="0x";if(function(t){return t&&null!=t.r&&null!=t.s}(t)){null==t.v&&null==t.recoveryParam&&i.throwError("at least on of recoveryParam or v must be specified",i.INVALID_ARGUMENT,{argument:"signature",value:t}),r=d(t.r,32),n=d(t.s,32),"string"==typeof(e=t.v)&&(e=parseInt(e,16));var o=t.recoveryParam;null==o&&null!=t.v&&(o=1-e%2),e=27+o}else{var s=u(t);if(65!==s.length)throw new Error("invalid signature");r=f(s.slice(0,32)),n=f(s.slice(32,64)),27!==(e=s[64])&&28!==e&&(e=27+e%2)}return{r:r,s:n,recoveryParam:e-27,v:e}}r.hexlify=f,r.hexDataLength=function(t){return c(t)&&t.length%2==0?(t.length-2)/2:null},r.hexDataSlice=function(t,e,r){return c(t)||i.throwError("invalid hex data",i.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&i.throwError("hex data length must be even",i.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)},r.hexStripZeros=function(t){for(c(t)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:t});3>3)]=t>>24-n&255;var i=l.computeHmac(l.SupportedAlgorithms.sha512,this.chainCode,r),o=i.slice(0,32),s=i.slice(32),h=null,c=null;return this.privateKey?h=w(u.bigNumberify(o).add(this.privateKey).mod(m)):c=new d.KeyPair(a.hexlify(o))._addPoint(this.publicKey),new k(_,h,c,this.fingerprint,w(s),t,this.depth+1,this.mnemonic,e)},k.prototype.derivePath=function(t){var e=t.split("/");if(0===e.length||"m"===e[0]&&0!==this.depth)throw new Error("invalid path - "+t);"m"===e[0]&&e.shift();for(var r=this,n=0;n>3]|=1<<7-s%8),s++}var l=32*r.length/3,f=y(r.length/3),d=a.arrayify(p.sha256(n.slice(0,l/8)))[0];if((d&=f)!=(n[n.length-1]&f))throw new Error("invalid checksum");return a.hexlify(n.slice(0,l/8))}function E(t,e){if((t=a.arrayify(t)).length%4!=0||t.length<16||32>8-n,r.push(t[i]&(1<<8-n)-1),n+=3);var s=a.arrayify(p.sha256(t))[0],u=t.length/4;return s&=y(u),r[r.length-1]<<=u,r[r.length-1]|=s>>8-u,(e=e||o.langEn).join(r.map((function(t){return e.getWord(t)})))}r.HDNode=M,r.fromExtendedKey=function(t){var e=s.Base58.decode(t);82===e.length&&b(e.slice(0,78))===t||i.throwError("invalid extended key",i.INVALID_ARGUMENT,{argument:"extendedKey",value:"[REDACTED]"});var r=e[4],n=a.hexlify(e.slice(5,9)),o=parseInt(a.hexlify(e.slice(9,13)).substring(2),16),u=a.hexlify(e.slice(13,45)),h=e.slice(45,78);switch(a.hexlify(e.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new M(_,null,a.hexlify(h),n,u,o,r,null,null);case"0x0488ade4":case"0x04358394":if(0!==h[0])break;return new M(_,a.hexlify(h.slice(1)),null,n,u,o,r,null,null)}return i.throwError("invalid extended key",i.INVALID_ARGUMENT,{argument:"extendedKey",value:"[REDACTED]"})},r.fromMnemonic=function(t,e,r){return S(x(t=E(A(t,e),e),r),t)},r.fromSeed=function(t){return S(t,null)},r.mnemonicToSeed=x,r.mnemonicToEntropy=A,r.entropyToMnemonic=E,r.isValidMnemonic=function(t,e){try{return A(t,e),!0}catch(t){}return!1}},{"../errors":5,"../wordlists/lang-en":90,"./basex":62,"./bignumber":63,"./bytes":64,"./hmac":67,"./pbkdf2":73,"./properties":74,"./secp256k1":77,"./sha2":79,"./utf8":85}],67:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i,o,s=n(t("hash.js")),a=t("../utils/bytes"),u=n(t("../errors"));(o=i=r.SupportedAlgorithms||(r.SupportedAlgorithms={})).sha256="sha256",o.sha512="sha512",r.computeHmac=function(t,e,r){return i[t]||u.throwError("unsupported algorithm "+t,u.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:t}),a.arrayify(s.hmac(s[t],a.arrayify(e)).update(a.arrayify(r)).digest())}},{"../errors":5,"../utils/bytes":64,"hash.js":26}],68:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=t("./abi-coder");r.AbiCoder=i.AbiCoder,r.defaultAbiCoder=i.defaultAbiCoder,r.formatSignature=i.formatSignature,r.formatParamType=i.formatParamType,r.parseSignature=i.parseSignature,r.parseParamType=i.parseParamType;var o=t("./address");r.getAddress=o.getAddress,r.getContractAddress=o.getContractAddress,r.getCreate2Address=o.getCreate2Address,r.getIcapAddress=o.getIcapAddress;var s=n(t("./base64"));r.base64=s;var a=t("./bignumber");r.BigNumber=a.BigNumber,r.bigNumberify=a.bigNumberify;var u=t("./bytes");r.arrayify=u.arrayify,r.concat=u.concat,r.hexDataSlice=u.hexDataSlice,r.hexDataLength=u.hexDataLength,r.hexlify=u.hexlify,r.hexStripZeros=u.hexStripZeros,r.hexZeroPad=u.hexZeroPad,r.isHexString=u.isHexString,r.joinSignature=u.joinSignature,r.padZeros=u.padZeros,r.splitSignature=u.splitSignature,r.stripZeros=u.stripZeros;var h=t("./hash");r.hashMessage=h.hashMessage,r.id=h.id,r.namehash=h.namehash;var c=n(t("./hdnode"));r.HDNode=c;var l=t("./interface");r.Interface=l.Interface;var f=t("./json-wallet");r.getJsonWalletAddress=f.getJsonWalletAddress;var d=t("./keccak256");r.keccak256=d.keccak256;var p=t("./sha2");r.sha256=p.sha256;var m=t("./solidity");r.solidityKeccak256=m.keccak256,r.solidityPack=m.pack,r.soliditySha256=m.sha256;var v=t("./random-bytes");r.randomBytes=v.randomBytes;var g=t("./networks");r.getNetwork=g.getNetwork;var y=t("./properties");r.checkProperties=y.checkProperties,r.deepCopy=y.deepCopy,r.defineReadOnly=y.defineReadOnly,r.resolveProperties=y.resolveProperties,r.shallowCopy=y.shallowCopy;var w=n(t("./rlp"));r.RLP=w;var b=t("./secp256k1");r.computeAddress=b.computeAddress,r.computePublicKey=b.computePublicKey,r.recoverAddress=b.recoverAddress,r.recoverPublicKey=b.recoverPublicKey,r.verifyMessage=b.verifyMessage;var _=t("./signing-key");r.SigningKey=_.SigningKey;var M=t("./transaction");r.populateTransaction=M.populateTransaction;var k=t("./transaction");r.parseTransaction=k.parse,r.serializeTransaction=k.serialize;var S=t("./utf8");r.formatBytes32String=S.formatBytes32String,r.parseBytes32String=S.parseBytes32String,r.toUtf8Bytes=S.toUtf8Bytes,r.toUtf8String=S.toUtf8String;var x=t("./units");r.commify=x.commify,r.formatEther=x.formatEther,r.parseEther=x.parseEther,r.formatUnits=x.formatUnits,r.parseUnits=x.parseUnits;var A=t("./web");r.fetchJson=A.fetchJson,r.poll=A.poll;var E=t("./hmac");r.SupportedAlgorithms=E.SupportedAlgorithms;var T=t("./utf8");r.UnicodeNormalizationForm=T.UnicodeNormalizationForm;var O=t("./wordlist");r.Wordlist=O.Wordlist},{"./abi-coder":59,"./address":60,"./base64":61,"./bignumber":63,"./bytes":64,"./hash":65,"./hdnode":66,"./hmac":67,"./interface":69,"./json-wallet":70,"./keccak256":71,"./networks":72,"./properties":74,"./random-bytes":75,"./rlp":76,"./secp256k1":77,"./sha2":79,"./signing-key":81,"./solidity":82,"./transaction":83,"./units":84,"./utf8":85,"./web":86,"./wordlist":87}],69:[function(t,e,r){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};function s(t){for(var e in p.setType(this,"Description"),t)p.defineReadOnly(this,e,p.deepCopy(t[e],!0));Object.freeze(this)}Object.defineProperty(r,"__esModule",{value:!0});var a,u=t("./address"),h=t("./abi-coder"),c=t("./bignumber"),l=t("./bytes"),f=t("./hash"),d=t("./keccak256"),p=t("./properties"),m=o(t("../errors")),v=function(t){p.setType(this,"Indexed"),p.defineReadOnly(this,"hash",t)},g=(i(y,a=s),y.prototype.encode=function(t,e){l.isHexString(t)||m.throwError("invalid contract bytecode",m.INVALID_ARGUMENT,{arg:"bytecode",value:t}),m.checkArgumentCount(e.length,this.inputs.length," in Interface constructor");try{return t+h.defaultAbiCoder.encode(this.inputs,e).substring(2)}catch(t){m.throwError("invalid constructor argument",m.INVALID_ARGUMENT,{arg:t.arg,reason:t.reason,value:t.value})}return null},y);function y(){return null!==a&&a.apply(this,arguments)||this}var w,b=(i(_,w=s),_.prototype.encode=function(t){m.checkArgumentCount(t.length,this.inputs.length," in interface function "+this.name);try{return this.sighash+h.defaultAbiCoder.encode(this.inputs,t).substring(2)}catch(t){m.throwError("invalid input argument",m.INVALID_ARGUMENT,{arg:t.arg,reason:t.reason,value:t.value})}return null},_.prototype.decode=function(t){try{return h.defaultAbiCoder.decode(this.outputs,l.arrayify(t))}catch(e){m.throwError("invalid data for function output",m.INVALID_ARGUMENT,{arg:"data",errorArg:e.arg,errorValue:e.value,value:t,reason:e.reason})}},_);function _(){return null!==w&&w.apply(this,arguments)||this}var M,k=(i(S,M=s),S);function S(){return null!==M&&M.apply(this,arguments)||this}var x,A=(i(E,x=s),E.prototype.encodeTopics=function(t){var e=this;t.length>this.inputs.length&&m.throwError("too many arguments for "+this.name,m.UNEXPECTED_ARGUMENT,{maxCount:t.length,expectedCount:this.inputs.length});var r=[];for(this.anonymous||r.push(this.topic),t.forEach((function(t,n){var i=e.inputs[n];i.indexed?null==t?r.push(null):"string"===i.type?r.push(f.id(t)):"bytes"===i.type?r.push(d.keccak256(t)):-1!==i.type.indexOf("[")||"tuple"===i.type.substring(0,5)?m.throwError("filtering with tuples or arrays not implemented yet; bug us on GitHub",m.NOT_IMPLEMENTED,{operation:"filter(array|tuple)"}):("address"===i.type&&u.getAddress(t),r.push(l.hexZeroPad(l.hexlify(t),32).toLowerCase())):null!=t&&m.throwError("cannot filter non-indexed parameters; must be null",m.INVALID_ARGUMENT,{argument:i.name||n,value:t})}));r.length&&null===r[r.length-1];)r.pop();return r},E.prototype.decode=function(t,e){null==e||this.anonymous||(e=e.slice(1));var r=[],n=[],i=[];if(this.inputs.forEach((function(t,e){t.indexed?"string"===t.type||"bytes"===t.type||0<=t.type.indexOf("[")||"tuple"===t.type.substring(0,5)?(r.push({type:"bytes32",name:t.name||""}),i.push(!0)):(r.push(t),i.push(!1)):(n.push(t),i.push(!1))})),null!=e)var o=h.defaultAbiCoder.decode(r,l.concat(e));var s=h.defaultAbiCoder.decode(n,l.arrayify(t)),a={},u=0,c=0;return this.inputs.forEach((function(t,r){t.indexed?null==e?a[r]=new v(null):i[r]?a[r]=new v(o[c++]):a[r]=o[c++]:a[r]=s[u++],t.name&&(a[t.name]=a[r])})),a.length=this.inputs.length,new k(a)},E);function E(){return null!==x&&x.apply(this,arguments)||this}var T,O=(i(N,T=s),N);function N(){return null!==T&&T.apply(this,arguments)||this}var P,R=(i(I,P=s),I);function I(){return null!==P&&P.apply(this,arguments)||this}function C(t){switch(t.type){case"constructor":var e=new g({inputs:t.inputs,payable:null==t.payable||!!t.payable});this.deployFunction||(this.deployFunction=e);break;case"function":var r=h.formatSignature(t).replace(/tuple/g,""),n=f.id(r).substring(0,10),i=!1;null!=t.constant?i=t.constant:null!=t.stateMutability&&(i="view"==t.stateMutability||"pure"==t.stateMutability),e=new b({inputs:t.inputs,outputs:t.outputs,gas:t.gas,payable:null==t.payable||!!t.payable,type:i?"call":"transaction",name:t.name,signature:r,sighash:n}),t.name&&(null==this.functions[t.name]?p.defineReadOnly(this.functions,t.name,e):m.warn("WARNING: Multiple definitions for "+t.name)),null==this.functions[e.signature]&&p.defineReadOnly(this.functions,e.signature,e);break;case"event":r=h.formatSignature(t).replace(/tuple/g,""),e=new A({name:t.name,signature:r,inputs:t.inputs,topic:f.id(r),anonymous:!!t.anonymous}),t.name&&null==this.events[t.name]&&p.defineReadOnly(this.events,t.name,e),null==this.events[e.signature]&&p.defineReadOnly(this.events,e.signature,e);break;case"receive":case"fallback":break;default:m.warn("WARNING: unsupported ABI type - "+t.type)}}var D=(j.prototype.parseTransaction=function(t){var e=t.data.substring(0,10).toLowerCase();for(var r in this.functions)if(-1!==r.indexOf("(")){var n=this.functions[r];if(n.sighash===e){var i=h.defaultAbiCoder.decode(n.inputs,"0x"+t.data.substring(10));return new O({args:i,decode:n.decode,name:n.name,signature:n.signature,sighash:n.sighash,value:c.bigNumberify(t.value||"0")})}}return null},j.prototype.parseLog=function(t){for(var e in this.events)if(-1!==e.indexOf("(")){var r=this.events[e];if(!r.anonymous&&r.topic===t.topics[0])return new R({decode:r.decode,name:r.name,signature:r.signature,topic:r.topic,values:r.decode(t.data,t.topics)})}return null},j.isInterface=function(t){return p.isType(t,"Interface")},j.isIndexed=function(t){return p.isType(t,"Indexed")},j);function j(t){if(m.checkNew(this,j),"string"==typeof t){try{t=JSON.parse(t)}catch(e){m.throwError("could not parse ABI JSON",m.INVALID_ARGUMENT,{arg:"abi",errorMessage:e.message,value:t})}if(!Array.isArray(t))return m.throwError("invalid abi",m.INVALID_ARGUMENT,{arg:"abi",value:t}),null}p.defineReadOnly(this,"functions",{}),p.defineReadOnly(this,"events",{});var e=[];t.forEach((function(t){"string"==typeof t&&(t=h.parseSignature(t)),e.push(t)})),p.defineReadOnly(this,"abi",p.deepCopy(e,!0)),e.forEach(C,this),this.deployFunction||C.call(this,{type:"constructor",inputs:[]}),p.setType(this,"Interface")}r.Interface=D},{"../errors":5,"./abi-coder":59,"./address":60,"./bignumber":63,"./bytes":64,"./hash":65,"./keccak256":71,"./properties":74}],70:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("./address");function i(t){try{var e=JSON.parse(t)}catch(t){return!1}return e.encseed&&e.ethaddr}function o(t){try{var e=JSON.parse(t)}catch(t){return!1}return!(!e.version||parseInt(e.version)!==e.version||3!==parseInt(e.version))}r.isCrowdsaleWallet=i,r.isSecretStorageWallet=o,r.getJsonWalletAddress=function(t){if(i(t))try{return n.getAddress(JSON.parse(t).ethaddr)}catch(t){return null}if(o(t))try{return n.getAddress(JSON.parse(t).address)}catch(t){return null}return null}},{"./address":60}],71:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("js-sha3"),i=t("./bytes");r.keccak256=function(t){return"0x"+n.keccak_256(i.arrayify(t))}},{"./bytes":64,"js-sha3":40}],72:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=n(t("../errors"));function o(t){return function(e){var r=[];return e.InfuraProvider&&r.push(new e.InfuraProvider(t)),e.EtherscanProvider&&r.push(new e.EtherscanProvider(t)),0===r.length?null:e.FallbackProvider?new e.FallbackProvider(r):r[0]}}function s(t,e){return function(r){return r.JsonRpcProvider?new r.JsonRpcProvider(t,e):null}}var a={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:o("homestead")},u={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:o("ropsten")},h={unspecified:{chainId:0,name:"unspecified"},homestead:a,mainnet:a,morden:{chainId:2,name:"morden"},ropsten:u,testnet:u,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:o("rinkeby")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:o("goerli")},kovan:{chainId:42,name:"kovan",_defaultProvider:o("kovan")},classic:{chainId:61,name:"classic",_defaultProvider:s("https://web3.gastracker.io","classic")},classicTestnet:{chainId:62,name:"classicTestnet",_defaultProvider:s("https://web3.gastracker.io/morden","classicTestnet")}};r.getNetwork=function(t){if(null==t)return null;if("number"==typeof t){for(var e in h){var r=h[e];if(r.chainId===t)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){var n=h[t];return null==n?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}var o=h[t.name];return o?(0!==t.chainId&&t.chainId!==o.chainId&&i.throwError("network chainId mismatch",i.INVALID_ARGUMENT,{arg:"network",value:t}),{name:t.name,chainId:o.chainId,ensAddress:t.ensAddress||o.ensAddress||null,_defaultProvider:t._defaultProvider||o._defaultProvider||null}):("number"!=typeof t.chainId&&i.throwError("invalid network chainId",i.INVALID_ARGUMENT,{arg:"network",value:t}),t)}},{"../errors":5}],73:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("../utils/bytes"),i=t("./hmac");r.pbkdf2=function(t,e,r,o,s){var a;t=n.arrayify(t),e=n.arrayify(e);var u,h,c=1,l=new Uint8Array(o),f=new Uint8Array(e.length+4);f.set(e);for(var d=1;d<=c;d++){f[e.length]=d>>24&255,f[e.length+1]=d>>16&255,f[e.length+2]=d>>8&255,f[e.length+3]=255&d;var p=i.computeHmac(s,t,f);a||(a=p.length,h=new Uint8Array(a),u=o-((c=Math.ceil(o/a))-1)*a),h.set(p);for(var m=1;m>=8;return e}function o(t,e,r){for(var n=0,i=0;it.length)throw new Error("too short");if(e+1+r+(i=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+i)}if(192<=t[e]){if(e+1+(i=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,i)}if(184<=t[e]){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(i=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(t.slice(e+1+r,e+1+r+i))}}if(128<=t[e]){var i;if(e+1+(i=t[e]-128)>t.length)throw new Error("invalid rlp data");return{consumed:1+i,result:n.hexlify(t.slice(e+1,e+1+i))}}return{consumed:1,result:n.hexlify(t[e])}}r.encode=function(t){return n.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach((function(e){r=r.concat(t(e))})),r.length<=55?(r.unshift(192+r.length),r):((o=i(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(n.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=i(s.length)).unshift(183+o.length),o.concat(s))}(t))},r.decode=function(t){var e=n.arrayify(t),r=a(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},{"./bytes":64}],77:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=t("elliptic"),o=t("./address"),s=t("./bytes"),a=t("./hash"),u=t("./keccak256"),h=t("./properties"),c=n(t("../errors")),l=null;function f(){return l=l||new i.ec("secp256k1")}var d=(p.prototype.sign=function(t){var e=f().keyFromPrivate(s.arrayify(this.privateKey)).sign(s.arrayify(t),{canonical:!0});return{recoveryParam:e.recoveryParam,r:s.hexZeroPad("0x"+e.r.toString(16),32),s:s.hexZeroPad("0x"+e.s.toString(16),32),v:27+e.recoveryParam}},p.prototype.computeSharedSecret=function(t){var e=f().keyFromPrivate(s.arrayify(this.privateKey)),r=f().keyFromPublic(s.arrayify(m(t)));return s.hexZeroPad("0x"+e.derive(r.getPublic()).toString(16),32)},p.prototype._addPoint=function(t){var e=f().keyFromPublic(s.arrayify(this.publicKey)),r=f().keyFromPublic(s.arrayify(t));return"0x"+e.pub.add(r.pub).encodeCompressed("hex")},p);function p(t){var e=f().keyFromPrivate(s.arrayify(t));h.defineReadOnly(this,"privateKey",s.hexlify(e.priv.toArray("be",32))),h.defineReadOnly(this,"publicKey","0x"+e.getPublic(!1,"hex")),h.defineReadOnly(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),h.defineReadOnly(this,"publicKeyBytes",e.getPublic().encode(null,!0))}function m(t,e){var r=s.arrayify(t);if(32!==r.length)return 33===r.length?e?s.hexlify(r):"0x"+f().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?e?"0x"+f().keyFromPublic(r).getPublic(!0,"hex"):s.hexlify(r):(c.throwError("invalid public or private key",c.INVALID_ARGUMENT,{arg:"key",value:"[REDACTED]"}),null);var n=new d(r);return e?n.compressedPublicKey:n.publicKey}function v(t){var e="0x"+m(t).slice(4);return o.getAddress("0x"+u.keccak256(e).substring(26))}function g(t,e){var r=s.splitSignature(e),n={r:s.arrayify(r.r),s:s.arrayify(r.s)};return"0x"+f().recoverPubKey(s.arrayify(t),n,r.recoveryParam).encode("hex",!1)}function y(t,e){return v(g(s.arrayify(t),e))}r.KeyPair=d,r.computePublicKey=m,r.computeAddress=v,r.recoverPublicKey=g,r.recoverAddress=y,r.verifyMessage=function(t,e){return y(a.hashMessage(t),e)}},{"../errors":5,"./address":60,"./bytes":64,"./hash":65,"./keccak256":71,"./properties":74,elliptic:12}],78:[function(t,e,r){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var o=n(t("aes-js")),s=n(t("scrypt-js")),a=n(t("uuid")),u=t("./signing-key"),h=i(t("./hdnode")),c=t("./address"),l=t("./bytes"),f=t("./pbkdf2"),d=t("./keccak256"),p=t("./utf8"),m=t("./random-bytes");function v(t){return"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),l.arrayify(t)}function g(t,e){for(t=String(t);t.lengthe.maxLength&&o.throwError("invalid length for "+e.name,o.INVALID_ARGUMENT,{arg:"transaction"+e.name,value:n}),r.push(h.hexlify(n))})),null!=t.chainId&&0!==t.chainId&&(r.push(h.hexlify(t.chainId)),r.push("0x"),r.push("0x"));var n=f.encode(r);if(!e)return n;var i=h.splitSignature(e),s=27+i.recoveryParam;return 9===r.length&&(r.pop(),r.pop(),r.pop(),s+=2*t.chainId+8),r.push(h.hexlify(s)),r.push(h.stripZeros(h.arrayify(i.r))),r.push(h.stripZeros(h.arrayify(i.s))),f.encode(r)},r.parse=function(t){var e=f.decode(t);9!==e.length&&6!==e.length&&o.throwError("invalid raw transaction",o.INVALID_ARGUMENT,{arg:"rawTransactin",value:t});var r={nonce:p(e[0]).toNumber(),gasPrice:p(e[1]),gasLimit:p(e[2]),to:function(t){return"0x"===t?null:a.getAddress(t)}(e[3]),value:p(e[4]),data:e[5],chainId:0};if(6===e.length)return r;try{r.v=u.bigNumberify(e[6]).toNumber()}catch(t){return o.info(t),r}if(r.r=h.hexZeroPad(e[7],32),r.s=h.hexZeroPad(e[8],32),u.bigNumberify(r.r).isZero()&&u.bigNumberify(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);var n=r.v-27,i=e.slice(0,6);0!==r.chainId&&(i.push(h.hexlify(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);var l=c.keccak256(f.encode(i));try{r.from=s.recoverAddress(l,{r:h.hexlify(r.r),s:h.hexlify(r.s),recoveryParam:n})}catch(t){o.info(t)}r.hash=c.keccak256(t)}return r},r.populateTransaction=function(t,e,r){d.Provider.isProvider(e)||o.throwError("missing provider",o.INVALID_ARGUMENT,{argument:"provider",value:e}),l.checkProperties(t,v);var n=l.shallowCopy(t);if(null!=n.to&&(n.to=e.resolveName(n.to)),null==n.gasPrice&&(n.gasPrice=e.getGasPrice()),null==n.nonce&&(n.nonce=e.getTransactionCount(r)),null==n.gasLimit){var i=l.shallowCopy(n);i.from=r,n.gasLimit=e.estimateGas(i)}return null==n.chainId&&(n.chainId=e.getNetwork().then((function(t){return t.chainId}))),l.resolveProperties(n)}},{"../constants":3,"../errors":5,"../providers/abstract-provider":50,"./address":60,"./bignumber":63,"./bytes":64,"./keccak256":71,"./properties":74,"./rlp":76,"./secp256k1":77}],84:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i,o=t("../constants"),s=n(t("../errors")),a=t("./bignumber"),u={};function h(t){return{decimals:t.length-1,tenPower:a.bigNumberify(t)}}function c(t){var e=u[String(t).toLowerCase()];if(!e&&"number"==typeof t&&parseInt(String(t))==t&&0<=t&&t<=256){for(var r="1",n=0;nr.decimals&&s.throwError("underflow occurred",s.NUMERIC_FAULT,{operation:"division",fault:"underflow"});h.length>6|192),r.push(63&o|128);else if(55296==(64512&o)){i++;var u=t.charCodeAt(i);if(i>=t.length||56320!=(64512&u))throw new Error("invalid utf-8 string");o=65536+((1023&o)<<10)+(1023&u),r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(o>>12|224),r.push(o>>6&63|128),r.push(63&o|128)}return a.arrayify(r)}function h(t,e){t=a.arrayify(t);for(var r="",n=0;n>7!=0){var o=null,s=null;if(192==(224&i))o=1,s=127;else if(224==(240&i))o=2,s=2047;else{if(240!=(248&i)){if(e)continue;if(128==(192&i))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}o=3,s=65535}if(n+o>t.length){if(!e)throw new Error("invalid utf8 byte sequence; too short");for(;n>6==2;n++);}else{for(var u=i&(1<<8-o-1)-1,h=0;h>10&1023),56320+(1023&u)));else if(!e)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(i)}return r}(i=n=r.UnicodeNormalizationForm||(r.UnicodeNormalizationForm={})).current="",i.NFC="NFC",i.NFD="NFD",i.NFKC="NFKC",i.NFKD="NFKD",r.toUtf8Bytes=u,r.toUtf8String=h,r.formatBytes32String=function(t){var e=u(t);if(31e.ceiling&&(n=e.ceiling),a&&(u--,n=a,a=null),setTimeout(i,n)}return null}),(function(t){s()&&n(t)}))}()}))}},{"../errors":5,"./base64":61,"./properties":74,"./utf8":85,xmlhttprequest:49}],87:[function(t,e,r){(function(e){Object.defineProperty(r,"__esModule",{value:!0});var n=t("../utils/hash"),i=t("../utils/properties");r.check=function(t){for(var e=[],r=0;r<2048;r++){var i=t.getWord(r);if(r!==t.getWordIndex(i))return"0x";e.push(i)}return n.id(e.join("\n")+"\n")};var o=(s.prototype.split=function(t){return t.toLowerCase().split(/ +/g)},s.prototype.join=function(t){return t.join(" ")},s);function s(t){i.defineReadOnly(this,"locale",t)}r.Wordlist=o,r.register=function(t,e){e=e||t.locale}}).call(this,void 0!==p.d?p.d:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils/hash":65,"../utils/properties":74}],88:[function(t,e,r){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s,a=t("./utils/bytes"),u=t("./utils/hash"),h=t("./utils/hdnode"),c=t("./utils/json-wallet"),l=t("./utils/keccak256"),f=t("./utils/properties"),d=t("./utils/random-bytes"),p=o(t("./utils/secret-storage")),m=t("./utils/signing-key"),v=t("./utils/transaction"),g=t("./abstract-signer"),y=t("./providers/abstract-provider"),w=o(t("./errors")),b=(i(_,s=g.Signer),Object.defineProperty(_.prototype,"address",{get:function(){return this.signingKey.address},enumerable:!0,configurable:!0}),Object.defineProperty(_.prototype,"mnemonic",{get:function(){return this.signingKey.mnemonic},enumerable:!0,configurable:!0}),Object.defineProperty(_.prototype,"path",{get:function(){return this.signingKey.path},enumerable:!0,configurable:!0}),Object.defineProperty(_.prototype,"privateKey",{get:function(){return this.signingKey.privateKey},enumerable:!0,configurable:!0}),_.prototype.connect=function(t){return y.Provider.isProvider(t)||w.throwError("invalid provider",w.INVALID_ARGUMENT,{argument:"provider",value:t}),new _(this.signingKey,t)},_.prototype.getAddress=function(){return Promise.resolve(this.address)},_.prototype.sign=function(t){var e=this;return f.resolveProperties(t).then((function(t){var r=v.serialize(t),n=e.signingKey.signDigest(l.keccak256(r));return v.serialize(t,n)}))},_.prototype.signMessage=function(t){return Promise.resolve(a.joinSignature(this.signingKey.signDigest(u.hashMessage(t))))},_.prototype.getBalance=function(t){if(!this.provider)throw new Error("missing provider");return this.provider.getBalance(this.address,t)},_.prototype.getTransactionCount=function(t){if(!this.provider)throw new Error("missing provider");return this.provider.getTransactionCount(this.address,t)},_.prototype.sendTransaction=function(t){var e=this;if(!this.provider)throw new Error("missing provider");return null==t.nonce&&((t=f.shallowCopy(t)).nonce=this.getTransactionCount("pending")),v.populateTransaction(t,this.provider,this.address).then((function(t){return e.sign(t).then((function(t){return e.provider.sendTransaction(t)}))}))},_.prototype.encrypt=function(t,e,r){if("function"!=typeof e||r||(r=e,e={}),r&&"function"!=typeof r)throw new Error("invalid callback");return e=e||{},this.mnemonic&&((e=f.shallowCopy(e)).mnemonic=this.mnemonic,e.path=this.path),p.encrypt(this.privateKey,t,e,r)},_.createRandom=function(t){var e=d.randomBytes(16);(t=t||{}).extraEntropy&&(e=a.arrayify(l.keccak256(a.concat([e,t.extraEntropy])).substring(0,34)));var r=h.entropyToMnemonic(e,t.locale);return _.fromMnemonic(r,t.path,t.locale)},_.fromEncryptedJson=function(t,e,r){if(c.isCrowdsaleWallet(t))try{r&&r(0);var n=p.decryptCrowdsale(t,e);return r&&r(1),Promise.resolve(new _(n))}catch(t){return Promise.reject(t)}else if(c.isSecretStorageWallet(t))return p.decrypt(t,e,r).then((function(t){return new _(t)}));return Promise.reject("invalid wallet JSON")},_.fromMnemonic=function(t,e,r){return e=e||h.defaultPath,new _(h.fromMnemonic(t,r).derivePath(e))},_);function _(t,e){var r=s.call(this)||this;return w.checkNew(r,_),m.SigningKey.isSigningKey(t)?f.defineReadOnly(r,"signingKey",t):f.defineReadOnly(r,"signingKey",new m.SigningKey(t)),f.defineReadOnly(r,"provider",e),r}r.Wallet=b},{"./abstract-signer":2,"./errors":5,"./providers/abstract-provider":50,"./utils/bytes":64,"./utils/hash":65,"./utils/hdnode":66,"./utils/json-wallet":70,"./utils/keccak256":71,"./utils/properties":74,"./utils/random-bytes":75,"./utils/secret-storage":78,"./utils/signing-key":81,"./utils/transaction":83}],89:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("../wordlists/lang-en").langEn;r.en=n},{"../wordlists/lang-en":90}],90:[function(t,e,r){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var o,s=t("../utils/wordlist"),a=null;function u(t){if(null==a&&(a="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==s.check(t)))throw a=null,new Error("BIP39 Wordlist for en (English) FAILED")}function h(){return o.call(this,"en")||this}var c=new(i(h,o=s.Wordlist),h.prototype.getWord=function(t){return u(this),a[t]},h.prototype.getWordIndex=function(t){return u(this),a.indexOf(t)},h);r.langEn=c,s.register(c)},{"../utils/wordlist":87}]},{},[7])(7)})));var Ee="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),Te=new Uint8Array(16);function Oe(){if(!Ee)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ee(Te)}for(var Ne,Pe,Re=[],Ie=0;Ie<256;++Ie)Re[Ie]=(Ie+256).toString(16).substr(1);function Ce(t,e){var r=e||0,n=Re;return[n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]]].join("")}var De=0,je=0;function Le(t,e,r){var n=function(t,n,i,o){var s=i&&o||0;if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=new Array(t.length),r=0;r>16)+(e>>16)+(r>>16)<<16|65535&r}function Be(t,e,r,n,i,o){return Ue((s=Ue(Ue(e,t),Ue(n,o)))<<(a=i)|s>>>32-a,r);var s,a}function Fe(t,e,r,n,i,o,s){return Be(e&r|~e&n,t,e,i,o,s)}function He(t,e,r,n,i,o,s){return Be(e&n|r&~n,t,e,i,o,s)}function Ge(t,e,r,n,i,o,s){return Be(e^r^n,t,e,i,o,s)}function ze(t,e,r,n,i,o,s){return Be(r^(e|~n),t,e,i,o,s)}var We=Le("v3",48,(function(t){if("string"==typeof t){var e=unescape(encodeURIComponent(t));t=new Array(e.length);for(var r=0;r>5]>>>e%32&255,n=parseInt("0123456789abcdef".charAt(r>>>4&15)+"0123456789abcdef".charAt(15&r),16),i.push(n);return i}(function(t,e){var r,n,i,o,s;t[e>>5]|=128<>>9<<4)]=e;var a=1732584193,u=-271733879,h=-1732584194,c=271733878;for(r=0;r>2)-1]=void 0,e=0;e>5]|=(255&t[e/8])<>>32-e}var Ye=Le("v5",80,(function(t){var e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){var n=unescape(encodeURIComponent(t));t=new Array(n.length);for(var i=0;i>>0;m=p,p=d,d=Ke(f,30)>>>0,f=l,l=g}r[0]=r[0]+l>>>0,r[1]=r[1]+f>>>0,r[2]=r[2]+d>>>0,r[3]=r[3]+p>>>0,r[4]=r[4]+m>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),Ve=Object.freeze({__proto__:null,v1:function(t,e,r){var n=e&&r||0,i=e||[],o=(t=t||{}).node||Ne,s=void 0!==t.clockseq?t.clockseq:Pe;if(null==o||null==s){var a=t.random||(t.rng||Oe)();null==o&&(o=Ne=[1|a[0],a[1],a[2],a[3],a[4],a[5]]),null==s&&(s=Pe=16383&(a[6]<<8|a[7]))}var u=void 0!==t.msecs?t.msecs:(new Date).getTime(),h=void 0!==t.nsecs?t.nsecs:je+1,c=u-De+(h-je)/1e4;if(c<0&&void 0===t.clockseq&&(s=s+1&16383),(c<0||u>De)&&void 0===t.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");De=u,je=h,Pe=s;var l=(1e4*(268435455&(u+=122192928e5))+h)%4294967296;i[n++]=l>>>24&255,i[n++]=l>>>16&255,i[n++]=l>>>8&255,i[n++]=255&l;var f=u/4294967296*1e4&268435455;i[n++]=f>>>8&255,i[n++]=255&f,i[n++]=f>>>24&15|16,i[n++]=f>>>16&255,i[n++]=s>>>8|128,i[n++]=255&s;for(var d=0;d<6;++d)i[n+d]=o[d];return e||Ce(i)},v3:We,v4:function(t,e,r){var n=e&&r||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var i=(t=t||{}).random||(t.rng||Oe)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e)for(var o=0;o<16;++o)e[n+o]=i[o];return e||Ce(i)},v5:Ye}),Ze=Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.uuid=function(){return Ve.v4()};var r={v4:/(?:^[0-9a-f]{8}\x2D[0-9a-f]{4}\x2D4[0-9a-f]{3}\x2D[0-9a-f]{4}\x2D[0-9a-f]{12}$)|(?:^0{8}\x2D0{4}\x2D0{4}\x2D0{4}\x2D0{12}$)/,v5:/(?:^[0-9a-f]{8}\x2D[0-9a-f]{4}\x2D5[0-9a-f]{3}\x2D[0-9a-f]{4}\x2D[0-9a-f]{12}$)|(?:^0{8}\x2D0{4}\x2D0{4}\x2D0{4}\x2D0{12}$)/};e.regex=r,e.isUuid=function(t){return r.v4.test(t)||r.v5.test(t)},e.empty=function(){return"00000000-0000-0000-0000-000000000000"},e.fromString=function(t){return Ve.v5(t,"bb5d0ffa-9a4c-4d7c-8fc2-0a7d2220ba45")}})),Je=Object(p.c)(Ze),$e=Ze.uuid,Xe=Ze.regex,Qe=Ze.isUuid,tr=Ze.empty,er=Ze.fromString,rr=Object.freeze({__proto__:null,default:Je,__moduleExports:Ze,uuid:$e,regex:Xe,isUuid:Qe,empty:tr,fromString:er}),nr=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},ir=rr.uuid,or=function(t){return nr(void 0,void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){return setTimeout((function(){return e()}),t)})));case 1:case"end":return e.stop()}}),e)})))},sr=function(t,e){var r=new Map,n=0;return function(){for(var i,o=this,s=arguments.length,a=new Array(s),u=0;ue&&(n=h,i=setTimeout((function(){s(t.apply(o,a)),r.delete(i)}),n-h)),r.set(i,u)}))}},ar=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},ur=function(t){Object(c.a)(r,t);var e=Object(l.a)(r);function r(t){var n;Object(u.a)(this,r),(n=e.call(this)).isAuthereum=!0,n.lastSignTx="",n.lastSignTxTimeout=null,n.lastTx="",n.lastTxTimeout=null,n.lastMsg="",n.lastMsgTimeout=null,n.lastTypedMsg="",n.lastTypedMsgTimeout=null,n.concatAuthKeySig=function(t){return ar(Object(i.a)(n),void 0,void 0,s.a.mark((function e(){var r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.authereum.getLoginKeyAuthSignature();case 2:return r=e.sent,e.abrupt("return",(r=r.slice(2),t.concat(r)));case 4:case"end":return e.stop()}}),e,this)})))};var o=null;return t instanceof vr&&(t=(o=t).config),n.config=t||{},n.authereum=o||new vr(n.config),n.initSubprovider(),n.isAuthereum=!0,n}return Object(h.a)(r,[{key:"initSubprovider",value:function(){return ar(this,void 0,void 0,s.a.mark((function t(){var e,r=this;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.authereum._tilReady();case 2:if(t.t0=this.config.rpcUri,t.t0){t.next=7;break}return t.next=6,this.authereum.getRpcUri();case 6:t.t0=t.sent;case 7:this.rpcUri=t.t0,e=new rt({getAccounts:function(t){return ar(r,void 0,void 0,s.a.mark((function e(){var r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.authereum.isAuthenticated();case 2:if(e.sent){e.next=4;break}return e.abrupt("return",(t&&t(null,[]),[]));case 4:return e.next=6,this.authereum.getAccountAddress();case 6:return r=e.sent,e.abrupt("return",r?(t&&t(null,[r]),[r]):(t&&t(null,[]),[]));case 8:case"end":return e.stop()}}),e,this)})))},approveTransaction:function(t,e){return ar(r,void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(e&&e(null,!0),!0));case 1:case"end":return t.stop()}}),t)})))},approveMessage:function(t,e){return ar(r,void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(e&&e(null,!0),!0));case 1:case"end":return t.stop()}}),t)})))},approveTypedMessage:function(t,e){return ar(r,void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(e&&e(null,!0),!0));case 1:case"end":return t.stop()}}),t)})))},signMessage:function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){var n,i,o=this;return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=t;try{n=JSON.stringify(t)}catch(t){}if(clearTimeout(this.lastMsgTimeout),this.lastMsg!==n){r.next=4;break}return r.abrupt("return",this._throttledSignMessage(t,e));case 4:return i=!this.lastMsg,r.abrupt("return",(this.lastMsg=n,this.lastMsgTimeout=setTimeout((function(){o.lastMsg=""}),2e3),i?this._throttledSignMessage(t,e):this._signMessage(t,e)));case 6:case"end":return r.stop()}}),r,this)})))},signTransaction:function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){var n,i,o,a=this;return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if((n=Object.assign({},t)).nonce=null,i=JSON.stringify(n),clearTimeout(this.lastSignTxTimeout),this.lastSignTx!==i){r.next=5;break}return r.abrupt("return",this._throttledSignTransaction(t,e));case 5:return o=!this.lastSignTx,r.abrupt("return",(this.lastSignTx=i,this.lastSignTxTimeout=setTimeout((function(){a.lastSignTx=""}),2e3),o?this._throttledSignTransaction(t,e):this._signTransaction(t,e)));case 7:case"end":return r.stop()}}),r,this)})))},processTransaction:function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){var n,i,o,a=this;return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if((n=Object.assign({},t)).nonce=null,i=JSON.stringify(n),clearTimeout(this.lastTxTimeout),this.lastTx!==i){r.next=5;break}return r.abrupt("return",this._throttledProcessTransaction(t,e));case 5:return o=!this.lastTx,r.abrupt("return",(this.lastTx=i,this.lastTxTimeout=setTimeout((function(){a.lastTx=""}),2e3),o?this._throttledProcessTransaction(t,e):this._processTransaction(t,e)));case 7:case"end":return r.stop()}}),r,this)})))},approvePersonalMessage:function(t,e){return ar(r,void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(e&&e(null,!0),!0));case 1:case"end":return t.stop()}}),t)})))},signPersonalMessage:function(t,n){return ar(r,void 0,void 0,s.a.mark((function r(){return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",e.signMessage(t,n));case 1:case"end":return r.stop()}}),r)})))},signTypedMessage:function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){var n,i,o=this;return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=t;try{n=JSON.stringify(t)}catch(t){}if(clearTimeout(this.lastTypedMsgTimeout),this.lastTypedMsg!==n){r.next=4;break}return r.abrupt("return",this._throttledSignTypedMessage(t,e));case 4:return i=!this.lastTypedMsg,r.abrupt("return",(this.lastTypedMsg=n,this.lastTypedMsgTimeout=setTimeout((function(){o.lastTypedMsg=""}),2e3),i?this._throttledSignTypedMessage(t,e):this._signTypedMessage(t,e)));case 6:case"end":return r.stop()}}),r,this)})))}}),this.walletSubprovider=e,this._processTransaction=function(t,n){return ar(r,void 0,void 0,s.a.mark((function r(){var i,o;return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,re(e.signTransaction.bind(e))(t);case 3:return i=r.sent,o=Ae(i),r.abrupt("return",(n&&n(null,o),o));case 8:if(r.prev=8,r.t0=r.catch(0),!n){r.next=12;break}return r.abrupt("return",void n(r.t0));case 12:throw r.t0;case 13:case"end":return r.stop()}}),r,null,[[0,8]])})))},this._throttledProcessTransaction=sr((function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this._processTransaction(t,e));case 1:case"end":return r.stop()}}),r,this)})))}),2e3),this._signMessage=function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){var n,i,o,a;return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.authereum.signWithDappKey(t.data);case 3:return n=r.sent,r.next=6,this.authereum.getLoginKeyAuthSignature();case 6:return i=r.sent,r.next=9,this.authereum.getLoginKeyRestrictionsData();case 9:return o=r.sent,i=i.slice(2),o=o.slice(2),a=n.concat(i,o),r.abrupt("return",(e&&e(null,a),a));case 15:r.prev=15,r.t0=r.catch(0),e&&e(r.t0);case 18:case"end":return r.stop()}}),r,this,[[0,15]])})))},this._throttledSignMessage=sr((function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this._signMessage(t,e));case 1:case"end":return r.stop()}}),r,this)})))}),2e3),this._signTypedMessage=function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){var n,i;return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.authereum.signTypedMessageWithDappKey(t.data);case 3:return n=r.sent,r.next=6,this.concatAuthKeySig(n);case 6:return i=r.sent,r.abrupt("return",(e&&e(null,i),i));case 10:r.prev=10,r.t0=r.catch(0),e&&e(r.t0);case 13:case"end":return r.stop()}}),r,this,[[0,10]])})))},this._throttledSignTypedMessage=sr((function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this._signTypedMessage(t,e));case 1:case"end":return r.stop()}}),r,this)})))}),2e3),this._signTransaction=function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){var n;return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.authereum.signTransactionWithLoginKey(t);case 3:if(n=r.sent){r.next=6;break}throw new Error("Error signing transaction");case 6:return r.abrupt("return",(e&&e(null,n.signedTransactionData),n.signedTransactionData));case 9:r.prev=9,r.t0=r.catch(0),e(r.t0);case 12:case"end":return r.stop()}}),r,this,[[0,9]])})))},this._throttledSignTransaction=sr((function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this._signTransaction(t,e));case 1:case"end":return r.stop()}}),r,this)})))}),2e3),this._sendAsync=this.sendAsync,this.sendAsync=function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){var n=this;return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Promise((function(r,i){e||(e=function(t,e){t?i(t):r(e)}),n._sendAsync(t,e)})));case 1:case"end":return r.stop()}}),r)})))},this.send=function(t,e){if("string"==typeof t)return new Promise((function(n,i){r.sendAsync({jsonrpc:"2.0",id:42,method:t,params:e||[]},(function(t,e){t?i(t):n(e.result)}))}));if(!e){var n=null;switch(t.method){case"eth_uninstallFilter":r.sendAsync(t,(function(){})),n=!0;break;default:var i="The Authereum Web3 object does not support synchronous methods like ".concat(t.method," without a callback parameter.");throw new Error(i)}return{id:t.id,jsonrpc:t.jsonrpc,result:n}}r.sendAsync(t,e)},e.handleRequest=function(t,e,r){var n,i,o,s,a,u=this;switch(u._parityRequests={},u._parityRequestCount=0,t.method){case"eth_coinbase":return void u.getAccounts((function(t,e){if(t)return r(t);var n=e[0]||null;r(null,n)}));case"eth_accounts":return void u.getAccounts((function(t,e){if(t)return r(t);r(null,e)}));case"eth_sendTransaction":return n=t.params[0],void G([function(t){return u.processTransaction(n,t)}],r);case"eth_signTransaction":return n=t.params[0],void G([function(t){return u.processSignTransaction(n,t)}],r);case"eth_sign":return a=t.params[0],s=t.params[1],o=t.params[2]||{},i=Object(v.h)(o,{from:a,data:s}),void G([function(t){return u.processMessage(i,t)}],r);case"personal_sign":return function(){var e=t.params[0];if(cr(t.params[1])&&hr(e)){"[message, address]. This was previously handled incorrectly, ","and has been corrected automatically. ","Please switch this param order for smooth behavior in the future.",console.warn("The eth_personalSign method requires params ordered [message, address]. This was previously handled incorrectly, and has been corrected automatically. Please switch this param order for smooth behavior in the future."),a=t.params[0],s=t.params[1]}else s=t.params[0],a=t.params[1];o=t.params[2]||{},i=Object(v.h)(o,{from:a,data:s}),G([function(t){return u.processPersonalMessage(i,t)}],r)}();case"eth_decryptMessage":return function(){var e=t.params[0];if(cr(t.params[1])&&hr(e)){"[message, address]. This was previously handled incorrectly, ","and has been corrected automatically. ","Please switch this param order for smooth behavior in the future.",console.warn("The eth_decryptMessage method requires params ordered [message, address]. This was previously handled incorrectly, and has been corrected automatically. Please switch this param order for smooth behavior in the future."),a=t.params[0],s=t.params[1]}else s=t.params[0],a=t.params[1];o=t.params[2]||{},i=Object(v.h)(o,{from:a,data:s}),G([function(t){return u.validateDecryptMessage(i,t)},function(t){return u.processDecryptMessage(i,t)}],r)}();case"encryption_public_key":return a=t.params[0],void G([function(t){return u.validateEncryptionPublicKey(a,t)},function(t){return u.processEncryptionPublicKey(a,t)}],r);case"personal_ecRecover":return function(){s=t.params[0];var e=t.params[1];o=t.params[2]||{},i=Object(v.h)(o,{sig:e,data:s}),u.recoverPersonalSignature(i,r)}();case"eth_signTypedData":return s=t.params[0],a=t.params[1],o=t.params[2]||{},i=Object(v.h)(o,{from:a,data:s}),void G([function(t){return u.processTypedMessage(i,t)}],r);case"eth_signTypedData_v3":return a=t.params[0],s=t.params[1],o=t.params[2]||{},i=Object(v.h)(o,{from:a,data:s}),void G([function(t){return u.processTypedMessage(i,t)}],r);case"parity_postTransaction":return n=t.params[0],void u.parityPostTransaction(n,r);case"parity_postSign":return a=t.params[0],s=t.params[1],void u.parityPostSign(a,s,r);case"parity_checkRequest":return function(){var e=t.params[0];u.parityCheckRequest(e,r)}();case"parity_defaultAccount":return void u.getAccounts((function(t,e){if(t)return r(t);var n=e[0]||null;r(null,n)}));default:return void e()}},e.validatePersonalMessage=function(t,e){return ar(r,void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(e&&e(null,!0),!0));case 1:case"end":return t.stop()}}),t)})))},e.validateMessage=function(t,e){return ar(r,void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(e&&e(null,!0),!0));case 1:case"end":return t.stop()}}),t)})))},e.validateTypedMessage=function(t,e){return ar(r,void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(e&&e(null,!0),!0));case 1:case"end":return t.stop()}}),t)})))},this.addProvider(e),this.rpcSubProvider=new Jt({rpcUrl:this.rpcUri}),this.addProvider(new Qt),this.addProvider(new te),this.addProvider({setEngine:function(t){return t},handleRequest:function(t,e,n){return ar(r,void 0,void 0,s.a.mark((function r(){return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:this.rpcSubProvider.handleRequest(t,e,n);case 1:case"end":return r.stop()}}),r,this)})))}}),this.on("error",(function(t){console.error(t.stack)})),this.start(),this._blockTracker.removeAllListeners();case 10:case"end":return t.stop()}}),t,this)})))}},{key:"getAccounts",value:function(t){return ar(this,void 0,void 0,s.a.mark((function e(){var r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.authereum.isAuthenticated();case 2:if(e.sent){e.next=4;break}return e.abrupt("return",(t&&t(null,[]),[]));case 4:return e.next=6,this.authereum.getAccountAddress();case 6:return r=e.sent,e.abrupt("return",r?(t&&t(null,[r]),[r]):(t&&t(null,[]),[]));case 8:case"end":return e.stop()}}),e,this)})))}},{key:"isConnected",value:function(){return this.authereum.isAuthenticatedSync()}},{key:"enable",value:function(){return ar(this,void 0,void 0,s.a.mark((function t(){var e;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.authereum.login();case 2:return t.next=4,this.authereum.getAccountAddress();case 4:return e=t.sent,t.abrupt("return",e?[e]:[]);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"disable",value:function(){return ar(this,void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.authereum.logout());case 1:case"end":return t.stop()}}),t,this)})))}},{key:"tilDomReady",value:function(){return new Promise((function(t){"loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",(function(){return t()}))}))}},{key:"sendTransaction",value:function(t){return ar(this,void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.sendTransactionBatch([t]));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"sendTransactionBatch",value:function(t){return ar(this,void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.authereum.sendTransactionBatch(t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"estimateGasBatch",value:function(t){return ar(this,void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.authereum.estimateGasBatch(t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"sign",value:function(t){return this._signMessage(t)}},{key:"signMessageWithAdminKey",value:function(t){return this.authereum.signMessageWithAdminKey(t)}},{key:"signMessageWithSigningKey",value:function(t){return this.authereum.signMessageWithSigningKey(t)}},{key:"showWidget",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.authereum.showWidget(t)}},{key:"widgetEnabled",value:function(){return this.authereum.widgetEnabled()}},{key:"getTransactionReceipt",value:function(t){return this.authereum.getTransactionReceipt(t)}},{key:"waitForTransactionReceipt",value:function(t){return this.authereum.waitForTransactionReceipt(t)}},{key:"isContractDeployed",value:function(t){return this.authereum.isContractDeployed(t)}}]),r}(J);function hr(t){var e=Object(v.j)(t);return Object(v.k)(e)}function cr(t){var e=Object(v.j)(t);return!Object(v.k)(e)&&function(t){return"string"==typeof t&&("0x"===t.slice(0,2)&&t.slice(2).match(/^[0-9A-Fa-f]+$/g))}(t)}var lr=function(t){return"https://".concat("mainnet"===t?"":"".concat(t,"."),"x.authereum.com")},fr=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},dr=function(t){var e={};for(var r in t){var n=t[r];"object"==typeof n&&"function"===n.toString&&(n=n.toString("hex")),e[r]=n}return e},pr={width:0,height:0,top:0,left:0},mr={notify:function(t,e){return console.log(t,e),{dismiss:function(){}}}},vr=function(t){Object(c.a)(r,t);var e=Object(l.a)(r);function r(t){var n;return Object(u.a)(this,r),(n=e.call(this))._notifier=mr,n._iframeReady=!1,n._configReady=!1,n._iframeConnecting=null,n._cacheReady=!1,n._readyEmitted=!1,n._widgetEnabled=!1,n._iframeStyle=pr,n._blockedPopupRedirect=!0,n._notificationsMap={},n._heartbeatStarted=!1,n._backoffTimeout=1,n._userConfig=null,n._asymmetricEncryptionKey=null,n._authereumQueryParams={},n._injectedElements=[],n._destroyed=!1,n._init=function(t){if("string"==typeof t){var e=t;if(n._networkName=(e||"").trim().toLowerCase(),["mainnet","ropsten","rinkeby","kovan","goerli"].includes(n._networkName))n._xsUri=lr(n._networkName);else{if("localhost"!==t)throw new Error("Unsupported network");n._xsUri="http://localhost:3002",n._networkName="kovan"}}else t=t||{},n._networkName=t.networkName||"mainnet",n._xsUri=t.xsUri||lr(n._networkName),n._apiKey=t.apiKey;t.redirectUri?n._redirectUri=t.redirectUri:n._redirectUri=window.location.href,n._iframeStyle={width:0,height:0,top:0,left:0},n._redirectUri=n._redirectUri||window.location.href,n._provider=new ur(Object(i.a)(n)),n._setupNotifier(),n._connectToChildIframe().catch((function(){n._startHeartbeat(!0)})),n._setupCache(),n._cacheAuthereumQueryParams(),n._setupSigningKey(),n._setupResizeListener(),n._setupFocusListener(),n._setupActionKeyListener(),n._emitReadyEvent()},n._setConfig=function(t){if("string"==typeof n._userConfig){var e=n._userConfig;n._networkName=(e||"").trim().toLowerCase(),n._userConfig={networkName:n._networkName,xsUri:lr(n._networkName)}}var r=n._userConfig||{},i=r.apiKey,o=r.apiUri,s=r.rpcUri,a=r.webUri,u=r.notifierUri,h=r.networkName,c=r.networkId,l=r.disableNotifications,f=r.blockedPopupRedirect;i&&(n._apiKey=i),o?n._apiUri=o:t.apiUri&&(n._apiUri=t.apiUri),n._rpcUri=s||t.rpcUri,a?n._webUri=a:t.webUri&&(n._webUri=t.webUri),u?n._notifierUri=u:t.notifierUri&&(n._notifierUri=t.notifierUri),h?n._networkName=h:t.networkName&&(n._networkName=t.networkName),c?n._networkId=c:t.networkId&&(n._networkId=t.networkId),"boolean"==typeof l?n._disableNotifications=l:"boolean"==typeof t.disableNotifications&&(n._disableNotifications=t.disableNotifications),"boolean"==typeof f?n._blockedPopupRedirect=f:"boolean"==typeof t.blockedPopupRedirect&&(n._blockedPopupRedirect=t.blockedPopupRedirect)},n._setupCache=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all([this._cacheLoginKeyAddress(),this._cacheIsAuthenticated(),this._cacheAccountAddress()]);case 2:this._cacheReady=!0;case 3:case"end":return t.stop()}}),t,this)})))},n._handleWindowFocus=function(){if(!n._destroyed)return n._postMessageToChild({method:"onWindowFocus"})},n._resetCache=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._setupCache());case 1:case"end":return t.stop()}}),t,this)})))},n._setupNotifier=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._tilConfigReady();case 2:if(t.t0=this._notifierUri,!t.t0){t.next=7;break}return t.next=6,this._injectScript(this._notifierUri,"authereum-notifier");case 6:window.AuthereumNotifier&&(this._notifier=new window.AuthereumNotifier({networkId:this._networkId,disableNotifications:this._disableNotifications,context:this}));case 7:case"end":return t.stop()}}),t,this)})))},n._injectScript=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function r(){var n=this;return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this._tilDomReady();case 2:return r.abrupt("return",new Promise((function(r,i){if(!t)throw new Error("sourceUrl is required");if(document.getElementById(e))r();else{var o=document.createElement("script");o.id=e,o.type="text/javascript",o.async=!0,o.onload=function(){r()},o.onerror=function(t){i(t)},o.src=t,n._injectedElements.push(o),document.getElementsByTagName("head")[0].appendChild(o)}})));case 3:case"end":return r.stop()}}),r,this)})))},n._setupResizeListener=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.addEventListener("resize",this._handleResizeThrottled,!1),window.addEventListener("resize",this._handleResizeDebounced,!1);case 1:case"end":return t.stop()}}),t,this)})))},n._handleActionKeyPress=function(t){if(!n._destroyed){var e="";return"Escape"===t.key||"Esc"===t.key||27===t.keyCode?e="escape":"Enter"===t.key||13===t.keyCode?e="enter":"ArrowLeft"===t.key||37===t.keyCode?e="left":"ArrowUp"===t.key||38===t.keyCode?e="up":"ArrowRight"===t.key||39===t.keyCode?e="right":"ArrowDown"!==t.key&&40!==t.keyCode||(e="down"),e?n._postMessageToChild({method:"actionKeyPress",params:e}):void 0}},n._handleResize=function(t){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){var e;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._destroyed){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,this._getWindowSize();case 4:return e=t.sent,t.abrupt("return",this._postMessageToChild({method:"onResize",params:e}));case 6:case"end":return t.stop()}}),t,this)})))},n._handleResizeThrottled=sr((function(t){return n._handleResize(t)}),10),n._handleResizeDebounced=function(t,e){var r;return function(){for(var e=arguments.length,n=new Array(e),i=0;i0&&void 0!==arguments[0])||arguments[0];return t?(n._widgetEnabled=!0,n._refreshWidget(),!0):n.hideWidget()},n.hideWidget=function(){return n._widgetEnabled=!1,n._setIframeWidth(0),n._setIframeHeight(0),!0},n.widgetEnabled=function(){return n._widgetEnabled},n.addFunds=function(t){return n._widgetEnabled=!0,n._postMessageToChild({method:"addFunds",params:t})},n._openUrl=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.url,r=t.newWindow;r?window.open(e,"_blank"):window.location.href=e},n._tilIframeReady=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._iframeReady){t.next=6;break}return t.next=3,or(100);case 3:t.t0=!0,t.next=9;break;case 6:return t.next=8,or(100);case 8:t.t0=this._tilIframeReady();case 9:return t.abrupt("return",t.t0);case 10:case"end":return t.stop()}}),t,this)})))},n._tilConfigReady=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._configReady){t.next=6;break}return t.next=3,or(100);case 3:t.t0=!0,t.next=9;break;case 6:return t.next=8,or(100);case 8:t.t0=this._tilConfigReady();case 9:return t.abrupt("return",t.t0);case 10:case"end":return t.stop()}}),t,this)})))},n._tilReady=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.isReady()){t.next=6;break}return t.next=3,or(100);case 3:t.t0=!0,t.next=9;break;case 6:return t.next=8,or(100);case 8:t.t0=this._tilReady();case 9:return t.abrupt("return",t.t0);case 10:case"end":return t.stop()}}),t,this)})))},n._emitReadyEvent=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._tilReady();case 2:this._readyEmitted||(this._readyEmitted=!0,this.emit("ready",{}));case 3:case"end":return t.stop()}}),t,this)})))},n._connectToChildIframe=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){var e,r=this;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._iframeConnecting){t.next=2;break}return t.abrupt("return",this._iframeConnecting);case 2:return this._iframeReady=!1,this._iframeConnecting=!0,t.next=5,this._getOrCreateIframe();case 5:return e=t.sent,t.abrupt("return",(this._iframeConnection=P.connectToChild({iframe:e,timeout:6e4,methods:{postMessage:function(t){return r._handlePostMessage(t)}}}),this._iframeConnecting=new Promise((function(t,e){var n=!1,i=setTimeout((function(){r._iframeReady||(n=!0,r._iframeConnecting=null,e(new Error("timedout")))}),3e3);r._iframeConnection.promise.then((function(e){clearTimeout(i),n||(r._iframeReady=!0,r._childIframeConnection=e,r._startHeartbeat(),r._iframeConnecting=null,t())})).catch((function(t){clearTimeout(i),n||e(t)}))})),this._iframeConnecting));case 7:case"end":return t.stop()}}),t,this)})))},n._startHeartbeat=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n._heartbeatStarted||(n._heartbeat(t),n._heartbeatStarted=!0)},n._heartbeat=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._destroyed){e.next=21;break}return e.next=3,or(2e3);case 3:if(e.prev=3,!t){e.next=9;break}return e.next=7,this._connectToChildIframe();case 7:return this._backoffTimeout=1,e.abrupt("return",this._heartbeat());case 9:return e.next=11,this._ping();case 11:e.next=20;break;case 13:if(e.prev=13,e.t0=e.catch(3),!/destroy|timedout/gi.test(e.t0.message)){e.next=20;break}return e.next=18,or(1e3*this._backoffTimeout);case 18:return this._backoffTimeout=this._backoffTimeout<<1,e.abrupt("return",this._heartbeat(!0));case 20:return e.abrupt("return",this._heartbeat());case 21:case"end":return e.stop()}}),e,this,[[3,13]])})))},n._ping=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){var e=this;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,r){var n=!1,i=setTimeout((function(){n=!0}),5e3);e._postMessageToChild({method:"ping"}).then((function(e){clearTimeout(i),n?r(new Error("timedout")):"pong"===e?t(e):r(new Error("Invalid response"))})).catch((function(t){r(t)}))})));case 1:case"end":return t.stop()}}),t)})))},n._getConfigFromChild=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._postMessageToChild({method:"getConfig"}));case 1:case"end":return t.stop()}}),t,this)})))},n._postVersionToChild=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._postMessageToChild({method:"version",params:this.version()}));case 1:case"end":return t.stop()}}),t,this)})))},n._postApiKeyToChild=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._apiKey){t.next=2;break}return t.abrupt("return",this._postMessageToChild({method:"apiKey",params:this._apiKey}));case 2:case"end":return t.stop()}}),t,this)})))},n._loadAsymmetricEncryptionKeyFromChild=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._postMessageToChild({method:"getAsymmetricEncryptionKey"});case 2:this._asymmetricEncryptionKey=t.sent;case 3:case"end":return t.stop()}}),t,this)})))},n._postMessageToChild=function(t){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._destroyed){e.next=2;break}throw new Error("Authereum instance destroyed.");case 2:return e.next=4,this._tilIframeReady();case 4:return e.abrupt("return",this._handleError(this._childIframeConnection.postMessage(t)));case 5:case"end":return e.stop()}}),e,this)})))},n._handleChildLogoutEvent=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._resetCache();case 2:this.emit("logout",{});case 3:case"end":return t.stop()}}),t,this)})))},n._handleChildDappKeyExpired=function(t){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=t===this._cachedLoginKeyAddress,!e.t0){e.next=6;break}return e.next=4,this._resetCache();case 4:this.emit("dappKeyExpired",t),this.emit("logout");case 6:case"end":return e.stop()}}),e,this)})))},n._handlePostMessage=function(t){try{t.method;var e=t.params;switch(p.c){case"onError":var r=e;return n.emit("error",r),void n._notifier.notify({type:"error",message:r.message});case"onLogout":return n._handleChildLogoutEvent();case"onDappKeyExpired":return n._handleChildDappKeyExpired(e);case"login":return n.login();case"setWidgetPosition":return;case"setWidgetSize":var i=e,o=i.width,s=i.height;return n._iframeStyle.width=o,n._iframeStyle.height=s,n._refreshWidget();case"getWindowSize":return n._getWindowSize();case"hideWidget":return n.hideWidget();case"notification":return n._handlePostMessageNotification(e);case"updateNotificationId":return n._handlePostMessageUpdateNotificationId(e);case"updateNotification":return n._handlePostMessageUpdateNotification(e);case"dismissNotification":return n._handlePostMessageDismissNotification(e);case"log":return n._handlePostMessageLog(e);case"openUrl":return n._openUrl(e)}}catch(t){}},n._handlePostMessageNotification=function(t){var e=n._notifier.notify(t);t.id&&(n._notificationsMap[t.id]=e)},n._handlePostMessageUpdateNotificationId=function(t){var e=t.id,r=t.newId;n._notificationsMap[r]=n._notificationsMap[e],n._notificationsMap[e]=null},n._handlePostMessageUpdateNotification=function(t){var e=n._notificationsMap[t.id];e&&e.update(t)},n._handlePostMessageDismissNotification=function(t){var e=n._notificationsMap[t.id];e&&e.dismiss()},n._handlePostMessageLog=function(t){var e=t.type,r=t.message;e||(e="log"),console[e](r)},n._getWindowSize=function(){return{width:n._getWindowWidth(),height:n._getWindowHeight()}},n._getWindowWidth=function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth},n._getWindowHeight=function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},n._setIframePositionLeft=function(t){n._iframe&&(n._iframe.style.left="".concat(t,"px"))},n._setIframeWidth=function(t){n._iframe&&(n._iframe.style.width="".concat(t,"px"))},n._setIframeHeight=function(t){n._iframe&&(n._iframe.style.height="".concat(t,"px"))},n._refreshWidget=function(){if(n._widgetEnabled){var t=n._iframeStyle,e=(t.top,t.left,t.width),r=t.height;n._setIframeWidth(e),n._setIframeHeight(r)}},n._loginKeyExists=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getLoginKey();case 2:return t.abrupt("return",!!t.sent);case 3:case"end":return t.stop()}}),t,this)})))},n._accountAddressExists=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getAccountAddress();case 2:return t.abrupt("return",!!t.sent);case 3:case"end":return t.stop()}}),t,this)})))},n._getAccountAdminKeyNonce=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._handleError(this._postMessageToChild({method:"getAccountAuthKeyNonce"})));case 1:case"end":return t.stop()}}),t,this)})))},n._getAccountAuthKeyNonce=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(console.warn("Deprecation notice: `authereum._getAccountAuthKeyNonce()` is deprecated. Use `authereum._getAccountAdminKeyNonce()` instead."),this._getAccountAdminKeyNonce()));case 1:case"end":return t.stop()}}),t,this)})))},n._executeLoginKeyMetaTx=function(t){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._handleError(this._postMessageToChild({method:"executeLoginKeyMetaTx",params:dr(t)})));case 1:case"end":return e.stop()}}),e,this)})))},n._loadLoginKey=function(t){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._tilReady();case 2:return e.abrupt("return",this._handleError(this._postMessageToChild({method:"loadLoginKey",params:t})));case 3:case"end":return e.stop()}}),e,this)})))},n._getOrCreateLoginKey=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._tilReady();case 2:return t.abrupt("return",this._handleError(this._postMessageToChild({method:"getOrCreateLoginKey"})));case 3:case"end":return t.stop()}}),t,this)})))},n._getAuthenticateUri=function(t){var e=n._asymmetricEncryptionKey;return n._webUri+"/?slk="+encodeURIComponent(JSON.stringify({loginKey:{publicAddress:t,expiresAt:I().add(1,"month").utc().unix()},encryptionKey:e}))+"&redirect_uri="+n._redirectUri},n._getSignWithAdminKeyUri=function(t){var e;return null!=(e=t)&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)&&(t="0x".concat(t.toString("hex"))),n._webUri+"/?sm="+encodeURIComponent(JSON.stringify({message:t}))+"&redirect_uri="+n._redirectUri},n._openPopupOrRedirect=function(t){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function e(){var r,n,i,o=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.emit("openPopup",{}),r=window.open(t,"Authereum","toolbar=no,\n location=no,\n status=no,\n menubar=no,\n scrollbars=no,\n resizable=no,\n width=470,\n height=640"),!(n=null==r)||this._blockedPopupRedirect){e.next=5;break}throw i=new Error("Disable popup blocker and try again"),this._notifier.notify({type:"error",message:i.message,timeout:5e3}),i;case 5:return e.abrupt("return",n?(this.emit("popupBlocked"),void(window.location.href=t)):(r.focus(),new Promise((function(t,e){var n=setInterval((function(){return fr(o,void 0,void 0,s.a.mark((function t(){var n;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.closed&&(a(),n=new Error("Window closed"),this.emit("error",n),this.emit("closePopup",{}),e(n));case 1:case"end":return t.stop()}}),t,this)})))}),250),i=setTimeout((function(){a(),r.close(),u(new Error("Timedout"))}),6e5),a=function(){clearInterval(n),clearTimeout(i),o.emit("closePopup",{})},u=function(t){a(),o.emit("error",t),e(t)},h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(),t(e)};window.addEventListener("message",(function(t){return fr(o,void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=t.origin.includes(this._webUri),!e.t0){e.next=16;break}if(t.data.close&&(r.close(),h()),e.t1=t.data.login,!e.t1){e.next=14;break}if(h({success:!0}),this.emit("login",{}),this._cachedIsAuthenticated=!0,e.t2=t.data.encryptedSigningKey,!e.t2){e.next=12;break}return e.next=12,this._loadSigningKey(t.data.encryptedSigningKey);case 12:this._logAnalyticsEvent({eventType:"logged_in_dapp",properties:{dapp_url:window.location.href}}),this._redirectUri!==window.location.href&&(window.location.href=this._redirectUri);case 14:t.data.result&&(h(t.data.result),this._redirectUri!==window.location.href&&(window.location.href=this._redirectUri)),t.data.error&&(u(new Error(t.data.error)),this._redirectUri!==window.location.href&&(window.location.href=this._redirectUri));case 16:case"end":return e.stop()}}),e,this)})))}))}))));case 6:case"end":return e.stop()}}),e,this)})))},n._signLoginKeyRequest=function(t){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function e(){var r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._getAuthenticateUri(t),e.abrupt("return",this._openPopupOrRedirect(r));case 2:case"end":return e.stop()}}),e,this)})))},n._tilDomReady=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){"loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",(function(){return t()}))})));case 1:case"end":return t.stop()}}),t)})))},n.version=function(){return C},n.isAuthenticatedSync=function(){return n._cachedIsAuthenticated},n.getTransactionReceipt=function(t){return n._handleError(n._postMessageToChild({method:"getTransactionReceipt",params:t}))},n.waitForTransactionReceipt=function(t){return n._handleError(n._postMessageToChild({method:"waitForTransactionReceipt",params:t}))},n.hasRecoveryEnabled=function(){return n._handleError(n._postMessageToChild({method:"hasRecoveryEnabled"}))},n.isContractDeployed=function(t){return n._handleError(n._postMessageToChild({method:"isContractDeployed",params:t}))},n._loadSigningKey=function(t){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._postMessageToChild({method:"loadSigningKey",params:t}));case 1:case"end":return e.stop()}}),e,this)})))},n._logAnalyticsEvent=function(t){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._postMessageToChild({method:"logAnalyticsEvent",params:t}));case 1:case"end":return e.stop()}}),e,this)})))},n._setupSigningKey=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){var e;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._tilReady();case 2:if(!(e=this._authereumQueryParams.encryptedSigningKey)){t.next=8;break}return t.next=6,this._loadSigningKey(e);case 6:if(!t.sent){t.next=8;break}try{localStorage.removeItem("_authereum")}catch(e){}case 8:case"end":return t.stop()}}),t,this)})))},n._cacheAuthereumQueryParams=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function e(){var r,n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{if(r=function(t){var e=window.location.search.substr(1),r=w.a.parse(e);return r[t]?r[t]:null}("_authereum")){this._authereumQueryParams=JSON.parse(r);try{localStorage.setItem("_authereum",btoa(JSON.stringify(this._authereumQueryParams)))}catch(t){}!function(t){try{window.history.replaceState({},document.title,t)}catch(t){}}(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location.href;try{var r=new URL(e);if("URLSearchParams"in window){var n=new URLSearchParams(r.search);return n.delete(t),r.search=n.toString(),r.toString()}}catch(t){}return e}("_authereum"))}else try{(n=localStorage.getItem("_authereum"))&&(this._authereumQueryParams=JSON.parse(atob(n)))}catch(t){}}catch(t){}case 1:case"end":return e.stop()}}),e,this)})))},n.destroy=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){var e,r,n,i,o;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._destroyed){t.next=2;break}return t.abrupt("return",(console.warn("Authereum instance already destroyed."),!0));case 2:if(t.prev=2,t.t0=this._iframeReady,!t.t0){t.next=7;break}return t.next=7,this._postMessageToChild({method:"destroy"});case 7:t.next=12;break;case 9:t.prev=9,t.t1=t.catch(2),console.error(t.t1);case 12:for(e=0;e0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location.href;try{var r=new URL(e);if("URLSearchParams"in window){var n=new URLSearchParams(r.search);for(var i in t)n.set(i,t[i]);return r.search=n.toString(),r.toString()}}catch(t){}return e}({url:r},this._xsUri),["Safari","Firefox"].includes(function(){var t,e=navigator.userAgent,r=e.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];/trident/i.test(r[1])&&(t=/\brv[ :]+(\d+)/g.exec(e)||[])[1],"Chrome"===r[1]&&(null!=(t=e.match(/\b(OPR|Edge?)\/(\d+)/))&&t.slice(1).join(" ").replace("OPR","Opera").replace("Edg ","Edge ")),r=r[2]?[r[1],r[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(t=e.match(/version\/(\d+)/i))&&r.splice(1,1,t[1]);var n=r.join(" ").split(" ");return{browser:n[0],version:n[1]}}().browser)&&i.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),i.style.position="fixed",i.style.bottom="0",i.style.right="0",i.style.width="0",i.style.height="0",i.style.border="0",i.style.background="transparent",i.style.zIndex="1",i.setAttribute("frameborder","0"),i.setAttribute("scrolling","no"),this._iframe=i,t(this._iframe),e.next=20,this._tilDomReady();case 20:document.body.appendChild(i),this._injectedElements.push(i),i.onload=function(){o._postVersionToChild(),o._postApiKeyToChild(),o._loadAsymmetricEncryptionKeyFromChild(),o._getConfigFromChild().then((function(t){o._setConfig(t),o._configReady=!0,o.emit("iframeReady",{})}))};case 23:case"end":return e.stop()}}),e,this)})))}))));case 1:case"end":return t.stop()}}),t,this)})))}}]),r}(R);vr.version=function(){return C},"undefined"!=typeof window&&(window.Authereum=vr);var gr=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},yr=function(t){Object(c.a)(r,t);var e=Object(l.a)(r);function r(t){var n;return Object(u.a)(this,r),(n=e.call(this)).config=t||{},n.authereum=new vr(n.config),n.provider=n.authereum.getProvider(),n}return Object(h.a)(r,[{key:"getAddress",value:function(){return gr(this,void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.authereum.getAccountAddress());case 1:case"end":return t.stop()}}),t,this)})))}},{key:"signMessage",value:function(t){return gr(this,void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.provider.sign(t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"sign",value:function(t){return gr(this,void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.provider.sign(t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"sendTransaction",value:function(t){return gr(this,void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.provider.sendTransaction(t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"sendTransactionBatch",value:function(t){return gr(this,void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.provider.sendTransactionBatch(t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"estimateGasBatch",value:function(t){return gr(this,void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.provider.estimateGasBatch(t));case 1:case"end":return e.stop()}}),e,this)})))}}]),r}(r(94).Signer);e.default=vr}.call(this,r(449).setImmediate,r(90))}}]); \ No newline at end of file +(this.webpackJsonpbridge=this.webpackJsonpbridge||[]).push([[15],{715:function(t,e,r){"use strict";r.r(e),function(t,n){r.d(e,"Authereum",(function(){return vr})),r.d(e,"AuthereumProvider",(function(){return ur})),r.d(e,"AuthereumSigner",(function(){return yr})),r.d(e,"version",(function(){return C}));var i=r(83),o=r(11),s=r.n(o),a=r(187),u=r(21),h=r(30),c=r(32),l=r(33),f=r(190),d=r(38),p=r(714),m=(r(0),r(330),r(73),r(52),r(737)),v=r(804),g=(r(374),r(373),r(736)),y=(r(726),r(10),r(450),r(453)),w=r.n(y),b=Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.DATA_CLONE_ERROR=e.MESSAGE=e.REJECTED=e.FULFILLED=e.REPLY=e.CALL=e.HANDSHAKE_REPLY=e.HANDSHAKE=void 0,e.HANDSHAKE="handshake",e.HANDSHAKE_REPLY="handshake-reply",e.CALL="call",e.REPLY="reply",e.FULFILLED="fulfilled",e.REJECTED="rejected",e.MESSAGE="message",e.DATA_CLONE_ERROR="DataCloneError"}));Object(p.c)(b),b.DATA_CLONE_ERROR,b.MESSAGE,b.REJECTED,b.FULFILLED,b.REPLY,b.CALL,b.HANDSHAKE_REPLY,b.HANDSHAKE;var _=Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ERR_NO_IFRAME_SRC=e.ERR_NOT_IN_IFRAME=e.ERR_CONNECTION_TIMEOUT=e.ERR_CONNECTION_DESTROYED=void 0,e.ERR_CONNECTION_DESTROYED="ConnectionDestroyed",e.ERR_CONNECTION_TIMEOUT="ConnectionTimeout",e.ERR_NOT_IN_IFRAME="NotInIframe",e.ERR_NO_IFRAME_SRC="NoIframeSrc"}));Object(p.c)(_),_.ERR_NO_IFRAME_SRC,_.ERR_NOT_IN_IFRAME,_.ERR_CONNECTION_TIMEOUT,_.ERR_CONNECTION_DESTROYED;var M=Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default=function(){var t=[],e=!1;return{destroy:function(){e=!0,t.forEach((function(t){t()}))},onDestroy:function(r){e?r():t.push(r)}}},t.exports=e.default}));Object(p.c)(M);var k=Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r={"http:":"80","https:":"443"},n=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,i=["file:","data:"];e.default=function(t){if(t&&i.find((function(e){return t.startsWith(e)})))return"null";var e,o,s,a=document.location,u=n.exec(t);return u?(e=u[1]?u[1]:a.protocol,o=u[2],s=u[4]):(e=a.protocol,o=a.hostname,s=a.port),"".concat(e,"//").concat(o).concat(s&&s!==r[e]?":".concat(s):"")},t.exports=e.default}));Object(p.c)(k);var S=Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default=function(t){return function(){if(t){for(var e,r=arguments.length,n=new Array(r),i=0;i0&&void 0!==arguments[0]?arguments[0]:{},e=t.parentOrigin,s=void 0===e?"*":e,a=t.methods,u=void 0===a?{}:a,h=t.timeout,c=t.debug,l=(0,o.default)(c);if(window===window.top){var f=new Error("connectToParent() must be called within an iframe");throw f.code=_.ERR_NOT_IN_IFRAME,f}var d=(0,r.default)(),p=d.destroy,m=d.onDestroy,v=window,g=v.parent,y=new Promise((function(t,e){var r;void 0!==h&&(r=setTimeout((function(){var t=new Error("Connection to parent timed out after ".concat(h,"ms"));t.code=_.ERR_CONNECTION_TIMEOUT,e(t),p()}),h));var o=function e(o){try{clearTimeout()}catch(t){return}if(o.source===g&&o.data.penpal===b.HANDSHAKE_REPLY)if("*"===s||s===o.origin){l("Child: Received handshake reply"),v.removeEventListener(b.MESSAGE,e);var a={localName:"Child",local:v,remote:g,originForSending:"null"===o.origin?"*":o.origin,originForReceiving:o.origin},h={},c=(0,n.default)(a,u,l);m(c);var f=(0,i.default)(h,a,o.data.methodNames,p,l);m(f),clearTimeout(r),t(h)}else l("Child received handshake reply from origin ".concat(o.origin," which did not match expected origin ").concat(s))};v.addEventListener(b.MESSAGE,o),m((function(){v.removeEventListener(b.MESSAGE,o);var t=new Error("Connection destroyed");t.code=_.ERR_CONNECTION_DESTROYED,e(t)})),l("Child: Sending handshake"),g.postMessage({penpal:b.HANDSHAKE,methodNames:Object.keys(u)},s)}));return{promise:y,destroy:p}},t.exports=e.default}));Object(p.c)(N);var P=Object(p.c)(Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=i(O),n=i(N);function i(t){return t&&t.__esModule?t:{default:t}}var o={ERR_CONNECTION_DESTROYED:_.ERR_CONNECTION_DESTROYED,ERR_CONNECTION_TIMEOUT:_.ERR_CONNECTION_TIMEOUT,ERR_NOT_IN_IFRAME:_.ERR_NOT_IN_IFRAME,ERR_NO_IFRAME_SRC:_.ERR_NO_IFRAME_SRC,connectToChild:r.default,connectToParent:n.default};e.default=o,t.exports=e.default}))),R=Object(p.b)((function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,n,o,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,o||t,s),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i>>0,n=0;n0)for(r=0;r=0?r?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}var F=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,H=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,G={},z={};function W(t,e,r,n){var i=n;"string"==typeof n&&(i=function(){return this[n]()}),t&&(z[t]=i),e&&(z[e[0]]=function(){return B(i.apply(this,arguments),e[1],e[2])}),r&&(z[r]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function q(t,e){return t.isValid()?(e=K(e,t.localeData()),G[e]=G[e]||function(t){var e,r,n,i=t.match(F);for(e=0,r=i.length;e=0&&H.test(t);)t=t.replace(H,n),H.lastIndex=0,r-=1;return t}var Y=/\d/,V=/\d\d/,Z=/\d{3}/,J=/\d{4}/,$=/[+-]?\d{6}/,X=/\d\d?/,Q=/\d\d\d\d?/,tt=/\d\d\d\d\d\d?/,et=/\d{1,3}/,rt=/\d{1,4}/,nt=/[+-]?\d{1,6}/,it=/\d+/,ot=/[+-]?\d+/,st=/Z|[+-]\d\d:?\d\d/gi,at=/Z|[+-]\d\d(?::?\d\d)?/gi,ut=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ht={};function ct(t,e,r){ht[t]=N(e)?e:function(t,n){return t&&r?r:e}}function lt(t,e){return c(ht,t)?ht[t](e._strict,e._locale):new RegExp(ft(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(t,e,r,n,i){return e||r||n||i}))))}function ft(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var dt={};function pt(t,e){var r,n=e;for("string"==typeof t&&(t=[t]),a(e)&&(n=function(t,r){r[e]=k(t)}),r=0;r68?1900:2e3)};var wt,bt=_t("FullYear",!0);function _t(t,e){return function(r){return null!=r?(kt(this,t,r),n.updateOffset(this,e),this):Mt(this,t)}}function Mt(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function kt(t,e,r){t.isValid()&&!isNaN(r)&&("FullYear"===e&&yt(t.year())&&1===t.month()&&29===t.date()?t._d["set"+(t._isUTC?"UTC":"")+e](r,t.month(),St(r,t.month())):t._d["set"+(t._isUTC?"UTC":"")+e](r))}function St(t,e){if(isNaN(t)||isNaN(e))return NaN;var r=(e%12+12)%12;return t+=(e-r)/12,1===r?yt(t)?29:28:31-r%7%2}wt=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e=0?(a=new Date(t+400,e,r,n,i,o,s),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,r,n,i,o,s),a}function Dt(t){var e;if(t<100&&t>=0){var r=Array.prototype.slice.call(arguments);r[0]=t+400,e=new Date(Date.UTC.apply(null,r)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)}else e=new Date(Date.UTC.apply(null,arguments));return e}function jt(t,e,r){var n=7+e-r;return-(7+Dt(t,0,n).getUTCDay()-e)%7+n-1}function Lt(t,e,r,n,i){var o,s,a=1+7*(e-1)+(7+r-n)%7+jt(t,n,i);return a<=0?s=gt(o=t-1)+a:a>gt(t)?(o=t+1,s=a-gt(t)):(o=t,s=a),{year:o,dayOfYear:s}}function Ut(t,e,r){var n,i,o=jt(t.year(),e,r),s=Math.floor((t.dayOfYear()-o-1)/7)+1;return s<1?n=s+Bt(i=t.year()-1,e,r):s>Bt(t.year(),e,r)?(n=s-Bt(t.year(),e,r),i=t.year()+1):(i=t.year(),n=s),{week:n,year:i}}function Bt(t,e,r){var n=jt(t,e,r),i=jt(t+1,e,r);return(gt(t)-n+i)/7}function Ft(t,e){return t.slice(e,7).concat(t.slice(0,e))}W("w",["ww",2],"wo","week"),W("W",["WW",2],"Wo","isoWeek"),C("week","w"),C("isoWeek","W"),U("week",5),U("isoWeek",5),ct("w",X),ct("ww",X,V),ct("W",X),ct("WW",X,V),mt(["w","ww","W","WW"],(function(t,e,r,n){e[n.substr(0,1)]=k(t)})),W("d",0,"do","day"),W("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),W("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),W("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),W("e",0,0,"weekday"),W("E",0,0,"isoWeekday"),C("day","d"),C("weekday","e"),C("isoWeekday","E"),U("day",11),U("weekday",11),U("isoWeekday",11),ct("d",X),ct("e",X),ct("E",X),ct("dd",(function(t,e){return e.weekdaysMinRegex(t)})),ct("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),ct("dddd",(function(t,e){return e.weekdaysRegex(t)})),mt(["dd","ddd","dddd"],(function(t,e,r,n){var i=r._locale.weekdaysParse(t,n,r._strict);null!=i?e.d=i:d(r).invalidWeekday=t})),mt(["d","e","E"],(function(t,e,r,n){e[n]=k(t)}));var Ht="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Gt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),zt="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Wt(t,e,r){var n,i,o,s=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)o=f([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(o,"").toLocaleLowerCase();return r?"dddd"===e?-1!==(i=wt.call(this._weekdaysParse,s))?i:null:"ddd"===e?-1!==(i=wt.call(this._shortWeekdaysParse,s))?i:null:-1!==(i=wt.call(this._minWeekdaysParse,s))?i:null:"dddd"===e?-1!==(i=wt.call(this._weekdaysParse,s))||-1!==(i=wt.call(this._shortWeekdaysParse,s))||-1!==(i=wt.call(this._minWeekdaysParse,s))?i:null:"ddd"===e?-1!==(i=wt.call(this._shortWeekdaysParse,s))||-1!==(i=wt.call(this._weekdaysParse,s))||-1!==(i=wt.call(this._minWeekdaysParse,s))?i:null:-1!==(i=wt.call(this._minWeekdaysParse,s))||-1!==(i=wt.call(this._weekdaysParse,s))||-1!==(i=wt.call(this._shortWeekdaysParse,s))?i:null}var qt=ut,Kt=ut,Yt=ut;function Vt(){function t(t,e){return e.length-t.length}var e,r,n,i,o,s=[],a=[],u=[],h=[];for(e=0;e<7;e++)r=f([2e3,1]).day(e),n=this.weekdaysMin(r,""),i=this.weekdaysShort(r,""),o=this.weekdays(r,""),s.push(n),a.push(i),u.push(o),h.push(n),h.push(i),h.push(o);for(s.sort(t),a.sort(t),u.sort(t),h.sort(t),e=0;e<7;e++)a[e]=ft(a[e]),u[e]=ft(u[e]),h[e]=ft(h[e]);this._weekdaysRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Zt(){return this.hours()%12||12}function Jt(t,e){W(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function $t(t,e){return e._meridiemParse}W("H",["HH",2],0,"hour"),W("h",["hh",2],0,Zt),W("k",["kk",2],0,(function(){return this.hours()||24})),W("hmm",0,0,(function(){return""+Zt.apply(this)+B(this.minutes(),2)})),W("hmmss",0,0,(function(){return""+Zt.apply(this)+B(this.minutes(),2)+B(this.seconds(),2)})),W("Hmm",0,0,(function(){return""+this.hours()+B(this.minutes(),2)})),W("Hmmss",0,0,(function(){return""+this.hours()+B(this.minutes(),2)+B(this.seconds(),2)})),Jt("a",!0),Jt("A",!1),C("hour","h"),U("hour",13),ct("a",$t),ct("A",$t),ct("H",X),ct("h",X),ct("k",X),ct("HH",X,V),ct("hh",X,V),ct("kk",X,V),ct("hmm",Q),ct("hmmss",tt),ct("Hmm",Q),ct("Hmmss",tt),pt(["H","HH"],3),pt(["k","kk"],(function(t,e,r){var n=k(t);e[3]=24===n?0:n})),pt(["a","A"],(function(t,e,r){r._isPm=r._locale.isPM(t),r._meridiem=t})),pt(["h","hh"],(function(t,e,r){e[3]=k(t),d(r).bigHour=!0})),pt("hmm",(function(t,e,r){var n=t.length-2;e[3]=k(t.substr(0,n)),e[4]=k(t.substr(n)),d(r).bigHour=!0})),pt("hmmss",(function(t,e,r){var n=t.length-4,i=t.length-2;e[3]=k(t.substr(0,n)),e[4]=k(t.substr(n,2)),e[5]=k(t.substr(i)),d(r).bigHour=!0})),pt("Hmm",(function(t,e,r){var n=t.length-2;e[3]=k(t.substr(0,n)),e[4]=k(t.substr(n))})),pt("Hmmss",(function(t,e,r){var n=t.length-4,i=t.length-2;e[3]=k(t.substr(0,n)),e[4]=k(t.substr(n,2)),e[5]=k(t.substr(i))}));var Xt,Qt=_t("Hours",!0),te={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:At,monthsShort:Et,week:{dow:0,doy:6},weekdays:Ht,weekdaysMin:zt,weekdaysShort:Gt,meridiemParse:/[ap]\.?m?\.?/i},ee={},re={};function ne(t){return t?t.toLowerCase().replace("_","-"):t}function ie(e){var r=null;if(!ee[e]&&t&&t.exports)try{r=Xt._abbr,Object(p.e)("./locale/"+e),oe(r)}catch(t){}return ee[e]}function oe(t,e){var r;return t&&((r=s(e)?ae(t):se(t,e))?Xt=r:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),Xt._abbr}function se(t,e){if(null!==e){var r,n=te;if(e.abbr=t,null!=ee[t])O("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=ee[t]._config;else if(null!=e.parentLocale)if(null!=ee[e.parentLocale])n=ee[e.parentLocale]._config;else{if(null==(r=ie(e.parentLocale)))return re[e.parentLocale]||(re[e.parentLocale]=[]),re[e.parentLocale].push({name:t,config:e}),null;n=r._config}return ee[t]=new R(P(n,e)),re[t]&&re[t].forEach((function(t){se(t.name,t.config)})),oe(t),ee[t]}return delete ee[t],null}function ae(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Xt;if(!i(t)){if(e=ie(t))return e;t=[t]}return function(t){for(var e,r,n,i,o=0;o0;){if(n=ie(i.slice(0,e).join("-")))return n;if(r&&r.length>=e&&S(i,r,!0)>=e-1)break;e--}o++}return Xt}(t)}function ue(t){var e,r=t._a;return r&&-2===d(t).overflow&&(e=r[1]<0||r[1]>11?1:r[2]<1||r[2]>St(r[0],r[1])?2:r[3]<0||r[3]>24||24===r[3]&&(0!==r[4]||0!==r[5]||0!==r[6])?3:r[4]<0||r[4]>59?4:r[5]<0||r[5]>59?5:r[6]<0||r[6]>999?6:-1,d(t)._overflowDayOfYear&&(e<0||e>2)&&(e=2),d(t)._overflowWeeks&&-1===e&&(e=7),d(t)._overflowWeekday&&-1===e&&(e=8),d(t).overflow=e),t}function he(t,e,r){return null!=t?t:null!=e?e:r}function ce(t){var e,r,i,o,s,a=[];if(!t._d){for(i=function(t){var e=new Date(n.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}(t),t._w&&null==t._a[2]&&null==t._a[1]&&function(t){var e,r,n,i,o,s,a,u;if(null!=(e=t._w).GG||null!=e.W||null!=e.E)o=1,s=4,r=he(e.GG,t._a[0],Ut(xe(),1,4).year),n=he(e.W,1),((i=he(e.E,1))<1||i>7)&&(u=!0);else{o=t._locale._week.dow,s=t._locale._week.doy;var h=Ut(xe(),o,s);r=he(e.gg,t._a[0],h.year),n=he(e.w,h.week),null!=e.d?((i=e.d)<0||i>6)&&(u=!0):null!=e.e?(i=e.e+o,(e.e<0||e.e>6)&&(u=!0)):i=o}n<1||n>Bt(r,o,s)?d(t)._overflowWeeks=!0:null!=u?d(t)._overflowWeekday=!0:(a=Lt(r,n,i,o,s),t._a[0]=a.year,t._dayOfYear=a.dayOfYear)}(t),null!=t._dayOfYear&&(s=he(t._a[0],i[0]),(t._dayOfYear>gt(s)||0===t._dayOfYear)&&(d(t)._overflowDayOfYear=!0),r=Dt(s,0,t._dayOfYear),t._a[1]=r.getUTCMonth(),t._a[2]=r.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=a[e]=i[e];for(;e<7;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[3]&&0===t._a[4]&&0===t._a[5]&&0===t._a[6]&&(t._nextDay=!0,t._a[3]=0),t._d=(t._useUTC?Dt:Ct).apply(null,a),o=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[3]=24),t._w&&void 0!==t._w.d&&t._w.d!==o&&(d(t).weekdayMismatch=!0)}}var le=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,fe=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,de=/Z|[+-]\d\d(?::?\d\d)?/,pe=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],me=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],ve=/^\/?Date\((\-?\d+)/i;function ge(t){var e,r,n,i,o,s,a=t._i,u=le.exec(a)||fe.exec(a);if(u){for(d(t).iso=!0,e=0,r=pe.length;e0&&d(t).unusedInput.push(s),a=a.slice(a.indexOf(r)+r.length),h+=r.length),z[o]?(r?d(t).empty=!1:d(t).unusedTokens.push(o),vt(o,r,t)):t._strict&&!r&&d(t).unusedTokens.push(o);d(t).charsLeftOver=u-h,a.length>0&&d(t).unusedInput.push(a),t._a[3]<=12&&!0===d(t).bigHour&&t._a[3]>0&&(d(t).bigHour=void 0),d(t).parsedDateParts=t._a.slice(0),d(t).meridiem=t._meridiem,t._a[3]=function(t,e,r){var n;return null==r?e:null!=t.meridiemHour?t.meridiemHour(e,r):null!=t.isPM?((n=t.isPM(r))&&e<12&&(e+=12),n||12!==e||(e=0),e):e}(t._locale,t._a[3],t._meridiem),ce(t),ue(t)}else _e(t);else ge(t)}function ke(t){var e=t._i,r=t._f;return t._locale=t._locale||ae(t._l),null===e||void 0===r&&""===e?v({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),_(e)?new b(ue(e)):(u(e)?t._d=e:i(r)?function(t){var e,r,n,i,o;if(0===t._f.length)return d(t).invalidFormat=!0,void(t._d=new Date(NaN));for(i=0;ithis?this:t:v()}));function Te(t,e){var r,n;if(1===e.length&&i(e[0])&&(e=e[0]),!e.length)return xe();for(r=e[0],n=1;n=0?new Date(t+400,e,r)-126227808e5:new Date(t,e,r).valueOf()}function tr(t,e,r){return t<100&&t>=0?Date.UTC(t+400,e,r)-126227808e5:Date.UTC(t,e,r)}function er(t,e){W(0,[t,t.length],0,e)}function rr(t,e,r,n,i){var o;return null==t?Ut(this,n,i).year:(e>(o=Bt(t,n,i))&&(e=o),nr.call(this,t,e,r,n,i))}function nr(t,e,r,n,i){var o=Lt(t,e,r,n,i),s=Dt(o.year,0,o.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}W(0,["gg",2],0,(function(){return this.weekYear()%100})),W(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),er("gggg","weekYear"),er("ggggg","weekYear"),er("GGGG","isoWeekYear"),er("GGGGG","isoWeekYear"),C("weekYear","gg"),C("isoWeekYear","GG"),U("weekYear",1),U("isoWeekYear",1),ct("G",ot),ct("g",ot),ct("GG",X,V),ct("gg",X,V),ct("GGGG",rt,J),ct("gggg",rt,J),ct("GGGGG",nt,$),ct("ggggg",nt,$),mt(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,r,n){e[n.substr(0,2)]=k(t)})),mt(["gg","GG"],(function(t,e,r,i){e[i]=n.parseTwoDigitYear(t)})),W("Q",0,"Qo","quarter"),C("quarter","Q"),U("quarter",7),ct("Q",Y),pt("Q",(function(t,e){e[1]=3*(k(t)-1)})),W("D",["DD",2],"Do","date"),C("date","D"),U("date",9),ct("D",X),ct("DD",X,V),ct("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),pt(["D","DD"],2),pt("Do",(function(t,e){e[2]=k(t.match(X)[0])}));var ir=_t("Date",!0);W("DDD",["DDDD",3],"DDDo","dayOfYear"),C("dayOfYear","DDD"),U("dayOfYear",4),ct("DDD",et),ct("DDDD",Z),pt(["DDD","DDDD"],(function(t,e,r){r._dayOfYear=k(t)})),W("m",["mm",2],0,"minute"),C("minute","m"),U("minute",14),ct("m",X),ct("mm",X,V),pt(["m","mm"],4);var or=_t("Minutes",!1);W("s",["ss",2],0,"second"),C("second","s"),U("second",15),ct("s",X),ct("ss",X,V),pt(["s","ss"],5);var sr,ar=_t("Seconds",!1);for(W("S",0,0,(function(){return~~(this.millisecond()/100)})),W(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),W(0,["SSS",3],0,"millisecond"),W(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),W(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),W(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),W(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),W(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),W(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),C("millisecond","ms"),U("millisecond",16),ct("S",et,Y),ct("SS",et,V),ct("SSS",et,Z),sr="SSSS";sr.length<=9;sr+="S")ct(sr,it);function ur(t,e){e[6]=k(1e3*("0."+t))}for(sr="S";sr.length<=9;sr+="S")pt(sr,ur);var hr=_t("Milliseconds",!1);W("z",0,0,"zoneAbbr"),W("zz",0,0,"zoneName");var cr=b.prototype;function lr(t){return t}cr.add=Ke,cr.calendar=function(t,e){var r=t||xe(),i=je(r,this).startOf("day"),o=n.calendarFormat(this,i)||"sameElse",s=e&&(N(e[o])?e[o].call(this,r):e[o]);return this.format(s||this.localeData().calendar(o,this,xe(r)))},cr.clone=function(){return new b(this)},cr.diff=function(t,e,r){var n,i,o;if(!this.isValid())return NaN;if(!(n=je(t,this)).isValid())return NaN;switch(i=6e4*(n.utcOffset()-this.utcOffset()),e=D(e)){case"year":o=Ve(this,n)/12;break;case"month":o=Ve(this,n);break;case"quarter":o=Ve(this,n)/3;break;case"second":o=(this-n)/1e3;break;case"minute":o=(this-n)/6e4;break;case"hour":o=(this-n)/36e5;break;case"day":o=(this-n-i)/864e5;break;case"week":o=(this-n-i)/6048e5;break;default:o=this-n}return r?o:M(o)},cr.endOf=function(t){var e;if(void 0===(t=D(t))||"millisecond"===t||!this.isValid())return this;var r=this._isUTC?tr:Qe;switch(t){case"year":e=r(this.year()+1,0,1)-1;break;case"quarter":e=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=r(this.year(),this.month()+1,1)-1;break;case"week":e=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=36e5-Xe(e+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":e=this._d.valueOf(),e+=6e4-Xe(e,6e4)-1;break;case"second":e=this._d.valueOf(),e+=1e3-Xe(e,1e3)-1}return this._d.setTime(e),n.updateOffset(this,!0),this},cr.format=function(t){t||(t=this.isUtc()?n.defaultFormatUtc:n.defaultFormat);var e=q(this,t);return this.localeData().postformat(e)},cr.from=function(t,e){return this.isValid()&&(_(t)&&t.isValid()||xe(t).isValid())?He({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},cr.fromNow=function(t){return this.from(xe(),t)},cr.to=function(t,e){return this.isValid()&&(_(t)&&t.isValid()||xe(t).isValid())?He({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},cr.toNow=function(t){return this.to(xe(),t)},cr.get=function(t){return N(this[t=D(t)])?this[t]():this},cr.invalidAt=function(){return d(this).overflow},cr.isAfter=function(t,e){var r=_(t)?t:xe(t);return!(!this.isValid()||!r.isValid())&&("millisecond"===(e=D(e)||"millisecond")?this.valueOf()>r.valueOf():r.valueOf()9999?q(r,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):N(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",q(r,"Z")):q(r,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},cr.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var r="["+t+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i=e+'[")]';return this.format(r+n+"-MM-DD[T]HH:mm:ss.SSS"+i)},cr.toJSON=function(){return this.isValid()?this.toISOString():null},cr.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},cr.unix=function(){return Math.floor(this.valueOf()/1e3)},cr.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},cr.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},cr.year=bt,cr.isLeapYear=function(){return yt(this.year())},cr.weekYear=function(t){return rr.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},cr.isoWeekYear=function(t){return rr.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},cr.quarter=cr.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},cr.month=Nt,cr.daysInMonth=function(){return St(this.year(),this.month())},cr.week=cr.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},cr.isoWeek=cr.isoWeeks=function(t){var e=Ut(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},cr.weeksInYear=function(){var t=this.localeData()._week;return Bt(this.year(),t.dow,t.doy)},cr.isoWeeksInYear=function(){return Bt(this.year(),1,4)},cr.date=ir,cr.day=cr.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=function(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}(t,this.localeData()),this.add(t-e,"d")):e},cr.weekday=function(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},cr.isoWeekday=function(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=function(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7},cr.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},cr.hour=cr.hours=Qt,cr.minute=cr.minutes=or,cr.second=cr.seconds=ar,cr.millisecond=cr.milliseconds=hr,cr.utcOffset=function(t,e,r){var i,o=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=De(at,t)))return this}else Math.abs(t)<16&&!r&&(t*=60);return!this._isUTC&&e&&(i=Le(this)),this._offset=t,this._isUTC=!0,null!=i&&this.add(i,"m"),o!==t&&(!e||this._changeInProgress?qe(this,He(t-o,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?o:Le(this)},cr.utc=function(t){return this.utcOffset(0,t)},cr.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Le(this),"m")),this},cr.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=De(st,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this},cr.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?xe(t).utcOffset():0,(this.utcOffset()-t)%60==0)},cr.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},cr.isLocal=function(){return!!this.isValid()&&!this._isUTC},cr.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},cr.isUtc=Ue,cr.isUTC=Ue,cr.zoneAbbr=function(){return this._isUTC?"UTC":""},cr.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},cr.dates=A("dates accessor is deprecated. Use date instead.",ir),cr.months=A("months accessor is deprecated. Use month instead",Nt),cr.years=A("years accessor is deprecated. Use year instead",bt),cr.zone=A("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()})),cr.isDSTShifted=A("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var t={};if(y(t,this),(t=ke(t))._a){var e=t._isUTC?f(t._a):xe(t._a);this._isDSTShifted=this.isValid()&&S(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}));var fr=R.prototype;function dr(t,e,r,n){var i=ae(),o=f().set(n,e);return i[r](o,t)}function pr(t,e,r){if(a(t)&&(e=t,t=void 0),t=t||"",null!=e)return dr(t,e,r,"month");var n,i=[];for(n=0;n<12;n++)i[n]=dr(t,n,r,"month");return i}function mr(t,e,r,n){"boolean"==typeof t?(a(e)&&(r=e,e=void 0),e=e||""):(r=e=t,t=!1,a(e)&&(r=e,e=void 0),e=e||"");var i,o=ae(),s=t?o._week.dow:0;if(null!=r)return dr(e,(r+s)%7,n,"day");var u=[];for(i=0;i<7;i++)u[i]=dr(e,(i+s)%7,n,"day");return u}fr.calendar=function(t,e,r){var n=this._calendar[t]||this._calendar.sameElse;return N(n)?n.call(e,r):n},fr.longDateFormat=function(t){var e=this._longDateFormat[t],r=this._longDateFormat[t.toUpperCase()];return e||!r?e:(this._longDateFormat[t]=r.replace(/MMMM|MM|DD|dddd/g,(function(t){return t.slice(1)})),this._longDateFormat[t])},fr.invalidDate=function(){return this._invalidDate},fr.ordinal=function(t){return this._ordinal.replace("%d",t)},fr.preparse=lr,fr.postformat=lr,fr.relativeTime=function(t,e,r,n){var i=this._relativeTime[r];return N(i)?i(t,e,r,n):i.replace(/%d/i,t)},fr.pastFuture=function(t,e){var r=this._relativeTime[t>0?"future":"past"];return N(r)?r(e):r.replace(/%s/i,e)},fr.set=function(t){var e,r;for(r in t)N(e=t[r])?this[r]=e:this["_"+r]=e;this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},fr.months=function(t,e){return t?i(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||xt).test(e)?"format":"standalone"][t.month()]:i(this._months)?this._months:this._months.standalone},fr.monthsShort=function(t,e){return t?i(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[xt.test(e)?"format":"standalone"][t.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},fr.monthsParse=function(t,e,r){var n,i,o;if(this._monthsParseExact)return Tt.call(this,t,e,r);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(i=f([2e3,n]),r&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),r||this._monthsParse[n]||(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[n]=new RegExp(o.replace(".",""),"i")),r&&"MMMM"===e&&this._longMonthsParse[n].test(t))return n;if(r&&"MMM"===e&&this._shortMonthsParse[n].test(t))return n;if(!r&&this._monthsParse[n].test(t))return n}},fr.monthsRegex=function(t){return this._monthsParseExact?(c(this,"_monthsRegex")||It.call(this),t?this._monthsStrictRegex:this._monthsRegex):(c(this,"_monthsRegex")||(this._monthsRegex=Rt),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},fr.monthsShortRegex=function(t){return this._monthsParseExact?(c(this,"_monthsRegex")||It.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(c(this,"_monthsShortRegex")||(this._monthsShortRegex=Pt),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},fr.week=function(t){return Ut(t,this._week.dow,this._week.doy).week},fr.firstDayOfYear=function(){return this._week.doy},fr.firstDayOfWeek=function(){return this._week.dow},fr.weekdays=function(t,e){var r=i(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?Ft(r,this._week.dow):t?r[t.day()]:r},fr.weekdaysMin=function(t){return!0===t?Ft(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin},fr.weekdaysShort=function(t){return!0===t?Ft(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort},fr.weekdaysParse=function(t,e,r){var n,i,o;if(this._weekdaysParseExact)return Wt.call(this,t,e,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(i=f([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[n]=new RegExp(o.replace(".",""),"i")),r&&"dddd"===e&&this._fullWeekdaysParse[n].test(t))return n;if(r&&"ddd"===e&&this._shortWeekdaysParse[n].test(t))return n;if(r&&"dd"===e&&this._minWeekdaysParse[n].test(t))return n;if(!r&&this._weekdaysParse[n].test(t))return n}},fr.weekdaysRegex=function(t){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Vt.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(c(this,"_weekdaysRegex")||(this._weekdaysRegex=qt),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},fr.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Vt.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(c(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Kt),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},fr.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Vt.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(c(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Yt),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},fr.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},fr.meridiem=function(t,e,r){return t>11?r?"pm":"PM":r?"am":"AM"},oe("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===k(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),n.lang=A("moment.lang is deprecated. Use moment.locale instead.",oe),n.langData=A("moment.langData is deprecated. Use moment.localeData instead.",ae);var vr=Math.abs;function gr(t,e,r,n){var i=He(e,r);return t._milliseconds+=n*i._milliseconds,t._days+=n*i._days,t._months+=n*i._months,t._bubble()}function yr(t){return t<0?Math.floor(t):Math.ceil(t)}function wr(t){return 4800*t/146097}function br(t){return 146097*t/4800}function _r(t){return function(){return this.as(t)}}var Mr=_r("ms"),kr=_r("s"),Sr=_r("m"),xr=_r("h"),Ar=_r("d"),Er=_r("w"),Tr=_r("M"),Or=_r("Q"),Nr=_r("y");function Pr(t){return function(){return this.isValid()?this._data[t]:NaN}}var Rr=Pr("milliseconds"),Ir=Pr("seconds"),Cr=Pr("minutes"),Dr=Pr("hours"),jr=Pr("days"),Lr=Pr("months"),Ur=Pr("years"),Br=Math.round,Fr={ss:44,s:45,m:45,h:22,d:26,M:11};function Hr(t,e,r,n,i){return i.relativeTime(e||1,!!r,t,n)}var Gr=Math.abs;function zr(t){return(t>0)-(t<0)||+t}function Wr(){if(!this.isValid())return this.localeData().invalidDate();var t,e,r=Gr(this._milliseconds)/1e3,n=Gr(this._days),i=Gr(this._months);t=M(r/60),e=M(t/60),r%=60,t%=60;var o=M(i/12),s=i%=12,a=n,u=e,h=t,c=r?r.toFixed(3).replace(/\.?0+$/,""):"",l=this.asSeconds();if(!l)return"P0D";var f=l<0?"-":"",d=zr(this._months)!==zr(l)?"-":"",p=zr(this._days)!==zr(l)?"-":"",m=zr(this._milliseconds)!==zr(l)?"-":"";return f+"P"+(o?d+o+"Y":"")+(s?d+s+"M":"")+(a?p+a+"D":"")+(u||h||c?"T":"")+(u?m+u+"H":"")+(h?m+h+"M":"")+(c?m+c+"S":"")}var qr=Ne.prototype;return qr.isValid=function(){return this._isValid},qr.abs=function(){var t=this._data;return this._milliseconds=vr(this._milliseconds),this._days=vr(this._days),this._months=vr(this._months),t.milliseconds=vr(t.milliseconds),t.seconds=vr(t.seconds),t.minutes=vr(t.minutes),t.hours=vr(t.hours),t.months=vr(t.months),t.years=vr(t.years),this},qr.add=function(t,e){return gr(this,t,e,1)},qr.subtract=function(t,e){return gr(this,t,e,-1)},qr.as=function(t){if(!this.isValid())return NaN;var e,r,n=this._milliseconds;if("month"===(t=D(t))||"quarter"===t||"year"===t)switch(e=this._days+n/864e5,r=this._months+wr(e),t){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(e=this._days+Math.round(br(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return 24*e+n/36e5;case"minute":return 1440*e+n/6e4;case"second":return 86400*e+n/1e3;case"millisecond":return Math.floor(864e5*e)+n;default:throw new Error("Unknown unit "+t)}},qr.asMilliseconds=Mr,qr.asSeconds=kr,qr.asMinutes=Sr,qr.asHours=xr,qr.asDays=Ar,qr.asWeeks=Er,qr.asMonths=Tr,qr.asQuarters=Or,qr.asYears=Nr,qr.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},qr._bubble=function(){var t,e,r,n,i,o=this._milliseconds,s=this._days,a=this._months,u=this._data;return o>=0&&s>=0&&a>=0||o<=0&&s<=0&&a<=0||(o+=864e5*yr(br(a)+s),s=0,a=0),u.milliseconds=o%1e3,t=M(o/1e3),u.seconds=t%60,e=M(t/60),u.minutes=e%60,r=M(e/60),u.hours=r%24,s+=M(r/24),a+=i=M(wr(s)),s-=yr(br(i)),n=M(a/12),a%=12,u.days=s,u.months=a,u.years=n,this},qr.clone=function(){return He(this)},qr.get=function(t){return t=D(t),this.isValid()?this[t+"s"]():NaN},qr.milliseconds=Rr,qr.seconds=Ir,qr.minutes=Cr,qr.hours=Dr,qr.days=jr,qr.weeks=function(){return M(this.days()/7)},qr.months=Lr,qr.years=Ur,qr.humanize=function(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),r=function(t,e,r){var n=He(t).abs(),i=Br(n.as("s")),o=Br(n.as("m")),s=Br(n.as("h")),a=Br(n.as("d")),u=Br(n.as("M")),h=Br(n.as("y")),c=i<=Fr.ss&&["s",i]||i0,c[4]=r,Hr.apply(null,c)}(this,!t,e);return t&&(r=e.pastFuture(+this,r)),e.postformat(r)},qr.toISOString=Wr,qr.toString=Wr,qr.toJSON=Wr,qr.locale=Ze,qr.localeData=$e,qr.toIsoString=A("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Wr),qr.lang=Je,W("X",0,0,"unix"),W("x",0,0,"valueOf"),ct("x",ot),ct("X",/[+-]?\d+(\.\d{1,3})?/),pt("X",(function(t,e,r){r._d=new Date(1e3*parseFloat(t,10))})),pt("x",(function(t,e,r){r._d=new Date(k(t))})),n.version="2.24.0",e=xe,n.fn=cr,n.min=function(){var t=[].slice.call(arguments,0);return Te("isBefore",t)},n.max=function(){var t=[].slice.call(arguments,0);return Te("isAfter",t)},n.now=function(){return Date.now?Date.now():+new Date},n.utc=f,n.unix=function(t){return xe(1e3*t)},n.months=function(t,e){return pr(t,e,"months")},n.isDate=u,n.locale=oe,n.invalid=v,n.duration=He,n.isMoment=_,n.weekdays=function(t,e,r){return mr(t,e,r,"weekdays")},n.parseZone=function(){return xe.apply(null,arguments).parseZone()},n.localeData=ae,n.isDuration=Pe,n.monthsShort=function(t,e){return pr(t,e,"monthsShort")},n.weekdaysMin=function(t,e,r){return mr(t,e,r,"weekdaysMin")},n.defineLocale=se,n.updateLocale=function(t,e){if(null!=e){var r,n,i=te;null!=(n=ie(t))&&(i=n._config),(r=new R(e=P(i,e))).parentLocale=ee[t],ee[t]=r,oe(t)}else null!=ee[t]&&(null!=ee[t].parentLocale?ee[t]=ee[t].parentLocale:null!=ee[t]&&delete ee[t]);return ee[t]},n.locales=function(){return E(ee)},n.weekdaysShort=function(t,e,r){return mr(t,e,r,"weekdaysShort")},n.normalizeUnits=D,n.relativeTimeRounding=function(t){return void 0===t?Br:"function"==typeof t&&(Br=t,!0)},n.relativeTimeThreshold=function(t,e){return void 0!==Fr[t]&&(void 0===e?Fr[t]:(Fr[t]=e,"s"===t&&(Fr.ss=e-1),!0))},n.calendarFormat=function(t,e){var r=t.diff(e,"days",!0);return r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse"},n.prototype=cr,n.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},n}()})),C="0.0.4-beta.157",D=Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){function e(){for(var e=arguments.length,r=new Array(e),n=0;n1?r-1:0),i=1;i1&&void 0!==arguments[1]?arguments[1]:t.length;if(!e)throw new Error("arity is undefined");return function(){for(var r=this,n=arguments.length,i=new Array(n),o=0;o1?e-1:0),i=1;i1?r:r[0])},t.apply(r,i)}))}},t.exports=e.default}));Object(p.c)(H);var G=Object(p.c)(Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=s(D),n=s(j),i=s(F),o=s(H);function s(t){return t&&t.__esModule?t:{default:t}}e.default=(0,o.default)((function(t,e){if(e=(0,r.default)(e),!Array.isArray(t))return e(new Error("First argument to waterfall must be an array of functions"));if(!t.length)return e();var o=0;function s(e){(0,i.default)(t[o++]).apply(void 0,Object(d.a)(e).concat([(0,n.default)(a)]))}function a(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a=r._providers.length)a(new Error('Request for method "'+t.method+'" not handled by any subprovider. Please check your subprovider configuration to ensure this method is handled.'));else try{r._providers[n].handleRequest(t,e,a)}catch(t){a(t)}}()},$.prototype._setCurrentBlock=function(t){this.currentBlock=t,this.emit("block",t)};var X=Q;function Q(){}Q.prototype.setEngine=function(t){var e=this;e.engine||(e.engine=t,t.on("block",(function(t){e.currentBlock=t})),t.on("start",(function(){e.start()})),t.on("stop",(function(){e.stop()})))},Q.prototype.handleRequest=function(t,e,r){throw new Error("Subproviders should override `handleRequest`.")},Q.prototype.emitPayload=function(t,e){this.engine.sendAsync(Y(t),e)},Q.prototype.stop=function(){},Q.prototype.start=function(){};var tt=g.c.inherits,et=/^[0-9A-Fa-f]+$/g,rt=nt;function nt(t){this.nonceLock=Object(v.c)(1),t.getAccounts&&(this.getAccounts=t.getAccounts),t.processTransaction&&(this.processTransaction=t.processTransaction),t.processSignTransaction&&(this.processSignTransaction=t.processSignTransaction),t.processMessage&&(this.processMessage=t.processMessage),t.processPersonalMessage&&(this.processPersonalMessage=t.processPersonalMessage),t.processTypedMessage&&(this.processTypedMessage=t.processTypedMessage),this.approveTransaction=t.approveTransaction||this.autoApprove,this.approveMessage=t.approveMessage||this.autoApprove,this.approvePersonalMessage=t.approvePersonalMessage||this.autoApprove,this.approveTypedMessage=t.approveTypedMessage||this.autoApprove,this.signTransaction=t.signTransaction||st("signTransaction"),this.signMessage=t.signMessage||st("signMessage"),this.signPersonalMessage=t.signPersonalMessage||st("signPersonalMessage"),this.signTypedMessage=t.signTypedMessage||st("signTypedMessage"),t.recoverPersonalSignature&&(this.recoverPersonalSignature=t.recoverPersonalSignature),t.publishTransaction&&(this.publishTransaction=t.publishTransaction),this.estimateGas=t.estimateGas||this.estimateGas,this.getGasPrice=t.getGasPrice||this.getGasPrice}function it(t){return t.toLowerCase()}function ot(t){return"string"==typeof t&&"0x"===t.slice(0,2)&&t.slice(2).match(et)}function st(t){return function(e,r){r(new Error('ProviderEngine - HookedWalletSubprovider - Must provide "'+t+'" fn in constructor options'))}}tt(nt,X),nt.prototype.handleRequest=function(t,e,r){var n,i,o,s,a,u=this;switch(u._parityRequests={},u._parityRequestCount=0,t.method){case"eth_coinbase":return void u.getAccounts((function(t,e){if(t)return r(t);var n=e[0]||null;r(null,n)}));case"eth_accounts":return void u.getAccounts((function(t,e){if(t)return r(t);r(null,e)}));case"eth_sendTransaction":return n=t.params[0],void Object(v.p)([function(t){return u.validateTransaction(n,t)},function(t){return u.processTransaction(n,t)}],r);case"eth_signTransaction":return n=t.params[0],void Object(v.p)([function(t){return u.validateTransaction(n,t)},function(t){return u.processSignTransaction(n,t)}],r);case"eth_sign":return a=t.params[0],s=t.params[1],o=t.params[2]||{},i=Object(v.h)(o,{from:a,data:s}),void Object(v.p)([function(t){return u.validateMessage(i,t)},function(t){return u.processMessage(i,t)}],r);case"personal_sign":return function(){var e=t.params[0];if(function(t){var e=v.d.addHexPrefix(t);return!v.d.isValidAddress(e)&&ot(t)}(t.params[1])&&function(t){var e=v.d.addHexPrefix(t);return v.d.isValidAddress(e)}(e)){"[message, address]. This was previously handled incorrectly, ","and has been corrected automatically. ","Please switch this param order for smooth behavior in the future.",console.warn("The eth_personalSign method requires params ordered [message, address]. This was previously handled incorrectly, and has been corrected automatically. Please switch this param order for smooth behavior in the future."),a=t.params[0],s=t.params[1]}else s=t.params[0],a=t.params[1];o=t.params[2]||{},i=Object(v.h)(o,{from:a,data:s}),Object(v.p)([function(t){return u.validatePersonalMessage(i,t)},function(t){return u.processPersonalMessage(i,t)}],r)}();case"personal_ecRecover":return function(){s=t.params[0];var e=t.params[1];o=t.params[2]||{},i=Object(v.h)(o,{sig:e,data:s}),u.recoverPersonalSignature(i,r)}();case"eth_signTypedData":return s=t.params[0],a=t.params[1],o=t.params[2]||{},i=Object(v.h)(o,{from:a,data:s}),void Object(v.p)([function(t){return u.validateTypedMessage(i,t)},function(t){return u.processTypedMessage(i,t)}],r);case"parity_postTransaction":return n=t.params[0],void u.parityPostTransaction(n,r);case"parity_postSign":return a=t.params[0],s=t.params[1],void u.parityPostSign(a,s,r);case"parity_checkRequest":return function(){var e=t.params[0];u.parityCheckRequest(e,r)}();case"parity_defaultAccount":return void u.getAccounts((function(t,e){if(t)return r(t);var n=e[0]||null;r(null,n)}));default:return void e()}},nt.prototype.getAccounts=function(t){t(null,[])},nt.prototype.processTransaction=function(t,e){var r=this;Object(v.p)([function(e){return r.approveTransaction(t,e)},function(t,e){return r.checkApproval("transaction",t,e)},function(e){return r.finalizeAndSubmitTx(t,e)}],e)},nt.prototype.processSignTransaction=function(t,e){var r=this;Object(v.p)([function(e){return r.approveTransaction(t,e)},function(t,e){return r.checkApproval("transaction",t,e)},function(e){return r.finalizeTx(t,e)}],e)},nt.prototype.processMessage=function(t,e){var r=this;Object(v.p)([function(e){return r.approveMessage(t,e)},function(t,e){return r.checkApproval("message",t,e)},function(e){return r.signMessage(t,e)}],e)},nt.prototype.processPersonalMessage=function(t,e){var r=this;Object(v.p)([function(e){return r.approvePersonalMessage(t,e)},function(t,e){return r.checkApproval("message",t,e)},function(e){return r.signPersonalMessage(t,e)}],e)},nt.prototype.processTypedMessage=function(t,e){var r=this;Object(v.p)([function(e){return r.approveTypedMessage(t,e)},function(t,e){return r.checkApproval("message",t,e)},function(e){return r.signTypedMessage(t,e)}],e)},nt.prototype.autoApprove=function(t,e){e(null,!0)},nt.prototype.checkApproval=function(t,e,r){r(e?null:new Error("User denied "+t+" signature."))},nt.prototype.parityPostTransaction=function(t,e){var r=this,n="0x".concat(r._parityRequestCount.toString(16));r._parityRequestCount++,r.emitPayload({method:"eth_sendTransaction",params:[t]},(function(t,e){if(t)r._parityRequests[n]={error:t};else{var i=e.result;r._parityRequests[n]=i}})),e(null,n)},nt.prototype.parityPostSign=function(t,e,r){var n=this,i="0x".concat(n._parityRequestCount.toString(16));n._parityRequestCount++,n.emitPayload({method:"eth_sign",params:[t,e]},(function(t,e){if(t)n._parityRequests[i]={error:t};else{var r=e.result;n._parityRequests[i]=r}})),r(null,i)},nt.prototype.parityCheckRequest=function(t,e){var r=this._parityRequests[t]||null;return r?r.error?e(r.error):void e(null,r):e(null,null)},nt.prototype.recoverPersonalSignature=function(t,e){var r;try{r=v.o.recoverPersonalSignature(t)}catch(t){return e(t)}e(null,r)},nt.prototype.validateTransaction=function(t,e){if(void 0===t.from)return e(new Error("Undefined address - from address required to sign transaction."));this.validateSender(t.from,(function(r,n){return r?e(r):n?void e():e(new Error('Unknown address - unable to sign transaction for this address: "'.concat(t.from,'"')))}))},nt.prototype.validateMessage=function(t,e){if(void 0===t.from)return e(new Error("Undefined address - from address required to sign message."));this.validateSender(t.from,(function(r,n){return r?e(r):n?void e():e(new Error('Unknown address - unable to sign message for this address: "'.concat(t.from,'"')))}))},nt.prototype.validatePersonalMessage=function(t,e){return void 0===t.from?e(new Error("Undefined address - from address required to sign personal message.")):void 0===t.data?e(new Error("Undefined message - message required to sign personal message.")):ot(t.data)?void this.validateSender(t.from,(function(r,n){return r?e(r):n?void e():e(new Error('Unknown address - unable to sign message for this address: "'.concat(t.from,'"')))})):e(new Error("HookedWalletSubprovider - validateMessage - message was not encoded as hex."))},nt.prototype.validateTypedMessage=function(t,e){return void 0===t.from?e(new Error("Undefined address - from address required to sign typed data.")):void 0===t.data?e(new Error("Undefined data - message required to sign typed data.")):void this.validateSender(t.from,(function(r,n){return r?e(r):n?void e():e(new Error('Unknown address - unable to sign message for this address: "'.concat(t.from,'"')))}))},nt.prototype.validateSender=function(t,e){if(!t)return e(null,!1);this.getAccounts((function(r,n){if(r)return e(r);var i=-1!==n.map(it).indexOf(t.toLowerCase());e(null,i)}))},nt.prototype.finalizeAndSubmitTx=function(t,e){var r=this;r.nonceLock.take((function(){Object(v.p)([r.fillInTxExtras.bind(r,t),r.signTransaction.bind(r),r.publishTransaction.bind(r)],(function(t,n){if(r.nonceLock.leave(),t)return e(t);e(null,n)}))}))},nt.prototype.finalizeTx=function(t,e){var r=this;r.nonceLock.take((function(){Object(v.p)([r.fillInTxExtras.bind(r,t),r.signTransaction.bind(r)],(function(n,i){if(r.nonceLock.leave(),n)return e(n);e(null,{raw:i,tx:t})}))}))},nt.prototype.publishTransaction=function(t,e){this.emitPayload({method:"eth_sendRawTransaction",params:[t]},(function(t,r){if(t)return e(t);e(null,r.result)}))},nt.prototype.estimateGas=function(t,e){!function(t,e,r){t.sendAsync(Y({method:"eth_estimateGas",params:[e]}),(function(t,e){if(t)return"no contract code at given address"===t.message?r(null,"0xcf08"):r(t);r(null,e.result)}))}(this.engine,t,e)},nt.prototype.getGasPrice=function(t){this.emitPayload({method:"eth_gasPrice",params:[]},(function(e,r){if(e)return t(e);t(null,r.result)}))},nt.prototype.fillInTxExtras=function(t,e){var r=this,n=t.from,i={};void 0===t.gasPrice&&(i.gasPrice=r.getGasPrice.bind(r)),void 0===t.nonce&&(i.nonce=r.emitPayload.bind(r,{method:"eth_getTransactionCount",params:[n,"pending"]})),void 0===t.gas&&(i.gas=r.estimateGas.bind(r,function(t){return{from:t.from,to:t.to,value:t.value,data:t.data,gas:t.gas,gasPrice:t.gasPrice,nonce:t.nonce}}(t))),Object(v.n)(i,(function(r,n){if(r)return e(r);var i={};n.gasPrice&&(i.gasPrice=n.gasPrice),n.nonce&&(i.nonce=n.nonce.result),n.gas&&(i.gas=n.gas),e(null,Object(v.h)(t,i))}))};var at="undefined"!=typeof window?window:void 0!==p.d?p.d:"undefined"!=typeof self?self:{},ut=Object.prototype.toString,ht=function(t){return t.replace(/^\s+|\s+$/g,"")},ct=dt,lt=dt;function ft(t,e,r){var n=t;return function(t){var e=ut.call(t);return"[object Function]"===e||"function"==typeof t&&"[object RegExp]"!==e||"undefined"!=typeof window&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)}(e)?(r=e,"string"==typeof t&&(n={uri:t})):n=Object(v.h)(e,{uri:t}),n.callback=r,n}function dt(t,e,r){return pt(e=ft(t,e,r))}function pt(t){if(void 0===t.callback)throw new Error("callback argument missing");var e=!1,r=function(r,n,i){e||(e=!0,t.callback(r,n,i))};function n(){var t=void 0;if(t=u.response?u.response:u.responseText||function(t){try{if("document"===t.responseType)return t.responseXML;var e=t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;if(""===t.responseType&&!e)return t.responseXML}catch(t){}return null}(u),m)try{t=JSON.parse(t)}catch(t){}return t}function i(t){return clearTimeout(h),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,r(t,v)}function o(){if(!a){var e;clearTimeout(h),e=t.useXDR&&void 0===u.status?200:1223===u.status?204:u.status;var i=v,o=null;return 0!==e?(i={body:n(),statusCode:e,method:l,headers:{},url:c,rawRequest:u},u.getAllResponseHeaders&&(i.headers=function(t){if(!t)return{};for(var e,r={},n=ht(t).split("\n"),i=0;i0&&(h=setTimeout((function(){if(!a){a=!0,u.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",i(t)}}),t.timeout)),u.setRequestHeader)for(s in d)d.hasOwnProperty(s)&&u.setRequestHeader(s,d[s]);else if(t.headers&&!function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(u.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(u),u.send(f||null),u}dt.XMLHttpRequest=at.XMLHttpRequest||function(){},dt.XDomainRequest="withCredentials"in new dt.XMLHttpRequest?dt.XMLHttpRequest:at.XDomainRequest,function(t,e){for(var r=0;re?1:0}function _t(t,e,r){var n,i=function t(e,r,n,i){var o;if("object"==typeof e&&null!==e){for(o=0;o0)for(var n=0;n=1e3&&t<=4999}(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');return e.call(this,t,n,i)}return r}(kt)},At=Object.freeze({__proto__:null,default:{4001:{standard:"EIP 1193",message:"User rejected the request."},4100:{standard:"EIP 1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP 1193",message:"The requested method is not supported by this Ethereum provider."},"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."}}}),Et={parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},Tt={userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200},Ot={jsonRpc:Et,eth:Tt},Nt=Object.freeze({__proto__:null,jsonRpc:Et,eth:Tt,default:Ot}),Pt=Object(p.f)(At),Rt=Object(p.f)(Nt),It=Rt.jsonRpc.internal,Ct=xt.JsonRpcError,Dt={code:It,message:jt(It)};function jt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Unspecified error message. This is bug, please report it.";if(Number.isInteger(t)){var r=t.toString();if(Pt[r])return Pt[r].message;if(Ut(t))return"Unspecified server error."}return e}function Lt(t){if(!Number.isInteger(t))return!1;var e=t.toString();return!!Pt[e]||!!Ut(t)}function Ut(t){return t>=-32099&&t<=-32e3}function Bt(t){return t&&"object"==typeof t&&!Array.isArray(t)?Object.assign({},t):t}var Ft=xt.JsonRpcError,Ht=xt.EthJsonRpcError,Gt=jt;function zt(t,e,r){return new Ft(t,e||Gt(t),r)}function Wt(t,e,r){return new Ht(t,e||Gt(t),r)}var qt={errors:{parse:function(t,e){return zt(Rt.jsonRpc.parse,t,e)},invalidRequest:function(t,e){return zt(Rt.jsonRpc.invalidRequest,t,e)},invalidParams:function(t,e){return zt(Rt.jsonRpc.invalidParams,t,e)},methodNotFound:function(t,e){return zt(Rt.jsonRpc.methodNotFound,t,e)},internal:function(t,e){return zt(Rt.jsonRpc.internal,t,e)},server:function(t,e,r){if(!Number.isInteger(t)||t>-32e3||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32000');return zt(t,e,r)},eth:{userRejectedRequest:function(t,e){return Wt(Rt.eth.userRejectedRequest,t,e)},unauthorized:function(t,e){return Wt(Rt.eth.unauthorized,t,e)},unsupportedMethod:function(t,e){return Wt(Rt.eth.unsupportedMethod,t,e)},custom:function(t,e,r){if(!e||"string"!=typeof e)throw new Error('"message" must be a nonempty string');return new Ht(t,e,r)}}},JsonRpcError:xt.JsonRpcError,EthJsonRpcError:xt.EthJsonRpcError,serializeError:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Dt;if(!e||!Number.isInteger(e.code)||"string"!=typeof e.message)throw new Error("fallbackError must contain integer number code and string message.");if("object"==typeof t&&t instanceof Ct)return t.serialize();var r={};return t&&Lt(t.code)?(r.code=t.code,t.message&&"string"==typeof t.message?(r.message=t.message,t.hasOwnProperty("data")&&(r.data=t.data)):(r.message=jt(r.code),r.data={originalError:Bt(t)})):(r.code=e.code,r.message=t&&t.message?t.message:e.message,r.data={originalError:Bt(t)}),t&&t.stack&&(r.stack=t.stack),r},getMessageFromCode:jt,ERROR_CODES:Rt},Kt=Object(p.f)(mt),Yt=n.browser?ct:Kt,Vt=g.c.inherits,Zt=qt.errors,Jt=$t;function $t(t){this.rpcUrl=t.rpcUrl}Vt($t,X),$t.prototype.handleRequest=function(t,e,r){var n=this.rpcUrl,i=Y(t);Yt({uri:n,method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(i),rejectUnauthorized:!1,timeout:2e4},(function(t,e,n){if(t)return r(Zt.internal(t));switch(e.statusCode){case 405:return r(Zt.methodNotFound());case 504:return r(Zt.internal("Gateway timeout. The request took too long to process. This can happen when querying logs over too wide a block range."));case 429:return function(){var t=new Error("Too Many Requests");return r(Zt.internal(t))}();default:if(200!=e.statusCode)return r(Zt.internal(e.body))}var i;try{i=JSON.parse(n)}catch(t){return console.error(t.stack),r(Zt.internal(t))}if(i.error)return r(i.error);r(null,i.result)}))};var Xt=function(t){Object(c.a)(r,t);var e=Object(l.a)(r);function r(t){var n;if(Object(u.a)(this,r),n=e.call(this),!t)throw new Error("JsonRpcEngineMiddlewareSubprovider - no constructorFn specified");return n._constructorFn=t,Object(a.a)(n)}return Object(h.a)(r,[{key:"setEngine",value:function(t){if(this.middleware)throw new Error("JsonRpcEngineMiddlewareSubprovider - subprovider added to engine twice");var e=t._blockTracker,r=this._constructorFn({engine:t,provider:t,blockTracker:e});if(!r)throw new Error("JsonRpcEngineMiddlewareSubprovider - _constructorFn did not return middleware");if("function"!=typeof r)throw new Error("JsonRpcEngineMiddlewareSubprovider - specified middleware is not a function");this.middleware=r}},{key:"handleRequest",value:function(t,e,r){var n={id:t.id};this.middleware(t,n,(function(t){e((function(e,r,i){e?(delete n.result,n.error={message:e.message||e}):n.result=r,t?t(i):i()}))}),(function(t){if(t)return r(t);r(null,n.result)}))}}]),r}(X),Qt=function(t){Object(c.a)(r,t);var e=Object(l.a)(r);function r(){return Object(u.a)(this,r),e.call(this,(function(t){var e=t.blockTracker,r=t.provider,n=t.engine,i=Object(v.f)({blockTracker:e,provider:r}),o=i.events,s=i.middleware;return o.on("notification",(function(t){return n.emit("data",null,t)})),s}))}return r}(Xt),te=function(t){Object(c.a)(r,t);var e=Object(l.a)(r);function r(){return Object(u.a)(this,r),e.call(this,(function(t){var e=t.blockTracker,r=t.provider;t.engine;return Object(v.g)({blockTracker:e,provider:r})}))}return r}(Xt),ee=function(t,e){return function(){for(var r=this,n=arguments.length,i=new Array(n),o=0;o=0&&e<=x};v.each=v.forEach=function(t,e,r){var n,i;if(e=y(e,r),E(t))for(n=0,i=t.length;n0?0:s-1;for(i||(n=e[o?o[a]:a],a+=t);a>=0&&a=3;return e(t,y(r,i,4),n,o)}};v.reduce=v.foldl=v.inject=T(1),v.reduceRight=v.foldr=T(-1),v.find=v.detect=function(t,e,r){var n=(E(t)?v.findIndex:v.findKey)(t,e,r);if(void 0!==n&&-1!==n)return t[n]},v.filter=v.select=function(t,e,r){var n=[];return e=w(e,r),v.each(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n},v.reject=function(t,e,r){return v.filter(t,v.negate(w(e)),r)},v.every=v.all=function(t,e,r){e=w(e,r);for(var n=!E(t)&&v.keys(t),i=(n||t).length,o=0;o=0},v.invoke=b((function(t,e,r){var n,i;return v.isFunction(e)?i=e:v.isArray(e)&&(n=e.slice(0,-1),e=e[e.length-1]),v.map(t,(function(t){var o=i;if(!o){if(n&&n.length&&(t=S(t,n)),null==t)return;o=t[e]}return null==o?o:o.apply(t,r)}))})),v.pluck=function(t,e){return v.map(t,v.property(e))},v.where=function(t,e){return v.filter(t,v.matcher(e))},v.findWhere=function(t,e){return v.find(t,v.matcher(e))},v.max=function(t,e,r){var n,i,o=-1/0,s=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,u=(t=E(t)?t:v.values(t)).length;ao&&(o=n);else e=w(e,r),v.each(t,(function(t,r,n){((i=e(t,r,n))>s||i===-1/0&&o===-1/0)&&(o=t,s=i)}));return o},v.min=function(t,e,r){var n,i,o=1/0,s=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,u=(t=E(t)?t:v.values(t)).length;an||void 0===r)return 1;if(r0?0:i-1;o>=0&&o0?s=o>=0?o:Math.max(o+a,s):a=o>=0?Math.min(o+1,a):o+a+1;else if(r&&o&&a)return n[o=r(n,i)]===i?o:-1;if(i!=i)return(o=e(u.call(n,s,a),v.isNaN))>=0?o+s:-1;for(o=t>0?s:a-1;o>=0&&oe?(n&&(clearTimeout(n),n=null),a=h,s=t.apply(i,o),n||(i=o=null)):n||!1===r.trailing||(n=setTimeout(u,c)),s};return h.cancel=function(){clearTimeout(n),a=0,n=i=o=null},h},v.debounce=function(t,e,r){var n,i,o=function(e,r){n=null,r&&(i=t.apply(e,r))},s=b((function(s){if(n&&clearTimeout(n),r){var a=!n;n=setTimeout(o,e),a&&(i=t.apply(this,s))}else n=v.delay(o,e,this,s);return i}));return s.cancel=function(){clearTimeout(n),n=null},s},v.wrap=function(t,e){return v.partial(e,t)},v.negate=function(t){return function(){return!t.apply(this,arguments)}},v.compose=function(){var t=arguments,e=t.length-1;return function(){for(var r=e,n=t[e].apply(this,arguments);r--;)n=t[r].call(this,n);return n}},v.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},v.before=function(t,e){var r;return function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=null),r}},v.once=v.partial(v.before,2),v.restArguments=b;var D=!{toString:null}.propertyIsEnumerable("toString"),j=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],L=function(t,e){var r=j.length,n=t.constructor,i=v.isFunction(n)&&n.prototype||o,s="constructor";for(k(t,s)&&!v.contains(e,s)&&e.push(s);r--;)(s=j[r])in t&&t[s]!==i[s]&&!v.contains(e,s)&&e.push(s)};v.keys=function(t){if(!v.isObject(t))return[];if(f)return f(t);var e=[];for(var r in t)k(t,r)&&e.push(r);return D&&L(t,e),e},v.allKeys=function(t){if(!v.isObject(t))return[];var e=[];for(var r in t)e.push(r);return D&&L(t,e),e},v.values=function(t){for(var e=v.keys(t),r=e.length,n=Array(r),i=0;i1&&(n=y(n,e[1])),e=v.allKeys(t)):(n=H,e=P(e,!1,!1),t=Object(t));for(var i=0,o=e.length;i1&&(r=e[1])):(e=v.map(P(e,!1,!1),String),n=function(t,r){return!v.contains(e,r)}),v.pick(t,n,r)})),v.defaults=U(v.allKeys,!0),v.create=function(t,e){var r=_(t);return e&&v.extendOwn(r,e),r},v.clone=function(t){return v.isObject(t)?v.isArray(t)?t.slice():v.extend({},t):t},v.tap=function(t,e){return e(t),t},v.isMatch=function(t,e){var r=v.keys(e),n=r.length;if(null==t)return!n;for(var i=Object(t),o=0;o":">",'"':""","'":"'","`":"`"},W=v.invert(z),q=function(t){var e=function(e){return t[e]},r="(?:"+v.keys(t).join("|")+")",n=RegExp(r),i=RegExp(r,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(i,e):t}};v.escape=q(z),v.unescape=q(W),v.result=function(t,e,r){v.isArray(e)||(e=[e]);var n=e.length;if(!n)return v.isFunction(r)?r.call(t):r;for(var i=0;i/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var Y=/(.)^/,V={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Z=/\\|'|\r|\n|\u2028|\u2029/g,J=function(t){return"\\"+V[t]};v.template=function(t,e,r){!e&&r&&(e=r),e=v.defaults({},e,v.templateSettings);var n,i=RegExp([(e.escape||Y).source,(e.interpolate||Y).source,(e.evaluate||Y).source].join("|")+"|$","g"),o=0,s="__p+='";t.replace(i,(function(e,r,n,i,a){return s+=t.slice(o,a).replace(Z,J),o=a+e.length,r?s+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?s+="'+\n((__t=("+n+"))==null?'':__t)+\n'":i&&(s+="';\n"+i+"\n__p+='"),e})),s+="';\n",e.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{n=new Function(e.variable||"obj","_",s)}catch(t){throw t.source=s,t}var a=function(t){return n.call(this,t,v)},u=e.variable||"obj";return a.source="function("+u+"){\n"+s+"}",a},v.chain=function(t){var e=v(t);return e._chain=!0,e};var $=function(t,e){return t._chain?v(e).chain():e};v.mixin=function(t){return v.each(v.functions(t),(function(e){var r=v[e]=t[e];v.prototype[e]=function(){var t=[this._wrapped];return a.apply(t,arguments),$(this,r.apply(v,t))}})),v},v.mixin(v),v.each(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=i[t];v.prototype[t]=function(){var r=this._wrapped;return e.apply(r,arguments),"shift"!==t&&"splice"!==t||0!==r.length||delete r[0],$(this,r)}})),v.each(["concat","join","slice"],(function(t){var e=i[t];v.prototype[t]=function(){return $(this,e.apply(this._wrapped,arguments))}})),v.prototype.value=function(){return this._wrapped},v.prototype.valueOf=v.prototype.toJSON=v.prototype.value,v.prototype.toString=function(){return String(this._wrapped)}}()})),ie=(ne._,Object(p.b)((function(t){!function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{o=Object(p.e)("buffer").Buffer}catch(t){}function s(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function a(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return i}i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initArray=function(t,e,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},i.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,u=Math.min(o,o-s)+r,h=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var u=["","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"],h=[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],c=[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];function l(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h>>26,l=67108863&u,f=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=f;d++){var p=h-d|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}i.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?u[6-l.length]+l+n:l+n,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(n=o.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var f=h[t],d=c[t];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);n=(p=p.idivn(d)).isZero()?m+n:u[f-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(t,e){return r(void 0!==o),this.toArrayLike(o,t,e)},i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var n=t/26|0,i=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,w=0|s[3],b=8191&w,_=w>>>13,M=0|s[4],k=8191&M,S=M>>>13,x=0|s[5],A=8191&x,E=x>>>13,T=0|s[6],O=8191&T,N=T>>>13,P=0|s[7],R=8191&P,I=P>>>13,C=0|s[8],D=8191&C,j=C>>>13,L=0|s[9],U=8191&L,B=L>>>13,F=0|a[0],H=8191&F,G=F>>>13,z=0|a[1],W=8191&z,q=z>>>13,K=0|a[2],Y=8191&K,V=K>>>13,Z=0|a[3],J=8191&Z,$=Z>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],lt=8191&ct,ft=ct>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(l,H))|0)+((8191&(i=(i=Math.imul(l,G))+Math.imul(f,H)|0))<<13)|0;h=((o=Math.imul(f,G))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,H),i=(i=Math.imul(p,G))+Math.imul(m,H)|0,o=Math.imul(m,G);var gt=(h+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,q)|0)+Math.imul(f,W)|0))<<13)|0;h=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,H),i=(i=Math.imul(g,G))+Math.imul(y,H)|0,o=Math.imul(y,G),n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,q)|0;var yt=(h+(n=n+Math.imul(l,Y)|0)|0)+((8191&(i=(i=i+Math.imul(l,V)|0)+Math.imul(f,Y)|0))<<13)|0;h=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(b,H),i=(i=Math.imul(b,G))+Math.imul(_,H)|0,o=Math.imul(_,G),n=n+Math.imul(g,W)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,q)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,V)|0;var wt=(h+(n=n+Math.imul(l,J)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(f,J)|0))<<13)|0;h=((o=o+Math.imul(f,$)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,H),i=(i=Math.imul(k,G))+Math.imul(S,H)|0,o=Math.imul(S,G),n=n+Math.imul(b,W)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,V)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,$)|0;var bt=(h+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(f,Q)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(A,H),i=(i=Math.imul(A,G))+Math.imul(E,H)|0,o=Math.imul(E,G),n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,q)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,q)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(f,rt)|0))<<13)|0;h=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(O,H),i=(i=Math.imul(O,G))+Math.imul(N,H)|0,o=Math.imul(N,G),n=n+Math.imul(A,W)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,q)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,V)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,V)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Mt=(h+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,st)|0)+Math.imul(f,ot)|0))<<13)|0;h=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,H),i=(i=Math.imul(R,G))+Math.imul(I,H)|0,o=Math.imul(I,G),n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,q)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,V)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,V)|0,n=n+Math.imul(k,J)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var kt=(h+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(f,ut)|0))<<13)|0;h=((o=o+Math.imul(f,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,G))+Math.imul(j,H)|0,o=Math.imul(j,G),n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,q)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,q)|0,n=n+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,V)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,$)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var St=(h+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ft)|0)+Math.imul(f,lt)|0))<<13)|0;h=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,H),i=(i=Math.imul(U,G))+Math.imul(B,H)|0,o=Math.imul(B,G),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,q)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,q)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,V)|0,n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,$)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ft)|0;var xt=(h+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(f,pt)|0))<<13)|0;h=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,q))+Math.imul(B,W)|0,o=Math.imul(B,q),n=n+Math.imul(D,Y)|0,i=(i=i+Math.imul(D,V)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,$)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(g,lt)|0,i=(i=i+Math.imul(g,ft)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ft)|0;var At=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(U,Y),i=(i=Math.imul(U,V))+Math.imul(B,Y)|0,o=Math.imul(B,V),n=n+Math.imul(D,J)|0,i=(i=i+Math.imul(D,$)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,$)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ft)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ft)|0;var Et=(h+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(U,J),i=(i=Math.imul(U,$))+Math.imul(B,J)|0,o=Math.imul(B,$),n=n+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ht)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ft)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ft)|0;var Tt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,tt))+Math.imul(B,Q)|0,o=Math.imul(B,tt),n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(O,ut)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(A,lt)|0,i=(i=i+Math.imul(A,ft)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ft)|0;var Ot=(h+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(B,rt)|0,o=Math.imul(B,nt),n=n+Math.imul(D,ot)|0,i=(i=i+Math.imul(D,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,ft)|0;var Nt=(h+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;h=((o=o+Math.imul(E,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(B,ot)|0,o=Math.imul(B,st),n=n+Math.imul(D,ut)|0,i=(i=i+Math.imul(D,ht)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ft)|0)+Math.imul(I,lt)|0,o=o+Math.imul(I,ft)|0;var Pt=(h+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ht))+Math.imul(B,ut)|0,o=Math.imul(B,ht),n=n+Math.imul(D,lt)|0,i=(i=i+Math.imul(D,ft)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ft)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,lt),i=(i=Math.imul(U,ft))+Math.imul(B,lt)|0,o=Math.imul(B,ft);var It=(h+(n=n+Math.imul(D,pt)|0)|0)+((8191&(i=(i=i+Math.imul(D,mt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863;var Ct=(h+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,mt))+Math.imul(B,pt)|0))<<13)|0;return h=((o=Math.imul(B,mt))+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=vt,u[1]=gt,u[2]=yt,u[3]=wt,u[4]=bt,u[5]=_t,u[6]=Mt,u[7]=kt,u[8]=St,u[9]=xt,u[10]=At,u[11]=Et,u[12]=Tt,u[13]=Ot,u[14]=Nt,u[15]=Pt,u[16]=Rt,u[17]=It,u[18]=Ct,0!==h&&(u[19]=h,r.length++),r};function d(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(f=l),i.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?f(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):d(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=i.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,n[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=i/67108864|0,e+=o>>>26,this.words[n]=67108863&o}return 0!==e&&(this.words[n]=e,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new i(1);for(var r=this,n=0;n=0);var e,n=t%26,i=(t-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(e=0;e>>26-n}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==c||h>=i);h--){var l=0|this.words[h];this.words[h]=c<<26-o|l>>>o,c=l&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<=0);var e=t%26,n=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),o=t,s=0|o.words[o.length-1];0!==(r=26-this._countBits(s))&&(o=o.ushln(r),n.iushln(r),s=0|o.words[o.length-1]);var a,u=n.length-o.length;if("mod"!==e){(a=new i(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;l--){var f=67108864*(0|n.words[o.length+l])+(0|n.words[o.length+l-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(o,f,l);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(o,1,l),n.isZero()||(n.negative^=1);a&&(a.words[l]=f)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},i.prototype.divmod=function(t,e,n){return r(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(o=a.div.neg()),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(o=a.div.neg()),{div:o,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e);var o,s,a},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(e*n+(0|this.words[i]))%t;return n},i.prototype.idivn=function(t){r(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),s=new i(0),a=new i(0),u=new i(1),h=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++h;for(var c=n.clone(),l=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(c),s.isub(l)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(l)),a.iushrn(1),u.iushrn(1);e.cmp(n)>=0?(e.isub(n),o.isub(a),s.isub(u)):(n.isub(e),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:n.iushln(h)}},i.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,s=new i(1),a=new i(0),u=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var h=0,c=1;0==(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,f=1;0==(n.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(n.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(n)>=0?(e.isub(n),s.isub(a)):(n.isub(e),a.isub(s))}return(o=0===e.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(t),o},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)e=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new M(t)},i.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}g.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new w;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},M.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var n=this.m.add(new i(1)).iushrn(2);return this.pow(t,n)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new i(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var l=this.pow(c,o),f=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();r(v=0;n--){for(var h=e.words[n],c=u-1;c>=0;c--){var l=h>>c&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==s?(s<<=1,s|=l,(4===++a||0===n&&0===c)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}u=26}return o},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new k(t)},n(k,M),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,p.d)}))),oe=Object(p.b)((function(t){!function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{o=Object(p.e)("buffer").Buffer}catch(t){}function s(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function a(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return i}i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initArray=function(t,e,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},i.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,u=Math.min(o,o-s)+r,h=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var u=["","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"],h=[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],c=[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];function l(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h>>26,l=67108863&u,f=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=f;d++){var p=h-d|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}i.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?u[6-l.length]+l+n:l+n,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(n=o.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var f=h[t],d=c[t];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);n=(p=p.idivn(d)).isZero()?m+n:u[f-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(t,e){return r(void 0!==o),this.toArrayLike(o,t,e)},i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var n=t/26|0,i=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,w=0|s[3],b=8191&w,_=w>>>13,M=0|s[4],k=8191&M,S=M>>>13,x=0|s[5],A=8191&x,E=x>>>13,T=0|s[6],O=8191&T,N=T>>>13,P=0|s[7],R=8191&P,I=P>>>13,C=0|s[8],D=8191&C,j=C>>>13,L=0|s[9],U=8191&L,B=L>>>13,F=0|a[0],H=8191&F,G=F>>>13,z=0|a[1],W=8191&z,q=z>>>13,K=0|a[2],Y=8191&K,V=K>>>13,Z=0|a[3],J=8191&Z,$=Z>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],lt=8191&ct,ft=ct>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(l,H))|0)+((8191&(i=(i=Math.imul(l,G))+Math.imul(f,H)|0))<<13)|0;h=((o=Math.imul(f,G))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,H),i=(i=Math.imul(p,G))+Math.imul(m,H)|0,o=Math.imul(m,G);var gt=(h+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,q)|0)+Math.imul(f,W)|0))<<13)|0;h=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,H),i=(i=Math.imul(g,G))+Math.imul(y,H)|0,o=Math.imul(y,G),n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,q)|0;var yt=(h+(n=n+Math.imul(l,Y)|0)|0)+((8191&(i=(i=i+Math.imul(l,V)|0)+Math.imul(f,Y)|0))<<13)|0;h=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(b,H),i=(i=Math.imul(b,G))+Math.imul(_,H)|0,o=Math.imul(_,G),n=n+Math.imul(g,W)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,q)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,V)|0;var wt=(h+(n=n+Math.imul(l,J)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(f,J)|0))<<13)|0;h=((o=o+Math.imul(f,$)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,H),i=(i=Math.imul(k,G))+Math.imul(S,H)|0,o=Math.imul(S,G),n=n+Math.imul(b,W)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,V)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,$)|0;var bt=(h+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(f,Q)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(A,H),i=(i=Math.imul(A,G))+Math.imul(E,H)|0,o=Math.imul(E,G),n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,q)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,q)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(f,rt)|0))<<13)|0;h=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(O,H),i=(i=Math.imul(O,G))+Math.imul(N,H)|0,o=Math.imul(N,G),n=n+Math.imul(A,W)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,q)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,V)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,V)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Mt=(h+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,st)|0)+Math.imul(f,ot)|0))<<13)|0;h=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,H),i=(i=Math.imul(R,G))+Math.imul(I,H)|0,o=Math.imul(I,G),n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,q)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,V)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,V)|0,n=n+Math.imul(k,J)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var kt=(h+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(f,ut)|0))<<13)|0;h=((o=o+Math.imul(f,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,G))+Math.imul(j,H)|0,o=Math.imul(j,G),n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,q)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,q)|0,n=n+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,V)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,$)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var St=(h+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ft)|0)+Math.imul(f,lt)|0))<<13)|0;h=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,H),i=(i=Math.imul(U,G))+Math.imul(B,H)|0,o=Math.imul(B,G),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,q)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,q)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,V)|0,n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,$)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ft)|0;var xt=(h+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(f,pt)|0))<<13)|0;h=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,q))+Math.imul(B,W)|0,o=Math.imul(B,q),n=n+Math.imul(D,Y)|0,i=(i=i+Math.imul(D,V)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,$)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(g,lt)|0,i=(i=i+Math.imul(g,ft)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ft)|0;var At=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(U,Y),i=(i=Math.imul(U,V))+Math.imul(B,Y)|0,o=Math.imul(B,V),n=n+Math.imul(D,J)|0,i=(i=i+Math.imul(D,$)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,$)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ft)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ft)|0;var Et=(h+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(U,J),i=(i=Math.imul(U,$))+Math.imul(B,J)|0,o=Math.imul(B,$),n=n+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ht)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ft)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ft)|0;var Tt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,tt))+Math.imul(B,Q)|0,o=Math.imul(B,tt),n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(O,ut)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(A,lt)|0,i=(i=i+Math.imul(A,ft)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ft)|0;var Ot=(h+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(B,rt)|0,o=Math.imul(B,nt),n=n+Math.imul(D,ot)|0,i=(i=i+Math.imul(D,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,ft)|0;var Nt=(h+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;h=((o=o+Math.imul(E,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(B,ot)|0,o=Math.imul(B,st),n=n+Math.imul(D,ut)|0,i=(i=i+Math.imul(D,ht)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ft)|0)+Math.imul(I,lt)|0,o=o+Math.imul(I,ft)|0;var Pt=(h+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ht))+Math.imul(B,ut)|0,o=Math.imul(B,ht),n=n+Math.imul(D,lt)|0,i=(i=i+Math.imul(D,ft)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ft)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,lt),i=(i=Math.imul(U,ft))+Math.imul(B,lt)|0,o=Math.imul(B,ft);var It=(h+(n=n+Math.imul(D,pt)|0)|0)+((8191&(i=(i=i+Math.imul(D,mt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863;var Ct=(h+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,mt))+Math.imul(B,pt)|0))<<13)|0;return h=((o=Math.imul(B,mt))+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=vt,u[1]=gt,u[2]=yt,u[3]=wt,u[4]=bt,u[5]=_t,u[6]=Mt,u[7]=kt,u[8]=St,u[9]=xt,u[10]=At,u[11]=Et,u[12]=Tt,u[13]=Ot,u[14]=Nt,u[15]=Pt,u[16]=Rt,u[17]=It,u[18]=Ct,0!==h&&(u[19]=h,r.length++),r};function d(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(f=l),i.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?f(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):d(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=i.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,n[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=i/67108864|0,e+=o>>>26,this.words[n]=67108863&o}return 0!==e&&(this.words[n]=e,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new i(1);for(var r=this,n=0;n=0);var e,n=t%26,i=(t-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(e=0;e>>26-n}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==c||h>=i);h--){var l=0|this.words[h];this.words[h]=c<<26-o|l>>>o,c=l&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<=0);var e=t%26,n=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),o=t,s=0|o.words[o.length-1];0!==(r=26-this._countBits(s))&&(o=o.ushln(r),n.iushln(r),s=0|o.words[o.length-1]);var a,u=n.length-o.length;if("mod"!==e){(a=new i(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;l--){var f=67108864*(0|n.words[o.length+l])+(0|n.words[o.length+l-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(o,f,l);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(o,1,l),n.isZero()||(n.negative^=1);a&&(a.words[l]=f)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},i.prototype.divmod=function(t,e,n){return r(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(o=a.div.neg()),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(o=a.div.neg()),{div:o,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e);var o,s,a},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(e*n+(0|this.words[i]))%t;return n},i.prototype.idivn=function(t){r(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),s=new i(0),a=new i(0),u=new i(1),h=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++h;for(var c=n.clone(),l=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(c),s.isub(l)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(l)),a.iushrn(1),u.iushrn(1);e.cmp(n)>=0?(e.isub(n),o.isub(a),s.isub(u)):(n.isub(e),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:n.iushln(h)}},i.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,s=new i(1),a=new i(0),u=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var h=0,c=1;0==(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,f=1;0==(n.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(n.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(n)>=0?(e.isub(n),s.isub(a)):(n.isub(e),a.isub(s))}return(o=0===e.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(t),o},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)e=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new M(t)},i.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}g.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new w;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},M.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var n=this.m.add(new i(1)).iushrn(2);return this.pow(t,n)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new i(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var l=this.pow(c,o),f=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();r(v=0;n--){for(var h=e.words[n],c=u-1;c>=0;c--){var l=h>>c&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==s?(s<<=1,s|=l,(4===++a||0===n&&0===c)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}u=26}return o},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new k(t)},n(k,M),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,p.d)})),se=function(t){if("string"==typeof t||"number"==typeof t){var e=new oe(1),r=String(t).toLowerCase().trim(),n="0x"===r.substr(0,2)||"-0x"===r.substr(0,3),i=Object(v.i)(r);if("-"===i.substr(0,1)&&(i=Object(v.i)(i.slice(1)),e=new oe(-1,10)),!(i=""===i?"0":i).match(/^-?[0-9]+$/)&&i.match(/^[0-9A-Fa-f]+$/)||i.match(/^[a-fA-F]+$/)||!0===n&&i.match(/^[0-9A-Fa-f]+$/))return new oe(i,16).mul(e);if((i.match(/^-?[0-9]+$/)||""===i)&&!1===n)return new oe(i,10).mul(e)}else if("object"==typeof t&&t.toString&&!t.pop&&!t.push&&t.toString(10).match(/^-?[0-9]+$/)&&(t.mul||t.dividedToIntegerBy))return new oe(t.toString(10),10);throw new Error("[number-to-bn] while converting number "+JSON.stringify(t)+" to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.")};new ie(0),new ie(-1);var ae=Object(p.b)((function(t,e){!function(t){var e,r,n,i=String.fromCharCode;function o(t){for(var e,r,n=[],i=0,o=t.length;i=55296&&e<=56319&&i=55296&&t<=57343)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function a(t,e){return i(t>>e&63|128)}function u(t){if(0==(4294967168&t))return i(t);var e="";return 0==(4294965248&t)?e=i(t>>6&31|192):0==(4294901760&t)?(s(t),e=i(t>>12&15|224),e+=a(t,6)):0==(4292870144&t)&&(e=i(t>>18&7|240),e+=a(t,12),e+=a(t,6)),e+i(63&t|128)}function h(){if(n>=r)throw Error("Invalid byte index");var t=255&e[n];if(n++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function c(){var t,i;if(n>r)throw Error("Invalid byte index");if(n==r)return!1;if(t=255&e[n],n++,0==(128&t))return t;if(192==(224&t)){if((i=(31&t)<<6|h())>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&t)){if((i=(15&t)<<12|h()<<6|h())>=2048)return s(i),i;throw Error("Invalid continuation byte")}if(240==(248&t)&&(i=(7&t)<<18|h()<<12|h()<<6|h())>=65536&&i<=1114111)return i;throw Error("Invalid UTF-8 detected")}t.version="3.0.0",t.encode=function(t){for(var e=o(t),r=e.length,n=-1,i="";++n65535&&(o+=i((e-=65536)>>>10&1023|55296),e=56320|1023&e),o+=i(e);return o}(a)}}(e)})),ue="0123456789abcdef".split(""),he=[1,256,65536,16777216],ce=[0,8,16,24],le=[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],fe=function(t){var e,r,n,i,o,s,a,u,h,c,l,f,d,p,m,v,g,y,w,b,_,M,k,S,x,A,E,T,O,N,P,R,I,C,D,j,L,U,B,F,H,G,z,W,q,K,Y,V,Z,J,$,X,Q,tt,et,rt,nt,it,ot,st,at,ut,ht;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],h=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(u<<1|h>>>31),r=o^(h<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(c<<1|l>>>31),r=a^(l<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(f<<1|d>>>31),r=h^(d<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(i<<1|o>>>31),r=l^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],m=t[1],K=t[11]<<4|t[10]>>>28,Y=t[10]<<4|t[11]>>>28,T=t[20]<<3|t[21]>>>29,O=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,G=t[40]<<18|t[41]>>>14,z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,D=t[3]<<1|t[2]>>>31,v=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,V=t[22]<<10|t[23]>>>22,Z=t[23]<<10|t[22]>>>22,N=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ht=t[43]<<2|t[42]>>>30,tt=t[5]<<30|t[4]>>>2,et=t[4]<<30|t[5]>>>2,j=t[14]<<6|t[15]>>>26,L=t[15]<<6|t[14]>>>26,y=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,J=t[34]<<15|t[35]>>>17,$=t[35]<<15|t[34]>>>17,R=t[45]<<29|t[44]>>>3,I=t[44]<<29|t[45]>>>3,S=t[6]<<28|t[7]>>>4,x=t[7]<<28|t[6]>>>4,rt=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,U=t[26]<<25|t[27]>>>7,B=t[27]<<25|t[26]>>>7,b=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,X=t[47]<<24|t[46]>>>8,Q=t[46]<<24|t[47]>>>8,W=t[8]<<27|t[9]>>>5,q=t[9]<<27|t[8]>>>5,A=t[18]<<20|t[19]>>>12,E=t[19]<<20|t[18]>>>12,it=t[29]<<7|t[28]>>>25,ot=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,H=t[39]<<8|t[38]>>>24,M=t[48]<<14|t[49]>>>18,k=t[49]<<14|t[48]>>>18,t[0]=p^~v&y,t[1]=m^~g&w,t[10]=S^~A&T,t[11]=x^~E&O,t[20]=C^~j&U,t[21]=D^~L&B,t[30]=W^~K&V,t[31]=q^~Y&Z,t[40]=tt^~rt&it,t[41]=et^~nt&ot,t[2]=v^~y&b,t[3]=g^~w&_,t[12]=A^~T&N,t[13]=E^~O&P,t[22]=j^~U&F,t[23]=L^~B&H,t[32]=K^~V&J,t[33]=Y^~Z&$,t[42]=rt^~it&st,t[43]=nt^~ot&at,t[4]=y^~b&M,t[5]=w^~_&k,t[14]=T^~N&R,t[15]=O^~P&I,t[24]=U^~F&G,t[25]=B^~H&z,t[34]=V^~J&X,t[35]=Z^~$&Q,t[44]=it^~st&ut,t[45]=ot^~at&ht,t[6]=b^~M&p,t[7]=_^~k&m,t[16]=N^~R&S,t[17]=P^~I&x,t[26]=F^~G&C,t[27]=H^~z&D,t[36]=J^~X&W,t[37]=$^~Q&q,t[46]=st^~ut&tt,t[47]=at^~ht&et,t[8]=M^~p&v,t[9]=k^~m&g,t[18]=R^~S&A,t[19]=I^~x&E,t[28]=G^~C&j,t[29]=z^~D&L,t[38]=X^~W&K,t[39]=Q^~q&Y,t[48]=ut^~tt&rt,t[49]=ht^~et&nt,t[0]^=le[n],t[1]^=le[n+1]},de=function(t){return function(e){var r;if("0x"===e.slice(0,2)){r=[];for(var n=2,i=e.length;n>2]|=e[h]<>2]|=r<>2]|=(192|r>>6)<>2]|=(128|63&r)<=57344?(i[f>>2]|=(224|r>>12)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<=o){for(t.start=f-o,t.block=i[s],f=0;f>2]|=he[3&f],t.lastByteIndex===o)for(i[0]=i[s],f=1;f>4&15]+ue[15&c]+ue[c>>12&15]+ue[c>>8&15]+ue[c>>20&15]+ue[c>>16&15]+ue[c>>28&15]+ue[c>>24&15];d%s==0&&(fe(u),f=0)}return"0x"+l}(function(t){return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e}(t),r)}},pe={keccak256:de(256),keccak512:de(512),keccak256s:de(256),keccak512s:de(512)},me=function(t){return t instanceof v.a||t&&t.constructor&&"BN"===t.constructor.name},ve=function(t){return t&&t.constructor&&"BigNumber"===t.constructor.name},ge=function(t){try{return se.apply(null,arguments)}catch(e){throw new Error(e+' Given value: "'+t+'"')}},ye=function(t){return!!/^(0x)?[0-9a-f]{40}$/i.test(t)&&(!(!/^(0x|0X)?[0-9a-f]{40}$/.test(t)&&!/^(0x|0X)?[0-9A-F]{40}$/.test(t))||we(t))},we=function(t){t=t.replace(/^0x/i,"");for(var e=Se(t.toLowerCase()).replace(/^0x/i,""),r=0;r<40;r++)if(parseInt(e[r],16)>7&&t[r].toUpperCase()!==t[r]||parseInt(e[r],16)<=7&&t[r].toLowerCase()!==t[r])return!1;return!0},be=function(t){var e="";t=(t=(t=(t=(t=ae.encode(t)).replace(/^(?:\u0000)*/,"")).split("").reverse().join("")).replace(/^(?:\u0000)*/,"")).split("").reverse().join("");for(var r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return"0x"+e.join("")},isHex:function(t){return(ne.isString(t)||ne.isNumber(t))&&/^(-0x|0x)?[0-9a-f]*$/i.test(t)},isHexStrict:ke,leftPad:function(t,e,r){var n=/^0x/i.test(t)||"number"==typeof t,i=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(i).join(r||"0")+t},rightPad:function(t,e,r){var n=/^0x/i.test(t)||"number"==typeof t,i=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(i).join(r||"0")},toTwosComplement:function(t){return"0x"+ge(t).toTwos(256).toString(16,64)},sha3:Se},Ae=(m.c,[xe.BN,xe.isBN,xe.isBigNumber,xe.isHex,xe.isHexStrict,xe.sha3,xe.sha3,xe.isAddress,xe.checkAddressChecksum,xe.toHex,xe.toBN,xe.bytesToHex,xe.hexToBytes,xe.hexToNumberString,xe.hexToNumber,xe.hexToNumber,xe.numberToHex,xe.numberToHex,xe.hexToUtf8,xe.hexToUtf8,xe.hexToUtf8,xe.utf8ToHex,xe.utf8ToHex,xe.utf8ToHex,xe.leftPad,xe.leftPad,xe.rightPad,xe.rightPad,xe.toTwosComplement][5]);Object(p.c)(Object(p.b)((function(t,e){t.exports=function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){var u="function"==typeof p.e&&p.e;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var c=r[s]={exports:{}};e[s][0].call(c.exports,(function(t){return i(e[s][1][t]||t)}),c,c.exports,t,e,r,n)}return r[s].exports}for(var o="function"==typeof p.e&&p.e,s=0;sa[t]||console.log.apply(console,e)}function c(){for(var t=[],e=0;e>4]+u[15&n])}return e.join("")}}),l={16:10,24:12,32:14},f=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],p=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],m=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],v=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],g=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],y=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],w=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],b=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],_=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],M=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],k=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],S=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],x=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],A=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function E(t){for(var e=[],r=0;r>2,this._Ke[r][e%4]=o[e],this._Kd[t-r][e%4]=o[e];for(var s,a=0,u=i;u>16&255]<<24^d[s>>8&255]<<16^d[255&s]<<8^d[s>>24&255]^f[a]<<24,a+=1,8!=i)for(e=1;e>8&255]<<8^d[s>>16&255]<<16^d[s>>24&255]<<24,e=i/2+1;e>2,c=u%4,this._Ke[h][c]=o[e],this._Kd[t-h][c]=o[e++],u++}for(var h=1;h>24&255]^S[s>>16&255]^x[s>>8&255]^A[255&s]},T.prototype.encrypt=function(t){if(16!=t.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var e=this._Ke.length-1,r=[0,0,0,0],n=E(t),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var o=1;o>24&255]^v[n[(i+1)%4]>>16&255]^g[n[(i+2)%4]>>8&255]^y[255&n[(i+3)%4]]^this._Ke[o][i];n=r.slice()}var a,u=s(16);for(i=0;i<4;i++)a=this._Ke[e][i],u[4*i]=255&(d[n[i]>>24&255]^a>>24),u[4*i+1]=255&(d[n[(i+1)%4]>>16&255]^a>>16),u[4*i+2]=255&(d[n[(i+2)%4]>>8&255]^a>>8),u[4*i+3]=255&(d[255&n[(i+3)%4]]^a);return u},T.prototype.decrypt=function(t){if(16!=t.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var e=this._Kd.length-1,r=[0,0,0,0],n=E(t),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var o=1;o>24&255]^b[n[(i+3)%4]>>16&255]^_[n[(i+2)%4]>>8&255]^M[255&n[(i+1)%4]]^this._Kd[o][i];n=r.slice()}var a,u=s(16);for(i=0;i<4;i++)a=this._Kd[e][i],u[4*i]=255&(p[n[i]>>24&255]^a>>24),u[4*i+1]=255&(p[n[(i+3)%4]>>16&255]^a>>16),u[4*i+2]=255&(p[n[(i+2)%4]>>8&255]^a>>8),u[4*i+3]=255&(p[255&n[(i+1)%4]]^a);return u};var O=function t(e){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new T(e)};O.prototype.encrypt=function(t){if((t=o(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=s(t.length),r=s(16),n=0;n>=8},I.prototype.setBytes=function(t){if(16!=(t=o(t,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=t},I.prototype.increment=function(){for(var t=15;0<=t;t--){if(255!==this._counter[t]){this._counter[t]++;break}this._counter[t]=0}};var C=function t(e,r){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",r instanceof I||(r=new I(r)),this._counter=r,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new T(e)};C.prototype.encrypt=function(t){for(var e=o(t,!0),r=0;r>>26-a&67108863,26<=(a+=24)&&(a-=26,o++);else if("le"===r)for(o=i=0;i>>26-a&67108863,26<=(a+=24)&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r>>26-o&4194303,26<=(o+=24)&&(o-=26,n++);r+6!==e&&(i=a(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0];for(var n=0,i=this.length=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,h=0,c=r;c"};var h=["","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"],c=[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],l=[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];function f(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;n=(r.length=n)-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h>>26,l=67108863&u,f=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=f;d++){var p=h-d|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,26<=(i+=2)&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&2<=t&&t<=36){var f=c[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:h[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:2>>=13),64<=e&&(r+=7,e>>>=7),8<=e&&(r+=4,e>>>=4),2<=e&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;r=this.length>t.length?(e=this,t):(e=t,this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&0<=t);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),0>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&0<=t);var r=t/26|0,i=t%26;return this._expand(1+r),this.words[r]=e?this.words[r]|1<t.length?(r=this,t):(r=t,this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;n=0>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,w=0|s[3],b=8191&w,_=w>>>13,M=0|s[4],k=8191&M,S=M>>>13,x=0|s[5],A=8191&x,E=x>>>13,T=0|s[6],O=8191&T,N=T>>>13,P=0|s[7],R=8191&P,I=P>>>13,C=0|s[8],D=8191&C,j=C>>>13,L=0|s[9],U=8191&L,B=L>>>13,F=0|a[0],H=8191&F,G=F>>>13,z=0|a[1],W=8191&z,q=z>>>13,K=0|a[2],Y=8191&K,V=K>>>13,Z=0|a[3],J=8191&Z,$=Z>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],lt=8191&ct,ft=ct>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(l,H))|0)+((8191&(i=(i=Math.imul(l,G))+Math.imul(f,H)|0))<<13)|0;h=((o=Math.imul(f,G))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,H),i=(i=Math.imul(p,G))+Math.imul(m,H)|0,o=Math.imul(m,G);var gt=(h+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,q)|0)+Math.imul(f,W)|0))<<13)|0;h=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,H),i=(i=Math.imul(g,G))+Math.imul(y,H)|0,o=Math.imul(y,G),n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,q)|0;var yt=(h+(n=n+Math.imul(l,Y)|0)|0)+((8191&(i=(i=i+Math.imul(l,V)|0)+Math.imul(f,Y)|0))<<13)|0;h=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(b,H),i=(i=Math.imul(b,G))+Math.imul(_,H)|0,o=Math.imul(_,G),n=n+Math.imul(g,W)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,q)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,V)|0;var wt=(h+(n=n+Math.imul(l,J)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(f,J)|0))<<13)|0;h=((o=o+Math.imul(f,$)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,H),i=(i=Math.imul(k,G))+Math.imul(S,H)|0,o=Math.imul(S,G),n=n+Math.imul(b,W)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,V)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,$)|0;var bt=(h+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(f,Q)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(A,H),i=(i=Math.imul(A,G))+Math.imul(E,H)|0,o=Math.imul(E,G),n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,q)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,q)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(f,rt)|0))<<13)|0;h=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(O,H),i=(i=Math.imul(O,G))+Math.imul(N,H)|0,o=Math.imul(N,G),n=n+Math.imul(A,W)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,q)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,V)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,V)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Mt=(h+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,st)|0)+Math.imul(f,ot)|0))<<13)|0;h=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,H),i=(i=Math.imul(R,G))+Math.imul(I,H)|0,o=Math.imul(I,G),n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,q)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,V)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,V)|0,n=n+Math.imul(k,J)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var kt=(h+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(f,ut)|0))<<13)|0;h=((o=o+Math.imul(f,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,G))+Math.imul(j,H)|0,o=Math.imul(j,G),n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,q)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,q)|0,n=n+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,V)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,$)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var St=(h+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ft)|0)+Math.imul(f,lt)|0))<<13)|0;h=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,H),i=(i=Math.imul(U,G))+Math.imul(B,H)|0,o=Math.imul(B,G),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,q)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,q)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,V)|0,n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,$)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ft)|0;var xt=(h+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(f,pt)|0))<<13)|0;h=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,q))+Math.imul(B,W)|0,o=Math.imul(B,q),n=n+Math.imul(D,Y)|0,i=(i=i+Math.imul(D,V)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,$)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(g,lt)|0,i=(i=i+Math.imul(g,ft)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ft)|0;var At=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(U,Y),i=(i=Math.imul(U,V))+Math.imul(B,Y)|0,o=Math.imul(B,V),n=n+Math.imul(D,J)|0,i=(i=i+Math.imul(D,$)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,$)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ft)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ft)|0;var Et=(h+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(U,J),i=(i=Math.imul(U,$))+Math.imul(B,J)|0,o=Math.imul(B,$),n=n+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ht)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ft)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ft)|0;var Tt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,tt))+Math.imul(B,Q)|0,o=Math.imul(B,tt),n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(O,ut)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(A,lt)|0,i=(i=i+Math.imul(A,ft)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ft)|0;var Ot=(h+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(B,rt)|0,o=Math.imul(B,nt),n=n+Math.imul(D,ot)|0,i=(i=i+Math.imul(D,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,ft)|0;var Nt=(h+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;h=((o=o+Math.imul(E,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(B,ot)|0,o=Math.imul(B,st),n=n+Math.imul(D,ut)|0,i=(i=i+Math.imul(D,ht)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ft)|0)+Math.imul(I,lt)|0,o=o+Math.imul(I,ft)|0;var Pt=(h+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ht))+Math.imul(B,ut)|0,o=Math.imul(B,ht),n=n+Math.imul(D,lt)|0,i=(i=i+Math.imul(D,ft)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ft)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,lt),i=(i=Math.imul(U,ft))+Math.imul(B,lt)|0,o=Math.imul(B,ft);var It=(h+(n=n+Math.imul(D,pt)|0)|0)+((8191&(i=(i=i+Math.imul(D,mt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863;var Ct=(h+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,mt))+Math.imul(B,pt)|0))<<13)|0;return h=((o=Math.imul(B,mt))+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=vt,u[1]=gt,u[2]=yt,u[3]=wt,u[4]=bt,u[5]=_t,u[6]=Mt,u[7]=kt,u[8]=St,u[9]=xt,u[10]=At,u[11]=Et,u[12]=Tt,u[13]=Ot,u[14]=Nt,u[15]=Pt,u[16]=Rt,u[17]=It,u[18]=Ct,0!==h&&(u[19]=h,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=f),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?f(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n>>26-r<<26-r;if(0!=r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!=i){for(e=this.length-1;0<=e;e--)this.words[e+i]=this.words[e];for(e=0;e>>o<s)for(this.length-=s,h=0;h>>o,c=l&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&0<=t);var e=t%26,r=(t-e)/26,i=1<>>e<>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),i=a=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=1+u,a.words=new Array(a.length);for(var h=0;hthis.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;0<=i;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var c=r.clone(),l=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(0>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),1t.length)return 1;if(this.lengththis.n;);var n=e>>22,i=o}i>>>=22,0===(t.words[n-10]=i)&&10>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new w;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return 0<=r.cmp(this.m)&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var l=this.pow(c,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();n(v>c&1;i!==r[0]&&(i=this.sqr(i)),0!=l||0!==s?(s<<=1,s|=l,(4==++a||0===n&&0===c)&&(i=this.mul(i,r[s]),s=a=0)):a=0}u=26}return i},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},i(k,M),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return 0<=i.cmp(this.m)?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return 0<=i.cmp(this.m)?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:11}],10:[function(t,e,r){(function(t){e.exports=function(e){var r=new Uint8Array(e);return(t.crypto||t.msCrypto).getRandomValues(r),r}}).call(this,void 0!==p.d?p.d:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(t,e,r){},{}],12:[function(t,e,r){var n=r;n.version=t("../package.json").version,n.utils=t("./elliptic/utils"),n.rand=t("brorand"),n.curve=t("./elliptic/curve"),n.curves=t("./elliptic/curves"),n.ec=t("./elliptic/ec"),n.eddsa=t("./elliptic/eddsa")},{"../package.json":25,"./elliptic/curve":15,"./elliptic/curves":18,"./elliptic/ec":19,"./elliptic/eddsa":22,"./elliptic/utils":24,brorand:10}],13:[function(t,e,r){var n=t("bn.js"),i=t("../utils"),o=i.getNAF,s=i.getJSF,a=i.assert;function u(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||0>1]):u.mixedAdd(i[-c-1>>1].neg()):0>1]):u.add(i[-c-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,n,i){for(var a=this._wnafT1,u=this._wnafT2,h=this._wnafT3,c=0,l=0;l>1]:A<0&&(x=u[y][-A-1>>1].neg()),_="affine"===x.type?_.mixedAdd(x):_.add(x))}}for(l=0;l=Math.ceil((t.bitLength()+1)/e.step)},h.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i":""},h.prototype.isInfinity=function(){return this.inf},h.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},h.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},h.prototype.getX=function(){return this.x.fromRed()},h.prototype.getY=function(){return this.y.fromRed()},h.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},h.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},h.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},h.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},h.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},h.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(c,s.BasePoint),u.prototype.jpoint=function(t,e,r){return new c(this,t,e,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),c=h.redMul(a),l=n.redMul(h),f=u.redSqr().redIAdd(c).redISub(l).redISub(l),d=u.redMul(l.redISub(f)).redISub(o.redMul(c)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(f,d,p)},c.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),h=u.redMul(s),c=r.redMul(u),l=a.redSqr().redIAdd(h).redISub(c).redISub(c),f=a.redMul(c.redISub(l)).redISub(i.redMul(h)),d=this.z.redMul(s);return this.curve.jpoint(l,f,d)},c.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":24,"./base":13,"bn.js":9,inherits:39}],18:[function(t,e,r){var n,i=r,o=t("hash.js"),s=t("./curve"),a=t("./utils").assert;function u(t){"short"===t.type?this.curve=new s.short(t):"edwards"===t.type?this.curve=new s.edwards(t):this.curve=new s.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function h(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new u(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,h("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:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),h("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:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),h("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:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),h("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:o.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"]}),h("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:o.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"]}),h("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),h("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:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=t("./precomputed/secp256k1")}catch(t){n=void 0}h("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:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},{"./curve":15,"./precomputed/secp256k1":23,"./utils":24,"hash.js":26}],19:[function(t,e,r){var n=t("bn.js"),i=t("hmac-drbg"),o=t("../utils"),s=t("../curves"),a=t("brorand"),u=o.assert,h=t("./key"),c=t("./signature");function l(t){if(!(this instanceof l))return new l(t);"string"==typeof t&&(u(s.hasOwnProperty(t),"Unknown curve "+t),t=s[t]),t instanceof s.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}(e.exports=l).prototype.keyPair=function(t){return new h(this,t)},l.prototype.keyFromPrivate=function(t,e){return h.fromPrivate(this,t,e)},l.prototype.keyFromPublic=function(t,e){return h.fromPublic(this,t,e)},l.prototype.genKeyPair=function(t){t=t||{};for(var e=new i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(e.generate(r));if(!(0>1;if(0<=a.cmp(this.curve.p.umod(this.curve.n))&&f)throw new Error("Unable to find sencond key candinate");a=f?this.curve.pointFromX(a.add(this.curve.n),l):this.curve.pointFromX(a,l);var d=e.r.invm(o),p=o.sub(s).mul(d).umod(o),m=h.mul(d).umod(o);return this.g.mulAdd(p,a,m)},l.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new c(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},{"../curves":18,"../utils":24,"./key":20,"./signature":21,"bn.js":9,brorand:10,"hmac-drbg":38}],20:[function(t,e,r){var n=t("bn.js"),i=t("../utils").assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}(e.exports=o).fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return""}},{"../utils":24,"bn.js":9}],21:[function(t,e,r){var n=t("bn.js"),i=t("../utils"),o=i.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function u(t,e){var r=t[e.place++];if(!(128&r))return r;for(var n=15&r,i=0,o=0,s=e.place;o>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}(e.exports=s).prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;if(u(t,r)+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=u(t,r),s=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var h=u(t,r);if(t.length!==h+r.place)return!1;var c=t.slice(r.place,h+r.place);return 0===s[0]&&128&s[1]&&(s=s.slice(1)),0===c[0]&&128&c[1]&&(c=c.slice(1)),this.r=new n(s),this.s=new n(c),!(this.recoveryParam=null)},s.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=h(e),r=h(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];c(n,e.length),(n=n.concat(e)).push(2),c(n,r.length);var o=n.concat(r),s=[48];return c(s,o.length),s=s.concat(o),i.encode(s,t)}},{"../utils":24,"bn.js":9}],22:[function(t,e,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],23:[function(t,e,r){e.exports=void 0},{}],24:[function(t,e,r){var n=r,i=t("bn.js"),o=t("minimalistic-assert"),s=t("minimalistic-crypto-utils");n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<>1)-1>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0;0=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;othis.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e>>3},r.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},{"../utils":37}],37:[function(t,e,r){var n=t("minimalistic-assert"),i=t("inherits");function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function a(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}r.inherits=i,r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n>8,s=255&i;o?r.push(o,s):r.push(s)}else for(n=0;n>>0}return s},r.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},r.rotr32=function(t,e){return t>>>e|t<<32-e},r.rotl32=function(t,e){return t<>>32-e},r.sum32=function(t,e){return t+e>>>0},r.sum32_3=function(t,e,r){return t+e+r>>>0},r.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},r.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},r.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,s=(o>>0,t[e+1]=o},r.sum64_hi=function(t,e,r,n){return(e+n>>>0>>0},r.sum64_lo=function(t,e,r,n){return e+n>>>0},r.sum64_4_hi=function(t,e,r,n,i,o,s,a){var u=0,h=e;return u+=(h=h+n>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(t,e,r,n,i,o,s,a){return e+n+o+a>>>0},r.sum64_5_hi=function(t,e,r,n,i,o,s,a,u,h){var c=0,l=e;return c+=(l=l+n>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(t,e,r,n,i,o,s,a,u,h){return e+n+o+a+h>>>0},r.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},r.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},r.shr64_hi=function(t,e,r){return t>>>r},r.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},{inherits:39,"minimalistic-assert":41}],38:[function(t,e,r){var n=t("hash.js"),i=t("minimalistic-crypto-utils"),o=t("minimalistic-assert");function s(t){if(!(this instanceof s))return new s(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}(e.exports=s).prototype._init=function(t,e,r){var n=t.concat(e).concat(r);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(t.concat(r||[])),this._reseed=1},s.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}_.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,a=this.byteCount,u=this.blockCount,h=0,c=this.s;h>2]|=t[h]<>2]|=n<>2]|=(192|n>>6)<>2]|=(224|n>>12)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];a%e==0&&(M(r),s=0)}return i&&(t=r[s],0>4&15]+o[15&t]),1>12&15]+o[t>>8&15]),2>20&15]+o[t>>16&15])),u},_.prototype.buffer=_.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&M(n)}return o&&(t=a<<2,e=n[s],0>8&255),2>16&255)),u};var M=function(t){var e,r,n,i,o,s,u,h,c,l,f,d,p,m,v,g,y,w,b,_,M,k,S,x,A,E,T,O,N,P,R,I,C,D,j,L,U,B,F,H,G,z,W,q,K,Y,V,Z,J,$,X,Q,tt,et,rt,nt,it,ot,st,at,ut,ht,ct;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(h<<1|c>>>31),r=o^(c<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(l<<1|f>>>31),r=u^(f<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(d<<1|p>>>31),r=c^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(i<<1|o>>>31),r=f^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,m=t[0],v=t[1],Y=t[11]<<4|t[10]>>>28,V=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,N=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,D=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,g=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,Z=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,P=t[33]<<13|t[32]>>>19,R=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,ct=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,U=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,b=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,X=t[35]<<15|t[34]>>>17,I=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,A=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,E=t[18]<<20|t[19]>>>12,T=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,H=t[38]<<8|t[39]>>>24,G=t[39]<<8|t[38]>>>24,k=t[48]<<14|t[49]>>>18,S=t[49]<<14|t[48]>>>18,t[0]=m^~g&w,t[1]=v^~y&b,t[10]=x^~E&O,t[11]=A^~T&N,t[20]=D^~L&B,t[21]=j^~U&F,t[30]=q^~Y&Z,t[31]=K^~V&J,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=g^~w&_,t[3]=y^~b&M,t[12]=E^~O&P,t[13]=T^~N&R,t[22]=L^~B&H,t[23]=U^~F&G,t[32]=Y^~Z&$,t[33]=V^~J&X,t[42]=nt^~ot&at,t[43]=it^~st&ut,t[4]=w^~_&k,t[5]=b^~M&S,t[14]=O^~P&I,t[15]=N^~R&C,t[24]=B^~H&z,t[25]=F^~G&W,t[34]=Z^~$&Q,t[35]=J^~X&tt,t[44]=ot^~at&ht,t[45]=st^~ut&ct,t[6]=_^~k&m,t[7]=M^~S&v,t[16]=P^~I&x,t[17]=R^~C&A,t[26]=H^~z&D,t[27]=G^~W&j,t[36]=$^~Q&q,t[37]=X^~tt&K,t[46]=at^~ht&et,t[47]=ut^~ct&rt,t[8]=k^~m&g,t[9]=S^~v&y,t[18]=I^~x&E,t[19]=C^~A&T,t[28]=z^~D&L,t[29]=W^~j&U,t[38]=Q^~q&Y,t[39]=tt^~K&V,t[48]=ht^~et&nt,t[49]=ct^~rt&it,t[0]^=a[n],t[1]^=a[n+1]};if(i)e.exports=p;else for(v=0;v>8,s=255&i;o?r.push(o,s):r.push(s)}return r},n.zero2=i,n.toHex=o,n.encode=function(t,e){return"hex"===e?o(t):t}},{}],43:[function(t,e,r){e.exports={browser:!0}},{}],44:[function(t,e,r){(function(t){function n(t){var e=[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],r=1779033703,n=3144134277,i=1013904242,o=2773480762,s=1359893119,a=2600822924,u=528734635,h=1541459225,c=new Array(64);function l(t){for(var l=0,f=t.length;64<=f;){var d,p,m,v,g,y=r,w=n,b=i,_=o,M=s,k=a,S=u,x=h;for(p=0;p<16;p++)m=l+4*p,c[p]=(255&t[m])<<24|(255&t[m+1])<<16|(255&t[m+2])<<8|255&t[m+3];for(p=16;p<64;p++)v=((d=c[p-2])>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,g=((d=c[p-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3,c[p]=(v+c[p-7]|0)+(g+c[p-16]|0)|0;for(p=0;p<64;p++)v=(((M>>>6|M<<26)^(M>>>11|M<<21)^(M>>>25|M<<7))+(M&k^~M&S)|0)+(x+(e[p]+c[p]|0)|0)|0,g=((y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10))+(y&w^y&b^w&b)|0,x=S,S=k,k=M,M=_+v|0,_=b,b=w,w=y,y=v+g|0;r=r+y|0,n=n+w|0,i=i+b|0,o=o+_|0,s=s+M|0,a=a+k|0,u=u+S|0,h=h+x|0,l+=64,f-=64}}l(t);var f,d=t.length%64,p=t.length/536870912|0,m=t.length<<3,v=d<56?56:120,g=t.slice(t.length-d,t.length);for(g.push(128),f=1+d;f>>24&255),g.push(p>>>16&255),g.push(p>>>8&255),g.push(p>>>0&255),g.push(m>>>24&255),g.push(m>>>16&255),g.push(m>>>8&255),g.push(m>>>0&255),l(g),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,h>>>24&255,h>>>16&255,h>>>8&255,h>>>0&255]}function i(t,e,r){var i;t=t.length<=64?t:n(t);var o=64+e.length+4,s=new Array(o),a=new Array(64),u=[];for(i=0;i<64;i++)s[i]=54;for(i=0;i>>32-e}function a(t,e){h(t,0,e,0,16);for(var r=8;0>0&255),m.push(v[r]>>8&255),m.push(v[r]>>16&255),m.push(v[r]>>24&255);var g=i(e,m,f);return d(null,1,g)}I(t)}()}var d,p;d=this,p=2147483647,void 0!==r?e.exports=f:d&&(d.scrypt&&(d._scrypt=d.scrypt),d.scrypt=f)}).call(this,t("timers").setImmediate)},{timers:46}],45:[function(t,e,r){(function(t,e,r){!function(e,r){if(!e.setImmediate){var n,i,o,s,a=1,u={},h=!1,c=e.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(e);l=l&&l.setTimeout?l:e,n="[object process]"==={}.toString.call(e.process)?function(){var e=f(arguments);return t.nextTick(d(p,e)),e}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(s="setImmediate$"+Math.random()+"$",e.addEventListener?e.addEventListener("message",v,!1):e.attachEvent("onmessage",v),function(){var t=f(arguments);return e.postMessage(s+t,"*"),t}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},function(){var t=f(arguments);return o.port2.postMessage(t),t}):c&&"onreadystatechange"in c.createElement("script")?(i=c.documentElement,function(){var t=f(arguments),e=c.createElement("script");return e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e),t}):function(){var t=f(arguments);return setTimeout(d(p,t),0),t},l.setImmediate=n,l.clearImmediate=m}function f(t){return u[a]=d.apply(r,t),a++}function d(t){var e=[].slice.call(arguments,1);return function(){"function"==typeof t?t.apply(r,e):new Function(""+t)()}}function p(t){if(h)setTimeout(d(p,t),0);else{var e=u[t];if(e){h=!0;try{e()}finally{m(t),h=!1}}}}function m(t){delete u[t]}function v(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&p(+t.data.slice(s.length))}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,t("_process"),void 0!==p.d?p.d:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("timers").clearImmediate)},{_process:43,timers:46}],46:[function(t,e,r){(function(t){e.exports={setImmediate:t.setImmediate}}).call(this,void 0!==p.d?p.d:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],47:[function(t,e,r){(function(t){var r;if(t.crypto&&crypto.getRandomValues){var n=new Uint8Array(16);r=function(){return crypto.getRandomValues(n),n}}if(!r){var i=new Array(16);r=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),i[e]=t>>>((3&e)<<3)&255;return i}}e.exports=r}).call(this,void 0!==p.d?p.d:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],48:[function(t,e,r){for(var n=t("./rng"),i=[],o={},s=0;s<256;s++)i[s]=(s+256).toString(16).substr(1),o[i[s]]=s;function a(t,e){var r=e||0,n=i;return n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]}var u=n(),h=[1|u[0],u[1],u[2],u[3],u[4],u[5]],c=16383&(u[6]<<8|u[7]),l=0,f=0;function d(t,e,r){var i=e&&r||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null);var o=(t=t||{}).random||(t.rng||n)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var s=0;s<16;s++)e[i+s]=o[s];return e||a(o)}var p=d;p.v1=function(t,e,r){var n=e&&r||0,i=e||[],o=void 0!==(t=t||{}).clockseq?t.clockseq:c,s=void 0!==t.msecs?t.msecs:(new Date).getTime(),u=void 0!==t.nsecs?t.nsecs:f+1,d=s-l+(u-f)/1e4;if(d<0&&void 0===t.clockseq&&(o=o+1&16383),(d<0||l>>24&255,i[n++]=p>>>16&255,i[n++]=p>>>8&255,i[n++]=255&p;var m=s/4294967296*1e4&268435455;i[n++]=m>>>8&255,i[n++]=255&m,i[n++]=m>>>24&15|16,i[n++]=m>>>16&255,i[n++]=o>>>8|128,i[n++]=255&o;for(var v=t.node||h,g=0;g<6;g++)i[n+g]=v[g];return e||a(i)},p.v4=d,p.parse=function(t,e,r){var n=e&&r||0,i=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,(function(t){i<16&&(e[n+i++]=o[t])}));i<16;)e[n+i++]=0;return e},p.unparse=a,e.exports=p},{"./rng":47}],49:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});try{e.exports.XMLHttpRequest=XMLHttpRequest}catch(t){console.log("Warning: XMLHttpRequest is not defined"),e.exports.XMLHttpRequest=null}},{}],50:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("../utils/properties"),i=(o.isProvider=function(t){return n.isType(t,"Provider")},o);function o(){n.setType(this,"Provider")}r.Provider=i},{"../utils/properties":74}],51:[function(t,e,r){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s=t("../utils/address"),a=t("../utils/bignumber"),u=t("../utils/bytes"),h=t("../constants"),c=t("../utils/hash"),l=t("../utils/networks"),f=t("../utils/properties"),d=t("../utils/rlp"),p=t("../utils/transaction"),m=t("../utils/utf8"),v=t("../utils/web"),g=o(t("../errors")),y=t("./abstract-provider");function w(t,e){var r={};for(var n in t)try{var i=t[n](e[n]);void 0!==i&&(r[n]=i)}catch(t){throw t.checkKey=n,t.checkValue=e[n],t}return r}function b(t,e){return function(r){return null==r?e:t(r)}}function _(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");var r=[];return e.forEach((function(e){r.push(t(e))})),r}}function M(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),32===u.hexDataLength(t))?t.toLowerCase():(g.throwError("invalid hash",g.INVALID_ARGUMENT,{arg:"hash",value:t}),null)}function k(t){return a.bigNumberify(t).toNumber()}function S(t){if(!u.isHexString(t))throw new Error("invalid uint256");for(;t.length<66;)t="0x0"+t.substring(2);return t}function x(t){if(null==t)return"latest";if("earliest"===t)return"0x0";if("latest"===t||"pending"===t)return t;if("number"==typeof t)return u.hexStripZeros(u.hexlify(t));if(u.isHexString(t))return u.hexStripZeros(t);throw new Error("invalid blockTag")}var A={hash:M,blockHash:b(M,null),blockNumber:b(k,null),transactionIndex:b(k,null),confirmations:b(k,null),from:s.getAddress,gasPrice:a.bigNumberify,gasLimit:a.bigNumberify,to:b(s.getAddress,null),value:a.bigNumberify,nonce:k,data:u.hexlify,r:b(S),s:b(S),v:b(k),creates:b(s.getAddress,null),raw:b(u.hexlify)};function E(t){if(null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&a.bigNumberify(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=s.getContractAddress(t)),!t.raw&&t.v&&t.r&&t.s){var e=[u.stripZeros(u.hexlify(t.nonce)),u.stripZeros(u.hexlify(t.gasPrice)),u.stripZeros(u.hexlify(t.gasLimit)),t.to||"0x",u.stripZeros(u.hexlify(t.value||"0x")),u.hexlify(t.data||"0x"),u.stripZeros(u.hexlify(t.v||"0x")),u.stripZeros(u.hexlify(t.r)),u.stripZeros(u.hexlify(t.s))];t.raw=d.encode(e)}var r=w(A,t),n=t.networkId;return null!=t.chainId&&null==n&&null==r.v&&(n=t.chainId),u.isHexString(n)&&(n=a.bigNumberify(n).toNumber()),"number"!=typeof n&&null!=r.v&&((n=(r.v-35)/2)<0&&(n=0),n=parseInt(n)),"number"!=typeof n&&(n=0),r.networkId=n,null==r.chainId&&null!=n&&(r.chainId=n),r.blockHash&&"x"===r.blockHash.replace(/0/g,"")&&(r.blockHash=null),r}var T={hash:M,parentHash:M,number:k,timestamp:k,nonce:b(u.hexlify),difficulty:function(t){var e=a.bigNumberify(t);try{return e.toNumber()}catch(t){}return null},gasLimit:a.bigNumberify,gasUsed:a.bigNumberify,miner:s.getAddress,extraData:u.hexlify,transactions:b(_(M))},O=f.shallowCopy(T);function N(t,e){return null!=t.author&&null==t.miner&&(t.miner=t.author),w(e?O:T,t)}O.transactions=b(_(E));var P={from:b(s.getAddress),nonce:b(k),gasLimit:b(a.bigNumberify),gasPrice:b(a.bigNumberify),to:b(s.getAddress),value:b(a.bigNumberify),data:b(u.hexlify)};function R(t){return w(P,t)}var I={transactionLogIndex:b(k),transactionIndex:k,blockNumber:k,transactionHash:M,address:s.getAddress,topics:_(M),data:u.hexlify,logIndex:k,blockHash:M},C={to:b(s.getAddress,null),from:b(s.getAddress,null),contractAddress:b(s.getAddress,null),transactionIndex:k,root:b(M),gasUsed:a.bigNumberify,logsBloom:b(u.hexlify),blockHash:M,transactionHash:M,logs:_((function(t){return w(I,t)})),blockNumber:k,confirmations:b(k,null),cumulativeGasUsed:a.bigNumberify,status:b(k)};function D(t){return Array.isArray(t)?t.forEach((function(t){D(t)})):null!=t&&M(t),t}var j,L={fromBlock:b(x,void 0),toBlock:b(x,void 0),address:b(s.getAddress,void 0),topics:b(D,void 0)},U={blockHash:b(M,void 0),address:b(s.getAddress,void 0),topics:b(D,void 0)},B={blockNumber:b(k),blockHash:b(M),transactionIndex:k,removed:b((function(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===t)return!0;if("false"===t)return!1}throw new Error("invaid boolean - "+t)})),address:s.getAddress,data:(j=u.hexlify,function(t){return t?j(t):"0x"}),topics:_(M),transactionHash:M,logIndex:k};function F(t){return w(B,t)}function H(t){return t.map((function(t){return"string"==typeof t?t:Array.isArray(t)?(t.forEach((function(t){null!==t&&32!==u.hexDataLength(t)&&g.throwError("invalid topic",g.INVALID_ARGUMENT,{argument:"topic",value:t})})),t.join(",")):null===t?"":g.throwError("invalid topic value",g.INVALID_ARGUMENT,{argument:"topic",value:t})})).join("&")}function G(t){if("string"==typeof t){if(20===u.hexDataLength(t))return"address:"+s.getAddress(t);if(t=t.toLowerCase(),32===u.hexDataLength(t))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter::"+H(t);if(t&&"object"==typeof t)return"filter:"+(t.address||"")+":"+H(t.topics||[])}throw new Error("invalid event - "+t)}function z(){return(new Date).getTime()}var W,q=(i(K,W=y.Provider),K.prototype._doPoll=function(){var t=this;this.getBlockNumber().then((function(e){if(t.polling&&(t._setFastBlockNumber(e),e!==t._lastBlockNumber)){-2===t._emitted.block&&(t._emitted.block=e-1);for(var r=t._emitted.block+1;r<=e;r++)t.emit("block",r);t._emitted.block!==e&&(t._emitted.block=e,Object.keys(t._emitted).forEach((function(r){if("block"!==r){var n=t._emitted[r];"pending"!==n&&122*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((function(e){return(null==t._fastBlockNumber||e>t._fastBlockNumber)&&(t._fastBlockNumber=e),t._fastBlockNumber}))),this._fastBlockNumberPromise},K.prototype._setFastBlockNumber=function(t){null!=this._fastBlockNumber&&tthis._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))},K.prototype.waitForTransaction=function(t,e){var r=this;return null==e&&(e=1),this.getTransactionReceipt(t).then((function(n){return 0===e||n&&n.confirmations>=e?n:new Promise((function(n){r.on(t,(function i(o){o.confirmations(e=e.substring(64)).length)return null;var n=m.toUtf8String("0x"+e.substring(0,2*r));return i.resolveName(n).then((function(e){return e!=t?null:n}))}))},K.checkTransactionResponse=function(t){return E(t)},K.prototype.doPoll=function(){},K.prototype.perform=function(t,e){return g.throwError(t+" not implemented",g.NOT_IMPLEMENTED,{operation:t}),null},K.prototype._startPending=function(){g.warn("WARNING: this provider does not support pending events")},K.prototype._stopPending=function(){},K.prototype._addEventListener=function(t,e,r){this._events.push({tag:G(t),listener:e,once:r}),"pending"===t&&this._startPending(),this.polling=!0},K.prototype.on=function(t,e){return this._addEventListener(t,e,!1),this},K.prototype.once=function(t,e){return this._addEventListener(t,e,!0),this},K.prototype.addEventListener=function(t,e){return this.on(t,e)},K.prototype.emit=function(t){for(var e=this,r=[],n=1;nt.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},E);function E(t,e){return x.call(this,t,"null","",e,!1)||this}var T,O=(i(N,T=_),N.prototype.encode=function(t){try{var e=h.bigNumberify(t);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(e.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),e.lt(r))throw new Error("out-of-bounds")}else if(e.lt(s.Zero)||e.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),c.padZeros(c.arrayify(e),32)}catch(e){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},N.prototype.decode=function(t,e){t.length>1]>>4&&(e[i]=e[i].toUpperCase()),8<=(15&r[i>>1])&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var c={},l=0;l<10;l++)c[String(l)]=String(l);for(l=0;l<26;l++)c[String.fromCharCode(65+l)]=String(10+l);var f,d=Math.floor((f=9007199254740991,Math.log10?Math.log10(f):Math.log(f)/Math.LN10));function p(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=c[t]}));e.length>=d;){var r=e.substring(0,d);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function m(t){var e=null;if("string"!=typeof t&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=h(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:t}),e=new i.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});return e}r.getAddress=m,r.getIcapAddress=function(t){for(var e=new i.default.BN(m(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e},r.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return m("0x"+s.keccak256(a.encode([m(t.from),o.stripZeros(o.hexlify(e))])).substring(26))},r.getCreate2Address=function(t){var e=t.initCodeHash;t.initCode&&(e?s.keccak256(t.initCode)!==e&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:t}):e=s.keccak256(t.initCode)),e||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:t});var r=m(t.from),n=o.arrayify(t.salt);return 32!==n.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:t}),m("0x"+s.keccak256(o.concat(["0xff",r,n,e])).substring(26))}},{"../errors":5,"./bytes":64,"./keccak256":71,"./rlp":76,"bn.js":9}],61:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("../utils/bytes");e.exports={decode:function(t){t=atob(t);for(var e=[],r=0;r>=8;for(;0>=8}for(var a=0;t[a]===this._leader&&a>4]+l[15&u])}return"0x"+n.join("")}return i.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function d(t,e){for(c(t)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function p(t){var e=0,r="0x",n="0x";if(function(t){return t&&null!=t.r&&null!=t.s}(t)){null==t.v&&null==t.recoveryParam&&i.throwError("at least on of recoveryParam or v must be specified",i.INVALID_ARGUMENT,{argument:"signature",value:t}),r=d(t.r,32),n=d(t.s,32),"string"==typeof(e=t.v)&&(e=parseInt(e,16));var o=t.recoveryParam;null==o&&null!=t.v&&(o=1-e%2),e=27+o}else{var s=u(t);if(65!==s.length)throw new Error("invalid signature");r=f(s.slice(0,32)),n=f(s.slice(32,64)),27!==(e=s[64])&&28!==e&&(e=27+e%2)}return{r:r,s:n,recoveryParam:e-27,v:e}}r.hexlify=f,r.hexDataLength=function(t){return c(t)&&t.length%2==0?(t.length-2)/2:null},r.hexDataSlice=function(t,e,r){return c(t)||i.throwError("invalid hex data",i.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&i.throwError("hex data length must be even",i.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)},r.hexStripZeros=function(t){for(c(t)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:t});3>3)]=t>>24-n&255;var i=l.computeHmac(l.SupportedAlgorithms.sha512,this.chainCode,r),o=i.slice(0,32),s=i.slice(32),h=null,c=null;return this.privateKey?h=w(u.bigNumberify(o).add(this.privateKey).mod(m)):c=new d.KeyPair(a.hexlify(o))._addPoint(this.publicKey),new k(_,h,c,this.fingerprint,w(s),t,this.depth+1,this.mnemonic,e)},k.prototype.derivePath=function(t){var e=t.split("/");if(0===e.length||"m"===e[0]&&0!==this.depth)throw new Error("invalid path - "+t);"m"===e[0]&&e.shift();for(var r=this,n=0;n>3]|=1<<7-s%8),s++}var l=32*r.length/3,f=y(r.length/3),d=a.arrayify(p.sha256(n.slice(0,l/8)))[0];if((d&=f)!=(n[n.length-1]&f))throw new Error("invalid checksum");return a.hexlify(n.slice(0,l/8))}function E(t,e){if((t=a.arrayify(t)).length%4!=0||t.length<16||32>8-n,r.push(t[i]&(1<<8-n)-1),n+=3);var s=a.arrayify(p.sha256(t))[0],u=t.length/4;return s&=y(u),r[r.length-1]<<=u,r[r.length-1]|=s>>8-u,(e=e||o.langEn).join(r.map((function(t){return e.getWord(t)})))}r.HDNode=M,r.fromExtendedKey=function(t){var e=s.Base58.decode(t);82===e.length&&b(e.slice(0,78))===t||i.throwError("invalid extended key",i.INVALID_ARGUMENT,{argument:"extendedKey",value:"[REDACTED]"});var r=e[4],n=a.hexlify(e.slice(5,9)),o=parseInt(a.hexlify(e.slice(9,13)).substring(2),16),u=a.hexlify(e.slice(13,45)),h=e.slice(45,78);switch(a.hexlify(e.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new M(_,null,a.hexlify(h),n,u,o,r,null,null);case"0x0488ade4":case"0x04358394":if(0!==h[0])break;return new M(_,a.hexlify(h.slice(1)),null,n,u,o,r,null,null)}return i.throwError("invalid extended key",i.INVALID_ARGUMENT,{argument:"extendedKey",value:"[REDACTED]"})},r.fromMnemonic=function(t,e,r){return S(x(t=E(A(t,e),e),r),t)},r.fromSeed=function(t){return S(t,null)},r.mnemonicToSeed=x,r.mnemonicToEntropy=A,r.entropyToMnemonic=E,r.isValidMnemonic=function(t,e){try{return A(t,e),!0}catch(t){}return!1}},{"../errors":5,"../wordlists/lang-en":90,"./basex":62,"./bignumber":63,"./bytes":64,"./hmac":67,"./pbkdf2":73,"./properties":74,"./secp256k1":77,"./sha2":79,"./utf8":85}],67:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i,o,s=n(t("hash.js")),a=t("../utils/bytes"),u=n(t("../errors"));(o=i=r.SupportedAlgorithms||(r.SupportedAlgorithms={})).sha256="sha256",o.sha512="sha512",r.computeHmac=function(t,e,r){return i[t]||u.throwError("unsupported algorithm "+t,u.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:t}),a.arrayify(s.hmac(s[t],a.arrayify(e)).update(a.arrayify(r)).digest())}},{"../errors":5,"../utils/bytes":64,"hash.js":26}],68:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=t("./abi-coder");r.AbiCoder=i.AbiCoder,r.defaultAbiCoder=i.defaultAbiCoder,r.formatSignature=i.formatSignature,r.formatParamType=i.formatParamType,r.parseSignature=i.parseSignature,r.parseParamType=i.parseParamType;var o=t("./address");r.getAddress=o.getAddress,r.getContractAddress=o.getContractAddress,r.getCreate2Address=o.getCreate2Address,r.getIcapAddress=o.getIcapAddress;var s=n(t("./base64"));r.base64=s;var a=t("./bignumber");r.BigNumber=a.BigNumber,r.bigNumberify=a.bigNumberify;var u=t("./bytes");r.arrayify=u.arrayify,r.concat=u.concat,r.hexDataSlice=u.hexDataSlice,r.hexDataLength=u.hexDataLength,r.hexlify=u.hexlify,r.hexStripZeros=u.hexStripZeros,r.hexZeroPad=u.hexZeroPad,r.isHexString=u.isHexString,r.joinSignature=u.joinSignature,r.padZeros=u.padZeros,r.splitSignature=u.splitSignature,r.stripZeros=u.stripZeros;var h=t("./hash");r.hashMessage=h.hashMessage,r.id=h.id,r.namehash=h.namehash;var c=n(t("./hdnode"));r.HDNode=c;var l=t("./interface");r.Interface=l.Interface;var f=t("./json-wallet");r.getJsonWalletAddress=f.getJsonWalletAddress;var d=t("./keccak256");r.keccak256=d.keccak256;var p=t("./sha2");r.sha256=p.sha256;var m=t("./solidity");r.solidityKeccak256=m.keccak256,r.solidityPack=m.pack,r.soliditySha256=m.sha256;var v=t("./random-bytes");r.randomBytes=v.randomBytes;var g=t("./networks");r.getNetwork=g.getNetwork;var y=t("./properties");r.checkProperties=y.checkProperties,r.deepCopy=y.deepCopy,r.defineReadOnly=y.defineReadOnly,r.resolveProperties=y.resolveProperties,r.shallowCopy=y.shallowCopy;var w=n(t("./rlp"));r.RLP=w;var b=t("./secp256k1");r.computeAddress=b.computeAddress,r.computePublicKey=b.computePublicKey,r.recoverAddress=b.recoverAddress,r.recoverPublicKey=b.recoverPublicKey,r.verifyMessage=b.verifyMessage;var _=t("./signing-key");r.SigningKey=_.SigningKey;var M=t("./transaction");r.populateTransaction=M.populateTransaction;var k=t("./transaction");r.parseTransaction=k.parse,r.serializeTransaction=k.serialize;var S=t("./utf8");r.formatBytes32String=S.formatBytes32String,r.parseBytes32String=S.parseBytes32String,r.toUtf8Bytes=S.toUtf8Bytes,r.toUtf8String=S.toUtf8String;var x=t("./units");r.commify=x.commify,r.formatEther=x.formatEther,r.parseEther=x.parseEther,r.formatUnits=x.formatUnits,r.parseUnits=x.parseUnits;var A=t("./web");r.fetchJson=A.fetchJson,r.poll=A.poll;var E=t("./hmac");r.SupportedAlgorithms=E.SupportedAlgorithms;var T=t("./utf8");r.UnicodeNormalizationForm=T.UnicodeNormalizationForm;var O=t("./wordlist");r.Wordlist=O.Wordlist},{"./abi-coder":59,"./address":60,"./base64":61,"./bignumber":63,"./bytes":64,"./hash":65,"./hdnode":66,"./hmac":67,"./interface":69,"./json-wallet":70,"./keccak256":71,"./networks":72,"./properties":74,"./random-bytes":75,"./rlp":76,"./secp256k1":77,"./sha2":79,"./signing-key":81,"./solidity":82,"./transaction":83,"./units":84,"./utf8":85,"./web":86,"./wordlist":87}],69:[function(t,e,r){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};function s(t){for(var e in p.setType(this,"Description"),t)p.defineReadOnly(this,e,p.deepCopy(t[e],!0));Object.freeze(this)}Object.defineProperty(r,"__esModule",{value:!0});var a,u=t("./address"),h=t("./abi-coder"),c=t("./bignumber"),l=t("./bytes"),f=t("./hash"),d=t("./keccak256"),p=t("./properties"),m=o(t("../errors")),v=function(t){p.setType(this,"Indexed"),p.defineReadOnly(this,"hash",t)},g=(i(y,a=s),y.prototype.encode=function(t,e){l.isHexString(t)||m.throwError("invalid contract bytecode",m.INVALID_ARGUMENT,{arg:"bytecode",value:t}),m.checkArgumentCount(e.length,this.inputs.length," in Interface constructor");try{return t+h.defaultAbiCoder.encode(this.inputs,e).substring(2)}catch(t){m.throwError("invalid constructor argument",m.INVALID_ARGUMENT,{arg:t.arg,reason:t.reason,value:t.value})}return null},y);function y(){return null!==a&&a.apply(this,arguments)||this}var w,b=(i(_,w=s),_.prototype.encode=function(t){m.checkArgumentCount(t.length,this.inputs.length," in interface function "+this.name);try{return this.sighash+h.defaultAbiCoder.encode(this.inputs,t).substring(2)}catch(t){m.throwError("invalid input argument",m.INVALID_ARGUMENT,{arg:t.arg,reason:t.reason,value:t.value})}return null},_.prototype.decode=function(t){try{return h.defaultAbiCoder.decode(this.outputs,l.arrayify(t))}catch(e){m.throwError("invalid data for function output",m.INVALID_ARGUMENT,{arg:"data",errorArg:e.arg,errorValue:e.value,value:t,reason:e.reason})}},_);function _(){return null!==w&&w.apply(this,arguments)||this}var M,k=(i(S,M=s),S);function S(){return null!==M&&M.apply(this,arguments)||this}var x,A=(i(E,x=s),E.prototype.encodeTopics=function(t){var e=this;t.length>this.inputs.length&&m.throwError("too many arguments for "+this.name,m.UNEXPECTED_ARGUMENT,{maxCount:t.length,expectedCount:this.inputs.length});var r=[];for(this.anonymous||r.push(this.topic),t.forEach((function(t,n){var i=e.inputs[n];i.indexed?null==t?r.push(null):"string"===i.type?r.push(f.id(t)):"bytes"===i.type?r.push(d.keccak256(t)):-1!==i.type.indexOf("[")||"tuple"===i.type.substring(0,5)?m.throwError("filtering with tuples or arrays not implemented yet; bug us on GitHub",m.NOT_IMPLEMENTED,{operation:"filter(array|tuple)"}):("address"===i.type&&u.getAddress(t),r.push(l.hexZeroPad(l.hexlify(t),32).toLowerCase())):null!=t&&m.throwError("cannot filter non-indexed parameters; must be null",m.INVALID_ARGUMENT,{argument:i.name||n,value:t})}));r.length&&null===r[r.length-1];)r.pop();return r},E.prototype.decode=function(t,e){null==e||this.anonymous||(e=e.slice(1));var r=[],n=[],i=[];if(this.inputs.forEach((function(t,e){t.indexed?"string"===t.type||"bytes"===t.type||0<=t.type.indexOf("[")||"tuple"===t.type.substring(0,5)?(r.push({type:"bytes32",name:t.name||""}),i.push(!0)):(r.push(t),i.push(!1)):(n.push(t),i.push(!1))})),null!=e)var o=h.defaultAbiCoder.decode(r,l.concat(e));var s=h.defaultAbiCoder.decode(n,l.arrayify(t)),a={},u=0,c=0;return this.inputs.forEach((function(t,r){t.indexed?null==e?a[r]=new v(null):i[r]?a[r]=new v(o[c++]):a[r]=o[c++]:a[r]=s[u++],t.name&&(a[t.name]=a[r])})),a.length=this.inputs.length,new k(a)},E);function E(){return null!==x&&x.apply(this,arguments)||this}var T,O=(i(N,T=s),N);function N(){return null!==T&&T.apply(this,arguments)||this}var P,R=(i(I,P=s),I);function I(){return null!==P&&P.apply(this,arguments)||this}function C(t){switch(t.type){case"constructor":var e=new g({inputs:t.inputs,payable:null==t.payable||!!t.payable});this.deployFunction||(this.deployFunction=e);break;case"function":var r=h.formatSignature(t).replace(/tuple/g,""),n=f.id(r).substring(0,10),i=!1;null!=t.constant?i=t.constant:null!=t.stateMutability&&(i="view"==t.stateMutability||"pure"==t.stateMutability),e=new b({inputs:t.inputs,outputs:t.outputs,gas:t.gas,payable:null==t.payable||!!t.payable,type:i?"call":"transaction",name:t.name,signature:r,sighash:n}),t.name&&(null==this.functions[t.name]?p.defineReadOnly(this.functions,t.name,e):m.warn("WARNING: Multiple definitions for "+t.name)),null==this.functions[e.signature]&&p.defineReadOnly(this.functions,e.signature,e);break;case"event":r=h.formatSignature(t).replace(/tuple/g,""),e=new A({name:t.name,signature:r,inputs:t.inputs,topic:f.id(r),anonymous:!!t.anonymous}),t.name&&null==this.events[t.name]&&p.defineReadOnly(this.events,t.name,e),null==this.events[e.signature]&&p.defineReadOnly(this.events,e.signature,e);break;case"receive":case"fallback":break;default:m.warn("WARNING: unsupported ABI type - "+t.type)}}var D=(j.prototype.parseTransaction=function(t){var e=t.data.substring(0,10).toLowerCase();for(var r in this.functions)if(-1!==r.indexOf("(")){var n=this.functions[r];if(n.sighash===e){var i=h.defaultAbiCoder.decode(n.inputs,"0x"+t.data.substring(10));return new O({args:i,decode:n.decode,name:n.name,signature:n.signature,sighash:n.sighash,value:c.bigNumberify(t.value||"0")})}}return null},j.prototype.parseLog=function(t){for(var e in this.events)if(-1!==e.indexOf("(")){var r=this.events[e];if(!r.anonymous&&r.topic===t.topics[0])return new R({decode:r.decode,name:r.name,signature:r.signature,topic:r.topic,values:r.decode(t.data,t.topics)})}return null},j.isInterface=function(t){return p.isType(t,"Interface")},j.isIndexed=function(t){return p.isType(t,"Indexed")},j);function j(t){if(m.checkNew(this,j),"string"==typeof t){try{t=JSON.parse(t)}catch(e){m.throwError("could not parse ABI JSON",m.INVALID_ARGUMENT,{arg:"abi",errorMessage:e.message,value:t})}if(!Array.isArray(t))return m.throwError("invalid abi",m.INVALID_ARGUMENT,{arg:"abi",value:t}),null}p.defineReadOnly(this,"functions",{}),p.defineReadOnly(this,"events",{});var e=[];t.forEach((function(t){"string"==typeof t&&(t=h.parseSignature(t)),e.push(t)})),p.defineReadOnly(this,"abi",p.deepCopy(e,!0)),e.forEach(C,this),this.deployFunction||C.call(this,{type:"constructor",inputs:[]}),p.setType(this,"Interface")}r.Interface=D},{"../errors":5,"./abi-coder":59,"./address":60,"./bignumber":63,"./bytes":64,"./hash":65,"./keccak256":71,"./properties":74}],70:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("./address");function i(t){try{var e=JSON.parse(t)}catch(t){return!1}return e.encseed&&e.ethaddr}function o(t){try{var e=JSON.parse(t)}catch(t){return!1}return!(!e.version||parseInt(e.version)!==e.version||3!==parseInt(e.version))}r.isCrowdsaleWallet=i,r.isSecretStorageWallet=o,r.getJsonWalletAddress=function(t){if(i(t))try{return n.getAddress(JSON.parse(t).ethaddr)}catch(t){return null}if(o(t))try{return n.getAddress(JSON.parse(t).address)}catch(t){return null}return null}},{"./address":60}],71:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("js-sha3"),i=t("./bytes");r.keccak256=function(t){return"0x"+n.keccak_256(i.arrayify(t))}},{"./bytes":64,"js-sha3":40}],72:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=n(t("../errors"));function o(t){return function(e){var r=[];return e.InfuraProvider&&r.push(new e.InfuraProvider(t)),e.EtherscanProvider&&r.push(new e.EtherscanProvider(t)),0===r.length?null:e.FallbackProvider?new e.FallbackProvider(r):r[0]}}function s(t,e){return function(r){return r.JsonRpcProvider?new r.JsonRpcProvider(t,e):null}}var a={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:o("homestead")},u={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:o("ropsten")},h={unspecified:{chainId:0,name:"unspecified"},homestead:a,mainnet:a,morden:{chainId:2,name:"morden"},ropsten:u,testnet:u,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:o("rinkeby")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:o("goerli")},kovan:{chainId:42,name:"kovan",_defaultProvider:o("kovan")},classic:{chainId:61,name:"classic",_defaultProvider:s("https://web3.gastracker.io","classic")},classicTestnet:{chainId:62,name:"classicTestnet",_defaultProvider:s("https://web3.gastracker.io/morden","classicTestnet")}};r.getNetwork=function(t){if(null==t)return null;if("number"==typeof t){for(var e in h){var r=h[e];if(r.chainId===t)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){var n=h[t];return null==n?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}var o=h[t.name];return o?(0!==t.chainId&&t.chainId!==o.chainId&&i.throwError("network chainId mismatch",i.INVALID_ARGUMENT,{arg:"network",value:t}),{name:t.name,chainId:o.chainId,ensAddress:t.ensAddress||o.ensAddress||null,_defaultProvider:t._defaultProvider||o._defaultProvider||null}):("number"!=typeof t.chainId&&i.throwError("invalid network chainId",i.INVALID_ARGUMENT,{arg:"network",value:t}),t)}},{"../errors":5}],73:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("../utils/bytes"),i=t("./hmac");r.pbkdf2=function(t,e,r,o,s){var a;t=n.arrayify(t),e=n.arrayify(e);var u,h,c=1,l=new Uint8Array(o),f=new Uint8Array(e.length+4);f.set(e);for(var d=1;d<=c;d++){f[e.length]=d>>24&255,f[e.length+1]=d>>16&255,f[e.length+2]=d>>8&255,f[e.length+3]=255&d;var p=i.computeHmac(s,t,f);a||(a=p.length,h=new Uint8Array(a),u=o-((c=Math.ceil(o/a))-1)*a),h.set(p);for(var m=1;m>=8;return e}function o(t,e,r){for(var n=0,i=0;it.length)throw new Error("too short");if(e+1+r+(i=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+i)}if(192<=t[e]){if(e+1+(i=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,i)}if(184<=t[e]){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(i=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(t.slice(e+1+r,e+1+r+i))}}if(128<=t[e]){var i;if(e+1+(i=t[e]-128)>t.length)throw new Error("invalid rlp data");return{consumed:1+i,result:n.hexlify(t.slice(e+1,e+1+i))}}return{consumed:1,result:n.hexlify(t[e])}}r.encode=function(t){return n.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach((function(e){r=r.concat(t(e))})),r.length<=55?(r.unshift(192+r.length),r):((o=i(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(n.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=i(s.length)).unshift(183+o.length),o.concat(s))}(t))},r.decode=function(t){var e=n.arrayify(t),r=a(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},{"./bytes":64}],77:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=t("elliptic"),o=t("./address"),s=t("./bytes"),a=t("./hash"),u=t("./keccak256"),h=t("./properties"),c=n(t("../errors")),l=null;function f(){return l=l||new i.ec("secp256k1")}var d=(p.prototype.sign=function(t){var e=f().keyFromPrivate(s.arrayify(this.privateKey)).sign(s.arrayify(t),{canonical:!0});return{recoveryParam:e.recoveryParam,r:s.hexZeroPad("0x"+e.r.toString(16),32),s:s.hexZeroPad("0x"+e.s.toString(16),32),v:27+e.recoveryParam}},p.prototype.computeSharedSecret=function(t){var e=f().keyFromPrivate(s.arrayify(this.privateKey)),r=f().keyFromPublic(s.arrayify(m(t)));return s.hexZeroPad("0x"+e.derive(r.getPublic()).toString(16),32)},p.prototype._addPoint=function(t){var e=f().keyFromPublic(s.arrayify(this.publicKey)),r=f().keyFromPublic(s.arrayify(t));return"0x"+e.pub.add(r.pub).encodeCompressed("hex")},p);function p(t){var e=f().keyFromPrivate(s.arrayify(t));h.defineReadOnly(this,"privateKey",s.hexlify(e.priv.toArray("be",32))),h.defineReadOnly(this,"publicKey","0x"+e.getPublic(!1,"hex")),h.defineReadOnly(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),h.defineReadOnly(this,"publicKeyBytes",e.getPublic().encode(null,!0))}function m(t,e){var r=s.arrayify(t);if(32!==r.length)return 33===r.length?e?s.hexlify(r):"0x"+f().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?e?"0x"+f().keyFromPublic(r).getPublic(!0,"hex"):s.hexlify(r):(c.throwError("invalid public or private key",c.INVALID_ARGUMENT,{arg:"key",value:"[REDACTED]"}),null);var n=new d(r);return e?n.compressedPublicKey:n.publicKey}function v(t){var e="0x"+m(t).slice(4);return o.getAddress("0x"+u.keccak256(e).substring(26))}function g(t,e){var r=s.splitSignature(e),n={r:s.arrayify(r.r),s:s.arrayify(r.s)};return"0x"+f().recoverPubKey(s.arrayify(t),n,r.recoveryParam).encode("hex",!1)}function y(t,e){return v(g(s.arrayify(t),e))}r.KeyPair=d,r.computePublicKey=m,r.computeAddress=v,r.recoverPublicKey=g,r.recoverAddress=y,r.verifyMessage=function(t,e){return y(a.hashMessage(t),e)}},{"../errors":5,"./address":60,"./bytes":64,"./hash":65,"./keccak256":71,"./properties":74,elliptic:12}],78:[function(t,e,r){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var o=n(t("aes-js")),s=n(t("scrypt-js")),a=n(t("uuid")),u=t("./signing-key"),h=i(t("./hdnode")),c=t("./address"),l=t("./bytes"),f=t("./pbkdf2"),d=t("./keccak256"),p=t("./utf8"),m=t("./random-bytes");function v(t){return"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),l.arrayify(t)}function g(t,e){for(t=String(t);t.lengthe.maxLength&&o.throwError("invalid length for "+e.name,o.INVALID_ARGUMENT,{arg:"transaction"+e.name,value:n}),r.push(h.hexlify(n))})),null!=t.chainId&&0!==t.chainId&&(r.push(h.hexlify(t.chainId)),r.push("0x"),r.push("0x"));var n=f.encode(r);if(!e)return n;var i=h.splitSignature(e),s=27+i.recoveryParam;return 9===r.length&&(r.pop(),r.pop(),r.pop(),s+=2*t.chainId+8),r.push(h.hexlify(s)),r.push(h.stripZeros(h.arrayify(i.r))),r.push(h.stripZeros(h.arrayify(i.s))),f.encode(r)},r.parse=function(t){var e=f.decode(t);9!==e.length&&6!==e.length&&o.throwError("invalid raw transaction",o.INVALID_ARGUMENT,{arg:"rawTransactin",value:t});var r={nonce:p(e[0]).toNumber(),gasPrice:p(e[1]),gasLimit:p(e[2]),to:function(t){return"0x"===t?null:a.getAddress(t)}(e[3]),value:p(e[4]),data:e[5],chainId:0};if(6===e.length)return r;try{r.v=u.bigNumberify(e[6]).toNumber()}catch(t){return o.info(t),r}if(r.r=h.hexZeroPad(e[7],32),r.s=h.hexZeroPad(e[8],32),u.bigNumberify(r.r).isZero()&&u.bigNumberify(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);var n=r.v-27,i=e.slice(0,6);0!==r.chainId&&(i.push(h.hexlify(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);var l=c.keccak256(f.encode(i));try{r.from=s.recoverAddress(l,{r:h.hexlify(r.r),s:h.hexlify(r.s),recoveryParam:n})}catch(t){o.info(t)}r.hash=c.keccak256(t)}return r},r.populateTransaction=function(t,e,r){d.Provider.isProvider(e)||o.throwError("missing provider",o.INVALID_ARGUMENT,{argument:"provider",value:e}),l.checkProperties(t,v);var n=l.shallowCopy(t);if(null!=n.to&&(n.to=e.resolveName(n.to)),null==n.gasPrice&&(n.gasPrice=e.getGasPrice()),null==n.nonce&&(n.nonce=e.getTransactionCount(r)),null==n.gasLimit){var i=l.shallowCopy(n);i.from=r,n.gasLimit=e.estimateGas(i)}return null==n.chainId&&(n.chainId=e.getNetwork().then((function(t){return t.chainId}))),l.resolveProperties(n)}},{"../constants":3,"../errors":5,"../providers/abstract-provider":50,"./address":60,"./bignumber":63,"./bytes":64,"./keccak256":71,"./properties":74,"./rlp":76,"./secp256k1":77}],84:[function(t,e,r){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i,o=t("../constants"),s=n(t("../errors")),a=t("./bignumber"),u={};function h(t){return{decimals:t.length-1,tenPower:a.bigNumberify(t)}}function c(t){var e=u[String(t).toLowerCase()];if(!e&&"number"==typeof t&&parseInt(String(t))==t&&0<=t&&t<=256){for(var r="1",n=0;nr.decimals&&s.throwError("underflow occurred",s.NUMERIC_FAULT,{operation:"division",fault:"underflow"});h.length>6|192),r.push(63&o|128);else if(55296==(64512&o)){i++;var u=t.charCodeAt(i);if(i>=t.length||56320!=(64512&u))throw new Error("invalid utf-8 string");o=65536+((1023&o)<<10)+(1023&u),r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(o>>12|224),r.push(o>>6&63|128),r.push(63&o|128)}return a.arrayify(r)}function h(t,e){t=a.arrayify(t);for(var r="",n=0;n>7!=0){var o=null,s=null;if(192==(224&i))o=1,s=127;else if(224==(240&i))o=2,s=2047;else{if(240!=(248&i)){if(e)continue;if(128==(192&i))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}o=3,s=65535}if(n+o>t.length){if(!e)throw new Error("invalid utf8 byte sequence; too short");for(;n>6==2;n++);}else{for(var u=i&(1<<8-o-1)-1,h=0;h>10&1023),56320+(1023&u)));else if(!e)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(i)}return r}(i=n=r.UnicodeNormalizationForm||(r.UnicodeNormalizationForm={})).current="",i.NFC="NFC",i.NFD="NFD",i.NFKC="NFKC",i.NFKD="NFKD",r.toUtf8Bytes=u,r.toUtf8String=h,r.formatBytes32String=function(t){var e=u(t);if(31e.ceiling&&(n=e.ceiling),a&&(u--,n=a,a=null),setTimeout(i,n)}return null}),(function(t){s()&&n(t)}))}()}))}},{"../errors":5,"./base64":61,"./properties":74,"./utf8":85,xmlhttprequest:49}],87:[function(t,e,r){(function(e){Object.defineProperty(r,"__esModule",{value:!0});var n=t("../utils/hash"),i=t("../utils/properties");r.check=function(t){for(var e=[],r=0;r<2048;r++){var i=t.getWord(r);if(r!==t.getWordIndex(i))return"0x";e.push(i)}return n.id(e.join("\n")+"\n")};var o=(s.prototype.split=function(t){return t.toLowerCase().split(/ +/g)},s.prototype.join=function(t){return t.join(" ")},s);function s(t){i.defineReadOnly(this,"locale",t)}r.Wordlist=o,r.register=function(t,e){e=e||t.locale}}).call(this,void 0!==p.d?p.d:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils/hash":65,"../utils/properties":74}],88:[function(t,e,r){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s,a=t("./utils/bytes"),u=t("./utils/hash"),h=t("./utils/hdnode"),c=t("./utils/json-wallet"),l=t("./utils/keccak256"),f=t("./utils/properties"),d=t("./utils/random-bytes"),p=o(t("./utils/secret-storage")),m=t("./utils/signing-key"),v=t("./utils/transaction"),g=t("./abstract-signer"),y=t("./providers/abstract-provider"),w=o(t("./errors")),b=(i(_,s=g.Signer),Object.defineProperty(_.prototype,"address",{get:function(){return this.signingKey.address},enumerable:!0,configurable:!0}),Object.defineProperty(_.prototype,"mnemonic",{get:function(){return this.signingKey.mnemonic},enumerable:!0,configurable:!0}),Object.defineProperty(_.prototype,"path",{get:function(){return this.signingKey.path},enumerable:!0,configurable:!0}),Object.defineProperty(_.prototype,"privateKey",{get:function(){return this.signingKey.privateKey},enumerable:!0,configurable:!0}),_.prototype.connect=function(t){return y.Provider.isProvider(t)||w.throwError("invalid provider",w.INVALID_ARGUMENT,{argument:"provider",value:t}),new _(this.signingKey,t)},_.prototype.getAddress=function(){return Promise.resolve(this.address)},_.prototype.sign=function(t){var e=this;return f.resolveProperties(t).then((function(t){var r=v.serialize(t),n=e.signingKey.signDigest(l.keccak256(r));return v.serialize(t,n)}))},_.prototype.signMessage=function(t){return Promise.resolve(a.joinSignature(this.signingKey.signDigest(u.hashMessage(t))))},_.prototype.getBalance=function(t){if(!this.provider)throw new Error("missing provider");return this.provider.getBalance(this.address,t)},_.prototype.getTransactionCount=function(t){if(!this.provider)throw new Error("missing provider");return this.provider.getTransactionCount(this.address,t)},_.prototype.sendTransaction=function(t){var e=this;if(!this.provider)throw new Error("missing provider");return null==t.nonce&&((t=f.shallowCopy(t)).nonce=this.getTransactionCount("pending")),v.populateTransaction(t,this.provider,this.address).then((function(t){return e.sign(t).then((function(t){return e.provider.sendTransaction(t)}))}))},_.prototype.encrypt=function(t,e,r){if("function"!=typeof e||r||(r=e,e={}),r&&"function"!=typeof r)throw new Error("invalid callback");return e=e||{},this.mnemonic&&((e=f.shallowCopy(e)).mnemonic=this.mnemonic,e.path=this.path),p.encrypt(this.privateKey,t,e,r)},_.createRandom=function(t){var e=d.randomBytes(16);(t=t||{}).extraEntropy&&(e=a.arrayify(l.keccak256(a.concat([e,t.extraEntropy])).substring(0,34)));var r=h.entropyToMnemonic(e,t.locale);return _.fromMnemonic(r,t.path,t.locale)},_.fromEncryptedJson=function(t,e,r){if(c.isCrowdsaleWallet(t))try{r&&r(0);var n=p.decryptCrowdsale(t,e);return r&&r(1),Promise.resolve(new _(n))}catch(t){return Promise.reject(t)}else if(c.isSecretStorageWallet(t))return p.decrypt(t,e,r).then((function(t){return new _(t)}));return Promise.reject("invalid wallet JSON")},_.fromMnemonic=function(t,e,r){return e=e||h.defaultPath,new _(h.fromMnemonic(t,r).derivePath(e))},_);function _(t,e){var r=s.call(this)||this;return w.checkNew(r,_),m.SigningKey.isSigningKey(t)?f.defineReadOnly(r,"signingKey",t):f.defineReadOnly(r,"signingKey",new m.SigningKey(t)),f.defineReadOnly(r,"provider",e),r}r.Wallet=b},{"./abstract-signer":2,"./errors":5,"./providers/abstract-provider":50,"./utils/bytes":64,"./utils/hash":65,"./utils/hdnode":66,"./utils/json-wallet":70,"./utils/keccak256":71,"./utils/properties":74,"./utils/random-bytes":75,"./utils/secret-storage":78,"./utils/signing-key":81,"./utils/transaction":83}],89:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t("../wordlists/lang-en").langEn;r.en=n},{"../wordlists/lang-en":90}],90:[function(t,e,r){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var o,s=t("../utils/wordlist"),a=null;function u(t){if(null==a&&(a="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==s.check(t)))throw a=null,new Error("BIP39 Wordlist for en (English) FAILED")}function h(){return o.call(this,"en")||this}var c=new(i(h,o=s.Wordlist),h.prototype.getWord=function(t){return u(this),a[t]},h.prototype.getWordIndex=function(t){return u(this),a.indexOf(t)},h);r.langEn=c,s.register(c)},{"../utils/wordlist":87}]},{},[7])(7)})));var Ee="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),Te=new Uint8Array(16);function Oe(){if(!Ee)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ee(Te)}for(var Ne,Pe,Re=[],Ie=0;Ie<256;++Ie)Re[Ie]=(Ie+256).toString(16).substr(1);function Ce(t,e){var r=e||0,n=Re;return[n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]]].join("")}var De=0,je=0;function Le(t,e,r){var n=function(t,n,i,o){var s=i&&o||0;if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=new Array(t.length),r=0;r>16)+(e>>16)+(r>>16)<<16|65535&r}function Be(t,e,r,n,i,o){return Ue((s=Ue(Ue(e,t),Ue(n,o)))<<(a=i)|s>>>32-a,r);var s,a}function Fe(t,e,r,n,i,o,s){return Be(e&r|~e&n,t,e,i,o,s)}function He(t,e,r,n,i,o,s){return Be(e&n|r&~n,t,e,i,o,s)}function Ge(t,e,r,n,i,o,s){return Be(e^r^n,t,e,i,o,s)}function ze(t,e,r,n,i,o,s){return Be(r^(e|~n),t,e,i,o,s)}var We=Le("v3",48,(function(t){if("string"==typeof t){var e=unescape(encodeURIComponent(t));t=new Array(e.length);for(var r=0;r>5]>>>e%32&255,n=parseInt("0123456789abcdef".charAt(r>>>4&15)+"0123456789abcdef".charAt(15&r),16),i.push(n);return i}(function(t,e){var r,n,i,o,s;t[e>>5]|=128<>>9<<4)]=e;var a=1732584193,u=-271733879,h=-1732584194,c=271733878;for(r=0;r>2)-1]=void 0,e=0;e>5]|=(255&t[e/8])<>>32-e}var Ye=Le("v5",80,(function(t){var e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){var n=unescape(encodeURIComponent(t));t=new Array(n.length);for(var i=0;i>>0;m=p,p=d,d=Ke(f,30)>>>0,f=l,l=g}r[0]=r[0]+l>>>0,r[1]=r[1]+f>>>0,r[2]=r[2]+d>>>0,r[3]=r[3]+p>>>0,r[4]=r[4]+m>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),Ve=Object.freeze({__proto__:null,v1:function(t,e,r){var n=e&&r||0,i=e||[],o=(t=t||{}).node||Ne,s=void 0!==t.clockseq?t.clockseq:Pe;if(null==o||null==s){var a=t.random||(t.rng||Oe)();null==o&&(o=Ne=[1|a[0],a[1],a[2],a[3],a[4],a[5]]),null==s&&(s=Pe=16383&(a[6]<<8|a[7]))}var u=void 0!==t.msecs?t.msecs:(new Date).getTime(),h=void 0!==t.nsecs?t.nsecs:je+1,c=u-De+(h-je)/1e4;if(c<0&&void 0===t.clockseq&&(s=s+1&16383),(c<0||u>De)&&void 0===t.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");De=u,je=h,Pe=s;var l=(1e4*(268435455&(u+=122192928e5))+h)%4294967296;i[n++]=l>>>24&255,i[n++]=l>>>16&255,i[n++]=l>>>8&255,i[n++]=255&l;var f=u/4294967296*1e4&268435455;i[n++]=f>>>8&255,i[n++]=255&f,i[n++]=f>>>24&15|16,i[n++]=f>>>16&255,i[n++]=s>>>8|128,i[n++]=255&s;for(var d=0;d<6;++d)i[n+d]=o[d];return e||Ce(i)},v3:We,v4:function(t,e,r){var n=e&&r||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var i=(t=t||{}).random||(t.rng||Oe)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e)for(var o=0;o<16;++o)e[n+o]=i[o];return e||Ce(i)},v5:Ye}),Ze=Object(p.b)((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.uuid=function(){return Ve.v4()};var r={v4:/(?:^[0-9a-f]{8}\x2D[0-9a-f]{4}\x2D4[0-9a-f]{3}\x2D[0-9a-f]{4}\x2D[0-9a-f]{12}$)|(?:^0{8}\x2D0{4}\x2D0{4}\x2D0{4}\x2D0{12}$)/,v5:/(?:^[0-9a-f]{8}\x2D[0-9a-f]{4}\x2D5[0-9a-f]{3}\x2D[0-9a-f]{4}\x2D[0-9a-f]{12}$)|(?:^0{8}\x2D0{4}\x2D0{4}\x2D0{4}\x2D0{12}$)/};e.regex=r,e.isUuid=function(t){return r.v4.test(t)||r.v5.test(t)},e.empty=function(){return"00000000-0000-0000-0000-000000000000"},e.fromString=function(t){return Ve.v5(t,"bb5d0ffa-9a4c-4d7c-8fc2-0a7d2220ba45")}})),Je=Object(p.c)(Ze),$e=Ze.uuid,Xe=Ze.regex,Qe=Ze.isUuid,tr=Ze.empty,er=Ze.fromString,rr=Object.freeze({__proto__:null,default:Je,__moduleExports:Ze,uuid:$e,regex:Xe,isUuid:Qe,empty:tr,fromString:er}),nr=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},ir=rr.uuid,or=function(t){return nr(void 0,void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){return setTimeout((function(){return e()}),t)})));case 1:case"end":return e.stop()}}),e)})))},sr=function(t,e){var r=new Map,n=0;return function(){for(var i,o=this,s=arguments.length,a=new Array(s),u=0;ue&&(n=h,i=setTimeout((function(){s(t.apply(o,a)),r.delete(i)}),n-h)),r.set(i,u)}))}},ar=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},ur=function(t){Object(c.a)(r,t);var e=Object(l.a)(r);function r(t){var n;Object(u.a)(this,r),(n=e.call(this)).isAuthereum=!0,n.lastSignTx="",n.lastSignTxTimeout=null,n.lastTx="",n.lastTxTimeout=null,n.lastMsg="",n.lastMsgTimeout=null,n.lastTypedMsg="",n.lastTypedMsgTimeout=null,n.concatAuthKeySig=function(t){return ar(Object(i.a)(n),void 0,void 0,s.a.mark((function e(){var r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.authereum.getLoginKeyAuthSignature();case 2:return r=e.sent,e.abrupt("return",(r=r.slice(2),t.concat(r)));case 4:case"end":return e.stop()}}),e,this)})))};var o=null;return t instanceof vr&&(t=(o=t).config),n.config=t||{},n.authereum=o||new vr(n.config),n.initSubprovider(),n.isAuthereum=!0,n}return Object(h.a)(r,[{key:"initSubprovider",value:function(){return ar(this,void 0,void 0,s.a.mark((function t(){var e,r=this;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.authereum._tilReady();case 2:if(t.t0=this.config.rpcUri,t.t0){t.next=7;break}return t.next=6,this.authereum.getRpcUri();case 6:t.t0=t.sent;case 7:this.rpcUri=t.t0,e=new rt({getAccounts:function(t){return ar(r,void 0,void 0,s.a.mark((function e(){var r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.authereum.isAuthenticated();case 2:if(e.sent){e.next=4;break}return e.abrupt("return",(t&&t(null,[]),[]));case 4:return e.next=6,this.authereum.getAccountAddress();case 6:return r=e.sent,e.abrupt("return",r?(t&&t(null,[r]),[r]):(t&&t(null,[]),[]));case 8:case"end":return e.stop()}}),e,this)})))},approveTransaction:function(t,e){return ar(r,void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(e&&e(null,!0),!0));case 1:case"end":return t.stop()}}),t)})))},approveMessage:function(t,e){return ar(r,void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(e&&e(null,!0),!0));case 1:case"end":return t.stop()}}),t)})))},approveTypedMessage:function(t,e){return ar(r,void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(e&&e(null,!0),!0));case 1:case"end":return t.stop()}}),t)})))},signMessage:function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){var n,i,o=this;return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=t;try{n=JSON.stringify(t)}catch(t){}if(clearTimeout(this.lastMsgTimeout),this.lastMsg!==n){r.next=4;break}return r.abrupt("return",this._throttledSignMessage(t,e));case 4:return i=!this.lastMsg,r.abrupt("return",(this.lastMsg=n,this.lastMsgTimeout=setTimeout((function(){o.lastMsg=""}),2e3),i?this._throttledSignMessage(t,e):this._signMessage(t,e)));case 6:case"end":return r.stop()}}),r,this)})))},signTransaction:function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){var n,i,o,a=this;return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if((n=Object.assign({},t)).nonce=null,i=JSON.stringify(n),clearTimeout(this.lastSignTxTimeout),this.lastSignTx!==i){r.next=5;break}return r.abrupt("return",this._throttledSignTransaction(t,e));case 5:return o=!this.lastSignTx,r.abrupt("return",(this.lastSignTx=i,this.lastSignTxTimeout=setTimeout((function(){a.lastSignTx=""}),2e3),o?this._throttledSignTransaction(t,e):this._signTransaction(t,e)));case 7:case"end":return r.stop()}}),r,this)})))},processTransaction:function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){var n,i,o,a=this;return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if((n=Object.assign({},t)).nonce=null,i=JSON.stringify(n),clearTimeout(this.lastTxTimeout),this.lastTx!==i){r.next=5;break}return r.abrupt("return",this._throttledProcessTransaction(t,e));case 5:return o=!this.lastTx,r.abrupt("return",(this.lastTx=i,this.lastTxTimeout=setTimeout((function(){a.lastTx=""}),2e3),o?this._throttledProcessTransaction(t,e):this._processTransaction(t,e)));case 7:case"end":return r.stop()}}),r,this)})))},approvePersonalMessage:function(t,e){return ar(r,void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(e&&e(null,!0),!0));case 1:case"end":return t.stop()}}),t)})))},signPersonalMessage:function(t,n){return ar(r,void 0,void 0,s.a.mark((function r(){return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",e.signMessage(t,n));case 1:case"end":return r.stop()}}),r)})))},signTypedMessage:function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){var n,i,o=this;return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=t;try{n=JSON.stringify(t)}catch(t){}if(clearTimeout(this.lastTypedMsgTimeout),this.lastTypedMsg!==n){r.next=4;break}return r.abrupt("return",this._throttledSignTypedMessage(t,e));case 4:return i=!this.lastTypedMsg,r.abrupt("return",(this.lastTypedMsg=n,this.lastTypedMsgTimeout=setTimeout((function(){o.lastTypedMsg=""}),2e3),i?this._throttledSignTypedMessage(t,e):this._signTypedMessage(t,e)));case 6:case"end":return r.stop()}}),r,this)})))}}),this.walletSubprovider=e,this._processTransaction=function(t,n){return ar(r,void 0,void 0,s.a.mark((function r(){var i,o;return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,re(e.signTransaction.bind(e))(t);case 3:return i=r.sent,o=Ae(i),r.abrupt("return",(n&&n(null,o),o));case 8:if(r.prev=8,r.t0=r.catch(0),!n){r.next=12;break}return r.abrupt("return",void n(r.t0));case 12:throw r.t0;case 13:case"end":return r.stop()}}),r,null,[[0,8]])})))},this._throttledProcessTransaction=sr((function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this._processTransaction(t,e));case 1:case"end":return r.stop()}}),r,this)})))}),2e3),this._signMessage=function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){var n,i,o,a;return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.authereum.signWithDappKey(t.data);case 3:return n=r.sent,r.next=6,this.authereum.getLoginKeyAuthSignature();case 6:return i=r.sent,r.next=9,this.authereum.getLoginKeyRestrictionsData();case 9:return o=r.sent,i=i.slice(2),o=o.slice(2),a=n.concat(i,o),r.abrupt("return",(e&&e(null,a),a));case 15:r.prev=15,r.t0=r.catch(0),e&&e(r.t0);case 18:case"end":return r.stop()}}),r,this,[[0,15]])})))},this._throttledSignMessage=sr((function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this._signMessage(t,e));case 1:case"end":return r.stop()}}),r,this)})))}),2e3),this._signTypedMessage=function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){var n,i;return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.authereum.signTypedMessageWithDappKey(t.data);case 3:return n=r.sent,r.next=6,this.concatAuthKeySig(n);case 6:return i=r.sent,r.abrupt("return",(e&&e(null,i),i));case 10:r.prev=10,r.t0=r.catch(0),e&&e(r.t0);case 13:case"end":return r.stop()}}),r,this,[[0,10]])})))},this._throttledSignTypedMessage=sr((function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this._signTypedMessage(t,e));case 1:case"end":return r.stop()}}),r,this)})))}),2e3),this._signTransaction=function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){var n;return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.authereum.signTransactionWithLoginKey(t);case 3:if(n=r.sent){r.next=6;break}throw new Error("Error signing transaction");case 6:return r.abrupt("return",(e&&e(null,n.signedTransactionData),n.signedTransactionData));case 9:r.prev=9,r.t0=r.catch(0),e(r.t0);case 12:case"end":return r.stop()}}),r,this,[[0,9]])})))},this._throttledSignTransaction=sr((function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this._signTransaction(t,e));case 1:case"end":return r.stop()}}),r,this)})))}),2e3),this._sendAsync=this.sendAsync,this.sendAsync=function(t,e){return ar(r,void 0,void 0,s.a.mark((function r(){var n=this;return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Promise((function(r,i){e||(e=function(t,e){t?i(t):r(e)}),n._sendAsync(t,e)})));case 1:case"end":return r.stop()}}),r)})))},this.send=function(t,e){if("string"==typeof t)return new Promise((function(n,i){r.sendAsync({jsonrpc:"2.0",id:42,method:t,params:e||[]},(function(t,e){t?i(t):n(e.result)}))}));if(!e){var n=null;switch(t.method){case"eth_uninstallFilter":r.sendAsync(t,(function(){})),n=!0;break;default:var i="The Authereum Web3 object does not support synchronous methods like ".concat(t.method," without a callback parameter.");throw new Error(i)}return{id:t.id,jsonrpc:t.jsonrpc,result:n}}r.sendAsync(t,e)},e.handleRequest=function(t,e,r){var n,i,o,s,a,u=this;switch(u._parityRequests={},u._parityRequestCount=0,t.method){case"eth_coinbase":return void u.getAccounts((function(t,e){if(t)return r(t);var n=e[0]||null;r(null,n)}));case"eth_accounts":return void u.getAccounts((function(t,e){if(t)return r(t);r(null,e)}));case"eth_sendTransaction":return n=t.params[0],void G([function(t){return u.processTransaction(n,t)}],r);case"eth_signTransaction":return n=t.params[0],void G([function(t){return u.processSignTransaction(n,t)}],r);case"eth_sign":return a=t.params[0],s=t.params[1],o=t.params[2]||{},i=Object(v.h)(o,{from:a,data:s}),void G([function(t){return u.processMessage(i,t)}],r);case"personal_sign":return function(){var e=t.params[0];if(cr(t.params[1])&&hr(e)){"[message, address]. This was previously handled incorrectly, ","and has been corrected automatically. ","Please switch this param order for smooth behavior in the future.",console.warn("The eth_personalSign method requires params ordered [message, address]. This was previously handled incorrectly, and has been corrected automatically. Please switch this param order for smooth behavior in the future."),a=t.params[0],s=t.params[1]}else s=t.params[0],a=t.params[1];o=t.params[2]||{},i=Object(v.h)(o,{from:a,data:s}),G([function(t){return u.processPersonalMessage(i,t)}],r)}();case"eth_decryptMessage":return function(){var e=t.params[0];if(cr(t.params[1])&&hr(e)){"[message, address]. This was previously handled incorrectly, ","and has been corrected automatically. ","Please switch this param order for smooth behavior in the future.",console.warn("The eth_decryptMessage method requires params ordered [message, address]. This was previously handled incorrectly, and has been corrected automatically. Please switch this param order for smooth behavior in the future."),a=t.params[0],s=t.params[1]}else s=t.params[0],a=t.params[1];o=t.params[2]||{},i=Object(v.h)(o,{from:a,data:s}),G([function(t){return u.validateDecryptMessage(i,t)},function(t){return u.processDecryptMessage(i,t)}],r)}();case"encryption_public_key":return a=t.params[0],void G([function(t){return u.validateEncryptionPublicKey(a,t)},function(t){return u.processEncryptionPublicKey(a,t)}],r);case"personal_ecRecover":return function(){s=t.params[0];var e=t.params[1];o=t.params[2]||{},i=Object(v.h)(o,{sig:e,data:s}),u.recoverPersonalSignature(i,r)}();case"eth_signTypedData":return s=t.params[0],a=t.params[1],o=t.params[2]||{},i=Object(v.h)(o,{from:a,data:s}),void G([function(t){return u.processTypedMessage(i,t)}],r);case"eth_signTypedData_v3":return a=t.params[0],s=t.params[1],o=t.params[2]||{},i=Object(v.h)(o,{from:a,data:s}),void G([function(t){return u.processTypedMessage(i,t)}],r);case"parity_postTransaction":return n=t.params[0],void u.parityPostTransaction(n,r);case"parity_postSign":return a=t.params[0],s=t.params[1],void u.parityPostSign(a,s,r);case"parity_checkRequest":return function(){var e=t.params[0];u.parityCheckRequest(e,r)}();case"parity_defaultAccount":return void u.getAccounts((function(t,e){if(t)return r(t);var n=e[0]||null;r(null,n)}));default:return void e()}},e.validatePersonalMessage=function(t,e){return ar(r,void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(e&&e(null,!0),!0));case 1:case"end":return t.stop()}}),t)})))},e.validateMessage=function(t,e){return ar(r,void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(e&&e(null,!0),!0));case 1:case"end":return t.stop()}}),t)})))},e.validateTypedMessage=function(t,e){return ar(r,void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(e&&e(null,!0),!0));case 1:case"end":return t.stop()}}),t)})))},this.addProvider(e),this.rpcSubProvider=new Jt({rpcUrl:this.rpcUri}),this.addProvider(new Qt),this.addProvider(new te),this.addProvider({setEngine:function(t){return t},handleRequest:function(t,e,n){return ar(r,void 0,void 0,s.a.mark((function r(){return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:this.rpcSubProvider.handleRequest(t,e,n);case 1:case"end":return r.stop()}}),r,this)})))}}),this.on("error",(function(t){console.error(t.stack)})),this.start(),this._blockTracker.removeAllListeners();case 10:case"end":return t.stop()}}),t,this)})))}},{key:"getAccounts",value:function(t){return ar(this,void 0,void 0,s.a.mark((function e(){var r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.authereum.isAuthenticated();case 2:if(e.sent){e.next=4;break}return e.abrupt("return",(t&&t(null,[]),[]));case 4:return e.next=6,this.authereum.getAccountAddress();case 6:return r=e.sent,e.abrupt("return",r?(t&&t(null,[r]),[r]):(t&&t(null,[]),[]));case 8:case"end":return e.stop()}}),e,this)})))}},{key:"isConnected",value:function(){return this.authereum.isAuthenticatedSync()}},{key:"enable",value:function(){return ar(this,void 0,void 0,s.a.mark((function t(){var e;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.authereum.login();case 2:return t.next=4,this.authereum.getAccountAddress();case 4:return e=t.sent,t.abrupt("return",e?[e]:[]);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"disable",value:function(){return ar(this,void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.authereum.logout());case 1:case"end":return t.stop()}}),t,this)})))}},{key:"tilDomReady",value:function(){return new Promise((function(t){"loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",(function(){return t()}))}))}},{key:"sendTransaction",value:function(t){return ar(this,void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.sendTransactionBatch([t]));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"sendTransactionBatch",value:function(t){return ar(this,void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.authereum.sendTransactionBatch(t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"estimateGasBatch",value:function(t){return ar(this,void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.authereum.estimateGasBatch(t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"sign",value:function(t){return this._signMessage(t)}},{key:"signMessageWithAdminKey",value:function(t){return this.authereum.signMessageWithAdminKey(t)}},{key:"signMessageWithSigningKey",value:function(t){return this.authereum.signMessageWithSigningKey(t)}},{key:"showWidget",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.authereum.showWidget(t)}},{key:"widgetEnabled",value:function(){return this.authereum.widgetEnabled()}},{key:"getTransactionReceipt",value:function(t){return this.authereum.getTransactionReceipt(t)}},{key:"waitForTransactionReceipt",value:function(t){return this.authereum.waitForTransactionReceipt(t)}},{key:"isContractDeployed",value:function(t){return this.authereum.isContractDeployed(t)}}]),r}(J);function hr(t){var e=Object(v.j)(t);return Object(v.k)(e)}function cr(t){var e=Object(v.j)(t);return!Object(v.k)(e)&&function(t){return"string"==typeof t&&("0x"===t.slice(0,2)&&t.slice(2).match(/^[0-9A-Fa-f]+$/g))}(t)}var lr=function(t){return"https://".concat("mainnet"===t?"":"".concat(t,"."),"x.authereum.com")},fr=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},dr=function(t){var e={};for(var r in t){var n=t[r];"object"==typeof n&&"function"===n.toString&&(n=n.toString("hex")),e[r]=n}return e},pr={width:0,height:0,top:0,left:0},mr={notify:function(t,e){return console.log(t,e),{dismiss:function(){}}}},vr=function(t){Object(c.a)(r,t);var e=Object(l.a)(r);function r(t){var n;return Object(u.a)(this,r),(n=e.call(this))._notifier=mr,n._iframeReady=!1,n._configReady=!1,n._iframeConnecting=null,n._cacheReady=!1,n._readyEmitted=!1,n._widgetEnabled=!1,n._iframeStyle=pr,n._blockedPopupRedirect=!0,n._notificationsMap={},n._heartbeatStarted=!1,n._backoffTimeout=1,n._userConfig=null,n._asymmetricEncryptionKey=null,n._authereumQueryParams={},n._injectedElements=[],n._destroyed=!1,n._init=function(t){if("string"==typeof t){var e=t;if(n._networkName=(e||"").trim().toLowerCase(),["mainnet","ropsten","rinkeby","kovan","goerli"].includes(n._networkName))n._xsUri=lr(n._networkName);else{if("localhost"!==t)throw new Error("Unsupported network");n._xsUri="http://localhost:3002",n._networkName="kovan"}}else t=t||{},n._networkName=t.networkName||"mainnet",n._xsUri=t.xsUri||lr(n._networkName),n._apiKey=t.apiKey;t.redirectUri?n._redirectUri=t.redirectUri:n._redirectUri=window.location.href,n._iframeStyle={width:0,height:0,top:0,left:0},n._redirectUri=n._redirectUri||window.location.href,n._provider=new ur(Object(i.a)(n)),n._setupNotifier(),n._connectToChildIframe().catch((function(){n._startHeartbeat(!0)})),n._setupCache(),n._cacheAuthereumQueryParams(),n._setupSigningKey(),n._setupResizeListener(),n._setupFocusListener(),n._setupActionKeyListener(),n._emitReadyEvent()},n._setConfig=function(t){if("string"==typeof n._userConfig){var e=n._userConfig;n._networkName=(e||"").trim().toLowerCase(),n._userConfig={networkName:n._networkName,xsUri:lr(n._networkName)}}var r=n._userConfig||{},i=r.apiKey,o=r.apiUri,s=r.rpcUri,a=r.webUri,u=r.notifierUri,h=r.networkName,c=r.networkId,l=r.disableNotifications,f=r.blockedPopupRedirect;i&&(n._apiKey=i),o?n._apiUri=o:t.apiUri&&(n._apiUri=t.apiUri),n._rpcUri=s||t.rpcUri,a?n._webUri=a:t.webUri&&(n._webUri=t.webUri),u?n._notifierUri=u:t.notifierUri&&(n._notifierUri=t.notifierUri),h?n._networkName=h:t.networkName&&(n._networkName=t.networkName),c?n._networkId=c:t.networkId&&(n._networkId=t.networkId),"boolean"==typeof l?n._disableNotifications=l:"boolean"==typeof t.disableNotifications&&(n._disableNotifications=t.disableNotifications),"boolean"==typeof f?n._blockedPopupRedirect=f:"boolean"==typeof t.blockedPopupRedirect&&(n._blockedPopupRedirect=t.blockedPopupRedirect)},n._setupCache=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all([this._cacheLoginKeyAddress(),this._cacheIsAuthenticated(),this._cacheAccountAddress()]);case 2:this._cacheReady=!0;case 3:case"end":return t.stop()}}),t,this)})))},n._handleWindowFocus=function(){if(!n._destroyed)return n._postMessageToChild({method:"onWindowFocus"})},n._resetCache=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._setupCache());case 1:case"end":return t.stop()}}),t,this)})))},n._setupNotifier=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._tilConfigReady();case 2:if(t.t0=this._notifierUri,!t.t0){t.next=7;break}return t.next=6,this._injectScript(this._notifierUri,"authereum-notifier");case 6:window.AuthereumNotifier&&(this._notifier=new window.AuthereumNotifier({networkId:this._networkId,disableNotifications:this._disableNotifications,context:this}));case 7:case"end":return t.stop()}}),t,this)})))},n._injectScript=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function r(){var n=this;return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this._tilDomReady();case 2:return r.abrupt("return",new Promise((function(r,i){if(!t)throw new Error("sourceUrl is required");if(document.getElementById(e))r();else{var o=document.createElement("script");o.id=e,o.type="text/javascript",o.async=!0,o.onload=function(){r()},o.onerror=function(t){i(t)},o.src=t,n._injectedElements.push(o),document.getElementsByTagName("head")[0].appendChild(o)}})));case 3:case"end":return r.stop()}}),r,this)})))},n._setupResizeListener=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.addEventListener("resize",this._handleResizeThrottled,!1),window.addEventListener("resize",this._handleResizeDebounced,!1);case 1:case"end":return t.stop()}}),t,this)})))},n._handleActionKeyPress=function(t){if(!n._destroyed){var e="";return"Escape"===t.key||"Esc"===t.key||27===t.keyCode?e="escape":"Enter"===t.key||13===t.keyCode?e="enter":"ArrowLeft"===t.key||37===t.keyCode?e="left":"ArrowUp"===t.key||38===t.keyCode?e="up":"ArrowRight"===t.key||39===t.keyCode?e="right":"ArrowDown"!==t.key&&40!==t.keyCode||(e="down"),e?n._postMessageToChild({method:"actionKeyPress",params:e}):void 0}},n._handleResize=function(t){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){var e;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._destroyed){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,this._getWindowSize();case 4:return e=t.sent,t.abrupt("return",this._postMessageToChild({method:"onResize",params:e}));case 6:case"end":return t.stop()}}),t,this)})))},n._handleResizeThrottled=sr((function(t){return n._handleResize(t)}),10),n._handleResizeDebounced=function(t,e){var r;return function(){for(var e=arguments.length,n=new Array(e),i=0;i0&&void 0!==arguments[0])||arguments[0];return t?(n._widgetEnabled=!0,n._refreshWidget(),!0):n.hideWidget()},n.hideWidget=function(){return n._widgetEnabled=!1,n._setIframeWidth(0),n._setIframeHeight(0),!0},n.widgetEnabled=function(){return n._widgetEnabled},n.addFunds=function(t){return n._widgetEnabled=!0,n._postMessageToChild({method:"addFunds",params:t})},n._openUrl=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.url,r=t.newWindow;r?window.open(e,"_blank"):window.location.href=e},n._tilIframeReady=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._iframeReady){t.next=6;break}return t.next=3,or(100);case 3:t.t0=!0,t.next=9;break;case 6:return t.next=8,or(100);case 8:t.t0=this._tilIframeReady();case 9:return t.abrupt("return",t.t0);case 10:case"end":return t.stop()}}),t,this)})))},n._tilConfigReady=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._configReady){t.next=6;break}return t.next=3,or(100);case 3:t.t0=!0,t.next=9;break;case 6:return t.next=8,or(100);case 8:t.t0=this._tilConfigReady();case 9:return t.abrupt("return",t.t0);case 10:case"end":return t.stop()}}),t,this)})))},n._tilReady=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.isReady()){t.next=6;break}return t.next=3,or(100);case 3:t.t0=!0,t.next=9;break;case 6:return t.next=8,or(100);case 8:t.t0=this._tilReady();case 9:return t.abrupt("return",t.t0);case 10:case"end":return t.stop()}}),t,this)})))},n._emitReadyEvent=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._tilReady();case 2:this._readyEmitted||(this._readyEmitted=!0,this.emit("ready",{}));case 3:case"end":return t.stop()}}),t,this)})))},n._connectToChildIframe=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){var e,r=this;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._iframeConnecting){t.next=2;break}return t.abrupt("return",this._iframeConnecting);case 2:return this._iframeReady=!1,this._iframeConnecting=!0,t.next=5,this._getOrCreateIframe();case 5:return e=t.sent,t.abrupt("return",(this._iframeConnection=P.connectToChild({iframe:e,timeout:6e4,methods:{postMessage:function(t){return r._handlePostMessage(t)}}}),this._iframeConnecting=new Promise((function(t,e){var n=!1,i=setTimeout((function(){r._iframeReady||(n=!0,r._iframeConnecting=null,e(new Error("timedout")))}),3e3);r._iframeConnection.promise.then((function(e){clearTimeout(i),n||(r._iframeReady=!0,r._childIframeConnection=e,r._startHeartbeat(),r._iframeConnecting=null,t())})).catch((function(t){clearTimeout(i),n||e(t)}))})),this._iframeConnecting));case 7:case"end":return t.stop()}}),t,this)})))},n._startHeartbeat=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n._heartbeatStarted||(n._heartbeat(t),n._heartbeatStarted=!0)},n._heartbeat=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._destroyed){e.next=21;break}return e.next=3,or(2e3);case 3:if(e.prev=3,!t){e.next=9;break}return e.next=7,this._connectToChildIframe();case 7:return this._backoffTimeout=1,e.abrupt("return",this._heartbeat());case 9:return e.next=11,this._ping();case 11:e.next=20;break;case 13:if(e.prev=13,e.t0=e.catch(3),!/destroy|timedout/gi.test(e.t0.message)){e.next=20;break}return e.next=18,or(1e3*this._backoffTimeout);case 18:return this._backoffTimeout=this._backoffTimeout<<1,e.abrupt("return",this._heartbeat(!0));case 20:return e.abrupt("return",this._heartbeat());case 21:case"end":return e.stop()}}),e,this,[[3,13]])})))},n._ping=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){var e=this;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,r){var n=!1,i=setTimeout((function(){n=!0}),5e3);e._postMessageToChild({method:"ping"}).then((function(e){clearTimeout(i),n?r(new Error("timedout")):"pong"===e?t(e):r(new Error("Invalid response"))})).catch((function(t){r(t)}))})));case 1:case"end":return t.stop()}}),t)})))},n._getConfigFromChild=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._postMessageToChild({method:"getConfig"}));case 1:case"end":return t.stop()}}),t,this)})))},n._postVersionToChild=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._postMessageToChild({method:"version",params:this.version()}));case 1:case"end":return t.stop()}}),t,this)})))},n._postApiKeyToChild=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._apiKey){t.next=2;break}return t.abrupt("return",this._postMessageToChild({method:"apiKey",params:this._apiKey}));case 2:case"end":return t.stop()}}),t,this)})))},n._loadAsymmetricEncryptionKeyFromChild=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._postMessageToChild({method:"getAsymmetricEncryptionKey"});case 2:this._asymmetricEncryptionKey=t.sent;case 3:case"end":return t.stop()}}),t,this)})))},n._postMessageToChild=function(t){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._destroyed){e.next=2;break}throw new Error("Authereum instance destroyed.");case 2:return e.next=4,this._tilIframeReady();case 4:return e.abrupt("return",this._handleError(this._childIframeConnection.postMessage(t)));case 5:case"end":return e.stop()}}),e,this)})))},n._handleChildLogoutEvent=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._resetCache();case 2:this.emit("logout",{});case 3:case"end":return t.stop()}}),t,this)})))},n._handleChildDappKeyExpired=function(t){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=t===this._cachedLoginKeyAddress,!e.t0){e.next=6;break}return e.next=4,this._resetCache();case 4:this.emit("dappKeyExpired",t),this.emit("logout");case 6:case"end":return e.stop()}}),e,this)})))},n._handlePostMessage=function(t){try{t.method;var e=t.params;switch(p.c){case"onError":var r=e;return n.emit("error",r),void n._notifier.notify({type:"error",message:r.message});case"onLogout":return n._handleChildLogoutEvent();case"onDappKeyExpired":return n._handleChildDappKeyExpired(e);case"login":return n.login();case"setWidgetPosition":return;case"setWidgetSize":var i=e,o=i.width,s=i.height;return n._iframeStyle.width=o,n._iframeStyle.height=s,n._refreshWidget();case"getWindowSize":return n._getWindowSize();case"hideWidget":return n.hideWidget();case"notification":return n._handlePostMessageNotification(e);case"updateNotificationId":return n._handlePostMessageUpdateNotificationId(e);case"updateNotification":return n._handlePostMessageUpdateNotification(e);case"dismissNotification":return n._handlePostMessageDismissNotification(e);case"log":return n._handlePostMessageLog(e);case"openUrl":return n._openUrl(e)}}catch(t){}},n._handlePostMessageNotification=function(t){var e=n._notifier.notify(t);t.id&&(n._notificationsMap[t.id]=e)},n._handlePostMessageUpdateNotificationId=function(t){var e=t.id,r=t.newId;n._notificationsMap[r]=n._notificationsMap[e],n._notificationsMap[e]=null},n._handlePostMessageUpdateNotification=function(t){var e=n._notificationsMap[t.id];e&&e.update(t)},n._handlePostMessageDismissNotification=function(t){var e=n._notificationsMap[t.id];e&&e.dismiss()},n._handlePostMessageLog=function(t){var e=t.type,r=t.message;e||(e="log"),console[e](r)},n._getWindowSize=function(){return{width:n._getWindowWidth(),height:n._getWindowHeight()}},n._getWindowWidth=function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth},n._getWindowHeight=function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},n._setIframePositionLeft=function(t){n._iframe&&(n._iframe.style.left="".concat(t,"px"))},n._setIframeWidth=function(t){n._iframe&&(n._iframe.style.width="".concat(t,"px"))},n._setIframeHeight=function(t){n._iframe&&(n._iframe.style.height="".concat(t,"px"))},n._refreshWidget=function(){if(n._widgetEnabled){var t=n._iframeStyle,e=(t.top,t.left,t.width),r=t.height;n._setIframeWidth(e),n._setIframeHeight(r)}},n._loginKeyExists=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getLoginKey();case 2:return t.abrupt("return",!!t.sent);case 3:case"end":return t.stop()}}),t,this)})))},n._accountAddressExists=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getAccountAddress();case 2:return t.abrupt("return",!!t.sent);case 3:case"end":return t.stop()}}),t,this)})))},n._getAccountAdminKeyNonce=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._handleError(this._postMessageToChild({method:"getAccountAuthKeyNonce"})));case 1:case"end":return t.stop()}}),t,this)})))},n._getAccountAuthKeyNonce=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(console.warn("Deprecation notice: `authereum._getAccountAuthKeyNonce()` is deprecated. Use `authereum._getAccountAdminKeyNonce()` instead."),this._getAccountAdminKeyNonce()));case 1:case"end":return t.stop()}}),t,this)})))},n._executeLoginKeyMetaTx=function(t){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._handleError(this._postMessageToChild({method:"executeLoginKeyMetaTx",params:dr(t)})));case 1:case"end":return e.stop()}}),e,this)})))},n._loadLoginKey=function(t){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._tilReady();case 2:return e.abrupt("return",this._handleError(this._postMessageToChild({method:"loadLoginKey",params:t})));case 3:case"end":return e.stop()}}),e,this)})))},n._getOrCreateLoginKey=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._tilReady();case 2:return t.abrupt("return",this._handleError(this._postMessageToChild({method:"getOrCreateLoginKey"})));case 3:case"end":return t.stop()}}),t,this)})))},n._getAuthenticateUri=function(t){var e=n._asymmetricEncryptionKey;return n._webUri+"/?slk="+encodeURIComponent(JSON.stringify({loginKey:{publicAddress:t,expiresAt:I().add(1,"month").utc().unix()},encryptionKey:e}))+"&redirect_uri="+n._redirectUri},n._getSignWithAdminKeyUri=function(t){var e;return null!=(e=t)&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)&&(t="0x".concat(t.toString("hex"))),n._webUri+"/?sm="+encodeURIComponent(JSON.stringify({message:t}))+"&redirect_uri="+n._redirectUri},n._openPopupOrRedirect=function(t){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function e(){var r,n,i,o=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.emit("openPopup",{}),r=window.open(t,"Authereum","toolbar=no,\n location=no,\n status=no,\n menubar=no,\n scrollbars=no,\n resizable=no,\n width=470,\n height=640"),!(n=null==r)||this._blockedPopupRedirect){e.next=5;break}throw i=new Error("Disable popup blocker and try again"),this._notifier.notify({type:"error",message:i.message,timeout:5e3}),i;case 5:return e.abrupt("return",n?(this.emit("popupBlocked"),void(window.location.href=t)):(r.focus(),new Promise((function(t,e){var n=setInterval((function(){return fr(o,void 0,void 0,s.a.mark((function t(){var n;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.closed&&(a(),n=new Error("Window closed"),this.emit("error",n),this.emit("closePopup",{}),e(n));case 1:case"end":return t.stop()}}),t,this)})))}),250),i=setTimeout((function(){a(),r.close(),u(new Error("Timedout"))}),6e5),a=function(){clearInterval(n),clearTimeout(i),o.emit("closePopup",{})},u=function(t){a(),o.emit("error",t),e(t)},h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(),t(e)};window.addEventListener("message",(function(t){return fr(o,void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=t.origin.includes(this._webUri),!e.t0){e.next=16;break}if(t.data.close&&(r.close(),h()),e.t1=t.data.login,!e.t1){e.next=14;break}if(h({success:!0}),this.emit("login",{}),this._cachedIsAuthenticated=!0,e.t2=t.data.encryptedSigningKey,!e.t2){e.next=12;break}return e.next=12,this._loadSigningKey(t.data.encryptedSigningKey);case 12:this._logAnalyticsEvent({eventType:"logged_in_dapp",properties:{dapp_url:window.location.href}}),this._redirectUri!==window.location.href&&(window.location.href=this._redirectUri);case 14:t.data.result&&(h(t.data.result),this._redirectUri!==window.location.href&&(window.location.href=this._redirectUri)),t.data.error&&(u(new Error(t.data.error)),this._redirectUri!==window.location.href&&(window.location.href=this._redirectUri));case 16:case"end":return e.stop()}}),e,this)})))}))}))));case 6:case"end":return e.stop()}}),e,this)})))},n._signLoginKeyRequest=function(t){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function e(){var r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._getAuthenticateUri(t),e.abrupt("return",this._openPopupOrRedirect(r));case 2:case"end":return e.stop()}}),e,this)})))},n._tilDomReady=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){"loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",(function(){return t()}))})));case 1:case"end":return t.stop()}}),t)})))},n.version=function(){return C},n.isAuthenticatedSync=function(){return n._cachedIsAuthenticated},n.getTransactionReceipt=function(t){return n._handleError(n._postMessageToChild({method:"getTransactionReceipt",params:t}))},n.waitForTransactionReceipt=function(t){return n._handleError(n._postMessageToChild({method:"waitForTransactionReceipt",params:t}))},n.hasRecoveryEnabled=function(){return n._handleError(n._postMessageToChild({method:"hasRecoveryEnabled"}))},n.isContractDeployed=function(t){return n._handleError(n._postMessageToChild({method:"isContractDeployed",params:t}))},n._loadSigningKey=function(t){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._postMessageToChild({method:"loadSigningKey",params:t}));case 1:case"end":return e.stop()}}),e,this)})))},n._logAnalyticsEvent=function(t){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._postMessageToChild({method:"logAnalyticsEvent",params:t}));case 1:case"end":return e.stop()}}),e,this)})))},n._setupSigningKey=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){var e;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._tilReady();case 2:if(!(e=this._authereumQueryParams.encryptedSigningKey)){t.next=8;break}return t.next=6,this._loadSigningKey(e);case 6:if(!t.sent){t.next=8;break}try{localStorage.removeItem("_authereum")}catch(e){}case 8:case"end":return t.stop()}}),t,this)})))},n._cacheAuthereumQueryParams=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function e(){var r,n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{if(r=function(t){var e=window.location.search.substr(1),r=w.a.parse(e);return r[t]?r[t]:null}("_authereum")){this._authereumQueryParams=JSON.parse(r);try{localStorage.setItem("_authereum",btoa(JSON.stringify(this._authereumQueryParams)))}catch(t){}!function(t){try{window.history.replaceState({},document.title,t)}catch(t){}}(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location.href;try{var r=new URL(e);if("URLSearchParams"in window){var n=new URLSearchParams(r.search);return n.delete(t),r.search=n.toString(),r.toString()}}catch(t){}return e}("_authereum"))}else try{(n=localStorage.getItem("_authereum"))&&(this._authereumQueryParams=JSON.parse(atob(n)))}catch(t){}}catch(t){}case 1:case"end":return e.stop()}}),e,this)})))},n.destroy=function(){return fr(Object(i.a)(n),void 0,void 0,s.a.mark((function t(){var e,r,n,i,o;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._destroyed){t.next=2;break}return t.abrupt("return",(console.warn("Authereum instance already destroyed."),!0));case 2:if(t.prev=2,t.t0=this._iframeReady,!t.t0){t.next=7;break}return t.next=7,this._postMessageToChild({method:"destroy"});case 7:t.next=12;break;case 9:t.prev=9,t.t1=t.catch(2),console.error(t.t1);case 12:for(e=0;e0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location.href;try{var r=new URL(e);if("URLSearchParams"in window){var n=new URLSearchParams(r.search);for(var i in t)n.set(i,t[i]);return r.search=n.toString(),r.toString()}}catch(t){}return e}({url:r},this._xsUri),["Safari","Firefox"].includes(function(){var t,e=navigator.userAgent,r=e.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];/trident/i.test(r[1])&&(t=/\brv[ :]+(\d+)/g.exec(e)||[])[1],"Chrome"===r[1]&&(null!=(t=e.match(/\b(OPR|Edge?)\/(\d+)/))&&t.slice(1).join(" ").replace("OPR","Opera").replace("Edg ","Edge ")),r=r[2]?[r[1],r[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(t=e.match(/version\/(\d+)/i))&&r.splice(1,1,t[1]);var n=r.join(" ").split(" ");return{browser:n[0],version:n[1]}}().browser)&&i.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),i.style.position="fixed",i.style.bottom="0",i.style.right="0",i.style.width="0",i.style.height="0",i.style.border="0",i.style.background="transparent",i.style.zIndex="1",i.setAttribute("frameborder","0"),i.setAttribute("scrolling","no"),this._iframe=i,t(this._iframe),e.next=20,this._tilDomReady();case 20:document.body.appendChild(i),this._injectedElements.push(i),i.onload=function(){o._postVersionToChild(),o._postApiKeyToChild(),o._loadAsymmetricEncryptionKeyFromChild(),o._getConfigFromChild().then((function(t){o._setConfig(t),o._configReady=!0,o.emit("iframeReady",{})}))};case 23:case"end":return e.stop()}}),e,this)})))}))));case 1:case"end":return t.stop()}}),t,this)})))}}]),r}(R);vr.version=function(){return C},"undefined"!=typeof window&&(window.Authereum=vr);var gr=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},yr=function(t){Object(c.a)(r,t);var e=Object(l.a)(r);function r(t){var n;return Object(u.a)(this,r),(n=e.call(this)).config=t||{},n.authereum=new vr(n.config),n.provider=n.authereum.getProvider(),n}return Object(h.a)(r,[{key:"getAddress",value:function(){return gr(this,void 0,void 0,s.a.mark((function t(){return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.authereum.getAccountAddress());case 1:case"end":return t.stop()}}),t,this)})))}},{key:"signMessage",value:function(t){return gr(this,void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.provider.sign(t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"sign",value:function(t){return gr(this,void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.provider.sign(t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"sendTransaction",value:function(t){return gr(this,void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.provider.sendTransaction(t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"sendTransactionBatch",value:function(t){return gr(this,void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.provider.sendTransactionBatch(t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"estimateGasBatch",value:function(t){return gr(this,void 0,void 0,s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.provider.estimateGasBatch(t));case 1:case"end":return e.stop()}}),e,this)})))}}]),r}(r(94).Signer);e.default=vr}.call(this,r(451).setImmediate,r(90))}}]); \ No newline at end of file diff --git a/static/js/4.58d00759.chunk.js b/bridge/static/js/4.2f1eeddd.chunk.js similarity index 58% rename from static/js/4.58d00759.chunk.js rename to bridge/static/js/4.2f1eeddd.chunk.js index bc6ff0f..7ea3c18 100644 --- a/static/js/4.58d00759.chunk.js +++ b/bridge/static/js/4.2f1eeddd.chunk.js @@ -1,2 +1,2 @@ -/*! For license information please see 4.58d00759.chunk.js.LICENSE.txt */ -(this.webpackJsonpbridge=this.webpackJsonpbridge||[]).push([[4],[function(e,t,n){"use strict";e.exports=n(457)},function(e,t,n){"use strict";var r=n(9),i=n(2),a=n(25),o=n(0),s=n(5),c=n.n(s),u=n(205),l=n(231),f=n(204),h=n(77);Object(f.b)("#1890ff");var d=o.forwardRef((function(e,t){var n,s=e.className,f=e.icon,d=e.spin,p=e.rotate,m=e.tabIndex,v=e.onClick,g=e.twoToneColor,b=Object(a.a)(e,["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"]),y=o.useContext(u.a).prefixCls,w=void 0===y?"anticon":y,x=c()(w,(n={},Object(i.a)(n,"".concat(w,"-").concat(f.name),!!f.name),Object(i.a)(n,"".concat(w,"-spin"),!!d||"loading"===f.name),n),s),M=m;void 0===M&&v&&(M=-1);var O=p?{msTransform:"rotate(".concat(p,"deg)"),transform:"rotate(".concat(p,"deg)")}:void 0,k=Object(h.d)(g),E=Object(r.a)(k,2),_=E[0],S=E[1];return o.createElement("span",Object.assign({role:"img","aria-label":f.name},b,{ref:t,tabIndex:M,onClick:v,className:x}),o.createElement(l.a,{icon:f,primaryColor:_,secondaryColor:S,style:O}))}));d.displayName="AntdIcon",d.getTwoToneColor=f.a,d.setTwoToneColor=f.b,t.a=d},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;tthis.span)throw new RangeError("indeterminate span");return this.span}},{key:"replicate",value:function(e){var t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}},{key:"fromArray",value:function(e){}}]),e}();function f(e,t){return t.property?e+"["+t.property+"]":e}t.Layout=l,t.nameWithProperty=f,t.bindConstructorLayout=function(e,t){if("function"!==typeof e)throw new TypeError("Class must be constructor");if(e.hasOwnProperty("layout_"))throw new Error("Class is already bound to a layout");if(!(t&&t instanceof l))throw new TypeError("layout must be a Layout");if(t.hasOwnProperty("boundConstructor_"))throw new Error("layout is already bound to a constructor");e.layout_=t,t.boundConstructor_=e,t.makeDestinationObject=function(){return new e},Object.defineProperty(e.prototype,"encode",{value:function(e,n){return t.encode(this,e,n)},writable:!0}),Object.defineProperty(e,"decode",{value:function(e,n){return t.decode(e,n)},writable:!0})};var h=function(e){a(n,e);var t=o(n);function n(){return s(this,n),t.apply(this,arguments)}return c(n,[{key:"isCount",value:function(){throw new Error("ExternalLayout is abstract")}}]),n}(l),d=function(e){a(n,e);var t=o(n);function n(e,r){var i;if(s(this,n),void 0===e&&(e=1),!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");return(i=t.call(this,-1,r)).elementSpan=e,i}return c(n,[{key:"isCount",value:function(){return!0}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.length-t;return Math.floor(n/this.elementSpan)}},{key:"encode",value:function(e,t,n){return 0}}]),n}(h),p=function(e){a(n,e);var t=o(n);function n(e,r,i){var a;if(s(this,n),!(e instanceof l))throw new TypeError("layout must be a Layout");if(void 0===r)r=0;else if(!Number.isInteger(r))throw new TypeError("offset must be integer or undefined");return(a=t.call(this,e.span,i||e.property)).layout=e,a.offset=r,a}return c(n,[{key:"isCount",value:function(){return this.layout instanceof m||this.layout instanceof v}},{key:"decode",value:function(e,t){return void 0===t&&(t=0),this.layout.decode(e,t+this.offset)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),this.layout.encode(e,t,n+this.offset)}}]),n}(h),m=function(e){a(n,e);var t=o(n);function n(e,r){var i;if(s(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return c(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readUIntLE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeUIntLE(e,n,this.span),this.span}}]),n}(l),v=function(e){a(n,e);var t=o(n);function n(e,r){var i;if(s(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return c(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readUIntBE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeUIntBE(e,n,this.span),this.span}}]),n}(l),g=function(e){a(n,e);var t=o(n);function n(e,r){var i;if(s(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return c(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readIntLE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeIntLE(e,n,this.span),this.span}}]),n}(l),b=function(e){a(n,e);var t=o(n);function n(e,r){var i;if(s(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return c(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readIntBE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeIntBE(e,n,this.span),this.span}}]),n}(l),y=Math.pow(2,32);function w(e){var t=Math.floor(e/y);return{hi32:t,lo32:e-t*y}}function x(e,t){return e*y+t}var M=function(e){a(n,e);var t=o(n);function n(e){return s(this,n),t.call(this,8,e)}return c(n,[{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.readUInt32LE(t);return x(e.readUInt32LE(t+4),n)}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=w(e);return t.writeUInt32LE(r.lo32,n),t.writeUInt32LE(r.hi32,n+4),8}}]),n}(l),O=function(e){a(n,e);var t=o(n);function n(e){return s(this,n),t.call(this,8,e)}return c(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),x(e.readUInt32BE(t),e.readUInt32BE(t+4))}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=w(e);return t.writeUInt32BE(r.hi32,n),t.writeUInt32BE(r.lo32,n+4),8}}]),n}(l),k=function(e){a(n,e);var t=o(n);function n(e){return s(this,n),t.call(this,8,e)}return c(n,[{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.readUInt32LE(t);return x(e.readInt32LE(t+4),n)}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=w(e);return t.writeUInt32LE(r.lo32,n),t.writeInt32LE(r.hi32,n+4),8}}]),n}(l),E=function(e){a(n,e);var t=o(n);function n(e){return s(this,n),t.call(this,8,e)}return c(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),x(e.readInt32BE(t),e.readUInt32BE(t+4))}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=w(e);return t.writeInt32BE(r.hi32,n),t.writeUInt32BE(r.lo32,n+4),8}}]),n}(l),_=function(e){a(n,e);var t=o(n);function n(e){return s(this,n),t.call(this,4,e)}return c(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readFloatLE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeFloatLE(e,n),4}}]),n}(l),S=function(e){a(n,e);var t=o(n);function n(e){return s(this,n),t.call(this,4,e)}return c(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readFloatBE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeFloatBE(e,n),4}}]),n}(l),C=function(e){a(n,e);var t=o(n);function n(e){return s(this,n),t.call(this,8,e)}return c(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readDoubleLE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeDoubleLE(e,n),8}}]),n}(l),j=function(e){a(n,e);var t=o(n);function n(e){return s(this,n),t.call(this,8,e)}return c(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readDoubleBE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeDoubleBE(e,n),8}}]),n}(l),T=function(e){a(n,e);var t=o(n);function n(e,r,i){var a;if(s(this,n),!(e instanceof l))throw new TypeError("elementLayout must be a Layout");if(!(r instanceof h&&r.isCount()||Number.isInteger(r)&&0<=r))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");var o=-1;return!(r instanceof h)&&0f.span&&void 0===f.property)throw new Error("fields cannot contain unnamed variable-length layout")}}catch(d){u.e(d)}finally{u.f()}var h=-1;try{h=e.reduce((function(e,t){return e+t.getSpan()}),0)}catch(p){}return(o=t.call(this,h,r)).fields=e,o.decodePrefixes=!!a,o}return c(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=0;try{n=this.fields.reduce((function(n,r){var i=r.getSpan(e,t);return t+=i,n+i}),0)}catch(r){throw new RangeError("indeterminate span")}return n}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n,r=this.makeDestinationObject(),a=i(this.fields);try{for(a.s();!(n=a.n()).done;){var o=n.value;if(void 0!==o.property&&(r[o.property]=o.decode(e,t)),t+=o.getSpan(e,t),this.decodePrefixes&&e.length===t)break}}catch(s){a.e(s)}finally{a.f()}return r}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r,a=n,o=0,s=0,c=i(this.fields);try{for(c.s();!(r=c.n()).done;){var l=r.value,f=l.span;if(s=0f&&(f=l.getSpan(t,n)))}o=n,n+=f}}catch(d){c.e(d)}finally{c.f()}return o+s-a}},{key:"fromArray",value:function(e){var t,n=this.makeDestinationObject(),r=i(this.fields);try{for(r.s();!(t=r.n()).done;){var a=t.value;void 0!==a.property&&0a.span?n=-1:0<=n&&(n+=a.span)}}catch(o){r.e(o)}finally{r.f()}}}]),n}(l),P=function(){function e(t){s(this,e),this.property=t}return c(e,[{key:"decode",value:function(){throw new Error("UnionDiscriminator is abstract")}},{key:"encode",value:function(){throw new Error("UnionDiscriminator is abstract")}}]),e}(),N=function(e){a(n,e);var t=o(n);function n(e,r){var i;if(s(this,n),!(e instanceof h&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");return(i=t.call(this,r||e.property||"variant")).layout=e,i}return c(n,[{key:"decode",value:function(e,t){return this.layout.decode(e,t)}},{key:"encode",value:function(e,t,n){return this.layout.encode(e,t,n)}}]),n}(P),R=function(t){a(i,t);var n=o(i);function i(e,t,a){var o;s(this,i);var c=e instanceof m||e instanceof v;if(c)e=new N(new p(e));else if(e instanceof h&&e.isCount())e=new N(e);else if(!(e instanceof P))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(void 0===t&&(t=null),!(null===t||t instanceof l))throw new TypeError("defaultLayout must be null or a Layout");if(null!==t){if(0>t.span)throw new Error("defaultLayout must have constant span");void 0===t.property&&(t=t.replicate("content"))}var u=-1;t&&0<=(u=t.span)&&c&&(u+=e.layout.span),(o=n.call(this,u,a)).discriminator=e,o.usesPrefixDiscriminator=c,o.defaultLayout=t,o.registry={};var f=o.defaultGetSourceVariant.bind(r(o));return o.getSourceVariant=function(e){return f(e)},o.configGetSourceVariant=function(e){f=e.bind(this)},o}return c(i,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=this.getVariant(e,t);if(!n)throw new Error("unable to determine span for unrecognized variant");return n.getSpan(e,t)}},{key:"defaultGetSourceVariant",value:function(e){if(e.hasOwnProperty(this.discriminator.property)){if(this.defaultLayout&&e.hasOwnProperty(this.defaultLayout.property))return;var t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||e.hasOwnProperty(t.property)))return t}else for(var n in this.registry){var r=this.registry[n];if(e.hasOwnProperty(r.property))return r}throw new Error("unable to infer src variant")}},{key:"decode",value:function(e,t){var n;void 0===t&&(t=0);var r=this.discriminator,i=r.decode(e,t),a=this.registry[i];if(void 0===a){var o=0;a=this.defaultLayout,this.usesPrefixDiscriminator&&(o=r.layout.span),(n=this.makeDestinationObject())[r.property]=i,n[a.property]=this.defaultLayout.decode(e,t+o)}else n=a.decode(e,t);return n}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=this.getSourceVariant(e);if(void 0===r){var i=this.discriminator,a=this.defaultLayout,o=0;return this.usesPrefixDiscriminator&&(o=i.layout.span),i.encode(e[i.property],t,n),o+a.encode(e[a.property],t,n+o)}return r.encode(e,t,n)}},{key:"addVariant",value:function(e,t,n){var r=new z(this,e,t,n);return this.registry[e]=r,r}},{key:"getVariant",value:function(t,n){var r=t;return t instanceof e&&(void 0===n&&(n=0),r=this.discriminator.decode(t,n)),this.registry[r]}}]),i}(l),z=function(e){a(n,e);var t=o(n);function n(e,r,i,a){var o;if(s(this,n),!(e instanceof R))throw new TypeError("union must be a Union");if(!Number.isInteger(r)||0>r)throw new TypeError("variant must be a (non-negative) integer");if("string"===typeof i&&void 0===a&&(a=i,i=null),i){if(!(i instanceof l))throw new TypeError("layout must be a Layout");if(null!==e.defaultLayout&&0<=i.span&&i.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if("string"!==typeof a)throw new TypeError("variant must have a String property")}var c=e.span;return 0>e.span&&0<=(c=i?i.span:0)&&e.usesPrefixDiscriminator&&(c+=e.discriminator.layout.span),(o=t.call(this,c,a)).union=e,o.variant=r,o.layout=i||null,o}return c(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=0;return this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),n+this.layout.getSpan(e,t+n)}},{key:"decode",value:function(e,t){var n=this.makeDestinationObject();if(void 0===t&&(t=0),this!==this.union.getVariant(e,t))throw new Error("variant mismatch");var r=0;return this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout?n[this.property]=this.layout.decode(e,t+r):this.property?n[this.property]=!0:this.union.usesPrefixDiscriminator&&(n[this.union.discriminator.property]=this.variant),n}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=0;if(this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout&&!e.hasOwnProperty(this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,n);var i=r;if(this.layout&&(this.layout.encode(e[this.property],t,n+r),i+=this.layout.getSpan(t,n+r),0<=this.union.span&&i>this.union.span))throw new Error("encoded variant overruns containing union");return i}},{key:"fromArray",value:function(e){if(this.layout)return this.layout.fromArray(e)}}]),n}(l);function L(e){return 0>e&&(e+=4294967296),e}var I=function(e){a(n,e);var t=o(n);function n(e,r,i){var a;if(s(this,n),!(e instanceof m||e instanceof v))throw new TypeError("word must be a UInt or UIntBE layout");if("string"===typeof r&&void 0===i&&(i=r,r=void 0),4=n)throw new TypeError("bits must be positive integer");var i=8*t.span,a=t.fields.reduce((function(e,t){return e+t.bits}),0);if(n+a>i)throw new Error("bits too long for span remainder ("+(i-a)+" of "+i+" remain)");this.container=t,this.bits=n,this.valueMask=(1<>>this.start}},{key:"encode",value:function(e){if(!Number.isInteger(e)||e!==L(e&this.valueMask))throw new TypeError(f("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);var t=this.container._packedGetValue(),n=L(e<n&&(n=this.length.decode(e,t)),n}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=this.span;return 0>n&&(n=this.length.decode(e,t)),e.slice(t,t+n)}},{key:"encode",value:function(t,n,r){var i=this.length;if(this.length instanceof h&&(i=t.length),!(t instanceof e&&i===t.length))throw new TypeError(f("Blob.encode",this)+" requires (length "+i+") Buffer as src");if(r+i>n.length)throw new RangeError("encoding overruns Buffer");return n.write(t.toString("hex"),r,i,"hex"),this.length instanceof h&&this.length.encode(i,n,r),i}}]),r}(l),F=function(t){a(r,t);var n=o(r);function r(e){return s(this,r),n.call(this,-1,e)}return c(r,[{key:"getSpan",value:function(t,n){if(!(t instanceof e))throw new TypeError("b must be a Buffer");void 0===n&&(n=0);for(var r=n;rn.length)throw new RangeError("encoding overruns Buffer");return i.copy(n,r),n[r+a]=0,a+1}}]),r}(l),V=function(t){a(r,t);var n=o(r);function r(e,t){var i;if(s(this,r),"string"===typeof e&&void 0===t&&(t=e,e=void 0),void 0===e)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");return(i=n.call(this,-1,t)).maxSpan=e,i}return c(r,[{key:"getSpan",value:function(t,n){if(!(t instanceof e))throw new TypeError("b must be a Buffer");return void 0===n&&(n=0),t.length-n}},{key:"decode",value:function(e,t,n){void 0===t&&(t=0);var r=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpann.length)throw new RangeError("encoding overruns Buffer");return i.copy(n,r),a}}]),r}(l),U=function(e){a(n,e);var t=o(n);function n(e,r){var i;return s(this,n),(i=t.call(this,0,r)).value=e,i}return c(n,[{key:"decode",value:function(e,t,n){return this.value}},{key:"encode",value:function(e,t,n){return 0}}]),n}(l);t.ExternalLayout=h,t.GreedyCount=d,t.OffsetLayout=p,t.UInt=m,t.UIntBE=v,t.Int=g,t.IntBE=b,t.Float=_,t.FloatBE=S,t.Double=C,t.DoubleBE=j,t.Sequence=T,t.Structure=A,t.UnionDiscriminator=P,t.UnionLayoutDiscriminator=N,t.Union=R,t.VariantLayout=z,t.BitStructure=I,t.BitField=D,t.Boolean=B,t.Blob=H,t.CString=F,t.UTF8=V,t.Constant=U,t.greedy=function(e,t){return new d(e,t)},t.offset=function(e,t,n){return new p(e,t,n)},t.u8=function(e){return new m(1,e)},t.u16=function(e){return new m(2,e)},t.u24=function(e){return new m(3,e)},t.u32=function(e){return new m(4,e)},t.u40=function(e){return new m(5,e)},t.u48=function(e){return new m(6,e)},t.nu64=function(e){return new M(e)},t.u16be=function(e){return new v(2,e)},t.u24be=function(e){return new v(3,e)},t.u32be=function(e){return new v(4,e)},t.u40be=function(e){return new v(5,e)},t.u48be=function(e){return new v(6,e)},t.nu64be=function(e){return new O(e)},t.s8=function(e){return new g(1,e)},t.s16=function(e){return new g(2,e)},t.s24=function(e){return new g(3,e)},t.s32=function(e){return new g(4,e)},t.s40=function(e){return new g(5,e)},t.s48=function(e){return new g(6,e)},t.ns64=function(e){return new k(e)},t.s16be=function(e){return new b(2,e)},t.s24be=function(e){return new b(3,e)},t.s32be=function(e){return new b(4,e)},t.s40be=function(e){return new b(5,e)},t.s48be=function(e){return new b(6,e)},t.ns64be=function(e){return new E(e)},t.f32=function(e){return new _(e)},t.f32be=function(e){return new S(e)},t.f64=function(e){return new C(e)},t.f64be=function(e){return new j(e)},t.struct=function(e,t,n){return new A(e,t,n)},t.bits=function(e,t,n){return new I(e,t,n)},t.seq=function(e,t,n){return new T(e,t,n)},t.union=function(e,t,n){return new R(e,t,n)},t.unionLayoutDiscriminator=function(e,t){return new N(e,t)},t.blob=function(e,t){return new H(e,t)},t.cstr=function(e){return new F(e)},t.utf8=function(e,t){return new V(e,t)},t.const=function(e,t){return new U(e,t)}}).call(this,n(52).Buffer)},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e=[],t=0;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}n.d(t,"a",(function(){return O}));var d=Object.prototype.toString,p=function(e){if(void 0===e)return"undefined";if(null===e)return"null";var t=typeof e;if("boolean"===t)return"boolean";if("string"===t)return"string";if("number"===t)return"number";if("symbol"===t)return"symbol";if("function"===t)return"GeneratorFunction"===m(e)?"generatorfunction":"function";if(function(e){return Array.isArray?Array.isArray(e):e instanceof Array}(e))return"array";if(function(e){if(e.constructor&&"function"===typeof e.constructor.isBuffer)return e.constructor.isBuffer(e);return!1}(e))return"buffer";if(function(e){try{if("number"===typeof e.length&&"function"===typeof e.callee)return!0}catch(t){if(-1!==t.message.indexOf("callee"))return!0}return!1}(e))return"arguments";if(function(e){return e instanceof Date||"function"===typeof e.toDateString&&"function"===typeof e.getDate&&"function"===typeof e.setDate}(e))return"date";if(function(e){return e instanceof Error||"string"===typeof e.message&&e.constructor&&"number"===typeof e.constructor.stackTraceLimit}(e))return"error";if(function(e){return e instanceof RegExp||"string"===typeof e.flags&&"boolean"===typeof e.ignoreCase&&"boolean"===typeof e.multiline&&"boolean"===typeof e.global}(e))return"regexp";switch(m(e)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(function(e){return"function"===typeof e.throw&&"function"===typeof e.return&&"function"===typeof e.next}(e))return"generator";switch(t=d.call(e)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")};function m(e){return"function"===typeof e.constructor?e.constructor.name:null}var v={any:function(e){return void 0!==e},arguments:function(e){return"arguments"===p(e)},array:function(e){return"array"===p(e)},boolean:function(e){return"boolean"===p(e)},buffer:function(e){return"buffer"===p(e)},date:function(e){return"date"===p(e)&&!isNaN(e)},error:function(e){return"error"===p(e)},float32array:function(e){return"float32array"===p(e)},float64array:function(e){return"float64array"===p(e)},function:function(e){return"function"===p(e)},generatorfunction:function(e){return"generatorfunction"===p(e)},int16array:function(e){return"int16array"===p(e)},int32array:function(e){return"int32array"===p(e)},int8array:function(e){return"int8array"===p(e)},map:function(e){return"map"===p(e)},null:function(e){return"null"===p(e)},number:function(e){return"number"===p(e)},object:function(e){return"object"===p(e)},promise:function(e){return"promise"===p(e)},regexp:function(e){return"regexp"===p(e)},set:function(e){return"set"===p(e)},string:function(e){return"string"===p(e)},symbol:function(e){return"symbol"===p(e)},uint16array:function(e){return"uint16array"===p(e)},uint32array:function(e){return"uint32array"===p(e)},uint8array:function(e){return"uint8array"===p(e)},uint8clampedarray:function(e){return"uint8clampedarray"===p(e)},undefined:function(e){return"undefined"===p(e)},weakmap:function(e){return"weakmap"===p(e)},weakset:function(e){return"weakset"===p(e)}};function g(e,t){if(!e)throw new Error("Invariant failed")}var b=function(e){var t,n;function r(t){var n;g(t.length>0);var i=t[0],a=i.path,o=i.value,s=i.type,c=i.branch,u=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(i,["path","value","type","branch"]),l="Expected a value of type `"+s+"`"+(a.length?" for `"+a.join(".")+"`":"")+" but received `"+JSON.stringify(o)+"`.";return(n=e.call(this,l)||this).type=s,n.value=o,Object.assign(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n),u),n.path=a,n.branch=c,n.failures=t,n.stack=(new Error).stack,n.__proto__=r.prototype,n}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,r}(l(TypeError)),y=Symbol("STRUCT"),w=function(e){var t=e.struct.Error,n=function e(t){return e.assert(t)};return Object.defineProperty(n,y,{value:!0}),n.kind=e.kind,n.type=e.type,n.default=function(){return"function"===typeof e.defaults?e.defaults():e.defaults},n.test=function(e){return!n.check(e,[e],[])[0]},n.assert=function(e){var r=n.check(e,[e],[]),i=r[0],a=r[1];if(i)throw new t(i);return a},n.validate=function(e){var r=n.check(e,[e],[]),i=r[0],a=r[1];return i?[new t(i)]:[void 0,a]},n.check=function(e,t,r){return void 0===e&&(e=n.default()),[[n.fail({value:e,branch:t,path:r})]]},n.fail=function(e){return a(a({},e),{},{type:"type"in e?e.type:n.type})},n},x=function(e,t,n){if("function"===typeof(r=e)&&r[y])return e;var r;if(Array.isArray(e)){if(1===e.length){var i=e[0];return n.array([i],t)}if(e.length>1)return n.tuple(e,t)}if("function"===typeof e)return n.function(e,t);if("object"===typeof e)return n.object(e,t);if("string"===typeof e){var a,o=!1;if(e.endsWith("?")&&(o=!0,e=e.slice(0,-1)),e.includes("|")){var s=e.split(/\s*\|\s*/g);a=n.union(s,t)}else if(e.includes("&")){var c=e.split(/\s*&\s*/g);a=n.intersection(c,t)}else a=n.scalar(e,t);return o&&(a=n.union([a,"undefined"],void 0)),a}throw new Error("A schema definition must be an object, array, string or function, but you passed: "+e)},M=function(e,t,n){g(Array.isArray(e)&&0!==e.length);var r=e.map((function(e){return n(e)})),i=r.map((function(e){return e.type})).join(" | "),a=w({kind:"union",type:i,defaults:t,struct:n});return a.check=function(e,t,n){void 0===e&&(e=a.default());for(var i,o=h(r);!(i=o()).done;){var s=i.value.check(e,t,n),c=s[0],u=s[1];if(!c)return[void 0,u]}return[[a.fail({value:e,branch:t,path:n})]]},a},O=function(e){void 0===e&&(e={});var t=function e(t,n){return x(t,n,e)};return t.array=function(e,n){return function(e,t,n){g(Array.isArray(e)&&1===e.length);var r=n(e[0],void 0),i=w({kind:"array",type:r.type+"[]",defaults:t,struct:n});return i.check=function(e,t,n){if(void 0===e&&(e=i.default()),!Array.isArray(e))return[[i.fail({value:e,branch:t,path:n})]];for(var a=[],o=[],s=0;s",defaults:t,struct:n});return r.check=function(t,n,i){return void 0===t&&(t=r.default()),e(t,n,i).check(t,n,i)},r}(e,n,t)},t.enum=function(e,n){return function(e,t,n){g(Array.isArray(e));var r=n((function(t){return e.includes(t)}),t);return r.kind="enum",r.type=e.map((function(e){return"string"===typeof e?'"'+e+'"':""+e})).join(" | "),r}(e,n,t)},t.function=function(e,n){return function(e,t,n){var r=w({kind:"function",type:"function<\u2026>",defaults:t,struct:n});return r.check=function(t,n,i){void 0===t&&(t=r.default());var o=e(t,n,i);if(!0===o)return[void 0,t];var s=[];if(!1===o)s.push(r.fail({value:t,branch:n,path:i}));else if(Array.isArray(o)&&o.length>0)for(var c,u=h(o);!(c=u()).done;){var l=c.value;s.push(r.fail(a({value:t,branch:n,path:i},l)))}else"object"===typeof o?s.push(r.fail(a({value:t,branch:n,path:i},o))):g(!1);return[s]},r}(e,n,t)},t.instance=function(e,n){return function(e,t,n){g("function"===typeof e);var r=n((function(t){return t instanceof e}),t);return r.kind="instance",r.type="instance<"+e.name+">",r}(e,n,t)},t.interface=function(e,n){return function(e,t,n){g("object"===typeof e);var r={};for(var i in e)r[i]=n(e[i]);var a=w({kind:"interface",type:"interface<{"+Object.keys(e).join()+"}>",defaults:t,struct:n});return a.check=function(e,t,n){if(void 0===e&&(e=a.default()),"object"!==typeof e&&"function"!==typeof e)return[[a.fail({value:e,branch:t,path:n})]];var i=[];for(var o in r){var s=r[o],c=e[o],u=s.check(c,t.concat(c),n.concat(o))[0];u&&i.push.apply(i,u)}return i.length?[i]:[void 0,e]},a}(e,n,t)},t.intersection=function(e,n){return function(e,t,n){g(Array.isArray(e)&&0!==e.length);var r=e.map((function(e){return n(e)})),i=r.map((function(e){return e.type})).join(" & "),a=w({kind:"intersection",type:i,defaults:t,struct:n});return a.check=function(e,t,n){void 0===e&&(e=a.default());for(var i,o=e,s=h(r);!(i=s()).done;){var c=i.value.check(e,t,n),u=c[0],l=c[1];if(u)return[[a.fail({value:e,branch:t,path:n})]];o=l}return[void 0,o]},a}(e,n,t)},t.lazy=function(e,n){return function(e,t,n){g("function"===typeof e);var r=w({kind:"lazy",type:"lazy<\u2026>",defaults:t,struct:n});return r.check=function(){return Object.assign(r,e()),r.check.apply(r,arguments)},r}(e,n,t)},t.literal=function(e,n){return function(e,t,n){var r=n((function(t){return t===e}),t);return r.kind="literal",r.type="string"===typeof e?'"'+e+'"':""+e,r}(e,n,t)},t.object=function(e,n){return function(e,t,n){g("object"===typeof e);var r={};for(var i in e)r[i]=n(e[i]);var a=w({kind:"object",type:"{"+Object.keys(e).join()+"}",defaults:t,struct:n});return a.check=function(e,t,n){void 0===e&&(e=a.default());var i=a.default();if(void 0===e&&(e=i),"object"!==p(e))return[[a.fail({value:e,branch:t,path:n})]];for(var o,s={},c=[],u=h(new Set(Object.keys(r).concat(Object.keys(e))));!(o=u()).done;){var l=o.value,f=e[l],d=n.concat(l),m=t.concat(f),v=r[l];if(void 0===f&&null!=i&&l in i&&(f="function"===typeof i[l]?i[l](e,t,n):i[l]),l in r){var g=v.check(f,m,d),b=g[0],y=g[1];b?c.push.apply(c,b):void 0!==y&&l in r&&(s[l]=y)}else c.push(a.fail({type:void 0,value:f,path:d,branch:e}))}return c.length?[c]:[void 0,s]},a}(e,n,t)},t.optional=function(e,n){return M([e,"undefined"],n,t)},t.partial=function(e,n){return function(e,t,n){g("object"===typeof e);var r={};for(var i in e)r[i]=n.union([e[i],"undefined"]);var a=w({kind:"object",type:"{"+Object.keys(e).join()+"}",defaults:t,struct:n});return a.check=function(e,t,n){void 0===e&&(e=a.default());var i=a.default();if(void 0===e&&(e=i),"object"!==p(e))return[[a.fail({value:e,branch:t,path:n})]];for(var o,s={},c=[],u=h(e);!(o=u()).done;){var l=o.value,f=e[l],d=n.concat(l),m=t.concat(f),v=r[l];if(void 0===f&&null!=i&&l in i&&(f="function"===typeof i[l]?i[l](e,t,n):i[l]),l in r){var g=v.check(f,m,d),b=g[0],y=g[1];b?c.push.apply(c,b):void 0!==y&&l in r&&(s[l]=y)}else c.push(a.fail({type:void 0,value:f,path:d,branch:e}))}return c.length?[c]:[void 0,s]},a}(e,n,t)},t.pick=function(e,n){return function(e,t,n){g("object"===typeof e);var r={};for(var i in e)r[i]=n(e[i]);var a=w({kind:"pick",type:"pick<{"+Object.keys(e).join()+"}>",defaults:t,struct:n});return a.check=function(e,t,n){void 0===e&&(e=a.default());var i=a.default();if(void 0===e&&(e=i),"object"!==p(e))return[[a.fail({value:e,branch:t,path:n})]];var o={},s=[];for(var c in r){var u=e[c],l=n.concat(c),f=t.concat(u),h=r[c];void 0===u&&null!=i&&c in i&&(u="function"===typeof i[c]?i[c](e,t,n):i[c]);var d=h.check(u,f,l),m=d[0],v=d[1];m?s.push.apply(s,m):void 0!==v&&c in r&&(o[c]=v)}return s.length?[s]:[void 0,o]},a}(e,n,t)},t.record=function(e,n){return function(e,t,n){g(Array.isArray(e)&&2===e.length);var r=n(e[0]),i=n(e[1]),o=w({kind:"record",type:"record<"+r.type+","+i.type+">",defaults:t,struct:n});return o.check=function(e,t,n){var s=o.default();if(e=s?a(a({},s),e):e,"object"!==p(e))return[[o.fail({value:e,branch:t,path:n})]];var c={},u=[];for(var l in e){var f=e[l],h=n.concat(l),d=t.concat(f),m=r.check(l,d,h),v=m[0],g=m[1];if(v)u.push.apply(u,v);else{var b=i.check(f,d,h),y=b[0],w=b[1];y?u.push.apply(u,y):c[g]=w}}return u.length?[u]:[void 0,c]},o}(e,n,t)},t.scalar=function(e,n){return function(e,t,n){g("string"===typeof e);var r=n.Types;g(e in r);var i=n(r[e],t);return i.kind="scalar",i.type=e,i}(e,n,t)},t.size=function(e,n){return function(e,t,n){g(Array.isArray(e)&&2===e.length&&e.every((function(e){return"number"===typeof e})));var r=e[0],i=e[1],a=n((function(e){return null!=e&&"number"===typeof e.length&&e.length>=r&&e.length<=i}),t);return a.kind="size",a.type="size<"+r+","+i+">",a}(e,n,t)},t.tuple=function(e,n){return function(e,t,n){g(Array.isArray(e));var r=e.map((function(e){return n(e)})),i=w({kind:"tuple",type:"["+r.map((function(e){return e.type})).join()+"]",defaults:t,struct:n});return i.check=function(e,t,n){if(void 0===e&&(e=i.default()),!Array.isArray(e))return[[i.fail({value:e,branch:t,path:n})]];for(var a=[],o=[],s=Math.max(e.length,r.length),c=0;c=0;u--)if(l[u]!==f[u])return!1;for(u=l.length-1;u>=0;u--)if(s=l[u],!y(e[s],t[s],n,r))return!1;return!0}(e,t,n,r))}return n?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function x(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(n){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function M(e,t,n,r){var i;if("function"!==typeof t)throw new TypeError('"block" argument must be a function');"string"===typeof n&&(r=n,n=null),i=function(e){var t;try{e()}catch(n){t=n}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!i&&g(i,n,"Missing expected exception"+r);var a="string"===typeof r,s=!e&&i&&!n;if((!e&&o.isError(i)&&a&&x(i,n)||s)&&g(i,n,"Got unwanted exception"+r),e&&i&&n&&!x(i,n)||!e&&i)throw i}h.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return m(v(e.actual),128)+" "+e.operator+" "+m(v(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var r=n.stack,i=p(t),a=r.indexOf("\n"+i);if(a>=0){var o=r.indexOf("\n",a+1);r=r.substring(o+1)}this.stack=r}}},o.inherits(h.AssertionError,Error),h.fail=g,h.ok=b,h.equal=function(e,t,n){e!=t&&g(e,t,n,"==",h.equal)},h.notEqual=function(e,t,n){e==t&&g(e,t,n,"!=",h.notEqual)},h.deepEqual=function(e,t,n){y(e,t,!1)||g(e,t,n,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(e,t,n){y(e,t,!0)||g(e,t,n,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(e,t,n){y(e,t,!1)&&g(e,t,n,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function e(t,n,r){y(t,n,!0)&&g(t,n,r,"notDeepStrictEqual",e)},h.strictEqual=function(e,t,n){e!==t&&g(e,t,n,"===",h.strictEqual)},h.notStrictEqual=function(e,t,n){e===t&&g(e,t,n,"!==",h.notStrictEqual)},h.throws=function(e,t,n){M(!0,e,t,n)},h.doesNotThrow=function(e,t,n){M(!1,e,t,n)},h.ifError=function(e){if(e)throw e},h.strict=r((function e(t,n){t||g(t,!0,n,"==",e)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var O=Object.keys||function(e){var t=[];for(var n in e)s.call(e,n)&&t.push(n);return t}}).call(this,n(71))},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){e.exports=n(377)},function(e,t){function n(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(u){return void n(u)}s.done?t(c):Promise.resolve(c).then(r,i)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,c,"next",e)}function c(e){n(o,i,a,s,c,"throw",e)}s(void 0)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(230);var i=n(301),a=n(201);function o(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||Object(i.a)(e)||Object(a.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";var r={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var t=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=r.F1&&t<=r.F12)return!1;switch(t){case r.ALT:case r.CAPS_LOCK:case r.CONTEXT_MENU:case r.CTRL:case r.DOWN:case r.END:case r.ESC:case r.HOME:case r.INSERT:case r.LEFT:case r.MAC_FF_META:case r.META:case r.NUMLOCK:case r.NUM_CENTER:case r.PAGE_DOWN:case r.PAGE_UP:case r.PAUSE:case r.PRINT_SCREEN:case r.RIGHT:case r.SHIFT:case r.UP:case r.WIN_KEY:case r.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=r.ZERO&&e<=r.NINE)return!0;if(e>=r.NUM_ZERO&&e<=r.NUM_MULTIPLY)return!0;if(e>=r.A&&e<=r.Z)return!0;if(-1!==window.navigator.userAgent.indexOf("WebKit")&&0===e)return!0;switch(e){case r.SPACE:case r.QUESTION_MARK:case r.NUM_PLUS:case r.NUM_MINUS:case r.NUM_PERIOD:case r.NUM_DIVISION:case r.SEMICOLON:case r.DASH:case r.EQUALS:case r.COMMA:case r.PERIOD:case r.SLASH:case r.APOSTROPHE:case r.SINGLE_QUOTE:case r.OPEN_SQUARE_BRACKET:case r.BACKSLASH:case r.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}};t.a=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){for(var n=0;n32)throw new Error("Invalid public key input")}return s()(t,[{key:"equals",value:function(e){return this._bn.eq(e._bn)}},{key:"toBase58",value:function(){return y.a.encode(this.toBuffer())}},{key:"toBuffer",value:function(){var t=this._bn.toArrayLike(e);if(32===t.length)return t;var n=e.alloc(32);return t.copy(n,32-t.length),n}},{key:"toString",value:function(){return this.toBase58()}}],[{key:"createWithSeed",value:function(){var n=m()(d.a.mark((function n(r,i,a){var o,s;return d.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=e.concat([r.toBuffer(),e.from(i),a.toBuffer()]),n.next=3,Object(w.sha256)(new Uint8Array(o));case 3:return s=n.sent,n.abrupt("return",new t(e.from(s,"hex")));case 5:case"end":return n.stop()}}),n)})));return function(e,t,r){return n.apply(this,arguments)}}()},{key:"createProgramAddress",value:function(){var n=m()(d.a.mark((function n(r,i){var a,o,s;return d.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=e.alloc(0),r.forEach((function(t){if(t.length>q)throw new Error("Max seed length exceeded");a=e.concat([a,e.from(t)])})),a=e.concat([a,i.toBuffer(),e.from("ProgramDerivedAddress")]),n.next=5,Object(w.sha256)(new Uint8Array(a));case 5:if(o=n.sent,!K(s=new g.a(o,16).toArray(null,32))){n.next=9;break}throw new Error("Invalid seeds, address must fall off the curve");case 9:return n.abrupt("return",new t(s));case 10:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}()},{key:"findProgramAddress",value:function(){var t=m()(d.a.mark((function t(n,r){var i,a,o;return d.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=255;case 1:if(0==i){t.next=16;break}return t.prev=2,o=n.concat(e.from([i])),t.next=6,this.createProgramAddress(o,r);case 6:a=t.sent,t.next=13;break;case 9:return t.prev=9,t.t0=t.catch(2),i--,t.abrupt("continue",1);case 13:return t.abrupt("return",[a,i]);case 16:throw new Error("Unable to find a viable program address nonce");case 17:case"end":return t.stop()}}),t,this,[[2,9]])})));return function(e,n){return t.apply(this,arguments)}}()}]),t}();function K(e){var t=[W.gf(),W.gf(),W.gf(),W.gf()],n=W.gf(),r=W.gf(),i=W.gf(),a=W.gf(),o=W.gf(),s=W.gf(),c=W.gf();return W.set25519(t[2],Y),W.unpack25519(t[1],e),W.S(i,t[1]),W.M(a,i,W.D),W.Z(i,i,t[2]),W.A(a,t[2],a),W.S(o,a),W.S(s,o),W.M(c,s,o),W.M(n,c,i),W.M(n,n,a),W.pow2523(n,n),W.M(n,n,i),W.M(n,n,a),W.M(n,n,a),W.M(t[0],n,a),W.S(r,t[0]),W.M(r,r,a),Z(r,i)&&W.M(t[0],t[0],X),W.S(r,t[0]),W.M(r,r,a),Z(r,i)?0:1}var Y=W.gf([1]),X=W.gf([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Z(e,t){var n=new Uint8Array(32),r=new Uint8Array(32);return W.pack25519(n,e),W.pack25519(r,t),W.crypto_verify_32(n,0,r,0)}var J=function(){function e(t){a()(this,e),u()(this,"_keypair",void 0),this._keypair=t?f.a.sign.keyPair.fromSecretKey(U(t)):f.a.sign.keyPair()}return s()(e,[{key:"publicKey",get:function(){return new G(this._keypair.publicKey)}},{key:"secretKey",get:function(){return this._keypair.secretKey}}]),e}(),Q=new G("BPFLoader1111111111111111111111111111111111"),$=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"publicKey";return Object(x.blob)(32,e)},ee=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"string",n=Object(x.struct)([Object(x.u32)("length"),Object(x.u32)("lengthPadding"),Object(x.blob)(Object(x.offset)(Object(x.u32)(),-8),"chars")],t),r=n.decode.bind(n),i=n.encode.bind(n);return n.decode=function(e,t){return r(e,t).chars.toString("utf8")},n.encode=function(t,n,r){var a={chars:e.from(t,"utf8")};return i(a,n,r)},n.alloc=function(t){return Object(x.u32)().span+Object(x.u32)().span+e.from(t,"utf8").length},n};function te(e){for(var t=0,n=0;;){var r=e.shift();if(t|=(127&r)<<7*n,n+=1,0===(128&r))break}return t}function ne(e,t){for(var n=t;;){var r=127&n;if(0==(n>>=7)){e.push(r);break}r|=128,e.push(r)}}var re=function(){function t(e){a()(this,t),u()(this,"header",void 0),u()(this,"accountKeys",void 0),u()(this,"recentBlockhash",void 0),u()(this,"instructions",void 0),this.header=e.header,this.accountKeys=e.accountKeys.map((function(e){return new G(e)})),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions}return s()(t,[{key:"isAccountWritable",value:function(e){return e=this.header.numRequiredSignatures&&e=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?this.signatures[0].signature:null}}]),s()(t,[{key:"add",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r0&&this.signatures[0].publicKey))throw new Error("Transaction fee payer required");t=this.signatures[0].publicKey}var r=[],i=[];this.instructions.forEach((function(e){e.keys.forEach((function(e){i.push(function(e){for(var t=1;t-1?a[n].isWritable=a[n].isWritable||e.isWritable:a.push(e)}));var o=a.findIndex((function(e){return e.pubkey.equals(t)}));if(o>-1){var s=a.splice(o,1),c=E()(s,1)[0];c.isSigner=!0,c.isWritable=!0,a.unshift(c)}else a.unshift({pubkey:t,isSigner:!0,isWritable:!0});var l,f=ie(this.signatures);try{var h=function(){var e=l.value,t=a.findIndex((function(t){return t.pubkey.equals(e.publicKey)}));if(!(t>-1))throw new Error("unknown signer: ".concat(e.publicKey.toString()));a[t].isSigner||(a[t].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."))};for(f.s();!(l=f.n()).done;)h()}catch(x){f.e(x)}finally{f.f()}var d=0,p=0,m=0,v=[],g=[];a.forEach((function(e){var t=e.pubkey,n=e.isSigner,r=e.isWritable;n?(v.push(t.toString()),d+=1,r||(p+=1)):(g.push(t.toString()),r||(m+=1))}));var b=v.concat(g),w=this.instructions.map((function(e){var t=e.data,n=e.programId;return{programIdIndex:b.indexOf(n.toString()),accounts:e.keys.map((function(e){return b.indexOf(e.pubkey.toString())})),data:y.a.encode(t)}}));return w.forEach((function(e){S()(e.programIdIndex>=0),e.accounts.forEach((function(e){return S()(e>=0)}))})),new re({header:{numRequiredSignatures:d,numReadonlySignedAccounts:p,numReadonlyUnsignedAccounts:m},accountKeys:b,recentBlockhash:n,instructions:w})}},{key:"_compile",value:function(){var e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);if(this.signatures.length===t.length&&this.signatures.every((function(e,n){return t[n].equals(e.publicKey)})))return e;return this.signatures=t.map((function(e){return{signature:null,publicKey:e}})),e}},{key:"serializeMessage",value:function(){return this._compile().serialize()}},{key:"setSigners",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1?r-1:0),a=1;a ").concat(ce)),a}},{key:"keys",get:function(){return S()(1===this.instructions.length),this.instructions[0].keys.map((function(e){return e.pubkey}))}},{key:"programId",get:function(){return S()(1===this.instructions.length),this.instructions[0].programId}},{key:"data",get:function(){return S()(1===this.instructions.length),this.instructions[0].data}}],[{key:"from",value:function(n){for(var r=O()(n),i=te(r),a=[],o=0;o0&&(r.feePayer=e.accountKeys[0]),n.forEach((function(t,n){var i={signature:t==y.a.encode(se)?null:y.a.decode(t),publicKey:e.accountKeys[n]};r.signatures.push(i)})),e.instructions.forEach((function(t){var n=t.accounts.map((function(t){var n=e.accountKeys[t];return{pubkey:n,isSigner:r.signatures.some((function(e){return e.publicKey.toString()===n.toString()})),isWritable:e.isAccountWritable(t)}}));r.instructions.push(new ue({keys:n,programId:e.accountKeys[t.programIdIndex],data:y.a.decode(t.data)}))})),r}}]),t}(),fe=new G("SysvarC1ock11111111111111111111111111111111"),he=new G("SysvarRecentB1ockHashes11111111111111111111"),de=new G("SysvarRent111111111111111111111111111111111"),pe=new G("SysvarRewards111111111111111111111111111111"),me=new G("SysvarStakeHistory1111111111111111111111111"),ve=new G("Sysvar1nstructions1111111111111111111111111"),ge=Object(x.nu64)("lamportsPerSignature"),be=Object(x.struct)([Object(x.u32)("version"),Object(x.u32)("state"),$("authorizedPubkey"),$("nonce"),Object(x.struct)([ge],"feeCalculator")]),ye=be.span,we=function(){function e(){a()(this,e),u()(this,"authorizedPubkey",void 0),u()(this,"nonce",void 0),u()(this,"feeCalculator",void 0)}return s()(e,null,[{key:"fromAccountData",value:function(e){var t=be.decode(U(e),0);return t.authorizedPubkey=new G(t.authorizedPubkey),t.nonce=new G(t.nonce).toString(),t}}]),e}();function xe(e){return new Promise((function(t){return setTimeout(t,e)}))}function Me(e,t){var n,r=new Promise((function(e){n=setTimeout((function(){return e(null)}),t)}));return Promise.race([e,r]).then((function(e){return clearTimeout(n),e}))}var Oe=function(){function e(t){a()(this,e),u()(this,"_agent",void 0),u()(this,"_activeRequests",0),u()(this,"_destroyTimeout",null),u()(this,"_useHttps",void 0),this._useHttps=!0===t,this._agent=e._newAgent(this._useHttps)}return s()(e,null,[{key:"_newAgent",value:function(e){var t={keepAlive:!0,maxSockets:25};return e?new D.a.Agent(t):new L.a.Agent(t)}}]),s()(e,[{key:"requestStart",value:function(){if(!r.browser)return this._activeRequests++,clearTimeout(this._destroyTimeout),this._destroyTimeout=null,this._agent}},{key:"requestEnd",value:function(){var t=this;r.browser||(this._activeRequests--,0===this._activeRequests&&null===this._destroyTimeout&&(this._destroyTimeout=setTimeout((function(){t._agent.destroy(),t._agent=e._newAgent(t._useHttps)}),5e3)))}}]),e}();function ke(e,t){var n;if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"===typeof e)return Ee(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ee(e,t)}(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=3e4,null===this._blockhashInfo.recentBlockhash||n){e.next=9;break}return e.abrupt("return",this._blockhashInfo.recentBlockhash);case 9:return e.next=11,this._pollNewBlockhash();case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_pollNewBlockhash",value:function(){var e=m()(d.a.mark((function e(){var t,n,r,i;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._pollingBlockhash=!0,e.prev=1,t=Date.now(),n=0;case 4:if(!(n<50)){e.next=17;break}return e.next=7,this.getRecentBlockhash("max");case 7:if(r=e.sent,i=r.blockhash,this._blockhashInfo.recentBlockhash==i){e.next=12;break}return this._blockhashInfo={recentBlockhash:i,lastFetch:new Date,transactionSignatures:[],simulatedSignatures:[]},e.abrupt("return",i);case 12:return e.next=14,xe(200);case 14:n++,e.next=4;break;case 17:throw new Error("Unable to obtain a new blockhash after ".concat(Date.now()-t,"ms"));case 18:return e.prev=18,this._pollingBlockhash=!1,e.finish(18);case 21:case"end":return e.stop()}}),e,this,[[1,,18,21]])})));return function(){return e.apply(this,arguments)}}()},{key:"simulateTransaction",value:function(){var e=m()(d.a.mark((function e(t,n){var r,i,a,o,s,c,u,l,f;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.nonceInfo||!n){e.next=4;break}t.sign.apply(t,O()(n)),e.next=22;break;case 4:r=this._disableBlockhashCaching;case 5:return e.next=7,this._recentBlockhash(r);case 7:if(t.recentBlockhash=e.sent,n){e.next=10;break}return e.abrupt("break",22);case 10:if(t.sign.apply(t,O()(n)),t.signature){e.next=13;break}throw new Error("!signature");case 13:if(i=t.signature.toString("base64"),this._blockhashInfo.simulatedSignatures.includes(i)||this._blockhashInfo.transactionSignatures.includes(i)){e.next=19;break}return this._blockhashInfo.simulatedSignatures.push(i),e.abrupt("break",22);case 19:r=!0;case 20:e.next=5;break;case 22:return a=t.serializeMessage(),o=t._serialize(a),s=o.toString("base64"),u=[s,c={encoding:"base64"}],n&&(c.sigVerify=!0),e.next=30,this._rpcRequest("simulateTransaction",u);case 30:if(l=e.sent,!(f=De(l)).error){e.next=34;break}throw new Error("failed to simulate transaction: "+f.error.message);case 34:return S()("undefined"!==typeof f.result),S()(f.result),e.abrupt("return",f.result);case 37:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"sendTransaction",value:function(){var e=m()(d.a.mark((function e(t,n,r){var i,a,o;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.nonceInfo){e.next=4;break}t.sign.apply(t,O()(n)),e.next=20;break;case 4:i=this._disableBlockhashCaching;case 5:return e.next=7,this._recentBlockhash(i);case 7:if(t.recentBlockhash=e.sent,t.sign.apply(t,O()(n)),t.signature){e.next=11;break}throw new Error("!signature");case 11:if(a=t.signature.toString("base64"),this._blockhashInfo.transactionSignatures.includes(a)){e.next=17;break}return this._blockhashInfo.transactionSignatures.push(a),e.abrupt("break",20);case 17:i=!0;case 18:e.next=5;break;case 20:return o=t.serialize(),e.next=23,this.sendRawTransaction(o,r);case 23:return e.abrupt("return",e.sent);case 24:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"validatorExit",value:function(){var e=m()(d.a.mark((function e(){var t,n;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("validatorExit",[]);case 2:if(t=e.sent,!(n=je("boolean")(t)).error){e.next=6;break}throw new Error("validator exit failed: "+n.error.message);case 6:return S()("undefined"!==typeof n.result),e.abrupt("return",n.result);case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"sendRawTransaction",value:function(){var e=m()(d.a.mark((function e(t,n){var r,i;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=U(t).toString("base64"),e.next=3,this.sendEncodedTransaction(r,n);case 3:return i=e.sent,e.abrupt("return",i);case 5:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"sendEncodedTransaction",value:function(){var e=m()(d.a.mark((function e(t,n){var r,i,a,o,s,c,u,l;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=[t,r={encoding:"base64"}],a=n&&n.skipPreflight,o=n&&n.preflightCommitment,!a||!o){e.next=6;break}throw new Error("cannot set preflightCommitment when skipPreflight is enabled");case 6:return a?r.skipPreflight=a:o&&(r.preflightCommitment=o),e.next=9,this._rpcRequest("sendTransaction",i);case 9:if(s=e.sent,!(c=Dt(s)).error){e.next=14;break}throw c.error.data&&(u=c.error.data.logs)&&Array.isArray(u)&&("\n ",l="\n "+u.join("\n "),console.error(c.error.message,l)),new Error("failed to send transaction: "+c.error.message);case 14:return S()("undefined"!==typeof c.result),S()(c.result),e.abrupt("return",c.result);case 17:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"_wsOnOpen",value:function(){var e=this;this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval((function(){e._rpcWebSocket.notify("ping").catch((function(){}))}),5e3),this._updateSubscriptions()}},{key:"_wsOnError",value:function(e){console.error("ws error:",e.message)}},{key:"_wsOnClose",value:function(e){clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null,1e3!==e?this._resetSubscriptions():this._updateSubscriptions()}},{key:"_subscribe",value:function(){var e=m()(d.a.mark((function e(t,n,r){var i;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.subscriptionId){e.next=13;break}return t.subscriptionId="subscribing",e.prev=2,e.next=5,this._rpcWebSocket.call(n,r);case 5:i=e.sent,"subscribing"===t.subscriptionId&&(t.subscriptionId=i),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(2),"subscribing"===t.subscriptionId&&(t.subscriptionId=null),console.error("".concat(n," error for argument"),r,e.t0.message);case 13:case"end":return e.stop()}}),e,this,[[2,9]])})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"_unsubscribe",value:function(){var e=m()(d.a.mark((function e(t,n){var r,i;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==(r=t.subscriptionId)||"string"==typeof r){e.next=11;break}return i=r,e.prev=3,e.next=6,this._rpcWebSocket.call(n,[i]);case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(3),console.error("".concat(n," error:"),e.t0.message);case 11:case"end":return e.stop()}}),e,this,[[3,8]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"_resetSubscriptions",value:function(){Object.values(this._accountChangeSubscriptions).forEach((function(e){return e.subscriptionId=null})),Object.values(this._programAccountChangeSubscriptions).forEach((function(e){return e.subscriptionId=null})),Object.values(this._signatureSubscriptions).forEach((function(e){return e.subscriptionId=null})),Object.values(this._slotSubscriptions).forEach((function(e){return e.subscriptionId=null})),Object.values(this._rootSubscriptions).forEach((function(e){return e.subscriptionId=null}))}},{key:"_updateSubscriptions",value:function(){var e=this,t=Object.keys(this._accountChangeSubscriptions).map(Number),n=Object.keys(this._programAccountChangeSubscriptions).map(Number),r=Object.keys(this._slotSubscriptions).map(Number),i=Object.keys(this._signatureSubscriptions).map(Number),a=Object.keys(this._rootSubscriptions).map(Number);if(0!==t.length||0!==n.length||0!==r.length||0!==i.length||0!==a.length)if(null!==this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),this._rpcWebSocketConnected){var o,s=ke(t);try{for(s.s();!(o=s.n()).done;){var c=o.value,u=this._accountChangeSubscriptions[c];this._subscribe(u,"accountSubscribe",this._buildArgs([u.publicKey],u.commitment,"base64"))}}catch(_){s.e(_)}finally{s.f()}var l,f=ke(n);try{for(f.s();!(l=f.n()).done;){var h=l.value,d=this._programAccountChangeSubscriptions[h];this._subscribe(d,"programSubscribe",this._buildArgs([d.programId],d.commitment,"base64"))}}catch(_){f.e(_)}finally{f.f()}var p,m=ke(r);try{for(m.s();!(p=m.n()).done;){var v=p.value,g=this._slotSubscriptions[v];this._subscribe(g,"slotSubscribe",[])}}catch(_){m.e(_)}finally{m.f()}var b,y=ke(i);try{for(y.s();!(b=y.n()).done;){var w=b.value,x=this._signatureSubscriptions[w];this._subscribe(x,"signatureSubscribe",this._buildArgs([x.signature],x.commitment))}}catch(_){y.e(_)}finally{y.f()}var M,O=ke(a);try{for(O.s();!(M=O.n()).done;){var k=M.value,E=this._rootSubscriptions[k];this._subscribe(E,"rootSubscribe",[])}}catch(_){O.e(_)}finally{O.f()}}else this._rpcWebSocket.connect();else this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout((function(){e._rpcWebSocketIdleTimeout=null,e._rpcWebSocket.close()}),500))}},{key:"_wsOnAccountNotification",value:function(t){var n=ut(t);if(n.error)throw new Error("account notification failed: "+n.error.message);S()("undefined"!==typeof n.result);var r,i=ke(Object.keys(this._accountChangeSubscriptions).map(Number));try{for(i.s();!(r=i.n()).done;){var a=r.value,o=this._accountChangeSubscriptions[a];if(o.subscriptionId===n.subscription){var s=n.result,c=s.value,u=s.context;return S()("base64"===c.data[1]),o.callback({executable:c.executable,owner:new G(c.owner),lamports:c.lamports,data:e.from(c.data[0],"base64")},u),!0}}}catch(l){i.e(l)}finally{i.f()}}},{key:"onAccountChange",value:function(e,t,n){var r=++this._accountChangeSubscriptionCounter;return this._accountChangeSubscriptions[r]={publicKey:e.toBase58(),callback:t,commitment:n,subscriptionId:null},this._updateSubscriptions(),r}},{key:"removeAccountChangeListener",value:function(){var e=m()(d.a.mark((function e(t){var n;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._accountChangeSubscriptions[t]){e.next=8;break}return n=this._accountChangeSubscriptions[t],delete this._accountChangeSubscriptions[t],e.next=5,this._unsubscribe(n,"accountUnsubscribe");case 5:this._updateSubscriptions(),e.next=9;break;case 8:throw new Error("Unknown account change id: ".concat(t));case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_wsOnProgramAccountNotification",value:function(t){var n=ht(t);if(n.error)throw new Error("program account notification failed: "+n.error.message);S()("undefined"!==typeof n.result);var r,i=ke(Object.keys(this._programAccountChangeSubscriptions).map(Number));try{for(i.s();!(r=i.n()).done;){var a=r.value,o=this._programAccountChangeSubscriptions[a];if(o.subscriptionId===n.subscription){var s=n.result,c=s.value,u=s.context;return S()("base64"===c.account.data[1]),o.callback({accountId:c.pubkey,accountInfo:{executable:c.account.executable,owner:new G(c.account.owner),lamports:c.account.lamports,data:e.from(c.account.data[0],"base64")}},u),!0}}}catch(l){i.e(l)}finally{i.f()}}},{key:"onProgramAccountChange",value:function(e,t,n){var r=++this._programAccountChangeSubscriptionCounter;return this._programAccountChangeSubscriptions[r]={programId:e.toBase58(),callback:t,commitment:n,subscriptionId:null},this._updateSubscriptions(),r}},{key:"removeProgramAccountChangeListener",value:function(){var e=m()(d.a.mark((function e(t){var n;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._programAccountChangeSubscriptions[t]){e.next=8;break}return n=this._programAccountChangeSubscriptions[t],delete this._programAccountChangeSubscriptions[t],e.next=5,this._unsubscribe(n,"programUnsubscribe");case 5:this._updateSubscriptions(),e.next=9;break;case 8:throw new Error("Unknown program account change id: ".concat(t));case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_wsOnSlotNotification",value:function(e){var t=pt(e);if(t.error)throw new Error("slot notification failed: "+t.error.message);S()("undefined"!==typeof t.result);var n,r=t.result,i=r.parent,a=r.slot,o=r.root,s=ke(Object.keys(this._slotSubscriptions).map(Number));try{for(s.s();!(n=s.n()).done;){var c=n.value,u=this._slotSubscriptions[c];if(u.subscriptionId===t.subscription)return u.callback({parent:i,slot:a,root:o}),!0}}catch(l){s.e(l)}finally{s.f()}}},{key:"onSlotChange",value:function(e){var t=++this._slotSubscriptionCounter;return this._slotSubscriptions[t]={callback:e,subscriptionId:null},this._updateSubscriptions(),t}},{key:"removeSlotChangeListener",value:function(){var e=m()(d.a.mark((function e(t){var n;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._slotSubscriptions[t]){e.next=8;break}return n=this._slotSubscriptions[t],delete this._slotSubscriptions[t],e.next=5,this._unsubscribe(n,"slotUnsubscribe");case 5:this._updateSubscriptions(),e.next=9;break;case 8:throw new Error("Unknown slot change id: ".concat(t));case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_buildArgs",value:function(e,t,n,r){var i=t||this._commitment;if(i||n||r){var a={};n&&(a.encoding=n),i&&(a.commitment=i),r&&(a=Object.assign(a,r)),e.push(a)}return e}},{key:"_wsOnSignatureNotification",value:function(e){var t=mt(e);if(t.error)throw new Error("signature notification failed: "+t.error.message);S()("undefined"!==typeof t.result);var n,r=ke(Object.keys(this._signatureSubscriptions).map(Number));try{for(r.s();!(n=r.n()).done;){var i=n.value,a=this._signatureSubscriptions[i];if(a.subscriptionId===t.subscription)return delete this._signatureSubscriptions[i],this._updateSubscriptions(),void a.callback(t.result.value,t.result.context)}}catch(o){r.e(o)}finally{r.f()}}},{key:"onSignature",value:function(e,t,n){var r=++this._signatureSubscriptionCounter;return this._signatureSubscriptions[r]={signature:e,callback:t,commitment:n,subscriptionId:null},this._updateSubscriptions(),r}},{key:"removeSignatureListener",value:function(){var e=m()(d.a.mark((function e(t){var n;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._signatureSubscriptions[t]){e.next=8;break}return n=this._signatureSubscriptions[t],delete this._signatureSubscriptions[t],e.next=5,this._unsubscribe(n,"signatureUnsubscribe");case 5:this._updateSubscriptions(),e.next=9;break;case 8:throw new Error("Unknown signature result id: ".concat(t));case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_wsOnRootNotification",value:function(e){var t=vt(e);if(t.error)throw new Error("root notification failed: "+t.error.message);S()("undefined"!==typeof t.result);var n,r=t.result,i=ke(Object.keys(this._rootSubscriptions).map(Number));try{for(i.s();!(n=i.n()).done;){var a=n.value,o=this._rootSubscriptions[a];if(o.subscriptionId===t.subscription)return o.callback(r),!0}}catch(s){i.e(s)}finally{i.f()}}},{key:"onRootChange",value:function(e){var t=++this._rootSubscriptionCounter;return this._rootSubscriptions[t]={callback:e,subscriptionId:null},this._updateSubscriptions(),t}},{key:"removeRootChangeListener",value:function(){var e=m()(d.a.mark((function e(t){var n;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._rootSubscriptions[t]){e.next=8;break}return n=this._rootSubscriptions[t],delete this._rootSubscriptions[t],e.next=5,this._unsubscribe(n,"rootUnsubscribe");case 5:this._updateSubscriptions(),e.next=9;break;case 8:throw new Error("Unknown root change id: ".concat(t));case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"commitment",get:function(){return this._commitment}}]),t}();function Ht(e,t,n,r){return Ft.apply(this,arguments)}function Ft(){return(Ft=m()(d.a.mark((function e(t,n,r,i){var a,o;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.sendTransaction(n,r,i);case 2:return a=e.sent,e.next=5,t.confirmTransaction(a,i&&i.commitment);case 5:if(!(o=e.sent.value).err){e.next=8;break}throw new Error("Transaction ".concat(a," failed (").concat(JSON.stringify(o),")"));case 8:return e.abrupt("return",a);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Vt(t,n){var r=t.layout.span>=0?t.layout.span:function(e,t){var n=0;return e.layout.fields.forEach((function(e){e.span>=0?n+=e.span:"function"===typeof e.alloc&&(n+=e.alloc(t[e.property]))})),n}(t,n),i=e.alloc(r),a=Object.assign({instruction:t.index},n);return t.layout.encode(a,i),i}function Ut(e,t){var n;try{n=e.layout.decode(t)}catch(r){throw new Error("invalid instruction; "+r)}if(n.instruction!==e.index)throw new Error("invalid instruction; instruction index mismatch ".concat(n.instruction," != ").concat(e.index));return n}var Wt=function(){function e(){a()(this,e)}return s()(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=Object(x.u32)("instruction").decode(e.data),r=0,i=Object.keys(qt);r0?c:1,space:s.length,programId:o}));case 17:if(null===l){n.next=20;break}return n.next=20,Ht(r,l,[i,a],{commitment:"singleGossip",skipPreflight:!0});case 20:f=Object(x.struct)([Object(x.u32)("instruction"),Object(x.u32)("offset"),Object(x.u32)("bytesLength"),Object(x.u32)("bytesLengthPadding"),Object(x.seq)(Object(x.u8)("byte"),Object(x.offset)(Object(x.u32)(),-8),"bytes")]),h=t.chunkSize,p=0,m=s,v=[];case 25:if(!(m.length>0)){n.next=39;break}if(g=m.slice(0,h),b=e.alloc(h+16),f.encode({instruction:0,offset:p,bytes:g},b),y=(new le).add({keys:[{pubkey:a.publicKey,isSigner:!0,isWritable:!0}],programId:o,data:b}),v.push(Ht(r,y,[i,a],{commitment:"singleGossip",skipPreflight:!0})),!r._rpcEndpoint.includes("solana.com")){n.next=35;break}return 4,n.next=35,xe(250);case 35:p+=h,m=m.slice(h),n.next=25;break;case 39:return n.next=41,Promise.all(v);case 41:return w=Object(x.struct)([Object(x.u32)("instruction")]),M=e.alloc(w.span),w.encode({instruction:1},M),O=(new le).add({keys:[{pubkey:a.publicKey,isSigner:!0,isWritable:!0},{pubkey:de,isSigner:!1,isWritable:!1}],programId:o,data:M}),n.next=47,Ht(r,O,[i,a],{commitment:"singleGossip",skipPreflight:!0});case 47:return n.abrupt("return",!0);case 48:case"end":return n.stop()}}),n)})));return function(e,t,r,i,a){return n.apply(this,arguments)}}()},{key:"chunkSize",get:function(){return ce-300}}]),t}(),Yt=new G("BPFLoader2111111111111111111111111111111111"),Xt=function(){function e(){a()(this,e)}return s()(e,null,[{key:"getMinNumSignatures",value:function(e){return Kt.getMinNumSignatures(e)}},{key:"load",value:function(e,t,n,r,i){return Kt.load(e,t,n,i,r)}}]),e}(),Zt=new G("StakeConfig11111111111111111111111111111111"),Jt=function e(t,n){a()(this,e),u()(this,"staker",void 0),u()(this,"withdrawer",void 0),this.staker=t,this.withdrawer=n},Qt=function e(t,n,r){a()(this,e),u()(this,"unixTimestamp",void 0),u()(this,"epoch",void 0),u()(this,"custodian",void 0),this.unixTimestamp=t,this.epoch=n,this.custodian=r},$t=function(){function e(){a()(this,e)}return s()(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=Object(x.u32)("instruction").decode(e.data),r=0,i=Object.keys(en);r0&&void 0!==arguments[0]?arguments[0]:"authorized";return Object(x.struct)([$("staker"),$("withdrawer")],e)}(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"lockup";return Object(x.struct)([Object(x.ns64)("unixTimestamp"),Object(x.ns64)("epoch"),$("custodian")],e)}()])},Authorize:{index:1,layout:Object(x.struct)([Object(x.u32)("instruction"),$("newAuthorized"),Object(x.u32)("stakeAuthorizationType")])},Delegate:{index:2,layout:Object(x.struct)([Object(x.u32)("instruction")])},Split:{index:3,layout:Object(x.struct)([Object(x.u32)("instruction"),Object(x.ns64)("lamports")])},Withdraw:{index:4,layout:Object(x.struct)([Object(x.u32)("instruction"),Object(x.ns64)("lamports")])},Deactivate:{index:5,layout:Object(x.struct)([Object(x.u32)("instruction")])},AuthorizeWithSeed:{index:8,layout:Object(x.struct)([Object(x.u32)("instruction"),$("newAuthorized"),Object(x.u32)("stakeAuthorizationType"),ee("authoritySeed"),$("authorityOwner")])}}),tn=Object.freeze({Staker:{index:0},Withdrawer:{index:1}}),nn=function(){function e(){a()(this,e)}return s()(e,null,[{key:"initialize",value:function(e){var t=e.stakePubkey,n=e.authorized,r=e.lockup,i=Vt(en.Initialize,{authorized:{staker:n.staker.toBuffer(),withdrawer:n.withdrawer.toBuffer()},lockup:{unixTimestamp:r.unixTimestamp,epoch:r.epoch,custodian:r.custodian.toBuffer()}}),a={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:de,isSigner:!1,isWritable:!1}],programId:this.programId,data:i};return new ue(a)}},{key:"createAccountWithSeed",value:function(e){var t=new le;t.add(Gt.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));var n=e.stakePubkey,r=e.authorized,i=e.lockup;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}},{key:"createAccount",value:function(e){var t=new le;t.add(Gt.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));var n=e.stakePubkey,r=e.authorized,i=e.lockup;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}},{key:"delegate",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.votePubkey,i=Vt(en.Delegate);return(new le).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!1},{pubkey:fe,isSigner:!1,isWritable:!1},{pubkey:me,isSigner:!1,isWritable:!1},{pubkey:Zt,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}},{key:"authorize",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.newAuthorizedPubkey,i=e.stakeAuthorizationType,a=Vt(en.Authorize,{newAuthorized:r.toBuffer(),stakeAuthorizationType:i.index});return(new le).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:fe,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}},{key:"authorizeWithSeed",value:function(e){var t=e.stakePubkey,n=e.authorityBase,r=e.authoritySeed,i=e.authorityOwner,a=e.newAuthorizedPubkey,o=e.stakeAuthorizationType,s=Vt(en.AuthorizeWithSeed,{newAuthorized:a.toBuffer(),stakeAuthorizationType:o.index,authoritySeed:r,authorityOwner:i.toBuffer()});return(new le).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:s})}},{key:"split",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.splitStakePubkey,i=e.lamports,a=new le;a.add(Gt.createAccount({fromPubkey:n,newAccountPubkey:r,lamports:0,space:this.space,programId:this.programId}));var o=Vt(en.Split,{lamports:i});return a.add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}},{key:"withdraw",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.toPubkey,i=e.lamports,a=Vt(en.Withdraw,{lamports:i});return(new le).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:fe,isSigner:!1,isWritable:!1},{pubkey:me,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}},{key:"deactivate",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=Vt(en.Deactivate);return(new le).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:fe,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}},{key:"programId",get:function(){return new G("Stake11111111111111111111111111111111111111")}},{key:"space",get:function(){return 200}}]),e}(),rn=H.a.publicKeyCreate,an=H.a.ecdsaSign,on=Object(x.struct)([Object(x.u8)("numSignatures"),Object(x.u16)("signatureOffset"),Object(x.u8)("signatureInstructionIndex"),Object(x.u16)("ethAddressOffset"),Object(x.u8)("ethAddressInstructionIndex"),Object(x.u16)("messageDataOffset"),Object(x.u16)("messageDataSize"),Object(x.u8)("messageInstructionIndex"),Object(x.blob)(20,"ethPublicKey"),Object(x.blob)(64,"signature"),Object(x.u8)("recoveryId")]),sn=function(){function t(){a()(this,t)}return s()(t,null,[{key:"createInstructionWithPublicKey",value:function(n){var r,i=n.publicKey,a=n.message,o=n.signature,s=n.recoveryId;S()(65===i.length,"Public key must be ".concat(65," bytes"));try{r=function(e){return V()("keccak256").update(U(e.slice(1))).digest().slice(-20)}(i)}catch(f){throw new Error("Error constructing ethereum public key: ".concat(f))}var c=12+r.length,u=c+o.length+1,l=e.alloc(on.span+a.length);return on.encode({numSignatures:1,signatureOffset:c,signatureInstructionIndex:0,ethAddressOffset:12,ethAddressInstructionIndex:0,messageDataOffset:u,messageDataSize:a.length,messageInstructionIndex:0,signature:U(o),ethPublicKey:r,recoveryId:s},l),l.fill(U(a),on.span),new ue({keys:[],programId:t.programId,data:l})}},{key:"createInstructionWithPrivateKey",value:function(e){var t=e.privateKey,n=e.message;S()(32===t.length,"Private key must be ".concat(32," bytes"));try{var r=rn(t,!1),i=V()("keccak256").update(U(n)).digest(),a=an(i,t),o=a.signature,s=a.recid;return this.createInstructionWithPublicKey({publicKey:r,message:n,signature:o,recoveryId:s})}catch(c){throw new Error("Error creating instruction; ".concat(c))}}},{key:"programId",get:function(){return new G("KeccakSecp256k11111111111111111111111111111")}}]),t}();var cn=new G("Va1idator1nfo111111111111111111111111111111"),un=Object(N.a)({name:"string",website:"string?",details:"string?",keybaseUsername:"string?"}),ln=function(){function t(e,n){a()(this,t),u()(this,"key",void 0),u()(this,"info",void 0),this.key=e,this.info=n}return s()(t,null,[{key:"fromConfigData",value:function(n){var r=O()(n);if(2!==te(r))return null;for(var i=[],a=0;a<2;a++){var o=new G(r.slice(0,32)),s=1===(r=r.slice(32)).slice(0,1)[0];r=r.slice(1),i.push({publicKey:o,isSigner:s})}if(i[0].publicKey.equals(cn)&&i[1].isSigner){var c=ee().decode(e.from(r)),u=un(JSON.parse(c));return new t(i[1].publicKey,u)}return null}}]),t}(),fn=new G("Vote111111111111111111111111111111111111111"),hn=Object(x.struct)([$("nodePubkey"),$("authorizedVoterPubkey"),$("authorizedWithdrawerPubkey"),Object(x.u8)("commission"),Object(x.nu64)(),Object(x.seq)(Object(x.struct)([Object(x.nu64)("slot"),Object(x.u32)("confirmationCount")]),Object(x.offset)(Object(x.u32)(),-8),"votes"),Object(x.u8)("rootSlotValid"),Object(x.nu64)("rootSlot"),Object(x.nu64)("epoch"),Object(x.nu64)("credits"),Object(x.nu64)("lastEpochCredits"),Object(x.nu64)(),Object(x.seq)(Object(x.struct)([Object(x.nu64)("epoch"),Object(x.nu64)("credits"),Object(x.nu64)("prevCredits")]),Object(x.offset)(Object(x.u32)(),-8),"epochCredits")]),dn=function(){function e(){a()(this,e),u()(this,"nodePubkey",void 0),u()(this,"authorizedVoterPubkey",void 0),u()(this,"authorizedWithdrawerPubkey",void 0),u()(this,"commission",void 0),u()(this,"votes",void 0),u()(this,"rootSlot",void 0),u()(this,"epoch",void 0),u()(this,"credits",void 0),u()(this,"lastEpochCredits",void 0),u()(this,"epochCredits",void 0)}return s()(e,null,[{key:"fromAccountData",value:function(e){var t=hn.decode(U(e),0);return t.nodePubkey=new G(t.nodePubkey),t.authorizedVoterPubkey=new G(t.authorizedVoterPubkey),t.authorizedWithdrawerPubkey=new G(t.authorizedWithdrawerPubkey),t.rootSlotValid||(t.rootSlot=null),t}}]),e}();function pn(e,t,n){return mn.apply(this,arguments)}function mn(){return(mn=m()(d.a.mark((function e(t,n,r){var i,a;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.sendRawTransaction(n,r);case 2:return i=e.sent,e.next=5,t.confirmTransaction(i,r&&r.commitment);case 5:if(!(a=e.sent.value).err){e.next=8;break}throw new Error("Raw transaction ".concat(i," failed (").concat(JSON.stringify(a),")"));case 8:return e.abrupt("return",i);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var vn={http:{devnet:"http://devnet.solana.com",testnet:"http://testnet.solana.com","mainnet-beta":"http://api.mainnet-beta.solana.com"},https:{devnet:"https://devnet.solana.com",testnet:"https://testnet.solana.com","mainnet-beta":"https://api.mainnet-beta.solana.com"}};function gn(e,t){var n=!1===t?"http":"https";if(!e)return vn[n].devnet;var r=vn[n][e];if(!r)throw new Error("Unknown ".concat(n," cluster: ").concat(e));return r}var bn=1e9}.call(this,n(52).Buffer,n(90))},function(e,t,n){"use strict";n.d(t,"a",(function(){return x}));var r=n(3),i=n(0),a=n(205),o=n(91),s=n(104),c=n(16),u=n(17),l=n(18),f=n(19),h=n(29),d=n(157),p=n(229),m=function(e){Object(l.a)(n,e);var t=Object(f.a)(n);function n(e){var r;return Object(c.a)(this,n),r=t.call(this,e),Object(d.a)(e.locale&&e.locale.Modal),Object(h.a)("internalMark"===e._ANT_MARK__,"LocaleProvider","`LocaleProvider` is deprecated. Please use `locale` with `ConfigProvider` instead: http://u.ant.design/locale"),r}return Object(u.a)(n,[{key:"componentDidUpdate",value:function(e){var t=this.props.locale;e.locale!==t&&Object(d.a)(t&&t.Modal)}},{key:"componentWillUnmount",value:function(){Object(d.a)()}},{key:"render",value:function(){var e=this.props,t=e.locale,n=e.children;return i.createElement(p.a.Provider,{value:Object(r.a)(Object(r.a)({},t),{exist:!0})},n)}}]),n}(i.Component);m.defaultProps={locale:{}};var v=n(53),g=n(62),b=n(50),y=n(257),w=n(258),x=["getTargetContainer","getPopupContainer","rootPrefixCls","getPrefixCls","renderEmpty","csp","autoInsertSpaceInButton","locale","pageHeader"],M=["getTargetContainer","getPopupContainer","renderEmpty","pageHeader","input","form"],O=function(e){var t=e.children,n=e.csp,c=e.autoInsertSpaceInButton,u=e.form,l=e.locale,f=e.componentSize,h=e.direction,d=e.space,p=e.virtual,v=e.dropdownMatchSelectWidth,y=e.legacyLocale,w=e.parentContext,x=e.iconPrefixCls,O=i.useCallback((function(t,n){var r=e.prefixCls;if(n)return n;var i=r||w.getPrefixCls("");return t?"".concat(i,"-").concat(t):i}),[w.getPrefixCls]),k=Object(r.a)(Object(r.a)({},w),{csp:n,autoInsertSpaceInButton:c,locale:l||y,direction:h,space:d,virtual:p,dropdownMatchSelectWidth:v,getPrefixCls:O});M.forEach((function(t){var n=e[t];n&&(k[t]=n)}));var E=Object(s.a)((function(){return k}),k,(function(e,t){var n=Object.keys(e),r=Object.keys(t);return n.length!==r.length||n.some((function(n){return e[n]!==t[n]}))})),_=i.useMemo((function(){return{prefixCls:x}}),[x]),S=t,C={};return l&&l.Form&&l.Form.defaultValidateMessages&&(C=l.Form.defaultValidateMessages),u&&u.validateMessages&&(C=Object(r.a)(Object(r.a)({},C),u.validateMessages)),Object.keys(C).length>0&&(S=i.createElement(o.b,{validateMessages:C},t)),l&&(S=i.createElement(m,{locale:l,_ANT_MARK__:"internalMark"},S)),x&&(S=i.createElement(a.a.Provider,{value:_},S)),f&&(S=i.createElement(b.a,{size:f},S)),i.createElement(g.b.Provider,{value:E},S)},k=function(e){return i.useEffect((function(){e.direction&&(y.b.config({rtl:"rtl"===e.direction}),w.a.config({rtl:"rtl"===e.direction}))}),[e.direction]),i.createElement(v.a,null,(function(t,n,a){return i.createElement(g.a,null,(function(t){return i.createElement(O,Object(r.a)({parentContext:t,legacyLocale:a},e))}))}))};k.ConfigContext=g.b,k.SizeContext=b.b;t.b=k},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(115);function i(e,t){if(null==e)return{};var n,i,a=Object(r.a)(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},,function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return s}));var r={};function i(e,t){0}function a(e,t){0}function o(e,t,n){t||r[n]||(e(!1,n),r[n]=!0)}function s(e,t){o(a,e,t)}t.a=function(e,t){o(i,e,t)}},function(e,t,n){"use strict";var r=n(28);t.a=function(e,t,n){Object(r.a)(e,"[antd: ".concat(t,"] ").concat(n))}},function(e,t,n){"use strict";function r(e,t){for(var n=0;n>8&255]+Jn[e>>16&255]+Jn[e>>24&255]+"-"+Jn[255&t]+Jn[t>>8&255]+"-"+Jn[t>>16&15|64]+Jn[t>>24&255]+"-"+Jn[63&n|128]+Jn[n>>8&255]+"-"+Jn[n>>16&255]+Jn[n>>24&255]+Jn[255&r]+Jn[r>>8&255]+Jn[r>>16&255]+Jn[r>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},damp:function(e,t,n,r){return tr.lerp(e,t,1-Math.exp(-n*r))},pingpong:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t-Math.abs(tr.euclideanModulo(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){return void 0!==e&&(er=e%2147483647),((er=16807*er%2147483647)-1)/2147483646},degToRad:function(e){return e*tr.DEG2RAD},radToDeg:function(e){return e*tr.RAD2DEG},isPowerOfTwo:function(e){return 0===(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,r,i){var a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),u=a((t+r)/2),l=o((t+r)/2),f=a((t-r)/2),h=o((t-r)/2),d=a((r-t)/2),p=o((r-t)/2);switch(i){case"XYX":e.set(s*l,c*f,c*h,s*u);break;case"YZY":e.set(c*h,s*l,c*f,s*u);break;case"ZXZ":e.set(c*f,c*h,s*l,s*u);break;case"XZX":e.set(s*l,c*p,c*d,s*u);break;case"YXY":e.set(c*d,s*l,c*p,s*u);break;case"ZYZ":e.set(c*p,c*d,s*l,s*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}},nr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(m.a)(this,e),Object.defineProperty(this,"isVector2",{value:!0}),this.x=t,this.y=n}return Object(v.a)(e,[{key:"width",get:function(){return this.x},set:function(e){this.x=e}},{key:"height",get:function(){return this.y},set:function(e){this.y=e}},{key:"set",value:function(e,t){return this.x=e,this.y=t,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this}},{key:"add",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"applyMatrix3",value:function(e){var t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y}},{key:"cross",value:function(e){return this.x*e.y-this.y*e.x}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"angle",value:function(){var e=Math.atan2(-this.y,-this.x)+Math.PI;return e}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}},{key:"lerpVectors",value:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e}},{key:"fromBufferAttribute",value:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}},{key:"rotateAround",value:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this}}]),e}(),rr=function(){function e(){Object(m.a)(this,e),Object.defineProperty(this,"isMatrix3",{value:!0}),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}return Object(v.a)(e,[{key:"set",value:function(e,t,n,r,i,a,o,s,c){var u=this.elements;return u[0]=e,u[1]=r,u[2]=o,u[3]=t,u[4]=i,u[5]=s,u[6]=n,u[7]=a,u[8]=c,this}},{key:"identity",value:function(){return this.set(1,0,0,0,1,0,0,0,1),this}},{key:"clone",value:function(){return(new this.constructor).fromArray(this.elements)}},{key:"copy",value:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}},{key:"extractBasis",value:function(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}},{key:"setFromMatrix4",value:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}},{key:"multiply",value:function(e){return this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],u=n[4],l=n[7],f=n[2],h=n[5],d=n[8],p=r[0],m=r[3],v=r[6],g=r[1],b=r[4],y=r[7],w=r[2],x=r[5],M=r[8];return i[0]=a*p+o*g+s*w,i[3]=a*m+o*b+s*x,i[6]=a*v+o*y+s*M,i[1]=c*p+u*g+l*w,i[4]=c*m+u*b+l*x,i[7]=c*v+u*y+l*M,i[2]=f*p+h*g+d*w,i[5]=f*m+h*b+d*x,i[8]=f*v+h*y+d*M,this}},{key:"multiplyScalar",value:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}},{key:"determinant",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],u=e[8];return t*a*u-t*o*c-n*i*u+n*o*s+r*i*c-r*a*s}},{key:"invert",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],u=e[8],l=u*a-o*c,f=o*s-u*i,h=c*i-a*s,d=t*l+n*f+r*h;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);var p=1/d;return e[0]=l*p,e[1]=(r*c-u*n)*p,e[2]=(o*n-r*a)*p,e[3]=f*p,e[4]=(u*t-r*s)*p,e[5]=(r*i-o*t)*p,e[6]=h*p,e[7]=(n*s-c*t)*p,e[8]=(a*t-n*i)*p,this}},{key:"transpose",value:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}},{key:"getNormalMatrix",value:function(e){return this.setFromMatrix4(e).copy(this).invert().transpose()}},{key:"transposeIntoArray",value:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}},{key:"setUvTransform",value:function(e,t,n,r,i,a,o){var s=Math.cos(i),c=Math.sin(i);return this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1),this}},{key:"scale",value:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}},{key:"rotate",value:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],a=r[3],o=r[6],s=r[1],c=r[4],u=r[7];return r[0]=t*i+n*s,r[3]=t*a+n*c,r[6]=t*o+n*u,r[1]=-n*i+t*s,r[4]=-n*a+t*c,r[7]=-n*o+t*u,this}},{key:"translate",value:function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}},{key:"equals",value:function(e){for(var t=this.elements,n=e.elements,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<9;n++)this.elements[n]=e[n+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}}]),e}(),ir={getDataURL:function(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;var t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===$n&&($n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),$n.width=e.width,$n.height=e.height;var n=$n.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=$n}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}},ar=0;function or(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:or.DEFAULT_IMAGE,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:or.DEFAULT_MAPPING,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:_e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:_e,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Ne,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Le,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Qe,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:De,c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1,u=arguments.length>9&&void 0!==arguments[9]?arguments[9]:fn;Object.defineProperty(this,"id",{value:ar++}),this.uuid=tr.generateUUID(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=s,this.offset=new nr(0,0),this.repeat=new nr(1,1),this.center=new nr(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new rr,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.version=0,this.onUpdate=null}function sr(e){return"undefined"!==typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&e instanceof ImageBitmap?ir.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}or.DEFAULT_IMAGE=void 0,or.DEFAULT_MAPPING=be,or.prototype=Object.assign(Object.create(Zn.prototype),{constructor:or,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=void 0===e||"string"===typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=tr.generateUUID()),!t&&void 0===e.images[r.uuid]){var i;if(Array.isArray(r)){i=[];for(var a=0,o=r.length;a1)switch(this.wrapS){case Ee:e.x=e.x-Math.floor(e.x);break;case _e:e.x=e.x<0?0:1;break;case Se:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case Ee:e.y=e.y-Math.floor(e.y);break;case _e:e.y=e.y<0?0:1;break;case Se:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(or.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}});var cr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;Object(m.a)(this,e),Object.defineProperty(this,"isVector4",{value:!0}),this.x=t,this.y=n,this.z=r,this.w=i}return Object(v.a)(e,[{key:"width",get:function(){return this.z},set:function(e){this.z=e}},{key:"height",get:function(){return this.w},set:function(e){this.w=e}},{key:"set",value:function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setW",value:function(e){return this.w=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z,this.w)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}},{key:"add",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}},{key:"applyMatrix4",value:function(e){var t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"setAxisAngleFromQuaternion",value:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}},{key:"setAxisAngleFromRotationMatrix",value:function(e){var t,n,r,i,a=e.elements,o=a[0],s=a[4],c=a[8],u=a[1],l=a[5],f=a[9],h=a[2],d=a[6],p=a[10];if(Math.abs(s-u)<.01&&Math.abs(c-h)<.01&&Math.abs(f-d)<.01){if(Math.abs(s+u)<.1&&Math.abs(c+h)<.1&&Math.abs(f+d)<.1&&Math.abs(o+l+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;var m=(o+1)/2,v=(l+1)/2,g=(p+1)/2,b=(s+u)/4,y=(c+h)/4,w=(f+d)/4;return m>v&&m>g?m<.01?(n=0,r=.707106781,i=.707106781):(r=b/(n=Math.sqrt(m)),i=y/n):v>g?v<.01?(n=.707106781,r=0,i=.707106781):(n=b/(r=Math.sqrt(v)),i=w/r):g<.01?(n=.707106781,r=.707106781,i=0):(n=y/(i=Math.sqrt(g)),r=w/i),this.set(n,r,i,t),this}var x=Math.sqrt((d-f)*(d-f)+(c-h)*(c-h)+(u-s)*(u-s));return Math.abs(x)<.001&&(x=1),this.x=(d-f)/x,this.y=(c-h)/x,this.z=(u-s)/x,this.w=Math.acos((o+l+p-1)/2),this}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}},{key:"lerpVectors",value:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}},{key:"fromBufferAttribute",value:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}]),e}(),ur=function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(e,r,i){var a;return Object(m.a)(this,n),a=t.call(this),Object.defineProperty(Object(h.a)(a),"isWebGLRenderTarget",{value:!0}),a.width=e,a.height=r,a.scissor=new cr(0,0,e,r),a.scissorTest=!1,a.viewport=new cr(0,0,e,r),i=i||{},a.texture=new or(void 0,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),a.texture.image={},a.texture.image.width=e,a.texture.image.height=r,a.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,a.texture.minFilter=void 0!==i.minFilter?i.minFilter:Ne,a.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,a.stencilBuffer=void 0!==i.stencilBuffer&&i.stencilBuffer,a.depthTexture=void 0!==i.depthTexture?i.depthTexture:null,a}return Object(v.a)(n,[{key:"setSize",value:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}}]),n}(Zn),lr=function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(e,r,i){var a;return Object(m.a)(this,n),a=t.call(this,e,r,i),Object.defineProperty(Object(h.a)(a),"isWebGLMultisampleRenderTarget",{value:!0}),a.samples=4,a}return Object(v.a)(n,[{key:"copy",value:function(e){return Object(l.a)(Object(f.a)(n.prototype),"copy",this).call(this,e),this.samples=e.samples,this}}]),n}(ur),fr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;Object(m.a)(this,e),Object.defineProperty(this,"isQuaternion",{value:!0}),this._x=t,this._y=n,this._z=r,this._w=i}return Object(v.a)(e,[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}},{key:"set",value:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._w)}},{key:"copy",value:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}},{key:"setFromEuler",value:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,c=o(n/2),u=o(r/2),l=o(i/2),f=s(n/2),h=s(r/2),d=s(i/2);switch(a){case"XYZ":this._x=f*u*l+c*h*d,this._y=c*h*l-f*u*d,this._z=c*u*d+f*h*l,this._w=c*u*l-f*h*d;break;case"YXZ":this._x=f*u*l+c*h*d,this._y=c*h*l-f*u*d,this._z=c*u*d-f*h*l,this._w=c*u*l+f*h*d;break;case"ZXY":this._x=f*u*l-c*h*d,this._y=c*h*l+f*u*d,this._z=c*u*d+f*h*l,this._w=c*u*l-f*h*d;break;case"ZYX":this._x=f*u*l-c*h*d,this._y=c*h*l+f*u*d,this._z=c*u*d-f*h*l,this._w=c*u*l+f*h*d;break;case"YZX":this._x=f*u*l+c*h*d,this._y=c*h*l+f*u*d,this._z=c*u*d-f*h*l,this._w=c*u*l-f*h*d;break;case"XZY":this._x=f*u*l-c*h*d,this._y=c*h*l-f*u*d,this._z=c*u*d+f*h*l,this._w=c*u*l+f*h*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!1!==t&&this._onChangeCallback(),this}},{key:"setFromAxisAngle",value:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],u=t[6],l=t[10],f=n+o+l;if(f>0){var h=.5/Math.sqrt(f+1);this._w=.25/h,this._x=(u-s)*h,this._y=(i-c)*h,this._z=(a-r)*h}else if(n>o&&n>l){var d=2*Math.sqrt(1+n-o-l);this._w=(u-s)/d,this._x=.25*d,this._y=(r+a)/d,this._z=(i+c)/d}else if(o>l){var p=2*Math.sqrt(1+o-n-l);this._w=(i-c)/p,this._x=(r+a)/p,this._y=.25*p,this._z=(s+u)/p}else{var m=2*Math.sqrt(1+l-n-o);this._w=(a-r)/m,this._x=(i+c)/m,this._y=(s+u)/m,this._z=.25*m}return this._onChangeCallback(),this}},{key:"setFromUnitVectors",value:function(e,t){var n=e.dot(t)+1;return n<1e-6?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}},{key:"angleTo",value:function(e){return 2*Math.acos(Math.abs(tr.clamp(this.dot(e),-1,1)))}},{key:"rotateTowards",value:function(e,t){var n=this.angleTo(e);if(0===n)return this;var r=Math.min(1,t/n);return this.slerp(e,r),this}},{key:"identity",value:function(){return this.set(0,0,0,1)}},{key:"invert",value:function(){return this.conjugate()}},{key:"conjugate",value:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}},{key:"dot",value:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}},{key:"lengthSq",value:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}},{key:"length",value:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}},{key:"normalize",value:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}},{key:"multiply",value:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}},{key:"premultiply",value:function(e){return this.multiplyQuaternions(e,this)}},{key:"multiplyQuaternions",value:function(e,t){var n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,u=t._w;return this._x=n*u+a*o+r*c-i*s,this._y=r*u+a*s+i*o-n*c,this._z=i*u+a*c+n*s-r*o,this._w=a*u-n*o-r*s-i*c,this._onChangeCallback(),this}},{key:"slerp",value:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,a=this._w,o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;var s=1-o*o;if(s<=Number.EPSILON){var c=1-t;return this._w=c*a+t*this._w,this._x=c*n+t*this._x,this._y=c*r+t*this._y,this._z=c*i+t*this._z,this.normalize(),this._onChangeCallback(),this}var u=Math.sqrt(s),l=Math.atan2(u,o),f=Math.sin((1-t)*l)/u,h=Math.sin(t*l)/u;return this._w=a*f+this._w*h,this._x=n*f+this._x*h,this._y=r*f+this._y*h,this._z=i*f+this._z*h,this._onChangeCallback(),this}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}},{key:"fromBufferAttribute",value:function(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}}],[{key:"slerp",value:function(e,t,n,r){return n.copy(e).slerp(t,r)}},{key:"slerpFlat",value:function(e,t,n,r,i,a,o){var s=n[r+0],c=n[r+1],u=n[r+2],l=n[r+3],f=i[a+0],h=i[a+1],d=i[a+2],p=i[a+3];if(l!==p||s!==f||c!==h||u!==d){var m=1-o,v=s*f+c*h+u*d+l*p,g=v>=0?1:-1,b=1-v*v;if(b>Number.EPSILON){var y=Math.sqrt(b),w=Math.atan2(y,v*g);m=Math.sin(m*w)/y,o=Math.sin(o*w)/y}var x=o*g;if(s=s*m+f*x,c=c*m+h*x,u=u*m+d*x,l=l*m+p*x,m===1-o){var M=1/Math.sqrt(s*s+c*c+u*u+l*l);s*=M,c*=M,u*=M,l*=M}}e[t]=s,e[t+1]=c,e[t+2]=u,e[t+3]=l}},{key:"multiplyQuaternionsFlat",value:function(e,t,n,r,i,a){var o=n[r],s=n[r+1],c=n[r+2],u=n[r+3],l=i[a],f=i[a+1],h=i[a+2],d=i[a+3];return e[t]=o*d+u*l+s*h-c*f,e[t+1]=s*d+u*f+c*l-o*h,e[t+2]=c*d+u*h+o*f-s*l,e[t+3]=u*d-o*l-s*f-c*h,e}}]),e}(),hr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;Object(m.a)(this,e),Object.defineProperty(this,"isVector3",{value:!0}),this.x=t,this.y=n,this.z=r}return Object(v.a)(e,[{key:"set",value:function(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}},{key:"add",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}},{key:"multiply",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this}},{key:"multiplyVectors",value:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}},{key:"applyEuler",value:function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(pr.setFromEuler(e))}},{key:"applyAxisAngle",value:function(e,t){return this.applyQuaternion(pr.setFromAxisAngle(e,t))}},{key:"applyMatrix3",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}},{key:"applyNormalMatrix",value:function(e){return this.applyMatrix3(e).normalize()}},{key:"applyMatrix4",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}},{key:"applyQuaternion",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=s*t+a*r-o*n,u=s*n+o*t-i*r,l=s*r+i*n-a*t,f=-i*t-a*n-o*r;return this.x=c*s+f*-i+u*-o-l*-a,this.y=u*s+f*-a+l*-i-c*-o,this.z=l*s+f*-o+c*-a-u*-i,this}},{key:"project",value:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}},{key:"unproject",value:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}},{key:"transformDirection",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}},{key:"lerpVectors",value:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}},{key:"cross",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}},{key:"crossVectors",value:function(e,t){var n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}},{key:"projectOnVector",value:function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}},{key:"projectOnPlane",value:function(e){return dr.copy(this).projectOnVector(e),this.sub(dr)}},{key:"reflect",value:function(e){return this.sub(dr.copy(e).multiplyScalar(2*this.dot(e)))}},{key:"angleTo",value:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var n=this.dot(e)/t;return Math.acos(tr.clamp(n,-1,1))}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}},{key:"setFromSpherical",value:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}},{key:"setFromSphericalCoords",value:function(e,t,n){var r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}},{key:"setFromCylindrical",value:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}},{key:"setFromCylindricalCoords",value:function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}},{key:"setFromMatrixPosition",value:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}},{key:"setFromMatrixScale",value:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}},{key:"setFromMatrixColumn",value:function(e,t){return this.fromArray(e.elements,4*t)}},{key:"setFromMatrix3Column",value:function(e,t){return this.fromArray(e.elements,3*t)}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}},{key:"fromBufferAttribute",value:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}]),e}(),dr=new hr,pr=new fr,mr=function(){function e(t,n){Object(m.a)(this,e),Object.defineProperty(this,"isBox3",{value:!0}),this.min=void 0!==t?t:new hr(1/0,1/0,1/0),this.max=void 0!==n?n:new hr(-1/0,-1/0,-1/0)}return Object(v.a)(e,[{key:"set",value:function(e,t){return this.min.copy(e),this.max.copy(t),this}},{key:"setFromArray",value:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,c=e.length;si&&(i=u),l>a&&(a=l),f>o&&(o=f)}return this.min.set(t,n,r),this.max.set(i,a,o),this}},{key:"setFromBufferAttribute",value:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,c=e.count;si&&(i=u),l>a&&(a=l),f>o&&(o=f)}return this.min.set(t,n,r),this.max.set(i,a,o),this}},{key:"setFromPoints",value:function(e){this.makeEmpty();for(var t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}},{key:"containsBox",value:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}},{key:"getParameter",value:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new hr),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}},{key:"intersectsBox",value:function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}},{key:"intersectsSphere",value:function(e){return this.clampPoint(e.center,br),br.distanceToSquared(e.center)<=e.radius*e.radius}},{key:"intersectsPlane",value:function(e){var t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}},{key:"intersectsTriangle",value:function(e){if(this.isEmpty())return!1;this.getCenter(_r),Sr.subVectors(this.max,_r),wr.subVectors(e.a,_r),xr.subVectors(e.b,_r),Mr.subVectors(e.c,_r),Or.subVectors(xr,wr),kr.subVectors(Mr,xr),Er.subVectors(wr,Mr);var t=[0,-Or.z,Or.y,0,-kr.z,kr.y,0,-Er.z,Er.y,Or.z,0,-Or.x,kr.z,0,-kr.x,Er.z,0,-Er.x,-Or.y,Or.x,0,-kr.y,kr.x,0,-Er.y,Er.x,0];return!!vr(t,wr,xr,Mr,Sr)&&(!!vr(t=[1,0,0,0,1,0,0,0,1],wr,xr,Mr,Sr)&&(Cr.crossVectors(Or,kr),vr(t=[Cr.x,Cr.y,Cr.z],wr,xr,Mr,Sr)))}},{key:"clampPoint",value:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new hr),t.copy(e).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(e){return br.copy(e).clamp(this.min,this.max).sub(e).length()}},{key:"getBoundingSphere",value:function(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(br).length(),e}},{key:"intersect",value:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}},{key:"union",value:function(e){return this.min.min(e.min),this.max.max(e.max),this}},{key:"applyMatrix4",value:function(e){return this.isEmpty()||(gr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),gr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),gr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),gr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),gr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),gr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),gr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),gr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(gr)),this}},{key:"translate",value:function(e){return this.min.add(e),this.max.add(e),this}},{key:"equals",value:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}]),e}();function vr(e,t,n,r,i){for(var a=0,o=e.length-3;a<=o;a+=3){jr.fromArray(e,a);var s=i.x*Math.abs(jr.x)+i.y*Math.abs(jr.y)+i.z*Math.abs(jr.z),c=t.dot(jr),u=n.dot(jr),l=r.dot(jr);if(Math.max(-Math.max(c,u,l),Math.min(c,u,l))>s)return!1}return!0}var gr=[new hr,new hr,new hr,new hr,new hr,new hr,new hr,new hr],br=new hr,yr=new mr,wr=new hr,xr=new hr,Mr=new hr,Or=new hr,kr=new hr,Er=new hr,_r=new hr,Sr=new hr,Cr=new hr,jr=new hr,Tr=new mr,Ar=function(){function e(t,n){Object(m.a)(this,e),this.center=void 0!==t?t:new hr,this.radius=void 0!==n?n:-1}return Object(v.a)(e,[{key:"set",value:function(e,t){return this.center.copy(e),this.radius=t,this}},{key:"setFromPoints",value:function(e,t){var n=this.center;void 0!==t?n.copy(t):Tr.setFromPoints(e).getCenter(n);for(var r=0,i=0,a=e.length;ithis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}},{key:"getBoundingBox",value:function(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new mr),this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}},{key:"applyMatrix4",value:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}},{key:"translate",value:function(e){return this.center.add(e),this}},{key:"equals",value:function(e){return e.center.equals(this.center)&&e.radius===this.radius}}]),e}(),Pr=new hr,Nr=new hr,Rr=new hr,zr=new hr,Lr=new hr,Ir=new hr,Dr=new hr,Br=function(){function e(t,n){Object(m.a)(this,e),this.origin=void 0!==t?t:new hr,this.direction=void 0!==n?n:new hr(0,0,-1)}return Object(v.a)(e,[{key:"set",value:function(e,t){return this.origin.copy(e),this.direction.copy(t),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}},{key:"at",value:function(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new hr),t.copy(this.direction).multiplyScalar(e).add(this.origin)}},{key:"lookAt",value:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this}},{key:"recast",value:function(e){return this.origin.copy(this.at(e,Pr)),this}},{key:"closestPointToPoint",value:function(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new hr),t.subVectors(e,this.origin);var n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}},{key:"distanceToPoint",value:function(e){return Math.sqrt(this.distanceSqToPoint(e))}},{key:"distanceSqToPoint",value:function(e){var t=Pr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Pr.copy(this.direction).multiplyScalar(t).add(this.origin),Pr.distanceToSquared(e))}},{key:"distanceSqToSegment",value:function(e,t,n,r){Nr.copy(e).add(t).multiplyScalar(.5),Rr.copy(t).sub(e).normalize(),zr.copy(this.origin).sub(Nr);var i,a,o,s,c=.5*e.distanceTo(t),u=-this.direction.dot(Rr),l=zr.dot(this.direction),f=-zr.dot(Rr),h=zr.lengthSq(),d=Math.abs(1-u*u);if(d>0)if(a=u*l-f,s=c*d,(i=u*f-l)>=0)if(a>=-s)if(a<=s){var p=1/d;o=(i*=p)*(i+u*(a*=p)+2*l)+a*(u*i+a+2*f)+h}else a=c,o=-(i=Math.max(0,-(u*a+l)))*i+a*(a+2*f)+h;else a=-c,o=-(i=Math.max(0,-(u*a+l)))*i+a*(a+2*f)+h;else a<=-s?o=-(i=Math.max(0,-(-u*c+l)))*i+(a=i>0?-c:Math.min(Math.max(-c,-f),c))*(a+2*f)+h:a<=s?(i=0,o=(a=Math.min(Math.max(-c,-f),c))*(a+2*f)+h):o=-(i=Math.max(0,-(u*c+l)))*i+(a=i>0?c:Math.min(Math.max(-c,-f),c))*(a+2*f)+h;else a=u>0?-c:c,o=-(i=Math.max(0,-(u*a+l)))*i+a*(a+2*f)+h;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(Rr).multiplyScalar(a).add(Nr),o}},{key:"intersectSphere",value:function(e,t){Pr.subVectors(e.center,this.origin);var n=Pr.dot(this.direction),r=Pr.dot(Pr)-n*n,i=e.radius*e.radius;if(r>i)return null;var a=Math.sqrt(i-r),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,t):this.at(o,t)}},{key:"intersectsSphere",value:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}},{key:"distanceToPlane",value:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}},{key:"intersectPlane",value:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}},{key:"intersectsPlane",value:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}},{key:"intersectBox",value:function(e,t){var n,r,i,a,o,s,c=1/this.direction.x,u=1/this.direction.y,l=1/this.direction.z,f=this.origin;return c>=0?(n=(e.min.x-f.x)*c,r=(e.max.x-f.x)*c):(n=(e.max.x-f.x)*c,r=(e.min.x-f.x)*c),u>=0?(i=(e.min.y-f.y)*u,a=(e.max.y-f.y)*u):(i=(e.max.y-f.y)*u,a=(e.min.y-f.y)*u),n>a||i>r?null:((i>n||n!==n)&&(n=i),(a=0?(o=(e.min.z-f.z)*l,s=(e.max.z-f.z)*l):(o=(e.max.z-f.z)*l,s=(e.min.z-f.z)*l),n>s||o>r?null:((o>n||n!==n)&&(n=o),(s=0?n:r,t)))}},{key:"intersectsBox",value:function(e){return null!==this.intersectBox(e,Pr)}},{key:"intersectTriangle",value:function(e,t,n,r,i){Lr.subVectors(t,e),Ir.subVectors(n,e),Dr.crossVectors(Lr,Ir);var a,o=this.direction.dot(Dr);if(o>0){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}zr.subVectors(this.origin,e);var s=a*this.direction.dot(Ir.crossVectors(zr,Ir));if(s<0)return null;var c=a*this.direction.dot(Lr.cross(zr));if(c<0)return null;if(s+c>o)return null;var u=-a*zr.dot(Dr);return u<0?null:this.at(u/o,i)}},{key:"applyMatrix4",value:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}},{key:"equals",value:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}]),e}(),Hr=function(){function e(){Object(m.a)(this,e),Object.defineProperty(this,"isMatrix4",{value:!0}),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}return Object(v.a)(e,[{key:"set",value:function(e,t,n,r,i,a,o,s,c,u,l,f,h,d,p,m){var v=this.elements;return v[0]=e,v[4]=t,v[8]=n,v[12]=r,v[1]=i,v[5]=a,v[9]=o,v[13]=s,v[2]=c,v[6]=u,v[10]=l,v[14]=f,v[3]=h,v[7]=d,v[11]=p,v[15]=m,this}},{key:"identity",value:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}},{key:"clone",value:function(){return(new e).fromArray(this.elements)}},{key:"copy",value:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}},{key:"copyPosition",value:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}},{key:"setFromMatrix3",value:function(e){var t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}},{key:"extractBasis",value:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}},{key:"makeBasis",value:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}},{key:"extractRotation",value:function(e){var t=this.elements,n=e.elements,r=1/Fr.setFromMatrixColumn(e,0).length(),i=1/Fr.setFromMatrixColumn(e,1).length(),a=1/Fr.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromEuler",value:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),u=Math.cos(i),l=Math.sin(i);if("XYZ"===e.order){var f=a*u,h=a*l,d=o*u,p=o*l;t[0]=s*u,t[4]=-s*l,t[8]=c,t[1]=h+d*c,t[5]=f-p*c,t[9]=-o*s,t[2]=p-f*c,t[6]=d+h*c,t[10]=a*s}else if("YXZ"===e.order){var m=s*u,v=s*l,g=c*u,b=c*l;t[0]=m+b*o,t[4]=g*o-v,t[8]=a*c,t[1]=a*l,t[5]=a*u,t[9]=-o,t[2]=v*o-g,t[6]=b+m*o,t[10]=a*s}else if("ZXY"===e.order){var y=s*u,w=s*l,x=c*u,M=c*l;t[0]=y-M*o,t[4]=-a*l,t[8]=x+w*o,t[1]=w+x*o,t[5]=a*u,t[9]=M-y*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){var O=a*u,k=a*l,E=o*u,_=o*l;t[0]=s*u,t[4]=E*c-k,t[8]=O*c+_,t[1]=s*l,t[5]=_*c+O,t[9]=k*c-E,t[2]=-c,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){var S=a*s,C=a*c,j=o*s,T=o*c;t[0]=s*u,t[4]=T-S*l,t[8]=j*l+C,t[1]=l,t[5]=a*u,t[9]=-o*u,t[2]=-c*u,t[6]=C*l+j,t[10]=S-T*l}else if("XZY"===e.order){var A=a*s,P=a*c,N=o*s,R=o*c;t[0]=s*u,t[4]=-l,t[8]=c*u,t[1]=A*l+R,t[5]=a*u,t[9]=P*l-N,t[2]=N*l-P,t[6]=o*u,t[10]=R*l+A}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromQuaternion",value:function(e){return this.compose(Ur,e,Wr)}},{key:"lookAt",value:function(e,t,n){var r=this.elements;return Kr.subVectors(e,t),0===Kr.lengthSq()&&(Kr.z=1),Kr.normalize(),qr.crossVectors(n,Kr),0===qr.lengthSq()&&(1===Math.abs(n.z)?Kr.x+=1e-4:Kr.z+=1e-4,Kr.normalize(),qr.crossVectors(n,Kr)),qr.normalize(),Gr.crossVectors(Kr,qr),r[0]=qr.x,r[4]=Gr.x,r[8]=Kr.x,r[1]=qr.y,r[5]=Gr.y,r[9]=Kr.y,r[2]=qr.z,r[6]=Gr.z,r[10]=Kr.z,this}},{key:"multiply",value:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],u=n[1],l=n[5],f=n[9],h=n[13],d=n[2],p=n[6],m=n[10],v=n[14],g=n[3],b=n[7],y=n[11],w=n[15],x=r[0],M=r[4],O=r[8],k=r[12],E=r[1],_=r[5],S=r[9],C=r[13],j=r[2],T=r[6],A=r[10],P=r[14],N=r[3],R=r[7],z=r[11],L=r[15];return i[0]=a*x+o*E+s*j+c*N,i[4]=a*M+o*_+s*T+c*R,i[8]=a*O+o*S+s*A+c*z,i[12]=a*k+o*C+s*P+c*L,i[1]=u*x+l*E+f*j+h*N,i[5]=u*M+l*_+f*T+h*R,i[9]=u*O+l*S+f*A+h*z,i[13]=u*k+l*C+f*P+h*L,i[2]=d*x+p*E+m*j+v*N,i[6]=d*M+p*_+m*T+v*R,i[10]=d*O+p*S+m*A+v*z,i[14]=d*k+p*C+m*P+v*L,i[3]=g*x+b*E+y*j+w*N,i[7]=g*M+b*_+y*T+w*R,i[11]=g*O+b*S+y*A+w*z,i[15]=g*k+b*C+y*P+w*L,this}},{key:"multiplyScalar",value:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}},{key:"determinant",value:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],u=e[2],l=e[6],f=e[10],h=e[14];return e[3]*(+i*s*l-r*c*l-i*o*f+n*c*f+r*o*h-n*s*h)+e[7]*(+t*s*h-t*c*f+i*a*f-r*a*h+r*c*u-i*s*u)+e[11]*(+t*c*l-t*o*h-i*a*l+n*a*h+i*o*u-n*c*u)+e[15]*(-r*o*u-t*s*l+t*o*f+r*a*l-n*a*f+n*s*u)}},{key:"transpose",value:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}},{key:"setPosition",value:function(e,t,n){var r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}},{key:"invert",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],u=e[8],l=e[9],f=e[10],h=e[11],d=e[12],p=e[13],m=e[14],v=e[15],g=l*m*c-p*f*c+p*s*h-o*m*h-l*s*v+o*f*v,b=d*f*c-u*m*c-d*s*h+a*m*h+u*s*v-a*f*v,y=u*p*c-d*l*c+d*o*h-a*p*h-u*o*v+a*l*v,w=d*l*s-u*p*s-d*o*f+a*p*f+u*o*m-a*l*m,x=t*g+n*b+r*y+i*w;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var M=1/x;return e[0]=g*M,e[1]=(p*f*i-l*m*i-p*r*h+n*m*h+l*r*v-n*f*v)*M,e[2]=(o*m*i-p*s*i+p*r*c-n*m*c-o*r*v+n*s*v)*M,e[3]=(l*s*i-o*f*i-l*r*c+n*f*c+o*r*h-n*s*h)*M,e[4]=b*M,e[5]=(u*m*i-d*f*i+d*r*h-t*m*h-u*r*v+t*f*v)*M,e[6]=(d*s*i-a*m*i-d*r*c+t*m*c+a*r*v-t*s*v)*M,e[7]=(a*f*i-u*s*i+u*r*c-t*f*c-a*r*h+t*s*h)*M,e[8]=y*M,e[9]=(d*l*i-u*p*i-d*n*h+t*p*h+u*n*v-t*l*v)*M,e[10]=(a*p*i-d*o*i+d*n*c-t*p*c-a*n*v+t*o*v)*M,e[11]=(u*o*i-a*l*i-u*n*c+t*l*c+a*n*h-t*o*h)*M,e[12]=w*M,e[13]=(u*p*r-d*l*r+d*n*f-t*p*f-u*n*m+t*l*m)*M,e[14]=(d*o*r-a*p*r-d*n*s+t*p*s+a*n*m-t*o*m)*M,e[15]=(a*l*r-u*o*r+u*n*s-t*l*s-a*n*f+t*o*f)*M,this}},{key:"scale",value:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}},{key:"getMaxScaleOnAxis",value:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}},{key:"makeTranslation",value:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}},{key:"makeRotationX",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}},{key:"makeRotationY",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}},{key:"makeRotationZ",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}},{key:"makeRotationAxis",value:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,u=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,u*o+n,u*s-r*a,0,c*s-r*o,u*s+r*a,i*s*s+n,0,0,0,0,1),this}},{key:"makeScale",value:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}},{key:"makeShear",value:function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this}},{key:"compose",value:function(e,t,n){var r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,c=i+i,u=a+a,l=o+o,f=i*c,h=i*u,d=i*l,p=a*u,m=a*l,v=o*l,g=s*c,b=s*u,y=s*l,w=n.x,x=n.y,M=n.z;return r[0]=(1-(p+v))*w,r[1]=(h+y)*w,r[2]=(d-b)*w,r[3]=0,r[4]=(h-y)*x,r[5]=(1-(f+v))*x,r[6]=(m+g)*x,r[7]=0,r[8]=(d+b)*M,r[9]=(m-g)*M,r[10]=(1-(f+p))*M,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}},{key:"decompose",value:function(e,t,n){var r=this.elements,i=Fr.set(r[0],r[1],r[2]).length(),a=Fr.set(r[4],r[5],r[6]).length(),o=Fr.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],Vr.copy(this);var s=1/i,c=1/a,u=1/o;return Vr.elements[0]*=s,Vr.elements[1]*=s,Vr.elements[2]*=s,Vr.elements[4]*=c,Vr.elements[5]*=c,Vr.elements[6]*=c,Vr.elements[8]*=u,Vr.elements[9]*=u,Vr.elements[10]*=u,t.setFromRotationMatrix(Vr),n.x=i,n.y=a,n.z=o,this}},{key:"makePerspective",value:function(e,t,n,r,i,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*i/(t-e),c=2*i/(n-r),u=(t+e)/(t-e),l=(n+r)/(n-r),f=-(a+i)/(a-i),h=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=u,o[12]=0,o[1]=0,o[5]=c,o[9]=l,o[13]=0,o[2]=0,o[6]=0,o[10]=f,o[14]=h,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}},{key:"makeOrthographic",value:function(e,t,n,r,i,a){var o=this.elements,s=1/(t-e),c=1/(n-r),u=1/(a-i),l=(t+e)*s,f=(n+r)*c,h=(a+i)*u;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-l,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-f,o[2]=0,o[6]=0,o[10]=-2*u,o[14]=-h,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}},{key:"equals",value:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<16;n++)this.elements[n]=e[n+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}]),e}(),Fr=new hr,Vr=new Hr,Ur=new hr(0,0,0),Wr=new hr(1,1,1),qr=new hr,Gr=new hr,Kr=new hr,Yr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.DefaultOrder;Object(m.a)(this,e),Object.defineProperty(this,"isEuler",{value:!0}),this._x=t,this._y=n,this._z=r,this._order=i}return Object(v.a)(e,[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}},{key:"set",value:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||this._order,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._order)}},{key:"copy",value:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e,t,n){var r=tr.clamp,i=e.elements,a=i[0],o=i[4],s=i[8],c=i[1],u=i[5],l=i[9],f=i[2],h=i[6],d=i[10];switch(t=t||this._order){case"XYZ":this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(h,u),this._z=0);break;case"YXZ":this._x=Math.asin(-r(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(c,u)):(this._y=Math.atan2(-f,a),this._z=0);break;case"ZXY":this._x=Math.asin(r(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-f,d),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(c,a));break;case"ZYX":this._y=Math.asin(-r(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(r(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-l,u),this._y=Math.atan2(-f,a)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-r(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(h,u),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-l,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!1!==n&&this._onChangeCallback(),this}},{key:"setFromQuaternion",value:function(e,t,n){return Xr.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Xr,t,n)}},{key:"setFromVector3",value:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)}},{key:"reorder",value:function(e){return Zr.setFromEuler(this),this.setFromQuaternion(Zr,e)}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}},{key:"fromArray",value:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}},{key:"toVector3",value:function(e){return e?e.set(this._x,this._y,this._z):new hr(this._x,this._y,this._z)}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}}]),e}();Yr.DefaultOrder="XYZ",Yr.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var Xr=new Hr,Zr=new fr,Jr=function(){function e(){Object(m.a)(this,e),this.mask=1}return Object(v.a)(e,[{key:"set",value:function(e){this.mask=1<1){for(var t=0;t1){for(var t=0;t0){r.children=[];for(var d=0;d0){r.animations=[];for(var p=0;p0&&(n.geometries=v),g.length>0&&(n.materials=g),b.length>0&&(n.textures=b),y.length>0&&(n.images=y),w.length>0&&(n.shapes=w),x.length>0&&(n.skeletons=x),M.length>0&&(n.animations=M)}return n.object=r,n;function O(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var n=0;n1?void 0:t.copy(n).multiplyScalar(i).add(e.start)}},{key:"intersectsLine",value:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}},{key:"intersectsBox",value:function(e){return e.intersectsPlane(this)}},{key:"intersectsSphere",value:function(e){return e.intersectsPlane(this)}},{key:"coplanarPoint",value:function(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new hr),e.copy(this.normal).multiplyScalar(-this.constant)}},{key:"applyMatrix4",value:function(e,t){var n=t||pi.getNormalMatrix(e),r=this.coplanarPoint(hi).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}},{key:"translate",value:function(e){return this.constant-=e.dot(this.normal),this}},{key:"equals",value:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}}]),e}(),vi=new hr,gi=new hr,bi=new hr,yi=new hr,wi=new hr,xi=new hr,Mi=new hr,Oi=new hr,ki=new hr,Ei=new hr,_i=function(){function e(t,n,r){Object(m.a)(this,e),this.a=void 0!==t?t:new hr,this.b=void 0!==n?n:new hr,this.c=void 0!==r?r:new hr}return Object(v.a)(e,[{key:"set",value:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}},{key:"setFromPointsAndIndices",value:function(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}},{key:"getArea",value:function(){return vi.subVectors(this.c,this.b),gi.subVectors(this.a,this.b),.5*vi.cross(gi).length()}},{key:"getMidpoint",value:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new hr),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}},{key:"getNormal",value:function(t){return e.getNormal(this.a,this.b,this.c,t)}},{key:"getPlane",value:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new mi),e.setFromCoplanarPoints(this.a,this.b,this.c)}},{key:"getBarycoord",value:function(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}},{key:"getUV",value:function(t,n,r,i,a){return e.getUV(t,this.a,this.b,this.c,n,r,i,a)}},{key:"containsPoint",value:function(t){return e.containsPoint(t,this.a,this.b,this.c)}},{key:"isFrontFacing",value:function(t){return e.isFrontFacing(this.a,this.b,this.c,t)}},{key:"intersectsBox",value:function(e){return e.intersectsTriangle(this)}},{key:"closestPointToPoint",value:function(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new hr);var n,r,i=this.a,a=this.b,o=this.c;wi.subVectors(a,i),xi.subVectors(o,i),Oi.subVectors(e,i);var s=wi.dot(Oi),c=xi.dot(Oi);if(s<=0&&c<=0)return t.copy(i);ki.subVectors(e,a);var u=wi.dot(ki),l=xi.dot(ki);if(u>=0&&l<=u)return t.copy(a);var f=s*l-u*c;if(f<=0&&s>=0&&u<=0)return n=s/(s-u),t.copy(i).addScaledVector(wi,n);Ei.subVectors(e,o);var h=wi.dot(Ei),d=xi.dot(Ei);if(d>=0&&h<=d)return t.copy(o);var p=h*c-s*d;if(p<=0&&c>=0&&d<=0)return r=c/(c-d),t.copy(i).addScaledVector(xi,r);var m=u*d-h*l;if(m<=0&&l-u>=0&&h-d>=0)return Mi.subVectors(o,a),r=(l-u)/(l-u+(h-d)),t.copy(a).addScaledVector(Mi,r);var v=1/(m+p+f);return n=p*v,r=f*v,t.copy(i).addScaledVector(wi,n).addScaledVector(xi,r)}},{key:"equals",value:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}],[{key:"getNormal",value:function(e,t,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new hr),r.subVectors(n,t),vi.subVectors(e,t),r.cross(vi);var i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}},{key:"getBarycoord",value:function(e,t,n,r,i){vi.subVectors(r,t),gi.subVectors(n,t),bi.subVectors(e,t);var a=vi.dot(vi),o=vi.dot(gi),s=vi.dot(bi),c=gi.dot(gi),u=gi.dot(bi),l=a*c-o*o;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new hr),0===l)return i.set(-2,-1,-1);var f=1/l,h=(c*s-o*u)*f,d=(a*u-o*s)*f;return i.set(1-h-d,d,h)}},{key:"containsPoint",value:function(e,t,n,r){return this.getBarycoord(e,t,n,r,yi),yi.x>=0&&yi.y>=0&&yi.x+yi.y<=1}},{key:"getUV",value:function(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,yi),s.set(0,0),s.addScaledVector(i,yi.x),s.addScaledVector(a,yi.y),s.addScaledVector(o,yi.z),s}},{key:"isFrontFacing",value:function(e,t,n,r){return vi.subVectors(n,t),gi.subVectors(e,t),vi.cross(gi).dot(r)<0}}]),e}(),Si={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ci={h:0,s:0,l:0},ji={h:0,s:0,l:0};function Ti(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function Ai(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Pi(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}var Ni=function(){function e(t,n,r){return Object(m.a)(this,e),Object.defineProperty(this,"isColor",{value:!0}),void 0===n&&void 0===r?this.set(t):this.setRGB(t,n,r)}return Object(v.a)(e,[{key:"set",value:function(e){return e&&e.isColor?this.copy(e):"number"===typeof e?this.setHex(e):"string"===typeof e&&this.setStyle(e),this}},{key:"setScalar",value:function(e){return this.r=e,this.g=e,this.b=e,this}},{key:"setHex",value:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}},{key:"setRGB",value:function(e,t,n){return this.r=e,this.g=t,this.b=n,this}},{key:"setHSL",value:function(e,t,n){if(e=tr.euclideanModulo(e,1),t=tr.clamp(t,0,1),n=tr.clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Ti(i,r,e+1/3),this.g=Ti(i,r,e),this.b=Ti(i,r,e-1/3)}return this}},{key:"setStyle",value:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){var r,i=n[1],a=n[2];switch(i){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[4]),this;if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[4]),this;break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)){var o=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100;return t(r[4]),this.setHSL(o,s,c)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){var u=n[1],l=u.length;if(3===l)return this.r=parseInt(u.charAt(0)+u.charAt(0),16)/255,this.g=parseInt(u.charAt(1)+u.charAt(1),16)/255,this.b=parseInt(u.charAt(2)+u.charAt(2),16)/255,this;if(6===l)return this.r=parseInt(u.charAt(0)+u.charAt(1),16)/255,this.g=parseInt(u.charAt(2)+u.charAt(3),16)/255,this.b=parseInt(u.charAt(4)+u.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}},{key:"setColorName",value:function(e){var t=Si[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}},{key:"clone",value:function(){return new this.constructor(this.r,this.g,this.b)}},{key:"copy",value:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}},{key:"copyGammaToLinear",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}},{key:"copyLinearToGamma",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}},{key:"convertGammaToLinear",value:function(e){return this.copyGammaToLinear(this,e),this}},{key:"convertLinearToGamma",value:function(e){return this.copyLinearToGamma(this,e),this}},{key:"copySRGBToLinear",value:function(e){return this.r=Ai(e.r),this.g=Ai(e.g),this.b=Ai(e.b),this}},{key:"copyLinearToSRGB",value:function(e){return this.r=Pi(e.r),this.g=Pi(e.g),this.b=Pi(e.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}},{key:"getHex",value:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}},{key:"getHexString",value:function(){return("000000"+this.getHex().toString(16)).slice(-6)}},{key:"getHSL",value:function(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t,n,r=this.r,i=this.g,a=this.b,o=Math.max(r,i,a),s=Math.min(r,i,a),c=(s+o)/2;if(s===o)t=0,n=0;else{var u=o-s;switch(n=c<=.5?u/(o+s):u/(2-o-s),o){case r:t=(i-a)/u+(i1&&void 0!==arguments[1]?arguments[1]:0;return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}},{key:"fromBufferAttribute",value:function(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}},{key:"toJSON",value:function(){return this.getHex()}}]),e}();Ni.NAMES=Si,Ni.prototype.r=1,Ni.prototype.g=1,Ni.prototype.b=1;var Ri=function(){function e(t,n,r,i,a){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;Object(m.a)(this,e),this.a=t,this.b=n,this.c=r,this.normal=i&&i.isVector3?i:new hr,this.vertexNormals=Array.isArray(i)?i:[],this.color=a&&a.isColor?a:new Ni,this.vertexColors=Array.isArray(a)?a:[],this.materialIndex=o}return Object(v.a)(e,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,n=e.vertexNormals.length;t0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){var i=r(e.textures),a=r(e.images);i.length>0&&(n.textures=i),a.length>0&&(n.images=a)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,n=null;if(null!==t){var r=t.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Li.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Ii.prototype=Object.create(Li.prototype),Ii.prototype.constructor=Ii,Ii.prototype.isMeshBasicMaterial=!0,Ii.prototype.copy=function(e){return Li.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this};var Di=new hr,Bi=new nr;function Hi(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=Bn,this.updateRange={offset:0,count:-1},this.version=0}function Fi(e,t,n){Hi.call(this,new Int8Array(e),t,n)}function Vi(e,t,n){Hi.call(this,new Uint8Array(e),t,n)}function Ui(e,t,n){Hi.call(this,new Uint8ClampedArray(e),t,n)}function Wi(e,t,n){Hi.call(this,new Int16Array(e),t,n)}function qi(e,t,n){Hi.call(this,new Uint16Array(e),t,n)}function Gi(e,t,n){Hi.call(this,new Int32Array(e),t,n)}function Ki(e,t,n){Hi.call(this,new Uint32Array(e),t,n)}function Yi(e,t,n){Hi.call(this,new Uint16Array(e),t,n)}function Xi(e,t,n){Hi.call(this,new Float32Array(e),t,n)}function Zi(e,t,n){Hi.call(this,new Float64Array(e),t,n)}function Ji(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,r=e.length;nt&&(t=e[n]);return t}Object.defineProperty(Hi.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Hi.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var r=0,i=this.itemSize;r1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),Fi.prototype=Object.create(Hi.prototype),Fi.prototype.constructor=Fi,Vi.prototype=Object.create(Hi.prototype),Vi.prototype.constructor=Vi,Ui.prototype=Object.create(Hi.prototype),Ui.prototype.constructor=Ui,Wi.prototype=Object.create(Hi.prototype),Wi.prototype.constructor=Wi,qi.prototype=Object.create(Hi.prototype),qi.prototype.constructor=qi,Gi.prototype=Object.create(Hi.prototype),Gi.prototype.constructor=Gi,Ki.prototype=Object.create(Hi.prototype),Ki.prototype.constructor=Ki,Yi.prototype=Object.create(Hi.prototype),Yi.prototype.constructor=Yi,Yi.prototype.isFloat16BufferAttribute=!0,Xi.prototype=Object.create(Hi.prototype),Xi.prototype.constructor=Xi,Zi.prototype=Object.create(Hi.prototype),Zi.prototype.constructor=Zi;var Qi={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!==typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function $i(e,t){return new Qi[e](t)}var ea=0,ta=new Hr,na=new fi,ra=new hr,ia=new mr,aa=new mr,oa=new hr;function sa(){Object.defineProperty(this,"id",{value:ea++}),this.uuid=tr.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}sa.prototype=Object.assign(Object.create(Zn.prototype),{constructor:sa,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){return Array.isArray(e)?this.index=new(Ji(e)>65535?Ki:qi)(e,1):this.index=e,this},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},hasAttribute:function(e){return void 0!==this.attributes[e]},addGroup:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:e,count:t,materialIndex:n})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix4:function(e){var t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var r=(new rr).getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return ta.makeRotationX(e),this.applyMatrix4(ta),this},rotateY:function(e){return ta.makeRotationY(e),this.applyMatrix4(ta),this},rotateZ:function(e){return ta.makeRotationZ(e),this.applyMatrix4(ta),this},translate:function(e,t,n){return ta.makeTranslation(e,t,n),this.applyMatrix4(ta),this},scale:function(e,t,n){return ta.makeScale(e,t,n),this.applyMatrix4(ta),this},lookAt:function(e){return na.lookAt(e),na.updateMatrix(),this.applyMatrix4(na.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(ra).negate(),this.translate(ra.x,ra.y,ra.z),this},setFromPoints:function(e){for(var t=[],n=0,r=e.length;n0&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var r=this.index;null!==r&&(e.data.index={type:r.array.constructor.name,array:Array.prototype.slice.call(r.array)});var i=this.attributes;for(var a in i){var o=i[a],s=o.toJSON(e.data);""!==o.name&&(s.name=o.name),e.data.attributes[a]=s}var c={},u=!1;for(var l in this.morphAttributes){for(var f=this.morphAttributes[l],h=[],d=0,p=f.length;d0&&(c[l]=h,u=!0)}u&&(e.data.morphAttributes=c,e.data.morphTargetsRelative=this.morphTargetsRelative);var g=this.groups;g.length>0&&(e.data.groups=JSON.parse(JSON.stringify(g)));var b=this.boundingSphere;return null!==b&&(e.data.boundingSphere={center:b.center.toArray(),radius:b.radius}),e},clone:function(){return(new sa).copy(this)},copy:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;var t={};this.name=e.name;var n=e.index;null!==n&&this.setIndex(n.clone(t));var r=e.attributes;for(var i in r){var a=r[i];this.setAttribute(i,a.clone(t))}var o=e.morphAttributes;for(var s in o){for(var c=[],u=o[s],l=0,f=u.length;l0&&void 0!==arguments[0]?arguments[0]:new sa,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ii;fi.call(this),this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}function _a(e,t,n,r,i,a,o,s,c,u,l,f){fa.fromBufferAttribute(i,u),ha.fromBufferAttribute(i,l),da.fromBufferAttribute(i,f);var h=e.morphTargetInfluences;if(t.morphTargets&&a&&h){ga.set(0,0,0),ba.set(0,0,0),ya.set(0,0,0);for(var d=0,p=a.length;dn.far?null:{distance:c,point:ka.clone(),object:e}}(e,t,n,r,fa,ha,da,Oa);if(g){s&&(wa.fromBufferAttribute(s,u),xa.fromBufferAttribute(s,l),Ma.fromBufferAttribute(s,f),g.uv=_i.getUV(Oa,fa,ha,da,wa,xa,Ma,new nr)),c&&(wa.fromBufferAttribute(c,u),xa.fromBufferAttribute(c,l),Ma.fromBufferAttribute(c,f),g.uv2=_i.getUV(Oa,fa,ha,da,wa,xa,Ma,new nr));var b=new Ri(u,l,f);_i.getNormal(fa,ha,da,b.normal),g.face=b}return g}Ea.prototype=Object.assign(Object.create(fi.prototype),{constructor:Ea,isMesh:!0,copy:function(e){return fi.prototype.copy.call(this,e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this},updateMorphTargets:function(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,n=Object.keys(t);if(n.length>0){var r=t[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,a=r.length;i0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){var n,r=this.geometry,i=this.material,a=this.matrixWorld;if(void 0!==i&&(null===r.boundingSphere&&r.computeBoundingSphere(),la.copy(r.boundingSphere),la.applyMatrix4(a),!1!==e.ray.intersectsSphere(la)&&(ca.copy(a).invert(),ua.copy(e.ray).applyMatrix4(ca),null===r.boundingBox||!1!==ua.intersectsBox(r.boundingBox))))if(r.isBufferGeometry){var o=r.index,s=r.attributes.position,c=r.morphAttributes.position,u=r.morphTargetsRelative,l=r.attributes.uv,f=r.attributes.uv2,h=r.groups,d=r.drawRange;if(null!==o)if(Array.isArray(i))for(var p=0,m=h.length;p0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;Object(m.a)(this,n),(e=t.call(this)).type="BoxGeometry",e.parameters={width:r,height:i,depth:a,widthSegments:o,heightSegments:s,depthSegments:c};var u=Object(h.a)(e);o=Math.floor(o),s=Math.floor(s),c=Math.floor(c);var l=[],f=[],d=[],p=[],v=0,g=0;function b(e,t,n,r,i,a,o,s,c,h,m){for(var b=a/c,y=o/h,w=a/2,x=o/2,M=s/2,O=c+1,k=h+1,E=0,_=0,S=new hr,C=0;C0?1:-1,d.push(S.x,S.y,S.z),p.push(T/c),p.push(1-C/h),E+=1}for(var P=0;P0&&void 0!==arguments[0]?arguments[0]:50,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2e3;Pa.call(this),this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}Aa.prototype=Object.create(Li.prototype),Aa.prototype.constructor=Aa,Aa.prototype.isShaderMaterial=!0,Aa.prototype.copy=function(e){return Li.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Ca(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this},Aa.prototype.toJSON=function(e){var t=Li.prototype.toJSON.call(this,e);for(var n in t.glslVersion=this.glslVersion,t.uniforms={},this.uniforms){var r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:"t",value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:"m4",value:r.toArray()}:t.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var i={};for(var a in this.extensions)!0===this.extensions[a]&&(i[a]=!0);return Object.keys(i).length>0&&(t.extensions=i),t},Pa.prototype=Object.assign(Object.create(fi.prototype),{constructor:Pa,isCamera:!0,copy:function(e,t){return fi.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new hr),this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){fi.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()},updateWorldMatrix:function(e,t){fi.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()},clone:function(){return(new this.constructor).copy(this)}}),Na.prototype=Object.assign(Object.create(Pa.prototype),{constructor:Na,isPerspectiveCamera:!0,copy:function(e,t){return Pa.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*tr.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*tr.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*tr.RAD2DEG*Math.atan(Math.tan(.5*tr.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,n,r,i,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*tr.DEG2RAD*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;i+=a.offsetX*r/o,t-=a.offsetY*n/s,r*=a.width/o,n*=a.height/s}var c=this.filmOffset;0!==c&&(i+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()},toJSON:function(e){var t=fi.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}});function Ra(e,t,n){if(fi.call(this),this.type="CubeCamera",!0===n.isWebGLCubeRenderTarget){this.renderTarget=n;var r=new Na(90,1,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new hr(1,0,0)),this.add(r);var i=new Na(90,1,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new hr(-1,0,0)),this.add(i);var a=new Na(90,1,e,t);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(new hr(0,1,0)),this.add(a);var o=new Na(90,1,e,t);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new hr(0,-1,0)),this.add(o);var s=new Na(90,1,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new hr(0,0,1)),this.add(s);var c=new Na(90,1,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new hr(0,0,-1)),this.add(c),this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var u=e.xr.enabled,l=e.getRenderTarget();e.xr.enabled=!1;var f=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,r),e.setRenderTarget(n,1),e.render(t,i),e.setRenderTarget(n,2),e.render(t,a),e.setRenderTarget(n,3),e.render(t,o),e.setRenderTarget(n,4),e.render(t,s),n.texture.generateMipmaps=f,e.setRenderTarget(n,5),e.render(t,c),e.setRenderTarget(l),e.xr.enabled=u}}else console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.")}function za(e,t,n,r,i,a,o,s,c,u){e=void 0!==e?e:[],t=void 0!==t?t:ye,o=void 0!==o?o:Je,or.call(this,e,t,n,r,i,a,o,s,c,u),this.flipY=!1,this._needsFlipEnvMap=!0}Ra.prototype=Object.create(fi.prototype),Ra.prototype.constructor=Ra,za.prototype=Object.create(or.prototype),za.prototype.constructor=za,za.prototype.isCubeTexture=!0,Object.defineProperty(za.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}});var La=function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(e,r,i){var a;return Object(m.a)(this,n),Number.isInteger(r)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),r=i),a=t.call(this,e,e,r),Object.defineProperty(Object(h.a)(a),"isWebGLCubeRenderTarget",{value:!0}),r=r||{},a.texture=new za(void 0,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),a.texture._needsFlipEnvMap=!1,a}return Object(v.a)(n,[{key:"fromEquirectangularTexture",value:function(e,t){this.texture.type=t.type,this.texture.format=Qe,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;var n={tEquirect:{value:null}},r="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",i="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",a=new Sa(5,5,5),o=new Aa({name:"CubemapFromEquirect",uniforms:Ca(n),vertexShader:r,fragmentShader:i,side:j,blending:N});o.uniforms.tEquirect.value=t;var s=new Ea(a,o),c=t.minFilter;return t.minFilter===Le&&(t.minFilter=Ne),new Ra(1,10,this).update(e,s),t.minFilter=c,s.geometry.dispose(),s.material.dispose(),this}},{key:"clear",value:function(e,t,n,r){for(var i=e.getRenderTarget(),a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,r);e.setRenderTarget(i)}}]),n}(ur);function Ia(e,t,n,r,i,a,o,s,c,u,l,f){or.call(this,null,a,o,s,c,u,r,i,l,f),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==c?c:Ce,this.minFilter=void 0!==u?u:Ce,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}Ia.prototype=Object.create(or.prototype),Ia.prototype.constructor=Ia,Ia.prototype.isDataTexture=!0;var Da=new Ar,Ba=new hr,Ha=function(){function e(t,n,r,i,a,o){Object(m.a)(this,e),this.planes=[void 0!==t?t:new mi,void 0!==n?n:new mi,void 0!==r?r:new mi,void 0!==i?i:new mi,void 0!==a?a:new mi,void 0!==o?o:new mi]}return Object(v.a)(e,[{key:"set",value:function(e,t,n,r,i,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this}},{key:"setFromProjectionMatrix",value:function(e){var t=this.planes,n=e.elements,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],u=n[6],l=n[7],f=n[8],h=n[9],d=n[10],p=n[11],m=n[12],v=n[13],g=n[14],b=n[15];return t[0].setComponents(o-r,l-s,p-f,b-m).normalize(),t[1].setComponents(o+r,l+s,p+f,b+m).normalize(),t[2].setComponents(o+i,l+c,p+h,b+v).normalize(),t[3].setComponents(o-i,l-c,p-h,b-v).normalize(),t[4].setComponents(o-a,l-u,p-d,b-g).normalize(),t[5].setComponents(o+a,l+u,p+d,b+g).normalize(),this}},{key:"intersectsObject",value:function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),Da.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Da)}},{key:"intersectsSprite",value:function(e){return Da.center.set(0,0,0),Da.radius=.7071067811865476,Da.applyMatrix4(e.matrixWorld),this.intersectsSphere(Da)}},{key:"intersectsSphere",value:function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++){if(t[i].distanceToPoint(n)0?e.max.x:e.min.x,Ba.y=r.normal.y>0?e.max.y:e.min.y,Ba.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Ba)<0)return!1}return!0}},{key:"containsPoint",value:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}}]),e}();function Fa(){var e=null,t=!1,n=null,r=null;function i(t,a){n(t,a),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function Va(e,t){var n=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){var a=r.get(t);(!a||a.version0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;Object(m.a)(this,n),(e=t.call(this)).type="PlaneGeometry",e.parameters={width:r,height:i,widthSegments:a,heightSegments:o};for(var s=r/2,c=i/2,u=Math.floor(a),l=Math.floor(o),f=u+1,h=l+1,d=r/u,p=i/l,v=[],g=[],b=[],y=[],w=0;w 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor.xyz *= color.xyz;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmissionmap_fragment:"#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif",transmissionmap_pars_fragment:"#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= mix( saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) ), 1.0, metalness );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"},qa={common:{diffuse:{value:new Ni(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new rr},uv2Transform:{value:new rr},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new nr(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ni(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ni(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new rr}},sprite:{diffuse:{value:new Ni(15658734)},opacity:{value:1},center:{value:new nr(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new rr}}},Ga={basic:{uniforms:ja([qa.common,qa.specularmap,qa.envmap,qa.aomap,qa.lightmap,qa.fog]),vertexShader:Wa.meshbasic_vert,fragmentShader:Wa.meshbasic_frag},lambert:{uniforms:ja([qa.common,qa.specularmap,qa.envmap,qa.aomap,qa.lightmap,qa.emissivemap,qa.fog,qa.lights,{emissive:{value:new Ni(0)}}]),vertexShader:Wa.meshlambert_vert,fragmentShader:Wa.meshlambert_frag},phong:{uniforms:ja([qa.common,qa.specularmap,qa.envmap,qa.aomap,qa.lightmap,qa.emissivemap,qa.bumpmap,qa.normalmap,qa.displacementmap,qa.fog,qa.lights,{emissive:{value:new Ni(0)},specular:{value:new Ni(1118481)},shininess:{value:30}}]),vertexShader:Wa.meshphong_vert,fragmentShader:Wa.meshphong_frag},standard:{uniforms:ja([qa.common,qa.envmap,qa.aomap,qa.lightmap,qa.emissivemap,qa.bumpmap,qa.normalmap,qa.displacementmap,qa.roughnessmap,qa.metalnessmap,qa.fog,qa.lights,{emissive:{value:new Ni(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Wa.meshphysical_vert,fragmentShader:Wa.meshphysical_frag},toon:{uniforms:ja([qa.common,qa.aomap,qa.lightmap,qa.emissivemap,qa.bumpmap,qa.normalmap,qa.displacementmap,qa.gradientmap,qa.fog,qa.lights,{emissive:{value:new Ni(0)}}]),vertexShader:Wa.meshtoon_vert,fragmentShader:Wa.meshtoon_frag},matcap:{uniforms:ja([qa.common,qa.bumpmap,qa.normalmap,qa.displacementmap,qa.fog,{matcap:{value:null}}]),vertexShader:Wa.meshmatcap_vert,fragmentShader:Wa.meshmatcap_frag},points:{uniforms:ja([qa.points,qa.fog]),vertexShader:Wa.points_vert,fragmentShader:Wa.points_frag},dashed:{uniforms:ja([qa.common,qa.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Wa.linedashed_vert,fragmentShader:Wa.linedashed_frag},depth:{uniforms:ja([qa.common,qa.displacementmap]),vertexShader:Wa.depth_vert,fragmentShader:Wa.depth_frag},normal:{uniforms:ja([qa.common,qa.bumpmap,qa.normalmap,qa.displacementmap,{opacity:{value:1}}]),vertexShader:Wa.normal_vert,fragmentShader:Wa.normal_frag},sprite:{uniforms:ja([qa.sprite,qa.fog]),vertexShader:Wa.sprite_vert,fragmentShader:Wa.sprite_frag},background:{uniforms:{uvTransform:{value:new rr},t2D:{value:null}},vertexShader:Wa.background_vert,fragmentShader:Wa.background_frag},cube:{uniforms:ja([qa.envmap,{opacity:{value:1}}]),vertexShader:Wa.cube_vert,fragmentShader:Wa.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Wa.equirect_vert,fragmentShader:Wa.equirect_frag},distanceRGBA:{uniforms:ja([qa.common,qa.displacementmap,{referencePosition:{value:new hr},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Wa.distanceRGBA_vert,fragmentShader:Wa.distanceRGBA_frag},shadow:{uniforms:ja([qa.lights,qa.fog,{color:{value:new Ni(0)},opacity:{value:1}}]),vertexShader:Wa.shadow_vert,fragmentShader:Wa.shadow_frag}};function Ka(e,t,n,r,i){var a,o,s=new Ni(0),c=0,u=null,l=0,f=null;function h(e,t){n.buffers.color.setClear(e.r,e.g,e.b,t,i)}return{getClearColor:function(){return s},setClearColor:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;s.set(e),h(s,c=t)},getClearAlpha:function(){return c},setClearAlpha:function(e){h(s,c=e)},render:function(n,i,d,p){var m=!0===i.isScene?i.background:null;m&&m.isTexture&&(m=t.get(m));var v=e.xr,g=v.getSession&&v.getSession();g&&"additive"===g.environmentBlendMode&&(m=null),null===m?h(s,c):m&&m.isColor&&(h(m,1),p=!0),(e.autoClear||p)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),m&&(m.isCubeTexture||m.isWebGLCubeRenderTarget||m.mapping===Oe)?(void 0===o&&((o=new Ea(new Sa(1,1,1),new Aa({name:"BackgroundCubeMaterial",uniforms:Ca(Ga.cube.uniforms),vertexShader:Ga.cube.vertexShader,fragmentShader:Ga.cube.fragmentShader,side:j,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),o.geometry.deleteAttribute("uv"),o.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(o.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(o)),m.isWebGLCubeRenderTarget&&(m=m.texture),o.material.uniforms.envMap.value=m,o.material.uniforms.flipEnvMap.value=m.isCubeTexture&&m._needsFlipEnvMap?-1:1,u===m&&l===m.version&&f===e.toneMapping||(o.material.needsUpdate=!0,u=m,l=m.version,f=e.toneMapping),n.unshift(o,o.geometry,o.material,0,0,null)):m&&m.isTexture&&(void 0===a&&((a=new Ea(new Ua(2,2),new Aa({name:"BackgroundMaterial",uniforms:Ca(Ga.background.uniforms),vertexShader:Ga.background.vertexShader,fragmentShader:Ga.background.fragmentShader,side:C,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(a)),a.material.uniforms.t2D.value=m,!0===m.matrixAutoUpdate&&m.updateMatrix(),a.material.uniforms.uvTransform.value.copy(m.matrix),u===m&&l===m.version&&f===e.toneMapping||(a.material.needsUpdate=!0,u=m,l=m.version,f=e.toneMapping),n.unshift(a,a.geometry,a.material,0,0,null))}}}function Ya(e,t,n,r){var i=e.getParameter(34921),a=r.isWebGL2?null:t.get("OES_vertex_array_object"),o=r.isWebGL2||null!==a,s={},c=h(null),u=c;function l(t){return r.isWebGL2?e.bindVertexArray(t):a.bindVertexArrayOES(t)}function f(t){return r.isWebGL2?e.deleteVertexArray(t):a.deleteVertexArrayOES(t)}function h(e){for(var t=[],n=[],r=[],a=0;a=0){var b=c[f];if(void 0!==b){var y=b.normalized,w=b.itemSize,x=n.get(b);if(void 0===x)continue;var M=x.buffer,O=x.type,k=x.bytesPerElement;if(b.isInterleavedBufferAttribute){var E=b.data,_=E.stride,S=b.offset;E&&E.isInstancedInterleavedBuffer?(m(h,E.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=E.meshPerAttribute*E.count)):p(h),e.bindBuffer(34962,M),g(h,w,O,y,_*k,S*k)}else b.isInstancedBufferAttribute?(m(h,b.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=b.meshPerAttribute*b.count)):p(h),e.bindBuffer(34962,M),g(h,w,O,y,0,0)}else if("instanceMatrix"===f){var C=n.get(i.instanceMatrix);if(void 0===C)continue;var j=C.buffer,T=C.type;m(h+0,1),m(h+1,1),m(h+2,1),m(h+3,1),e.bindBuffer(34962,j),e.vertexAttribPointer(h+0,4,T,!1,64,0),e.vertexAttribPointer(h+1,4,T,!1,64,16),e.vertexAttribPointer(h+2,4,T,!1,64,32),e.vertexAttribPointer(h+3,4,T,!1,64,48)}else if("instanceColor"===f){var A=n.get(i.instanceColor);if(void 0===A)continue;var P=A.buffer,N=A.type;m(h,1),e.bindBuffer(34962,P),e.vertexAttribPointer(h,3,N,!1,12,0)}else if(void 0!==l){var R=l[f];if(void 0!==R)switch(R.length){case 2:e.vertexAttrib2fv(h,R);break;case 3:e.vertexAttrib3fv(h,R);break;case 4:e.vertexAttrib4fv(h,R);break;default:e.vertexAttrib1fv(h,R)}}}}v()}(i,c,f,b),null!==y&&e.bindBuffer(34963,n.get(y).buffer))},reset:b,resetDefaultState:y,dispose:function(){for(var e in b(),s){var t=s[e];for(var n in t){var r=t[n];for(var i in r)f(r[i].object),delete r[i];delete t[n]}delete s[e]}},releaseStatesOfGeometry:function(e){if(void 0!==s[e.id]){var t=s[e.id];for(var n in t){var r=t[n];for(var i in r)f(r[i].object),delete r[i];delete t[n]}delete s[e.id]}},releaseStatesOfProgram:function(e){for(var t in s){var n=s[t];if(void 0!==n[e.id]){var r=n[e.id];for(var i in r)f(r[i].object),delete r[i];delete n[e.id]}}},initAttributes:d,enableAttribute:p,disableUnusedAttributes:v}}function Xa(e,t,n,r){var i,a=r.isWebGL2;this.setMode=function(e){i=e},this.render=function(t,r){e.drawArrays(i,t,r),n.update(r,i,1)},this.renderInstances=function(r,o,s){if(0!==s){var c,u;if(a)c=e,u="drawArraysInstanced";else if(u="drawArraysInstancedANGLE",null===(c=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[u](i,r,o,s),n.update(o,i,s)}}}function Za(e,t,n){var r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var a="undefined"!==typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!==typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext,o=void 0!==n.precision?n.precision:"highp",s=i(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var c=!0===n.logarithmicDepthBuffer,u=e.getParameter(34930),l=e.getParameter(35660),f=e.getParameter(3379),h=e.getParameter(34076),d=e.getParameter(34921),p=e.getParameter(36347),m=e.getParameter(36348),v=e.getParameter(36349),g=l>0,b=a||!!t.get("OES_texture_float");return{isWebGL2:a,getMaxAnisotropy:function(){if(void 0!==r)return r;var n=t.get("EXT_texture_filter_anisotropic");return r=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:c,maxTextures:u,maxVertexTextures:l,maxTextureSize:f,maxCubemapSize:h,maxAttributes:d,maxVertexUniforms:p,maxVaryings:m,maxFragmentUniforms:v,vertexTextures:g,floatFragmentTextures:b,floatVertexTextures:g&&b,maxSamples:a?e.getParameter(36183):0}}function Ja(e){var t=this,n=null,r=0,i=!1,a=!1,o=new mi,s=new rr,c={value:null,needsUpdate:!1};function u(){c.value!==n&&(c.value=n,c.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function l(e,n,r,i){var a=null!==e?e.length:0,u=null;if(0!==a){if(u=c.value,!0!==i||null===u){var l=r+4*a,f=n.matrixWorldInverse;s.getNormalMatrix(f),(null===u||u.length0){var s=e.getRenderList(),c=e.getRenderTarget(),u=new La(o.height/2);return u.fromEquirectangularTexture(e,i),t.set(i,u),e.setRenderTarget(c),e.setRenderList(s),i.addEventListener("dispose",r),n(u.texture,i.mapping)}return null}}return i},dispose:function(){t=new WeakMap}}}function $a(e){var t={};function n(n){if(void 0!==t[n])return t[n];var r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,r}return{has:function(e){return null!==n(e)},init:function(e){e.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float")},get:function(e){var t=n(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function eo(e,t,n,r){var i={},a=new WeakMap;function o(e){var s=e.target;for(var c in null!==s.index&&t.remove(s.index),s.attributes)t.remove(s.attributes[c]);s.removeEventListener("dispose",o),delete i[s.id];var u=a.get(s);u&&(t.remove(u),a.delete(s)),r.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(e){var n=[],r=e.index,i=e.attributes.position,o=0;if(null!==r){var s=r.array;o=r.version;for(var c=0,u=s.length;c65535?Ki:qi)(n,1);y.version=o;var w=a.get(e);w&&t.remove(w),a.set(e,y)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",o),i[t.id]=!0,n.memory.geometries++),t},update:function(e){var n=e.attributes;for(var r in n)t.update(n[r],34962);var i=e.morphAttributes;for(var a in i)for(var o=i[a],s=0,c=o.length;s0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;or.call(this,null),this.image={data:e,width:t,height:n,depth:r},this.magFilter=Ce,this.minFilter=Ce,this.wrapR=_e,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function co(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;or.call(this,null),this.image={data:e,width:t,height:n,depth:r},this.magFilter=Ce,this.minFilter=Ce,this.wrapR=_e,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}Ga.physical={uniforms:ja([Ga.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new nr(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new Ni(0)},transmission:{value:0},transmissionMap:{value:null}}]),vertexShader:Wa.meshphysical_vert,fragmentShader:Wa.meshphysical_frag},so.prototype=Object.create(or.prototype),so.prototype.constructor=so,so.prototype.isDataTexture2DArray=!0,co.prototype=Object.create(or.prototype),co.prototype.constructor=co,co.prototype.isDataTexture3D=!0;var uo=new or,lo=new so,fo=new co,ho=new za,po=[],mo=[],vo=new Float32Array(16),go=new Float32Array(9),bo=new Float32Array(4);function yo(e,t,n){var r=e[0];if(r<=0||r>0)return e;var i=t*n,a=po[i];if(void 0===a&&(a=new Float32Array(i),po[i]=a),0!==t){r.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=n,e[o].toArray(a,s)}return a}function wo(e,t){if(e.length!==t.length)return!1;for(var n=0,r=e.length;n/gm;function vs(e){return e.replace(ms,gs)}function gs(e,t){var n=Wa[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return vs(n)}var bs=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,ys=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function ws(e){return e.replace(ys,Ms).replace(bs,xs)}function xs(e,t,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Ms(e,t,n,r)}function Ms(e,t,n,r){for(var i="",a=parseInt(t);a0?e.gammaFactor:1,m=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(hs).join("\n")}(n),v=function(e){var t=[];for(var n in e){var r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(s),g=o.createProgram(),b=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?((i=[v].filter(hs).join("\n")).length>0&&(i+="\n"),(a=[m,v].filter(hs).join("\n")).length>0&&(a+="\n")):(i=[Os(n),"#define SHADER_NAME "+n.shaderName,v,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+p,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(hs).join("\n"),a=[m,Os(n),"#define SHADER_NAME "+n.shaderName,v,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+f:"",n.envMap?"#define "+h:"",n.envMap?"#define "+d:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==he?"#define TONE_MAPPING":"",n.toneMapping!==he?Wa.tonemapping_pars_fragment:"",n.toneMapping!==he?fs("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",Wa.encodings_pars_fragment,n.map?us("mapTexelToLinear",n.mapEncoding):"",n.matcap?us("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?us("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?us("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?us("lightMapTexelToLinear",n.lightMapEncoding):"",ls("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(hs).join("\n")),c=ps(c=ds(c=vs(c),n),n),u=ps(u=ds(u=vs(u),n),n),c=ws(c),u=ws(u),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(b="#version 300 es\n",i=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+i,a=["#define varying in",n.glslVersion===Xn?"":"out highp vec4 pc_fragColor;",n.glslVersion===Xn?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+a);var y,w,x=b+a+u,M=as(o,35633,b+i+c),O=as(o,35632,x);if(o.attachShader(g,M),o.attachShader(g,O),void 0!==n.index0AttributeName?o.bindAttribLocation(g,0,n.index0AttributeName):!0===n.morphTargets&&o.bindAttribLocation(g,0,"position"),o.linkProgram(g),e.debug.checkShaderErrors){var k=o.getProgramInfoLog(g).trim(),C=o.getShaderInfoLog(M).trim(),j=o.getShaderInfoLog(O).trim(),T=!0,A=!0;if(!1===o.getProgramParameter(g,35714)){T=!1;var P=cs(o,M,"vertex"),N=cs(o,O,"fragment");console.error("THREE.WebGLProgram: shader error: ",o.getError(),"35715",o.getProgramParameter(g,35715),"gl.getProgramInfoLog",k,P,N)}else""!==k?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",k):""!==C&&""!==j||(A=!1);A&&(this.diagnostics={runnable:T,programLog:k,vertexShader:{log:C,prefix:i},fragmentShader:{log:j,prefix:a}})}return o.deleteShader(M),o.deleteShader(O),this.getUniforms=function(){return void 0===y&&(y=new is(o,g)),y},this.getAttributes=function(){return void 0===w&&(w=function(e,t){for(var n={},r=e.getProgramParameter(t,35721),i=0;i0,maxBones:k,useVertexTexture:u,morphTargets:i.morphTargets,morphNormals:i.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&p.length>0,shadowMapType:e.shadowMap.type,toneMapping:i.toneMapped?e.toneMapping:he,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:i.side===T,flipSided:i.side===j,depthPacking:void 0!==i.depthPacking&&i.depthPacking,index0AttributeName:i.index0AttributeName,extensionDerivatives:i.extensions&&i.extensions.derivatives,extensionFragDepth:i.extensions&&i.extensions.fragDepth,extensionDrawBuffers:i.extensions&&i.extensions.drawBuffers,extensionShaderTextureLOD:i.extensions&&i.extensions.shaderTextureLOD,rendererExtensionFragDepth:s||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:s||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:s||n.has("EXT_shader_texture_lod"),customProgramCacheKey:i.customProgramCacheKey()}},getProgramCacheKey:function(t){var n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(var r in t.defines)n.push(r),n.push(t.defines[r]);if(!1===t.isRawShaderMaterial){for(var i=0;i1&&r.sort(e||Ss),i.length>1&&i.sort(t||Cs)}}}function Ts(e){var t=new WeakMap;return{get:function(n,r){var i,a=t.get(n);return void 0===a?(i=new js(e),t.set(n,new WeakMap),t.get(n).set(r,i)):void 0===(i=a.get(r))&&(i=new js(e),a.set(r,i)),i},dispose:function(){t=new WeakMap}}}function As(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new hr,color:new Ni};break;case"SpotLight":n={position:new hr,direction:new hr,color:new Ni,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new hr,color:new Ni,distance:0,decay:0};break;case"HemisphereLight":n={direction:new hr,skyColor:new Ni,groundColor:new Ni};break;case"RectAreaLight":n={color:new Ni,position:new hr,halfWidth:new hr,halfHeight:new hr}}return e[t.id]=n,n}}}var Ps=0;function Ns(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function Rs(e,t){for(var n=new As,r=function(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new nr};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new nr,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},a=0;a<9;a++)i.probe.push(new hr);var o=new hr,s=new Hr,c=new Hr;return{setup:function(a){for(var o=0,s=0,c=0,u=0;u<9;u++)i.probe[u].set(0,0,0);var l=0,f=0,h=0,d=0,p=0,m=0,v=0,g=0;a.sort(Ns);for(var b=0,y=a.length;b0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=qa.LTC_FLOAT_1,i.rectAreaLTC2=qa.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=qa.LTC_HALF_1,i.rectAreaLTC2=qa.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=o,i.ambient[1]=s,i.ambient[2]=c;var I=i.hash;I.directionalLength===l&&I.pointLength===f&&I.spotLength===h&&I.rectAreaLength===d&&I.hemiLength===p&&I.numDirectionalShadows===m&&I.numPointShadows===v&&I.numSpotShadows===g||(i.directional.length=l,i.spot.length=h,i.rectArea.length=d,i.point.length=f,i.hemi.length=p,i.directionalShadow.length=m,i.directionalShadowMap.length=m,i.pointShadow.length=v,i.pointShadowMap.length=v,i.spotShadow.length=g,i.spotShadowMap.length=g,i.directionalShadowMatrix.length=m,i.pointShadowMatrix.length=v,i.spotShadowMatrix.length=g,I.directionalLength=l,I.pointLength=f,I.spotLength=h,I.rectAreaLength=d,I.hemiLength=p,I.numDirectionalShadows=m,I.numPointShadows=v,I.numSpotShadows=g,i.version=Ps++)},setupView:function(e,t){for(var n=0,r=0,a=0,u=0,l=0,f=t.matrixWorldInverse,h=0,d=e.length;h1&&void 0!==arguments[1]?arguments[1]:0;return!1===n.has(r)?(i=new zs(e,t),n.set(r,[]),n.get(r).push(i)):a>=n.get(r).length?(i=new zs(e,t),n.get(r).push(i)):i=n.get(r)[a],i},dispose:function(){n=new WeakMap}}}function Is(e){Li.call(this),this.type="MeshDepthMaterial",this.depthPacking=yn,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}function Ds(e){Li.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new hr,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}Is.prototype=Object.create(Li.prototype),Is.prototype.constructor=Is,Is.prototype.isMeshDepthMaterial=!0,Is.prototype.copy=function(e){return Li.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},Ds.prototype=Object.create(Li.prototype),Ds.prototype.constructor=Ds,Ds.prototype.isMeshDistanceMaterial=!0,Ds.prototype.copy=function(e){return Li.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this};function Bs(e,t,n){var r=new Ha,i=new nr,a=new nr,o=new cr,s=[],c=[],u={},l={0:j,1:C,2:T},f=new Aa({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new nr},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),h=f.clone();h.defines.HORIZONTAL_PASS=1;var d=new sa;d.setAttribute("position",new Hi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var p=new Ea(d,f),m=this;function v(n,r){var i=t.update(p);f.uniforms.shadow_pass.value=n.map.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,i,f,p,null),h.uniforms.shadow_pass.value=n.mapPass.texture,h.uniforms.resolution.value=n.mapSize,h.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,i,h,p,null)}function g(e,t,n){var r=e<<0|t<<1|n<<2,i=s[r];return void 0===i&&(i=new Is({depthPacking:wn,morphTargets:e,skinning:t}),s[r]=i),i}function b(e,t,n){var r=e<<0|t<<1|n<<2,i=c[r];return void 0===i&&(i=new Ds({morphTargets:e,skinning:t}),c[r]=i),i}function y(t,n,r,i,a,o,s){var c=null,f=g,h=t.customDepthMaterial;if(!0===i.isPointLight&&(f=b,h=t.customDistanceMaterial),void 0===h){var d=!1;!0===r.morphTargets&&(d=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);var p=!1;!0===t.isSkinnedMesh&&(!0===r.skinning?p=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t)),c=f(d,p,!0===t.isInstancedMesh)}else c=h;if(e.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){var m=c.uuid,v=r.uuid,y=u[m];void 0===y&&(y={},u[m]=y);var w=y[v];void 0===w&&(w=c.clone(),y[v]=w),c=w}return c.visible=r.visible,c.wireframe=r.wireframe,c.side=s===S?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:l[r.side],c.clipShadows=r.clipShadows,c.clippingPlanes=r.clippingPlanes,c.clipIntersection=r.clipIntersection,c.wireframeLinewidth=r.wireframeLinewidth,c.linewidth=r.linewidth,!0===i.isPointLight&&!0===c.isMeshDistanceMaterial&&(c.referencePosition.setFromMatrixPosition(i.matrixWorld),c.nearDistance=a,c.farDistance=o),c}function w(n,i,a,o,s){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===S)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);var c=t.update(n),u=n.material;if(Array.isArray(u))for(var l=c.groups,f=0,h=l.length;fn||i.y>n)&&(i.x>n&&(a.x=Math.floor(n/y.x),i.x=a.x*y.x,b.mapSize.x=a.x),i.y>n&&(a.y=Math.floor(n/y.y),i.y=a.y*y.y,b.mapSize.y=a.y)),null===b.map&&!b.isPointLightShadow&&this.type===S){var x={minFilter:Ne,magFilter:Ne,format:Qe};b.map=new ur(i.x,i.y,x),b.map.texture.name=g.name+".shadowMap",b.mapPass=new ur(i.x,i.y,x),b.camera.updateProjectionMatrix()}if(null===b.map){var M={minFilter:Ce,magFilter:Ce,format:Qe};b.map=new ur(i.x,i.y,M),b.map.texture.name=g.name+".shadowMap",b.camera.updateProjectionMatrix()}e.setRenderTarget(b.map),e.clear();for(var O=b.getViewportCount(),k=0;k=1):-1!==le.indexOf("OpenGL ES")&&(ue=parseFloat(/^OpenGL ES (\d)/.exec(le)[1]),P=ue>=2);var fe=null,he={},de=new cr,pe=new cr;function me(t,n,r){var i=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(var o=0;or||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!==typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&e instanceof ImageBitmap){var a=t?tr.floorPowerOfTwo:Math.floor,o=a(i*e.width),s=a(i*e.height);void 0===l&&(l=b(o,s));var c=n?b(o,s):l;return c.width=o,c.height=s,c.getContext("2d").drawImage(e,0,0,o,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+o+"x"+s+")."),c}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function w(e){return tr.isPowerOfTwo(e.width)&&tr.isPowerOfTwo(e.height)}function x(e,t){return e.generateMipmaps&&t&&e.minFilter!==Ce&&e.minFilter!==Ne}function M(t,n,i,a){e.generateMipmap(t),r.get(n).__maxMipLevel=Math.log(Math.max(i,a))*Math.LOG2E}function O(n,r,i){if(!1===f)return r;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}var a=r;return 6403===r&&(5126===i&&(a=33326),5131===i&&(a=33325),5121===i&&(a=33321)),6407===r&&(5126===i&&(a=34837),5131===i&&(a=34843),5121===i&&(a=32849)),6408===r&&(5126===i&&(a=34836),5131===i&&(a=34842),5121===i&&(a=32856)),33325!==a&&33326!==a&&34842!==a&&34836!==a||t.get("EXT_color_buffer_float"),a}function k(e){return e===Ce||e===je||e===Ae?9728:9729}function E(t){var n=t.target;n.removeEventListener("dispose",E),function(t){var n=r.get(t);if(void 0===n.__webglInit)return;e.deleteTexture(n.__webglTexture),r.remove(t)}(n),n.isVideoTexture&&v.delete(n),o.memory.textures--}function _(t){var n=t.target;n.removeEventListener("dispose",_),function(t){var n=r.get(t),i=r.get(t.texture);if(!t)return;void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(var a=0;a<6;a++)e.deleteFramebuffer(n.__webglFramebuffer[a]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[a]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&e.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer);r.remove(t.texture),r.remove(t)}(n),o.memory.textures--}var S=0;function C(e,t){var i=r.get(e);if(e.isVideoTexture&&function(e){var t=o.render.frame;v.get(e)!==t&&(v.set(e,t),e.update())}(e),e.version>0&&i.__version!==e.version){var a=e.image;if(void 0===a)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==a.complete)return void R(i,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,i.__webglTexture)}function j(t,i){var o=r.get(t);t.version>0&&o.__version!==t.version?function(t,r,i){if(6!==r.image.length)return;N(t,r),n.activeTexture(33984+i),n.bindTexture(34067,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment);for(var o=r&&(r.isCompressedTexture||r.image[0].isCompressedTexture),s=r.image[0]&&r.image[0].isDataTexture,c=[],u=0;u<6;u++)c[u]=o||s?s?r.image[u].image:r.image[u]:y(r.image[u],!1,!0,d);var l,h=c[0],p=w(h)||f,m=a.convert(r.format),v=a.convert(r.type),g=O(r.internalFormat,m,v);if(P(34067,r,p),o){for(var b=0;b<6;b++){l=c[b].mipmaps;for(var k=0;k1||r.get(a).__currentAnisotropy)&&(e.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy)}}function N(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",E),t.__webglTexture=e.createTexture(),o.memory.textures++)}function R(t,r,i){var o=3553;r.isDataTexture2DArray&&(o=35866),r.isDataTexture3D&&(o=32879),N(t,r),n.activeTexture(33984+i),n.bindTexture(o,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment);var s,c=function(e){return!f&&(e.wrapS!==_e||e.wrapT!==_e||e.minFilter!==Ce&&e.minFilter!==Ne)}(r)&&!1===w(r.image),u=y(r.image,c,!1,p),l=w(u)||f,h=a.convert(r.format),d=a.convert(r.type),m=O(r.internalFormat,h,d);P(o,r,l);var v=r.mipmaps;if(r.isDepthTexture)m=6402,f?m=r.type===We?36012:r.type===Ue?33190:r.type===Xe?35056:33189:r.type===We&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===nt&&6402===m&&r.type!==Fe&&r.type!==Ue&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=Fe,d=a.convert(r.type)),r.format===rt&&6402===m&&(m=34041,r.type!==Xe&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=Xe,d=a.convert(r.type))),n.texImage2D(3553,0,m,u.width,u.height,0,h,d,null);else if(r.isDataTexture)if(v.length>0&&l){for(var g=0,b=v.length;g0&&l){for(var _=0,S=v.length;_=h&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+h),S+=1,e},this.resetTextureUnits=function(){S=0},this.setTexture2D=C,this.setTexture2DArray=function(e,t){var i=r.get(e);e.version>0&&i.__version!==e.version?R(i,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){var i=r.get(e);e.version>0&&i.__version!==e.version?R(i,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=j,this.setupRenderTarget=function(t){var i=r.get(t),s=r.get(t.texture);t.addEventListener("dispose",_),s.__webglTexture=e.createTexture(),o.memory.textures++;var c=!0===t.isWebGLCubeRenderTarget,u=!0===t.isWebGLMultisampleRenderTarget,l=w(t)||f;if(!f||t.texture.format!==Je||t.texture.type!==We&&t.texture.type!==qe||(t.texture.format=Qe,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),c){i.__webglFramebuffer=[];for(var h=0;h<6;h++)i.__webglFramebuffer[h]=e.createFramebuffer()}else if(i.__webglFramebuffer=e.createFramebuffer(),u)if(f){i.__webglMultisampledFramebuffer=e.createFramebuffer(),i.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,i.__webglColorRenderbuffer);var d=a.convert(t.texture.format),p=a.convert(t.texture.type),m=O(t.texture.internalFormat,d,p),v=D(t);e.renderbufferStorageMultisample(36161,v,m,t.width,t.height),e.bindFramebuffer(36160,i.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,i.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(i.__webglDepthRenderbuffer=e.createRenderbuffer(),L(i.__webglDepthRenderbuffer,t,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(c){n.bindTexture(34067,s.__webglTexture),P(34067,t.texture,l);for(var g=0;g<6;g++)z(i.__webglFramebuffer[g],t,36064,34069+g);x(t.texture,l)&&M(34067,t.texture,t.width,t.height),n.bindTexture(34067,null)}else n.bindTexture(3553,s.__webglTexture),P(3553,t.texture,l),z(i.__webglFramebuffer,t,36064,3553),x(t.texture,l)&&M(3553,t.texture,t.width,t.height),n.bindTexture(3553,null);t.depthBuffer&&I(t)},this.updateRenderTargetMipmap=function(e){var t=e.texture;if(x(t,w(e)||f)){var i=e.isWebGLCubeRenderTarget?34067:3553,a=r.get(t).__webglTexture;n.bindTexture(i,a),M(i,t,e.width,e.height),n.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(f){var n=r.get(t);e.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,n.__webglFramebuffer);var i=t.width,a=t.height,o=16384;t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024),e.blitFramebuffer(0,0,i,a,0,0,i,a,o,9728),e.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===B&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),B=!0),e=e.texture),C(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===H&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),H=!0),e=e.texture),j(e,t)}}function Vs(e,t,n){var r=n.isWebGL2;return{convert:function(e){var n;if(e===De)return 5121;if(e===Ge)return 32819;if(e===Ke)return 32820;if(e===Ye)return 33635;if(e===Be)return 5120;if(e===He)return 5122;if(e===Fe)return 5123;if(e===Ve)return 5124;if(e===Ue)return 5125;if(e===We)return 5126;if(e===qe)return r?5131:null!==(n=t.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(e===Ze)return 6406;if(e===Je)return 6407;if(e===Qe)return 6408;if(e===$e)return 6409;if(e===et)return 6410;if(e===nt)return 6402;if(e===rt)return 34041;if(e===it)return 6403;if(e===at)return 36244;if(e===ot)return 33319;if(e===st)return 33320;if(e===ct)return 36248;if(e===ut)return 36249;if(e===lt||e===ft||e===ht||e===dt){if(null===(n=t.get("WEBGL_compressed_texture_s3tc")))return null;if(e===lt)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===ft)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===ht)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===dt)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e===pt||e===mt||e===vt||e===gt){if(null===(n=t.get("WEBGL_compressed_texture_pvrtc")))return null;if(e===pt)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===mt)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===vt)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===gt)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e===bt)return null!==(n=t.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((e===yt||e===wt)&&null!==(n=t.get("WEBGL_compressed_texture_etc"))){if(e===yt)return n.COMPRESSED_RGB8_ETC2;if(e===wt)return n.COMPRESSED_RGBA8_ETC2_EAC}return e===xt||e===Mt||e===Ot||e===kt||e===Et||e===_t||e===St||e===Ct||e===jt||e===Tt||e===At||e===Pt||e===Nt||e===Rt||e===Lt||e===It||e===Dt||e===Bt||e===Ht||e===Ft||e===Vt||e===Ut||e===Wt||e===qt||e===Gt||e===Kt||e===Yt||e===Xt?null!==(n=t.get("WEBGL_compressed_texture_astc"))?e:null:e===zt?null!==(n=t.get("EXT_texture_compression_bptc"))?e:null:e===Xe?r?34042:null!==(n=t.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function Us(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Na.call(this),this.cameras=e}function Ws(){fi.call(this),this.type="Group"}function qs(){this._targetRay=null,this._grip=null,this._hand=null}function Gs(e,t){var n=this,r=null,i=1,a=null,c="local-floor",u=null,l=[],f=new Map,h=new Na;h.layers.enable(1),h.viewport=new cr;var d=new Na;d.layers.enable(2),d.viewport=new cr;var p=[h,d],m=new Us;m.layers.enable(1),m.layers.enable(2);var v=null,g=null;function b(e){var t=f.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function y(){f.forEach((function(e,t){e.disconnect(t)})),f.clear(),v=null,g=null,e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),E.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function w(e){for(var t=r.inputSources,n=0;n0&&Oe(a,e,t),o.length>0&&Oe(o,e,t),!0===e.isScene&&e.onAfterRender(p,e,t),null!==y&&(G.updateRenderTargetMipmap(y),G.updateMultisampleRenderTarget(y)),U.buffers.depth.setTest(!0),U.buffers.depth.setMask(!0),U.buffers.color.setMask(!0),U.setPolygonOffset(!1),d.pop(),h=d.length>0?d[d.length-1]:null,f=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(e){v!==e&&null===y&&ce.bindFramebuffer(36160,e),v=e},this.getActiveCubeFace=function(){return g},this.getActiveMipmapLevel=function(){return b},this.getRenderList=function(){return f},this.setRenderList=function(e){f=e},this.getRenderTarget=function(){return y},this.setRenderTarget=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;y=e,g=t,b=n,e&&void 0===q.get(e).__webglFramebuffer&&G.setupRenderTarget(e);var r=v,i=!1;if(e){var a=q.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=a[t],i=!0):r=e.isWebGLMultisampleRenderTarget?q.get(e).__webglMultisampledFramebuffer:a,O.copy(e.viewport),k.copy(e.scissor),E=e.scissorTest}else O.copy(A).multiplyScalar(C).floor(),k.copy(P).multiplyScalar(C).floor(),E=N;if(w!==r&&(ce.bindFramebuffer(36160,r),w=r),U.viewport(O),U.scissor(k),U.setScissorTest(E),i){var o=q.get(e.texture);ce.framebufferTexture2D(36160,36064,34069+t,o.__webglTexture,n)}},this.readRenderTargetPixels=function(e,t,n,r,i,a,o){if(e&&e.isWebGLRenderTarget){var s=q.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){var c=!1;s!==w&&(ce.bindFramebuffer(36160,s),c=!0);try{var u=e.texture,l=u.format,f=u.type;if(l!==Qe&&oe.convert(l)!==ce.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");var h=f===qe&&(F.has("EXT_color_buffer_half_float")||V.isWebGL2&&F.has("EXT_color_buffer_float"));if(f!==De&&oe.convert(f)!==ce.getParameter(35738)&&(f!==We||!(V.isWebGL2||F.has("OES_texture_float")||F.has("WEBGL_color_buffer_float")))&&!h)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===ce.checkFramebufferStatus(36160)?t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&ce.readPixels(t,n,r,i,oe.convert(l),oe.convert(f),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{c&&ce.bindFramebuffer(36160,w)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Math.pow(2,-n),i=Math.floor(t.image.width*r),a=Math.floor(t.image.height*r),o=oe.convert(t.format);G.setTexture2D(t,0),ce.copyTexImage2D(3553,n,o,e.x,e.y,i,a,0),U.unbindTexture()},this.copyTextureToTexture=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=t.image.width,a=t.image.height,o=oe.convert(n.format),s=oe.convert(n.type);G.setTexture2D(n,0),ce.pixelStorei(37440,n.flipY),ce.pixelStorei(37441,n.premultiplyAlpha),ce.pixelStorei(3317,n.unpackAlignment),t.isDataTexture?ce.texSubImage2D(3553,r,e.x,e.y,i,a,o,s,t.image.data):t.isCompressedTexture?ce.compressedTexSubImage2D(3553,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,o,t.mipmaps[0].data):ce.texSubImage2D(3553,r,e.x,e.y,o,s,t.image),0===r&&n.generateMipmaps&&ce.generateMipmap(3553),U.unbindTexture()},this.initTexture=function(e){G.setTexture2D(e,0),U.unbindTexture()},this.resetState=function(){U.reset(),se.reset()},"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Xs(e){Ys.call(this,e)}Us.prototype=Object.assign(Object.create(Na.prototype),{constructor:Us,isArrayCamera:!0}),Ws.prototype=Object.assign(Object.create(fi.prototype),{constructor:Ws,isGroup:!0}),Object.assign(qs.prototype,{constructor:qs,getHandSpace:function(){return null===this._hand&&(this._hand=new Ws,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new Ws,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new Ws,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this},disconnect:function(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},update:function(e,t,n){var r=null,i=null,a=null,o=this._targetRay,s=this._grip,u=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState)if(u&&e.hand){a=!0;var l,f=Object(c.a)(e.hand.values());try{for(f.s();!(l=f.n()).done;){var h=l.value,d=t.getJointPose(h,n);if(void 0===u.joints[h.jointName]){var p=new Ws;p.matrixAutoUpdate=!1,p.visible=!1,u.joints[h.jointName]=p,u.add(p)}var m=u.joints[h.jointName];null!==d&&(m.matrix.fromArray(d.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.jointRadius=d.radius),m.visible=null!==d}}catch(y){f.e(y)}finally{f.f()}var v=u.joints["index-finger-tip"],g=u.joints["thumb-tip"],b=v.position.distanceTo(g.position);u.inputState.pinching&&b>.025?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&b<=.015&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&null!==(r=t.getPose(e.targetRaySpace,n))&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale)),null!==s&&e.gripSpace&&null!==(i=t.getPose(e.gripSpace,n))&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale));return null!==o&&(o.visible=null!==r),null!==s&&(s.visible=null!==i),null!==u&&(u.visible=null!==a),this}}),Object.assign(Gs.prototype,Zn.prototype),Xs.prototype=Object.assign(Object.create(Ys.prototype),{constructor:Xs,isWebGL1Renderer:!0});var Zs=function(){function e(t,n){Object(m.a)(this,e),Object.defineProperty(this,"isFogExp2",{value:!0}),this.name="",this.color=new Ni(t),this.density=void 0!==n?n:25e-5}return Object(v.a)(e,[{key:"clone",value:function(){return new e(this.color,this.density)}},{key:"toJSON",value:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}]),e}(),Js=function(){function e(t,n,r){Object(m.a)(this,e),Object.defineProperty(this,"isFog",{value:!0}),this.name="",this.color=new Ni(t),this.near=void 0!==n?n:1,this.far=void 0!==r?r:1e3}return Object(v.a)(e,[{key:"clone",value:function(){return new e(this.color,this.near,this.far)}},{key:"toJSON",value:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}]),e}(),Qs=function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(){var e;return Object(m.a)(this,n),e=t.call(this),Object.defineProperty(Object(h.a)(e),"isScene",{value:!0}),e.type="Scene",e.background=null,e.environment=null,e.fog=null,e.overrideMaterial=null,e.autoUpdate=!0,"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:Object(h.a)(e)})),e}return Object(v.a)(n,[{key:"copy",value:function(e,t){return Object(l.a)(Object(f.a)(n.prototype),"copy",this).call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}},{key:"toJSON",value:function(e){var t=Object(l.a)(Object(f.a)(n.prototype),"toJSON",this).call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.environment&&(t.object.environment=this.environment.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}]),n}(fi);function $s(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=Bn,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=tr.generateUUID()}Object.defineProperty($s.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign($s.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(var r=0,i=this.stride;r1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this},clone:function(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=tr.generateUUID()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);var t=new $s(new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),this.stride);return t.setUsage(this.usage),t},onUpload:function(e){return this.onUploadCallback=e,this},toJSON:function(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=tr.generateUUID()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}});var ec,tc=new hr;function nc(e,t,n,r){this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===r}function rc(e){Li.call(this),this.type="SpriteMaterial",this.color=new Ni(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}Object.defineProperties(nc.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}},needsUpdate:{set:function(e){this.data.needsUpdate=e}}}),Object.assign(nc.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(e){for(var t=0,n=this.data.count;te.far||t.push({distance:s,point:ic.clone(),uv:_i.getUV(ic,lc,fc,hc,dc,pc,mc,new nr),face:null,object:this})}},copy:function(e){return fi.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}});var bc=new hr,yc=new hr;function wc(){fi.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}wc.prototype=Object.assign(Object.create(fi.prototype),{constructor:wc,isLOD:!0,copy:function(e){fi.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,r=t.length;n1&&void 0!==arguments[1]?arguments[1]:0;t=Math.abs(t);var n,r=this.levels;for(n=0;n0){var n,r;for(n=1,r=t.length;n0){bc.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(bc);this.getObjectForDistance(n).raycast(e,t)}},update:function(e){var t=this.levels;if(t.length>1){bc.setFromMatrixPosition(e.matrixWorld),yc.setFromMatrixPosition(this.matrixWorld);var n,r,i=bc.distanceTo(yc)/e.zoom;for(t[0].object.visible=!0,n=1,r=t.length;n=t[n].distance;n++)t[n-1].object.visible=!1,t[n].object.visible=!0;for(this._currentLevel=n-1;n0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.uuid=tr.generateUUID(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}Object.assign(Tc.prototype,{init:function(){var e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(var n=0,r=this.bones.length;n0&&void 0!==arguments[0]?arguments[0]:new sa,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Lc;fi.call(this),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}Vc.prototype=Object.assign(Object.create(fi.prototype),{constructor:Vc,isLine:!0,copy:function(e){return fi.prototype.copy.call(this,e),this.material=e.material,this.geometry=e.geometry,this},computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],r=1,i=t.count;ro)){l.applyMatrix4(this.matrixWorld);var y=e.ray.origin.distanceTo(l);ye.far||t.push({distance:y,point:u.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}else for(var w=0,x=d.count-1;wo)){l.applyMatrix4(this.matrixWorld);var M=e.ray.origin.distanceTo(l);Me.far||t.push({distance:M,point:u.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},updateMorphTargets:function(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,n=Object.keys(t);if(n.length>0){var r=t[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,a=r.length;i0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});var Uc=new hr,Wc=new hr;function qc(e,t){Vc.call(this,e,t),this.type="LineSegments"}function Gc(e,t){Vc.call(this,e,t),this.type="LineLoop"}function Kc(e){Li.call(this),this.type="PointsMaterial",this.color=new Ni(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}qc.prototype=Object.assign(Object.create(Vc.prototype),{constructor:qc,isLineSegments:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[],r=0,i=t.count;r0&&void 0!==arguments[0]?arguments[0]:new sa,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Kc;fi.call(this),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}function $c(e,t,n,r,i,a,o){var s=Xc.distanceSqToPoint(e);if(si.far)return;a.push({distance:u,distanceToRay:Math.sqrt(s),point:c,index:t,face:null,object:o})}}function eu(e,t,n,r,i,a,o,s,c){or.call(this,e,t,n,r,i,a,o,s,c),this.format=void 0!==o?o:Je,this.minFilter=void 0!==a?a:Ne,this.magFilter=void 0!==i?i:Ne,this.generateMipmaps=!1;var u=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){u.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}function tu(e,t,n,r,i,a,o,s,c,u,l,f){or.call(this,null,a,o,s,c,u,r,i,l,f),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function nu(e,t,n,r,i,a,o,s,c){or.call(this,e,t,n,r,i,a,o,s,c),this.needsUpdate=!0}function ru(e,t,n,r,i,a,o,s,c,u){if((u=void 0!==u?u:nt)!==nt&&u!==rt)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&u===nt&&(n=Fe),void 0===n&&u===rt&&(n=Xe),or.call(this,null,r,i,a,o,s,u,n,c),this.image={width:e,height:t},this.magFilter=void 0!==o?o:Ce,this.minFilter=void 0!==s?s:Ce,this.flipY=!1,this.generateMipmaps=!1}Qc.prototype=Object.assign(Object.create(fi.prototype),{constructor:Qc,isPoints:!0,copy:function(e){return fi.prototype.copy.call(this,e),this.material=e.material,this.geometry=e.geometry,this},raycast:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),Zc.copy(n.boundingSphere),Zc.applyMatrix4(r),Zc.radius+=i,!1!==e.ray.intersectsSphere(Zc)){Yc.copy(r).invert(),Xc.copy(e.ray).applyMatrix4(Yc);var a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a;if(n.isBufferGeometry){var s=n.index,c=n.attributes.position;if(null!==s)for(var u=s.array,l=0,f=u.length;l0){var r=t[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,a=r.length;i0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),eu.prototype=Object.assign(Object.create(or.prototype),{constructor:eu,clone:function(){return new this.constructor(this.image).copy(this)},isVideoTexture:!0,update:function(){var e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),tu.prototype=Object.create(or.prototype),tu.prototype.constructor=tu,tu.prototype.isCompressedTexture=!0,nu.prototype=Object.create(or.prototype),nu.prototype.constructor=nu,nu.prototype.isCanvasTexture=!0,ru.prototype=Object.create(or.prototype),ru.prototype.constructor=ru,ru.prototype.isDepthTexture=!0;var iu=function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;Object(m.a)(this,n),(e=t.call(this)).type="CircleGeometry",e.parameters={radius:r,segments:i,thetaStart:a,thetaLength:o},i=Math.max(3,i);var s=[],c=[],u=[],l=[],f=new hr,h=new nr;c.push(0,0,0),u.push(0,0,1),l.push(.5,.5);for(var d=0,p=3;d<=i;d++,p+=3){var v=a+d/i*o;f.x=r*Math.cos(v),f.y=r*Math.sin(v),c.push(f.x,f.y,f.z),u.push(0,0,1),h.x=(c[p]/r+1)/2,h.y=(c[p+1]/r+1)/2,l.push(h.x,h.y)}for(var g=1;g<=i;g++)s.push(g,g+1,0);return e.setIndex(s),e.setAttribute("position",new Xi(c,3)),e.setAttribute("normal",new Xi(u,3)),e.setAttribute("uv",new Xi(l,2)),e}return n}(sa),au=function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,c=arguments.length>5&&void 0!==arguments[5]&&arguments[5],u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:2*Math.PI;Object(m.a)(this,n),(e=t.call(this)).type="CylinderGeometry",e.parameters={radiusTop:r,radiusBottom:i,height:a,radialSegments:o,heightSegments:s,openEnded:c,thetaStart:u,thetaLength:l};var f=Object(h.a)(e);o=Math.floor(o),s=Math.floor(s);var d=[],p=[],v=[],g=[],b=0,y=[],w=a/2,x=0;function M(){for(var e=new hr,t=new hr,n=0,c=(i-r)/a,h=0;h<=s;h++){for(var m=[],M=h/s,O=M*(i-r)+r,k=0;k<=o;k++){var E=k/o,_=E*l+u,S=Math.sin(_),C=Math.cos(_);t.x=O*S,t.y=-M*a+w,t.z=O*C,p.push(t.x,t.y,t.z),e.set(S,c,C).normalize(),v.push(e.x,e.y,e.z),g.push(E,1-M),m.push(b++)}y.push(m)}for(var j=0;j0&&O(!0),i>0&&O(!1)),e.setIndex(d),e.setAttribute("position",new Xi(p,3)),e.setAttribute("normal",new Xi(v,3)),e.setAttribute("uv",new Xi(g,2)),e}return n}(sa),ou=function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2*Math.PI;return Object(m.a)(this,n),(e=t.call(this,0,r,i,a,o,s,c,u)).type="ConeGeometry",e.parameters={radius:r,height:i,radialSegments:a,heightSegments:o,openEnded:s,thetaStart:c,thetaLength:u},e}return n}(au),su=function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(e,r){var i,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;Object(m.a)(this,n),(i=t.call(this)).type="PolyhedronGeometry",i.parameters={vertices:e,indices:r,radius:a,detail:o};var s=[],c=[];function u(e){for(var t=new hr,n=new hr,i=new hr,a=0;a.9&&a<.1&&(t<.2&&(c[e+0]+=1),n<.2&&(c[e+2]+=1),r<.2&&(c[e+4]+=1))}}function p(e){s.push(e.x,e.y,e.z)}function v(t,n){var r=3*t;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function g(){for(var e=new hr,t=new hr,n=new hr,r=new hr,i=new nr,a=new nr,o=new nr,u=0,l=0;u0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(m.a)(this,n);var a=(1+Math.sqrt(5))/2,o=1/a,s=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-o,-a,0,-o,a,0,o,-a,0,o,a,-o,-a,0,-o,a,0,o,-a,0,o,a,0,-a,0,-o,a,0,-o,-a,0,o,a,0,o],c=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];return(e=t.call(this,s,c,r,i)).type="DodecahedronGeometry",e.parameters={radius:r,detail:i},e}return n}(su),uu=new hr,lu=new hr,fu=new hr,hu=new _i,du=function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(e,r){var a;if(Object(m.a)(this,n),(a=t.call(this)).type="EdgesGeometry",a.parameters={thresholdAngle:r},r=void 0!==r?r:1,!0===e.isGeometry)return console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),Object(i.a)(a);for(var o=Math.pow(10,4),s=Math.cos(tr.DEG2RAD*r),c=e.getIndex(),u=e.getAttribute("position"),l=c?c.count:u.count,f=[0,0,0],h=["a","b","c"],d=new Array(3),p={},v=[],g=0;g80*n){r=a=e[0],i=o=e[1];for(var p=n;pa&&(a=s),c>o&&(o=c);u=0!==(u=Math.max(a-r,o-i))?1/u:0}return gu(h,d,n,r,i,u),d};function mu(e,t,n,r,i){var a,o;if(i===function(e,t,n,r){for(var i=0,a=t,o=n-r;a0)for(a=t;a=t;a-=r)o=Lu(a,e[a],e[a+1],o);return o&&Tu(o,o.next)&&(Iu(o),o=o.next),o}function vu(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!Tu(r,r.next)&&0!==ju(r.prev,r,r.next))r=r.next;else{if(Iu(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function gu(e,t,n,r,i,a,o){if(e){!o&&a&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=Eu(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,a,o,s,c,u=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t0||c>0&&r;)0!==s&&(0===c||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,u*=2}while(o>1)}(i)}(e,r,i,a);for(var s,c,u=e;e.prev!==e.next;)if(s=e.prev,c=e.next,a?yu(e,r,i,a):bu(e))t.push(s.i/n),t.push(e.i/n),t.push(c.i/n),Iu(e),e=c.next,u=c.next;else if((e=c)===u){o?1===o?gu(e=wu(vu(e),t,n),t,n,r,i,a,2):2===o&&xu(e,t,n,r,i,a):gu(vu(e),t,n,r,i,a,1);break}}}function bu(e){var t=e.prev,n=e,r=e.next;if(ju(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(Su(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&ju(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function yu(e,t,n,r){var i=e.prev,a=e,o=e.next;if(ju(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,l=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=Eu(s,c,t,n,r),h=Eu(u,l,t,n,r),d=e.prevZ,p=e.nextZ;d&&d.z>=f&&p&&p.z<=h;){if(d!==e.prev&&d!==e.next&&Su(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&ju(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,p!==e.prev&&p!==e.next&&Su(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&ju(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&Su(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&ju(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&Su(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&ju(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function wu(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!Tu(i,a)&&Au(i,r,r.next,a)&&Ru(i,a)&&Ru(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),Iu(r),Iu(r.next),r=e=a),r=r.next}while(r!==e);return vu(r)}function xu(e,t,n,r,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Cu(o,s)){var c=zu(o,s);return o=vu(o,o.next),c=vu(c,c.next),gu(o,t,n,r,i,a),void gu(c,t,n,r,i,a)}s=s.next}o=o.next}while(o!==e)}function Mu(e,t){return e.x-t.x}function Ou(e,t){if(t=function(e,t){var n,r=t,i=e.x,a=e.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>o){if(o=s,s===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x=r.x&&r.x>=l&&i!==r.x&&Su(an.x||r.x===n.x&&ku(n,r)))&&(n=r,h=c)),r=r.next}while(r!==u);return n}(e,t)){var n=zu(t,e);vu(t,t.next),vu(n,n.next)}}function ku(e,t){return ju(e.prev,e,t.prev)<0&&ju(t.next,e,e.next)<0}function Eu(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function _u(e){var t=e,n=e;do{(t.x=0&&(e-o)*(r-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}function Cu(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Au(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(Ru(e,t)&&Ru(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!==n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(ju(e.prev,e,t.prev)||ju(e,t.prev,t))||Tu(e,t)&&ju(e.prev,e,e.next)>0&&ju(t.prev,t,t.next)>0)}function ju(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Tu(e,t){return e.x===t.x&&e.y===t.y}function Au(e,t,n,r){var i=Nu(ju(e,t,n)),a=Nu(ju(e,t,r)),o=Nu(ju(n,r,e)),s=Nu(ju(n,r,t));return i!==a&&o!==s||(!(0!==i||!Pu(e,n,t))||(!(0!==a||!Pu(e,r,t))||(!(0!==o||!Pu(n,e,r))||!(0!==s||!Pu(n,t,r)))))}function Pu(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Nu(e){return e>0?1:e<0?-1:0}function Ru(e,t){return ju(e.prev,e,e.next)<0?ju(e,t,e.next)>=0&&ju(e,e.prev,t)>=0:ju(e,t,e.prev)<0||ju(e,e.next,t)<0}function zu(e,t){var n=new Du(e.i,e.x,e.y),r=new Du(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function Lu(e,t,n,r){var i=new Du(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Iu(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Du(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var Bu={area:function(e){for(var t=e.length,n=0,r=t-1,i=0;i2&&e[t-1].equals(e[0])&&e.pop()}function Fu(e,t){for(var n=0;nNumber.EPSILON){var h=Math.sqrt(l),d=Math.sqrt(c*c+u*u),p=t.x-s/h,m=t.y+o/h,v=((n.x-u/d-p)*u-(n.y+c/d-m)*c)/(o*u-s*c),g=(r=p+o*v-e.x)*r+(i=m+s*v-e.y)*i;if(g<=2)return new nr(r,i);a=Math.sqrt(g/2)}else{var b=!1;o>Number.EPSILON?c>Number.EPSILON&&(b=!0):o<-Number.EPSILON?c<-Number.EPSILON&&(b=!0):Math.sign(s)===Math.sign(u)&&(b=!0),b?(r=-s,i=o,a=Math.sqrt(l)):(r=o,i=s,a=Math.sqrt(l/2))}return new nr(r/a,i/a)}for(var I=[],D=0,B=j.length,H=B-1,F=D+1;D=0;ge--){for(var be=ge/d,ye=l*Math.cos(be*Math.PI/2),we=f*Math.sin(be*Math.PI/2)+h,xe=0,Me=j.length;xe=0;){var r=n,a=n-1;a<0&&(a=e.length-1);for(var o=0,s=i+2*d;o0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(m.a)(this,n);var a=(1+Math.sqrt(5))/2,o=[-1,a,0,1,a,0,-1,-a,0,1,-a,0,0,-1,a,0,1,a,0,-1,-a,0,1,-a,a,0,-1,a,0,1,-a,0,-1,-a,0,1],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];return(e=t.call(this,o,s,r,i)).type="IcosahedronGeometry",e.parameters={radius:r,detail:i},e}return n}(su),qu=function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;Object(m.a)(this,n),(r=t.call(this)).type="LatheGeometry",r.parameters={points:e,segments:i,phiStart:a,phiLength:o},i=Math.floor(i),o=tr.clamp(o,0,2*Math.PI);for(var s=[],c=[],u=[],l=1/i,f=new hr,h=new nr,d=0;d<=i;d++)for(var p=a+d*l*o,v=Math.sin(p),g=Math.cos(p),b=0;b<=e.length-1;b++)f.x=e[b].x*v,f.y=e[b].y,f.z=e[b].x*g,c.push(f.x,f.y,f.z),h.x=d/i,h.y=b/(e.length-1),u.push(h.x,h.y);for(var y=0;y0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(m.a)(this,n);var a=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],o=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];return(e=t.call(this,a,o,r,i)).type="OctahedronGeometry",e.parameters={radius:r,detail:i},e}return n}(su);function Ku(e,t,n){sa.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n};var r=[],i=[],a=[],o=[],s=1e-5,c=new hr,u=new hr,l=new hr,f=new hr,h=new hr;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");for(var d=t+1,p=0;p<=n;p++)for(var m=p/n,v=0;v<=t;v++){var g=v/t;e(g,m,u),i.push(u.x,u.y,u.z),g-s>=0?(e(g-s,m,l),f.subVectors(u,l)):(e(g+s,m,l),f.subVectors(l,u)),m-s>=0?(e(g,m-s,l),h.subVectors(u,l)):(e(g,m+s,l),h.subVectors(l,u)),c.crossVectors(f,h).normalize(),a.push(c.x,c.y,c.z),o.push(g,m)}for(var b=0;b0&&void 0!==arguments[0]?arguments[0]:.5,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI;Object(m.a)(this,n),(e=t.call(this)).type="RingGeometry",e.parameters={innerRadius:r,outerRadius:i,thetaSegments:a,phiSegments:o,thetaStart:s,thetaLength:c},a=Math.max(3,a);for(var u=[],l=[],f=[],h=[],d=r,p=(i-r)/(o=Math.max(1,o)),v=new hr,g=new nr,b=0;b<=o;b++){for(var y=0;y<=a;y++){var w=s+y/a*c;v.x=d*Math.cos(w),v.y=d*Math.sin(w),l.push(v.x,v.y,v.z),f.push(0,0,1),g.x=(v.x/i+1)/2,g.y=(v.y/i+1)/2,h.push(g.x,g.y)}d+=p}for(var x=0;x1&&void 0!==arguments[1]?arguments[1]:12;Object(m.a)(this,n),(r=t.call(this)).type="ShapeGeometry",r.parameters={shapes:e,curveSegments:i};var a=[],o=[],s=[],c=[],u=0,l=0;if(!1===Array.isArray(e))h(e);else for(var f=0;f0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:6,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Math.PI;Object(m.a)(this,n),(e=t.call(this)).type="SphereGeometry",e.parameters={radius:r,widthSegments:i,heightSegments:a,phiStart:o,phiLength:s,thetaStart:c,thetaLength:u},i=Math.max(3,Math.floor(i)),a=Math.max(2,Math.floor(a));for(var l=Math.min(c+u,Math.PI),f=0,h=[],d=new hr,p=new hr,v=[],g=[],b=[],y=[],w=0;w<=a;w++){var x=[],M=w/a,O=0;0==w&&0==c?O=.5/i:w==a&&l==Math.PI&&(O=-.5/i);for(var k=0;k<=i;k++){var E=k/i;d.x=-r*Math.cos(o+E*s)*Math.sin(c+M*u),d.y=r*Math.cos(c+M*u),d.z=r*Math.sin(o+E*s)*Math.sin(c+M*u),g.push(d.x,d.y,d.z),p.copy(d).normalize(),b.push(p.x,p.y,p.z),y.push(E+O,1-M),x.push(f++)}h.push(x)}for(var _=0;_0)&&v.push(C,j,A),(_!==a-1||l0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(m.a)(this,n);var a=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],o=[2,1,0,0,3,2,1,3,0,2,3,1];return(e=t.call(this,a,o,r,i)).type="TetrahedronGeometry",e.parameters={radius:r,detail:i},e}return n}(su),Qu=function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(m.a)(this,n);var o=a.font;if(!o||!o.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),Object(i.a)(r,new sa);var s=o.generateShapes(e,a.size);return a.depth=void 0!==a.height?a.height:50,void 0===a.bevelThickness&&(a.bevelThickness=10),void 0===a.bevelSize&&(a.bevelSize=8),void 0===a.bevelEnabled&&(a.bevelEnabled=!1),(r=t.call(this,s,a)).type="TextGeometry",r}return n}(Vu),$u=function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI;Object(m.a)(this,n),(e=t.call(this)).type="TorusGeometry",e.parameters={radius:r,tube:i,radialSegments:a,tubularSegments:o,arc:s},a=Math.floor(a),o=Math.floor(o);for(var c=[],u=[],l=[],f=[],h=new hr,d=new hr,p=new hr,v=0;v<=a;v++)for(var g=0;g<=o;g++){var b=g/o*s,y=v/a*Math.PI*2;d.x=(r+i*Math.cos(y))*Math.cos(b),d.y=(r+i*Math.cos(y))*Math.sin(b),d.z=i*Math.sin(y),u.push(d.x,d.y,d.z),h.x=r*Math.cos(b),h.y=r*Math.sin(b),p.subVectors(d,h).normalize(),l.push(p.x,p.y,p.z),f.push(g/o),f.push(v/a)}for(var w=1;w<=a;w++)for(var x=1;x<=o;x++){var M=(o+1)*w+x-1,O=(o+1)*(w-1)+x-1,k=(o+1)*(w-1)+x,E=(o+1)*w+x;c.push(M,O,E),c.push(O,k,E)}return e.setIndex(c),e.setAttribute("position",new Xi(u,3)),e.setAttribute("normal",new Xi(l,3)),e.setAttribute("uv",new Xi(f,2)),e}return n}(sa),el=function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:3;Object(m.a)(this,n),(e=t.call(this)).type="TorusKnotGeometry",e.parameters={radius:r,tube:i,tubularSegments:a,radialSegments:o,p:s,q:c},a=Math.floor(a),o=Math.floor(o);for(var u=[],l=[],f=[],h=[],d=new hr,p=new hr,v=new hr,g=new hr,b=new hr,y=new hr,w=new hr,x=0;x<=a;++x){var M=x/a*s*Math.PI*2;N(M,s,c,r,v),N(M+.01,s,c,r,g),y.subVectors(g,v),w.addVectors(g,v),b.crossVectors(y,w),w.crossVectors(b,y),b.normalize(),w.normalize();for(var O=0;O<=o;++O){var k=O/o*Math.PI*2,E=-i*Math.cos(k),_=i*Math.sin(k);d.x=v.x+(E*w.x+_*b.x),d.y=v.y+(E*w.y+_*b.y),d.z=v.z+(E*w.z+_*b.z),l.push(d.x,d.y,d.z),p.subVectors(d,v).normalize(),f.push(p.x,p.y,p.z),h.push(x/a),h.push(O/o)}}for(var S=1;S<=a;S++)for(var C=1;C<=o;C++){var j=(o+1)*(S-1)+(C-1),T=(o+1)*S+(C-1),A=(o+1)*S+C,P=(o+1)*(S-1)+C;u.push(j,T,P),u.push(T,A,P)}function N(e,t,n,r,i){var a=Math.cos(e),o=Math.sin(e),s=n/t*e,c=Math.cos(s);i.x=r*(2+c)*.5*a,i.y=r*(2+c)*o*.5,i.z=r*Math.sin(s)*.5}return e.setIndex(u),e.setAttribute("position",new Xi(l,3)),e.setAttribute("normal",new Xi(f,3)),e.setAttribute("uv",new Xi(h,2)),e}return n}(sa),tl=function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Object(m.a)(this,n),(r=t.call(this)).type="TubeGeometry",r.parameters={path:e,tubularSegments:i,radius:a,radialSegments:o,closed:s};var c=e.computeFrenetFrames(i,s);r.tangents=c.tangents,r.normals=c.normals,r.binormals=c.binormals;var u=new hr,l=new hr,f=new nr,h=new hr,d=[],p=[],v=[],g=[];function b(){for(var e=0;e4&&void 0!==arguments[4]?arguments[4]:30,a=e.clone();a.name=t;for(var o=[],s=0;s=r)){l.push(c.times[h]);for(var p=0;pa.tracks[v].times[0]&&(m=a.tracks[v].times[0]);for(var g=0;g1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30;r<=0&&(r=30);for(var i=n.tracks.length,a=t/r,o=function(t){var r=n.tracks[t],i=r.ValueTypeName;if("bool"===i||"string"===i)return"continue";var o=e.tracks.find((function(e){return e.name===r.name&&e.ValueTypeName===i}));if(void 0===o)return"continue";var s=0,c=r.getValueSize();r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(s=c/3);var u=0,l=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(u=l/3);var f=r.times.length-1,h=void 0;if(a<=r.times[0]){var d=s,p=c-s;h=ml.arraySlice(r.values,d,p)}else if(a>=r.times[f]){var m=f*c+s,v=m+c-s;h=ml.arraySlice(r.values,m,v)}else{var g=r.createInterpolant(),b=s,y=c-s;g.evaluate(a),h=ml.arraySlice(g.resultBuffer,b,y)}"quaternion"===i&&(new fr).fromArray(h).normalize().conjugate().toArray(h);for(var w=o.times.length,x=0;x1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:on;this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=tr.generateUUID(),this.duration<0&&this.resetDuration()}function jl(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Ol;case"vector":case"vector2":case"vector3":case"vector4":return Sl;case"color":return Ml;case"quaternion":return El;case"bool":case"boolean":return xl;case"string":return _l}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){var n=[],r=[];ml.flattenJSON(e.keys,n,r,"value"),e.times=n,e.values=r}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}Object.assign(vl.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{var a;n:{r:if(!(e=i)break e;var s=t[1];e=(i=t[--n-1]))break t}a=n,n=0}for(;n>>1;et;)--a;if(++a,0!==i||a!==r){i>=a&&(i=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=ml.arraySlice(n,i,a),this.values=ml.arraySlice(this.values,i*o,a*o)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var a=null,o=0;o!==i;o++){var s=n[o];if("number"===typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),e=!1;break}if(null!==a&&a>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),e=!1;break}a=s}if(void 0!==r&&ml.isTypedArray(r))for(var c=0,u=r.length;c!==u;++c){var l=r[c];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,c,l),e=!1;break}}return e},optimize:function(){for(var e=ml.arraySlice(this.times),t=ml.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===tn,i=e.length-1,a=1,o=1;o0){e[a]=e[i];for(var g=i*n,b=a*n,y=0;y!==n;++y)t[b+y]=t[g+y];++a}return a!==e.length?(this.times=ml.arraySlice(e,0,a),this.values=ml.arraySlice(t,0,a*n)):(this.times=e,this.values=t),this},clone:function(){var e=ml.arraySlice(this.times,0),t=ml.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}),xl.prototype=Object.assign(Object.create(wl.prototype),{constructor:xl,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:$t,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Ml.prototype=Object.assign(Object.create(wl.prototype),{constructor:Ml,ValueTypeName:"color"}),Ol.prototype=Object.assign(Object.create(wl.prototype),{constructor:Ol,ValueTypeName:"number"}),kl.prototype=Object.assign(Object.create(vl.prototype),{constructor:kl,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-t)/(r-t),c=e*o,u=c+o;c!==u;c+=4)fr.slerpFlat(i,0,a,c-o,a,c,s);return i}}),El.prototype=Object.assign(Object.create(wl.prototype),{constructor:El,ValueTypeName:"quaternion",DefaultInterpolation:en,InterpolantFactoryMethodLinear:function(e){return new kl(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),_l.prototype=Object.assign(Object.create(wl.prototype),{constructor:_l,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:$t,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Sl.prototype=Object.assign(Object.create(wl.prototype),{constructor:Sl,ValueTypeName:"vector"}),Object.assign(Cl,{parse:function(e){for(var t=[],n=e.tracks,r=1/(e.fps||1),i=0,a=n.length;i!==a;++i)t.push(jl(n[i]).scale(r));var o=new Cl(e.name,e.duration,t,e.blendMode);return o.uuid=e.uuid,o},toJSON:function(e){for(var t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode},i=0,a=n.length;i!==a;++i)t.push(wl.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(e,t,n,r){for(var i=t.length,a=[],o=0;o1){var u=c[1],l=r[u];l||(r[u]=l=[]),l.push(s)}}var f=[];for(var h in r)f.push(Cl.CreateFromMorphTargetSequence(h,r[h],t,n));return f},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,r,i){if(0!==n.length){var a=[],o=[];ml.flattenJSON(n,a,o,r),0!==a.length&&i.push(new e(t,a,o))}},r=[],i=e.name||"default",a=e.fps||30,o=e.blendMode,s=e.length||-1,c=e.hierarchy||[],u=0;u0||0===e.search(/^data\:image\/jpeg/);i.format=r?Je:Qe,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}}),Object.assign(Vl.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n=[],r=this.getPoint(0),i=0;n.push(0);for(var a=1;a<=e;a++)i+=(t=this.getPoint(a/e)).distanceTo(r),n.push(i),r=t;return this.cacheArcLengths=n,n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,r=this.getLengths(),i=0,a=r.length;n=t||e*r[a-1];for(var o,s=0,c=a-1;s<=c;)if((o=r[i=Math.floor(s+(c-s)/2)]-n)<0)s=i+1;else{if(!(o>0)){c=i;break}c=i-1}if(r[i=c]===n)return i/(a-1);var u=r[i];return(i+(n-u)/(r[i+1]-u))/(a-1)},getTangent:function(e,t){var n=e-1e-4,r=e+1e-4;n<0&&(n=0),r>1&&(r=1);var i=this.getPoint(n),a=this.getPoint(r),o=t||(i.isVector2?new nr:new hr);return o.copy(a).sub(i).normalize(),o},getTangentAt:function(e,t){var n=this.getUtoTmapping(e);return this.getTangent(n,t)},computeFrenetFrames:function(e,t){for(var n=new hr,r=[],i=[],a=[],o=new hr,s=new Hr,c=0;c<=e;c++){var u=c/e;r[c]=this.getTangentAt(u,new hr),r[c].normalize()}i[0]=new hr,a[0]=new hr;var l=Number.MAX_VALUE,f=Math.abs(r[0].x),h=Math.abs(r[0].y),d=Math.abs(r[0].z);f<=l&&(l=f,n.set(1,0,0)),h<=l&&(l=h,n.set(0,1,0)),d<=l&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]);for(var p=1;p<=e;p++){if(i[p]=i[p-1].clone(),a[p]=a[p-1].clone(),o.crossVectors(r[p-1],r[p]),o.length()>Number.EPSILON){o.normalize();var m=Math.acos(tr.clamp(r[p-1].dot(r[p]),-1,1));i[p].applyMatrix4(s.makeRotationAxis(o,m))}a[p].crossVectors(r[p],i[p])}if(!0===t){var v=Math.acos(tr.clamp(i[0].dot(i[e]),-1,1));v/=e,r[0].dot(o.crossVectors(i[0],i[e]))>0&&(v=-v);for(var g=1;g<=e;g++)i[g].applyMatrix4(s.makeRotationAxis(r[g],v*g)),a[g].crossVectors(r[g],i[g])}return{tangents:r,normals:i,binormals:a}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),Ul.prototype=Object.create(Vl.prototype),Ul.prototype.constructor=Ul,Ul.prototype.isEllipseCurve=!0,Ul.prototype.getPoint=function(e,t){for(var n=t||new nr,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)r;)i-=r;i0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"centripetal",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;Vl.call(this),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=r}function Jl(e,t,n,r,i){var a=.5*(r-t),o=.5*(i-n),s=e*e;return(2*n-2*r+a+o)*(e*s)+(-3*n+3*r-2*a-o)*s+a*e+n}function Ql(e,t,n,r){return function(e,t){var n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,r)}function $l(e,t,n,r,i){return function(e,t){var n=1-e;return n*n*n*t}(e,t)+function(e,t){var n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,r)+function(e,t){return e*e*e*t}(e,i)}function ef(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new nr,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nr,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new nr,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new nr;Vl.call(this),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=r}function tf(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new hr,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new hr,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new hr,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new hr;Vl.call(this),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=r}function nf(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new nr,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nr;Vl.call(this),this.type="LineCurve",this.v1=e,this.v2=t}function rf(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new hr,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new hr;Vl.call(this),this.type="LineCurve3",this.v1=e,this.v2=t}function af(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new nr,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nr,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new nr;Vl.call(this),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}function of(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new hr,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new hr,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new hr;Vl.call(this),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}function sf(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Vl.call(this),this.type="SplineCurve",this.points=e}Zl.prototype=Object.create(Vl.prototype),Zl.prototype.constructor=Zl,Zl.prototype.isCatmullRomCurve3=!0,Zl.prototype.getPoint=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new hr,i=r,a=this.points,o=a.length,s=(o-(this.closed?0:1))*e,c=Math.floor(s),u=s-c;this.closed?c+=c>0?0:(Math.floor(Math.abs(c)/o)+1)*o:0===u&&c===o-1&&(c=o-2,u=1),this.closed||c>0?t=a[(c-1)%o]:(Gl.subVectors(a[0],a[1]).add(a[0]),t=Gl);var l=a[c%o],f=a[(c+1)%o];if(this.closed||c+21&&void 0!==arguments[1]?arguments[1]:new nr,n=t,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set($l(e,r.x,i.x,a.x,o.x),$l(e,r.y,i.y,a.y,o.y)),n},ef.prototype.copy=function(e){return Vl.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},ef.prototype.toJSON=function(){var e=Vl.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},ef.prototype.fromJSON=function(e){return Vl.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},tf.prototype=Object.create(Vl.prototype),tf.prototype.constructor=tf,tf.prototype.isCubicBezierCurve3=!0,tf.prototype.getPoint=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new hr,n=t,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set($l(e,r.x,i.x,a.x,o.x),$l(e,r.y,i.y,a.y,o.y),$l(e,r.z,i.z,a.z,o.z)),n},tf.prototype.copy=function(e){return Vl.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},tf.prototype.toJSON=function(){var e=Vl.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},tf.prototype.fromJSON=function(e){return Vl.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},nf.prototype=Object.create(Vl.prototype),nf.prototype.constructor=nf,nf.prototype.isLineCurve=!0,nf.prototype.getPoint=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nr,n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},nf.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},nf.prototype.getTangent=function(e,t){var n=t||new nr;return n.copy(this.v2).sub(this.v1).normalize(),n},nf.prototype.copy=function(e){return Vl.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},nf.prototype.toJSON=function(){var e=Vl.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},nf.prototype.fromJSON=function(e){return Vl.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},rf.prototype=Object.create(Vl.prototype),rf.prototype.constructor=rf,rf.prototype.isLineCurve3=!0,rf.prototype.getPoint=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new hr,n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},rf.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},rf.prototype.copy=function(e){return Vl.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},rf.prototype.toJSON=function(){var e=Vl.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},rf.prototype.fromJSON=function(e){return Vl.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},af.prototype=Object.create(Vl.prototype),af.prototype.constructor=af,af.prototype.isQuadraticBezierCurve=!0,af.prototype.getPoint=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nr,n=t,r=this.v0,i=this.v1,a=this.v2;return n.set(Ql(e,r.x,i.x,a.x),Ql(e,r.y,i.y,a.y)),n},af.prototype.copy=function(e){return Vl.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},af.prototype.toJSON=function(){var e=Vl.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},af.prototype.fromJSON=function(e){return Vl.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},of.prototype=Object.create(Vl.prototype),of.prototype.constructor=of,of.prototype.isQuadraticBezierCurve3=!0,of.prototype.getPoint=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new hr,n=t,r=this.v0,i=this.v1,a=this.v2;return n.set(Ql(e,r.x,i.x,a.x),Ql(e,r.y,i.y,a.y),Ql(e,r.z,i.z,a.z)),n},of.prototype.copy=function(e){return Vl.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},of.prototype.toJSON=function(){var e=Vl.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},of.prototype.fromJSON=function(e){return Vl.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},sf.prototype=Object.create(Vl.prototype),sf.prototype.constructor=sf,sf.prototype.isSplineCurve=!0,sf.prototype.getPoint=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nr,n=t,r=this.points,i=(r.length-1)*e,a=Math.floor(i),o=i-a,s=r[0===a?a:a-1],c=r[a],u=r[a>r.length-2?r.length-1:a+1],l=r[a>r.length-3?r.length-1:a+2];return n.set(Jl(o,s.x,c.x,u.x,l.x),Jl(o,s.y,c.y,u.y,l.y)),n},sf.prototype.copy=function(e){Vl.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t1&&void 0!==arguments[1]?arguments[1]:1;fi.call(this),this.type="Light",this.color=new Ni(e),this.intensity=t}function df(e,t,n){hf.call(this,e,n),this.type="HemisphereLight",this.position.copy(fi.DefaultUp),this.updateMatrix(),this.groundColor=new Ni(t)}function pf(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new nr(512,512),this.map=null,this.mapPass=null,this.matrix=new Hr,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Ha,this._frameExtents=new nr(1,1),this._viewportCount=1,this._viewports=[new cr(0,0,1,1)]}function mf(){pf.call(this,new Na(50,1,.5,500)),this.focus=1}function vf(e,t,n,r,i,a){hf.call(this,e,t),this.type="SpotLight",this.position.copy(fi.DefaultUp),this.updateMatrix(),this.target=new fi,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==a?a:1,this.shadow=new mf}function gf(){pf.call(this,new Na(90,1,.5,500)),this._frameExtents=new nr(4,2),this._viewportCount=6,this._viewports=[new cr(2,1,1,1),new cr(0,1,1,1),new cr(3,1,1,1),new cr(1,1,1,1),new cr(3,0,1,1),new cr(1,0,1,1)],this._cubeDirections=[new hr(1,0,0),new hr(-1,0,0),new hr(0,0,1),new hr(0,0,-1),new hr(0,1,0),new hr(0,-1,0)],this._cubeUps=[new hr(0,1,0),new hr(0,1,0),new hr(0,1,0),new hr(0,1,0),new hr(0,0,1),new hr(0,0,-1)]}function bf(e,t,n,r){hf.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new gf}function yf(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2e3;Pa.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=i,this.far=a,this.updateProjectionMatrix()}function wf(){pf.call(this,new yf(-5,5,5,-5,.5,500))}function xf(e,t){hf.call(this,e,t),this.type="DirectionalLight",this.position.copy(fi.DefaultUp),this.updateMatrix(),this.target=new fi,this.shadow=new wf}function Mf(e,t){hf.call(this,e,t),this.type="AmbientLight"}function Of(e,t,n,r){hf.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}uf.prototype=Object.assign(Object.create(Vl.prototype),{constructor:uf,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new nf(t,e))},getPoint:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),r=0;r=t){var i=n[r]-t,a=this.curves[r],o=a.getLength(),s=0===o?0:1-i/o;return a.getPointAt(s)}r++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,r=this.curves.length;n0&&void 0!==arguments[0]?arguments[0]:40,t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(){for(var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,n=[],r=0,i=this.curves;r1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(e){Vl.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t0){var u=c.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(c);var l=c.getPoint(1);return this.currentPoint.copy(l),this},copy:function(e){return uf.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=uf.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return uf.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),ff.prototype=Object.assign(Object.create(lf.prototype),{constructor:ff,getPointsHoles:function(e){for(var t=[],n=0,r=this.holes.length;n1&&void 0!==arguments[1]?arguments[1]:0,n=this.camera,r=this.matrix,i=this._lightPositionWorld,a=this._lookTarget,o=this._projScreenMatrix;i.setFromMatrixPosition(e.matrixWorld),n.position.copy(i),a.copy(n.position),a.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(a),n.updateMatrixWorld(),r.makeTranslation(-i.x,-i.y,-i.z),o.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(o)}}),bf.prototype=Object.assign(Object.create(hf.prototype),{constructor:bf,isPointLight:!0,copy:function(e){return hf.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),yf.prototype=Object.assign(Object.create(Pa.prototype),{constructor:yf,isOrthographicCamera:!0,copy:function(e,t){return Pa.prototype.copy.call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this},setViewOffset:function(e,t,n,r,i,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,a=n+e,o=r+t,s=r-t;if(null!==this.view&&this.view.enabled){var c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a=(i+=c*this.view.offsetX)+c*this.view.width,s=(o-=u*this.view.offsetY)-u*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()},toJSON:function(e){var t=fi.prototype.toJSON.call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}),wf.prototype=Object.assign(Object.create(pf.prototype),{constructor:wf,isDirectionalLightShadow:!0,updateMatrices:function(e){pf.prototype.updateMatrices.call(this,e)}}),xf.prototype=Object.assign(Object.create(hf.prototype),{constructor:xf,isDirectionalLight:!0,copy:function(e){return hf.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Mf.prototype=Object.assign(Object.create(hf.prototype),{constructor:Mf,isAmbientLight:!0}),Of.prototype=Object.assign(Object.create(hf.prototype),{constructor:Of,isRectAreaLight:!0,copy:function(e){return hf.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=hf.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}});var kf=function(){function e(){Object(m.a)(this,e),Object.defineProperty(this,"isSphericalHarmonics3",{value:!0}),this.coefficients=[];for(var t=0;t<9;t++)this.coefficients.push(new hr)}return Object(v.a)(e,[{key:"set",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}},{key:"zero",value:function(){for(var e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}},{key:"getAt",value:function(e,t){var n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScaledVector(a[1],.488603*r),t.addScaledVector(a[2],.488603*i),t.addScaledVector(a[3],.488603*n),t.addScaledVector(a[4],n*r*1.092548),t.addScaledVector(a[5],r*i*1.092548),t.addScaledVector(a[6],.315392*(3*i*i-1)),t.addScaledVector(a[7],n*i*1.092548),t.addScaledVector(a[8],.546274*(n*n-r*r)),t}},{key:"getIrradianceAt",value:function(e,t){var n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScaledVector(a[1],1.023328*r),t.addScaledVector(a[2],1.023328*i),t.addScaledVector(a[3],1.023328*n),t.addScaledVector(a[4],.858086*n*r),t.addScaledVector(a[5],.858086*r*i),t.addScaledVector(a[6],.743125*i*i-.247708),t.addScaledVector(a[7],.858086*n*i),t.addScaledVector(a[8],.429043*(n*n-r*r)),t}},{key:"add",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}},{key:"addScaledSH",value:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}},{key:"scale",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}},{key:"lerp",value:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}},{key:"equals",value:function(e){for(var t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}},{key:"copy",value:function(e){return this.set(e.coefficients)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.coefficients,r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.coefficients,r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}}],[{key:"getBasisAt",value:function(e,t){var n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}}]),e}();function Ef(e,t){hf.call(this,void 0,t),this.type="LightProbe",this.sh=void 0!==e?e:new kf}function _f(e){Nl.call(this,e),this.textures={}}Ef.prototype=Object.assign(Object.create(hf.prototype),{constructor:Ef,isLightProbe:!0,copy:function(e){return hf.prototype.copy.call(this,e),this.sh.copy(e.sh),this},fromJSON:function(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this},toJSON:function(e){var t=hf.prototype.toJSON.call(this,e);return t.object.sh=this.sh.toArray(),t}}),_f.prototype=Object.assign(Object.create(Nl.prototype),{constructor:_f,load:function(e,t,n,r){var i=this,a=new zl(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(a){r?r(a):console.error(a),i.manager.itemError(e)}}),n,r)},parse:function(e){var t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}var r=new pl[e.type];if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&void 0!==r.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.sheen&&(r.sheen=(new Ni).setHex(e.sheen)),void 0!==e.emissive&&void 0!==r.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==r.specular&&r.specular.setHex(e.specular),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearcoat&&(r.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(r.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.combine&&(r.combine=e.combine),void 0!==e.side&&(r.side=e.side),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(r.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(r.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(r.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(r.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(r.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(r.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(r.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(r.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),1!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.polygonOffset&&(r.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(r.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(r.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.skinning&&(r.skinning=e.skinning),void 0!==e.morphTargets&&(r.morphTargets=e.morphTargets),void 0!==e.morphNormals&&(r.morphNormals=e.morphNormals),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.vertexTangents&&(r.vertexTangents=e.vertexTangents),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.toneMapped&&(r.toneMapped=e.toneMapped),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.vertexColors&&("number"===typeof e.vertexColors?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),void 0!==e.uniforms)for(var i in e.uniforms){var a=e.uniforms[i];switch(r.uniforms[i]={},a.type){case"t":r.uniforms[i].value=n(a.value);break;case"c":r.uniforms[i].value=(new Ni).setHex(a.value);break;case"v2":r.uniforms[i].value=(new nr).fromArray(a.value);break;case"v3":r.uniforms[i].value=(new hr).fromArray(a.value);break;case"v4":r.uniforms[i].value=(new cr).fromArray(a.value);break;case"m3":r.uniforms[i].value=(new rr).fromArray(a.value);break;case"m4":r.uniforms[i].value=(new Hr).fromArray(a.value);break;default:r.uniforms[i].value=a.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(var o in e.extensions)r.extensions[o]=e.extensions[o];if(void 0!==e.shading&&(r.flatShading=1===e.shading),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){var s=e.normalScale;!1===Array.isArray(s)&&(s=[s,s]),r.normalScale=(new nr).fromArray(s)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(r.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=(new nr).fromArray(e.clearcoatNormalScale)),void 0!==e.transmission&&(r.transmission=e.transmission),void 0!==e.transmissionMap&&(r.transmissionMap=n(e.transmissionMap)),r},setTextures:function(e){return this.textures=e,this}});var Sf={decodeText:function(e){if("undefined"!==typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",n=0,r=e.length;n0){var o=new Al(t);(n=new Dl(o)).setCrossOrigin(this.crossOrigin);for(var s=0,c=e.length;sNumber.EPSILON){if(u<0&&(o=t[a],c=-c,s=t[i],u=-u),e.ys.y)continue;if(e.y===o.y){if(e.x===o.x)return!0}else{var l=u*(e.x-o.x)-c*(e.y-o.y);if(0===l)return!0;if(l<0)continue;r=!r}}else{if(e.y!==o.y)continue;if(s.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=s.x)return!0}}return r}var i,a,o,s=Bu.isClockWise,c=this.subPaths;if(0===c.length)return[];if(!0===t)return n(c);var u=[];if(1===c.length)return a=c[0],(o=new ff).curves=a.curves,u.push(o),u;var l=!s(c[0].getPoints());l=e?!l:l;var f,h,d=[],p=[],m=[],v=0;p[v]=void 0,m[v]=[];for(var g=0,b=c.length;g1){for(var y=!1,w=[],x=0,M=p.length;x0&&(y||(m=d))}for(var T=0,A=p.length;T1&&void 0!==arguments[1]?arguments[1]:100,n=[],r=Bf(e,t,this.data),i=0,a=r.length;i0&&void 0!==arguments[0]?arguments[0]:0;if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){this._startedAt=this.context.currentTime+e;var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")}},{key:"pause",value:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}},{key:"stop",value:function(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}},{key:"connect",value:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e1&&void 0!==arguments[1]?arguments[1]:2048;Object(m.a)(this,e),this.analyser=t.context.createAnalyser(),this.analyser.fftSize=n,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}return Object(v.a)(e,[{key:"getFrequencyData",value:function(){return this.analyser.getByteFrequencyData(this.data),this.data}},{key:"getAverageFrequency",value:function(){for(var e=0,t=this.getFrequencyData(),n=0;n0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(var c=t,u=t+t;c!==u;++c)if(n[c]!==n[c+t]){o.setValue(n,r);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(var i=n,a=r;i!==a;++i)t[i]=t[r+i%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_setAdditiveIdentityNumeric:function(){for(var e=this._addIndex*this.valueSize,t=e+this.valueSize,n=e;n=.5)for(var a=0;a!==i;++a)e[t+a]=e[n+a]},_slerp:function(e,t,n,r){fr.slerpFlat(e,t,e,t,e,n,r)},_slerpAdditive:function(e,t,n,r,i){var a=this._workIndex*i;fr.multiplyQuaternionsFlat(e,a,e,t,e,n),fr.slerpFlat(e,t,e,t,e,a,r)},_lerp:function(e,t,n,r,i){for(var a=1-r,o=0;o!==i;++o){var s=t+o;e[s]=e[s]*a+e[n+o]*r}},_lerpAdditive:function(e,t,n,r,i){for(var a=0;a!==i;++a){var o=t+a;e[o]=e[o]+e[n+a]*r}}});var lh=new RegExp("[\\[\\]\\.:\\/]","g"),fh="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",hh=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),dh=/(WCOD+)?/.source.replace("WCOD",fh),ph=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),mh=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),vh=new RegExp("^"+hh+dh+ph+mh+"$"),gh=["material","materials","bones"];function bh(e,t,n){var r=n||yh.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function yh(e,t,n){this.path=t,this.parsedPath=n||yh.parseTrackName(t),this.node=yh.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function wh(){this.uuid=tr.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}Object.assign(bh.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(yh,{Composite:bh,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new yh.Composite(e,t,n):new yh(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(lh,"")},parseTrackName:function(e){var t=vh.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var i=n.nodeName.substring(r+1);-1!==gh.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n},findNode:function(e,t){if(!t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){var r=function e(n){for(var r=0;r=i){var l=i++,f=e[l];t[f.uuid]=u,e[u]=f,t[c]=l,e[l]=s;for(var h=0,d=r;h!==d;++h){var p=n[h],m=p[l],v=p[u];p[u]=m,p[l]=v}}}this.nCachedObjects_=i},uncache:function(){for(var e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_,a=e.length,o=0,s=arguments.length;o!==s;++o){var c=arguments[o],u=c.uuid,l=t[u];if(void 0!==l)if(delete t[u],l0&&(t[x.uuid]=l),e[l]=x,e.pop();for(var M=0,O=r;M!==O;++M){var k=n[M];k[l]=k[w],k.pop()}}}this.nCachedObjects_=i},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(void 0!==r)return i[r];var a=this._paths,o=this._parsedPaths,s=this._objects,c=s.length,u=this.nCachedObjects_,l=new Array(c);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(l);for(var f=u,h=s.length;f!==h;++f){var d=s[f];l[f]=new yh(d,e,t)}return l},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){var r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];t[e[o]]=n,a[n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}});var xh=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.blendMode;Object(m.a)(this,e),this._mixer=t,this._clip=n,this._localRoot=r,this.blendMode=i;for(var a=n.tracks,o=a.length,s=new Array(o),c={endingStart:nn,endingEnd:nn},u=0;u!==o;++u){var l=a[u].createInterpolant(null);s[u]=l,l.settings=c}this._interpolantSettings=c,this._interpolants=s,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Jt,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}return Object(v.a)(e,[{key:"play",value:function(){return this._mixer._activateAction(this),this}},{key:"stop",value:function(){return this._mixer._deactivateAction(this),this.reset()}},{key:"reset",value:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}},{key:"isRunning",value:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}},{key:"isScheduled",value:function(){return this._mixer._isActiveAction(this)}},{key:"startAt",value:function(e){return this._startTime=e,this}},{key:"setLoop",value:function(e,t){return this.loop=e,this.repetitions=t,this}},{key:"setEffectiveWeight",value:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}},{key:"getEffectiveWeight",value:function(){return this._effectiveWeight}},{key:"fadeIn",value:function(e){return this._scheduleFading(e,0,1)}},{key:"fadeOut",value:function(e){return this._scheduleFading(e,1,0)}},{key:"crossFadeFrom",value:function(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){var r=this._clip.duration,i=e._clip.duration,a=i/r,o=r/i;e.warp(1,a,t),this.warp(o,1,t)}return this}},{key:"crossFadeTo",value:function(e,t,n){return e.crossFadeFrom(this,t,n)}},{key:"stopFading",value:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}},{key:"setEffectiveTimeScale",value:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}},{key:"getEffectiveTimeScale",value:function(){return this._effectiveTimeScale}},{key:"setDuration",value:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}},{key:"syncWith",value:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}},{key:"halt",value:function(e){return this.warp(this._effectiveTimeScale,0,e)}},{key:"warp",value:function(e,t,n){var r=this._mixer,i=r.time,a=this.timeScale,o=this._timeScaleInterpolant;null===o&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);var s=o.parameterPositions,c=o.sampleValues;return s[0]=i,s[1]=i+n,c[0]=e/a,c[1]=t/a,this}},{key:"stopWarping",value:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}},{key:"getMixer",value:function(){return this._mixer}},{key:"getClip",value:function(){return this._clip}},{key:"getRoot",value:function(){return this._localRoot||this._mixer._root}},{key:"_update",value:function(e,t,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var a=(e-i)*n;if(a<0||0===n)return;this._startTime=null,t=n*a}t*=this._updateTimeScale(e);var o=this._updateTime(t),s=this._updateWeight(e);if(s>0){var c=this._interpolants,u=this._propertyBindings;switch(this.blendMode){case sn:for(var l=0,f=c.length;l!==f;++l)c[l].evaluate(o),u[l].accumulateAdditive(s);break;case on:default:for(var h=0,d=c.length;h!==d;++h)c[h].evaluate(o),u[h].accumulate(r,s)}}}else this._updateWeight(e)}},{key:"_updateWeight",value:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t}},{key:"_updateTimeScale",value:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}return this._effectiveTimeScale=t,t}},{key:"_updateTime",value:function(e){var t=this._clip.duration,n=this.loop,r=this.time+e,i=this._loopCount,a=n===Qt;if(0===e)return-1===i?r:a&&1===(1&i)?t-r:r;if(n===Zt){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),r>=t||r<0){var o=Math.floor(r/t);r-=t*o,i+=Math.abs(o);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var c=e<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=r;if(a&&1===(1&i))return t-r}return r}},{key:"_setEndings",value:function(e,t,n){var r=this._interpolantSettings;n?(r.endingStart=rn,r.endingEnd=rn):(r.endingStart=e?this.zeroSlopeAtStart?rn:nn:an,r.endingEnd=t?this.zeroSlopeAtEnd?rn:nn:an)}},{key:"_scheduleFading",value:function(e,t,n){var r=this._mixer,i=r.time,a=this._weightInterpolant;null===a&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=n,this}}]),e}();function Mh(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}Mh.prototype=Object.assign(Object.create(Zn.prototype),{constructor:Mh,_bindAction:function(e,t){var n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,c=this._bindingsByRootAndName,u=c[s];void 0===u&&(u={},c[s]=u);for(var l=0;l!==i;++l){var f=r[l],h=f.name,d=u[h];if(void 0!==d)a[l]=d;else{if(void 0!==(d=a[l])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,h));continue}var p=t&&t._propertyBindings[l].binding.parsedPath;++(d=new uh(yh.create(n,h,p),f.ValueTypeName,f.getValueSize())).referenceCount,this._addInactiveBinding(d,s,h),a[l]=d}o[l].resultBuffer=d.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}for(var i=e._propertyBindings,a=0,o=i.length;a!==o;++a){var s=i[a];0===s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0===--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&t=0;--t)e[t].stop();return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1,o=0;o!==n;++o){t[o]._update(r,e,i,a)}for(var s=this._bindings,c=this._nActiveBindings,u=0;u!==c;++u)s[u].apply(a);return this},setTime:function(e){this.time=0;for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(m.a)(this,e),this.radius=t,this.phi=n,this.theta=r,this}return Object(v.a)(e,[{key:"set",value:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}},{key:"makeSafe",value:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}},{key:"setFromVector3",value:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}},{key:"setFromCartesianCoords",value:function(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(tr.clamp(t/this.radius,-1,1))),this}}]),e}(),Th=function(){function e(t,n,r){return Object(m.a)(this,e),this.radius=void 0!==t?t:1,this.theta=void 0!==n?n:0,this.y=void 0!==r?r:0,this}return Object(v.a)(e,[{key:"set",value:function(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}},{key:"setFromVector3",value:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}},{key:"setFromCartesianCoords",value:function(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}}]),e}(),Ah=new nr,Ph=function(){function e(t,n){Object(m.a)(this,e),Object.defineProperty(this,"isBox2",{value:!0}),this.min=void 0!==t?t:new nr(1/0,1/0),this.max=void 0!==n?n:new nr(-1/0,-1/0)}return Object(v.a)(e,[{key:"set",value:function(e,t){return this.min.copy(e),this.max.copy(t),this}},{key:"setFromPoints",value:function(e){this.makeEmpty();for(var t=0,n=e.length;tthis.max.x||e.ythis.max.y)}},{key:"containsBox",value:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}},{key:"getParameter",value:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new nr),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}},{key:"intersectsBox",value:function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}},{key:"clampPoint",value:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new nr),t.copy(e).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(e){return Ah.copy(e).clamp(this.min,this.max).sub(e).length()}},{key:"intersect",value:function(e){return this.min.max(e.min),this.max.min(e.max),this}},{key:"union",value:function(e){return this.min.min(e.min),this.max.max(e.max),this}},{key:"translate",value:function(e){return this.min.add(e),this.max.add(e),this}},{key:"equals",value:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}]),e}(),Nh=new hr,Rh=new hr,zh=function(){function e(t,n){Object(m.a)(this,e),this.start=void 0!==t?t:new hr,this.end=void 0!==n?n:new hr}return Object(v.a)(e,[{key:"set",value:function(e,t){return this.start.copy(e),this.end.copy(t),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.start.copy(e.start),this.end.copy(e.end),this}},{key:"getCenter",value:function(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new hr),e.addVectors(this.start,this.end).multiplyScalar(.5)}},{key:"delta",value:function(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new hr),e.subVectors(this.end,this.start)}},{key:"distanceSq",value:function(){return this.start.distanceToSquared(this.end)}},{key:"distance",value:function(){return this.start.distanceTo(this.end)}},{key:"at",value:function(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new hr),this.delta(t).multiplyScalar(e).add(this.start)}},{key:"closestPointToPointParameter",value:function(e,t){Nh.subVectors(e,this.start),Rh.subVectors(this.end,this.start);var n=Rh.dot(Rh),r=Rh.dot(Nh)/n;return t&&(r=tr.clamp(r,0,1)),r}},{key:"closestPointToPoint",value:function(e,t,n){var r=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new hr),this.delta(n).multiplyScalar(r).add(this.start)}},{key:"applyMatrix4",value:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}},{key:"equals",value:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}]),e}();function Lh(e){fi.call(this),this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}Lh.prototype=Object.create(fi.prototype),Lh.prototype.constructor=Lh,Lh.prototype.isImmediateRenderObject=!0;var Ih=new hr,Dh=function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(e,r){var i;Object(m.a)(this,n),(i=t.call(this)).light=e,i.light.updateMatrixWorld(),i.matrix=e.matrixWorld,i.matrixAutoUpdate=!1,i.color=r;for(var a=new sa,o=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],s=0,c=1;s<32;s++,c++){var u=s/32*Math.PI*2,l=c/32*Math.PI*2;o.push(Math.cos(u),Math.sin(u),1,Math.cos(l),Math.sin(l),1)}a.setAttribute("position",new Xi(o,3));var f=new Lc({fog:!1,toneMapped:!1});return i.cone=new qc(a,f),i.add(i.cone),i.update(),i}return Object(v.a)(n,[{key:"dispose",value:function(){this.cone.geometry.dispose(),this.cone.material.dispose()}},{key:"update",value:function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),Ih.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Ih),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}]),n}(fi),Bh=new hr,Hh=new Hr,Fh=new Hr,Vh=function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(e){var r;Object(m.a)(this,n);for(var i=function e(t){var n=[];t&&t.isBone&&n.push(t);for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:10,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4473924,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8947848;Object(m.a)(this,n),a=new Ni(a),o=new Ni(o);for(var s=i/2,c=r/i,u=r/2,l=[],f=[],h=0,d=0,p=-u;h<=i;h++,p+=c){l.push(-u,0,p,u,0,p),l.push(p,0,-u,p,0,u);var v=h===s?a:o;v.toArray(f,d),d+=3,v.toArray(f,d),d+=3,v.toArray(f,d),d+=3,v.toArray(f,d),d+=3}var g=new sa;g.setAttribute("position",new Xi(l,3)),g.setAttribute("color",new Xi(f,3));var b=new Lc({vertexColors:!0,toneMapped:!1});return(e=t.call(this,g,b)).type="GridHelper",e}return n}(qc),Xh=function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:64,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4473924,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8947848;Object(m.a)(this,n),s=new Ni(s),c=new Ni(c);for(var u=[],l=[],f=0;f<=i;f++){var h=f/i*(2*Math.PI),d=Math.sin(h)*r,p=Math.cos(h)*r;u.push(0,0,0),u.push(d,0,p);var v=1&f?s:c;l.push(v.r,v.g,v.b),l.push(v.r,v.g,v.b)}for(var g=0;g<=a;g++)for(var b=1&g?s:c,y=r-r/a*g,w=0;w1&&void 0!==arguments[1]?arguments[1]:16776960;Object(m.a)(this,n);var a=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),o=new Float32Array(24),s=new sa;return s.setIndex(new Hi(a,1)),s.setAttribute("position",new Hi(o,3)),(r=t.call(this,s,new Lc({color:i,toneMapped:!1}))).object=e,r.type="BoxHelper",r.matrixAutoUpdate=!1,r.update(),r}return Object(v.a)(n,[{key:"update",value:function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&od.setFromObject(this.object),!od.isEmpty()){var t=od.min,n=od.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}}},{key:"setFromObject",value:function(e){return this.object=e,this.update(),this}},{key:"copy",value:function(e){return qc.prototype.copy.call(this,e),this.object=e.object,this}}]),n}(qc),cd=function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16776960;Object(m.a)(this,n);var a=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),o=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],s=new sa;return s.setIndex(new Hi(a,1)),s.setAttribute("position",new Xi(o,3)),(r=t.call(this,s,new Lc({color:i,toneMapped:!1}))).box=e,r.type="Box3Helper",r.geometry.computeBoundingSphere(),r}return Object(v.a)(n,[{key:"updateMatrixWorld",value:function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),Object(l.a)(Object(f.a)(n.prototype),"updateMatrixWorld",this).call(this,e))}}]),n}(qc),ud=function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16776960;Object(m.a)(this,n);var o=a,s=[1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],c=new sa;c.setAttribute("position",new Xi(s,3)),c.computeBoundingSphere(),(r=t.call(this,c,new Lc({color:o,toneMapped:!1}))).type="PlaneHelper",r.plane=e,r.size=i;var u=[1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],l=new sa;return l.setAttribute("position",new Xi(u,3)),l.computeBoundingSphere(),r.add(new Ea(l,new Ii({color:o,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1}))),r}return Object(v.a)(n,[{key:"updateMatrixWorld",value:function(e){var t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?j:C,this.lookAt(this.plane.normal),Object(l.a)(Object(f.a)(n.prototype),"updateMatrixWorld",this).call(this,e)}}]),n}(Vc),ld=new hr,fd=function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(e,r,i,a,o,s){var c;return Object(m.a)(this,n),(c=t.call(this)).type="ArrowHelper",void 0===e&&(e=new hr(0,0,1)),void 0===r&&(r=new hr(0,0,0)),void 0===i&&(i=1),void 0===a&&(a=16776960),void 0===o&&(o=.2*i),void 0===s&&(s=.2*o),void 0===id&&((id=new sa).setAttribute("position",new Xi([0,0,0,0,1,0],3)),(ad=new au(0,.5,1,5,1)).translate(0,-.5,0)),c.position.copy(r),c.line=new Vc(id,new Lc({color:a,toneMapped:!1})),c.line.matrixAutoUpdate=!1,c.add(c.line),c.cone=new Ea(ad,new Ii({color:a,toneMapped:!1})),c.cone.matrixAutoUpdate=!1,c.add(c.cone),c.setDirection(e),c.setLength(i,o,s),c}return Object(v.a)(n,[{key:"setDirection",value:function(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{ld.set(e.z,0,-e.x).normalize();var t=Math.acos(e.y);this.quaternion.setFromAxisAngle(ld,t)}}},{key:"setLength",value:function(e,t,n){void 0===t&&(t=.2*e),void 0===n&&(n=.2*t),this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}},{key:"setColor",value:function(e){this.line.material.color.set(e),this.cone.material.color.set(e)}},{key:"copy",value:function(e){return Object(l.a)(Object(f.a)(n.prototype),"copy",this).call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}}]),n}(fi),hd=function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;Object(m.a)(this,n);var i=[0,0,0,r,0,0,0,0,0,0,r,0,0,0,0,0,0,r],a=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],o=new sa;o.setAttribute("position",new Xi(i,3)),o.setAttribute("color",new Xi(a,3));var s=new Lc({vertexColors:!0,toneMapped:!1});return(e=t.call(this,o,s)).type="AxesHelper",e}return n}(qc),dd=new Float32Array(1),pd=new Int32Array(dd.buffer),md={toHalfFloat:function(e){dd[0]=e;var t=pd[0],n=t>>16&32768,r=t>>12&2047,i=t>>23&255;return i<103?n:i>142?(n|=31744,n|=(255==i?0:1)&&8388607&t):i<113?n|=((r|=2048)>>114-i)+(r>>113-i&1):(n|=i-112<<10|r>>1,n+=1&r)}},vd=Math.pow(2,8),gd=[.125,.215,.35,.446,.526,.582],bd=5+gd.length,yd=(r={},Object(u.a)(r,fn,0),Object(u.a)(r,hn,1),Object(u.a)(r,pn,2),Object(u.a)(r,vn,3),Object(u.a)(r,gn,4),Object(u.a)(r,bn,5),Object(u.a)(r,dn,6),r),wd=new Ii({side:j,depthWrite:!1,depthTest:!1}),xd=new Ea(new Sa,wd),Md=new yf,Od=zd(),kd=Od._lodPlanes,Ed=Od._sizeLods,_d=Od._sigmas,Sd=new Ni,Cd=null,jd=(1+Math.sqrt(5))/2,Td=1/jd,Ad=[new hr(1,1,1),new hr(-1,1,1),new hr(1,1,-1),new hr(-1,1,-1),new hr(0,jd,Td),new hr(0,jd,-Td),new hr(Td,0,jd),new hr(-Td,0,jd),new hr(jd,Td,0),new hr(-jd,Td,0)];function Pd(e){var t=Math.max(e.r,e.g,e.b),n=Math.min(Math.max(Math.ceil(Math.log2(t)),-128),127);return e.multiplyScalar(Math.pow(2,-n)),(n+128)/255}var Nd=function(){function e(t){Object(m.a)(this,e),this._renderer=t,this._pingPongRenderTarget=null,this._blurMaterial=function(e){var t=new Float32Array(e),n=new hr(0,1,0);return new al({name:"SphericalGaussianBlur",defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:t},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n},inputEncoding:{value:yd[fn]},outputEncoding:{value:yd[fn]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t".concat("\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t","\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t"),blending:N,depthTest:!1,depthWrite:!1})}(20),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}return Object(v.a)(e,[{key:"fromScene",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100;Cd=this._renderer.getRenderTarget();var i=this._allocateTargets();return this._sceneToCubeUV(e,n,r,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}},{key:"fromEquirectangular",value:function(e){return this._fromTexture(e)}},{key:"fromCubemap",value:function(e){return this._fromTexture(e)}},{key:"compileCubemapShader",value:function(){null===this._cubemapShader&&(this._cubemapShader=Bd(),this._compileMaterial(this._cubemapShader))}},{key:"compileEquirectangularShader",value:function(){null===this._equirectShader&&(this._equirectShader=Dd(),this._compileMaterial(this._equirectShader))}},{key:"dispose",value:function(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(var e=0;e2?vd:0,vd,vd),s.setRenderTarget(r),f&&s.render(xd,i),s.render(e,i)}s.toneMapping=l,s.outputEncoding=u,s.autoClear=c}},{key:"_textureToCubeUV",value:function(e,t){var n=this._renderer;e.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=Bd()):null==this._equirectShader&&(this._equirectShader=Dd());var r=e.isCubeTexture?this._cubemapShader:this._equirectShader,i=new Ea(kd[0],r),a=r.uniforms;a.envMap.value=e,e.isCubeTexture||a.texelSize.value.set(1/e.image.width,1/e.image.height),a.inputEncoding.value=yd[e.encoding],a.outputEncoding.value=yd[t.texture.encoding],Id(t,0,0,3*vd,2*vd),n.setRenderTarget(t),n.render(i,Md)}},{key:"_applyPMREM",value:function(e){var t=this._renderer,n=t.autoClear;t.autoClear=!1;for(var r=1;r20&&console.warn("sigmaRadians, ".concat(i,", is too large and will clip, as it requested ").concat(p," samples when the maximum is set to ").concat(20));for(var m=[],v=0,g=0;g<20;++g){var b=g/d,y=Math.exp(-b*b/2);m.push(y),0==g?v+=y:g4?r-8+4:0),3*x,2*x),s.setRenderTarget(t),s.render(u,Md)}}]),e}();function Rd(e){return void 0!==e&&e.type===De&&(e.encoding===fn||e.encoding===hn||e.encoding===dn)}function zd(){for(var e=[],t=[],n=[],r=8,i=0;i4?o=gd[i-8+4-1]:0==i&&(o=0),n.push(o);for(var s=1/(a-1),c=-s/2,u=1+s/2,l=[c,c,u,c,u,u,c,c,u,u,c,u],f=new Float32Array(108),h=new Float32Array(72),d=new Float32Array(36),p=0;p<6;p++){var m=p%3*2/3-1,v=p>2?0:-1,g=[m,v,0,m+2/3,v,0,m+2/3,v+1,0,m,v,0,m+2/3,v+1,0,m,v+1,0];f.set(g,18*p),h.set(l,12*p);var b=[p,p,p,p,p,p];d.set(b,6*p)}var y=new sa;y.setAttribute("position",new Hi(f,3)),y.setAttribute("uv",new Hi(h,2)),y.setAttribute("faceIndex",new Hi(d,1)),e.push(y),r>4&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}function Ld(e){var t=new ur(3*vd,3*vd,e);return t.texture.mapping=Oe,t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}function Id(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function Dd(){return new al({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:new nr(1,1)},inputEncoding:{value:yd[fn]},outputEncoding:{value:yd[fn]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform vec2 texelSize;\n\n\t\t\t".concat("\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t","\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t"),blending:N,depthTest:!1,depthWrite:!1})}function Bd(){return new al({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:yd[fn]},outputEncoding:{value:yd[fn]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\t".concat("\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t","\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t"),blending:N,depthTest:!1,depthWrite:!1})}function Hd(e,t,n,r,i,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new Ri(e,t,n,i,a,o)}var Fd=0,Vd=1,Ud=0,Wd=1,qd=2;function Gd(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e}function Kd(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,e.materials=e,e.clone=function(){return e.slice()},e}function Yd(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new Qc(e,t)}function Xd(e){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new vc(e)}function Zd(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new Qc(e,t)}function Jd(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new Kc(e)}function Qd(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new Kc(e)}function $d(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new Kc(e)}function ep(e,t,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new hr(e,t,n)}function tp(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new Hi(e,t).setUsage(Hn)}function np(e,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new Fi(e,t)}function rp(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new Vi(e,t)}function ip(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new Ui(e,t)}function ap(e,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new Wi(e,t)}function op(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new qi(e,t)}function sp(e,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new Gi(e,t)}function cp(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Ki(e,t)}function up(e,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Xi(e,t)}function lp(e,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Zi(e,t)}function fp(e){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Zl.call(this,e),this.type="catmullrom",this.closed=!0}function hp(e){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Zl.call(this,e),this.type="catmullrom"}function dp(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Zl.call(this,e),this.type="catmullrom"}function pp(e){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new hd(e)}function mp(e,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new sd(e,t)}function vp(e,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new qc(new du(e.geometry),new Lc({color:void 0!==t?t:16777215}))}function gp(e,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new qc(new nl(e.geometry),new Lc({color:void 0!==t?t:16777215}))}function bp(e){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new zl(e)}function yp(e){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new Hl(e)}function wp(e,t,n){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new La(e,n)}Vl.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Vl.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(lf.prototype,{fromPoints:function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),fp.prototype=Object.create(Zl.prototype),hp.prototype=Object.create(Zl.prototype),dp.prototype=Object.create(Zl.prototype),Object.assign(dp.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),Yh.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Vh.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(Nl.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Sf.extractUrlBase(e)}}),Nl.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(Ph.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(mr.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(Ar.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),Ha.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},zh.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign(tr,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),tr.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),tr.ceilPowerOfTwo(e)}}),Object.assign(rr.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},getInverse:function(e){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()}}),Object.assign(Hr.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new hr).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,r,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,i,a)},getInverse:function(e){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()}}),mi.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},Object.assign(fr.prototype,{multiplyVector3:function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},inverse:function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()}}),Object.assign(Br.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(_i.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),Object.assign(_i,{barycoordFromPoint:function(e,t,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),_i.getBarycoord(e,t,n,r,i)},normal:function(e,t,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),_i.getNormal(e,t,n,r)}}),Object.assign(ff.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Vu(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Xu(this,e)}}),Object.assign(nr.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(hr.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(cr.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(fi.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(fi.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(Ea.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(Ea.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),cn},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(wc.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Tc.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),_c.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Vl.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),Na.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(hf.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(Hi.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===Hn},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Hn)}}}),Object.assign(Hi.prototype,{setDynamic:function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?Hn:Bn),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(sa.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addAttribute:function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new Hi(arguments[1],arguments[2])))},addDrawCall:function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},applyMatrix:function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(sa.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(Cf.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(e){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=e}}}),Object.defineProperties(_h.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(e){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=e}}}),Object.defineProperties($s.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===Hn},set:function(e){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),Object.assign($s.prototype,{setDynamic:function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?Hn:Bn),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(Vu.prototype,{getArrays:function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")}}),Object.assign(Qs.prototype,{dispose:function(){console.error("THREE.Scene: .dispose() has been removed.")}}),Object.defineProperties(Oh.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(Li.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Ni}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=e===A}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}}}),Object.defineProperties(cl.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(sl.prototype,{transparency:{get:function(){return console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission},set:function(e){console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission=e}}}),Object.defineProperties(Aa.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(Ys.prototype,{clearTarget:function(e,t,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,r)},animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(Ys.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?hn:fn}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(Bs.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(ur.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(nh.prototype,{load:{value:function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this;return(new Uf).load(e,(function(e){t.setBuffer(e)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),ch.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Ra.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)},Ra.prototype.clear=function(e,t,n,r){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(e,t,n,r)};var xp={merge:function(e,t,n){var r;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),t.isMesh&&(t.matrixAutoUpdate&&t.updateMatrix(),r=t.matrix,t=t.geometry),e.merge(t,r,n)},center:function(e){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),e.center()}};function Mp(){console.error("THREE.CanvasRenderer has been removed")}function Op(){console.error("THREE.JSONLoader has been removed.")}ir.crossOrigin=void 0,ir.loadTexture=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new Fl;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},ir.loadTextureCube=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new Bl;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},ir.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},ir.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var kp={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};function Ep(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")}"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:g}})),"undefined"!==typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=g)},function(e,t,n){var r=n(474);e.exports=r("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(45);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=[];return i.a.Children.forEach(e,(function(e){(void 0!==e&&null!==e||t.keepEmpty)&&(Array.isArray(e)?n=n.concat(o(e)):Object(a.isFragment)(e)&&e.props?n=n.concat(o(e.props.children,t)):n.push(e))})),n}},function(e,t,n){"use strict";n.d(t,"e",(function(){return l})),n.d(t,"c",(function(){return f})),n.d(t,"d",(function(){return h})),n.d(t,"a",(function(){return p})),n.d(t,"f",(function(){return m})),n.d(t,"b",(function(){return v}));var r=n(20),i=n(14),a=n(6),o=n(25),s=n(43),c=n(28),u=n(49);function l(e,t){return null!==e&&void 0!==e?e:t}function f(e){return function e(t){return Object(s.a)(t).map((function(t){if(!Object(u.i)(t))return Object(c.a)(!t,"Tree/TreeNode can only accept TreeNode as children."),null;var n=t.key,r=t.props,i=r.children,s=Object(o.a)(r,["children"]),l=Object(a.a)({key:n},s),f=e(i);return f.length&&(l.children=f),l})).filter((function(e){return e}))}(e)}function h(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=new Set(!0===t?[]:t),r=[];function o(e){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e.map((function(c,f){var h=Object(u.h)(s?s.pos:"0",f),d=l(c.key,h),p=Object(a.a)(Object(a.a)({},c),{},{parent:s,pos:h,children:null,data:c,isStart:[].concat(Object(i.a)(s?s.isStart:[]),[0===f]),isEnd:[].concat(Object(i.a)(s?s.isEnd:[]),[f===e.length-1])});return r.push(p),!0===t||n.has(d)?p.children=o(c.children||[],p):p.children=[],p}))}return o(e),r}function d(e,t,n){var i,a,o=null,s=Object(r.a)(n);"function"===s||"string"===s?o=n:n&&"object"===s&&(i=n.childrenPropName,o=n.externalGetKey),i=i||"children",o?"string"===typeof o?a=function(e){return e[o]}:"function"===typeof o&&(a=function(e){return o(e)}):a=function(e,t){return l(e.key,t)},function n(r,o,s){var c=r?r[i]:e,l=r?Object(u.h)(s.pos,o):"0";if(r){var f=a(r,l),h={node:r,index:o,pos:l,key:f,parentPos:s.node?s.pos:null,level:s.level+1};t(h)}c&&c.forEach((function(e,t){n(e,t,{node:r,pos:l,level:s?s.level+1:-1})}))}(null)}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.initWrapper,r=t.processEntity,i=t.onProcessFinished,a=t.externalGetKey,o=t.childrenPropName,s=arguments.length>2?arguments[2]:void 0,c=a||s,u={},f={},h={posEntities:u,keyEntities:f};return n&&(h=n(h)||h),d(e,(function(e){var t=e.node,n=e.index,i=e.pos,a=e.key,o=e.parentPos,s={node:t,index:n,key:a,pos:i,level:e.level},c=l(a,i);u[i]=s,f[c]=s,s.parent=u[o],s.parent&&(s.parent.children=s.parent.children||[],s.parent.children.push(s)),r&&r(s,h)}),{externalGetKey:c,childrenPropName:o}),i&&i(h),h}function m(e,t){var n=t.expandedKeys,r=t.selectedKeys,i=t.loadedKeys,a=t.loadingKeys,o=t.checkedKeys,s=t.halfCheckedKeys,c=t.dragOverNodeKey,u=t.dropPosition,l=t.keyEntities[e];return{eventKey:e,expanded:-1!==n.indexOf(e),selected:-1!==r.indexOf(e),loaded:-1!==i.indexOf(e),loading:-1!==a.indexOf(e),checked:-1!==o.indexOf(e),halfChecked:-1!==s.indexOf(e),pos:String(l?l.pos:""),dragOver:c===e&&0===u,dragOverGapTop:c===e&&-1===u,dragOverGapBottom:c===e&&1===u}}function v(e){var t=e.data,n=e.expanded,r=e.selected,i=e.checked,o=e.loaded,s=e.loading,u=e.halfChecked,l=e.dragOver,f=e.dragOverGapTop,h=e.dragOverGapBottom,d=e.pos,p=e.active,m=Object(a.a)(Object(a.a)({},t),{},{expanded:n,selected:r,checked:i,loaded:o,loading:s,halfChecked:u,dragOver:l,dragOverGapTop:f,dragOverGapBottom:h,pos:d,active:p});return"props"in m||Object.defineProperty(m,"props",{get:function(){return Object(c.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),m}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return o})),n.d(t,"c",(function(){return s}));var r=n(20),i=n(188);function a(e,t){"function"===typeof e?e(t):"object"===Object(r.a)(e)&&e&&"current"in e&&(e.current=t)}function o(){for(var e=arguments.length,t=new Array(e),n=0;n=0&&n.splice(r,1),n}function s(e,t){var n=e.slice();return-1===n.indexOf(t)&&n.push(t),n}function c(e){return e.split("-")}function u(e,t){return"".concat(e,"-").concat(t)}function l(e){return e&&e.type&&e.type.isTreeNode}function f(e,t){var n=[];return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.forEach((function(t){var r=t.key,i=t.children;n.push(r),e(i)}))}(t[e].children),n}function h(e){if(e.parent){var t=c(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1}function d(e,t,n,r,i,a,o,s,u){var l,f=e.clientX,d=e.clientY,p=e.target.getBoundingClientRect(),m=p.top,v=p.height,g=(("rtl"===u?-1:1)*(((null===r||void 0===r?void 0:r.x)||0)-f)-12)/n,b=o[t.props.eventKey];if(d-1.5?i({dropNode:_,dropPosition:1})?O=1:S=!1:i({dropNode:_,dropPosition:0})?O=0:i({dropNode:_,dropPosition:1})?O=1:S=!1:i({dropNode:_,dropPosition:1})?O=1:S=!1,{dropPosition:O,dropLevelOffset:k,dropTargetKey:b.key,dropTargetPos:b.pos,dragOverNodeKey:M,dropContainerKey:0===O?null:(null===(l=b.parent)||void 0===l?void 0:l.key)||null,dropAllowed:S}}function p(e,t){if(e)return t.multiple?e.slice():e.length?[e[0]]:e}function m(e){if(!e)return null;var t;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else{if("object"!==Object(i.a)(e))return Object(a.a)(!1,"`checkedKeys` is not an array or an object"),null;t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0}}return t}function v(e,t){var n=new Set;return(e||[]).forEach((function(e){!function e(r){if(!n.has(r)){var i=t[r];if(i){n.add(r);var a=i.parent;i.node.disabled||a&&e(a.key)}}}(e)})),Object(r.a)(n)}function g(e){var t={};return Object.keys(e).forEach((function(n){(n.startsWith("data-")||n.startsWith("aria-"))&&(t[n]=e[n])})),t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),i=r.createContext(void 0),a=function(e){var t=e.children,n=e.size;return r.createElement(i.Consumer,null,(function(e){return r.createElement(i.Provider,{value:n||e},t)}))};t.b=i},function(e,t,n){"use strict";n.d(t,"a",(function(){return U}));var r=n(2),i=n(6),a=n(9),o=n(20),s=n(0),c=n(125),u=n(46),l=n(5),f=n.n(l),h=n(92);function d(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}var p=function(e,t){var n={animationend:d("Animation","AnimationEnd"),transitionend:d("Transition","TransitionEnd")};return e&&("AnimationEvent"in t||delete n.animationend.animation,"TransitionEvent"in t||delete n.transitionend.transition),n}(Object(h.a)(),"undefined"!==typeof window?window:{}),m={};if(Object(h.a)()){var v=document.createElement("div");m=v.style}var g={};function b(e){if(g[e])return g[e];var t=p[e];if(t)for(var n=Object.keys(t),r=n.length,i=0;i1&&void 0!==arguments[1]?arguments[1]:2;t();var a=Object(S.a)((function(){i<=1?r({isCanceled:function(){return a!==e.current}}):n(r,i-1)}));e.current=a},t]}(),u=Object(a.a)(c,2),l=u[0],f=u[1];return _((function(){if("none"!==i&&"end"!==i){var e=C.indexOf(i),n=C[e+1],r=t(i);!1===r?o(n):l((function(e){function t(){e.isCanceled()||o(n)}!0===r?t():Promise.resolve(r).then(t)}))}}),[e,i]),s.useEffect((function(){return function(){f()}}),[]),[function(){o("prepare")},i]};function A(e,t,n,o){var c=o.motionEnter,u=void 0===c||c,l=o.motionAppear,f=void 0===l||l,h=o.motionLeave,d=void 0===h||h,p=o.motionDeadline,m=o.motionLeaveImmediately,v=o.onAppearPrepare,g=o.onEnterPrepare,b=o.onLeavePrepare,y=o.onAppearStart,w=o.onEnterStart,x=o.onLeaveStart,k=o.onAppearActive,S=o.onEnterActive,C=o.onLeaveActive,A=o.onAppearEnd,P=o.onEnterEnd,N=o.onLeaveEnd,R=o.onVisibleChanged,z=E(),L=Object(a.a)(z,2),I=L[0],D=L[1],B=E("none"),H=Object(a.a)(B,2),F=H[0],V=H[1],U=E(null),W=Object(a.a)(U,2),q=W[0],G=W[1],K=Object(s.useRef)(!1),Y=Object(s.useRef)(null),X=Object(s.useRef)(!1),Z=Object(s.useRef)(null);function J(){return n()||Z.current}var Q=Object(s.useRef)(!1);function $(e){var t,n=J();e&&!e.deadline&&e.target!==n||("appear"===F&&Q.current?t=null===A||void 0===A?void 0:A(n,e):"enter"===F&&Q.current?t=null===P||void 0===P?void 0:P(n,e):"leave"===F&&Q.current&&(t=null===N||void 0===N?void 0:N(n,e)),!1===t||X.current||(V("none"),G(null)))}var ee=function(e){var t=Object(s.useRef)(),n=Object(s.useRef)(e);n.current=e;var r=s.useCallback((function(e){n.current(e)}),[]);function i(e){e&&(e.removeEventListener(O,r),e.removeEventListener(M,r))}return s.useEffect((function(){return function(){i(t.current)}}),[]),[function(e){t.current&&t.current!==e&&i(t.current),e&&e!==t.current&&(e.addEventListener(O,r),e.addEventListener(M,r),t.current=e)},i]}($),te=Object(a.a)(ee,1)[0],ne=s.useMemo((function(){var e,t,n;switch(F){case"appear":return e={},Object(r.a)(e,"prepare",v),Object(r.a)(e,"start",y),Object(r.a)(e,"active",k),e;case"enter":return t={},Object(r.a)(t,"prepare",g),Object(r.a)(t,"start",w),Object(r.a)(t,"active",S),t;case"leave":return n={},Object(r.a)(n,"prepare",b),Object(r.a)(n,"start",x),Object(r.a)(n,"active",C),n;default:return{}}}),[F]),re=T(F,(function(e){if("prepare"===e){var t=ne.prepare;return!!t&&t(J())}var n;oe in ne&&G((null===(n=ne[oe])||void 0===n?void 0:n.call(ne,J(),null))||null);return"active"===oe&&(te(J()),p>0&&(clearTimeout(Y.current),Y.current=setTimeout((function(){$({deadline:!0})}),p))),!0})),ie=Object(a.a)(re,2),ae=ie[0],oe=ie[1],se=j(oe);Q.current=se,_((function(){if(D(t),e){var n,r=K.current;K.current=!0,!r&&t&&f&&(n="appear"),r&&t&&u&&(n="enter"),(r&&!t&&d||!r&&m&&!t&&d)&&(n="leave"),n&&(V(n),ae())}}),[t]),Object(s.useEffect)((function(){("appear"===F&&!f||"enter"===F&&!u||"leave"===F&&!d)&&V("none")}),[f,u,d]),Object(s.useEffect)((function(){return function(){clearTimeout(Y.current),X.current=!0}}),[]),Object(s.useEffect)((function(){void 0!==I&&"none"===F&&(null===R||void 0===R||R(I))}),[I,F]);var ce=q;return ne.prepare&&"start"===oe&&(ce=Object(i.a)({transition:"none"},ce)),[F,oe,ce,null!==I&&void 0!==I?I:t]}var P=n(16),N=n(17),R=n(18),z=n(19),L=function(e){Object(R.a)(n,e);var t=Object(z.a)(n);function n(){return Object(P.a)(this,n),t.apply(this,arguments)}return Object(N.a)(n,[{key:"render",value:function(){return this.props.children}}]),n}(s.Component);var I=function(e){var t=e;function n(e){return!(!e.motionName||!t)}"object"===Object(o.a)(e)&&(t=e.transitionSupport);var l=s.forwardRef((function(e,t){var o=e.visible,l=void 0===o||o,h=e.removeOnLeave,d=void 0===h||h,p=e.forceRender,m=e.children,v=e.motionName,g=e.leavedClassName,b=e.eventProps,y=n(e),w=Object(s.useRef)(),x=Object(s.useRef)();var M=A(y,l,(function(){try{return Object(c.a)(w.current||x.current)}catch(e){return null}}),e),O=Object(a.a)(M,4),E=O[0],_=O[1],S=O[2],C=O[3],T=Object(s.useRef)(t);T.current=t;var P,N=s.useCallback((function(e){w.current=e,Object(u.b)(T.current,e)}),[]),R=Object(i.a)(Object(i.a)({},b),{},{visible:l});if(m)if("none"!==E&&n(e)){var z,I;"prepare"===_?I="prepare":j(_)?I="active":"start"===_&&(I="start"),P=m(Object(i.a)(Object(i.a)({},R),{},{className:f()(k(v,E),(z={},Object(r.a)(z,k(v,"".concat(E,"-").concat(I)),I),Object(r.a)(z,v,"string"===typeof v),z)),style:S}),N)}else P=C?m(Object(i.a)({},R),N):d?p?m(Object(i.a)(Object(i.a)({},R),{},{style:{display:"none"}}),N):null:m(Object(i.a)(Object(i.a)({},R),{},{className:g}),N);else P=null;return s.createElement(L,{ref:x},P)}));return l.displayName="CSSMotion",l}(x),D=n(25);function B(e){var t;return t=e&&"object"===Object(o.a)(e)&&"key"in e?e:{key:e},Object(i.a)(Object(i.a)({},t),{},{key:String(t.key)})}function H(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(B)}function F(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,a=t.length,o=H(e),s=H(t);o.forEach((function(e){for(var t=!1,o=r;o1}));return u.forEach((function(e){(n=n.filter((function(t){var n=t.key,r=t.status;return n!==e||"remove"!==r}))).forEach((function(t){t.key===e&&(t.status="keep")}))})),n}var V=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];var U=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I,n=function(e){Object(R.a)(r,e);var n=Object(z.a)(r);function r(){var e;return Object(P.a)(this,r),(e=n.apply(this,arguments)).state={keyEntities:[]},e.removeKey=function(t){e.setState((function(e){return{keyEntities:e.keyEntities.map((function(e){return e.key!==t?e:Object(i.a)(Object(i.a)({},e),{},{status:"removed"})}))}}))},e}return Object(N.a)(r,[{key:"render",value:function(){var e=this,n=this.state.keyEntities,r=this.props,i=r.component,a=r.children,o=r.onVisibleChanged,c=Object(D.a)(r,["component","children","onVisibleChanged"]),u=i||s.Fragment,l={};return V.forEach((function(e){l[e]=c[e],delete c[e]})),delete c.keys,s.createElement(u,Object.assign({},c),n.map((function(n){var r=n.status,i=Object(D.a)(n,["status"]),c="add"===r||"keep"===r;return s.createElement(t,Object.assign({},l,{key:i.key,visible:c,eventProps:i,onVisibleChanged:function(t){null===o||void 0===o||o(t,{key:i.key}),t||e.removeKey(i.key)}}),a)})))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.keys,r=t.keyEntities,i=H(n);return{keyEntities:F(r,i).filter((function(e){var t=r.find((function(t){var n=t.key;return e.key===n}));return!t||"removed"!==t.status||"remove"!==e.status}))}}}]),r}(s.Component);return n.defaultProps={component:"div"},n}(x);t.b=I},function(e,t,n){"use strict";(function(e){var r=n(463),i=n(464),a=n(376);function o(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function p(e,t){if(c.isBuffer(e))return e.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!==typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return F(e).length;default:if(r)return H(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,n);case"utf8":case"utf-8":return _(this,t,n);case"ascii":return S(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,i){if(0===e.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"===typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,i);if("number"===typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,i){var a,o=1,s=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,c/=2,n/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var l=-1;for(a=n;as&&(n=s-c),a=n;a>=0;a--){for(var f=!0,h=0;hi&&(r=i):r=i;var a=t.length;if(a%2!==0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function E(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function _(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:u>223?3:u>191?2:1;if(i+f<=n)switch(f){case 1:u<128&&(l=u);break;case 2:128===(192&(a=e[i+1]))&&(c=(31&u)<<6|63&a)>127&&(l=c);break;case 3:a=e[i+1],o=e[i+2],128===(192&a)&&128===(192&o)&&(c=(15&u)<<12|(63&a)<<6|63&o)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128===(192&a)&&128===(192&o)&&128===(192&s)&&(c=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&c<1114112&&(l=c)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},c.prototype.compare=function(e,t,n,r,i){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),s=Math.min(a,o),u=this.slice(r,i),l=e.slice(t,n),f=0;fi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return x(this,e,t,n);case"latin1":case"binary":return M(this,e,t,n);case"base64":return O(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function S(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",a=t;an)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,n,r,i,a){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function N(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function R(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function z(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(e,t,n,r,a){return a||z(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function I(e,t,n,r,a){return a||z(e,0,n,8),i.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},c.prototype.readUInt8=function(e,t){return t||A(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||A(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||A(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||A(e,t,this.length);for(var r=this[e],i=1,a=0;++a=(i*=128)&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||A(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},c.prototype.readInt8=function(e,t){return t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||A(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){t||A(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||A(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||A(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||A(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||A(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||P(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+n},c.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):R(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);P(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);P(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):R(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,n){return L(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return I(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return I(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(a<1e3||!c.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(a=t;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function F(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(D,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function V(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(71))},function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return h}));var r=n(3),i=n(16),a=n(17),o=n(18),s=n(19),c=n(0),u=n(70).a,l=n(229),f=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(a.a)(n,[{key:"getLocale",value:function(){var e=this.props,t=e.componentName,n=e.defaultLocale||u[t||"global"],i=this.context,a=t&&i?i[t]:{};return Object(r.a)(Object(r.a)({},"function"===typeof n?n():n),a||{})}},{key:"getLocaleCode",value:function(){var e=this.context,t=e&&e.locale;return e&&e.exist&&!t?u.locale:t}},{key:"render",value:function(){return this.props.children(this.getLocale(),this.getLocaleCode(),this.context)}}]),n}(c.Component);function h(e,t){var n=c.useContext(l.a);return[c.useMemo((function(){var i=t||u[e||"global"],a=e&&n?n[e]:{};return Object(r.a)(Object(r.a)({},"function"===typeof i?i():i),a||{})}),[e,t,n])]}f.defaultProps={componentName:"global"},f.contextType=l.a},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(56),i=n.n(r);function a(e,t,n,r){var a=i.a.unstable_batchedUpdates?function(e){i.a.unstable_batchedUpdates(n,e)}:n;return e.addEventListener&&e.addEventListener(t,a,r),{remove:function(){e.removeEventListener&&e.removeEventListener(t,a)}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(48);function i(e,t,n){return(i="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(r.a)(e)););return e}(e,t);if(i){var a=Object.getOwnPropertyDescriptor(i,t);return a.get?a.get.call(n):a.value}})(e,t,n||e)}},function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}}(),e.exports=n(458)},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return i}));var r=function(){for(var e=arguments.length,t=new Array(e),n=0;n1)Object(f.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(0===t.length)return Object(f.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var n=t[0];if(c.isValidElement(n)&&Object(h.c)(n)){var r=n.ref;t[0]=c.cloneElement(n,{ref:Object(h.a)(r,this.setChildNode)})}return 1===t.length?t[0]:t.map((function(e,t){return!c.isValidElement(e)||"key"in e&&null!==e.key?e:c.cloneElement(e,{key:"".concat("rc-observer-key","-").concat(t)})}))}}]),n}(c.Component);p.displayName="ResizeObserver",t.a=p},function(e,t,n){var r=n(476),i=n(477),a=n(380),o=n(478);e.exports=function(e){return r(e)||i(e)||a(e)||o()}},function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return c})),n.d(t,"c",(function(){return u}));var r=n(3),i=n(0),a=n(117),o=function(e){return i.createElement(c,null,(function(t){var n=(0,t.getPrefixCls)("empty");switch(e){case"Table":case"List":return i.createElement(a.a,{image:a.a.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return i.createElement(a.a,{image:a.a.PRESENTED_IMAGE_SIMPLE,className:"".concat(n,"-small")});default:return i.createElement(a.a,null)}}))},s=i.createContext({getPrefixCls:function(e,t){return t||(e?"ant-".concat(e):"ant")},renderEmpty:o}),c=s.Consumer;function u(e){return function(t){var n=function(n){return i.createElement(c,null,(function(a){var o=e.prefixCls,s=(0,a.getPrefixCls)(o,n.prefixCls);return i.createElement(t,Object(r.a)({},a,n,{prefixCls:s}))}))},a=t.constructor,o=a&&a.displayName||t.name||"Component";return n.displayName="withConfigConsumer(".concat(o,")"),n}}},function(e,t,n){"use strict";(function(e,r){n.d(t,"a",(function(){return P})),n.d(t,"b",(function(){return Ee})),n.d(t,"c",(function(){return Y})),n.d(t,"d",(function(){return K})),n.d(t,"e",(function(){return xe}));var i=n(37),a=n.n(i),o=n(39),s=n.n(o),c=n(11),u=n.n(c),l=n(76),f=n.n(l),h=n(8),d=n.n(h),p=n(13),m=n.n(p),v=n(212),g=n.n(v),b=n(41),y=n.n(b),w=n(132),x=n(4),M=n(61),O=n.n(M),k=n(197),E=n.n(k),_=n(10),S=n.n(_),C=(n(111),n(198),n(199),n(7)),j=(n(200),n(163),n(187),n(361)),T=n.n(j),A=(n(130),f.a.lowlevel),P=function(){function t(e){if(a()(this,t),u()(this,"_bn",void 0),"string"===typeof e){var n=y.a.decode(e);if(32!=n.length)throw new Error("Invalid public key input");this._bn=new g.a(n)}else this._bn=new g.a(e);if(this._bn.byteLength()>32)throw new Error("Invalid public key input")}return s()(t,[{key:"equals",value:function(e){return this._bn.eq(e._bn)}},{key:"toBase58",value:function(){return y.a.encode(this.toBuffer())}},{key:"toBuffer",value:function(){var t=this._bn.toArrayLike(e);if(32===t.length)return t;var n=e.alloc(32);return t.copy(n,32-t.length),n}},{key:"toString",value:function(){return this.toBase58()}}],[{key:"createWithSeed",value:function(){var n=m()(d.a.mark((function n(r,i,a){var o,s;return d.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=e.concat([r.toBuffer(),e.from(i),a.toBuffer()]),n.next=3,Object(w.sha256)(new Uint8Array(o));case 3:return s=n.sent,n.abrupt("return",new t(e.from(s,"hex")));case 5:case"end":return n.stop()}}),n)})));return function(e,t,r){return n.apply(this,arguments)}}()},{key:"createProgramAddress",value:function(){var n=m()(d.a.mark((function n(r,i){var a,o,s;return d.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=e.alloc(0),r.forEach((function(t){if(t.length>32)throw new Error("Max seed length exceeded");a=e.concat([a,e.from(t)])})),a=e.concat([a,i.toBuffer(),e.from("ProgramDerivedAddress")]),n.next=5,Object(w.sha256)(new Uint8Array(a));case 5:if(o=n.sent,!N(s=new g.a(o,16).toArray(null,32))){n.next=9;break}throw new Error("Invalid seeds, address must fall off the curve");case 9:return n.abrupt("return",new t(s));case 10:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}()},{key:"findProgramAddress",value:function(){var t=m()(d.a.mark((function t(n,r){var i,a,o;return d.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=255;case 1:if(0==i){t.next=16;break}return t.prev=2,o=n.concat(e.from([i])),t.next=6,this.createProgramAddress(o,r);case 6:a=t.sent,t.next=13;break;case 9:return t.prev=9,t.t0=t.catch(2),i--,t.abrupt("continue",1);case 13:return t.abrupt("return",[a,i]);case 16:throw new Error("Unable to find a viable program address nonce");case 17:case"end":return t.stop()}}),t,this,[[2,9]])})));return function(e,n){return t.apply(this,arguments)}}()}]),t}();function N(e){var t=[A.gf(),A.gf(),A.gf(),A.gf()],n=A.gf(),r=A.gf(),i=A.gf(),a=A.gf(),o=A.gf(),s=A.gf(),c=A.gf();return A.set25519(t[2],R),A.unpack25519(t[1],e),A.S(i,t[1]),A.M(a,i,A.D),A.Z(i,i,t[2]),A.A(a,t[2],a),A.S(o,a),A.S(s,o),A.M(c,s,o),A.M(n,c,i),A.M(n,n,a),A.pow2523(n,n),A.M(n,n,i),A.M(n,n,a),A.M(n,n,a),A.M(t[0],n,a),A.S(r,t[0]),A.M(r,r,a),L(r,i)&&A.M(t[0],t[0],z),A.S(r,t[0]),A.M(r,r,a),L(r,i)?0:1}var R=A.gf([1]),z=A.gf([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function L(e,t){var n=new Uint8Array(32),r=new Uint8Array(32);return A.pack25519(n,e),A.pack25519(r,t),A.crypto_verify_32(n,0,r,0)}new P("BPFLoader1111111111111111111111111111111111");var I=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"publicKey";return Object(x.blob)(32,e)},D=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"string",n=Object(x.struct)([Object(x.u32)("length"),Object(x.u32)("lengthPadding"),Object(x.blob)(Object(x.offset)(Object(x.u32)(),-8),"chars")],t),r=n.decode.bind(n),i=n.encode.bind(n);return n.decode=function(e,t){return r(e,t).chars.toString("utf8")},n.encode=function(t,n,r){var a={chars:e.from(t,"utf8")};return i(a,n,r)},n.alloc=function(t){return Object(x.u32)().span+Object(x.u32)().span+e.from(t,"utf8").length},n};function B(e){for(var t=0,n=0;;){var r=e.shift();if(t|=(127&r)<<7*n,n+=1,0===(128&r))break}return t}function H(e,t){for(var n=t;;){var r=127&n;if(0==(n>>=7)){e.push(r);break}r|=128,e.push(r)}}var F=function(){function t(e){a()(this,t),u()(this,"header",void 0),u()(this,"accountKeys",void 0),u()(this,"recentBlockhash",void 0),u()(this,"instructions",void 0),this.header=e.header,this.accountKeys=e.accountKeys.map((function(e){return new P(e)})),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions}return s()(t,[{key:"isAccountWritable",value:function(e){return e=this.header.numRequiredSignatures&&e=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function U(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?this.signatures[0].signature:null}}]),s()(t,[{key:"add",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r0&&this.signatures[0].publicKey))throw new Error("Transaction fee payer required");t=this.signatures[0].publicKey}var r=[],i=[];this.instructions.forEach((function(e){e.keys.forEach((function(e){i.push(function(e){for(var t=1;t-1?a[n].isWritable=a[n].isWritable||e.isWritable:a.push(e)}));var o=a.findIndex((function(e){return e.pubkey.equals(t)}));if(o>-1){var s=a.splice(o,1),c=E()(s,1)[0];c.isSigner=!0,c.isWritable=!0,a.unshift(c)}else a.unshift({pubkey:t,isSigner:!0,isWritable:!0});var l,f=V(this.signatures);try{var h=function(){var e=l.value,t=a.findIndex((function(t){return t.pubkey.equals(e.publicKey)}));if(!(t>-1))throw new Error("unknown signer: ".concat(e.publicKey.toString()));a[t].isSigner||(a[t].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."))};for(f.s();!(l=f.n()).done;)h()}catch(x){f.e(x)}finally{f.f()}var d=0,p=0,m=0,v=[],g=[];a.forEach((function(e){var t=e.pubkey,n=e.isSigner,r=e.isWritable;n?(v.push(t.toString()),d+=1,r||(p+=1)):(g.push(t.toString()),r||(m+=1))}));var b=v.concat(g),w=this.instructions.map((function(e){var t=e.data,n=e.programId;return{programIdIndex:b.indexOf(n.toString()),accounts:e.keys.map((function(e){return b.indexOf(e.pubkey.toString())})),data:y.a.encode(t)}}));return w.forEach((function(e){S()(e.programIdIndex>=0),e.accounts.forEach((function(e){return S()(e>=0)}))})),new F({header:{numRequiredSignatures:d,numReadonlySignedAccounts:p,numReadonlyUnsignedAccounts:m},accountKeys:b,recentBlockhash:n,instructions:w})}},{key:"_compile",value:function(){var e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);if(this.signatures.length===t.length&&this.signatures.every((function(e,n){return t[n].equals(e.publicKey)})))return e;return this.signatures=t.map((function(e){return{signature:null,publicKey:e}})),e}},{key:"serializeMessage",value:function(){return this._compile().serialize()}},{key:"setSigners",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1?r-1:0),a=1;a ").concat(G)),a}},{key:"keys",get:function(){return S()(1===this.instructions.length),this.instructions[0].keys.map((function(e){return e.pubkey}))}},{key:"programId",get:function(){return S()(1===this.instructions.length),this.instructions[0].programId}},{key:"data",get:function(){return S()(1===this.instructions.length),this.instructions[0].data}}],[{key:"from",value:function(n){for(var r=O()(n),i=B(r),a=[],o=0;o0&&(r.feePayer=e.accountKeys[0]),n.forEach((function(t,n){var i={signature:t==y.a.encode(q)?null:y.a.decode(t),publicKey:e.accountKeys[n]};r.signatures.push(i)})),e.instructions.forEach((function(t){var n=t.accounts.map((function(t){var n=e.accountKeys[t];return{pubkey:n,isSigner:r.signatures.some((function(e){return e.publicKey.toString()===n.toString()})),isWritable:e.isAccountWritable(t)}}));r.instructions.push(new K({keys:n,programId:e.accountKeys[t.programIdIndex],data:y.a.decode(t.data)}))})),r}}]),t}(),X=(new P("SysvarC1ock11111111111111111111111111111111"),new P("SysvarRecentB1ockHashes11111111111111111111")),Z=new P("SysvarRent111111111111111111111111111111111"),J=(new P("SysvarRewards111111111111111111111111111111"),new P("SysvarStakeHistory1111111111111111111111111"),new P("Sysvar1nstructions1111111111111111111111111"),Object(x.nu64)("lamportsPerSignature")),Q=Object(x.struct)([Object(x.u32)("version"),Object(x.u32)("state"),I("authorizedPubkey"),I("nonce"),Object(x.struct)([J],"feeCalculator")]),$=Q.span;function ee(e){return te({context:Object(C.a)({slot:"number"}),value:e})}function te(e){var t=C.a.literal("2.0");return C.a.union([Object(C.a)({jsonrpc:t,id:"string",error:"any"}),Object(C.a)({jsonrpc:t,id:"string",error:"null?",result:e})])}function ne(e){return Object(C.a)({context:Object(C.a)({slot:"number"}),value:e})}var re=Object(C.a)({foundation:"number",foundationTerm:"number",initial:"number",taper:"number",terminal:"number"}),ie=Object(C.a)({epoch:"number",slotIndex:"number",slotsInEpoch:"number",absoluteSlot:"number",blockHeight:"number?",transactionCount:"number?"}),ae=Object(C.a)({slotsPerEpoch:"number",leaderScheduleSlotOffset:"number",warmup:"boolean",firstNormalEpoch:"number",firstNormalSlot:"number"}),oe=C.a.record(["string","any"]),se=C.a.union(["null","object"]),ce=Object(C.a)({err:se}),ue=C.a.pick({"solana-core":"string","feature-set":"number?"});ee(C.a.pick({err:C.a.union(["null","object","string"]),logs:C.a.union(["null",C.a.array(["string"])])}));Object(C.a)({jsonrpc:C.a.literal("2.0"),id:"string",error:"any?",result:re}),Object(C.a)({jsonrpc:C.a.literal("2.0"),id:"string",error:"any?",result:ie}),Object(C.a)({jsonrpc:C.a.literal("2.0"),id:"string",error:"any?",result:ae}),te(oe),ee("number?"),Object(C.a)({jsonrpc:C.a.literal("2.0"),id:"string",error:"any?",result:C.a.union(["null","number","undefined"])}),Object(C.a)({jsonrpc:C.a.literal("2.0"),id:"string",error:"any?",result:"number"}),ee(Object(C.a)({total:"number",circulating:"number",nonCirculating:"number",nonCirculatingAccounts:C.a.array(["string"])}));var le=C.a.object({amount:"string",uiAmount:"number",decimals:"number"}),fe=(ee(C.a.array([C.a.pick({address:"string",amount:"string",uiAmount:"number",decimals:"number"})])),ee(le),ee(le),ee(C.a.array([C.a.object({pubkey:"string",account:C.a.object({executable:"boolean",owner:"string",lamports:"number",data:["string",C.a.literal("base64")],rentEpoch:"number?"})})])),ee(C.a.array([C.a.object({pubkey:"string",account:C.a.object({executable:"boolean",owner:"string",lamports:"number",data:C.a.pick({program:"string",parsed:"any",space:"number"}),rentEpoch:"number?"})})])),ee(C.a.array([Object(C.a)({lamports:"number",address:"string"})])),Object(C.a)({jsonrpc:C.a.literal("2.0"),id:"string",error:"any?",result:ue}),Object(C.a)({executable:"boolean",owner:"string",lamports:"number",data:"any",rentEpoch:"number?"})),he=C.a.object({executable:"boolean",owner:"string",lamports:"number",data:C.a.union([["string",C.a.literal("base64")],C.a.pick({program:"string",parsed:"any",space:"number"})]),rentEpoch:"number?"}),de=C.a.object({state:C.a.union([C.a.literal("active"),C.a.literal("inactive"),C.a.literal("activating"),C.a.literal("deactivating")]),active:"number",inactive:"number"}),pe=(ee(C.a.union(["null",fe])),ee(C.a.union(["null",he])),te(de),te(C.a.array(["string"])),te(C.a.array([C.a.pick({signature:"string",slot:"number",err:se,memo:C.a.union(["null","string"]),blockTime:C.a.union(["undefined","null","number"])})])),Object(C.a)({subscription:"number",result:ne(fe)}),Object(C.a)({pubkey:"string",account:fe})),me=Object(C.a)({pubkey:"string",account:he}),ve=(Object(C.a)({subscription:"number",result:ne(pe)}),Object(C.a)({parent:"number",slot:"number",root:"number"})),ge=(Object(C.a)({subscription:"number",result:ve}),Object(C.a)({subscription:"number",result:ne(ce)}),Object(C.a)({subscription:"number",result:"number"}),te(C.a.array([pe])),te(C.a.array([me])),te("number"),te("string"),te(C.a.array([C.a.pick({pubkey:"string",gossip:C.a.union(["null","string"]),tpu:C.a.union(["null","string"]),rpc:C.a.union(["null","string"]),version:C.a.union(["null","string"])})])),te(Object(C.a)({current:C.a.array([C.a.pick({votePubkey:"string",nodePubkey:"string",activatedStake:"number",epochVoteAccount:"boolean",epochCredits:C.a.array([C.a.tuple(["number","number","number"])]),commission:"number",lastVote:"number",rootSlot:"number?"})]),delinquent:C.a.array([C.a.pick({votePubkey:"string",nodePubkey:"string",activatedStake:"number",epochVoteAccount:"boolean",epochCredits:C.a.array([C.a.tuple(["number","number","number"])]),commission:"number",lastVote:"number",rootSlot:"number?"})])})),ee(C.a.array([C.a.union(["null",C.a.pick({slot:"number",confirmations:C.a.union(["number","null"]),err:se,confirmationStatus:"string?"})])])),te("number"),te("number"),te("number"),Object(C.a)({signatures:C.a.array(["string"]),message:Object(C.a)({accountKeys:C.a.array(["string"]),header:Object(C.a)({numRequiredSignatures:"number",numReadonlySignedAccounts:"number",numReadonlyUnsignedAccounts:"number"}),instructions:C.a.array([Object(C.a)({accounts:C.a.array(["number"]),data:"string",programIdIndex:"number"})]),recentBlockhash:"string"})})),be=Object(C.a)({signatures:C.a.array(["string"]),message:Object(C.a)({accountKeys:C.a.array([Object(C.a)({pubkey:"string",signer:"boolean",writable:"boolean"})]),instructions:C.a.array([C.a.union([Object(C.a)({accounts:C.a.array(["string"]),data:"string",programId:"string"}),Object(C.a)({parsed:"any",program:"string",programId:"string"})])]),recentBlockhash:"string"})}),ye=C.a.union(["null",C.a.pick({err:se,fee:"number",innerInstructions:C.a.union([C.a.array([Object(C.a)({index:"number",instructions:C.a.array([Object(C.a)({accounts:C.a.array(["number"]),data:"string",programIdIndex:"number"})])})]),"null","undefined"]),preBalances:C.a.array(["number"]),postBalances:C.a.array(["number"]),logMessages:C.a.union([C.a.array(["string"]),"null","undefined"]),preTokenBalances:C.a.union([C.a.array([C.a.pick({accountIndex:"number",mint:"string",uiTokenAmount:C.a.pick({amount:"string",decimals:"number",uiAmount:"number"})})]),"null","undefined"]),postTokenBalances:C.a.union([C.a.array([C.a.pick({accountIndex:"number",mint:"string",uiTokenAmount:C.a.pick({amount:"string",decimals:"number",uiAmount:"number"})})]),"null","undefined"])})]),we=C.a.union(["null",C.a.pick({err:se,fee:"number",innerInstructions:C.a.union([C.a.array([Object(C.a)({index:"number",instructions:C.a.array([C.a.union([Object(C.a)({accounts:C.a.array(["string"]),data:"string",programId:"string"}),Object(C.a)({parsed:"any",program:"string",programId:"string"})])])})]),"null","undefined"]),preBalances:C.a.array(["number"]),postBalances:C.a.array(["number"]),logMessages:C.a.union([C.a.array(["string"]),"null","undefined"]),preTokenBalances:C.a.union([C.a.array([C.a.pick({accountIndex:"number",mint:"string",uiTokenAmount:C.a.pick({amount:"string",decimals:"number",uiAmount:"number"})})]),"null","undefined"]),postTokenBalances:C.a.union([C.a.array([C.a.pick({accountIndex:"number",mint:"string",uiTokenAmount:C.a.pick({amount:"string",decimals:"number",uiAmount:"number"})})]),"null","undefined"])})]);te(C.a.union(["null",C.a.pick({blockhash:"string",previousBlockhash:"string",parentSlot:"number",transactions:C.a.array([Object(C.a)({transaction:ge,meta:ye})]),rewards:C.a.union(["undefined",C.a.array([Object(C.a)({pubkey:"string",lamports:"number",postBalance:C.a.union(["number","undefined"]),rewardType:C.a.union(["string","undefined"])})])])})])),te(C.a.union(["null",C.a.pick({slot:"number",transaction:ge,meta:ye,blockTime:C.a.union(["number","null","undefined"])})])),te(C.a.union(["null",C.a.pick({slot:"number",transaction:be,meta:we,blockTime:C.a.union(["number","null","undefined"])})])),ee(Object(C.a)({blockhash:"string",feeCalculator:Object(C.a)({lamportsPerSignature:"number"})})),te(C.a.array([C.a.pick({slot:"number",numTransactions:"number",numSlots:"number",samplePeriodSecs:"number"})])),ee(C.a.union(["null",Object(C.a)({feeCalculator:Object(C.a)({lamportsPerSignature:"number"})})])),te("string"),te("string");function xe(e,t,n,r){return Me.apply(this,arguments)}function Me(){return(Me=m()(d.a.mark((function e(t,n,r,i){var a,o,s;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=i&&{skipPreflight:i.skipPreflight,preflightCommitment:i.preflightCommitment||i.commitment},e.next=3,t.sendTransaction(n,r,a);case 3:return o=e.sent,e.next=6,t.confirmTransaction(o,i&&i.commitment);case 6:if(!(s=e.sent.value).err){e.next=9;break}throw new Error("Transaction ".concat(o," failed (").concat(JSON.stringify(s),")"));case 9:return e.abrupt("return",o);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Oe(t,n){var r=t.layout.span>=0?t.layout.span:function(e,t){var n=0;return e.layout.fields.forEach((function(e){e.span>=0?n+=e.span:"function"===typeof e.alloc&&(n+=e.alloc(t[e.property]))})),n}(t,n),i=e.alloc(r),a=Object.assign({instruction:t.index},n);return t.layout.encode(a,i),i}var ke=Object.freeze({Create:{index:0,layout:Object(x.struct)([Object(x.u32)("instruction"),Object(x.ns64)("lamports"),Object(x.ns64)("space"),I("programId")])},Assign:{index:1,layout:Object(x.struct)([Object(x.u32)("instruction"),I("programId")])},Transfer:{index:2,layout:Object(x.struct)([Object(x.u32)("instruction"),Object(x.ns64)("lamports")])},CreateWithSeed:{index:3,layout:Object(x.struct)([Object(x.u32)("instruction"),I("base"),D("seed"),Object(x.ns64)("lamports"),Object(x.ns64)("space"),I("programId")])},AdvanceNonceAccount:{index:4,layout:Object(x.struct)([Object(x.u32)("instruction")])},WithdrawNonceAccount:{index:5,layout:Object(x.struct)([Object(x.u32)("instruction"),Object(x.ns64)("lamports")])},InitializeNonceAccount:{index:6,layout:Object(x.struct)([Object(x.u32)("instruction"),I("authorized")])},AuthorizeNonceAccount:{index:7,layout:Object(x.struct)([Object(x.u32)("instruction"),I("authorized")])},Allocate:{index:8,layout:Object(x.struct)([Object(x.u32)("instruction"),Object(x.ns64)("space")])},AllocateWithSeed:{index:9,layout:Object(x.struct)([Object(x.u32)("instruction"),I("base"),D("seed"),Object(x.ns64)("space"),I("programId")])},AssignWithSeed:{index:10,layout:Object(x.struct)([Object(x.u32)("instruction"),I("base"),D("seed"),I("programId")])},TransferWithSeed:{index:11,layout:Object(x.struct)([Object(x.u32)("instruction"),Object(x.ns64)("lamports"),D("seed"),I("programId")])}}),Ee=function(){function e(){a()(this,e)}return s()(e,null,[{key:"createAccount",value:function(e){var t=Oe(ke.Create,{lamports:e.lamports,space:e.space,programId:e.programId.toBuffer()});return new K({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:t})}},{key:"transfer",value:function(e){var t,n;e.basePubkey?(t=Oe(ke.TransferWithSeed,{lamports:e.lamports,seed:e.seed,programId:e.programId.toBuffer()}),n=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]):(t=Oe(ke.Transfer,{lamports:e.lamports}),n=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]);return new K({keys:n,programId:this.programId,data:t})}},{key:"assign",value:function(e){var t,n;e.basePubkey?(t=Oe(ke.AssignWithSeed,{base:e.basePubkey.toBuffer(),seed:e.seed,programId:e.programId.toBuffer()}),n=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]):(t=Oe(ke.Assign,{programId:e.programId.toBuffer()}),n=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]);return new K({keys:n,programId:this.programId,data:t})}},{key:"createAccountWithSeed",value:function(e){var t=Oe(ke.CreateWithSeed,{base:e.basePubkey.toBuffer(),seed:e.seed,lamports:e.lamports,space:e.space,programId:e.programId.toBuffer()});return new K({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}],programId:this.programId,data:t})}},{key:"createNonceAccount",value:function(t){var n=new Y;t.basePubkey&&t.seed?n.add(e.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:$,programId:this.programId})):n.add(e.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,lamports:t.lamports,space:$,programId:this.programId}));var r={noncePubkey:t.noncePubkey,authorizedPubkey:t.authorizedPubkey};return n.add(this.nonceInitialize(r)),n}},{key:"nonceInitialize",value:function(e){var t=Oe(ke.InitializeNonceAccount,{authorized:e.authorizedPubkey.toBuffer()}),n={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:X,isSigner:!1,isWritable:!1},{pubkey:Z,isSigner:!1,isWritable:!1}],programId:this.programId,data:t};return new K(n)}},{key:"nonceAdvance",value:function(e){var t=Oe(ke.AdvanceNonceAccount),n={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:X,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t};return new K(n)}},{key:"nonceWithdraw",value:function(e){var t=Oe(ke.WithdrawNonceAccount,{lamports:e.lamports});return new K({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:X,isSigner:!1,isWritable:!1},{pubkey:Z,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}},{key:"nonceAuthorize",value:function(e){var t=Oe(ke.AuthorizeNonceAccount,{authorized:e.newAuthorizedPubkey.toBuffer()});return new K({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}},{key:"allocate",value:function(e){var t,n;e.basePubkey?(t=Oe(ke.AllocateWithSeed,{base:e.basePubkey.toBuffer(),seed:e.seed,space:e.space,programId:e.programId.toBuffer()}),n=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]):(t=Oe(ke.Allocate,{space:e.space}),n=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]);return new K({keys:n,programId:this.programId,data:t})}},{key:"programId",get:function(){return new P("11111111111111111111111111111111")}}]),e}();new P("BPFLoader2111111111111111111111111111111111"),new P("StakeConfig11111111111111111111111111111111"),Object.freeze({Initialize:{index:0,layout:Object(x.struct)([Object(x.u32)("instruction"),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"authorized";return Object(x.struct)([I("staker"),I("withdrawer")],e)}(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"lockup";return Object(x.struct)([Object(x.ns64)("unixTimestamp"),Object(x.ns64)("epoch"),I("custodian")],e)}()])},Authorize:{index:1,layout:Object(x.struct)([Object(x.u32)("instruction"),I("newAuthorized"),Object(x.u32)("stakeAuthorizationType")])},Delegate:{index:2,layout:Object(x.struct)([Object(x.u32)("instruction")])},Split:{index:3,layout:Object(x.struct)([Object(x.u32)("instruction"),Object(x.ns64)("lamports")])},Withdraw:{index:4,layout:Object(x.struct)([Object(x.u32)("instruction"),Object(x.ns64)("lamports")])},Deactivate:{index:5,layout:Object(x.struct)([Object(x.u32)("instruction")])},AuthorizeWithSeed:{index:8,layout:Object(x.struct)([Object(x.u32)("instruction"),I("newAuthorized"),Object(x.u32)("stakeAuthorizationType"),D("authoritySeed"),I("authorityOwner")])}}),Object.freeze({Staker:{index:0},Withdrawer:{index:1}}),T.a.publicKeyCreate,T.a.ecdsaSign,Object(x.struct)([Object(x.u8)("numSignatures"),Object(x.u16)("signatureOffset"),Object(x.u8)("signatureInstructionIndex"),Object(x.u16)("ethAddressOffset"),Object(x.u8)("ethAddressInstructionIndex"),Object(x.u16)("messageDataOffset"),Object(x.u16)("messageDataSize"),Object(x.u8)("messageInstructionIndex"),Object(x.blob)(20,"ethPublicKey"),Object(x.blob)(64,"signature"),Object(x.u8)("recoveryId")]);new P("Va1idator1nfo111111111111111111111111111111"),Object(C.a)({name:"string",website:"string?",details:"string?",keybaseUsername:"string?"}),new P("Vote111111111111111111111111111111111111111"),Object(x.struct)([I("nodePubkey"),I("authorizedVoterPubkey"),I("authorizedWithdrawerPubkey"),Object(x.u8)("commission"),Object(x.nu64)(),Object(x.seq)(Object(x.struct)([Object(x.nu64)("slot"),Object(x.u32)("confirmationCount")]),Object(x.offset)(Object(x.u32)(),-8),"votes"),Object(x.u8)("rootSlotValid"),Object(x.nu64)("rootSlot"),Object(x.nu64)("epoch"),Object(x.nu64)("credits"),Object(x.nu64)("lastEpochCredits"),Object(x.nu64)(),Object(x.seq)(Object(x.struct)([Object(x.nu64)("epoch"),Object(x.nu64)("credits"),Object(x.nu64)("prevCredits")]),Object(x.offset)(Object(x.u32)(),-8),"epochCredits")])}).call(this,n(52).Buffer,n(90))},function(e,t,n){"use strict";var r=n(0),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"}}]},name:"close",theme:"outlined"},a=n(1),o=function(e,t){return r.createElement(a.a,Object.assign({},e,{ref:t,icon:i}))};o.displayName="CloseOutlined";t.a=r.forwardRef(o)},function(e,t,n){"use strict";var r=n(2),i=n(9),a=n(3),o=n(0),s=n(320),c=n(5),u=n.n(c),l=n(308),f={adjustX:1,adjustY:1},h={adjustX:0,adjustY:0},d=[0,0];function p(e){return"boolean"===typeof e?e?f:h:Object(a.a)(Object(a.a)({},h),e)}var m=n(31),v=n(62),g=n(169),b=new RegExp("^(".concat(g.a.join("|"),")(-inverse)?$"));function y(e,t){var n=e.type;if((!0===n.__ANT_BUTTON||!0===n.__ANT_SWITCH||!0===n.__ANT_CHECKBOX||"button"===e.type)&&e.props.disabled){var r=function(e,t){var n={},r=Object(a.a)({},e);return t.forEach((function(t){e&&t in e&&(n[t]=e[t],delete r[t])})),{picked:n,omitted:r}}(e.props.style,["position","left","right","top","bottom","float","display","zIndex"]),i=r.picked,s=r.omitted,c=Object(a.a)(Object(a.a)({display:"inline-block"},i),{cursor:"not-allowed",width:e.props.block?"100%":null}),l=Object(a.a)(Object(a.a)({},s),{pointerEvents:"none"}),f=Object(m.a)(e,{style:l,className:null});return o.createElement("span",{style:c,className:u()(e.props.className,"".concat(t,"-disabled-compatible-wrapper"))},f)}return e}var w=o.forwardRef((function(e,t){var n,c=o.useContext(v.b),f=c.getPopupContainer,h=c.getPrefixCls,g=c.direction,w=o.useState(!!e.visible||!!e.defaultVisible),x=Object(i.a)(w,2),M=x[0],O=x[1];o.useEffect((function(){"visible"in e&&O(e.visible)}),[e.visible]);var k=function(){var t=e.title,n=e.overlay;return!t&&!n&&0!==t},E=function(){var t=e.builtinPlacements,n=e.arrowPointAtCenter,r=e.autoAdjustOverflow;return t||function(e){var t=e.arrowWidth,n=void 0===t?5:t,r=e.horizontalArrowShift,i=void 0===r?16:r,o=e.verticalArrowShift,s=void 0===o?8:o,c=e.autoAdjustOverflow,u={left:{points:["cr","cl"],offset:[-4,0]},right:{points:["cl","cr"],offset:[4,0]},top:{points:["bc","tc"],offset:[0,-4]},bottom:{points:["tc","bc"],offset:[0,4]},topLeft:{points:["bl","tc"],offset:[-(i+n),-4]},leftTop:{points:["tr","cl"],offset:[-4,-(s+n)]},topRight:{points:["br","tc"],offset:[i+n,-4]},rightTop:{points:["tl","cr"],offset:[4,-(s+n)]},bottomRight:{points:["tr","bc"],offset:[i+n,4]},rightBottom:{points:["bl","cr"],offset:[4,s+n]},bottomLeft:{points:["tl","bc"],offset:[-(i+n),4]},leftBottom:{points:["br","cl"],offset:[-4,s+n]}};return Object.keys(u).forEach((function(t){u[t]=e.arrowPointAtCenter?Object(a.a)(Object(a.a)({},u[t]),{overflow:p(c),targetOffset:d}):Object(a.a)(Object(a.a)({},l.a[t]),{overflow:p(c)}),u[t].ignoreShake=!0})),u}({arrowPointAtCenter:n,autoAdjustOverflow:r})},_=e.prefixCls,S=e.openClassName,C=e.getPopupContainer,j=e.getTooltipContainer,T=e.overlayClassName,A=e.color,P=e.overlayInnerStyle,N=e.children,R=h("tooltip",_),z=M;!("visible"in e)&&k()&&(z=!1);var L,I=y(Object(m.b)(N)?N:o.createElement("span",null,N),R),D=I.props,B=u()(D.className,Object(r.a)({},S||"".concat(R,"-open"),!0)),H=u()(T,(n={},Object(r.a)(n,"".concat(R,"-rtl"),"rtl"===g),Object(r.a)(n,"".concat(R,"-").concat(A),A&&b.test(A)),n)),F=P;return A&&!b.test(A)&&(F=Object(a.a)(Object(a.a)({},P),{background:A}),L={background:A}),o.createElement(s.a,Object(a.a)({},e,{prefixCls:R,overlayClassName:H,getTooltipContainer:C||j||f,ref:t,builtinPlacements:E(),overlay:function(){var t=e.title,n=e.overlay;return 0===t?t:n||t||""}(),visible:z,onVisibleChange:function(t){"visible"in e||O(!k()&&t),e.onVisibleChange&&!k()&&e.onVisibleChange(t)},onPopupAlign:function(e,t){var n=E(),r=Object.keys(n).filter((function(e){return n[e].points[0]===t.points[0]&&n[e].points[1]===t.points[1]}))[0];if(r){var i=e.getBoundingClientRect(),a={top:"50%",left:"50%"};r.indexOf("top")>=0||r.indexOf("Bottom")>=0?a.top="".concat(i.height-t.offset[1],"px"):(r.indexOf("Top")>=0||r.indexOf("bottom")>=0)&&(a.top="".concat(-t.offset[1],"px")),r.indexOf("left")>=0||r.indexOf("Right")>=0?a.left="".concat(i.width-t.offset[0],"px"):(r.indexOf("right")>=0||r.indexOf("Left")>=0)&&(a.left="".concat(-t.offset[0],"px")),e.style.transformOrigin="".concat(a.left," ").concat(a.top)}},overlayInnerStyle:F,arrowContent:o.createElement("span",{className:"".concat(R,"-arrow-content"),style:L})}),z?Object(m.a)(I,{className:B}):I)}));w.displayName="Tooltip",w.defaultProps={placement:"top",transitionName:"zoom-big-fast",mouseEnterDelay:.1,mouseLeaveDelay:.1,arrowPointAtCenter:!1,autoAdjustOverflow:!0};t.a=w},function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return w})),n.d(t,"c",(function(){return k})),n.d(t,"d",(function(){return C})),n.d(t,"e",(function(){return g})),n.d(t,"f",(function(){return R})),n.d(t,"g",(function(){return z})),n.d(t,"h",(function(){return v})),n.d(t,"i",(function(){return O})),n.d(t,"j",(function(){return S})),n.d(t,"k",(function(){return D})),n.d(t,"l",(function(){return B})),n.d(t,"m",(function(){return H})),n.d(t,"n",(function(){return F})),n.d(t,"o",(function(){return L}));var r=n(96),i=n(0),a=n.n(i),o=(n(226),n(110)),s=n(365),c=n(97),u=n(3),l=n(366),f=n.n(l),h=(n(188),n(115)),d=n(232),p=n.n(d),m=function(e){var t=Object(s.a)();return t.displayName=e,t}("Router-History"),v=function(e){var t=Object(s.a)();return t.displayName=e,t}("Router"),g=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}Object(r.a)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return a.a.createElement(v.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},a.a.createElement(m.Provider,{children:this.props.children||null,value:this.props.history}))},t}(a.a.Component);var b=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;ie.top-n)return n+t.top}function k(e,t,n){if(void 0!==n&&t.bottom=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};function A(){return"undefined"!==typeof window?window:null}!function(e){e[e.None=0]="None",e[e.Prepare=1]="Prepare"}(j||(j={}));var P=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){var e;return Object(a.a)(this,n),(e=t.apply(this,arguments)).state={status:j.None,lastAffix:!1,prevTarget:null},e.getOffsetTop=function(){var t=e.props.offsetBottom,n=e.props.offsetTop;return void 0===t&&void 0===n&&(n=0),n},e.getOffsetBottom=function(){return e.props.offsetBottom},e.savePlaceholderNode=function(t){e.placeholderNode=t},e.saveFixedNode=function(t){e.fixedNode=t},e.measure=function(){var t=e.state,n=t.status,r=t.lastAffix,i=e.props.onChange,a=e.getTargetFunc();if(n===j.Prepare&&e.fixedNode&&e.placeholderNode&&a){var o=e.getOffsetTop(),s=e.getOffsetBottom(),c=a();if(c){var u={status:j.None},l=M(c),f=M(e.placeholderNode),h=O(f,l,o),d=k(f,l,s);void 0!==h?(u.affixStyle={position:"fixed",top:h,width:f.width,height:f.height},u.placeholderStyle={width:f.width,height:f.height}):void 0!==d&&(u.affixStyle={position:"fixed",bottom:d,width:f.width,height:f.height},u.placeholderStyle={width:f.width,height:f.height}),u.lastAffix=!!u.affixStyle,i&&r!==u.lastAffix&&i(u.lastAffix),e.setState(u)}}},e.prepareMeasure=function(){e.setState({status:j.Prepare,affixStyle:void 0,placeholderStyle:void 0})},e.render=function(){var t=e.context.getPrefixCls,n=e.state,a=n.affixStyle,o=n.placeholderStyle,s=e.props,c=s.prefixCls,u=s.children,f=d()(Object(i.a)({},t("affix",c),a)),h=Object(p.a)(e.props,["prefixCls","offsetTop","offsetBottom","target","onChange"]);return l.createElement(m.a,{onResize:function(){e.updatePosition()}},l.createElement("div",Object(r.a)({},h,{ref:e.savePlaceholderNode}),a&&l.createElement("div",{style:o,"aria-hidden":"true"}),l.createElement("div",{className:f,ref:e.saveFixedNode,style:a},l.createElement(m.a,{onResize:function(){e.updatePosition()}},u))))},e}return Object(o.a)(n,[{key:"getTargetFunc",value:function(){var e=this.context.getTargetContainer,t=this.props.target;return void 0!==t?t:e||A}},{key:"componentDidMount",value:function(){var e=this,t=this.getTargetFunc();t&&(this.timeout=setTimeout((function(){S(t(),e),e.updatePosition()})))}},{key:"componentDidUpdate",value:function(e){var t=this.state.prevTarget,n=this.getTargetFunc(),r=null;n&&(r=n()||null),t!==r&&(C(this),r&&(S(r,this),this.updatePosition()),this.setState({prevTarget:r})),e.offsetTop===this.props.offsetTop&&e.offsetBottom===this.props.offsetBottom||this.updatePosition(),this.measure()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timeout),C(this),this.updatePosition.cancel(),this.lazyUpdatePosition.cancel()}},{key:"updatePosition",value:function(){this.prepareMeasure()}},{key:"lazyUpdatePosition",value:function(){var e=this.getTargetFunc(),t=this.state.affixStyle;if(e&&t){var n=this.getOffsetTop(),r=this.getOffsetBottom(),i=e();if(i&&this.placeholderNode){var a=M(i),o=M(this.placeholderNode),s=O(o,a,n),c=k(o,a,r);if(void 0!==s&&t.top===s||void 0!==c&&t.bottom===c)return}}this.prepareMeasure()}}]),n}(l.Component);P.contextType=v.b,T([w()],P.prototype,"updatePosition",null),T([w()],P.prototype,"lazyUpdatePosition",null);var N=P,R=n(27),z=n(210),L=n(167),I=l.createContext(null);function D(){return window}function B(e,t){if(!e.getClientRects().length)return 0;var n=e.getBoundingClientRect();return n.width||n.height?t===window?(t=e.ownerDocument.documentElement,n.top-t.clientTop):n.top-t.getBoundingClientRect().top:n.top}var H=/#(\S+)$/,F=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){var e;return Object(a.a)(this,n),(e=t.apply(this,arguments)).state={activeLink:null},e.wrapperRef=l.createRef(),e.links=[],e.registerLink=function(t){e.links.includes(t)||e.links.push(t)},e.unregisterLink=function(t){var n=e.links.indexOf(t);-1!==n&&e.links.splice(n,1)},e.getContainer=function(){var t=e.context.getTargetContainer;return(e.props.getContainer||t||D)()},e.handleScrollTo=function(t){var n=e.props,r=n.offsetTop,i=n.targetOffset;e.setCurrentActiveLink(t);var a=e.getContainer(),o=Object(L.a)(a,!0),s=H.exec(t);if(s){var c=document.getElementById(s[1]);if(c){var u=o+B(c,a);u-=void 0!==i?i:r||0,e.animating=!0,Object(z.a)(u,{callback:function(){e.animating=!1},getContainer:e.getContainer})}}},e.saveInkNode=function(t){e.inkNode=t},e.setCurrentActiveLink=function(t){var n=e.state.activeLink,r=e.props.onChange;n!==t&&(e.setState({activeLink:t}),r&&r(t))},e.handleScroll=function(){if(!e.animating){var t=e.props,n=t.offsetTop,r=t.bounds,i=t.targetOffset,a=e.getCurrentAnchor(void 0!==i?i:n||0,r);e.setCurrentActiveLink(a)}},e.updateInk=function(){var t=Object(R.a)(e),n=t.prefixCls,r=t.wrapperRef.current,i=null===r||void 0===r?void 0:r.getElementsByClassName("".concat(n,"-link-title-active"))[0];i&&(e.inkNode.style.top="".concat(i.offsetTop+i.clientHeight/2-4.5,"px"))},e.render=function(){var t=e.context,n=t.getPrefixCls,a=t.direction,o=e.props,s=o.prefixCls,c=o.className,u=void 0===c?"":c,f=o.style,h=o.offsetTop,p=o.affix,m=o.showInkInFixed,v=o.children,g=e.state.activeLink,b=n("anchor",s);e.prefixCls=b;var y=d()("".concat(b,"-ink-ball"),{visible:g}),w=d()("".concat(b,"-wrapper"),Object(i.a)({},"".concat(b,"-rtl"),"rtl"===a),u),x=d()(b,{fixed:!p&&!m}),M=Object(r.a)({maxHeight:h?"calc(100vh - ".concat(h,"px)"):"100vh"},f),O=l.createElement("div",{ref:e.wrapperRef,className:w,style:M},l.createElement("div",{className:x},l.createElement("div",{className:"".concat(b,"-ink")},l.createElement("span",{className:y,ref:e.saveInkNode})),v));return l.createElement(I.Provider,{value:{registerLink:e.registerLink,unregisterLink:e.unregisterLink,activeLink:e.state.activeLink,scrollTo:e.handleScrollTo,onClick:e.props.onClick}},p?l.createElement(N,{offsetTop:h,target:e.getContainer},O):O)},e}return Object(o.a)(n,[{key:"componentDidMount",value:function(){this.scrollContainer=this.getContainer(),this.scrollEvent=Object(x.a)(this.scrollContainer,"scroll",this.handleScroll),this.handleScroll()}},{key:"componentDidUpdate",value:function(){if(this.scrollEvent){var e=this.getContainer();this.scrollContainer!==e&&(this.scrollContainer=e,this.scrollEvent.remove(),this.scrollEvent=Object(x.a)(this.scrollContainer,"scroll",this.handleScroll),this.handleScroll())}this.updateInk()}},{key:"componentWillUnmount",value:function(){this.scrollEvent&&this.scrollEvent.remove()}},{key:"getCurrentAnchor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5,n=this.props.getCurrentAnchor;if("function"===typeof n)return n();var r=[],i=this.getContainer();if(this.links.forEach((function(n){var a=H.exec(n.toString());if(a){var o=document.getElementById(a[1]);if(o){var s=B(o,i);se.top?t:e}));return a.link}return""}}]),n}(l.Component);F.defaultProps={affix:!0,showInkInFixed:!1},F.contextType=v.b;var V=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){var e;return Object(a.a)(this,n),(e=t.apply(this,arguments)).handleClick=function(t){var n=e.context,r=n.scrollTo,i=n.onClick,a=e.props,o=a.href,s=a.title;i&&i(t,{title:s,href:o}),r(o)},e.renderAnchorLink=function(t){var n=t.getPrefixCls,r=e.props,a=r.prefixCls,o=r.href,s=r.title,c=r.children,u=r.className,f=r.target,h=n("anchor",a),p=e.context.activeLink===o,m=d()("".concat(h,"-link"),Object(i.a)({},"".concat(h,"-link-active"),p),u),v=d()("".concat(h,"-link-title"),Object(i.a)({},"".concat(h,"-link-title-active"),p));return l.createElement("div",{className:m},l.createElement("a",{className:v,href:o,title:"string"===typeof s?s:"",target:f,onClick:e.handleClick},s),c)},e}return Object(o.a)(n,[{key:"componentDidMount",value:function(){this.context.registerLink(this.props.href)}},{key:"componentDidUpdate",value:function(e){var t=e.href,n=this.props.href;t!==n&&(this.context.unregisterLink(t),this.context.registerLink(n))}},{key:"componentWillUnmount",value:function(){this.context.unregisterLink(this.props.href)}},{key:"render",value:function(){return l.createElement(v.a,null,this.renderAnchorLink)}}]),n}(l.Component);V.defaultProps={href:"#"},V.contextType=I;var U=V;F.Link=U;var W=F,q=n(9),G=n(43),K=n(80),Y=n(29),X=n(31),Z=K.a.Option;function J(e){return e&&e.type&&(e.type.isSelectOption||e.type.isSelectOptGroup)}var Q=function(e,t){var n,i=e.prefixCls,a=e.className,o=e.children,s=e.dataSource,c=Object(G.a)(o);if(1===c.length&&Object(X.b)(c[0])&&!J(c[0])){var f=Object(q.a)(c,1);n=f[0]}var h,m=n?function(){return n}:void 0;return h=c.length&&J(c[0])?o:s?s.map((function(e){if(Object(X.b)(e))return e;switch(Object(u.a)(e)){case"string":return l.createElement(Z,{key:e,value:e},e);case"object":var t=e.value;return l.createElement(Z,{key:t,value:t},e.text);default:throw new Error("AutoComplete[dataSource] only supports type `string[] | Object[]`.")}})):[],l.useEffect((function(){Object(Y.a)(!("dataSource"in e),"AutoComplete","`dataSource` is deprecated, please use `options` instead."),Object(Y.a)(!n||!("size"in e),"AutoComplete","You need to control style self instead of setting `size` when using customize input.")}),[]),l.createElement(v.a,null,(function(n){var o=(0,n.getPrefixCls)("select",i);return l.createElement(K.a,Object(r.a)({ref:t},Object(p.a)(e,["dataSource"]),{prefixCls:o,className:d()("".concat(o,"-auto-complete"),a),mode:K.a.SECRET_COMBOBOX_MODE_DO_NOT_USE,getInputElement:m}),h)}))},$=l.forwardRef(Q);$.Option=Z;var ee=$,te=n(64),ne=n(142),re=n(128),ie=n(143),ae=n(144),oe=n(102),se=n(103),ce=n(190),ue=n(59),le=n(51);var fe=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){var e;return Object(a.a)(this,n),(e=t.apply(this,arguments)).state={error:void 0,info:{componentStack:""}},e}return Object(o.a)(n,[{key:"componentDidCatch",value:function(e,t){this.setState({error:e,info:t})}},{key:"render",value:function(){var e=this.props,t=e.message,n=e.description,r=e.children,i=this.state,a=i.error,o=i.info,s=o&&o.componentStack?o.componentStack:null,c="undefined"===typeof t?(a||"").toString():t,u="undefined"===typeof n?s:n;return a?l.createElement(ve,{type:"error",message:c,description:l.createElement("pre",null,u)}):r}}]),n}(l.Component),he=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i2),"Avatar","`icon` is using ReactNode instead of string naming in v4. Please check `".concat(R,"` at https://ant.design/components/icon"));var U,W=S("avatar",j),G=d()((n={},Object(i.a)(n,"".concat(W,"-lg"),"large"===H),Object(i.a)(n,"".concat(W,"-sm"),"small"===H),n)),K=l.isValidElement(P),X=d()(W,G,(a={},Object(i.a)(a,"".concat(W,"-").concat(T),T),Object(i.a)(a,"".concat(W,"-image"),K||P&&M),Object(i.a)(a,"".concat(W,"-icon"),R),a),z),Z="number"===typeof H?{width:H,height:H,lineHeight:"".concat(H,"px"),fontSize:R?H/2:18}:{};if("string"===typeof P&&M)U=l.createElement("img",{src:P,draggable:I,srcSet:N,onError:function(){var t=e.onError;!1!==(t?t():void 0)&&O(!1)},alt:L});else if(K)U=P;else if(R)U=R;else if(b||1!==f){var J="scale(".concat(f,") translateX(-50%)"),Q={msTransform:J,WebkitTransform:J,transform:J},$="number"===typeof H?{lineHeight:"".concat(H,"px")}:{};U=l.createElement(m.a,{onResize:C},l.createElement("span",{className:"".concat(W,"-string"),ref:function(e){E.current=e},style:Object(r.a)(Object(r.a)({},$),Q)},D))}else U=l.createElement("span",{className:"".concat(W,"-string"),style:{opacity:0},ref:function(e){E.current=e}},D);return delete B.onError,delete B.gap,l.createElement("span",Object(r.a)({},B,{style:Object(r.a)(Object(r.a)(Object(r.a)({},Z),V),B.style),className:X,ref:_}),U)},Ee=l.forwardRef(ke);Ee.displayName="Avatar",Ee.defaultProps={shape:"circle",size:"default"};var _e=Ee,Se=n(65),Ce=function(e){return e?"function"===typeof e?e():e:null},je=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);in)}));l.useEffect((function(){return function(){var t=(e.target||u)();c.current=Object(x.a)(t,"scroll",(function(e){f(e)})),f({target:t})}(),function(){c.current&&c.current.remove(),f.cancel()}}),[e.target]);var h=l.useContext(v.b),m=h.getPrefixCls,g=h.direction,b=e.prefixCls,w=e.className,M=void 0===w?"":w,O=m("back-top",b),k=d()(O,Object(i.a)({},"".concat(O,"-rtl"),"rtl"===g),M),E=Object(p.a)(e,["prefixCls","className","children","visibilityHeight","target","visible"]);return l.createElement("div",Object(r.a)({},E,{className:k,onClick:function(t){var n=e.onClick,r=e.target,i=e.duration,a=void 0===i?450:i;Object(z.a)(0,{getContainer:r||u,duration:a}),"function"===typeof n&&n(t)},ref:s}),function(t){var n=t.prefixCls,r=e.children,i=l.createElement("div",{className:"".concat(n,"-content")},l.createElement("div",{className:"".concat(n,"-icon")},l.createElement(Le.a,null)));return l.createElement(le.b,{visible:a,motionName:"fade",removeOnLeave:!0},(function(e){var t=e.className,n=r||i;return l.createElement("div",null,Object(X.a)(n,(function(e){var n=e.className;return{className:d()(t,n)}})))}))}({prefixCls:O}))};Ie.defaultProps={visibilityHeight:400};var De=l.memo(Ie);function Be(e){var t,n=e.prefixCls,r=e.value,i=e.current,a=e.offset,o=void 0===a?0:a;return o&&(t={position:"absolute",top:"".concat(o,"00%"),left:0}),l.createElement("p",{style:t,className:d()("".concat(n,"-only-unit"),{current:i})},r)}function He(e,t,n){for(var r=e,i=0;(r+10)%10!==t;)r+=n,i+=n;return i}function Fe(e){var t,n,i=e.prefixCls,a=e.count,o=e.value,s=Number(o),c=Math.abs(a),u=l.useState(s),f=Object(q.a)(u,2),h=f[0],d=f[1],p=l.useState(c),m=Object(q.a)(p,2),v=m[0],g=m[1],b=function(){d(s),g(c)};if(l.useEffect((function(){var e=setTimeout((function(){b()}),1e3);return function(){clearTimeout(e)}}),[s]),h===s||Number.isNaN(s)||Number.isNaN(h))t=[l.createElement(Be,Object(r.a)({},e,{key:s,current:!0}))],n={transition:"none"};else{t=[];for(var y=s+10,w=[],x=s;x<=y;x+=1)w.push(x);var M=w.findIndex((function(e){return e%10===h}));t=w.map((function(t,n){var i=t%10;return l.createElement(Be,Object(r.a)({},e,{key:t,value:i,offset:n-M,current:n===M}))})),n={transform:"translateY(".concat(-He(h,s,vb?"".concat(b,"+"):m,z=null!==c&&void 0!==c||null!==h&&void 0!==h,L="0"===R||0===R,I=w&&!L||z,D=I?"":R,B=Object(l.useMemo)((function(){return(null===D||void 0===D||""===D||L&&!C)&&!I}),[D,L,C,I]),H=Object(l.useRef)(m);B||(H.current=m);var F=H.current,V=Object(l.useRef)(D);B||(V.current=D);var U=V.current,W=Object(l.useRef)(I);B||(W.current=I);var q=Object(l.useMemo)((function(){if(!k)return Object(r.a)({},E);var e={marginTop:k[1]};return"rtl"===P?e.left=parseInt(k[0],10):e.right=-parseInt(k[0],10),Object(r.a)(Object(r.a)({},e),E)}),[P,k,E]),G=null!==O&&void 0!==O?O:"string"===typeof F||"number"===typeof F?F:void 0,K=B||!f?null:l.createElement("span",{className:"".concat(N,"-status-text")},f),Y=F&&"object"===Object(u.a)(F)?Object(X.a)(F,(function(e){return{style:Object(r.a)(Object(r.a)({},q),e.style)}})):void 0,Z=d()((t={},Object(i.a)(t,"".concat(N,"-status-dot"),z),Object(i.a)(t,"".concat(N,"-status-").concat(c),!!c),Object(i.a)(t,"".concat(N,"-status-").concat(h),qe(h)),t)),J={};h&&!qe(h)&&(J.background=h);var Q=d()(N,(n={},Object(i.a)(n,"".concat(N,"-status"),z),Object(i.a)(n,"".concat(N,"-not-a-wrapper"),!s),Object(i.a)(n,"".concat(N,"-rtl"),"rtl"===P),n),_);if(!s&&z){var $=q.color;return l.createElement("span",Object(r.a)({},j,{className:Q,style:q}),l.createElement("span",{className:Z,style:J}),l.createElement("span",{style:{color:$},className:"".concat(N,"-status-text")},f))}return l.createElement("span",Object(r.a)({},j,{className:Q}),s,l.createElement(le.b,{visible:!B,motionName:"".concat(N,"-zoom"),motionAppear:!1},(function(e){var t,n=e.className,a=A("scroll-number",o),s=W.current,u=d()((t={},Object(i.a)(t,"".concat(N,"-dot"),s),Object(i.a)(t,"".concat(N,"-count"),!s),Object(i.a)(t,"".concat(N,"-count-sm"),"small"===M),Object(i.a)(t,"".concat(N,"-multiple-words"),!s&&U&&(null===U||void 0===U?void 0:U.toString().length)>1),Object(i.a)(t,"".concat(N,"-status-").concat(c),!!c),Object(i.a)(t,"".concat(N,"-status-").concat(h),qe(h)),t)),f=Object(r.a)({},q);return h&&!qe(h)&&((f=f||{}).background=h),l.createElement(Ue,{prefixCls:a,show:!B,motionClassName:n,className:u,count:U,title:G,style:f,key:"scrollNumber"},Y)})),K)};Ke.Ribbon=function(e){var t,n=e.className,a=e.prefixCls,o=e.style,s=e.color,c=e.children,u=e.text,f=e.placement,h=void 0===f?"end":f,p=l.useContext(v.b),m=p.getPrefixCls,g=p.direction,b=m("ribbon",a),y=qe(s),w=d()(b,"".concat(b,"-placement-").concat(h),(t={},Object(i.a)(t,"".concat(b,"-rtl"),"rtl"===g),Object(i.a)(t,"".concat(b,"-color-").concat(s),y),t),n),x={},M={};return s&&!y&&(x.background=s,M.color=s),l.createElement("div",{className:"".concat(b,"-wrapper")},c,l.createElement("div",{className:w,style:Object(r.a)(Object(r.a)({},x),o)},l.createElement("span",{className:"".concat(b,"-text")},u),l.createElement("div",{className:"".concat(b,"-corner"),style:M})))};var Ye=Ke,Xe=n(85),Ze=n(322),Je=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0){var k=[];t=u.map((function(e){var t,n=at(e.path,b);return n&&k.push(n),e.children&&e.children.length&&(t=l.createElement(nt.a,null,e.children.map((function(e){return l.createElement(nt.a.Item,{key:e.path||e.breadcrumbName},p(e,b,u,function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=Object(g.a)(e),i=at(t,n);return i&&r.push(i),r}(k,e.path,b)))})))),l.createElement($e,{overlay:t,separator:o,key:n||e.breadcrumbName},p(e,b,u,k))}))}else f&&(t=Object(G.a)(f).map((function(e,t){return e?(Object(Y.a)(e.type&&(!0===e.type.__ANT_BREADCRUMB_ITEM||!0===e.type.__ANT_BREADCRUMB_SEPARATOR),"Breadcrumb","Only accepts Breadcrumb.Item and Breadcrumb.Separator as it's children"),Object(X.a)(e,{separator:o,key:t})):e})));var E=d()(O,Object(i.a)({},"".concat(O,"-rtl"),"rtl"===M),c);return l.createElement("div",Object(r.a)({className:E,style:s},y),t)};ot.Item=$e,ot.Separator=tt;var st=ot,ct=n(58),ut=n(158),lt=n.n(ut),ft=n(28),ht={getNow:function(){return lt()()},getFixedDate:function(e){return lt()(e,"YYYY-MM-DD")},getEndDate:function(e){return e.clone().endOf("month")},getWeekDay:function(e){var t=e.clone().locale("en_US");return t.weekday()+t.localeData().firstDayOfWeek()},getYear:function(e){return e.year()},getMonth:function(e){return e.month()},getDate:function(e){return e.date()},getHour:function(e){return e.hour()},getMinute:function(e){return e.minute()},getSecond:function(e){return e.second()},addYear:function(e,t){return e.clone().add(t,"year")},addMonth:function(e,t){return e.clone().add(t,"month")},addDate:function(e,t){return e.clone().add(t,"day")},setYear:function(e,t){return e.clone().year(t)},setMonth:function(e,t){return e.clone().month(t)},setDate:function(e,t){return e.clone().date(t)},setHour:function(e,t){return e.clone().hour(t)},setMinute:function(e,t){return e.clone().minute(t)},setSecond:function(e,t){return e.clone().second(t)},isAfter:function(e,t){return e.isAfter(t)},isValidate:function(e){return e.isValid()},locale:{getWeekFirstDay:function(e){return lt()().locale(e).localeData().firstDayOfWeek()},getWeekFirstDate:function(e,t){return t.clone().locale(e).weekday(0)},getWeek:function(e,t){return t.clone().locale(e).week()},getShortWeekDays:function(e){return lt()().locale(e).localeData().weekdaysMin()},getShortMonths:function(e){return lt()().locale(e).localeData().monthsShort()},format:function(e,t,n){return t.clone().locale(e).format(n)},parse:function(e,t,n){for(var r=[],i=0;i3&&void 0!==arguments[3]?arguments[3]:1;switch(t){case"year":return n.addYear(e,10*r);case"quarter":case"month":return n.addYear(e,r);default:return n.addMonth(e,r)}}function Yt(e,t){var n=t.generateConfig,r=t.locale,i=t.format;return"function"===typeof i?i(e):n.locale.format(r.locale,e,i)}function Xt(e,t){var n=t.generateConfig,r=t.locale,i=t.formatList;return e&&"function"!==typeof i[0]?n.locale.parse(r.locale,e,i):null}function Zt(e){var t=e.cellDate,n=e.mode,r=e.disabledDate,i=e.generateConfig;if(!r)return!1;var a=function(e,n,a){for(var o=n;o<=a;){var s=void 0;switch(e){case"date":if(s=i.setDate(t,o),!r(s))return!1;break;case"month":if(!Zt({cellDate:s=i.setMonth(t,o),mode:"month",generateConfig:i,disabledDate:r}))return!1;break;case"year":if(!Zt({cellDate:s=i.setYear(t,o),mode:"year",generateConfig:i,disabledDate:r}))return!1}o+=1}return!0};switch(n){case"date":case"week":return r(t);case"month":return a("date",1,i.getDate(i.getEndDate(t)));case"quarter":var o=3*Math.floor(i.getMonth(t)/3);return a("month",o,o+2);case"year":return a("month",0,11);case"decade":var s=i.getYear(t),c=Math.floor(s/zt)*zt;return a("year",c,c+zt-1)}}var Jt=function(e){if(l.useContext(gt).hideHeader)return null;var t=e.prefixCls,n=e.generateConfig,r=e.locale,i=e.value,a=e.format,o="".concat(t,"-header");return l.createElement(yt,{prefixCls:o},i?Yt(i,{locale:r,format:a,generateConfig:n}):"\xa0")},Qt=n(104);var $t=function(e){var t=e.prefixCls,n=e.units,r=e.onSelect,a=e.value,o=e.active,s=e.hideDisabledOptions,c="".concat(t,"-cell"),u=l.useContext(gt).open,f=Object(l.useRef)(null),h=Object(l.useRef)(new Map),p=Object(l.useRef)();return Object(l.useLayoutEffect)((function(){var e=h.current.get(a);e&&!1!==u&&St(f.current,e.offsetTop,120)}),[a]),Object(l.useLayoutEffect)((function(){if(u){var e=h.current.get(a);e&&(p.current=function(e,t){var n;return function r(){Object(Et.a)(e)?t():n=Object(b.a)((function(){r()}))}(),function(){b.a.cancel(n)}}(e,(function(){St(f.current,e.offsetTop,0)})))}return function(){var e;null===(e=p.current)||void 0===e||e.call(p)}}),[u]),l.createElement("ul",{className:d()("".concat(t,"-column"),Object(i.a)({},"".concat(t,"-column-active"),o)),ref:f,style:{position:"relative"}},n.map((function(e){var t;return s&&e.disabled?null:l.createElement("li",{key:e.value,ref:function(t){h.current.set(e.value,t)},className:d()(c,(t={},Object(i.a)(t,"".concat(c,"-disabled"),e.disabled),Object(i.a)(t,"".concat(c,"-selected"),a===e.value),t)),onClick:function(){e.disabled||r(e.value)}},l.createElement("div",{className:"".concat(c,"-inner")},e.label))})))};function en(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0",r=String(e);r.length=12,S%=12);var N=l.useMemo((function(){if(!f)return[!1,!1];var e=[!0,!0];return P.forEach((function(t){var n=t.disabled,r=t.value;n||(r>=12?e[1]=!1:e[0]=!1)})),e}),[f,P]),R=Object(q.a)(N,2),z=R[0],L=R[1],I=l.useMemo((function(){return f?P.filter(t?function(e){return e.value>=12}:function(e){return e.value<12}).map((function(e){var t=e.value%12,n=0===t?"12":en(t,2);return Object(mt.a)(Object(mt.a)({},e),{},{label:n,value:t})})):P}),[f,t,P]),D=sn(0,59,m,y&&y(_)),B=sn(0,59,g,w&&w(_,C));function H(e,t,n,r,i){!1!==e&&O.push({node:l.cloneElement(t,{prefixCls:E,value:n,active:a===O.length,onSelect:i,units:r,hideDisabledOptions:x}),onSelect:i,value:n,units:r})}i.current={onUpDown:function(e){var t=O[a];if(t)for(var n=t.units.findIndex((function(e){return e.value===t.value})),r=t.units.length,i=1;i1&&(o=t.addDate(o,-7)),o}(a.locale,n,s),m="".concat(t,"-cell"),v=n.locale.getWeekFirstDay(a.locale),g=n.getNow(),b=[],y=a.shortWeekDays||(n.locale.getShortWeekDays?n.locale.getShortWeekDays(a.locale):[]);i&&b.push(l.createElement("th",{key:"empty","aria-label":"empty cell"}));for(var w=0;w<7;w+=1)b.push(l.createElement("th",{key:w},y[(w+v)%7]));var x=fn({cellPrefixCls:m,today:g,value:c,generateConfig:n,rangedValue:i?null:h,hoverRangedValue:i?null:d,isSameCell:function(e,t){return Ut(n,e,t)},isInView:function(e){return Vt(n,e,s)},offsetCell:function(e,t){return n.addDate(e,t)}}),M=u?function(e){return u(e,g)}:void 0;return l.createElement(Ot,Object(r.a)({},e,{rowNum:o,colNum:7,baseDate:p,getCellNode:M,getCellText:n.getDate,getCellClassName:x,getCellDate:n.addDate,titleCell:function(e){return Yt(e,{locale:a,format:"YYYY-MM-DD",generateConfig:n})},headerCells:b}))};var dn=function(e){var t=e.prefixCls,n=e.generateConfig,i=e.locale,a=e.viewDate,o=e.onNextMonth,s=e.onPrevMonth,c=e.onNextYear,u=e.onPrevYear,f=e.onYearClick,h=e.onMonthClick;if(l.useContext(gt).hideHeader)return null;var d="".concat(t,"-header"),p=i.shortMonths||(n.locale.getShortMonths?n.locale.getShortMonths(i.locale):[]),m=n.getMonth(a),v=l.createElement("button",{type:"button",key:"year",onClick:f,tabIndex:-1,className:"".concat(t,"-year-btn")},Yt(a,{locale:i,format:i.yearFormat,generateConfig:n})),g=l.createElement("button",{type:"button",key:"month",onClick:h,tabIndex:-1,className:"".concat(t,"-month-btn")},i.monthFormat?Yt(a,{locale:i,format:i.monthFormat,generateConfig:n}):p[m]),b=i.monthBeforeYear?[g,v]:[v,g];return l.createElement(yt,Object(r.a)({},e,{prefixCls:d,onSuperPrev:u,onPrev:s,onNext:o,onSuperNext:c}),b)};var pn=function(e){var t=e.prefixCls,n=e.panelName,a=void 0===n?"date":n,o=e.keyboardConfig,s=e.active,c=e.operationRef,u=e.generateConfig,f=e.value,h=e.viewDate,p=e.onViewDateChange,m=e.onPanelChange,v=e.onSelect,g="".concat(t,"-").concat(a,"-panel");c.current={onKeyDown:function(e){return Ct(e,Object(mt.a)({onLeftRight:function(e){v(u.addDate(f||h,e),"key")},onCtrlLeftRight:function(e){v(u.addYear(f||h,e),"key")},onUpDown:function(e){v(u.addDate(f||h,7*e),"key")},onPageUpDown:function(e){v(u.addMonth(f||h,e),"key")}},o))}};var b=function(e){var t=u.addYear(h,e);p(t),m(null,t)},y=function(e){var t=u.addMonth(h,e);p(t),m(null,t)};return l.createElement("div",{className:d()(g,Object(i.a)({},"".concat(g,"-active"),s))},l.createElement(dn,Object(r.a)({},e,{prefixCls:t,value:f,viewDate:h,onPrevYear:function(){b(-1)},onNextYear:function(){b(1)},onPrevMonth:function(){y(-1)},onNextMonth:function(){y(1)},onMonthClick:function(){m("month",h)},onYearClick:function(){m("year",h)}})),l.createElement(hn,Object(r.a)({},e,{onSelect:function(e){return v(e,"mouse")},prefixCls:t,value:f,viewDate:h,rowCount:6})))};var mn=function(){for(var e=arguments.length,t=new Array(e),n=0;n2&&void 0!==arguments[2]&&arguments[2];(be===w||n)&&(ue(e),C&&C(e),Z&&Z(e,t),!j||qt(f,e,ce)||(null===g||void 0===g?void 0:g(e))||j(e))},_e=function(e){return ie.current&&ie.current.onKeyDown?([vt.a.LEFT,vt.a.RIGHT,vt.a.UP,vt.a.DOWN,vt.a.PAGE_UP,vt.a.PAGE_DOWN,vt.a.ENTER].includes(e.which)&&e.preventDefault(),ie.current.onKeyDown(e)):(Object(ft.a)(!1,"Panel not correct handle keyDown event. Please help to fire issue about this."),!1)};Y&&"right"!==te&&(Y.current={onKeyDown:_e,onClose:function(){ie.current&&ie.current.onClose&&ie.current.onClose()}}),l.useEffect((function(){h&&!ae.current&&de(h)}),[h]),l.useEffect((function(){ae.current=!1}),[]);var Se,Ce,je,Te=Object(mt.a)(Object(mt.a)({},e),{},{operationRef:ie,prefixCls:a,viewDate:he,value:ce,onViewDateChange:pe,sourceMode:Oe,onPanelChange:function(e,t){var n=me(e||be);ke(be),ye(n),T&&(be!==n||qt(f,he,he))&&T(t,n)},disabledDate:g});switch(delete Te.onChange,delete Te.onSelect,be){case"decade":we=l.createElement(It,Object(r.a)({},Te,{onSelect:function(e,t){pe(e),Ee(e,t)}}));break;case"year":we=l.createElement(Sn,Object(r.a)({},Te,{onSelect:function(e,t){pe(e),Ee(e,t)}}));break;case"month":we=l.createElement(wn,Object(r.a)({},Te,{onSelect:function(e,t){pe(e),Ee(e,t)}}));break;case"quarter":we=l.createElement(On,Object(r.a)({},Te,{onSelect:function(e,t){pe(e),Ee(e,t)}}));break;case"week":we=l.createElement(gn,Object(r.a)({},Te,{onSelect:function(e,t){pe(e),Ee(e,t)}}));break;case"time":delete Te.showTime,we=l.createElement(un,Object(r.a)({},Te,"object"===Object(u.a)(k)?k:null,{onSelect:function(e,t){pe(e),Ee(e,t)}}));break;default:we=k?l.createElement(vn,Object(r.a)({},Te,{onSelect:function(e,t){pe(e),Ee(e,t)}})):l.createElement(pn,Object(r.a)({},Te,{onSelect:function(e,t){pe(e),Ee(e,t)}}))}if(J||(Se=Cn(a,be,_),Ce=jn({prefixCls:a,components:R,needConfirmButton:V,okDisabled:!ce||g&&g(ce),locale:c,showNow:O,onNow:V&&function(){var e=f.getNow(),t=function(e,t,n,r,i,a){var o=Math.floor(e/r)*r;if(o1&&void 0!==arguments[1]&&arguments[1];cancelAnimationFrame(u.current),t?c(e):u.current=requestAnimationFrame((function(){c(e)}))}var h=Dn(s,{formatList:n,generateConfig:r,locale:i}),d=Object(q.a)(h,2)[1];function p(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];f(null,e)}return Object(l.useEffect)((function(){p(!0)}),[e]),Object(l.useEffect)((function(){return function(){return cancelAnimationFrame(u.current)}}),[]),[d,function(e){f(e)},p]}function Hn(e){var t,n=e.prefixCls,a=void 0===n?"rc-picker":n,o=e.id,s=e.tabIndex,c=e.style,u=e.className,f=e.dropdownClassName,h=e.dropdownAlign,p=e.popupStyle,m=e.transitionName,v=e.generateConfig,g=e.locale,b=e.inputReadOnly,y=e.allowClear,w=e.autoFocus,x=e.showTime,M=e.picker,O=void 0===M?"date":M,k=e.format,E=e.use12Hours,_=e.value,S=e.defaultValue,C=e.open,j=e.defaultOpen,T=e.defaultOpenValue,A=e.suffixIcon,P=e.clearIcon,N=e.disabled,R=e.disabledDate,z=e.placeholder,L=e.getPopupContainer,I=e.pickerRef,D=e.panelRender,B=e.onChange,H=e.onOpenChange,F=e.onFocus,V=e.onBlur,U=e.onMouseDown,W=e.onMouseUp,G=e.onMouseEnter,K=e.onMouseLeave,Y=e.onContextMenu,X=e.onClick,Z=e.onKeyDown,J=e.onSelect,Q=e.direction,$=e.autoComplete,ee=void 0===$?"off":$,te=l.useRef(null),ne="date"===O&&!!x||"time"===O,re=tn(jt(k,O,x,E)),ie=l.useRef(null),ae=l.useRef(null),oe=Object(ze.a)(null,{value:_,defaultValue:S}),se=Object(q.a)(oe,2),ce=se[0],ue=se[1],le=l.useState(ce),fe=Object(q.a)(le,2),he=fe[0],de=fe[1],pe=l.useRef(null),me=Object(ze.a)(!1,{value:C,defaultValue:j,postState:function(e){return!N&&e},onChange:function(e){H&&H(e),!e&&pe.current&&pe.current.onClose&&pe.current.onClose()}}),ve=Object(q.a)(me,2),ge=ve[0],be=ve[1],ye=Dn(he,{formatList:re,generateConfig:v,locale:g}),we=Object(q.a)(ye,2),xe=we[0],Me=we[1],Oe=zn({valueTexts:xe,onTextChange:function(e){var t=Xt(e,{locale:g,formatList:re,generateConfig:v});!t||R&&R(t)||de(t)}}),ke=Object(q.a)(Oe,3),Ee=ke[0],_e=ke[1],Se=ke[2],Ce=function(e){de(e),ue(e),B&&!qt(v,ce,e)&&B(e,e?Yt(e,{generateConfig:v,locale:g,format:re[0]}):"")},je=function(e){N&&e||be(e)},Te=Rn({blurToCancel:ne,open:ge,value:Ee,triggerOpen:je,forwardKeyDown:function(e){return ge&&pe.current&&pe.current.onKeyDown?pe.current.onKeyDown(e):(Object(ft.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},isClickOutside:function(e){return!Rt([ie.current,ae.current],e)},onSubmit:function(){return(!R||!R(he))&&(Ce(he),je(!1),Se(),!0)},onCancel:function(){je(!1),de(ce),Se()},onKeyDown:function(e,t){null===Z||void 0===Z||Z(e,t)},onFocus:F,onBlur:V}),Ae=Object(q.a)(Te,2),Pe=Ae[0],Ne=Ae[1],Re=Ne.focused,Le=Ne.typing;l.useEffect((function(){ge||(de(ce),xe.length&&""!==xe[0]?Me!==Ee&&Se():_e(""))}),[ge,xe]),l.useEffect((function(){ge||Se()}),[O]),l.useEffect((function(){de(ce)}),[ce]),I&&(I.current={focus:function(){te.current&&te.current.focus()},blur:function(){te.current&&te.current.blur()}});var Ie=Bn(Ee,{formatList:re,generateConfig:v,locale:g}),De=Object(q.a)(Ie,3),Be=De[0],He=De[1],Fe=De[2],Ve=Object(mt.a)(Object(mt.a)({},e),{},{className:void 0,style:void 0,pickerValue:void 0,onPickerValueChange:void 0,onChange:null}),Ue=l.createElement(Tn,Object(r.a)({},Ve,{generateConfig:v,className:d()(Object(i.a)({},"".concat(a,"-panel-focused"),!Le)),value:he,locale:g,tabIndex:-1,onSelect:function(e){null===J||void 0===J||J(e),de(e)},direction:Q,onPanelChange:function(t,n){var r=e.onPanelChange;Fe(!0),null===r||void 0===r||r(t,n)}}));D&&(Ue=D(Ue));var We,qe,Ge=l.createElement("div",{className:"".concat(a,"-panel-container"),onMouseDown:function(e){e.preventDefault()}},Ue);A&&(We=l.createElement("span",{className:"".concat(a,"-suffix")},A)),y&&ce&&!N&&(qe=l.createElement("span",{onMouseDown:function(e){e.preventDefault(),e.stopPropagation()},onMouseUp:function(e){e.preventDefault(),e.stopPropagation(),Ce(null),je(!1)},className:"".concat(a,"-clear")},P||l.createElement("span",{className:"".concat(a,"-clear-btn")})));var Ke="rtl"===Q?"bottomRight":"bottomLeft";return l.createElement(gt.Provider,{value:{operationRef:pe,hideHeader:"time"===O,panelRef:ie,onSelect:function(e,t){("submit"===t||"key"!==t&&!ne)&&(Ce(e),je(!1))},open:ge,defaultOpenValue:T,onDateMouseEnter:He,onDateMouseLeave:Fe}},l.createElement(Nn,{visible:ge,popupElement:Ge,popupStyle:p,prefixCls:a,dropdownClassName:f,dropdownAlign:h,getPopupContainer:L,transitionName:m,popupPlacement:Ke,direction:Q},l.createElement("div",{className:d()(a,u,(t={},Object(i.a)(t,"".concat(a,"-disabled"),N),Object(i.a)(t,"".concat(a,"-focused"),Re),Object(i.a)(t,"".concat(a,"-rtl"),"rtl"===Q),t)),style:c,onMouseDown:U,onMouseUp:function(){W&&W.apply(void 0,arguments),te.current&&(te.current.focus(),je(!0))},onMouseEnter:G,onMouseLeave:K,onContextMenu:Y,onClick:X},l.createElement("div",{className:d()("".concat(a,"-input"),Object(i.a)({},"".concat(a,"-input-placeholder"),!!Be)),ref:ae},l.createElement("input",Object(r.a)({id:o,tabIndex:s,disabled:N,readOnly:b||"function"===typeof re[0]||!Le,value:Be||Ee,onChange:function(e){_e(e.target.value)},autoFocus:w,placeholder:z,ref:te,title:Ee},Pe,{size:Tt(O,re[0],v)},nn(e),{autoComplete:ee})),We,qe))))}var Fn=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){var e;return Object(a.a)(this,n),(e=t.apply(this,arguments)).pickerRef=l.createRef(),e.focus=function(){e.pickerRef.current&&e.pickerRef.current.focus()},e.blur=function(){e.pickerRef.current&&e.pickerRef.current.blur()},e}return Object(o.a)(n,[{key:"render",value:function(){return l.createElement(Hn,Object(r.a)({},this.props,{pickerRef:this.pickerRef}))}}]),n}(l.Component);function Vn(e,t,n,r){var i=Kt(e,n,r,1);function a(n){return n(e,t)?"same":n(i,t)?"closing":"far"}switch(n){case"year":return a((function(e,t){return function(e,t,n){var r=Dt(t,n);return"boolean"===typeof r?r:Math.floor(e.getYear(t)/10)===Math.floor(e.getYear(n)/10)}(r,e,t)}));case"quarter":case"month":return a((function(e,t){return Bt(r,e,t)}));default:return a((function(e,t){return Vt(r,e,t)}))}}function Un(e){var t=e.values,n=e.picker,r=e.defaultDates,i=e.generateConfig,a=l.useState((function(){return[rn(r,0),rn(r,1)]})),o=Object(q.a)(a,2),s=o[0],c=o[1],u=l.useState(null),f=Object(q.a)(u,2),h=f[0],d=f[1],p=rn(t,0),m=rn(t,1);return[function(e){return s[e]?s[e]:rn(h,e)||function(e,t,n,r){var i=rn(e,0),a=rn(e,1);if(0===t)return i;if(i&&a)switch(Vn(i,a,n,r)){case"same":case"closing":return i;default:return Kt(a,n,r,-1)}return i}(t,e,n,i)||p||m||i.getNow()},function(e,n){if(e){var r=an(h,e,n);c(an(s,null,n)||[null,null]);var i=(n+1)%2;rn(t,i)||(r=an(r,e,i)),d(r)}else(p||m)&&d(null)}]}function Wn(e,t){return e&&e[0]&&e[1]&&t.isAfter(e[0],e[1])?[e[1],e[0]]:e}function qn(e,t,n,r){return!!e||(!(!r||!r[t])||!!n[(t+1)%2])}function Gn(e){var t,n,a,o=e.prefixCls,s=void 0===o?"rc-picker":o,c=e.id,f=e.style,h=e.className,p=e.popupStyle,m=e.dropdownClassName,v=e.transitionName,g=e.dropdownAlign,b=e.getPopupContainer,y=e.generateConfig,w=e.locale,x=e.placeholder,M=e.autoFocus,O=e.disabled,k=e.format,E=e.picker,_=void 0===E?"date":E,S=e.showTime,C=e.use12Hours,j=e.separator,T=void 0===j?"~":j,A=e.value,P=e.defaultValue,N=e.defaultPickerValue,R=e.open,z=e.defaultOpen,L=e.disabledDate,I=e.disabledTime,D=e.dateRender,B=e.panelRender,H=e.ranges,F=e.allowEmpty,V=e.allowClear,U=e.suffixIcon,W=e.clearIcon,G=e.pickerRef,K=e.inputReadOnly,Y=e.mode,X=e.renderExtraFooter,Z=e.onChange,J=e.onOpenChange,Q=e.onPanelChange,$=e.onCalendarChange,ee=e.onFocus,te=e.onBlur,ne=e.onOk,re=e.onKeyDown,ie=e.components,ae=e.order,oe=e.direction,se=e.activePickerIndex,ce=e.autoComplete,ue=void 0===ce?"off":ce,le="date"===_&&!!S||"time"===_,fe=Object(l.useRef)({}),he=Object(l.useRef)(null),de=Object(l.useRef)(null),pe=Object(l.useRef)(null),me=Object(l.useRef)(null),ve=Object(l.useRef)(null),ge=Object(l.useRef)(null),be=Object(l.useRef)(null),ye=tn(jt(k,_,S,C)),we=Object(ze.a)(0,{value:se}),xe=Object(q.a)(we,2),Me=xe[0],Oe=xe[1],ke=Object(l.useRef)(null),Ee=l.useMemo((function(){return Array.isArray(O)?O:[O||!1,O||!1]}),[O]),_e=Object(ze.a)(null,{value:A,defaultValue:P,postState:function(e){return"time"!==_||ae?Wn(e,y):e}}),Se=Object(q.a)(_e,2),Ce=Se[0],je=Se[1],Te=Un({values:Ce,picker:_,defaultDates:N,generateConfig:y}),Ae=Object(q.a)(Te,2),Pe=Ae[0],Ne=Ae[1],Re=Object(ze.a)(Ce,{postState:function(e){var t=e;if(Ee[0]&&Ee[1])return t;for(var n=0;n<2;n+=1)!Ee[n]||rn(t,n)||rn(F,n)||(t=an(t,y.getNow(),n));return t}}),Le=Object(q.a)(Re,2),Ie=Le[0],De=Le[1],Be=Object(ze.a)([_,_],{value:Y}),He=Object(q.a)(Be,2),Fe=He[0],Ve=He[1];Object(l.useEffect)((function(){Ve([_,_])}),[_]);var Ue=function(e,t){Ve(e),Q&&Q(t,e)},We=function(e,t,n){var r=e.picker,i=e.locale,a=e.selectedValue,o=e.disabledDate,s=e.disabled,c=e.generateConfig,u=rn(a,0),f=rn(a,1);function h(e){return c.locale.getWeekFirstDate(i.locale,e)}function d(e){return 100*c.getYear(e)+c.getMonth(e)}function p(e){return 10*c.getYear(e)+Ht(c,e)}return[l.useCallback((function(e){if(o&&o(e))return!0;if(s[1]&&f)return!Ut(c,e,f)&&c.isAfter(e,f);if(t&&f)switch(r){case"quarter":return p(e)>p(f);case"month":return d(e)>d(f);case"week":return h(e)>h(f);default:return!Ut(c,e,f)&&c.isAfter(e,f)}return!1}),[o,s[1],f,t]),l.useCallback((function(e){if(o&&o(e))return!0;if(s[0]&&u)return!Ut(c,e,f)&&c.isAfter(u,e);if(n&&u)switch(r){case"quarter":return p(e)0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=null;Ze&&Gt&&Gt[0]&&Gt[1]&&y.isAfter(Gt[1],Gt[0])&&(a=Gt);var o=S;if(S&&"object"===Object(u.a)(S)&&S.defaultValue){var c=S.defaultValue;o=Object(mt.a)(Object(mt.a)({},S),{},{defaultValue:rn(c,Me)||void 0})}var f=null;return D&&(f=function(e,t){return D(e,t,{range:Me?"end":"start"})}),l.createElement(ln.Provider,{value:{inRange:!0,panelPosition:t,rangedValue:It||Ie,hoverRangedValue:a}},l.createElement(Tn,Object(r.a)({},e,n,{dateRender:f,showTime:o,mode:Fe[Me],generateConfig:y,style:void 0,direction:oe,disabledDate:0===Me?Ge:Ke,disabledTime:function(e){return!!I&&I(e,0===Me?"start":"end")},className:d()(Object(i.a)({},"".concat(s,"-panel-focused"),0===Me?!yn:!En)),value:rn(Ie,Me),locale:w,tabIndex:-1,onPanelChange:function(e,n){0===Me&&on(!0),1===Me&&hn(!0),Ue(an(Fe,n,Me),an(Ie,e,Me));var r=e;"right"===t&&Fe[Me]===n&&(r=Kt(r,n,y,-1)),Ne(r,Me)},onOk:null,onSelect:void 0,onChange:void 0,defaultValue:rn(Ie,0===Me?1:0),defaultPickerValue:void 0})))}var Ln=0,In=0;Me&&pe.current&&ve.current&&de.current&&(Ln=pe.current.offsetWidth+ve.current.offsetWidth,de.current.offsetWidth&&Ln>de.current.offsetWidth&&(In=Ln));var Hn="rtl"===oe?{right:Ln}:{left:Ln};var Fn,Vn,Gn=l.createElement("div",{className:d()("".concat(s,"-range-wrapper"),"".concat(s,"-").concat(_,"-range-wrapper")),style:{minWidth:nt}},l.createElement("div",{className:"".concat(s,"-range-arrow"),style:Hn}),function(){var e,t=Cn(s,Fe[Me],X),n=jn({prefixCls:s,components:ie,needConfirmButton:le,okDisabled:!rn(Ie,Me)||L&&L(Ie[Me]),locale:w,rangeList:An,onOk:function(){rn(Ie,Me)&&(st(Ie,Me),ne&&ne(Ie))}});if("time"===_||S)e=Pn();else{var r=Pe(Me),i=Kt(r,_,y),a=Fe[Me]===_,o=Pn(!!a&&"left",{pickerValue:r,onPickerValueChange:function(e){Ne(e,Me)}}),c=Pn("right",{pickerValue:i,onPickerValueChange:function(e){Ne(Kt(e,_,y,-1),Me)}});e="rtl"===oe?l.createElement(l.Fragment,null,c,a&&o):l.createElement(l.Fragment,null,o,a&&c)}var u=l.createElement(l.Fragment,null,l.createElement("div",{className:"".concat(s,"-panels")},e),(t||n)&&l.createElement("div",{className:"".concat(s,"-footer")},t,n));return B&&(u=B(u)),l.createElement("div",{className:"".concat(s,"-panel-container"),style:{marginLeft:In},ref:de,onMouseDown:function(e){e.preventDefault()}},u)}());U&&(Fn=l.createElement("span",{className:"".concat(s,"-suffix")},U)),V&&(rn(Ce,0)&&!Ee[0]||rn(Ce,1)&&!Ee[1])&&(Vn=l.createElement("span",{onMouseDown:function(e){e.preventDefault(),e.stopPropagation()},onMouseUp:function(e){e.preventDefault(),e.stopPropagation();var t=Ce;Ee[0]||(t=an(t,null,0)),Ee[1]||(t=an(t,null,1)),st(t,null),at(!1,Me)},className:"".concat(s,"-clear")},W||l.createElement("span",{className:"".concat(s,"-clear-btn")})));var Kn={size:Tt(_,ye[0],y)},Yn=0,Xn=0;pe.current&&me.current&&ve.current&&(0===Me?Xn=pe.current.offsetWidth:(Yn=Ln,Xn=me.current.offsetWidth));var Zn="rtl"===oe?{right:Yn}:{left:Yn};return l.createElement(gt.Provider,{value:{operationRef:ke,hideHeader:"time"===_,onDateMouseEnter:function(e){Zt(an(Ie,e,Me)),0===Me?en(e):fn(e)},onDateMouseLeave:function(){Zt(an(Ie,null,Me)),0===Me?on():hn()},hideRanges:!0,onSelect:function(e,t){var n=an(Ie,e,Me);"submit"===t||"key"!==t&&!le?(st(n,Me),0===Me?on():hn()):De(n)},open:Ze}},l.createElement(Nn,{visible:Ze,popupElement:Gn,popupStyle:p,prefixCls:s,dropdownClassName:m,dropdownAlign:g,getPopupContainer:b,transitionName:v,range:!0,direction:oe},l.createElement("div",Object(r.a)({ref:he,className:d()(s,"".concat(s,"-range"),h,(t={},Object(i.a)(t,"".concat(s,"-disabled"),Ee[0]&&Ee[1]),Object(i.a)(t,"".concat(s,"-focused"),0===Me?bn:kn),Object(i.a)(t,"".concat(s,"-rtl"),"rtl"===oe),t)),style:f,onClick:function(e){Ze||ge.current.contains(e.target)||be.current.contains(e.target)||(Ee[0]?Ee[1]||ot(1):ot(0))},onMouseDown:function(e){!Ze||!bn&&!kn||ge.current.contains(e.target)||be.current.contains(e.target)||e.preventDefault()}},nn(e)),l.createElement("div",{className:d()("".concat(s,"-input"),(n={},Object(i.a)(n,"".concat(s,"-input-active"),0===Me),Object(i.a)(n,"".concat(s,"-input-placeholder"),!!$t),n)),ref:pe},l.createElement("input",Object(r.a)({id:c,disabled:Ee[0],readOnly:K||"function"===typeof ye[0]||!yn,value:$t||kt,onChange:function(e){Et(e.target.value)},autoFocus:M,placeholder:rn(x,0)||"",ref:ge},vn,Kn,{autoComplete:ue}))),l.createElement("div",{className:"".concat(s,"-range-separator"),ref:ve},T),l.createElement("div",{className:d()("".concat(s,"-input"),(a={},Object(i.a)(a,"".concat(s,"-input-active"),1===Me),Object(i.a)(a,"".concat(s,"-input-placeholder"),!!un),a)),ref:me},l.createElement("input",Object(r.a)({disabled:Ee[1],readOnly:K||"function"===typeof ye[0]||!En,value:un||At,onChange:function(e){Pt(e.target.value)},placeholder:rn(x,1)||"",ref:be},Mn,Kn,{autoComplete:ue}))),l.createElement("div",{className:"".concat(s,"-active-bar"),style:Object(mt.a)(Object(mt.a)({},Zn),{},{width:Xn,position:"absolute"})}),Fn,Vn)))}var Kn=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){var e;return Object(a.a)(this,n),(e=t.apply(this,arguments)).pickerRef=l.createRef(),e.focus=function(){e.pickerRef.current&&e.pickerRef.current.focus()},e.blur=function(){e.pickerRef.current&&e.pickerRef.current.blur()},e}return Object(o.a)(n,[{key:"render",value:function(){return l.createElement(Gn,Object(r.a)({},this.props,{pickerRef:this.pickerRef}))}}]),n}(l.Component),Yn=Fn,Xn=n(53),Zn=n(300),Jn=n(356),Qn=n(357);function $n(e){var t=e.fullscreen,n=e.validRange,r=e.generateConfig,i=e.locale,a=e.prefixCls,o=e.value,s=e.onChange,c=e.divRef,u=r.getYear(o),f=u-10,h=f+20;n&&(f=r.getYear(n[0]),h=r.getYear(n[1])+1);for(var d=i&&"\u5e74"===i.year?"\u5e74":"",p=[],m=f;mr.getMonth(c)&&(t=r.setMonth(t,r.getMonth(c))),u===r.getYear(a)&&l-1?t.splice(n,1):t.push(e)}r.setActiveKey(t)},r.getNewChild=function(e,t){if(!e)return null;var n=r.state.activeKey,i=r.props,a=i.prefixCls,o=i.openMotion,s=i.accordion,c=i.destroyInactivePanel,u=i.expandIcon,f=i.collapsible,h=e.key||String(t),d=e.props,p=d.header,m=d.headerClass,v=d.destroyInactivePanel,g=d.collapsible,b=null!==g&&void 0!==g?g:f,y={key:h,panelKey:h,header:p,headerClass:m,isActive:s?n[0]===h:n.indexOf(h)>-1,prefixCls:a,destroyInactivePanel:null!==v&&void 0!==v?v:c,openMotion:o,accordion:s,children:e.props.children,onItemClick:"disabled"===b?null:r.onClickItem,expandIcon:u,collapsible:b};return"string"===typeof e.type?e:l.cloneElement(e,y)},r.getItems=function(){var e=r.props.children;return Object(G.a)(e).map(r.getNewChild)},r.setActiveKey=function(e){"activeKey"in r.props||r.setState({activeKey:e}),r.props.onChange(r.props.accordion?e[0]:e)};var i=e.activeKey,o=e.defaultActiveKey;return"activeKey"in e&&(o=i),r.state={activeKey:ur(o)},r}return Object(o.a)(n,[{key:"shouldComponentUpdate",value:function(e,t){return!In()(this.props,e)||!In()(this.state,t)}},{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,r=t.className,a=t.style,o=t.accordion,s=d()((e={},Object(i.a)(e,n,!0),Object(i.a)(e,r,!!r),e));return l.createElement("div",{className:s,style:a,role:o?"tablist":null},this.getItems())}}],[{key:"getDerivedStateFromProps",value:function(e){var t={};return"activeKey"in e&&(t.activeKey=ur(e.activeKey)),t}}]),n}(l.Component);lr.defaultProps={prefixCls:"rc-collapse",onChange:function(){},accordion:!1,destroyInactivePanel:!1},lr.Panel=cr;var fr=lr,hr=(lr.Panel,n(74)),dr=function(e){Object(Y.a)(!("disabled"in e),"Collapse.Panel",'`disabled` is deprecated. Please use `collapsible="disabled"` instead.');var t=l.useContext(v.b).getPrefixCls,n=e.prefixCls,a=e.className,o=void 0===a?"":a,s=e.showArrow,c=void 0===s||s,u=t("collapse",n),f=d()(Object(i.a)({},"".concat(u,"-no-arrow"),!c),o);return l.createElement(fr.Panel,Object(r.a)({},e,{prefixCls:u,className:f}))},pr=n(150),mr=function(e){var t,n=l.useContext(v.b),a=n.getPrefixCls,o=n.direction,s=e.prefixCls,c=e.className,u=void 0===c?"":c,f=e.bordered,h=void 0===f||f,m=e.ghost,g=a("collapse",s),b=function(){var t=e.expandIconPosition;return void 0!==t?t:"rtl"===o?"right":"left"}(),y=d()((t={},Object(i.a)(t,"".concat(g,"-borderless"),!h),Object(i.a)(t,"".concat(g,"-icon-position-").concat(b),!0),Object(i.a)(t,"".concat(g,"-rtl"),"rtl"===o),Object(i.a)(t,"".concat(g,"-ghost"),!!m),t),u),w=Object(r.a)(Object(r.a)({},pr.a),{motionAppear:!1,leavedClassName:"".concat(g,"-content-hidden")});return l.createElement(fr,Object(r.a)({openMotion:w},e,{bordered:h,expandIcon:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.expandIcon,r=n?n(t):l.createElement(hr.a,{rotate:t.isActive?90:void 0});return Object(X.a)(r,(function(){return{className:d()(r.props.className,"".concat(g,"-arrow"))}}))},prefixCls:g,className:y}),function(){var t=e.children;return Object(G.a)(t).map((function(e,t){var n;if(null===(n=e.props)||void 0===n?void 0:n.disabled){var i=e.key||String(t),a=e.props,o=a.disabled,s=a.collapsible,c=Object(r.a)(Object(r.a)({},Object(p.a)(e.props,["disabled"])),{key:i,collapsible:null!==s&&void 0!==s?s:o?"disabled":void 0});return Object(X.a)(e,c)}return e}))}())};mr.Panel=dr;var vr=mr,gr=n(151),br=n.n(gr),yr=n(25),wr={animating:!1,autoplaying:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,dragging:!1,edgeDragged:!1,initialized:!1,lazyLoadedList:[],listHeight:null,listWidth:null,scrolling:!1,slideCount:null,slideHeight:null,slideWidth:null,swipeLeft:null,swiped:!1,swiping:!1,touchObject:{startX:0,startY:0,curX:0,curY:0},trackStyle:{},trackWidth:0,targetSlide:0};function xr(e,t,n){return Math.max(t,Math.min(e,n))}var Mr=function(e){for(var t=[],n=Or(e),r=kr(e),i=n;i0?1:0):0},_r=function(e){return e.centerMode?Math.floor((e.slidesToShow-1)/2)+1+(parseInt(e.centerPadding)>0?1:0):e.slidesToShow},Sr=function(e){return e&&e.offsetWidth||0},Cr=function(e){return e&&e.offsetHeight||0},jr=function(e){var t,n,r,i,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=e.startX-e.curX,n=e.startY-e.curY,r=Math.atan2(n,t),(i=Math.round(180*r/Math.PI))<0&&(i=360-Math.abs(i)),i<=45&&i>=0||i<=360&&i>=315?"left":i>=135&&i<=225?"right":!0===a?i>=35&&i<=135?"up":"down":"vertical"},Tr=function(e){var t=!0;return e.infinite||(e.centerMode&&e.currentSlide>=e.slideCount-1||e.slideCount<=e.slidesToShow||e.currentSlide>=e.slideCount-e.slidesToShow)&&(t=!1),t},Ar=function(e,t){var n={};return t.forEach((function(t){return n[t]=e[t]})),n},Pr=function(e){var t=e.waitForAnimate,n=e.animating,r=e.fade,i=e.infinite,a=e.index,o=e.slideCount,s=e.lazyLoadedList,c=e.lazyLoad,u=e.currentSlide,l=e.centerMode,f=e.slidesToScroll,h=e.slidesToShow,d=e.useCSS;if(t&&n)return{};var p,m,v,g=a,b={},y={},w=i?a:xr(a,0,o-1);if(r){if(!i&&(a<0||a>=o))return{};a<0?g=a+o:a>=o&&(g=a-o),c&&s.indexOf(g)<0&&s.push(g),b={animating:!0,currentSlide:g,lazyLoadedList:s,targetSlide:g},y={animating:!1,targetSlide:g}}else p=g,g<0?(p=g+o,i?o%f!==0&&(p=o-o%f):p=0):!Tr(e)&&g>u?g=p=u:l&&g>=o?(g=i?o:o-1,p=i?0:o-1):g>=o&&(p=g-o,i?o%f!==0&&(p=0):p=o-h),!i&&g+h>=o&&(p=o-h),m=Br(Object(mt.a)(Object(mt.a)({},e),{},{slideIndex:g})),v=Br(Object(mt.a)(Object(mt.a)({},e),{},{slideIndex:p})),i||(m===v&&(g=p),m=v),c&&s.concat(Mr(Object(mt.a)(Object(mt.a)({},e),{},{currentSlide:g}))),d?(b={animating:!0,currentSlide:p,trackStyle:Dr(Object(mt.a)(Object(mt.a)({},e),{},{left:m})),lazyLoadedList:s,targetSlide:w},y={animating:!1,currentSlide:p,trackStyle:Ir(Object(mt.a)(Object(mt.a)({},e),{},{left:v})),swipeLeft:null,targetSlide:w}):b={currentSlide:p,trackStyle:Ir(Object(mt.a)(Object(mt.a)({},e),{},{left:v})),lazyLoadedList:s,targetSlide:w};return{state:b,nextState:y}},Nr=function(e,t){var n,r,i,a,o=e.slidesToScroll,s=e.slidesToShow,c=e.slideCount,u=e.currentSlide,l=e.targetSlide,f=e.lazyLoad,h=e.infinite;if(n=c%o!==0?0:(c-u)%o,"previous"===t.message)a=u-(i=0===n?o:s-n),f&&!h&&(a=-1===(r=u-i)?c-1:r),h||(a=l-o);else if("next"===t.message)a=u+(i=0===n?o:n),f&&!h&&(a=(u+o)%c+n),h||(a=l+o);else if("dots"===t.message)a=t.index*t.slidesToScroll;else if("children"===t.message){if(a=t.index,h){var d=Ur(Object(mt.a)(Object(mt.a)({},e),{},{targetSlide:a}));a>t.currentSlide&&"left"===d?a-=c:an[n.length-1])t=n[n.length-1];else for(var i in n){if(t-1*e.swipeLeft)return n=r,!1}else if(r.offsetLeft-t+Sr(r)/2>-1*e.swipeLeft)return n=r,!1;return!0})),!n)return 0;var i=!0===e.rtl?e.slideCount-e.currentSlide:e.currentSlide;return Math.abs(n.dataset.index-i)||1}return e.slidesToScroll},Lr=function(e,t){return t.reduce((function(t,n){return t&&e.hasOwnProperty(n)}),!0)?null:console.error("Keys Missing:",e)},Ir=function(e){var t,n;Lr(e,["left","variableWidth","slideCount","slidesToShow","slideWidth"]);var r=e.slideCount+2*e.slidesToShow;e.vertical?n=r*e.slideHeight:t=Vr(e)*e.slideWidth;var i={opacity:1,transition:"",WebkitTransition:""};if(e.useTransform){var a=e.vertical?"translate3d(0px, "+e.left+"px, 0px)":"translate3d("+e.left+"px, 0px, 0px)",o=e.vertical?"translate3d(0px, "+e.left+"px, 0px)":"translate3d("+e.left+"px, 0px, 0px)",s=e.vertical?"translateY("+e.left+"px)":"translateX("+e.left+"px)";i=Object(mt.a)(Object(mt.a)({},i),{},{WebkitTransform:a,transform:o,msTransform:s})}else e.vertical?i.top=e.left:i.left=e.left;return e.fade&&(i={opacity:1}),t&&(i.width=t),n&&(i.height=n),window&&!window.addEventListener&&window.attachEvent&&(e.vertical?i.marginTop=e.left+"px":i.marginLeft=e.left+"px"),i},Dr=function(e){Lr(e,["left","variableWidth","slideCount","slidesToShow","slideWidth","speed","cssEase"]);var t=Ir(e);return e.useTransform?(t.WebkitTransition="-webkit-transform "+e.speed+"ms "+e.cssEase,t.transition="transform "+e.speed+"ms "+e.cssEase):e.vertical?t.transition="top "+e.speed+"ms "+e.cssEase:t.transition="left "+e.speed+"ms "+e.cssEase,t},Br=function(e){if(e.unslick)return 0;Lr(e,["slideIndex","trackRef","infinite","centerMode","slideCount","slidesToShow","slidesToScroll","slideWidth","listWidth","variableWidth","slideHeight"]);var t,n,r=e.slideIndex,i=e.trackRef,a=e.infinite,o=e.centerMode,s=e.slideCount,c=e.slidesToShow,u=e.slidesToScroll,l=e.slideWidth,f=e.listWidth,h=e.variableWidth,d=e.slideHeight,p=e.fade,m=e.vertical;if(p||1===e.slideCount)return 0;var v=0;if(a?(v=-Hr(e),s%u!==0&&r+u>s&&(v=-(r>s?c-(r-s):s%u)),o&&(v+=parseInt(c/2))):(s%u!==0&&r+u>s&&(v=c-s%u),o&&(v=parseInt(c/2))),t=m?r*d*-1+v*d:r*l*-1+v*l,!0===h){var g,b=i&&i.node;if(g=r+Hr(e),t=(n=b&&b.childNodes[g])?-1*n.offsetLeft:0,!0===o){g=a?r+Hr(e):r,n=b&&b.children[g],t=0;for(var y=0;ye.currentSlide?e.targetSlide>e.currentSlide+Wr(e)?"left":"right":e.targetSlide0&&(a+=1),r&&t%2===0&&(a+=1),a}return r?0:t-1},qr=function(e){var t=e.slidesToShow,n=e.centerMode,r=e.rtl,i=e.centerPadding;if(n){var a=(t-1)/2+1;return parseInt(i)>0&&(a+=1),r||t%2!==0||(a+=1),a}return r?t-1:0},Gr=function(){return!("undefined"===typeof window||!window.document||!window.document.createElement)},Kr=function(e){var t,n,r,i,a;return r=(a=e.rtl?e.slideCount-1-e.index:e.index)<0||a>=e.slideCount,e.centerMode?(i=Math.floor(e.slidesToShow/2),n=(a-e.currentSlide)%e.slideCount===0,a>e.currentSlide-i-1&&a<=e.currentSlide+i&&(t=!0)):t=e.currentSlide<=a&&a=e.slideCount?e.targetSlide-e.slideCount:e.targetSlide)}},Yr=function(e,t){return e.key+"-"+t},Xr=function(e){var t,n=[],r=[],i=[],a=f.a.Children.count(e.children),o=Or(e),s=kr(e);return f.a.Children.forEach(e.children,(function(c,u){var l,h={message:"children",index:u,slidesToScroll:e.slidesToScroll,currentSlide:e.currentSlide};l=!e.lazyLoad||e.lazyLoad&&e.lazyLoadedList.indexOf(u)>=0?c:f.a.createElement("div",null);var p=function(e){var t={};return void 0!==e.variableWidth&&!1!==e.variableWidth||(t.width=e.slideWidth),e.fade&&(t.position="relative",e.vertical?t.top=-e.index*parseInt(e.slideHeight):t.left=-e.index*parseInt(e.slideWidth),t.opacity=e.currentSlide===e.index?1:0,e.useCSS&&(t.transition="opacity "+e.speed+"ms "+e.cssEase+", visibility "+e.speed+"ms "+e.cssEase)),t}(Object(mt.a)(Object(mt.a)({},e),{},{index:u})),m=l.props.className||"",v=Kr(Object(mt.a)(Object(mt.a)({},e),{},{index:u}));if(n.push(f.a.cloneElement(l,{key:"original"+Yr(l,u),"data-index":u,className:d()(v,m),tabIndex:"-1","aria-hidden":!v["slick-active"],style:Object(mt.a)(Object(mt.a)({outline:"none"},l.props.style||{}),p),onClick:function(t){l.props&&l.props.onClick&&l.props.onClick(t),e.focusOnSelect&&e.focusOnSelect(h)}})),e.infinite&&!1===e.fade){var g=a-u;g<=Hr(e)&&a!==e.slidesToShow&&((t=-g)>=o&&(l=c),v=Kr(Object(mt.a)(Object(mt.a)({},e),{},{index:t})),r.push(f.a.cloneElement(l,{key:"precloned"+Yr(l,t),"data-index":t,tabIndex:"-1",className:d()(v,m),"aria-hidden":!v["slick-active"],style:Object(mt.a)(Object(mt.a)({},l.props.style||{}),p),onClick:function(t){l.props&&l.props.onClick&&l.props.onClick(t),e.focusOnSelect&&e.focusOnSelect(h)}}))),a!==e.slidesToShow&&((t=a+u)=y&&u<=g:u===y}),x={message:"dots",index:m,slidesToScroll:o,currentSlide:u},M=this.clickHandler.bind(this,x);p=p.concat(f.a.createElement("li",{key:m,className:w},f.a.cloneElement(this.props.customPaging(m),{onClick:M})))}return f.a.cloneElement(this.props.appendDots(p),Object(mt.a)({className:this.props.dotsClass},h))}}]),n}(f.a.PureComponent),Qr=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){return Object(a.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"clickHandler",value:function(e,t){t&&t.preventDefault(),this.props.clickHandler(e,t)}},{key:"render",value:function(){var e={"slick-arrow":!0,"slick-prev":!0},t=this.clickHandler.bind(this,{message:"previous"});!this.props.infinite&&(0===this.props.currentSlide||this.props.slideCount<=this.props.slidesToShow)&&(e["slick-disabled"]=!0,t=null);var n={key:"0","data-role":"none",className:d()(e),style:{display:"block"},onClick:t},i={currentSlide:this.props.currentSlide,slideCount:this.props.slideCount};return this.props.prevArrow?f.a.cloneElement(this.props.prevArrow,Object(mt.a)(Object(mt.a)({},n),i)):f.a.createElement("button",Object(r.a)({key:"0",type:"button"},n)," ","Previous")}}]),n}(f.a.PureComponent),$r=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){return Object(a.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"clickHandler",value:function(e,t){t&&t.preventDefault(),this.props.clickHandler(e,t)}},{key:"render",value:function(){var e={"slick-arrow":!0,"slick-next":!0},t=this.clickHandler.bind(this,{message:"next"});Tr(this.props)||(e["slick-disabled"]=!0,t=null);var n={key:"1","data-role":"none",className:d()(e),style:{display:"block"},onClick:t},i={currentSlide:this.props.currentSlide,slideCount:this.props.slideCount};return this.props.nextArrow?f.a.cloneElement(this.props.nextArrow,Object(mt.a)(Object(mt.a)({},n),i)):f.a.createElement("button",Object(r.a)({key:"1",type:"button"},n)," ","Next")}}]),n}(f.a.PureComponent),ei=n(148),ti=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var o;Object(a.a)(this,n),o=t.call(this,e),Object(i.a)(Object(R.a)(o),"listRefHandler",(function(e){return o.list=e})),Object(i.a)(Object(R.a)(o),"trackRefHandler",(function(e){return o.track=e})),Object(i.a)(Object(R.a)(o),"adaptHeight",(function(){if(o.props.adaptiveHeight&&o.list){var e=o.list.querySelector('[data-index="'.concat(o.state.currentSlide,'"]'));o.list.style.height=Cr(e)+"px"}})),Object(i.a)(Object(R.a)(o),"componentDidMount",(function(){if(o.props.onInit&&o.props.onInit(),o.props.lazyLoad){var e=Mr(Object(mt.a)(Object(mt.a)({},o.props),o.state));e.length>0&&(o.setState((function(t){return{lazyLoadedList:t.lazyLoadedList.concat(e)}})),o.props.onLazyLoad&&o.props.onLazyLoad(e))}var t=Object(mt.a)({listRef:o.list,trackRef:o.track},o.props);o.updateState(t,!0,(function(){o.adaptHeight(),o.props.autoplay&&o.autoPlay("update")})),"progressive"===o.props.lazyLoad&&(o.lazyLoadTimer=setInterval(o.progressiveLazyLoad,1e3)),o.ro=new ei.a((function(){o.state.animating?(o.onWindowResized(!1),o.callbackTimers.push(setTimeout((function(){return o.onWindowResized()}),o.props.speed))):o.onWindowResized()})),o.ro.observe(o.list),Array.prototype.forEach.call(document.querySelectorAll(".slick-slide"),(function(e){e.onfocus=o.props.pauseOnFocus?o.onSlideFocus:null,e.onblur=o.props.pauseOnFocus?o.onSlideBlur:null})),window.addEventListener?window.addEventListener("resize",o.onWindowResized):window.attachEvent("onresize",o.onWindowResized)})),Object(i.a)(Object(R.a)(o),"componentWillUnmount",(function(){o.animationEndCallback&&clearTimeout(o.animationEndCallback),o.lazyLoadTimer&&clearInterval(o.lazyLoadTimer),o.callbackTimers.length&&(o.callbackTimers.forEach((function(e){return clearTimeout(e)})),o.callbackTimers=[]),window.addEventListener?window.removeEventListener("resize",o.onWindowResized):window.detachEvent("onresize",o.onWindowResized),o.autoplayTimer&&clearInterval(o.autoplayTimer),o.ro.disconnect()})),Object(i.a)(Object(R.a)(o),"componentDidUpdate",(function(e){if(o.checkImagesLoad(),o.props.onReInit&&o.props.onReInit(),o.props.lazyLoad){var t=Mr(Object(mt.a)(Object(mt.a)({},o.props),o.state));t.length>0&&(o.setState((function(e){return{lazyLoadedList:e.lazyLoadedList.concat(t)}})),o.props.onLazyLoad&&o.props.onLazyLoad(t))}o.adaptHeight();var n=Object(mt.a)(Object(mt.a)({listRef:o.list,trackRef:o.track},o.props),o.state),r=o.didPropsChange(e);r&&o.updateState(n,r,(function(){o.state.currentSlide>=f.a.Children.count(o.props.children)&&o.changeSlide({message:"index",index:f.a.Children.count(o.props.children)-o.props.slidesToShow,currentSlide:o.state.currentSlide}),e.autoplay===o.props.autoplay&&e.autoplaySpeed===o.props.autoplaySpeed||(o.props.autoplay?o.autoPlay("update"):o.pause("paused"))}))})),Object(i.a)(Object(R.a)(o),"onWindowResized",(function(e){o.debouncedResize&&o.debouncedResize.cancel(),o.debouncedResize=br()((function(){return o.resizeWindow(e)}),50),o.debouncedResize()})),Object(i.a)(Object(R.a)(o),"resizeWindow",(function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Boolean(o.track&&o.track.node);if(t){var n=Object(mt.a)(Object(mt.a)({listRef:o.list,trackRef:o.track},o.props),o.state);o.updateState(n,e,(function(){o.props.autoplay?o.autoPlay("update"):o.pause("paused")})),o.setState({animating:!1}),clearTimeout(o.animationEndCallback),delete o.animationEndCallback}})),Object(i.a)(Object(R.a)(o),"updateState",(function(e,t,n){var r=function(e){var t,n=f.a.Children.count(e.children),r=e.listRef,i=Math.ceil(Sr(r)),a=e.trackRef&&e.trackRef.node,o=Math.ceil(Sr(a));if(e.vertical)t=i;else{var s=e.centerMode&&2*parseInt(e.centerPadding);"string"===typeof e.centerPadding&&"%"===e.centerPadding.slice(-1)&&(s*=i/100),t=Math.ceil((i-s)/e.slidesToShow)}var c=r&&Cr(r.querySelector('[data-index="0"]')),u=c*e.slidesToShow,l=void 0===e.currentSlide?e.initialSlide:e.currentSlide;e.rtl&&void 0===e.currentSlide&&(l=n-1-e.initialSlide);var h=e.lazyLoadedList||[],d=Mr(Object(mt.a)(Object(mt.a)({},e),{},{currentSlide:l,lazyLoadedList:h}));h.concat(d);var p={slideCount:n,slideWidth:t,listWidth:i,trackWidth:o,currentSlide:l,slideHeight:c,listHeight:u,lazyLoadedList:h};return null===e.autoplaying&&e.autoplay&&(p.autoplaying="playing"),p}(e);e=Object(mt.a)(Object(mt.a)(Object(mt.a)({},e),r),{},{slideIndex:r.currentSlide});var i=Br(e);e=Object(mt.a)(Object(mt.a)({},e),{},{left:i});var a=Ir(e);(t||f.a.Children.count(o.props.children)!==f.a.Children.count(e.children))&&(r.trackStyle=a),o.setState(r,n)})),Object(i.a)(Object(R.a)(o),"ssrInit",(function(){if(o.props.variableWidth){var e=0,t=0,n=[],r=Hr(Object(mt.a)(Object(mt.a)(Object(mt.a)({},o.props),o.state),{},{slideCount:o.props.children.length})),i=Fr(Object(mt.a)(Object(mt.a)(Object(mt.a)({},o.props),o.state),{},{slideCount:o.props.children.length}));o.props.children.forEach((function(t){n.push(t.props.style.width),e+=t.props.style.width}));for(var a=0;a=t&&o.onWindowResized()};if(e.onclick){var i=e.onclick;e.onclick=function(){i(),e.parentNode.focus()}}else e.onclick=function(){return e.parentNode.focus()};e.onload||(o.props.lazyLoad?e.onload=function(){o.adaptHeight(),o.callbackTimers.push(setTimeout(o.onWindowResized,o.props.speed))}:(e.onload=r,e.onerror=function(){r(),o.props.onLazyLoadError&&o.props.onLazyLoadError()}))}))})),Object(i.a)(Object(R.a)(o),"progressiveLazyLoad",(function(){for(var e=[],t=Object(mt.a)(Object(mt.a)({},o.props),o.state),n=o.state.currentSlide;n=-Hr(t);r--)if(o.state.lazyLoadedList.indexOf(r)<0){e.push(r);break}e.length>0?(o.setState((function(t){return{lazyLoadedList:t.lazyLoadedList.concat(e)}})),o.props.onLazyLoad&&o.props.onLazyLoad(e)):o.lazyLoadTimer&&(clearInterval(o.lazyLoadTimer),delete o.lazyLoadTimer)})),Object(i.a)(Object(R.a)(o),"slideHandler",(function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=o.props,r=n.asNavFor,i=n.beforeChange,a=n.onLazyLoad,s=n.speed,c=n.afterChange,u=o.state.currentSlide,l=Pr(Object(mt.a)(Object(mt.a)(Object(mt.a)({index:e},o.props),o.state),{},{trackRef:o.track,useCSS:o.props.useCSS&&!t})),f=l.state,h=l.nextState;if(f){i&&i(u,f.currentSlide);var d=f.lazyLoadedList.filter((function(e){return o.state.lazyLoadedList.indexOf(e)<0}));a&&d.length>0&&a(d),!o.props.waitForAnimate&&o.animationEndCallback&&(clearTimeout(o.animationEndCallback),c&&c(u),delete o.animationEndCallback),o.setState(f,(function(){r&&o.asNavForIndex!==e&&(o.asNavForIndex=e,r.innerSlider.slideHandler(e)),h&&(o.animationEndCallback=setTimeout((function(){var e=h.animating,t=Object(yr.a)(h,["animating"]);o.setState(t,(function(){o.callbackTimers.push(setTimeout((function(){return o.setState({animating:e})}),10)),c&&c(f.currentSlide),delete o.animationEndCallback}))}),s))}))}})),Object(i.a)(Object(R.a)(o),"changeSlide",(function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Object(mt.a)(Object(mt.a)({},o.props),o.state),r=Nr(n,e);if((0===r||r)&&(!0===t?o.slideHandler(r,t):o.slideHandler(r),o.props.autoplay&&o.autoPlay("update"),o.props.focusOnSelect)){var i=o.list.querySelectorAll(".slick-current");i[0]&&i[0].focus()}})),Object(i.a)(Object(R.a)(o),"clickHandler",(function(e){!1===o.clickable&&(e.stopPropagation(),e.preventDefault()),o.clickable=!0})),Object(i.a)(Object(R.a)(o),"keyHandler",(function(e){var t=function(e,t,n){return e.target.tagName.match("TEXTAREA|INPUT|SELECT")||!t?"":37===e.keyCode?n?"next":"previous":39===e.keyCode?n?"previous":"next":""}(e,o.props.accessibility,o.props.rtl);""!==t&&o.changeSlide({message:t})})),Object(i.a)(Object(R.a)(o),"selectHandler",(function(e){o.changeSlide(e)})),Object(i.a)(Object(R.a)(o),"disableBodyScroll",(function(){window.ontouchmove=function(e){(e=e||window.event).preventDefault&&e.preventDefault(),e.returnValue=!1}})),Object(i.a)(Object(R.a)(o),"enableBodyScroll",(function(){window.ontouchmove=null})),Object(i.a)(Object(R.a)(o),"swipeStart",(function(e){o.props.verticalSwiping&&o.disableBodyScroll();var t=function(e,t,n){return"IMG"===e.target.tagName&&e.preventDefault(),!t||!n&&-1!==e.type.indexOf("mouse")?"":{dragging:!0,touchObject:{startX:e.touches?e.touches[0].pageX:e.clientX,startY:e.touches?e.touches[0].pageY:e.clientY,curX:e.touches?e.touches[0].pageX:e.clientX,curY:e.touches?e.touches[0].pageY:e.clientY}}}(e,o.props.swipe,o.props.draggable);""!==t&&o.setState(t)})),Object(i.a)(Object(R.a)(o),"swipeMove",(function(e){var t=function(e,t){var n=t.scrolling,r=t.animating,i=t.vertical,a=t.swipeToSlide,o=t.verticalSwiping,s=t.rtl,c=t.currentSlide,u=t.edgeFriction,l=t.edgeDragged,f=t.onEdge,h=t.swiped,d=t.swiping,p=t.slideCount,m=t.slidesToScroll,v=t.infinite,g=t.touchObject,b=t.swipeEvent,y=t.listHeight,w=t.listWidth;if(!n){if(r)return e.preventDefault();i&&a&&o&&e.preventDefault();var x,M={},O=Br(t);g.curX=e.touches?e.touches[0].pageX:e.clientX,g.curY=e.touches?e.touches[0].pageY:e.clientY,g.swipeLength=Math.round(Math.sqrt(Math.pow(g.curX-g.startX,2)));var k=Math.round(Math.sqrt(Math.pow(g.curY-g.startY,2)));if(!o&&!d&&k>10)return{scrolling:!0};o&&(g.swipeLength=k);var E=(s?-1:1)*(g.curX>g.startX?1:-1);o&&(E=g.curY>g.startY?1:-1);var _=Math.ceil(p/m),S=jr(t.touchObject,o),C=g.swipeLength;return v||(0===c&&"right"===S||c+1>=_&&"left"===S||!Tr(t)&&"left"===S)&&(C=g.swipeLength*u,!1===l&&f&&(f(S),M.edgeDragged=!0)),!h&&b&&(b(S),M.swiped=!0),x=i?O+C*(y/w)*E:s?O-C*E:O+C*E,o&&(x=O+C*E),M=Object(mt.a)(Object(mt.a)({},M),{},{touchObject:g,swipeLeft:x,trackStyle:Ir(Object(mt.a)(Object(mt.a)({},t),{},{left:x}))}),Math.abs(g.curX-g.startX)<.8*Math.abs(g.curY-g.startY)?M:(g.swipeLength>10&&(M.swiping=!0,e.preventDefault()),M)}}(e,Object(mt.a)(Object(mt.a)(Object(mt.a)({},o.props),o.state),{},{trackRef:o.track,listRef:o.list,slideIndex:o.state.currentSlide}));t&&(t.swiping&&(o.clickable=!1),o.setState(t))})),Object(i.a)(Object(R.a)(o),"swipeEnd",(function(e){var t=function(e,t){var n=t.dragging,r=t.swipe,i=t.touchObject,a=t.listWidth,o=t.touchThreshold,s=t.verticalSwiping,c=t.listHeight,u=t.swipeToSlide,l=t.scrolling,f=t.onSwipe,h=t.targetSlide,d=t.currentSlide,p=t.infinite;if(!n)return r&&e.preventDefault(),{};var m=s?c/o:a/o,v=jr(i,s),g={dragging:!1,edgeDragged:!1,scrolling:!1,swiping:!1,swiped:!1,swipeLeft:null,touchObject:{}};if(l)return g;if(!i.swipeLength)return g;if(i.swipeLength>m){var b,y;e.preventDefault(),f&&f(v);var w=p?d:h;switch(v){case"left":case"up":y=w+zr(t),b=u?Rr(t,y):y,g.currentDirection=0;break;case"right":case"down":y=w-zr(t),b=u?Rr(t,y):y,g.currentDirection=1;break;default:b=w}g.triggerSlideHandler=b}else{var x=Br(t);g.trackStyle=Dr(Object(mt.a)(Object(mt.a)({},t),{},{left:x}))}return g}(e,Object(mt.a)(Object(mt.a)(Object(mt.a)({},o.props),o.state),{},{trackRef:o.track,listRef:o.list,slideIndex:o.state.currentSlide}));if(t){var n=t.triggerSlideHandler;delete t.triggerSlideHandler,o.setState(t),void 0!==n&&(o.slideHandler(n),o.props.verticalSwiping&&o.enableBodyScroll())}})),Object(i.a)(Object(R.a)(o),"touchEnd",(function(e){o.swipeEnd(e),o.clickable=!0})),Object(i.a)(Object(R.a)(o),"slickPrev",(function(){o.callbackTimers.push(setTimeout((function(){return o.changeSlide({message:"previous"})}),0))})),Object(i.a)(Object(R.a)(o),"slickNext",(function(){o.callbackTimers.push(setTimeout((function(){return o.changeSlide({message:"next"})}),0))})),Object(i.a)(Object(R.a)(o),"slickGoTo",(function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e=Number(e),isNaN(e))return"";o.callbackTimers.push(setTimeout((function(){return o.changeSlide({message:"index",index:e,currentSlide:o.state.currentSlide},t)}),0))})),Object(i.a)(Object(R.a)(o),"play",(function(){var e;if(o.props.rtl)e=o.state.currentSlide-o.props.slidesToScroll;else{if(!Tr(Object(mt.a)(Object(mt.a)({},o.props),o.state)))return!1;e=o.state.currentSlide+o.props.slidesToScroll}o.slideHandler(e)})),Object(i.a)(Object(R.a)(o),"autoPlay",(function(e){o.autoplayTimer&&clearInterval(o.autoplayTimer);var t=o.state.autoplaying;if("update"===e){if("hovered"===t||"focused"===t||"paused"===t)return}else if("leave"===e){if("paused"===t||"focused"===t)return}else if("blur"===e&&("paused"===t||"hovered"===t))return;o.autoplayTimer=setInterval(o.play,o.props.autoplaySpeed+50),o.setState({autoplaying:"playing"})})),Object(i.a)(Object(R.a)(o),"pause",(function(e){o.autoplayTimer&&(clearInterval(o.autoplayTimer),o.autoplayTimer=null);var t=o.state.autoplaying;"paused"===e?o.setState({autoplaying:"paused"}):"focused"===e?"hovered"!==t&&"playing"!==t||o.setState({autoplaying:"focused"}):"playing"===t&&o.setState({autoplaying:"hovered"})})),Object(i.a)(Object(R.a)(o),"onDotsOver",(function(){return o.props.autoplay&&o.pause("hovered")})),Object(i.a)(Object(R.a)(o),"onDotsLeave",(function(){return o.props.autoplay&&"hovered"===o.state.autoplaying&&o.autoPlay("leave")})),Object(i.a)(Object(R.a)(o),"onTrackOver",(function(){return o.props.autoplay&&o.pause("hovered")})),Object(i.a)(Object(R.a)(o),"onTrackLeave",(function(){return o.props.autoplay&&"hovered"===o.state.autoplaying&&o.autoPlay("leave")})),Object(i.a)(Object(R.a)(o),"onSlideFocus",(function(){return o.props.autoplay&&o.pause("focused")})),Object(i.a)(Object(R.a)(o),"onSlideBlur",(function(){return o.props.autoplay&&"focused"===o.state.autoplaying&&o.autoPlay("blur")})),Object(i.a)(Object(R.a)(o),"render",(function(){var e,t,n,i=d()("slick-slider",o.props.className,{"slick-vertical":o.props.vertical,"slick-initialized":!0}),a=Object(mt.a)(Object(mt.a)({},o.props),o.state),s=Ar(a,["fade","cssEase","speed","infinite","centerMode","focusOnSelect","currentSlide","lazyLoad","lazyLoadedList","rtl","slideWidth","slideHeight","listHeight","vertical","slidesToShow","slidesToScroll","slideCount","trackStyle","variableWidth","unslick","centerPadding","targetSlide","useCSS"]),c=o.props.pauseOnHover;if(s=Object(mt.a)(Object(mt.a)({},s),{},{onMouseEnter:c?o.onTrackOver:null,onMouseLeave:c?o.onTrackLeave:null,onMouseOver:c?o.onTrackOver:null,focusOnSelect:o.props.focusOnSelect&&o.clickable?o.selectHandler:null}),!0===o.props.dots&&o.state.slideCount>=o.props.slidesToShow){var u=Ar(a,["dotsClass","slideCount","slidesToShow","currentSlide","slidesToScroll","clickHandler","children","customPaging","infinite","appendDots"]),l=o.props.pauseOnDotsHover;u=Object(mt.a)(Object(mt.a)({},u),{},{clickHandler:o.changeSlide,onMouseEnter:l?o.onDotsLeave:null,onMouseOver:l?o.onDotsOver:null,onMouseLeave:l?o.onDotsLeave:null}),e=f.a.createElement(Jr,u)}var h=Ar(a,["infinite","centerMode","currentSlide","slideCount","slidesToShow","prevArrow","nextArrow"]);h.clickHandler=o.changeSlide,o.props.arrows&&(t=f.a.createElement(Qr,h),n=f.a.createElement($r,h));var p=null;o.props.vertical&&(p={height:o.state.listHeight});var m=null;!1===o.props.vertical?!0===o.props.centerMode&&(m={padding:"0px "+o.props.centerPadding}):!0===o.props.centerMode&&(m={padding:o.props.centerPadding+" 0px"});var v=Object(mt.a)(Object(mt.a)({},p),m),g=o.props.touchMove,b={className:"slick-list",style:v,onClick:o.clickHandler,onMouseDown:g?o.swipeStart:null,onMouseMove:o.state.dragging&&g?o.swipeMove:null,onMouseUp:g?o.swipeEnd:null,onMouseLeave:o.state.dragging&&g?o.swipeEnd:null,onTouchStart:g?o.swipeStart:null,onTouchMove:o.state.dragging&&g?o.swipeMove:null,onTouchEnd:g?o.touchEnd:null,onTouchCancel:o.state.dragging&&g?o.swipeEnd:null,onKeyDown:o.props.accessibility?o.keyHandler:null},y={className:i,dir:"ltr",style:o.props.style};return o.props.unslick&&(b={className:"slick-list"},y={className:i}),f.a.createElement("div",y,o.props.unslick?"":t,f.a.createElement("div",Object(r.a)({ref:o.listRefHandler},b),f.a.createElement(Zr,Object(r.a)({ref:o.trackRefHandler},s),o.props.children)),o.props.unslick?"":n,o.props.unslick?"":e)})),o.list=null,o.track=null,o.state=Object(mt.a)(Object(mt.a)({},wr),{},{currentSlide:o.props.initialSlide,slideCount:f.a.Children.count(o.props.children)}),o.callbackTimers=[],o.clickable=!0,o.debouncedResize=null;var s=o.ssrInit();return o.state=Object(mt.a)(Object(mt.a)({},o.state),s),o}return Object(o.a)(n,[{key:"didPropsChange",value:function(e){for(var t=!1,n=0,r=Object.keys(this.props);n1&&void 0!==arguments[1]&&arguments[1];return r.innerSlider.slickGoTo(e,t)})),Object(i.a)(Object(R.a)(r),"slickPause",(function(){return r.innerSlider.pause("paused")})),Object(i.a)(Object(R.a)(r),"slickPlay",(function(){return r.innerSlider.autoPlay("play")})),r.state={breakpoint:null},r._responsiveMediaHandlers=[],r}return Object(o.a)(n,[{key:"media",value:function(e,t){var n=window.matchMedia(e),r=function(e){e.matches&&t()};n.addListener(r),r(n),this._responsiveMediaHandlers.push({mql:n,query:e,listener:r})}},{key:"componentDidMount",value:function(){var e=this;if(this.props.responsive){var t=this.props.responsive.map((function(e){return e.breakpoint}));t.sort((function(e,t){return e-t})),t.forEach((function(n,r){var i;i=0===r?ri()({minWidth:0,maxWidth:n}):ri()({minWidth:t[r-1]+1,maxWidth:n}),Gr()&&e.media(i,(function(){e.setState({breakpoint:n})}))}));var n=ri()({minWidth:t.slice(-1)[0]});Gr()&&this.media(n,(function(){e.setState({breakpoint:null})}))}}},{key:"componentWillUnmount",value:function(){this._responsiveMediaHandlers.forEach((function(e){e.mql.removeListener(e.listener)}))}},{key:"render",value:function(){var e,t,n=this;(e=this.state.breakpoint?"unslick"===(t=this.props.responsive.filter((function(e){return e.breakpoint===n.state.breakpoint})))[0].settings?"unslick":Object(mt.a)(Object(mt.a)(Object(mt.a)({},ii),this.props),t[0].settings):Object(mt.a)(Object(mt.a)({},ii),this.props)).centerMode&&(e.slidesToScroll,e.slidesToScroll=1),e.fade&&(e.slidesToShow,e.slidesToScroll,e.slidesToShow=1,e.slidesToScroll=1);var i=f.a.Children.toArray(this.props.children);i=i.filter((function(e){return"string"===typeof e?!!e.trim():!!e})),e.variableWidth&&(e.rows>1||e.slidesPerRow>1)&&(console.warn("variableWidth is not supported in case of rows > 1 or slidesPerRow > 1"),e.variableWidth=!1);for(var a=[],o=null,s=0;s=i.length));h+=1)l.push(f.a.cloneElement(i[h],{key:100*s+10*u+h,tabIndex:-1,style:{width:"".concat(100/e.slidesPerRow,"%"),display:"inline-block"}}));c.push(f.a.createElement("div",{key:10*s+u},l))}e.variableWidth?a.push(f.a.createElement("div",{key:s,style:{width:o}},c)):a.push(f.a.createElement("div",{key:s},c))}if("unslick"===e){var d="regular slider "+(this.props.className||"");return f.a.createElement("div",{className:d},i)}return a.length<=e.slidesToShow&&(e.unslick=!0),f.a.createElement(ti,Object(r.a)({style:this.props.style,ref:this.innerSliderRefHandler},e),a)}}]),n}(f.a.Component),oi=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i1&&void 0!==arguments[1]&&arguments[1];w.current.slickGoTo(e,t)};l.useImperativeHandle(t,(function(){return{goTo:x,autoPlay:w.current.innerSlider.autoPlay,innerSlider:w.current.innerSlider,prev:w.current.slickPrev,next:w.current.slickNext}}),[w.current]),l.useEffect((function(){var e=br()((function(){m.autoplay&&w.current&&w.current.innerSlider&&w.current.innerSlider.autoPlay&&w.current.innerSlider.autoPlay()}),500,{leading:!1});return m.autoplay&&window.addEventListener("resize",e),function(){m.autoplay&&(window.removeEventListener("resize",e),e.cancel())}}),[w.current,m.autoplay]);var M=l.useRef(l.Children.count(m.children));l.useEffect((function(){M.current!==l.Children.count(m.children)&&(x(m.initialSlide||0,!1),M.current=l.Children.count(m.children))}),[m.children]);var O=Object(r.a)({},m);"fade"===O.effect&&(O.fade=!0);var k=b("carousel",O.prefixCls);O.vertical="left"===p||"right"===p;var E=!!o,_=d()("slick-dots","".concat("slick-dots","-").concat(p),"boolean"!==typeof o&&(null===o||void 0===o?void 0:o.className)),S=d()(k,(n={},Object(i.a)(n,"".concat(k,"-rtl"),"rtl"===y),Object(i.a)(n,"".concat(k,"-vertical"),O.vertical),n));return l.createElement("div",{className:S},l.createElement(ai,Object(r.a)({ref:w},O,{dots:E,dotsClass:_,arrows:c,draggable:f})))})),ci=n(433),ui=n.n(ci),li=n(171),fi=n.n(li);var hi=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){var e;return Object(a.a)(this,n),(e=t.apply(this,arguments)).menuItems={},e.saveMenuItem=function(t){return function(n){e.menuItems[t]=n}},e}return Object(o.a)(n,[{key:"componentDidMount",value:function(){this.scrollActiveItemToView()}},{key:"componentDidUpdate",value:function(e){!e.visible&&this.props.visible&&this.scrollActiveItemToView()}},{key:"getFieldName",value:function(e){var t=this.props,n=t.fieldNames,r=t.defaultFieldNames;return n[e]||r[e]}},{key:"getOption",value:function(e,t){var n=this.props,r=n.prefixCls,i=n.expandTrigger,a=n.expandIcon,o=n.loadingIcon,s=this.props.onSelect.bind(this,e,t),c={onClick:s,onDoubleClick:this.props.onItemDoubleClick.bind(this,e,t)},u="".concat(r,"-menu-item"),f=null,h=e[this.getFieldName("children")]&&e[this.getFieldName("children")].length>0;(h||!1===e.isLeaf)&&(u+=" ".concat(r,"-menu-item-expand"),e.loading||(f=l.createElement("span",{className:"".concat(r,"-menu-item-expand-icon")},a))),"hover"!==i||!h&&!1!==e.isLeaf||(c={onMouseEnter:this.delayOnSelect.bind(this,s),onMouseLeave:this.delayOnSelect.bind(this),onClick:s}),this.isActiveOption(e,t)&&(u+=" ".concat(r,"-menu-item-active"),c.ref=this.saveMenuItem(t)),e.disabled&&(u+=" ".concat(r,"-menu-item-disabled"));var d=null;e.loading&&(u+=" ".concat(r,"-menu-item-loading"),d=o||null);var p="";return"title"in e?p=e.title:"string"===typeof e[this.getFieldName("label")]&&(p=e[this.getFieldName("label")]),l.createElement("li",Object.assign({key:e[this.getFieldName("value")],className:u,title:p},c,{role:"menuitem",onMouseDown:function(e){return e.preventDefault()}}),e[this.getFieldName("label")],f,d)}},{key:"getActiveOptions",value:function(e){var t=this,n=this.props.options,r=e||this.props.activeValue;return fi()(n,(function(e,n){return e[t.getFieldName("value")]===r[n]}),{childrenKeyName:this.getFieldName("children")})}},{key:"getShowOptions",value:function(){var e=this,t=this.props.options,n=this.getActiveOptions().map((function(t){return t[e.getFieldName("children")]})).filter((function(e){return!!e}));return n.unshift(t),n}},{key:"delayOnSelect",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i=a.length?0:s:(s-=1)<0?a.length-1:s:0,n[i]=a[s][r.getFieldName("value")]}else if(e.keyCode===vt.a.LEFT||e.keyCode===vt.a.BACKSPACE)e.preventDefault(),n.splice(n.length-1,1);else if(e.keyCode===vt.a.RIGHT)e.preventDefault(),a[o]&&a[o][r.getFieldName("children")]&&n.push(a[o][r.getFieldName("children")][0][r.getFieldName("value")]);else if(e.keyCode===vt.a.ESC||e.keyCode===vt.a.TAB)return r.setPopupVisible(!1),void(r.props.onKeyDown&&r.props.onKeyDown(e));n&&0!==n.length||r.setPopupVisible(!1);var c=r.getActiveOptions(n),u=c[c.length-1];r.handleMenuSelect(u,c.length-1,e),r.props.onKeyDown&&r.props.onKeyDown(e)}}},r.saveTrigger=function(e){r.trigger=e};var i=[];return"value"in e?i=e.value||[]:"defaultValue"in e&&(i=e.defaultValue||[]),ui()(!("filedNames"in e),"`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead."),r.state={popupVisible:e.popupVisible,activeValue:i,value:i,prevProps:e},r.defaultFieldNames={label:"label",value:"value",children:"children"},r}return Object(o.a)(n,[{key:"getPopupDOMNode",value:function(){return this.trigger.getPopupDomNode()}},{key:"getFieldName",value:function(e){var t=this.defaultFieldNames,n=this.props,r=n.fieldNames,i=n.filedNames;return"filedNames"in this.props?i[e]||t[e]:r[e]||t[e]}},{key:"getFieldNames",value:function(){var e=this.props,t=e.fieldNames,n=e.filedNames;return"filedNames"in this.props?n:t}},{key:"getCurrentLevelOptions",value:function(){var e=this,t=this.props.options,n=void 0===t?[]:t,r=this.state.activeValue,i=void 0===r?[]:r,a=fi()(n,(function(t,n){return t[e.getFieldName("value")]===i[n]}),{childrenKeyName:this.getFieldName("children")});return a[a.length-2]?a[a.length-2][this.getFieldName("children")]:Object(g.a)(n).filter((function(e){return!e.disabled}))}},{key:"getActiveOptions",value:function(e){var t=this;return fi()(this.props.options||[],(function(n,r){return n[t.getFieldName("value")]===e[r]}),{childrenKeyName:this.getFieldName("children")})}},{key:"render",value:function(){var e=this.props,t=e.prefixCls,n=e.transitionName,r=e.popupClassName,i=e.options,a=void 0===i?[]:i,o=e.disabled,s=e.builtinPlacements,c=e.popupPlacement,u=e.children,f=e.dropdownRender,h=Object(yr.a)(e,["prefixCls","transitionName","popupClassName","options","disabled","builtinPlacements","popupPlacement","children","dropdownRender"]),d=l.createElement("div",null),p="";a&&a.length>0?d=l.createElement(di,Object.assign({},this.props,{fieldNames:this.getFieldNames(),defaultFieldNames:this.defaultFieldNames,activeValue:this.state.activeValue,onSelect:this.handleMenuSelect,onItemDoubleClick:this.handleItemDoubleClick,visible:this.state.popupVisible})):p=" ".concat(t,"-menus-empty");var m=d;return f&&(m=f(d)),l.createElement(An.a,Object.assign({ref:this.saveTrigger},h,{popupPlacement:c,builtinPlacements:s,popupTransitionName:n,action:o?[]:["click"],popupVisible:!o&&this.state.popupVisible,onPopupVisibleChange:this.handlePopupVisibleChange,prefixCls:"".concat(t,"-menus"),popupClassName:r+p,popup:m}),l.cloneElement(u,{onKeyDown:this.handleKeyDown,tabIndex:o?void 0:0}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,r={prevProps:e};return"value"in e&&!function(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=e.length;if(t.length!==n)return!1;for(var r=0;r"};var vi=mi,gi=n(261),bi=n(88),yi=n(57),wi=Object(yi.a)("text","input");function xi(e){return!!(e.prefix||e.suffix||e.allowClear)}function Mi(e){return!(!e.addonBefore&&!e.addonAfter)}var Oi=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){var e;return Object(a.a)(this,n),(e=t.apply(this,arguments)).containerRef=l.createRef(),e.onInputMouseUp=function(t){var n;if(null===(n=e.containerRef.current)||void 0===n?void 0:n.contains(t.target)){var r=e.props.triggerFocus;null===r||void 0===r||r()}},e}return Object(o.a)(n,[{key:"renderClearIcon",value:function(e){var t=this.props,n=t.allowClear,r=t.value,a=t.disabled,o=t.readOnly,s=t.handleReset;if(!n)return null;var c=!a&&!o&&r,u="".concat(e,"-clear-icon");return l.createElement(ue.a,{onClick:s,className:d()(Object(i.a)({},"".concat(u,"-hidden"),!c),u),role:"button"})}},{key:"renderSuffix",value:function(e){var t=this.props,n=t.suffix,r=t.allowClear;return n||r?l.createElement("span",{className:"".concat(e,"-suffix")},this.renderClearIcon(e),n):null}},{key:"renderLabeledIcon",value:function(e,t){var n,r=this.props,a=r.focused,o=r.value,s=r.prefix,c=r.className,u=r.size,f=r.suffix,h=r.disabled,p=r.allowClear,m=r.direction,v=r.style,g=r.readOnly,b=r.bordered,y=this.renderSuffix(e);if(!xi(this.props))return Object(X.a)(t,{value:o});var w=s?l.createElement("span",{className:"".concat(e,"-prefix")},s):null,x=d()("".concat(e,"-affix-wrapper"),(n={},Object(i.a)(n,"".concat(e,"-affix-wrapper-focused"),a),Object(i.a)(n,"".concat(e,"-affix-wrapper-disabled"),h),Object(i.a)(n,"".concat(e,"-affix-wrapper-sm"),"small"===u),Object(i.a)(n,"".concat(e,"-affix-wrapper-lg"),"large"===u),Object(i.a)(n,"".concat(e,"-affix-wrapper-input-with-clear-btn"),f&&p&&o),Object(i.a)(n,"".concat(e,"-affix-wrapper-rtl"),"rtl"===m),Object(i.a)(n,"".concat(e,"-affix-wrapper-readonly"),g),Object(i.a)(n,"".concat(e,"-affix-wrapper-borderless"),!b),Object(i.a)(n,"".concat(c),!Mi(this.props)&&c),n));return l.createElement("span",{ref:this.containerRef,className:x,style:v,onMouseUp:this.onInputMouseUp},w,Object(X.a)(t,{style:null,value:o,className:Si(e,b,u,h)}),y)}},{key:"renderInputWithLabel",value:function(e,t){var n,r=this.props,a=r.addonBefore,o=r.addonAfter,s=r.style,c=r.size,u=r.className,f=r.direction;if(!Mi(this.props))return t;var h="".concat(e,"-group"),p="".concat(h,"-addon"),m=a?l.createElement("span",{className:p},a):null,v=o?l.createElement("span",{className:p},o):null,g=d()("".concat(e,"-wrapper"),h,Object(i.a)({},"".concat(h,"-rtl"),"rtl"===f)),b=d()("".concat(e,"-group-wrapper"),(n={},Object(i.a)(n,"".concat(e,"-group-wrapper-sm"),"small"===c),Object(i.a)(n,"".concat(e,"-group-wrapper-lg"),"large"===c),Object(i.a)(n,"".concat(e,"-group-wrapper-rtl"),"rtl"===f),n),u);return l.createElement("span",{className:b,style:s},l.createElement("span",{className:g},m,Object(X.a)(t,{style:null}),v))}},{key:"renderTextAreaWithClearIcon",value:function(e,t){var n,r=this.props,a=r.value,o=r.allowClear,s=r.className,c=r.style,u=r.direction,f=r.bordered;if(!o)return Object(X.a)(t,{value:a});var h=d()("".concat(e,"-affix-wrapper"),"".concat(e,"-affix-wrapper-textarea-with-clear-btn"),(n={},Object(i.a)(n,"".concat(e,"-affix-wrapper-rtl"),"rtl"===u),Object(i.a)(n,"".concat(e,"-affix-wrapper-borderless"),!f),Object(i.a)(n,"".concat(s),!Mi(this.props)&&s),n));return l.createElement("span",{className:h,style:c},Object(X.a)(t,{style:null,value:a}),this.renderClearIcon(e))}},{key:"render",value:function(){var e=this.props,t=e.prefixCls,n=e.inputType,r=e.element;return n===wi[0]?this.renderTextAreaWithClearIcon(t,r):this.renderInputWithLabel(t,this.renderLabeledIcon(t,r))}}]),n}(l.Component),ki=n(50);function Ei(e){return"undefined"===typeof e||null===e?"":e}function _i(e,t,n){if(n){var r=t;if("click"===t.type){(r=Object.create(t)).target=e,r.currentTarget=e;var i=e.value;return e.value="",n(r),void(e.value=i)}n(r)}}function Si(e,t,n,r,a){var o;return d()(e,(o={},Object(i.a)(o,"".concat(e,"-sm"),"small"===n),Object(i.a)(o,"".concat(e,"-lg"),"large"===n),Object(i.a)(o,"".concat(e,"-disabled"),r),Object(i.a)(o,"".concat(e,"-rtl"),"rtl"===a),Object(i.a)(o,"".concat(e,"-borderless"),!t),o))}function Ci(e,t){if(e){e.focus(t);var n=(t||{}).cursor;if(n){var r=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(r,r);break;default:e.setSelectionRange(0,r)}}}}var ji=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var o;Object(a.a)(this,n),(o=t.call(this,e)).direction="ltr",o.focus=function(e){Ci(o.input,e)},o.saveClearableInput=function(e){o.clearableInput=e},o.saveInput=function(e){o.input=e},o.onFocus=function(e){var t=o.props.onFocus;o.setState({focused:!0},o.clearPasswordValueAttribute),t&&t(e)},o.onBlur=function(e){var t=o.props.onBlur;o.setState({focused:!1},o.clearPasswordValueAttribute),t&&t(e)},o.handleReset=function(e){o.setValue("",(function(){o.focus()})),_i(o.input,e,o.props.onChange)},o.renderInput=function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=o.props,c=s.className,u=s.addonBefore,f=s.addonAfter,h=s.size,m=s.disabled,v=Object(p.a)(o.props,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","size","inputType","bordered"]);return l.createElement("input",Object(r.a)({autoComplete:a.autoComplete},v,{onChange:o.handleChange,onFocus:o.onFocus,onBlur:o.onBlur,onKeyDown:o.handleKeyDown,className:d()(Si(e,n,h||t,m,o.direction),Object(i.a)({},c,c&&!u&&!f)),ref:o.saveInput}))},o.clearPasswordValueAttribute=function(){o.removePasswordTimeout=setTimeout((function(){o.input&&"password"===o.input.getAttribute("type")&&o.input.hasAttribute("value")&&o.input.removeAttribute("value")}))},o.handleChange=function(e){o.setValue(e.target.value,o.clearPasswordValueAttribute),_i(o.input,e,o.props.onChange)},o.handleKeyDown=function(e){var t=o.props,n=t.onPressEnter,r=t.onKeyDown;13===e.keyCode&&n&&n(e),r&&r(e)},o.renderComponent=function(e){var t=e.getPrefixCls,n=e.direction,i=e.input,a=o.state,s=a.value,c=a.focused,u=o.props,f=u.prefixCls,h=u.bordered,d=void 0===h||h,p=t("input",f);return o.direction=n,l.createElement(ki.b.Consumer,null,(function(e){return l.createElement(Oi,Object(r.a)({size:e},o.props,{prefixCls:p,inputType:"input",value:Ei(s),element:o.renderInput(p,e,d,i),handleReset:o.handleReset,ref:o.saveClearableInput,direction:n,focused:c,triggerFocus:o.focus,bordered:d}))}))};var s="undefined"===typeof e.value?e.defaultValue:e.value;return o.state={value:s,focused:!1,prevValue:e.value},o}return Object(o.a)(n,[{key:"componentDidMount",value:function(){this.clearPasswordValueAttribute()}},{key:"componentDidUpdate",value:function(){}},{key:"getSnapshotBeforeUpdate",value:function(e){return xi(e)!==xi(this.props)&&Object(Y.a)(this.input!==document.activeElement,"Input","When Input is focused, dynamic add or remove prefix / suffix will make it lose focus caused by dom structure change. Read more: https://ant.design/components/input/#FAQ"),null}},{key:"componentWillUnmount",value:function(){this.removePasswordTimeout&&clearTimeout(this.removePasswordTimeout)}},{key:"blur",value:function(){this.input.blur()}},{key:"setSelectionRange",value:function(e,t,n){this.input.setSelectionRange(e,t,n)}},{key:"select",value:function(){this.input.select()}},{key:"setValue",value:function(e,t){void 0===this.props.value?this.setState({value:e},t):null===t||void 0===t||t()}},{key:"render",value:function(){return l.createElement(v.a,null,this.renderComponent)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevValue,r={prevValue:e.value};return void 0===e.value&&n===e.value||(r.value=e.value),r}}]),n}(l.Component);ji.defaultProps={type:"text"};var Ti=ji,Ai=function(e){return l.createElement(v.a,null,(function(t){var n,r=t.getPrefixCls,a=t.direction,o=e.prefixCls,s=e.className,c=void 0===s?"":s,u=r("input-group",o),f=d()(u,(n={},Object(i.a)(n,"".concat(u,"-lg"),"large"===e.size),Object(i.a)(n,"".concat(u,"-sm"),"small"===e.size),Object(i.a)(n,"".concat(u,"-compact"),e.compact),Object(i.a)(n,"".concat(u,"-rtl"),"rtl"===a),n),c);return l.createElement("span",{className:f,style:e.style,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onFocus:e.onFocus,onBlur:e.onBlur},e.children)}))},Pi=n(146),Ni=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i1&&void 0!==arguments[1]&&arguments[1],n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&Hi[n])return Hi[n];var r=window.getComputedStyle(e),i=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),a=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),o=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),s=Bi.map((function(e){return"".concat(e,":").concat(r.getPropertyValue(e))})).join(";"),c={sizingStyle:s,paddingSize:a,borderSize:o,boxSizing:i};return t&&n&&(Hi[n]=c),c}!function(e){e[e.NONE=0]="NONE",e[e.RESIZING=1]="RESIZING",e[e.RESIZED=2]="RESIZED"}(Li||(Li={}));var Vi=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var o;return Object(a.a)(this,n),(o=t.call(this,e)).saveTextArea=function(e){o.textArea=e},o.handleResize=function(e){var t=o.state.resizeStatus,n=o.props,r=n.autoSize,i=n.onResize;t===Li.NONE&&("function"===typeof i&&i(e),r&&o.resizeOnNextFrame())},o.resizeOnNextFrame=function(){cancelAnimationFrame(o.nextFrameActionId),o.nextFrameActionId=requestAnimationFrame(o.resizeTextarea)},o.resizeTextarea=function(){var e=o.props.autoSize;if(e&&o.textArea){var t=e.minRows,n=e.maxRows,r=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;zi||((zi=document.createElement("textarea")).setAttribute("tab-index","-1"),zi.setAttribute("aria-hidden","true"),document.body.appendChild(zi)),e.getAttribute("wrap")?zi.setAttribute("wrap",e.getAttribute("wrap")):zi.removeAttribute("wrap");var i=Fi(e,t),a=i.paddingSize,o=i.borderSize,s=i.boxSizing,c=i.sizingStyle;zi.setAttribute("style","".concat(c,";").concat(Di)),zi.value=e.value||e.placeholder||"";var u,l=Number.MIN_SAFE_INTEGER,f=Number.MAX_SAFE_INTEGER,h=zi.scrollHeight;if("border-box"===s?h+=o:"content-box"===s&&(h-=a),null!==n||null!==r){zi.value=" ";var d=zi.scrollHeight-a;null!==n&&(l=d*n,"border-box"===s&&(l=l+a+o),h=Math.max(l,h)),null!==r&&(f=d*r,"border-box"===s&&(f=f+a+o),u=h>f?"":"hidden",h=Math.min(f,h))}return{height:h,minHeight:l,maxHeight:f,overflowY:u,resize:"none"}}(o.textArea,!1,t,n);o.setState({textareaStyles:r,resizeStatus:Li.RESIZING},(function(){cancelAnimationFrame(o.resizeFrameId),o.resizeFrameId=requestAnimationFrame((function(){o.setState({resizeStatus:Li.RESIZED},(function(){o.resizeFrameId=requestAnimationFrame((function(){o.setState({resizeStatus:Li.NONE}),o.fixFirefoxAutoScroll()}))}))}))}))}},o.renderTextArea=function(){var e=o.props,t=e.prefixCls,n=void 0===t?"rc-textarea":t,a=e.autoSize,s=e.onResize,c=e.className,u=e.disabled,f=o.state,h=f.textareaStyles,v=f.resizeStatus,g=Object(p.a)(o.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),b=d()(n,c,Object(i.a)({},"".concat(n,"-disabled"),u));"value"in g&&(g.value=g.value||"");var y=Object(mt.a)(Object(mt.a)(Object(mt.a)({},o.props.style),h),v===Li.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return l.createElement(m.a,{onResize:o.handleResize,disabled:!(a||s)},l.createElement("textarea",Object(r.a)({},g,{className:b,style:y,ref:o.saveTextArea})))},o.state={textareaStyles:{},resizeStatus:Li.NONE},o}return Object(o.a)(n,[{key:"componentDidMount",value:function(){this.resizeTextarea()}},{key:"componentDidUpdate",value:function(e){e.value!==this.props.value&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var e=this.textArea.selectionStart,t=this.textArea.selectionEnd;this.textArea.setSelectionRange(e,t)}}catch(n){}}},{key:"render",value:function(){return this.renderTextArea()}}]),n}(l.Component),Ui=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r;Object(a.a)(this,n),(r=t.call(this,e)).focus=function(){r.resizableTextArea.textArea.focus()},r.saveTextArea=function(e){r.resizableTextArea=e},r.handleChange=function(e){var t=r.props.onChange;r.setValue(e.target.value,(function(){r.resizableTextArea.resizeTextarea()})),t&&t(e)},r.handleKeyDown=function(e){var t=r.props,n=t.onPressEnter,i=t.onKeyDown;13===e.keyCode&&n&&n(e),i&&i(e)};var i="undefined"===typeof e.value||null===e.value?e.defaultValue:e.value;return r.state={value:i},r}return Object(o.a)(n,[{key:"setValue",value:function(e,t){"value"in this.props||this.setState({value:e},t)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return l.createElement(Vi,Object(r.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(e){return"value"in e?{value:e.value}:null}}]),n}(l.Component),Wi=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0;z=L?Object(g.a)(z).slice(0,h).join(""):z;var I=l.createElement(Oi,Object(r.a)({},w,{prefixCls:N,direction:O,inputType:"text",value:z,element:R,handleReset:function(e){P("",(function(){var e;null===(e=E.current)||void 0===e||e.focus()})),_i(E.current,e,w.onChange)},ref:_,bordered:s}));if(f){var D=Math.min(z.length,null!==h&&void 0!==h?h:1/0),B="";return B="object"===Object(u.a)(f)?f.formatter({count:D,maxLength:h}):"".concat(D).concat(L?" / ".concat(h):""),l.createElement("div",{className:d()("".concat(N,"-textarea"),Object(i.a)({},"".concat(N,"-textarea-rtl"),"rtl"===O),"".concat(N,"-textarea-show-count"),m),style:b,"data-count":B},I)}return I})),Gi=n(145),Ki=n(268),Yi=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i-1}))}function ta(e,t,n,r){return t.map((function(t,i){var a=t[r.label],o=a.indexOf(e)>-1?function(e,t,n){return e.split(t).map((function(e,r){return 0===r?e:[l.createElement("span",{className:"".concat(n,"-menu-item-keyword"),key:"seperator"},t),e]}))}(a,e,n):a;return 0===i?o:[" / ",o]}))}function na(e,t,n,r){function i(e){return e[r.label].indexOf(n)>-1}return e.findIndex(i)-t.findIndex(i)}function ra(e){var t=e.fieldNames||{};return{children:t.children||"children",label:t.label||"label",value:t.value||"value"}}function ia(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=ra(t),i=[],a=r.children;return e.forEach((function(e){var r=n.concat(e);!t.changeOnSelect&&e[a]&&e[a].length||i.push(r),e[a]&&(i=i.concat(ia(e[a],t,r)))})),i}var aa=function(e){return e.join(" / ")};function oa(e,t,n){var r;return r={},Object(i.a)(r,t.value,"ANT_CASCADER_NOT_FOUND"),Object(i.a)(r,t.label,n||e("Cascader")),Object(i.a)(r,"disabled",!0),Object(i.a)(r,"isEmptyNode",!0),r}var sa=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var o;return Object(a.a)(this,n),(o=t.call(this,e)).cachedOptions=[],o.setValue=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];"value"in o.props||o.setState({value:e});var n=o.props.onChange;n&&n(e,t)},o.saveInput=function(e){o.input=e},o.handleChange=function(e,t){if(o.setState({inputValue:""}),t[0].__IS_FILTERED_OPTION){var n=void 0===t[0].__KEEP_FILTERED_OPTION_VALUE?e[0]:t[0].__KEEP_FILTERED_OPTION_VALUE,r=t[0].path;o.setValue(n,r)}else o.setValue(e,t)},o.handlePopupVisibleChange=function(e){"popupVisible"in o.props||o.setState((function(t){return{popupVisible:e,inputFocused:e,inputValue:e?t.inputValue:""}}));var t=o.props.onPopupVisibleChange;t&&t(e)},o.handleInputBlur=function(){o.setState({inputFocused:!1})},o.handleInputClick=function(e){var t=o.state,n=t.inputFocused,r=t.popupVisible;(n||r)&&e.stopPropagation()},o.handleKeyDown=function(e){e.keyCode!==vt.a.BACKSPACE&&e.keyCode!==vt.a.SPACE||e.stopPropagation()},o.handleInputChange=function(e){var t=o.state.popupVisible,n=e.target.value;t||o.handlePopupVisibleChange(!0),o.setState({inputValue:n})},o.clearSelection=function(e){var t=o.state.inputValue;e.preventDefault(),e.stopPropagation(),t?o.setState({inputValue:""}):(o.handlePopupVisibleChange(!1),o.clearSelectionTimeout=setTimeout((function(){o.setValue([])}),200))},o.renderCascader=function(e,t){var n=e.getPopupContainer,a=e.getPrefixCls,s=e.renderEmpty,c=e.direction;return l.createElement(ki.b.Consumer,null,(function(e){var u,f,h,m,v=Object(R.a)(o),g=v.props,b=v.state,y=g.prefixCls,w=g.inputPrefixCls,x=g.children,M=g.placeholder,O=void 0===M?t.placeholder||"Please select":M,k=g.size,E=g.disabled,_=g.className,S=g.style,C=g.allowClear,j=g.showSearch,T=void 0!==j&&j,A=g.suffixIcon,P=g.expandIcon,N=g.notFoundContent,z=g.popupClassName,L=g.bordered,I=g.dropdownRender,D=$i(g,["prefixCls","inputPrefixCls","children","placeholder","size","disabled","className","style","allowClear","showSearch","suffixIcon","expandIcon","notFoundContent","popupClassName","bordered","dropdownRender"]),B=k||e,H=b.value,F=b.inputFocused,V="rtl"===c,U=a("cascader",y),W=a("input",w),q=d()((u={},Object(i.a)(u,"".concat(W,"-lg"),"large"===B),Object(i.a)(u,"".concat(W,"-sm"),"small"===B),u)),G=C&&!E&&H.length>0||b.inputValue?l.createElement(ue.a,{className:"".concat(U,"-picker-clear"),onClick:o.clearSelection}):null,K=d()((f={},Object(i.a)(f,"".concat(U,"-picker-arrow"),!0),Object(i.a)(f,"".concat(U,"-picker-arrow-expand"),b.popupVisible),f)),Y=d()("".concat(U,"-picker"),(h={},Object(i.a)(h,"".concat(U,"-picker-rtl"),V),Object(i.a)(h,"".concat(U,"-picker-with-value"),b.inputValue),Object(i.a)(h,"".concat(U,"-picker-disabled"),E),Object(i.a)(h,"".concat(U,"-picker-").concat(B),!!B),Object(i.a)(h,"".concat(U,"-picker-show-search"),!!T),Object(i.a)(h,"".concat(U,"-picker-focused"),F),Object(i.a)(h,"".concat(U,"-picker-borderless"),!L),h),_),Z=Object(p.a)(D,["onChange","options","popupPlacement","transitionName","displayRender","onPopupVisibleChange","changeOnSelect","expandTrigger","popupVisible","getPopupContainer","loadData","filterOption","renderFilteredOption","sortFilteredOption","fieldNames"]),J=g.options,Q=ra(o.props);J&&J.length>0?b.inputValue&&(J=o.generateFilteredOptions(U,s)):J=[oa(s,Q,N)],b.popupVisible?o.cachedOptions=J:J=o.cachedOptions;var $,ee={},te=1===(J||[]).length&&J[0].isEmptyNode;te&&(ee.height="auto"),!1!==T.matchInputWidth&&(b.inputValue||te)&&o.input&&(ee.width=o.input.input.offsetWidth),$=A?Object(X.c)(A,l.createElement("span",{className:"".concat(U,"-picker-arrow")},A),(function(){var e;return{className:d()((e={},Object(i.a)(e,A.props.className,A.props.className),Object(i.a)(e,"".concat(U,"-picker-arrow"),!0),e))}})):l.createElement(Xe.a,{className:K});var ne,re=x||l.createElement("span",{style:S,className:Y},l.createElement("span",{className:"".concat(U,"-picker-label")},o.getLabel()),l.createElement(Qi,Object(r.a)({},Z,{tabIndex:-1,ref:o.saveInput,prefixCls:W,placeholder:H&&H.length>0?void 0:O,className:"".concat(U,"-input ").concat(q),value:b.inputValue,disabled:E,readOnly:!T,autoComplete:Z.autoComplete||"off",onClick:T?o.handleInputClick:void 0,onBlur:T?o.handleInputBlur:void 0,onKeyDown:o.handleKeyDown,onChange:T?o.handleInputChange:void 0})),G,$);ne=P||(V?l.createElement(bi.a,null):l.createElement(hr.a,null));var ie=l.createElement("span",{className:"".concat(U,"-menu-item-loading-icon")},l.createElement(gi.a,{spin:!0})),ae=g.getPopupContainer||n,oe=Object(p.a)(g,["inputIcon","expandIcon","loadingIcon","bordered","className"]),se=d()(z,(m={},Object(i.a)(m,"".concat(U,"-menu-").concat(c),"rtl"===c),Object(i.a)(m,"".concat(U,"-menu-empty"),1===J.length&&"ANT_CASCADER_NOT_FOUND"===J[0].value),m));return l.createElement(vi,Object(r.a)({},oe,{prefixCls:U,getPopupContainer:ae,options:J,value:H,popupVisible:b.popupVisible,onPopupVisibleChange:o.handlePopupVisibleChange,onChange:o.handleChange,dropdownMenuColumnStyle:ee,expandIcon:ne,loadingIcon:ie,popupClassName:se,popupPlacement:o.getPopupPlacement(c),dropdownRender:I}),re)}))},o.state={value:e.value||e.defaultValue||[],inputValue:"",inputFocused:!1,popupVisible:e.popupVisible,flattenOptions:e.showSearch?ia(e.options,e):void 0,prevProps:e},o}return Object(o.a)(n,[{key:"componentWillUnmount",value:function(){this.clearSelectionTimeout&&clearTimeout(this.clearSelectionTimeout)}},{key:"getLabel",value:function(){var e=this.props,t=e.options,n=e.displayRender,r=void 0===n?aa:n,i=ra(this.props),a=this.state.value,o=Array.isArray(a[0])?a[0]:a,s=fi()(t,(function(e,t){return e[i.value]===o[t]}),{childrenKeyName:i.children});return r(s.length?s.map((function(e){return e[i.label]})):a,s)}},{key:"generateFilteredOptions",value:function(e,t){var n,r=this,a=this.props,o=a.showSearch,s=a.notFoundContent,c=ra(this.props),u=o.filter,l=void 0===u?ea:u,f=o.render,h=void 0===f?ta:f,d=o.sort,p=void 0===d?na:d,m=o.limit,v=void 0===m?50:m,g=this.state,b=g.flattenOptions,y=void 0===b?[]:b,w=g.inputValue;if(v>0){n=[];var x=0;y.some((function(e){return l(r.state.inputValue,e,c)&&(n.push(e),x+=1),x>=v}))}else Object(Y.a)("number"!==typeof v,"Cascader","'limit' of showSearch should be positive number or false."),n=y.filter((function(e){return l(r.state.inputValue,e,c)}));if((n=n.sort((function(e,t){return p(e,t,w,c)}))).length>0){var M=c.value===c.label?"__KEEP_FILTERED_OPTION_VALUE":c.value;return n.map((function(t){var n;return n={__IS_FILTERED_OPTION:!0,path:t},Object(i.a)(n,M,t.map((function(e){return e[c.value]}))),Object(i.a)(n,c.label,h(w,t,e,c)),Object(i.a)(n,"disabled",t.some((function(e){return!!e.disabled}))),Object(i.a)(n,"isEmptyNode",!0),n}))}return[oa(t,c,s)]}},{key:"focus",value:function(){this.input.focus()}},{key:"blur",value:function(){this.input.blur()}},{key:"getPopupPlacement",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"ltr",t=this.props.popupPlacement;return void 0!==t?t:"rtl"===e?"bottomRight":"bottomLeft"}},{key:"render",value:function(){var e=this;return l.createElement(v.a,null,(function(t){return l.createElement(Xn.a,null,(function(n){return e.renderCascader(t,n)}))}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,r={prevProps:e};return"value"in e&&(r.value=e.value||[]),"popupVisible"in e&&(r.popupVisible=e.popupVisible),e.showSearch&&n.options!==e.options&&(r.flattenOptions=ia(e.options,e)),r}}]),n}(l.Component);sa.defaultProps={transitionName:"slide-up",options:[],disabled:!1,allowClear:!0,bordered:!0};var ca=sa,ua=n(114),la=n(95),fa=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);in)&&(r=Object(X.a)(e,{span:n}),Object(Y.a)(void 0===t,"Descriptions","Sum of column `span` in a line not match `column` of Descriptions.")),r}function Va(e){var t,n=e.prefixCls,r=e.title,a=e.extra,o=e.column,s=void 0===o?Ha:o,c=e.colon,f=void 0===c||c,h=e.bordered,p=e.layout,m=e.children,g=e.className,b=e.style,y=e.size,w=e.labelStyle,x=e.contentStyle,M=l.useContext(v.b),O=M.getPrefixCls,k=M.direction,E=O("descriptions",n),_=l.useState({}),S=Object(q.a)(_,2),C=S[0],j=S[1],T=function(e,t){if("number"===typeof e)return e;if("object"===Object(u.a)(e))for(var n=0;n0?"-".concat(h):h,x=!!m,M=d()(y,"".concat(y,"-").concat(u),(n={},Object(i.a)(n,"".concat(y,"-with-text"),x),Object(i.a)(n,"".concat(y,"-with-text").concat(w),x),Object(i.a)(n,"".concat(y,"-dashed"),!!v),Object(i.a)(n,"".concat(y,"-plain"),!!g),Object(i.a)(n,"".concat(y,"-rtl"),"rtl"===o),n),p);return l.createElement("div",Object(r.a)({className:M},b,{role:"separator"}),m&&l.createElement("span",{className:"".concat(y,"-inner-text")},m))}))},Ga=n(139),Ka=n(297),Ya=n(107),Xa=n(304),Za=n(92),Ja=n(93);var Qa=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return{};var n=t.element,r=void 0===n?document.body:n,i={},a=Object.keys(e);return a.forEach((function(e){i[e]=r.style[e]})),a.forEach((function(t){r.style[t]=e[t]})),i};var $a={},eo=function(e){if(document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth||e){var t=new RegExp("".concat("ant-scrolling-effect"),"g"),n=document.body.className;if(e){if(!t.test(n))return;return Qa($a),$a={},void(document.body.className=n.replace(t,"").trim())}var r=Object(Ja.a)();if(r&&($a=Qa({position:"relative",width:"calc(100% - ".concat(r,"px)")}),!t.test(n))){var i="".concat(n," ").concat("ant-scrolling-effect");document.body.className=i.trim()}}},to=[],no=new RegExp("".concat("ant-scrolling-effect"),"g"),ro=0,io=new Map,ao=function e(t){var n=this;Object(a.a)(this,e),this.getContainer=function(){var e;return null===(e=n.options)||void 0===e?void 0:e.container},this.reLock=function(e){var t=to.find((function(e){return e.target===n.lockTarget}));t&&n.unLock(),n.options=e,t&&(t.options=e,n.lock())},this.lock=function(){var e;if(!to.some((function(e){return e.target===n.lockTarget})))if(to.some((function(e){var t,r=e.options;return(null===r||void 0===r?void 0:r.container)===(null===(t=n.options)||void 0===t?void 0:t.container)})))to=[].concat(Object(g.a)(to),[{target:n.lockTarget,options:n.options}]);else{var t=0,r=(null===(e=n.options)||void 0===e?void 0:e.container)||document.body;(r===document.body&&window.innerWidth-document.documentElement.clientWidth>0||r.scrollHeight>r.clientHeight)&&(t=Object(Ja.a)());var i=r.className;if(0===to.filter((function(e){var t,r=e.options;return(null===r||void 0===r?void 0:r.container)===(null===(t=n.options)||void 0===t?void 0:t.container)})).length&&io.set(r,Qa({width:"calc(100% - ".concat(t,"px)"),overflow:"hidden",overflowX:"hidden",overflowY:"hidden"},{element:r})),!no.test(i)){var a="".concat(i," ").concat("ant-scrolling-effect");r.className=a.trim()}to=[].concat(Object(g.a)(to),[{target:n.lockTarget,options:n.options}])}},this.unLock=function(){var e,t=to.find((function(e){return e.target===n.lockTarget}));if(to=to.filter((function(e){return e.target!==n.lockTarget})),t&&!to.some((function(e){var n,r=e.options;return(null===r||void 0===r?void 0:r.container)===(null===(n=t.options)||void 0===n?void 0:n.container)}))){var r=(null===(e=n.options)||void 0===e?void 0:e.container)||document.body,i=r.className;no.test(i)&&(Qa(io.get(r),{element:r}),io.delete(r),r.className=r.className.replace(no,"").trim())}},this.lockTarget=ro++,this.options=t};function oo(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(Ya.a)(e);if(t){var i=Object(Ya.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(Ka.a)(this,n)}}var so=0,co=Object(Za.a)();var uo={},lo=function(e){if(!co)return null;if(e){if("string"===typeof e)return document.querySelectorAll(e)[0];if("function"===typeof e)return e();if("object"===Object(u.a)(e)&&e instanceof window.HTMLElement)return e}return document.body},fo=function(e){Object(s.a)(n,e);var t=oo(n);function n(e){var r;return Object(a.a)(this,n),(r=t.call(this,e)).componentRef=l.createRef(),r.updateScrollLocker=function(e){var t=(e||{}).visible,n=r.props,i=n.getContainer,a=n.visible;a&&a!==t&&co&&lo(i)!==r.scrollLocker.getContainer()&&r.scrollLocker.reLock({container:lo(i)})},r.updateOpenCount=function(e){var t=e||{},n=t.visible,i=t.getContainer,a=r.props,o=a.visible,s=a.getContainer;o!==n&&co&&lo(s)===document.body&&(o&&!n?so+=1:e&&(so-=1)),("function"===typeof s&&"function"===typeof i?s.toString()!==i.toString():s!==i)&&r.removeCurrentContainer()},r.attachToParent=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||r.container&&!r.container.parentNode){var t=lo(r.props.getContainer);return!!t&&(t.appendChild(r.container),!0)}return!0},r.getContainer=function(){return co?(r.container||(r.container=document.createElement("div"),r.attachToParent(!0)),r.setWrapperClassName(),r.container):null},r.setWrapperClassName=function(){var e=r.props.wrapperClassName;r.container&&e&&e!==r.container.className&&(r.container.className=e)},r.removeCurrentContainer=function(){var e,t;null===(e=r.container)||void 0===e||null===(t=e.parentNode)||void 0===t||t.removeChild(r.container)},r.switchScrollingEffect=function(){1!==so||Object.keys(uo).length?so||(Qa(uo),uo={},eo(!0)):(eo(),uo=Qa({overflow:"hidden",overflowX:"hidden",overflowY:"hidden"}))},r.scrollLocker=new ao({container:lo(e.getContainer)}),r}return Object(o.a)(n,[{key:"componentDidMount",value:function(){var e=this;this.updateOpenCount(),this.attachToParent()||(this.rafId=Object(b.a)((function(){e.forceUpdate()})))}},{key:"componentDidUpdate",value:function(e){this.updateOpenCount(e),this.updateScrollLocker(e),this.setWrapperClassName(),this.attachToParent()}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.visible,n=e.getContainer;co&&lo(n)===document.body&&(so=t&&so?so-1:so),this.removeCurrentContainer(),b.a.cancel(this.rafId)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.forceRender,r=e.visible,i=null,a={getOpenCount:function(){return so},getContainer:this.getContainer,switchScrollingEffect:this.switchScrollingEffect,scrollLocker:this.scrollLocker};return(n||r||this.componentRef.current)&&(i=l.createElement(Xa.a,{getContainer:this.getContainer,ref:this.componentRef},t(a))),i}}]),n}(l.Component);var ho={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},po=Object.keys(ho).filter((function(e){if("undefined"===typeof document)return!1;var t=document.getElementsByTagName("html")[0];return e in(t?t.style:{})}))[0],mo=ho[po];function vo(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),n)}function go(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r):e.attachEvent&&e.detachEvent("on".concat(t),n)}var bo=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},yo=!("undefined"!==typeof window&&window.document&&window.document.createElement),wo={},xo=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r;return Object(a.a)(this,n),(r=t.call(this,e)).domFocus=function(){r.dom&&r.dom.focus()},r.removeStartHandler=function(e){e.touches.length>1||(r.startPos={x:e.touches[0].clientX,y:e.touches[0].clientY})},r.removeMoveHandler=function(e){if(!(e.changedTouches.length>1)){var t=e.currentTarget,n=e.changedTouches[0].clientX-r.startPos.x,i=e.changedTouches[0].clientY-r.startPos.y;(t===r.maskDom||t===r.handlerDom||t===r.contentDom&&function e(t,n,r,i){if(!n||n===document||n instanceof Document)return!1;if(n===t.parentNode)return!0;var a=Math.max(Math.abs(r),Math.abs(i))===Math.abs(i),o=Math.max(Math.abs(r),Math.abs(i))===Math.abs(r),s=n.scrollHeight-n.clientHeight,c=n.scrollWidth-n.clientWidth,u=document.defaultView.getComputedStyle(n),l="auto"===u.overflowY||"scroll"===u.overflowY,f="auto"===u.overflowX||"scroll"===u.overflowX,h=s&&l,d=c&&f;return!!(a&&(!h||h&&(n.scrollTop>=s&&i<0||n.scrollTop<=0&&i>0))||o&&(!d||d&&(n.scrollLeft>=c&&r<0||n.scrollLeft<=0&&r>0)))&&e(t,n.parentNode,r,i)}(t,e.target,n,i))&&e.cancelable&&e.preventDefault()}},r.transitionEnd=function(e){var t=e.target;go(t,mo,r.transitionEnd),t.style.transition=""},r.onKeyDown=function(e){if(e.keyCode===vt.a.ESC){var t=r.props.onClose;e.stopPropagation(),t&&t(e)}},r.onWrapperTransitionEnd=function(e){var t=r.props,n=t.open,i=t.afterVisibleChange;e.target===r.contentWrapper&&e.propertyName.match(/transform$/)&&(r.dom.style.transition="",!n&&r.getCurrentDrawerSome()&&(document.body.style.overflowX="",r.maskDom&&(r.maskDom.style.left="",r.maskDom.style.width="")),i&&i(!!n))},r.openLevelTransition=function(){var e=r.props,t=e.open,n=e.width,i=e.height,a=r.getHorizontalBoolAndPlacementName(),o=a.isHorizontal,s=a.placementName,c=r.contentDom?r.contentDom.getBoundingClientRect()[o?"width":"height"]:0,u=(o?n:i)||c;r.setLevelAndScrolling(t,s,u)},r.setLevelTransform=function(e,t,n,i){var a=r.props,o=a.placement,s=a.levelMove,c=a.duration,u=a.ease,l=a.showMask;r.levelDom.forEach((function(a){a.style.transition="transform ".concat(c," ").concat(u),vo(a,mo,r.transitionEnd);var f=e?n:0;if(s){var h=function(e,t){var n="function"===typeof e?e(t):e;return Array.isArray(n)?2===n.length?n:[n[0],n[1]]:[n]}(s,{target:a,open:e});f=e?h[0]:h[1]||0}var d="number"===typeof f?"".concat(f,"px"):f,p="left"===o||"top"===o?d:"-".concat(d);p=l&&"right"===o&&i?"calc(".concat(p," + ").concat(i,"px)"):p,a.style.transform=f?"".concat(t,"(").concat(p,")"):""}))},r.setLevelAndScrolling=function(e,t,n){var i=r.props.onChange;if(!yo){var a=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(Ja.a)(!0):0;r.setLevelTransform(e,t,n,a),r.toggleScrollingToDrawerAndBody(a)}i&&i(e)},r.toggleScrollingToDrawerAndBody=function(e){var t=r.props,n=t.getContainer,i=t.showMask,a=t.open,o=n&&n();if(o&&o.parentNode===document.body&&i){var s=["touchstart"],c=[document.body,r.maskDom,r.handlerDom,r.contentDom];a&&"hidden"!==document.body.style.overflow?(e&&r.addScrollingEffect(e),document.body.style.touchAction="none",c.forEach((function(e,t){e&&vo(e,s[t]||"touchmove",t?r.removeMoveHandler:r.removeStartHandler,r.passive)}))):r.getCurrentDrawerSome()&&(document.body.style.touchAction="",e&&r.remScrollingEffect(e),c.forEach((function(e,t){e&&go(e,s[t]||"touchmove",t?r.removeMoveHandler:r.removeStartHandler,r.passive)})))}},r.addScrollingEffect=function(e){var t=r.props,n=t.placement,i=t.duration,a=t.ease,o="width ".concat(i," ").concat(a),s="transform ".concat(i," ").concat(a);switch(r.dom.style.transition="none",n){case"right":r.dom.style.transform="translateX(-".concat(e,"px)");break;case"top":case"bottom":r.dom.style.width="calc(100% - ".concat(e,"px)"),r.dom.style.transform="translateZ(0)"}clearTimeout(r.timeout),r.timeout=setTimeout((function(){r.dom&&(r.dom.style.transition="".concat(s,",").concat(o),r.dom.style.width="",r.dom.style.transform="")}))},r.remScrollingEffect=function(e){var t,n=r.props,i=n.placement,a=n.duration,o=n.ease;po&&(document.body.style.overflowX="hidden"),r.dom.style.transition="none";var s="width ".concat(a," ").concat(o),c="transform ".concat(a," ").concat(o);switch(i){case"left":r.dom.style.width="100%",s="width 0s ".concat(o," ").concat(a);break;case"right":r.dom.style.transform="translateX(".concat(e,"px)"),r.dom.style.width="100%",s="width 0s ".concat(o," ").concat(a),r.maskDom&&(r.maskDom.style.left="-".concat(e,"px"),r.maskDom.style.width="calc(100% + ".concat(e,"px)"));break;case"top":case"bottom":r.dom.style.width="calc(100% + ".concat(e,"px)"),r.dom.style.height="100%",r.dom.style.transform="translateZ(0)",t="height 0s ".concat(o," ").concat(a)}clearTimeout(r.timeout),r.timeout=setTimeout((function(){r.dom&&(r.dom.style.transition="".concat(c,",").concat(t?"".concat(t,","):"").concat(s),r.dom.style.transform="",r.dom.style.width="",r.dom.style.height="")}))},r.getCurrentDrawerSome=function(){return!Object.keys(wo).some((function(e){return wo[e]}))},r.getLevelDom=function(e){var t=e.level,n=e.getContainer;if(!yo){var i,a=n&&n(),o=a?a.parentNode:null;if(r.levelDom=[],"all"===t)(o?Array.prototype.slice.call(o.children):[]).forEach((function(e){"SCRIPT"!==e.nodeName&&"STYLE"!==e.nodeName&&"LINK"!==e.nodeName&&e!==a&&r.levelDom.push(e)}));else t&&(i=t,Array.isArray(i)?i:[i]).forEach((function(e){document.querySelectorAll(e).forEach((function(e){r.levelDom.push(e)}))}))}},r.getHorizontalBoolAndPlacementName=function(){var e=r.props.placement,t="left"===e||"right"===e;return{isHorizontal:t,placementName:"translate".concat(t?"X":"Y")}},r.state={_self:Object(R.a)(r)},r}return Object(o.a)(n,[{key:"componentDidMount",value:function(){var e=this;if(!yo){var t=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return t=!0,null}}))}catch(s){}this.passive=!!t&&{passive:!1}}var n,r=this.props,i=r.open,a=r.getContainer,o=a&&a();(this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(9*Math.random()).toString())).toString(16)),this.getLevelDom(this.props),i)&&(o&&o.parentNode===document.body&&(wo[this.drawerId]=i),this.openLevelTransition(),this.forceUpdate((function(){e.domFocus()})),null===(n=this.props.scrollLocker)||void 0===n||n.lock())}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.open,r=t.getContainer,i=t.scrollLocker,a=r&&r();n!==e.open&&(a&&a.parentNode===document.body&&(wo[this.drawerId]=!!n),this.openLevelTransition(),n?(this.domFocus(),null===i||void 0===i||i.lock()):null===i||void 0===i||i.unLock())}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.open,n=e.scrollLocker;delete wo[this.drawerId],t&&(this.setLevelTransform(!1),document.body.style.touchAction=""),null===n||void 0===n||n.unLock()}},{key:"render",value:function(){var e,t=this,n=this.props,a=n.className,o=n.children,s=n.style,c=n.width,u=n.height,f=(n.defaultOpen,n.open),h=n.prefixCls,m=n.placement,v=(n.level,n.levelMove,n.ease,n.duration,n.getContainer,n.handler),g=(n.onChange,n.afterVisibleChange,n.showMask),b=n.maskClosable,y=n.maskStyle,w=n.onClose,x=n.onHandleClick,M=n.keyboard,O=(n.getOpenCount,n.scrollLocker,Object(yr.a)(n,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","scrollLocker"])),k=!!this.dom&&f,E=d()(h,(e={},Object(i.a)(e,"".concat(h,"-").concat(m),!0),Object(i.a)(e,"".concat(h,"-open"),k),Object(i.a)(e,a||"",!!a),Object(i.a)(e,"no-mask",!g),e)),_=this.getHorizontalBoolAndPlacementName().placementName,S="left"===m||"top"===m?"-100%":"100%",C=k?"":"".concat(_,"(").concat(S,")"),j=v&&l.cloneElement(v,{onClick:function(e){v.props.onClick&&v.props.onClick(),x&&x(e)},ref:function(e){t.handlerDom=e}});return l.createElement("div",Object(r.a)({},Object(p.a)(O,["switchScrollingEffect"]),{tabIndex:-1,className:E,style:s,ref:function(e){t.dom=e},onKeyDown:k&&M?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),g&&l.createElement("div",{className:"".concat(h,"-mask"),onClick:b?w:void 0,style:y,ref:function(e){t.maskDom=e}}),l.createElement("div",{className:"".concat(h,"-content-wrapper"),style:{transform:C,msTransform:C,width:bo(c)?"".concat(c,"px"):c,height:bo(u)?"".concat(u,"px"):u},ref:function(e){t.contentWrapper=e}},l.createElement("div",{className:"".concat(h,"-content"),ref:function(e){t.contentDom=e},onTouchStart:k&&g?this.removeStartHandler:void 0,onTouchMove:k&&g?this.removeMoveHandler:void 0},o),j))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,r=t._self,i={prevProps:e};if(void 0!==n){var a=e.placement,o=e.level;a!==n.placement&&(r.contentDom=null),o!==n.level&&r.getLevelDom(e)}return i}}]),n}(l.Component),Mo=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r;Object(a.a)(this,n),(r=t.call(this,e)).onHandleClick=function(e){var t=r.props,n=t.onHandleClick,i=t.open;if(n&&n(e),"undefined"===typeof i){var a=r.state.open;r.setState({open:!a})}},r.onClose=function(e){var t=r.props,n=t.onClose,i=t.open;n&&n(e),"undefined"===typeof i&&r.setState({open:!1})};var i="undefined"!==typeof e.open?e.open:!!e.defaultOpen;return r.state={open:i},"onMaskClick"in e&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),r}return Object(o.a)(n,[{key:"render",value:function(){var e=this,t=this.props,n=(t.defaultOpen,t.getContainer),i=t.wrapperClassName,a=t.forceRender,o=t.handler,s=Object(yr.a)(t,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),c=this.state.open;if(!n)return l.createElement("div",{className:i,ref:function(t){e.dom=t}},l.createElement(xo,Object(r.a)({},s,{open:c,handler:o,getContainer:function(){return e.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var u=!!o||a;return l.createElement(fo,{visible:c,forceRender:u,getContainer:n,wrapperClassName:i},(function(t){var n=t.visible,i=t.afterClose,a=Object(yr.a)(t,["visible","afterClose"]);return l.createElement(xo,Object(r.a)({},s,a,{open:void 0!==n?n:c,afterVisibleChange:void 0!==i?i:s.afterVisibleChange,handler:o,onClose:e.onClose,onHandleClick:e.onHandleClick}))}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,r={prevProps:e};return"undefined"!==typeof n&&e.open!==n.open&&(r.open=e.open),r}}]),n}(l.Component);Mo.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:l.createElement("div",{className:"drawer-handle"},l.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var Oo=Mo,ko=n(86),Eo=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);it||a>e&&o=t&&s>=n?a-e-r:o>t&&sn?o-t+i:0}var Ho=function(e,t){var n=window,r=t.scrollMode,i=t.block,a=t.inline,o=t.boundary,s=t.skipOverflowHiddenElements,c="function"==typeof o?o:function(e){return e!==o};if(!Lo(e))throw new TypeError("Invalid target");for(var u=document.scrollingElement||document.documentElement,l=[],f=e;Lo(f)&&c(f);){if((f=f.parentNode)===u){l.push(f);break}f===document.body&&Do(f)&&!Do(document.documentElement)||Do(f,s)&&l.push(f)}for(var h=n.visualViewport?n.visualViewport.width:innerWidth,d=n.visualViewport?n.visualViewport.height:innerHeight,p=window.scrollX||pageXOffset,m=window.scrollY||pageYOffset,v=e.getBoundingClientRect(),g=v.height,b=v.width,y=v.top,w=v.right,x=v.bottom,M=v.left,O="start"===i||"nearest"===i?y:"end"===i?x:y+g/2,k="center"===a?M+b/2:"end"===a?w:M,E=[],_=0;_=0&&M>=0&&x<=d&&w<=h&&y>=A&&x<=N&&M>=R&&w<=P)return E;var z=getComputedStyle(S),L=parseInt(z.borderLeftWidth,10),I=parseInt(z.borderTopWidth,10),D=parseInt(z.borderRightWidth,10),B=parseInt(z.borderBottomWidth,10),H=0,F=0,V="offsetWidth"in S?S.offsetWidth-S.clientWidth-L-D:0,U="offsetHeight"in S?S.offsetHeight-S.clientHeight-I-B:0;if(u===S)H="start"===i?O:"end"===i?O-d:"nearest"===i?Bo(m,m+d,d,I,B,m+O,m+O+g,g):O-d/2,F="start"===a?k:"center"===a?k-h/2:"end"===a?k-h:Bo(p,p+h,h,L,D,p+k,p+k+b,b),H=Math.max(0,H+m),F=Math.max(0,F+p);else{H="start"===i?O-A-I:"end"===i?O-N+B+U:"nearest"===i?Bo(A,N,j,I,B+U,O,O+g,g):O-(A+j/2)+U/2,F="start"===a?k-R-L:"center"===a?k-(R+T/2)+V/2:"end"===a?k-P+D+V:Bo(R,P,T,L,D+V,k,k+b,b);var W=S.scrollLeft,q=S.scrollTop;O+=q-(H=Math.max(0,Math.min(q+H,S.scrollHeight-j+U))),k+=W-(F=Math.max(0,Math.min(W+F,S.scrollWidth-T+V)))}E.push({el:S,top:H,left:F})}return E};function Fo(e){return e===Object(e)&&0!==Object.keys(e).length}var Vo=function(e,t){var n=!e.ownerDocument.documentElement.contains(e);if(Fo(t)&&"function"===typeof t.behavior)return t.behavior(n?[]:Ho(e,t));if(!n){var r=function(e){return!1===e?{block:"end",inline:"nearest"}:Fo(e)?e:{block:"start",inline:"nearest"}}(t);return function(e,t){void 0===t&&(t="auto");var n="scrollBehavior"in document.body.style;e.forEach((function(e){var r=e.el,i=e.top,a=e.left;r.scroll&&n?r.scroll({top:i,left:a,behavior:t}):(r.scrollTop=i,r.scrollLeft=a)}))}(Ho(e,r),r.behavior)}};function Uo(e){return void 0===e||!1===e?[]:Array.isArray(e)?e:[e]}function Wo(e,t){if(e.length){var n=e.join("_");return t?"".concat(t,"_").concat(n):n}}function qo(e){return Uo(e).join("_")}function Go(e){var t=Object(Po.e)(),n=Object(q.a)(t,1)[0],i=l.useRef({}),a=l.useMemo((function(){return e||Object(r.a)(Object(r.a)({},n),{__INTERNAL__:{itemRef:function(e){return function(t){var n=qo(e);t?i.current[n]=t:delete i.current[n]}}},scrollToField:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Uo(e),i=Wo(n,a.__INTERNAL__.name),o=i?document.getElementById(i):null;o&&Vo(o,Object(r.a)({scrollMode:"if-needed",block:"nearest"},t))},getFieldInstance:function(e){var t=qo(e);return i.current[t]}})}),[e,n]);return[a]}var Ko=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0&&void 0!==arguments[0]?arguments[0]:{};return n!==e&&delete a[n],Jo()(a[e],t)?a:Object(r.a)(Object(r.a)({},a),Object(i.a)({},e,t))}))},te=function(){var e=l.useContext(No).itemRef,t=l.useRef({});return function(n,r){var i=r&&"object"===Object(u.a)(r)&&r.ref,a=n.join("_");return t.current.name===a&&t.current.originRef===i||(t.current.name=a,t.current.originRef=i,t.current.ref=Object(ge.a)(e(n),i)),t.current.ref}}();function ne(t,n,o,s){var u,h;if(a&&!j)return t;var v,b=[];Object.keys(U).forEach((function(e){b=[].concat(Object(g.a)(b),Object(g.a)(U[e]||[]))})),void 0!==y&&null!==y?v=Uo(y):(v=o?o.errors:[],v=[].concat(Object(g.a)(v),Object(g.a)(b)));var w="";void 0!==x?w=x:(null===o||void 0===o?void 0:o.validating)?w="validating":(null===(h=null===o||void 0===o?void 0:o.errors)||void 0===h?void 0:h.length)||b.length?w="error":(null===o||void 0===o?void 0:o.touched)&&(w="success");var M=(u={},Object(i.a)(u,"".concat($,"-item"),!0),Object(i.a)(u,"".concat($,"-item-with-help"),B||y),Object(i.a)(u,"".concat(f),!!f),Object(i.a)(u,"".concat($,"-item-has-feedback"),w&&m),Object(i.a)(u,"".concat($,"-item-has-success"),"success"===w),Object(i.a)(u,"".concat($,"-item-has-warning"),"warning"===w),Object(i.a)(u,"".concat($,"-item-has-error"),"error"===w),Object(i.a)(u,"".concat($,"-item-is-validating"),"validating"===w),Object(i.a)(u,"".concat($,"-item-hidden"),j),u);return l.createElement($o.a,Object(r.a)({className:d()(M),style:c,key:"row"},Object(p.a)(T,["colon","extra","getValueFromEvent","getValueProps","htmlFor","id","initialValue","isListField","labelAlign","labelCol","normalize","preserve","tooltip","validateFirst","valuePropName","wrapperCol","_internalItemRender"])),l.createElement(is,Object(r.a)({htmlFor:n,required:s,requiredMark:z},e,{prefixCls:$})),l.createElement(us,Object(r.a)({},e,o,{errors:v,prefixCls:$,status:w,onDomErrorVisibleChange:Z,validateStatus:w}),l.createElement(Ro.Provider,{value:{updateItemErrors:ee}},t)))}var re="function"===typeof M,ie=Object(l.useRef)(0);if(ie.current+=1,!J&&!re&&!o)return ne(M);var ae={};return"string"===typeof k&&(ae.label=k),E&&(ae=Object(r.a)(Object(r.a)({},ae),E)),l.createElement(Po.a,Object(r.a)({},e,{messageVariables:ae,trigger:S,validateTrigger:K,onReset:function(){Z(!1)}}),(function(i,s,c){var f=s.errors,d=Uo(t).length&&s?s.name:[],p=Wo(d,R);if(a){var m=Q.current.join("__SPLIT__");if(Q.current=Object(g.a)(d),n){var v=Array.isArray(n)?n:[n];Q.current=[].concat(Object(g.a)(d.slice(0,-1)),Object(g.a)(v))}L(Q.current.join("__SPLIT__"),f,m)}var b=void 0!==O?O:!(!w||!w.some((function(e){if(e&&"object"===Object(u.a)(e)&&e.required)return!0;if("function"===typeof e){var t=e(c);return t&&t.required}return!1}))),y=Object(r.a)({},i),x=null;if(Object(Y.a)(!(h&&o),"Form.Item","`shouldUpdate` and `dependencies` shouldn't be used together. See https://ant.design/components/form/#dependencies."),Array.isArray(M)&&J)Object(Y.a)(!1,"Form.Item","`children` is array of render props cannot have `name`."),x=M;else if(re&&(!h&&!o||J))Object(Y.a)(!(!h&&!o),"Form.Item","`children` of render props only work with `shouldUpdate` or `dependencies`."),Object(Y.a)(!J,"Form.Item","Do not use `name` with `children` of render props since it's not a field.");else if(!o||re||J)if(Object(X.b)(M)){Object(Y.a)(void 0===M.props.defaultValue,"Form.Item","`defaultValue` will not work on controlled Field. You should use `initialValues` of Form instead.");var k=Object(r.a)(Object(r.a)({},M.props),y);k.id||(k.id=p),Object(ge.c)(M)&&(k.ref=te(d,M)),new Set([].concat(Object(g.a)(Uo(S)),Object(g.a)(Uo(K)))).forEach((function(e){k[e]=function(){for(var t,n,r,i,a,o=arguments.length,s=new Array(o),c=0;cr){if(t>0)return Object(i.a)({},e,o);if(t<0&&ar)return Object(i.a)({},e,t<0?o:-o);return{}}var Ps=l.createContext({previewUrls:new Map,setPreviewUrls:function(){return null},current:null,setCurrent:function(){return null},setShowPreview:function(){return null},setMousePosition:function(){return null},registerImage:function(){return function(){return null}}}),Ns=Ps.Provider,Rs=function(e){var t=e.previewPrefixCls,n=void 0===t?"rc-image-preview":t,r=e.children,i=e.icons,a=void 0===i?{}:i,o=e.preview,s="object"===Object(u.a)(o)?o:{},c=s.visible,f=void 0===c?void 0:c,h=s.onVisibleChange,d=void 0===h?void 0:h,p=s.getContainer,m=void 0===p?void 0:p,v=s.current,g=void 0===v?0:v,b=Object(l.useState)(new Map),y=Object(q.a)(b,2),w=y[0],x=y[1],M=Object(l.useState)(),O=Object(q.a)(M,2),k=O[0],E=O[1],_=Object(ze.a)(!!f,{value:f,onChange:d}),S=Object(q.a)(_,2),C=S[0],j=S[1],T=Object(l.useState)(null),A=Object(q.a)(T,2),P=A[0],N=A[1],R=void 0!==f,z=Array.from(w.keys())[g];return l.useEffect((function(){E(z)}),[z]),l.useEffect((function(){!C&&R&&E(z)}),[z,R,C]),l.createElement(Ns,{value:{isPreviewGroup:!0,previewUrls:w,setPreviewUrls:x,current:k,setCurrent:E,setShowPreview:j,setMousePosition:N,registerImage:function(e,t){var n=function(){x((function(t){var n=new Map(t);return n.delete(e)?n:t}))};return w.get(e)===t||x((function(n){return new Map(n).set(e,t)})),n}}},r,l.createElement(Ds,{"aria-hidden":!C,visible:C,prefixCls:n,onClose:function(e){e.stopPropagation(),j(!1),N(null)},mousePosition:P,src:w.get(k),icons:a,getContainer:m}))},zs=l.useState,Ls=l.useEffect,Is={x:0,y:0},Ds=function(e){var t=e.prefixCls,n=e.src,a=e.alt,o=e.onClose,s=(e.afterClose,e.visible),c=e.icons,u=void 0===c?{}:c,f=Object(yr.a)(e,["prefixCls","src","alt","onClose","afterClose","visible","icons"]),h=u.rotateLeft,p=u.rotateRight,m=u.zoomIn,v=u.zoomOut,g=u.close,y=u.left,w=u.right,M=zs(1),O=Object(q.a)(M,2),k=O[0],E=O[1],_=zs(0),S=Object(q.a)(_,2),C=S[0],j=S[1],T=function(e){var t=l.useRef(null),n=l.useState(e),r=Object(q.a)(n,2),i=r[0],a=r[1],o=l.useRef([]);return l.useEffect((function(){return function(){return t.current&&b.a.cancel(t.current)}}),[]),[i,function(e){null===t.current&&(o.current=[],t.current=Object(b.a)((function(){a((function(e){var n=e;return o.current.forEach((function(e){n=Object(mt.a)(Object(mt.a)({},n),e)})),t.current=null,n}))}))),o.current.push(e)}]}(Is),A=Object(q.a)(T,2),P=A[0],N=A[1],R=l.useRef(),z=l.useRef({originX:0,originY:0,deltaX:0,deltaY:0}),L=l.useState(!1),I=Object(q.a)(L,2),D=I[0],B=I[1],H=l.useContext(Ps),F=H.previewUrls,V=H.current,U=H.isPreviewGroup,W=H.setCurrent,G=F.size,K=Array.from(F.keys()),Y=K.indexOf(V),X=U?F.get(V):n,Z=U&&G>1,J=l.useState({wheelDirection:0}),Q=Object(q.a)(J,2),$=Q[0],ee=Q[1],te=function(){E((function(e){return e+1})),N(Is)},ne=function(){k>1&&E((function(e){return e-1})),N(Is)},re=d()(Object(i.a)({},"".concat(t,"-moving"),D)),ie="".concat(t,"-operations-operation"),ae="".concat(t,"-operations-icon"),oe=[{icon:g,onClick:o,type:"close"},{icon:m,onClick:te,type:"zoomIn"},{icon:v,onClick:ne,type:"zoomOut",disabled:1===k},{icon:p,onClick:function(){j((function(e){return e+90}))},type:"rotateRight"},{icon:h,onClick:function(){j((function(e){return e-90}))},type:"rotateLeft"}],se=function(){if(s&&D){var e=R.current.offsetWidth*k,t=R.current.offsetHeight*k,n=R.current.getBoundingClientRect(),r=n.left,i=n.top,a=C%180!==0;B(!1);var o=function(e,t,n,r){var i=Object(bs.a)(),a=i.width,o=i.height,s=null;return e<=a&&t<=o?s={x:0,y:0}:(e>a||t>o)&&(s=Object(mt.a)(Object(mt.a)({},As("x",n,e,a)),As("y",r,t,o))),s}(a?t:e,a?e:t,r,i);o&&N(Object(mt.a)({},o))}},ce=function(e){s&&D&&N({x:e.pageX-z.current.deltaX,y:e.pageY-z.current.deltaY})},ue=function(e){if(s){e.preventDefault();var t=e.deltaY;ee({wheelDirection:t})}};return Ls((function(){var e=$.wheelDirection;e>0?ne():e<0&&te()}),[$]),Ls((function(){var e,t,n=Object(x.a)(window,"mouseup",se,!1),r=Object(x.a)(window,"mousemove",ce,!1),i=Object(x.a)(window,"wheel",ue,{passive:!1});try{window.top!==window.self&&(e=Object(x.a)(window.top,"mouseup",se,!1),t=Object(x.a)(window.top,"mousemove",ce,!1))}catch(a){Object(ft.c)(!1,"[rc-image] ".concat(a))}return function(){n.remove(),r.remove(),i.remove(),e&&e.remove(),t&&t.remove()}}),[s,D]),l.createElement(Ts,Object(r.a)({},f,{transitionName:"zoom",maskTransitionName:"fade",closable:!1,keyboard:!0,prefixCls:t,onClose:o,afterClose:function(){E(1),j(0),N(Is)},visible:s,wrapClassName:re}),l.createElement("ul",{className:"".concat(t,"-operations")},oe.map((function(e){var n=e.icon,r=e.onClick,a=e.type,o=e.disabled;return l.createElement("li",{className:d()(ie,Object(i.a)({},"".concat(t,"-operations-operation-disabled"),!!o)),onClick:r,key:a},l.isValidElement(n)?l.cloneElement(n,{className:ae}):n)}))),l.createElement("div",{className:"".concat(t,"-img-wrapper"),style:{transform:"translate3d(".concat(P.x,"px, ").concat(P.y,"px, 0)")}},l.createElement("img",{onMouseDown:function(e){0===e.button&&(e.preventDefault(),e.stopPropagation(),z.current.deltaX=e.pageX-P.x,z.current.deltaY=e.pageY-P.y,z.current.originX=P.x,z.current.originY=P.y,B(!0))},ref:R,className:"".concat(t,"-img"),src:X,alt:a,style:{transform:"scale3d(".concat(k,", ").concat(k,", 1) rotate(").concat(C,"deg)")}})),Z&&l.createElement("div",{className:d()("".concat(t,"-switch-left"),Object(i.a)({},"".concat(t,"-switch-left-disabled"),0===Y)),onClick:function(e){e.preventDefault(),e.stopPropagation(),Y>0&&W(K[Y-1])}},y),Z&&l.createElement("div",{className:d()("".concat(t,"-switch-right"),Object(i.a)({},"".concat(t,"-switch-right-disabled"),Y===G-1)),onClick:function(e){e.preventDefault(),e.stopPropagation(),Y1?n-1:0),a=1;a=0)return parseInt(t.slice(t.indexOf("e-")+2),10);var n=0;return t.indexOf(".")>=0&&(n=t.length-t.indexOf(".")-1),n},r.getInputDisplayValue=function(e){var t,n=e||r.state,i=n.focused,a=n.inputValue,o=n.value;void 0!==(t=i?a:r.toPrecisionAsStep(o))&&null!==t||(t="");var s=r.formatWrapper(t);return tc(r.props.decimalSeparator)&&(s=s.toString().replace(".",r.props.decimalSeparator)),s},r.recordCursorPosition=function(){try{r.cursorStart=r.input.selectionStart,r.cursorEnd=r.input.selectionEnd,r.currentValue=r.input.value,r.cursorBefore=r.input.value.substring(0,r.cursorStart),r.cursorAfter=r.input.value.substring(r.cursorEnd)}catch(e){}},r.restoreByAfter=function(e){if(void 0===e)return!1;var t=r.input.value,n=t.lastIndexOf(e);if(-1===n)return!1;var i=r.cursorBefore.length;return r.lastKeyCode===vt.a.DELETE&&r.cursorBefore.charAt(i-1)===e[0]?(r.fixCaret(i,i),!0):n+e.length===t.length&&(r.fixCaret(n,n),!0)},r.partRestoreByAfter=function(e){return void 0!==e&&Array.prototype.some.call(e,(function(t,n){var i=e.substring(n);return r.restoreByAfter(i)}))},r.isNotCompleteNumber=function(e){return isNaN(e)||""===e||null===e||e&&e.toString().indexOf(".")===e.toString().length-1},r.stop=function(){r.autoStepTimer&&clearTimeout(r.autoStepTimer)},r.down=function(e,t,n){r.pressingUpOrDown=!0,r.step("down",e,t,n)},r.up=function(e,t,n){r.pressingUpOrDown=!0,r.step("up",e,t,n)},r.saveInput=function(e){r.input=e};var i=e.value;void 0===i&&(i=e.defaultValue),r.state={focused:e.autoFocus};var o=r.getValidValue(r.toNumber(i));return r.state=Object(mt.a)(Object(mt.a)({},r.state),{},{inputValue:r.toPrecisionAsStep(o),value:o}),r}return Object(o.a)(n,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.value,r=t.onChange,i=t.max,a=t.min,o=this.state.focused;if(e){if(!nc(e.value,n)||!nc(e.max,i)||!nc(e.min,a)){var s,c=o?n:this.getValidValue(n);s=this.pressingUpOrDown?c:this.inputting?this.rawInput:this.toPrecisionAsStep(c),this.setState({value:c,inputValue:s})}var u="value"in this.props?n:this.state.value;"max"in this.props&&e.max!==i&&"number"===typeof u&&u>i&&r&&r(i),"min"in this.props&&e.min!==a&&"number"===typeof u&&ur&&(i=r),i)}},{key:"setValue",value:function(e,t){var n=this.props.precision,r=this.isNotCompleteNumber(parseFloat(e))?null:parseFloat(e),i=this.state.value,a=void 0===i?null:i,o=this.state.inputValue,s=void 0===o?null:o,c="number"===typeof r?r.toFixed(n):"".concat(r),u=r!==a||c!=="".concat(s);return"value"in this.props?(s=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:s},t)):this.setState({value:r,inputValue:this.toPrecisionAsStep(e)},t),u&&this.props.onChange(r),r}},{key:"getMaxPrecision",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.props,r=n.precision,i=n.step;if(tc(r))return r;var a=this.getPrecision(t),o=this.getPrecision(i),s=this.getPrecision(e);return e?Math.max(s,a+o):a+o}},{key:"getPrecisionFactor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.getMaxPrecision(e,t);return Math.pow(10,n)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(e){return this.props.formatter?this.props.formatter(e):e}},{key:"toPrecisionAsStep",value:function(e){if(this.isNotCompleteNumber(e)||""===e)return e;var t=Math.abs(this.getMaxPrecision(e));return isNaN(t)?e.toString():Number(e).toFixed(t)}},{key:"toNumber",value:function(e){var t=this.props.precision,n=this.state.focused,r=e&&e.length>16&&n;return this.isNotCompleteNumber(e)||r?e:tc(t)?Math.round(e*Math.pow(10,t))/Math.pow(10,t):Number(e)}},{key:"upStep",value:function(e,t){var n=this.props.step,r=this.getPrecisionFactor(e,t),i=Math.abs(this.getMaxPrecision(e,t)),a=((r*e+r*Number(n)*t)/r).toFixed(i);return this.toNumber(a)}},{key:"downStep",value:function(e,t){var n=this.props.step,r=this.getPrecisionFactor(e,t),i=Math.abs(this.getMaxPrecision(e,t)),a=((r*e-r*Number(n)*t)/r).toFixed(i);return this.toNumber(a)}},{key:"step",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3?arguments[3]:void 0;this.stop(),this.recordCursorPosition(),t&&(t.persist(),t.preventDefault());var a=this.props;if(!a.disabled){var o=this.getCurrentValidValue(this.state.inputValue)||0;if(!this.isNotCompleteNumber(o)){var s=this["".concat(e,"Step")](o,r),c=s>a.max||sa.max?s=a.max:s=p)||a||o,q=(D||0===D)&&(isNaN(D)||Number(D)<=m)||a||o,G=d()("".concat(n,"-handler"),"".concat(n,"-handler-up"),Object(i.a)({},"".concat(n,"-handler-up-disabled"),W)),K=d()("".concat(n,"-handler"),"".concat(n,"-handler-down"),Object(i.a)({},"".concat(n,"-handler-down-disabled"),q)),Y=s?{onTouchStart:W?Qs:this.up,onTouchEnd:this.stop}:{onMouseDown:W?Qs:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},X=s?{onTouchStart:q?Qs:this.down,onTouchEnd:this.stop}:{onMouseDown:q?Qs:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return f.a.createElement("div",{className:H,style:v,title:g,onMouseEnter:b,onMouseLeave:y,onMouseOver:w,onMouseOut:x,onFocus:function(){return null},onBlur:function(){return null}},f.a.createElement("div",{className:"".concat(n,"-handler-wrap")},f.a.createElement("span",Object(r.a)({unselectable:"on"},Y,{role:"button","aria-label":"Increase Value","aria-disabled":W,className:G}),u||f.a.createElement("span",{unselectable:"on",className:"".concat(n,"-handler-up-inner"),onClick:$s})),f.a.createElement("span",Object(r.a)({unselectable:"on"},X,{role:"button","aria-label":"Decrease Value","aria-disabled":q,className:K}),l||f.a.createElement("span",{unselectable:"on",className:"".concat(n,"-handler-down-inner"),onClick:$s}))),f.a.createElement("div",{className:"".concat(n,"-input-wrap")},f.a.createElement("input",Object(r.a)({role:"spinbutton","aria-valuemin":m,"aria-valuemax":p,"aria-valuenow":D,required:M,type:E,placeholder:_,onPaste:R,onClick:O,onMouseUp:this.onMouseUp,className:"".concat(n,"-input"),tabIndex:k,autoComplete:c,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:V?this.onKeyDown:Qs,onKeyUp:V?this.onKeyUp:Qs,autoFocus:P,maxLength:A,readOnly:o,disabled:a,max:p,min:m,step:T,name:N,title:g,id:S,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(U),pattern:j,inputMode:C,onInput:z},F))))}}]),n}(f.a.Component);rc.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:ec,min:-ec,step:1,style:{},onChange:Qs,onKeyDown:Qs,onPressEnter:Qs,onFocus:Qs,onBlur:Qs,parser:function(e){return e.replace(/[^\w.-]+/g,"")},required:!1,autoComplete:"off"};var ic=rc,ac=n(262),oc=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0&&l.createElement("ul",{className:"".concat(g,"-item-action"),key:"actions"},a.map((function(e,t){return l.createElement("li",{key:"".concat(g,"-item-action-").concat(t)},e,t!==a.length-1&&l.createElement("em",{className:"".concat(g,"-item-action-split")}))}))),y=h?"div":"li",w=l.createElement(y,Object(r.a)({},u,{className:d()("".concat(g,"-item"),Object(i.a)({},"".concat(g,"-item-no-flex"),!("vertical"===p?o:!function(){var e;return l.Children.forEach(n,(function(t){"string"===typeof t&&(e=!0)})),e&&l.Children.count(n)>1}())),s)}),"vertical"===p&&o?[l.createElement("div",{className:"".concat(g,"-item-main"),key:"content"},n,b),l.createElement("div",{className:"".concat(g,"-item-extra"),key:"extra"},o)]:[n,b,Object(X.a)(o,{key:"extra"})]);return h?l.createElement(ts.a,{flex:1,style:c},w):w};dc.Meta=function(e){var t=e.prefixCls,n=e.className,i=e.avatar,a=e.title,o=e.description,s=hc(e,["prefixCls","className","avatar","title","description"]),c=(0,l.useContext(v.b).getPrefixCls)("list",t),u=d()("".concat(c,"-item-meta"),n),f=l.createElement("div",{className:"".concat(c,"-item-meta-content")},a&&l.createElement("h4",{className:"".concat(c,"-item-meta-title")},a),o&&l.createElement("div",{className:"".concat(c,"-item-meta-description")},o));return l.createElement("div",Object(r.a)({},s,{className:u}),i&&l.createElement("div",{className:"".concat(c,"-item-meta-avatar")},i),(a||o)&&f)};var pc=dc,mc=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ine&&(te.current=ne);var re=a?l.createElement("div",{className:"".concat(Z,"-pagination")},l.createElement(fc.a,Object(r.a)({},te,{onChange:Y,onShowSizeChange:X}))):null,ie=Object(g.a)(M);a&&M.length>(te.current-1)*te.pageSize&&(ie=Object(g.a)(M).splice((te.current-1)*te.pageSize,te.pageSize));var ae=Object(ye.a)(),oe=l.useMemo((function(){for(var e=0;e0){var ue=ie.map((function(e,t){return function(e,t){return j?((n="function"===typeof C?C(e):"string"===typeof C?e[C]:e.key)||(n="list-item-".concat(t)),G[t]=n,j(e,t)):null;var n}(e,t)})),le=l.Children.map(ue,(function(e,t){return l.createElement("div",{key:G[t],style:se},e)}));ce=w?l.createElement($o.a,{gutter:w.gutter},le):l.createElement("ul",{className:"".concat(Z,"-items")},ue)}else m||Q||(ce=function(e,t){return l.createElement("div",{className:"".concat(e,"-empty-text")},T&&T.emptyText||t("List"))}(Z,U));var fe=te.position||"bottom";return l.createElement(vc.Provider,{value:{grid:w,itemLayout:b}},l.createElement("div",Object(r.a)({className:ee},A),("top"===fe||"both"===fe)&&re,k&&l.createElement("div",{className:"".concat(Z,"-header")},k),l.createElement(lc.a,J,ce,m),E&&l.createElement("div",{className:"".concat(Z,"-footer")},E),y||("bottom"===fe||"both"===fe)&&re))}gc.Item=pc;var bc=gc,yc=n(257),wc=n(84),xc=l.createContext(null),Mc=xc.Provider,Oc=xc.Consumer,kc=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){var e;return Object(a.a)(this,n),(e=t.apply(this,arguments)).renderDropdown=function(t){var n=t.notFoundContent,r=t.activeIndex,i=t.setActiveIndex,a=t.selectOption,o=t.onFocus,s=t.onBlur,c=e.props,u=c.prefixCls,f=c.options,h=f[r]||{};return l.createElement(wc.f,{prefixCls:"".concat(u,"-menu"),activeKey:h.key,onSelect:function(e){var t=e.key,n=f.find((function(e){return e.key===t}));a(n)},onFocus:o,onBlur:s},f.map((function(e,t){var n=e.key,r=e.disabled,a=e.children,o=e.className,s=e.style;return l.createElement(wc.d,{key:n,disabled:r,className:o,style:s,onMouseEnter:function(){i(t)}},a)})),!f.length&&l.createElement(wc.d,{disabled:!0},n))},e}return Object(o.a)(n,[{key:"render",value:function(){return l.createElement(Oc,null,this.renderDropdown)}}]),n}(l.Component),Ec={bottomRight:{points:["tl","br"],offset:[0,4],overflow:{adjustX:0,adjustY:1}},bottomLeft:{points:["tr","bl"],offset:[0,4],overflow:{adjustX:0,adjustY:1}},topRight:{points:["bl","tr"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}},topLeft:{points:["br","tl"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}}},_c=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){var e;return Object(a.a)(this,n),(e=t.apply(this,arguments)).getDropdownPrefix=function(){return"".concat(e.props.prefixCls,"-dropdown")},e.getDropdownElement=function(){var t=e.props.options;return l.createElement(kc,{prefixCls:e.getDropdownPrefix(),options:t})},e.getDropDownPlacement=function(){var t=e.props,n=t.placement;return"rtl"===t.direction?"top"===n?"topLeft":"bottomLeft":"top"===n?"topRight":"bottomRight"},e}return Object(o.a)(n,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.visible,r=e.transitionName,i=e.getPopupContainer,a=this.getDropdownElement();return l.createElement(An.a,{prefixCls:this.getDropdownPrefix(),popupVisible:n,popup:a,popupPlacement:this.getDropDownPlacement(),popupTransitionName:r,builtinPlacements:Ec,getPopupContainer:i},t)}}]),n}(l.Component),Sc=function(){return null};function Cc(e){return(e||"").toLowerCase()}function jc(e,t){var n=t.measureLocation,r=t.prefix,i=t.targetText,a=t.selectionStart,o=t.split,s=e.slice(0,n);s[s.length-o.length]===o&&(s=s.slice(0,s.length-o.length)),s&&(s="".concat(s).concat(o));var c=function(e,t,n){var r=e[0];if(!r||r===n)return e;for(var i=e,a=t.length,o=0;o1&&void 0!==arguments[1]?arguments[1]:"",n=Array.isArray(t)?t:[t];return n.reduce((function(t,n){var r=e.lastIndexOf(n);return r>t.location?{location:r,prefix:n}:t}),{location:-1,prefix:""})}(h,u),p=d.location,m=d.prefix;if(-1===[vt.a.ESC,vt.a.UP,vt.a.DOWN,vt.a.ENTER].indexOf(n))if(-1!==p){var v=h.slice(p+m.length),g=f(v,r.props),b=!!r.getOptions(v).length;g?(t===m||"Shift"===t||o||v!==a&&b)&&r.startMeasure(v,m,p):o&&r.stopMeasure(),l&&g&&l(v,m)}else o&&r.stopMeasure()},r.onPressEnter=function(e){var t=r.state.measuring,n=r.props.onPressEnter;!t&&n&&n(e)},r.onInputFocus=function(e){r.onFocus(e)},r.onInputBlur=function(e){r.onBlur(e)},r.onDropdownFocus=function(){r.onFocus()},r.onDropdownBlur=function(){r.onBlur()},r.onFocus=function(e){window.clearTimeout(r.focusId);var t=r.state.isFocus,n=r.props.onFocus;!t&&e&&n&&n(e),r.setState({isFocus:!0})},r.onBlur=function(e){r.focusId=window.setTimeout((function(){var t=r.props.onBlur;r.setState({isFocus:!1}),r.stopMeasure(),t&&t(e)}),0)},r.selectOption=function(e){var t=r.state,n=t.value,i=t.measureLocation,a=t.measurePrefix,o=r.props,s=o.split,c=o.onSelect,u=e.value,l=jc(n,{measureLocation:i,targetText:void 0===u?"":u,prefix:a,selectionStart:r.textarea.selectionStart,split:s}),f=l.text,h=l.selectionLocation;r.triggerChange(f),r.stopMeasure((function(){var e,t;e=r.textarea,t=h,e.setSelectionRange(t,t),e.blur(),e.focus()})),c&&c(e,a)},r.setActiveIndex=function(e){r.setState({activeIndex:e})},r.setTextAreaRef=function(e){var t;r.textarea=null===e||void 0===e||null===(t=e.resizableTextArea)||void 0===t?void 0:t.textArea},r.setMeasureRef=function(e){r.measure=e},r.getOptions=function(e){var t=e||r.state.measureText||"",n=r.props,i=n.children,a=n.filterOption;return Object(G.a)(i).map((function(e){var t=e.props,n=e.key;return Object(mt.a)(Object(mt.a)({},t),{},{key:n||t.value})})).filter((function(e){return!1===a||a(t,e)}))},r.state={value:e.defaultValue||e.value||"",measuring:!1,measureLocation:0,measureText:null,measurePrefix:"",activeIndex:0,isFocus:!1},r}return Object(o.a)(n,[{key:"componentDidUpdate",value:function(){this.state.measuring&&(this.measure.scrollTop=this.textarea.scrollTop)}},{key:"startMeasure",value:function(e,t,n){this.setState({measuring:!0,measureText:e,measurePrefix:t,measureLocation:n,activeIndex:0})}},{key:"stopMeasure",value:function(e){this.setState({measuring:!1,measureLocation:0,measureText:null},e)}},{key:"focus",value:function(){this.textarea.focus()}},{key:"blur",value:function(){this.textarea.blur()}},{key:"render",value:function(){var e=this.state,t=e.value,n=e.measureLocation,r=e.measurePrefix,i=e.measuring,a=e.activeIndex,o=this.props,s=o.prefixCls,c=o.placement,u=o.direction,f=o.transitionName,h=o.className,p=o.style,m=o.autoFocus,v=o.notFoundContent,g=o.getPopupContainer,b=function(e){for(var t=Object(mt.a)({},e),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=t||{},r=n.prefix,i=void 0===r?"@":r,a=n.split,o=void 0===a?" ":a,s=Array.isArray(i)?i:[i];return e.split(o).map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=null;return s.some((function(n){return e.slice(0,n.length)===n&&(t=n,!0)})),null!==t?{prefix:t,value:e.slice(t.length)}:null})).filter((function(e){return!!e&&!!e.value}))};var Ic=Lc;var Dc=n(153),Bc=function(e){var t=l.useRef(!1),n=l.useRef(),i=l.useState(!1),a=Object(q.a)(i,2),o=a[0],s=a[1];l.useEffect((function(){var t;if(e.autoFocus){var r=n.current;t=setTimeout((function(){return r.focus()}))}return function(){t&&clearTimeout(t)}}),[]);var c=e.type,u=e.children,f=e.prefixCls,h=e.buttonProps;return l.createElement(ct.a,Object(r.a)({},Object(Dc.a)(c),{onClick:function(){var n=e.actionFn,r=e.closeModal;if(!t.current)if(t.current=!0,n){var i;if(n.length)i=n(r),t.current=!1;else if(!(i=n()))return void r();!function(n){var r=e.closeModal;n&&n.then&&(s(!0),n.then((function(){r.apply(void 0,arguments)}),(function(e){console.error(e),s(!1),t.current=!1})))}(i)}else r()},loading:o,prefixCls:f},h,{ref:n}),u)},Hc=function(e){var t=e.icon,n=e.onCancel,r=e.onOk,a=e.close,o=e.zIndex,s=e.afterClose,c=e.visible,u=e.keyboard,f=e.centered,h=e.getContainer,p=e.maskStyle,m=e.okText,v=e.okButtonProps,g=e.cancelText,b=e.cancelButtonProps,y=e.direction,w=e.prefixCls,x=e.rootPrefixCls,M=e.bodyStyle,O=e.closable,k=void 0!==O&&O,E=e.closeIcon,_=e.modalRender,S=e.focusTriggerAfterClose;Object(Y.a)(!("string"===typeof t&&t.length>2),"Modal","`icon` is using ReactNode instead of string naming in v4. Please check `".concat(t,"` at https://ant.design/components/icon"));var C=e.okType||"primary",j="".concat(w,"-confirm"),T=!("okCancel"in e)||e.okCancel,A=e.width||416,P=e.style||{},N=void 0===e.mask||e.mask,R=void 0!==e.maskClosable&&e.maskClosable,z=null!==e.autoFocusButton&&(e.autoFocusButton||"ok"),L=e.transitionName||"zoom",I=e.maskTransitionName||"fade",D=d()(j,"".concat(j,"-").concat(e.type),Object(i.a)({},"".concat(j,"-rtl"),"rtl"===y),e.className),B=T&&l.createElement(Bc,{actionFn:n,closeModal:a,autoFocus:"cancel"===z,buttonProps:b,prefixCls:"".concat(x,"-btn")},g);return l.createElement(su,{prefixCls:w,className:D,wrapClassName:d()(Object(i.a)({},"".concat(j,"-centered"),!!e.centered)),onCancel:function(){return a({triggerCancel:!0})},visible:c,title:"",transitionName:L,footer:"",maskTransitionName:I,mask:N,maskClosable:R,maskStyle:p,style:P,width:A,zIndex:o,afterClose:s,keyboard:u,centered:f,getContainer:h,closable:k,closeIcon:E,modalRender:_,focusTriggerAfterClose:S},l.createElement("div",{className:"".concat(j,"-body-wrapper")},l.createElement(da.b,{prefixCls:x},l.createElement("div",{className:"".concat(j,"-body"),style:M},t,void 0===e.title?null:l.createElement("span",{className:"".concat(j,"-title")},e.title),l.createElement("div",{className:"".concat(j,"-content")},e.content))),l.createElement("div",{className:"".concat(j,"-btns")},B,l.createElement(Bc,{type:C,actionFn:r,closeModal:a,autoFocus:"ok"===z,buttonProps:v,prefixCls:"".concat(x,"-btn")},m))))},Fc=function(e,t){var n=e.afterClose,i=e.config,a=l.useState(!0),o=Object(q.a)(a,2),s=o[0],c=o[1],u=l.useState(i),f=Object(q.a)(u,2),h=f[0],d=f[1],p=l.useContext(v.b),m=p.direction,g=p.getPrefixCls,b=g("modal"),y=g();function w(){c(!1);for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:"ltr";return void 0!==e.backIcon?e.backIcon:"rtl"===t?l.createElement(pu.a,null):l.createElement(du.a,null)},wu=function(e){var t=l.useState(!1),n=Object(q.a)(t,2),r=n[0],a=n[1],o=function(e){var t=e.width;a(t<768)};return l.createElement(v.a,null,(function(t){var n,a=t.getPrefixCls,s=t.pageHeader,c=t.direction,u=e.prefixCls,f=e.style,h=e.footer,p=e.children,v=e.breadcrumb,g=e.breadcrumbRender,b=e.className,y=!0;"ghost"in e?y=e.ghost:s&&"ghost"in s&&(y=s.ghost);var w=a("page-header",u),x=function(){var e;return(null===(e=v)||void 0===e?void 0:e.routes)?function(e){return l.createElement(st,e)}(v):null}(),M=(null===g||void 0===g?void 0:g(e,x))||x,O=d()(w,b,(n={"has-breadcrumb":M,"has-footer":h},Object(i.a)(n,"".concat(w,"-ghost"),y),Object(i.a)(n,"".concat(w,"-rtl"),"rtl"===c),Object(i.a)(n,"".concat(w,"-compact"),r),n));return l.createElement(m.a,{onResize:o},l.createElement("div",{className:O,style:f},M,function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"ltr",r=t.title,i=t.avatar,a=t.subTitle,o=t.tags,s=t.extra,c=t.onBack,u="".concat(e,"-heading"),f=r||a||o||s;if(!f)return null;var h=yu(t,n),d=bu(e,h,c),p=d||i||f;return l.createElement("div",{className:u},p&&l.createElement("div",{className:"".concat(u,"-left")},d,i&&l.createElement(Re,i),r&&l.createElement("span",{className:"".concat(u,"-title"),title:"string"===typeof r?r:void 0},r),a&&l.createElement("span",{className:"".concat(u,"-sub-title"),title:"string"===typeof a?a:void 0},a),o&&l.createElement("span",{className:"".concat(u,"-tags")},o)),s&&l.createElement("span",{className:"".concat(u,"-extra")},s))}(w,e,c),p&&function(e,t){return l.createElement("div",{className:"".concat(e,"-content")},t)}(w,p),function(e,t){return t?l.createElement("div",{className:"".concat(e,"-footer")},t):null}(w,h)))}))},xu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i100?100:e}function Su(e){var t=e.success,n=e.successPercent;return t&&"progress"in t&&(Object(Y.a)(!1,"Progress","`success.progress` is deprecated. Please use `success.percent` instead."),n=t.progress),t&&"percent"in t&&(n=t.percent),n}var Cu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,o=50-r/2,s=0,c=-o,u=0,l=-2*o;switch(a){case"left":s=-o,c=0,u=2*o,l=0;break;case"right":s=o,c=0,u=-2*o,l=0;break;case"bottom":c=o,l=2*o}var f="M 50,50 m ".concat(s,",").concat(c,"\n a ").concat(o,",").concat(o," 0 1 1 ").concat(u,",").concat(-l,"\n a ").concat(o,",").concat(o," 0 1 1 ").concat(-u,",").concat(l),h=2*Math.PI*o,d={stroke:n,strokeDasharray:"".concat(t/100*(h-i),"px ").concat(h,"px"),strokeDashoffset:"-".concat(i/2+e/100*(h-i),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s"};return{pathString:f,pathStyle:d}}var Du=function(e){var t=e.prefixCls,n=e.strokeWidth,i=e.trailWidth,a=e.gapDegree,o=e.gapPosition,s=e.trailColor,c=e.strokeLinecap,u=e.style,f=e.className,h=e.strokeColor,p=e.percent,m=Object(yr.a)(e,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),v=l.useMemo((function(){return Ru+=1}),[]),g=Iu(0,100,s,n,a,o),b=g.pathString,y=g.pathStyle,w=Lu(p),x=Lu(h),M=x.find((function(e){return"[object Object]"===Object.prototype.toString.call(e)})),O=Pu(w),k=Object(q.a)(O,1)[0];return l.createElement("svg",Object(r.a)({className:d()("".concat(t,"-circle"),f),viewBox:"0 0 100 100",style:u},m),M&&l.createElement("defs",null,l.createElement("linearGradient",{id:"".concat(t,"-gradient-").concat(v),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(M).sort((function(e,t){return zu(e)-zu(t)})).map((function(e,t){return l.createElement("stop",{key:t,offset:e,stopColor:M[e]})})))),l.createElement("path",{className:"".concat(t,"-circle-trail"),d:b,stroke:s,strokeLinecap:c,strokeWidth:i||n,fillOpacity:"0",style:y}),function(){var e=0;return w.map((function(r,i){var s=x[i]||x[x.length-1],u="[object Object]"===Object.prototype.toString.call(s)?"url(#".concat(t,"-gradient-").concat(v,")"):"",f=Iu(e,r,s,n,a,o);return e+=r,l.createElement("path",{key:i,className:"".concat(t,"-circle-path"),d:f.pathString,stroke:u,strokeLinecap:c,strokeWidth:n,opacity:0===r?0:1,fillOpacity:"0",style:f.pathStyle,ref:k[i]})}))}().reverse())};Du.defaultProps=Au,Du.displayName="Circle";var Bu=Du;function Hu(e){var t=e.percent,n=e.success,r=e.successPercent,i=_u(t),a=Su({success:n,successPercent:r});return a?[_u(a),_u(i-_u(a))]:i}var Fu=function(e){var t=e.prefixCls,n=e.width,r=e.strokeWidth,a=e.trailColor,o=e.strokeLinecap,s=e.gapPosition,c=e.gapDegree,u=e.type,f=e.children,h=n||120,p={width:h,height:h,fontSize:.15*h+6},m=r||6,v=s||"dashboard"===u&&"bottom"||"top",g=function(e){var t=e.success,n=e.strokeColor||null;return Su({success:t,successPercent:e.successPercent})?[Eu.b.green,n]:n}(e),b="[object Object]"===Object.prototype.toString.call(g),y=d()("".concat(t,"-inner"),Object(i.a)({},"".concat(t,"-circle-gradient"),b));return l.createElement("div",{className:y,style:p},l.createElement(Bu,{percent:Hu(e),strokeWidth:m,trailWidth:m,strokeColor:g,strokeLinecap:o,trailColor:a,prefixCls:t,gapDegree:c||0===c?c:"dashboard"===u?75:void 0,gapPosition:v}),f)},Vu=function(e){for(var t=e.size,n=e.steps,r=e.percent,a=void 0===r?0:r,o=e.strokeWidth,s=void 0===o?8:o,c=e.strokeColor,u=e.trailColor,f=e.prefixCls,h=e.children,p=Math.round(n*(a/100)),m="small"===t?2:14,v=[],g=0;g=100?"success":e||"normal"}},{key:"renderProcessInfo",value:function(e,t){var n,r=this.props,i=r.showInfo,a=r.format,o=r.type,s=r.percent,c=Su(this.props);if(!i)return null;var u="line"===o;return a||"exception"!==t&&"success"!==t?n=(a||function(e){return"".concat(e,"%")})(_u(s),_u(c)):"exception"===t?n=u?l.createElement(ue.a,null):l.createElement(te.a,null):"success"===t&&(n=u?l.createElement(oe.a,null):l.createElement(ku.a,null)),l.createElement("span",{className:"".concat(e,"-text"),title:"string"===typeof n?n:void 0},n)}},{key:"render",value:function(){return l.createElement(v.a,null,this.renderProgress)}}]),n}(l.Component);qu.defaultProps={type:"line",percent:0,showInfo:!0,trailColor:null,size:"default",gapDegree:void 0,strokeLinecap:"round"};var Gu=qu,Ku=n(164),Yu=n(125);var Xu=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){var e;return Object(a.a)(this,n),(e=t.apply(this,arguments)).onHover=function(t){var n=e.props;(0,n.onHover)(t,n.index)},e.onClick=function(t){var n=e.props;(0,n.onClick)(t,n.index)},e.onKeyDown=function(t){var n=e.props,r=n.onClick,i=n.index;13===t.keyCode&&r(t,i)},e}return Object(o.a)(n,[{key:"getClassName",value:function(){var e=this.props,t=e.prefixCls,n=e.index,r=e.value,i=e.allowHalf,a=e.focused,o=n+1,s=t;return 0===r&&0===n&&a?s+=" ".concat(t,"-focused"):i&&r+.5>=o&&rc?"true":"false","aria-posinset":c+1,"aria-setsize":u,tabIndex:i?-1:0},f.a.createElement("div",{className:"".concat(a,"-first")},h),f.a.createElement("div",{className:"".concat(a,"-second")},h)));return s&&(d=s(d,this.props)),d}}]),n}(f.a.Component);function Zu(){}var Ju=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r;Object(a.a)(this,n),(r=t.call(this,e)).onHover=function(e,t){var n=r.props.onHoverChange,i=r.getStarValue(t,e.pageX);i!==r.state.cleanedValue&&r.setState({hoverValue:i,cleanedValue:null}),n(i)},r.onMouseLeave=function(){var e=r.props.onHoverChange;r.setState({hoverValue:void 0,cleanedValue:null}),e(void 0)},r.onClick=function(e,t){var n=r.props.allowClear,i=r.state.value,a=r.getStarValue(t,e.pageX),o=!1;n&&(o=a===i),r.onMouseLeave(),r.changeValue(o?0:a),r.setState({cleanedValue:o?a:null})},r.onFocus=function(){var e=r.props.onFocus;r.setState({focused:!0}),e&&e()},r.onBlur=function(){var e=r.props.onBlur;r.setState({focused:!1}),e&&e()},r.onKeyDown=function(e){var t=e.keyCode,n=r.props,i=n.count,a=n.allowHalf,o=n.onKeyDown,s="rtl"===n.direction,c=r.state.value;t===vt.a.RIGHT&&c0&&!s||t===vt.a.RIGHT&&c>0&&s?(c-=a?.5:1,r.changeValue(c),e.preventDefault()):t===vt.a.LEFT&&cc/2||!i&&t-s2),"Result","`icon` is using ReactNode instead of string naming in v4. Please check `".concat(r,"` at https://ant.design/components/icon")),ul.includes("".concat(n))){var a=cl[n];return l.createElement("div",{className:"".concat(i," ").concat(e,"-image")},l.createElement(a,null))}var o=l.createElement(sl[n]);return l.createElement("div",{className:i},r||o)}(b,{status:u,icon:f}),l.createElement("div",{className:"".concat(b,"-title")},a),r&&l.createElement("div",{className:"".concat(b,"-subtitle")},r),function(e,t){var n=t.extra;return n&&l.createElement("div",{className:"".concat(e,"-extra")},n)}(b,{extra:h}),s&&l.createElement("div",{className:"".concat(b,"-content")},s))};ll.PRESENTED_IMAGE_403=cl[403],ll.PRESENTED_IMAGE_404=cl[404],ll.PRESENTED_IMAGE_500=cl[500];var fl=ll,hl=n(156),dl=n(256),pl=function(e){var t,n,r=e.className,a=e.included,o=e.vertical,s=e.style,c=e.length,u=e.offset,l=e.reverse;c<0&&(l=!l,c=Math.abs(c),u=100-u);var h=o?(t={},Object(i.a)(t,l?"top":"bottom","".concat(u,"%")),Object(i.a)(t,l?"bottom":"top","auto"),Object(i.a)(t,"height","".concat(c,"%")),t):(n={},Object(i.a)(n,l?"right":"left","".concat(u,"%")),Object(i.a)(n,l?"left":"right","auto"),Object(i.a)(n,"width","".concat(c,"%")),n),d=Object(mt.a)(Object(mt.a)({},s),h);return a?f.a.createElement("div",{className:r,style:d}):null};function ml(e,t,n){return(ml="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(Ya.a)(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}var vl=function(e){var t=e.prefixCls,n=e.vertical,r=e.reverse,a=e.marks,o=e.dots,s=e.step,c=e.included,u=e.lowerBound,l=e.upperBound,h=e.max,p=e.min,m=e.dotStyle,v=e.activeDotStyle,g=h-p,b=function(e,t,n,r,i,a){Object(ft.a)(!n||r>0,"`Slider[step]` should be a positive number in order to make Slider[dots] work.");var o=Object.keys(t).map(parseFloat).sort((function(e,t){return e-t}));if(n&&r)for(var s=i;s<=a;s+=r)-1===o.indexOf(s)&&o.push(s);return o}(0,a,o,s,p,h).map((function(e){var a,o="".concat(Math.abs(e-p)/g*100,"%"),s=!c&&e===l||c&&e<=l&&e>=u,h=n?Object(mt.a)(Object(mt.a)({},m),{},Object(i.a)({},r?"top":"bottom",o)):Object(mt.a)(Object(mt.a)({},m),{},Object(i.a)({},r?"right":"left",o));s&&(h=Object(mt.a)(Object(mt.a)({},h),v));var b=d()((a={},Object(i.a)(a,"".concat(t,"-dot"),!0),Object(i.a)(a,"".concat(t,"-dot-active"),s),Object(i.a)(a,"".concat(t,"-dot-reverse"),r),a));return f.a.createElement("span",{className:b,style:h,key:e})}));return f.a.createElement("div",{className:"".concat(t,"-step")},b)},gl=function(e){var t=e.className,n=e.vertical,r=e.reverse,a=e.marks,o=e.included,s=e.upperBound,c=e.lowerBound,l=e.max,h=e.min,p=e.onClickLabel,m=Object.keys(a),v=l-h,g=m.map(parseFloat).sort((function(e,t){return e-t})).map((function(e){var l,m=a[e],g="object"===Object(u.a)(m)&&!f.a.isValidElement(m),b=g?m.label:m;if(!b&&0!==b)return null;var y=!o&&e===s||o&&e<=s&&e>=c,w=d()((l={},Object(i.a)(l,"".concat(t,"-text"),!0),Object(i.a)(l,"".concat(t,"-text-active"),y),l)),x=Object(i.a)({marginBottom:"-50%"},r?"top":"bottom","".concat((e-h)/v*100,"%")),M=Object(i.a)({transform:"translateX(".concat(r?"50%":"-50%",")"),msTransform:"translateX(".concat(r?"50%":"-50%",")")},r?"right":"left","".concat((e-h)/v*100,"%")),O=n?x:M,k=g?Object(mt.a)(Object(mt.a)({},O),m.style):O;return f.a.createElement("span",{className:w,style:k,key:e,onMouseDown:function(t){return p(t,e)},onTouchStart:function(t){return p(t,e)}},b)}));return f.a.createElement("div",{className:t},g)},bl=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){var e;return Object(a.a)(this,n),(e=t.apply(this,arguments)).state={clickFocused:!1},e.setHandleRef=function(t){e.handle=t},e.handleMouseUp=function(){document.activeElement===e.handle&&e.setClickFocus(!0)},e.handleMouseDown=function(t){t.preventDefault(),e.focus()},e.handleBlur=function(){e.setClickFocus(!1)},e.handleKeyDown=function(){e.setClickFocus(!1)},e}return Object(o.a)(n,[{key:"componentDidMount",value:function(){this.onMouseUpListener=Object(x.a)(document,"mouseup",this.handleMouseUp)}},{key:"componentWillUnmount",value:function(){this.onMouseUpListener&&this.onMouseUpListener.remove()}},{key:"setClickFocus",value:function(e){this.setState({clickFocused:e})}},{key:"clickFocus",value:function(){this.setClickFocus(!0),this.focus()}},{key:"focus",value:function(){this.handle.focus()}},{key:"blur",value:function(){this.handle.blur()}},{key:"render",value:function(){var e,t,n,a=this.props,o=a.prefixCls,s=a.vertical,c=a.reverse,u=a.offset,l=a.style,h=a.disabled,p=a.min,m=a.max,v=a.value,g=a.tabIndex,b=a.ariaLabel,y=a.ariaLabelledBy,w=a.ariaValueTextFormatter,x=Object(yr.a)(a,["prefixCls","vertical","reverse","offset","style","disabled","min","max","value","tabIndex","ariaLabel","ariaLabelledBy","ariaValueTextFormatter"]),M=d()(this.props.className,Object(i.a)({},"".concat(o,"-handle-click-focused"),this.state.clickFocused)),O=s?(e={},Object(i.a)(e,c?"top":"bottom","".concat(u,"%")),Object(i.a)(e,c?"bottom":"top","auto"),Object(i.a)(e,"transform",c?null:"translateY(+50%)"),e):(t={},Object(i.a)(t,c?"right":"left","".concat(u,"%")),Object(i.a)(t,c?"left":"right","auto"),Object(i.a)(t,"transform","translateX(".concat(c?"+":"-","50%)")),t),k=Object(mt.a)(Object(mt.a)({},l),O),E=g||0;return(h||null===g)&&(E=null),w&&(n=w(v)),f.a.createElement("div",Object(r.a)({ref:this.setHandleRef,tabIndex:E},x,{className:M,style:k,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,role:"slider","aria-valuemin":p,"aria-valuemax":m,"aria-valuenow":v,"aria-disabled":!!h,"aria-label":b,"aria-labelledby":y,"aria-valuetext":n}))}}]),n}(f.a.Component);function yl(e,t){try{return Object.keys(t).some((function(n){return e.target===Object(Uc.findDOMNode)(t[n])}))}catch(n){return!1}}function wl(e,t){var n=t.min,r=t.max;return er}function xl(e){return e.touches.length>1||"touchend"===e.type.toLowerCase()&&e.touches.length>0}function Ml(e,t){var n=t.marks,r=t.step,i=t.min,a=t.max,o=Object.keys(n).map(parseFloat);if(null!==r){var s=Math.pow(10,Ol(r)),c=Math.floor((a*s-i*s)/(r*s)),u=Math.min((e-i)/r,c),l=Math.round(u)*r+i;o.push(l)}var f=o.map((function(t){return Math.abs(e-t)}));return o[f.indexOf(Math.min.apply(Math,Object(g.a)(f)))]}function Ol(e){var t=e.toString(),n=0;return t.indexOf(".")>=0&&(n=t.length-t.indexOf(".")-1),n}function kl(e,t){return e?t.clientY:t.pageX}function El(e,t){return e?t.touches[0].clientY:t.touches[0].pageX}function _l(e,t){var n=t.getBoundingClientRect();return e?n.top+.5*n.height:window.pageXOffset+n.left+.5*n.width}function Sl(e,t){var n=t.max,r=t.min;return e<=r?r:e>=n?n:e}function Cl(e,t){var n=t.step,r=isFinite(Ml(e,t))?Ml(e,t):0;return null===n?r:parseFloat(r.toFixed(Ol(n)))}function jl(e){e.stopPropagation(),e.preventDefault()}function Tl(e,t,n){var r="increase";switch(e.keyCode){case vt.a.UP:r=t&&n?"decrease":"increase";break;case vt.a.RIGHT:r=!t&&n?"decrease":"increase";break;case vt.a.DOWN:r=t&&n?"increase":"decrease";break;case vt.a.LEFT:r=!t&&n?"increase":"decrease";break;case vt.a.END:return function(e,t){return t.max};case vt.a.HOME:return function(e,t){return t.min};case vt.a.PAGE_UP:return function(e,t){return e+2*t.step};case vt.a.PAGE_DOWN:return function(e,t){return e-2*t.step};default:return}return function(e,t){return function(e,t,n){var r={increase:function(e,t){return e+t},decrease:function(e,t){return e-t}},i=r[e](Object.keys(n.marks).indexOf(JSON.stringify(t)),1),a=Object.keys(n.marks)[i];return n.step?r[e](t,n.step):Object.keys(n.marks).length&&n.marks[a]?n.marks[a]:t}(r,e,t)}}function Al(){}function Pl(e){var t;return(t=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r;Object(a.a)(this,n),(r=t.call(this,e)).onDown=function(e,t){var n=t,i=r.props,a=i.draggableTrack,o=i.vertical,s=r.state.bounds,c=a&&r.positionGetValue&&r.positionGetValue(n)||[],u=yl(e,r.handlesRefs);if(r.dragTrack=a&&s.length>=2&&!u&&!c.map((function(e,t){var n=!!t||e>=s[t];return t===c.length-1?e<=s[t]:n})).some((function(e){return!e})),r.dragTrack)r.dragOffset=n,r.startBounds=Object(g.a)(s);else{if(u){var l=_l(o,e.target);r.dragOffset=n-l,n=l}else r.dragOffset=0;r.onStart(n)}},r.onMouseDown=function(e){if(0===e.button){r.removeDocumentEvents();var t=kl(r.props.vertical,e);r.onDown(e,t),r.addDocumentMouseEvents()}},r.onTouchStart=function(e){if(!xl(e)){var t=El(r.props.vertical,e);r.onDown(e,t),r.addDocumentTouchEvents(),jl(e)}},r.onFocus=function(e){var t=r.props,n=t.onFocus,i=t.vertical;if(yl(e,r.handlesRefs)&&!r.dragTrack){var a=_l(i,e.target);r.dragOffset=0,r.onStart(a),jl(e),n&&n(e)}},r.onBlur=function(e){var t=r.props.onBlur;r.dragTrack||r.onEnd(),t&&t(e)},r.onMouseUp=function(){r.handlesRefs[r.prevMovedHandleIndex]&&r.handlesRefs[r.prevMovedHandleIndex].clickFocus()},r.onMouseMove=function(e){if(r.sliderRef){var t=kl(r.props.vertical,e);r.onMove(e,t-r.dragOffset,r.dragTrack,r.startBounds)}else r.onEnd()},r.onTouchMove=function(e){if(!xl(e)&&r.sliderRef){var t=El(r.props.vertical,e);r.onMove(e,t-r.dragOffset,r.dragTrack,r.startBounds)}else r.onEnd()},r.onKeyDown=function(e){r.sliderRef&&yl(e,r.handlesRefs)&&r.onKeyboard(e)},r.onClickMarkLabel=function(e,t){e.stopPropagation(),r.onChange({value:t}),r.setState({value:t},(function(){return r.onEnd(!0)}))},r.saveSlider=function(e){r.sliderRef=e};var i=e.step,o=e.max,s=e.min,c=!isFinite(o-s)||(o-s)%i===0;return Object(ft.a)(!i||Math.floor(i)!==i||c,"Slider[max] - Slider[min] (".concat(o-s,") should be a multiple of Slider[step] (").concat(i,")")),r.handlesRefs={},r}return Object(o.a)(n,[{key:"componentDidMount",value:function(){this.document=this.sliderRef&&this.sliderRef.ownerDocument;var e=this.props,t=e.autoFocus,n=e.disabled;t&&!n&&this.focus()}},{key:"componentWillUnmount",value:function(){ml(Object(Ya.a)(n.prototype),"componentWillUnmount",this)&&ml(Object(Ya.a)(n.prototype),"componentWillUnmount",this).call(this),this.removeDocumentEvents()}},{key:"getSliderStart",value:function(){var e=this.sliderRef,t=this.props,n=t.vertical,r=t.reverse,i=e.getBoundingClientRect();return n?r?i.bottom:i.top:window.pageXOffset+(r?i.right:i.left)}},{key:"getSliderLength",value:function(){var e=this.sliderRef;if(!e)return 0;var t=e.getBoundingClientRect();return this.props.vertical?t.height:t.width}},{key:"addDocumentTouchEvents",value:function(){this.onTouchMoveListener=Object(x.a)(this.document,"touchmove",this.onTouchMove),this.onTouchUpListener=Object(x.a)(this.document,"touchend",this.onEnd)}},{key:"addDocumentMouseEvents",value:function(){this.onMouseMoveListener=Object(x.a)(this.document,"mousemove",this.onMouseMove),this.onMouseUpListener=Object(x.a)(this.document,"mouseup",this.onEnd)}},{key:"removeDocumentEvents",value:function(){this.onTouchMoveListener&&this.onTouchMoveListener.remove(),this.onTouchUpListener&&this.onTouchUpListener.remove(),this.onMouseMoveListener&&this.onMouseMoveListener.remove(),this.onMouseUpListener&&this.onMouseUpListener.remove()}},{key:"focus",value:function(){var e;this.props.disabled||null===(e=this.handlesRefs[0])||void 0===e||e.focus()}},{key:"blur",value:function(){var e=this;this.props.disabled||Object.keys(this.handlesRefs).forEach((function(t){var n,r;null===(n=e.handlesRefs[t])||void 0===n||null===(r=n.blur)||void 0===r||r.call(n)}))}},{key:"calcValue",value:function(e){var t=this.props,n=t.vertical,r=t.min,i=t.max,a=Math.abs(Math.max(e,0)/this.getSliderLength());return n?(1-a)*(i-r)+r:a*(i-r)+r}},{key:"calcValueByPos",value:function(e){var t=(this.props.reverse?-1:1)*(e-this.getSliderStart());return this.trimAlignValue(this.calcValue(t))}},{key:"calcOffset",value:function(e){var t=this.props,n=t.min,r=(e-n)/(t.max-n);return Math.max(0,100*r)}},{key:"saveHandle",value:function(e,t){this.handlesRefs[e]=t}},{key:"render",value:function(){var e,t=this.props,r=t.prefixCls,a=t.className,o=t.marks,s=t.dots,c=t.step,u=t.included,l=t.disabled,h=t.vertical,p=t.reverse,m=t.min,v=t.max,g=t.children,b=t.maximumTrackStyle,y=t.style,w=t.railStyle,x=t.dotStyle,M=t.activeDotStyle,O=ml(Object(Ya.a)(n.prototype),"render",this).call(this),k=O.tracks,E=O.handles,_=d()(r,(e={},Object(i.a)(e,"".concat(r,"-with-marks"),Object.keys(o).length),Object(i.a)(e,"".concat(r,"-disabled"),l),Object(i.a)(e,"".concat(r,"-vertical"),h),Object(i.a)(e,a,a),e));return f.a.createElement("div",{ref:this.saveSlider,className:_,onTouchStart:l?Al:this.onTouchStart,onMouseDown:l?Al:this.onMouseDown,onMouseUp:l?Al:this.onMouseUp,onKeyDown:l?Al:this.onKeyDown,onFocus:l?Al:this.onFocus,onBlur:l?Al:this.onBlur,style:y},f.a.createElement("div",{className:"".concat(r,"-rail"),style:Object(mt.a)(Object(mt.a)({},b),w)}),k,f.a.createElement(vl,{prefixCls:r,vertical:h,reverse:p,marks:o,dots:s,step:c,included:u,lowerBound:this.getLowerBound(),upperBound:this.getUpperBound(),max:v,min:m,dotStyle:x,activeDotStyle:M}),E,f.a.createElement(gl,{className:"".concat(r,"-mark"),onClickLabel:l?Al:this.onClickMarkLabel,vertical:h,marks:o,included:u,lowerBound:this.getLowerBound(),upperBound:this.getUpperBound(),max:v,min:m,reverse:p}),g)}}]),n}(e)).displayName="ComponentEnhancer(".concat(e.displayName,")"),t.defaultProps=Object(mt.a)(Object(mt.a)({},e.defaultProps),{},{prefixCls:"rc-slider",className:"",min:0,max:100,step:1,marks:{},handle:function(e){var t=e.index,n=Object(yr.a)(e,["index"]);return delete n.dragging,null===n.value?null:f.a.createElement(bl,Object(r.a)({},n,{key:t}))},onBeforeChange:Al,onChange:Al,onAfterChange:Al,included:!0,disabled:!1,dots:!1,vertical:!1,reverse:!1,trackStyle:[{}],handleStyle:[{}],railStyle:{},dotStyle:{},activeDotStyle:{}}),t}var Nl=Pl(function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r;Object(a.a)(this,n),(r=t.call(this,e)).positionGetValue=function(e){return[]},r.onEnd=function(e){var t=r.state.dragging;r.removeDocumentEvents(),(t||e)&&r.props.onAfterChange(r.getValue()),r.setState({dragging:!1})};var i=void 0!==e.defaultValue?e.defaultValue:e.min,o=void 0!==e.value?e.value:i;return r.state={value:r.trimAlignValue(o),dragging:!1},Object(ft.a)(!("minimumTrackStyle"in e),"minimumTrackStyle will be deprecated, please use trackStyle instead."),Object(ft.a)(!("maximumTrackStyle"in e),"maximumTrackStyle will be deprecated, please use railStyle instead."),r}return Object(o.a)(n,[{key:"calcValueByPos",value:function(e){return 0}},{key:"calcOffset",value:function(e){return 0}},{key:"saveHandle",value:function(e,t){}},{key:"removeDocumentEvents",value:function(){}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,r=n.min,i=n.max,a=n.value,o=n.onChange;if("min"in this.props||"max"in this.props){var s=void 0!==a?a:t.value,c=this.trimAlignValue(s,this.props);c!==t.value&&(this.setState({value:c}),r===e.min&&i===e.max||!wl(s,this.props)||o(c))}}},{key:"onChange",value:function(e){var t=this.props,n=!("value"in t),r=e.value>this.props.max?Object(mt.a)(Object(mt.a)({},e),{},{value:this.props.max}):e;n&&this.setState(r);var i=r.value;t.onChange(i)}},{key:"onStart",value:function(e){this.setState({dragging:!0});var t=this.props,n=this.getValue();t.onBeforeChange(n);var r=this.calcValueByPos(e);this.startValue=r,this.startPosition=e,r!==n&&(this.prevMovedHandleIndex=0,this.onChange({value:r}))}},{key:"onMove",value:function(e,t){jl(e);var n=this.state.value,r=this.calcValueByPos(t);r!==n&&this.onChange({value:r})}},{key:"onKeyboard",value:function(e){var t=this.props,n=t.reverse,r=Tl(e,t.vertical,n);if(r){jl(e);var i=this.state.value,a=r(i,this.props),o=this.trimAlignValue(a);if(o===i)return;this.onChange({value:o}),this.props.onAfterChange(o),this.onEnd()}}},{key:"getValue",value:function(){return this.state.value}},{key:"getLowerBound",value:function(){var e=this.props.startPoint||this.props.min;return this.state.value>e?e:this.state.value}},{key:"getUpperBound",value:function(){return this.state.value1&&void 0!==arguments[1]?arguments[1]:{};if(null===e)return null;var n=Object(mt.a)(Object(mt.a)({},this.props),t),r=Sl(e,n);return Cl(r,n)}},{key:"render",value:function(){var e=this,t=this.props,n=t.prefixCls,r=t.vertical,i=t.included,a=t.disabled,o=t.minimumTrackStyle,s=t.trackStyle,c=t.handleStyle,u=t.tabIndex,l=t.ariaLabelForHandle,h=t.ariaLabelledByForHandle,d=t.ariaValueTextFormatterForHandle,p=t.min,m=t.max,v=t.startPoint,g=t.reverse,b=t.handle,y=this.state,w=y.value,x=y.dragging,M=this.calcOffset(w),O=b({className:"".concat(n,"-handle"),prefixCls:n,vertical:r,offset:M,value:w,dragging:x,disabled:a,min:p,max:m,reverse:g,index:0,tabIndex:u,ariaLabel:l,ariaLabelledBy:h,ariaValueTextFormatter:d,style:c[0]||c,ref:function(t){return e.saveHandle(0,t)}}),k=void 0!==v?this.calcOffset(v):0,E=s[0]||s;return{tracks:f.a.createElement(pl,{className:"".concat(n,"-track"),vertical:r,included:i,offset:k,reverse:g,length:M-k,style:Object(mt.a)(Object(mt.a)({},o),E)}),handles:O}}}]),n}(f.a.Component)),Rl=function(e){var t=e.value,n=e.handle,r=e.bounds,i=e.props,a=i.allowCross,o=i.pushable,s=Number(o),c=Sl(t,i),u=c;return a||null==n||void 0===r||(n>0&&c<=r[n-1]+s&&(u=r[n-1]+s),n=r[n+1]-s&&(u=r[n+1]-s)),Cl(u,i)},zl=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r;Object(a.a)(this,n),(r=t.call(this,e)).positionGetValue=function(e){var t=r.getValue(),n=r.calcValueByPos(e),i=r.getClosestBound(n),a=r.getBoundNeedMoving(n,i);if(n===t[a])return null;var o=Object(g.a)(t);return o[a]=n,o},r.onEnd=function(e){var t=r.state.handle;r.removeDocumentEvents(),t||(r.dragTrack=!1),(null!==t||e)&&r.props.onAfterChange(r.getValue()),r.setState({handle:null})};var i=e.count,o=e.min,s=e.max,c=Array.apply(void 0,Object(g.a)(Array(i+1))).map((function(){return o})),u="defaultValue"in e?e.defaultValue:c,l=(void 0!==e.value?e.value:u).map((function(t,n){return Rl({value:t,handle:n,props:e})})),f=l[0]===s?0:l.length-1;return r.state={handle:null,recent:f,bounds:l},r}return Object(o.a)(n,[{key:"calcValueByPos",value:function(e){return 0}},{key:"getSliderLength",value:function(){return 0}},{key:"calcOffset",value:function(e){return 0}},{key:"saveHandle",value:function(e,t){}},{key:"removeDocumentEvents",value:function(){}},{key:"componentDidUpdate",value:function(e,t){var n=this,r=this.props,i=r.onChange,a=r.value,o=r.min,s=r.max;if(("min"in this.props||"max"in this.props)&&(o!==e.min||s!==e.max)){var c=a||t.bounds;if(c.some((function(e){return wl(e,n.props)})))i(c.map((function(e){return Sl(e,n.props)})))}}},{key:"onChange",value:function(e){var t=this.props;if(!("value"in t))this.setState(e);else{var n={};["handle","recent"].forEach((function(t){void 0!==e[t]&&(n[t]=e[t])})),Object.keys(n).length&&this.setState(n)}var r=Object(mt.a)(Object(mt.a)({},this.state),e).bounds;t.onChange(r)}},{key:"onStart",value:function(e){var t=this.props,n=this.state,r=this.getValue();t.onBeforeChange(r);var i=this.calcValueByPos(e);this.startValue=i,this.startPosition=e;var a=this.getClosestBound(i);if(this.prevMovedHandleIndex=this.getBoundNeedMoving(i,a),this.setState({handle:this.prevMovedHandleIndex,recent:this.prevMovedHandleIndex}),i!==r[this.prevMovedHandleIndex]){var o=Object(g.a)(n.bounds);o[this.prevMovedHandleIndex]=i,this.onChange({bounds:o})}}},{key:"onMove",value:function(e,t,n,r){jl(e);var i=this.state,a=this.props,o=a.max||100,s=a.min||0;if(n){var c=a.vertical?-t:t;c=a.reverse?-c:c;var u=o-Math.max.apply(Math,Object(g.a)(r)),l=s-Math.min.apply(Math,Object(g.a)(r)),f=Math.min(Math.max(c/(this.getSliderLength()/100),l),u),h=r.map((function(e){return Math.floor(Math.max(Math.min(e+f,o),s))}));i.bounds.map((function(e,t){return e===h[t]})).some((function(e){return!e}))&&this.onChange({bounds:h})}else{var d=this.calcValueByPos(t);d!==i.bounds[i.handle]&&this.moveTo(d)}}},{key:"onKeyboard",value:function(e){var t=this.props,n=t.reverse,r=Tl(e,t.vertical,n);if(r){jl(e);var i=this.state,a=this.props,o=i.bounds,s=i.handle,c=o[null===s?i.recent:s],u=r(c,a),l=Rl({value:u,handle:s,bounds:i.bounds,props:a});if(l===c)return;this.moveTo(l,!0)}}},{key:"getValue",value:function(){return this.state.bounds}},{key:"getClosestBound",value:function(e){for(var t=this.state.bounds,n=0,r=1;r=t[r]&&(n=r);return Math.abs(t[n+1]-e)=r.length||i<0)return!1;var a=t+n,o=r[i],s=this.props.pushable,c=Number(s),u=n*(e[a]-o);return!!this.pushHandle(e,a,n,c-u)&&(e[t]=o,!0)}},{key:"trimAlignValue",value:function(e){var t=this.state,n=t.handle,r=t.bounds;return Rl({value:e,handle:n,bounds:r,props:this.props})}},{key:"render",value:function(){var e=this,t=this.state,n=t.handle,r=t.bounds,a=this.props,o=a.prefixCls,s=a.vertical,c=a.included,u=a.disabled,l=a.min,h=a.max,p=a.reverse,m=a.handle,v=a.trackStyle,g=a.handleStyle,b=a.tabIndex,y=a.ariaLabelGroupForHandles,w=a.ariaLabelledByGroupForHandles,x=a.ariaValueTextFormatterGroupForHandles,M=r.map((function(t){return e.calcOffset(t)})),O="".concat(o,"-handle"),k=r.map((function(t,r){var a,c=b[r]||0;(u||null===b[r])&&(c=null);var f=n===r;return m({className:d()((a={},Object(i.a)(a,O,!0),Object(i.a)(a,"".concat(O,"-").concat(r+1),!0),Object(i.a)(a,"".concat(O,"-dragging"),f),a)),prefixCls:o,vertical:s,dragging:f,offset:M[r],value:t,index:r,tabIndex:c,min:l,max:h,reverse:p,disabled:u,style:g[r],ref:function(t){return e.saveHandle(r,t)},ariaLabel:y[r],ariaLabelledBy:w[r],ariaValueTextFormatter:x[r]})}));return{tracks:r.slice(0,-1).map((function(e,t){var n,r=t+1,a=d()((n={},Object(i.a)(n,"".concat(o,"-track"),!0),Object(i.a)(n,"".concat(o,"-track-").concat(r),!0),n));return f.a.createElement(pl,{className:a,vertical:s,reverse:p,included:c,offset:M[r-1],length:M[r]-M[r-1],style:v[t],key:r})})),handles:k}}}],[{key:"getDerivedStateFromProps",value:function(e,t){if(!("value"in e||"min"in e||"max"in e))return null;var n=e.value||t.bounds,r=n.map((function(n,r){return Rl({value:n,handle:r,bounds:t.bounds,props:e})}));if(t.bounds.length===r.length){if(r.every((function(e,n){return e===t.bounds[n]})))return null}else r=n.map((function(t,n){return Rl({value:t,handle:n,props:e})}));return Object(mt.a)(Object(mt.a)({},t),{},{bounds:r})}}]),n}(f.a.Component);zl.displayName="Range",zl.defaultProps={count:1,allowCross:!0,pushable:!1,draggableTrack:!1,tabIndex:[],ariaLabelGroupForHandles:[],ariaLabelledByGroupForHandles:[],ariaValueTextFormatterGroupForHandles:[]};var Ll=Pl(zl),Il=n(320),Dl=l.forwardRef((function(e,t){var n=e.visible,i=e.overlay,a=l.useRef(null),o=Object(ge.a)(t,a),s=l.useRef(null);function c(){b.a.cancel(s.current)}return l.useEffect((function(){return n?s.current=Object(b.a)((function(){var e;null===(e=a.current)||void 0===e||e.forcePopupAlign()})):c(),c}),[n,i]),l.createElement(Il.a,Object(r.a)({ref:o},e))}));var Bl=Nl;Bl.Range=Ll,Bl.Handle=bl,Bl.createSliderWithTooltip=function(e){var t;return(t=function(t){Object(s.a)(u,t);var n=Object(c.a)(u);function u(){var e;return Object(a.a)(this,u),(e=n.apply(this,arguments)).state={visibles:{}},e.handleTooltipVisibleChange=function(t,n){e.setState((function(e){return{visibles:Object(mt.a)(Object(mt.a)({},e.visibles),{},Object(i.a)({},t,n))}}))},e.handleWithTooltip=function(t){var n,i=t.value,a=t.dragging,o=t.index,s=t.disabled,c=Object(yr.a)(t,["value","dragging","index","disabled"]),u=e.props,l=u.tipFormatter,h=u.tipProps,d=u.handleStyle,p=u.getTooltipContainer,m=h.prefixCls,v=void 0===m?"rc-slider-tooltip":m,g=h.overlay,b=void 0===g?l(i):g,y=h.placement,w=void 0===y?"top":y,x=h.visible,M=void 0!==x&&x,O=Object(yr.a)(h,["prefixCls","overlay","placement","visible"]);return n=Array.isArray(d)?d[o]||d[0]:d,f.a.createElement(Dl,Object(r.a)({},O,{getTooltipContainer:p,prefixCls:v,overlay:b,placement:w,visible:!s&&(e.state.visibles[o]||a)||M,key:o}),f.a.createElement(bl,Object(r.a)({},c,{style:Object(mt.a)({},n),value:i,onMouseEnter:function(){return e.handleTooltipVisibleChange(o,!0)},onMouseLeave:function(){return e.handleTooltipVisibleChange(o,!1)}})))},e}return Object(o.a)(u,[{key:"render",value:function(){return f.a.createElement(e,Object(r.a)({},this.props,{handle:this.handleWithTooltip}))}}]),u}(f.a.Component)).defaultProps={tipFormatter:function(e){return e},handleStyle:[{}],tipProps:{},getTooltipContainer:function(e){return e.parentNode}},t};var Hl=Bl,Fl=l.forwardRef((function(e,t){var n=e.visible,i=Object(l.useRef)(null),a=Object(l.useRef)(null);function o(){b.a.cancel(a.current),a.current=null}return l.useEffect((function(){return n?a.current=Object(b.a)((function(){var e;null===(e=i.current)||void 0===e||e.forcePopupAlign(),a.current=null})):o(),o}),[n,e.title]),l.createElement(Se.a,Object(r.a)({ref:Object(ge.a)(i,t)},e))})),Vl=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0?l.createElement("a",{className:"".concat(i,"-action"),onClick:function(e){e.preventDefault(),!a&&s&&s(e)}},l.createElement(ue.a,null)):l.createElement("span",{className:"".concat(i,"-action")},l.createElement(Pi.a,null)))}var lf=n(195),ff=function(e){var t,n,r=e.renderedText,a=e.renderedEl,o=e.item,s=e.checked,c=e.disabled,u=e.prefixCls,f=e.onClick,h=e.onRemove,p=e.showRemove,m=d()((t={},Object(i.a)(t,"".concat(u,"-content-item"),!0),Object(i.a)(t,"".concat(u,"-content-item-disabled"),c||o.disabled),Object(i.a)(t,"".concat(u,"-content-item-checked"),s),t));return"string"!==typeof r&&"number"!==typeof r||(n=String(r)),l.createElement(Xn.a,{componentName:"Transfer",defaultLocale:ns.a.Transfer},(function(e){var t={className:m,title:n},r=l.createElement("span",{className:"".concat(u,"-content-item-text")},a);return p?l.createElement("li",t,r,l.createElement(gu,{disabled:c||o.disabled,className:"".concat(u,"-content-item-remove"),"aria-label":e.remove,onClick:function(){null===h||void 0===h||h(o)}},l.createElement(lf.a,null))):(t.onClick=c||o.disabled?void 0:function(){return f(o)},l.createElement("li",t,l.createElement(ua.a,{checked:s,disabled:c||o.disabled}),r))}))},hf=l.memo(ff),df=Object(yi.a)("handleFilter","handleClear","checkedKeys");function pf(e){if(!e)return null;var t={pageSize:10};return"object"===Object(u.a)(e)?Object(r.a)(Object(r.a)({},t),e):t}var mf=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){var e;return Object(a.a)(this,n),(e=t.apply(this,arguments)).state={current:1},e.onItemSelect=function(t){var n=e.props,r=n.onItemSelect,i=n.selectedKeys.indexOf(t.key)>=0;r(t.key,!i)},e.onItemRemove=function(t){var n=e.props.onItemRemove;null===n||void 0===n||n([t.key])},e.onPageChange=function(t){e.setState({current:t})},e.getItems=function(){var t=e.state.current,n=e.props,r=n.pagination,i=n.filteredRenderItems,a=pf(r),o=i;return a&&(o=i.slice((t-1)*a.pageSize,t*a.pageSize)),o},e}return Object(o.a)(n,[{key:"render",value:function(){var e=this,t=this.state.current,n=this.props,r=n.prefixCls,a=n.onScroll,o=n.filteredRenderItems,s=n.selectedKeys,c=n.disabled,u=n.showRemove,f=pf(n.pagination),h=null;return f&&(h=l.createElement(fc.a,{simple:!0,size:"small",disabled:c,className:"".concat(r,"-pagination"),total:o.length,pageSize:f.pageSize,current:t,onChange:this.onPageChange})),l.createElement(l.Fragment,null,l.createElement("ul",{className:d()("".concat(r,"-content"),Object(i.a)({},"".concat(r,"-content-show-remove"),u)),onScroll:a},this.getItems().map((function(t){var n=t.renderedEl,i=t.renderedText,a=t.item,o=a.disabled,f=s.indexOf(a.key)>=0;return l.createElement(hf,{disabled:c||o,key:a.key,item:a,renderedText:i,renderedEl:n,checked:f,prefixCls:r,onClick:e.onItemSelect,onRemove:e.onItemRemove,showRemove:u})}))),h)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.filteredRenderItems,r=e.pagination,i=t.current,a=pf(r);if(a){var o=Math.ceil(n.length/a.pageSize);if(i>o)return{current:o}}return null}}]),n}(l.Component),vf=function(){return null};function gf(e){return e.filter((function(e){return!e.disabled})).map((function(e){return e.key}))}var bf=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var i;return Object(a.a)(this,n),(i=t.call(this,e)).defaultListBodyRef=l.createRef(),i.handleFilter=function(e){var t=i.props.handleFilter,n=e.target.value;i.setState({filterValue:n}),t(e)},i.handleClear=function(){var e=i.props.handleClear;i.setState({filterValue:""}),e()},i.matchFilter=function(e,t){var n=i.state.filterValue,r=i.props.filterOption;return r?r(n,t):e.indexOf(n)>=0},i.getCurrentPageItems=function(){},i.renderListBody=function(e,t){var n=e?e(t):null,a=!!n;return a||(n=l.createElement(mf,Object(r.a)({ref:i.defaultListBodyRef},t))),{customize:a,bodyContent:n}},i.renderItem=function(e){var t,n=i.props.render,r=(void 0===n?vf:n)(e),a=(t=r)&&!Object(X.b)(t)&&"[object Object]"===Object.prototype.toString.call(t);return{renderedText:a?r.value:r,renderedEl:a?r.label:r,item:e}},i.getSelectAllLabel=function(e,t){var n=i.props,r=n.itemsUnit,a=n.itemUnit,o=n.selectAllLabel;if(o)return"function"===typeof o?o({selectedCount:e,totalCount:t}):o;var s=t>1?r:a;return l.createElement(l.Fragment,null,(e>0?"".concat(e,"/"):"")+t," ",s)},i.state={filterValue:""},i}return Object(o.a)(n,[{key:"componentWillUnmount",value:function(){clearTimeout(this.triggerScrollTimer)}},{key:"getCheckStatus",value:function(e){var t=this.props.checkedKeys;return 0===t.length?"none":e.every((function(e){return t.indexOf(e.key)>=0||!!e.disabled}))?"all":"part"}},{key:"getFilteredItems",value:function(e,t){var n=this,r=[],i=[];return e.forEach((function(e){var a=n.renderItem(e),o=a.renderedText;if(t&&!n.matchFilter(o,e))return null;r.push(e),i.push(a)})),{filteredItems:r,filteredRenderItems:i}}},{key:"getListBody",value:function(e,t,n,i,a,o,s,c,u,f){var h,m=u?l.createElement("div",{className:"".concat(e,"-body-search-wrapper")},l.createElement(uf,{prefixCls:"".concat(e,"-search"),onChange:this.handleFilter,handleClear:this.handleClear,placeholder:t,value:n,disabled:f})):null,v=this.renderListBody(c,Object(r.a)(Object(r.a)({},Object(p.a)(this.props,df)),{filteredItems:i,filteredRenderItems:o,selectedKeys:s})),g=v.bodyContent;return h=v.customize?l.createElement("div",{className:"".concat(e,"-body-customize-wrapper")},g):i.length?g:l.createElement("div",{className:"".concat(e,"-body-not-found")},a),l.createElement("div",{className:d()(u?"".concat(e,"-body ").concat(e,"-body-with-search"):"".concat(e,"-body"))},m,h)}},{key:"getCheckBox",value:function(e,t,n,r){var i=this.getCheckStatus(e),a="all"===i;return!1!==n&&l.createElement(ua.a,{disabled:r,checked:a,indeterminate:"part"===i,onChange:function(){t(e.filter((function(e){return!e.disabled})).map((function(e){return e.key})),!a)}})}},{key:"render",value:function(){var e,t=this,n=this.state.filterValue,r=this.props,a=r.prefixCls,o=r.dataSource,s=r.titleText,c=r.checkedKeys,u=r.disabled,f=r.footer,h=r.showSearch,p=r.style,m=r.searchPlaceholder,v=r.notFoundContent,g=r.selectAll,b=r.selectCurrent,y=r.selectInvert,w=r.removeAll,x=r.removeCurrent,M=r.renderList,O=r.onItemSelectAll,k=r.onItemRemove,E=r.showSelectAll,_=r.showRemove,S=r.pagination,C=f&&f(this.props),j=d()(a,(e={},Object(i.a)(e,"".concat(a,"-with-pagination"),S),Object(i.a)(e,"".concat(a,"-with-footer"),C),e)),T=this.getFilteredItems(o,n),A=T.filteredItems,P=T.filteredRenderItems,N=this.getListBody(a,m,n,A,v,P,c,M,h,u),R=C?l.createElement("div",{className:"".concat(a,"-footer")},C):null,z=!_&&!S&&this.getCheckBox(A,O,E,u),L=null;L=_?l.createElement(nt.a,null,S&&l.createElement(nt.a.Item,{onClick:function(){var e,n=gf(((null===(e=t.defaultListBodyRef.current)||void 0===e?void 0:e.getItems())||[]).map((function(e){return e.item})));null===k||void 0===k||k(n)}},x),l.createElement(nt.a.Item,{onClick:function(){null===k||void 0===k||k(gf(A))}},w)):l.createElement(nt.a,null,l.createElement(nt.a.Item,{onClick:function(){var e=gf(A);O(e,e.length!==c.length)}},g),S&&l.createElement(nt.a.Item,{onClick:function(){var e,n=(null===(e=t.defaultListBodyRef.current)||void 0===e?void 0:e.getItems())||[];O(gf(n.map((function(e){return e.item}))),!0)}},b),l.createElement(nt.a.Item,{onClick:function(){var e,n;n=gf(S?((null===(e=t.defaultListBodyRef.current)||void 0===e?void 0:e.getItems())||[]).map((function(e){return e.item})):A);var r=new Set(c),i=[],a=[];n.forEach((function(e){r.has(e)?a.push(e):i.push(e)})),O(i,!0),O(a,!1)}},y));var I=l.createElement(Ga.a,{className:"".concat(a,"-header-dropdown"),overlay:L,disabled:u},l.createElement(Xe.a,null));return l.createElement("div",{className:j,style:p},l.createElement("div",{className:"".concat(a,"-header")},z,I,l.createElement("span",{className:"".concat(a,"-header-selected")},this.getSelectAllLabel(c.length,A.length)),l.createElement("span",{className:"".concat(a,"-header-title")},s)),N,R)}}]),n}(l.PureComponent);bf.defaultProps={dataSource:[],titleText:"",showSearch:!1};var yf=function(e){var t=e.disabled,n=e.moveToLeft,r=e.moveToRight,i=e.leftArrowText,a=void 0===i?"":i,o=e.rightArrowText,s=void 0===o?"":o,c=e.leftActive,u=e.rightActive,f=e.className,h=e.style,d=e.direction,p=e.oneWay;return l.createElement("div",{className:f,style:h},l.createElement(ct.a,{type:"primary",size:"small",disabled:t||!u,onClick:r,icon:"rtl"!==d?l.createElement(hr.a,null):l.createElement(bi.a,null)},s),!p&&l.createElement(ct.a,{type:"primary",size:"small",disabled:t||!c,onClick:n,icon:"rtl"!==d?l.createElement(bi.a,null):l.createElement(hr.a,null)},a))},wf=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var o;Object(a.a)(this,n),(o=t.call(this,e)).separatedDataSource=null,o.setStateKeys=function(e,t){"left"===e?o.setState((function(e){var n=e.sourceSelectedKeys;return{sourceSelectedKeys:"function"===typeof t?t(n||[]):t}})):o.setState((function(e){var n=e.targetSelectedKeys;return{targetSelectedKeys:"function"===typeof t?t(n||[]):t}}))},o.getLocale=function(e,t){return Object(r.a)(Object(r.a)(Object(r.a)({},e),{notFoundContent:t("Transfer")}),o.props.locale)},o.moveTo=function(e){var t=o.props,n=t.targetKeys,r=void 0===n?[]:n,i=t.dataSource,a=void 0===i?[]:i,s=t.onChange,c=o.state,u=c.sourceSelectedKeys,l=c.targetSelectedKeys,f=("right"===e?u:l).filter((function(e){return!a.some((function(t){return!(e!==t.key||!t.disabled)}))})),h="right"===e?f.concat(r):r.filter((function(e){return-1===f.indexOf(e)})),d="right"===e?"left":"right";o.setStateKeys(d,[]),o.handleSelectChange(d,[]),s&&s(h,e,f)},o.moveToLeft=function(){return o.moveTo("left")},o.moveToRight=function(){return o.moveTo("right")},o.onItemSelectAll=function(e,t,n){o.setStateKeys(e,(function(r){var i=[];return i=n?Array.from(new Set([].concat(Object(g.a)(r),Object(g.a)(t)))):r.filter((function(e){return-1===t.indexOf(e)})),o.handleSelectChange(e,i),i}))},o.onLeftItemSelectAll=function(e,t){return o.onItemSelectAll("left",e,t)},o.onRightItemSelectAll=function(e,t){return o.onItemSelectAll("right",e,t)},o.handleFilter=function(e,t){var n=o.props.onSearch,r=t.target.value;n&&n(e,r)},o.handleLeftFilter=function(e){return o.handleFilter("left",e)},o.handleRightFilter=function(e){return o.handleFilter("right",e)},o.handleClear=function(e){var t=o.props.onSearch;t&&t(e,"")},o.handleLeftClear=function(){return o.handleClear("left")},o.handleRightClear=function(){return o.handleClear("right")},o.onItemSelect=function(e,t,n){var r=o.state,i=r.sourceSelectedKeys,a=r.targetSelectedKeys,s="left"===e?Object(g.a)(i):Object(g.a)(a),c=s.indexOf(t);c>-1&&s.splice(c,1),n&&s.push(t),o.handleSelectChange(e,s),o.props.selectedKeys||o.setStateKeys(e,s)},o.onLeftItemSelect=function(e,t){return o.onItemSelect("left",e,t)},o.onRightItemSelect=function(e,t){return o.onItemSelect("right",e,t)},o.onRightItemRemove=function(e){var t=o.props,n=t.targetKeys,r=void 0===n?[]:n,i=t.onChange;o.setStateKeys("right",[]),i&&i(r.filter((function(t){return!e.includes(t)})),"left",Object(g.a)(e))},o.handleScroll=function(e,t){var n=o.props.onScroll;n&&n(e,t)},o.handleLeftScroll=function(e){return o.handleScroll("left",e)},o.handleRightScroll=function(e){return o.handleScroll("right",e)},o.handleListStyle=function(e,t){return"function"===typeof e?e({direction:t}):e},o.renderTransfer=function(e){return l.createElement(v.a,null,(function(t){var n,a=t.getPrefixCls,s=t.renderEmpty,c=t.direction,u=o.props,f=u.prefixCls,h=u.className,p=u.disabled,m=u.operations,v=void 0===m?[]:m,g=u.showSearch,b=u.footer,y=u.style,w=u.listStyle,x=u.operationStyle,M=u.filterOption,O=u.render,k=u.children,E=u.showSelectAll,_=u.oneWay,S=u.pagination,C=a("transfer",f),j=o.getLocale(e,s),T=o.state,A=T.sourceSelectedKeys,P=T.targetSelectedKeys,N=!k&&S,R=o.separateDataSource(),z=R.leftDataSource,L=R.rightDataSource,I=P.length>0,D=A.length>0,B=d()(C,(n={},Object(i.a)(n,"".concat(C,"-disabled"),p),Object(i.a)(n,"".concat(C,"-customize-list"),!!k),Object(i.a)(n,"".concat(C,"-rtl"),"rtl"===c),n),h),H=o.getTitles(j),F=o.props.selectAllLabels||[];return l.createElement("div",{className:B,style:y},l.createElement(bf,Object(r.a)({prefixCls:"".concat(C,"-list"),titleText:H[0],dataSource:z,filterOption:M,style:o.handleListStyle(w,"left"),checkedKeys:A,handleFilter:o.handleLeftFilter,handleClear:o.handleLeftClear,onItemSelect:o.onLeftItemSelect,onItemSelectAll:o.onLeftItemSelectAll,render:O,showSearch:g,renderList:k,footer:b,onScroll:o.handleLeftScroll,disabled:p,direction:"left",showSelectAll:E,selectAllLabel:F[0],pagination:N},j)),l.createElement(yf,{className:"".concat(C,"-operation"),rightActive:D,rightArrowText:v[0],moveToRight:o.moveToRight,leftActive:I,leftArrowText:v[1],moveToLeft:o.moveToLeft,style:x,disabled:p,direction:c,oneWay:_}),l.createElement(bf,Object(r.a)({prefixCls:"".concat(C,"-list"),titleText:H[1],dataSource:L,filterOption:M,style:o.handleListStyle(w,"right"),checkedKeys:P,handleFilter:o.handleRightFilter,handleClear:o.handleRightClear,onItemSelect:o.onRightItemSelect,onItemSelectAll:o.onRightItemSelectAll,onItemRemove:o.onRightItemRemove,render:O,showSearch:g,renderList:k,footer:b,onScroll:o.handleRightScroll,disabled:p,direction:"right",showSelectAll:E,selectAllLabel:F[1],showRemove:_,pagination:N},j)))}))};var s=e.selectedKeys,c=void 0===s?[]:s,u=e.targetKeys,f=void 0===u?[]:u;return o.state={sourceSelectedKeys:c.filter((function(e){return-1===f.indexOf(e)})),targetSelectedKeys:c.filter((function(e){return f.indexOf(e)>-1}))},o}return Object(o.a)(n,[{key:"getTitles",value:function(e){var t=this.props.titles;return t||e.titles}},{key:"handleSelectChange",value:function(e,t){var n=this.state,r=n.sourceSelectedKeys,i=n.targetSelectedKeys,a=this.props.onSelectChange;a&&("left"===e?a(t,i):a(r,t))}},{key:"separateDataSource",value:function(){var e=this.props,t=e.dataSource,n=e.rowKey,i=e.targetKeys,a=void 0===i?[]:i,o=[],s=new Array(a.length);return t.forEach((function(e){n&&(e=Object(r.a)(Object(r.a)({},e),{key:n(e)}));var t=a.indexOf(e.key);-1!==t?s[t]=e:o.push(e)})),{leftDataSource:o,rightDataSource:s}}},{key:"render",value:function(){return l.createElement(Xn.a,{componentName:"Transfer",defaultLocale:ns.a.Transfer},this.renderTransfer)}}],[{key:"getDerivedStateFromProps",value:function(e){var t=e.selectedKeys,n=e.targetKeys,r=e.pagination,i=e.children;if(t){var a=n||[];return{sourceSelectedKeys:t.filter((function(e){return!a.includes(e)})),targetSelectedKeys:t.filter((function(e){return a.includes(e)}))}}return Object(Y.a)(!r||!i,"Transfer","`pagination` not support customize render list."),null}}]),n}(l.Component);wf.List=bf,wf.Operation=yf,wf.Search=uf,wf.defaultProps={dataSource:[],locale:{},showSearch:!1,listStyle:function(){}};var xf=wf,Mf=n(209),Of=n(49),kf=n(44),Ef=n(319),_f=n(129),Sf=function(e,t){var n=e.className,i=e.style,a=e.motion,o=e.motionNodes,s=e.motionType,c=e.onMotionStart,u=e.onMotionEnd,f=e.active,h=e.treeNodeRequiredProps,p=Object(yr.a)(e,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),m=l.useState(!0),v=Object(q.a)(m,2),g=v[0],b=v[1],y=l.useContext(Mf.a).prefixCls,w=l.useRef(!1),x=function(){w.current||u(),w.current=!0};return Object(l.useEffect)((function(){o&&"hide"===s&&g&&b(!1)}),[o]),Object(l.useEffect)((function(){return o&&c(),function(){o&&x()}}),[]),o?l.createElement(le.b,Object(r.a)({ref:t,visible:g},a,{motionAppear:"show"===s,onAppearEnd:x,onLeaveEnd:x}),(function(e,t){var n=e.className,i=e.style;return l.createElement("div",{ref:t,className:d()("".concat(y,"-treenode-motion"),n),style:i},o.map((function(e){var t=e.data,n=t.key,i=Object(yr.a)(t,["key"]),a=e.isStart,o=e.isEnd;delete i.children;var s=Object(kf.f)(n,h);return l.createElement(_f.a,Object(r.a)({},i,s,{active:f,data:e.data,key:n,isStart:a,isEnd:o}))})))})):l.createElement(_f.a,Object(r.a)({domRef:t,className:n,style:i},p,{active:f}))};Sf.displayName="MotionTreeNode";var Cf=l.forwardRef(Sf);function jf(e,t,n){var r=e.findIndex((function(e){return e.data.key===n})),i=e[r+1],a=t.findIndex((function(e){return e.data.key===n}));if(i){var o=t.findIndex((function(e){return e.data.key===i.data.key}));return t.slice(a+1,o)}return t.slice(a+1)}var Tf={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},Af=function(){},Pf="RC_TREE_MOTION_".concat(Math.random()),Nf={key:Pf},Rf={key:Pf,level:0,index:0,pos:"0",node:Nf},zf={parent:null,children:[],pos:Rf.pos,data:Nf,isStart:[],isEnd:[]};function Lf(e,t,n,r){return!1!==t&&n?e.slice(0,Math.ceil(n/r)+1):e}function If(e){var t=e.data.key,n=e.pos;return Object(kf.e)(t,n)}var Df=function(e,t){var n=e.prefixCls,i=e.data,a=(e.selectable,e.checkable,e.expandedKeys),o=e.selectedKeys,s=e.checkedKeys,c=e.loadedKeys,u=e.loadingKeys,f=e.halfCheckedKeys,h=e.keyEntities,d=e.disabled,p=e.dragging,m=e.dragOverNodeKey,v=e.dropPosition,g=e.motion,b=e.height,y=e.itemHeight,w=e.virtual,x=e.focusable,M=e.activeItem,O=e.focused,k=e.tabIndex,E=e.onKeyDown,_=e.onFocus,S=e.onBlur,C=e.onActiveChange,j=e.onListChangeStart,T=e.onListChangeEnd,A=Object(yr.a)(e,["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"]),P=l.useRef(null),N=l.useRef(null);l.useImperativeHandle(t,(function(){return{scrollTo:function(e){P.current.scrollTo(e)},getIndentWidth:function(){return N.current.offsetWidth}}}));var R=l.useState(a),z=Object(q.a)(R,2),L=z[0],I=z[1],D=l.useState(i),B=Object(q.a)(D,2),H=B[0],F=B[1],V=l.useState(i),U=Object(q.a)(V,2),W=U[0],G=U[1],K=l.useState([]),Y=Object(q.a)(K,2),X=Y[0],Z=Y[1],J=l.useState(null),Q=Object(q.a)(J,2),$=Q[0],ee=Q[1];function te(){F(i),G(i),Z([]),ee(null),T()}l.useEffect((function(){I(a);var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.length,r=t.length;if(1!==Math.abs(n-r))return{add:!1,key:null};function i(e,t){var n=new Map;e.forEach((function(e){n.set(e,!0)}));var r=t.filter((function(e){return!n.has(e)}));return 1===r.length?r[0]:null}return n ").concat(t);return t}(M)),l.createElement("div",{role:"tree"},l.createElement("input",{style:Tf,disabled:!1===x||d,tabIndex:!1!==x?k:null,onKeyDown:E,onFocus:_,onBlur:S,value:"",onChange:Af})),l.createElement("div",{className:"".concat(n,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden"}},l.createElement("div",{className:"".concat(n,"-indent")},l.createElement("div",{ref:N,className:"".concat(n,"-indent-unit")}))),l.createElement(Ef.a,Object(r.a)({},A,{data:ne,itemKey:If,height:b,fullHeight:!1,virtual:w,itemHeight:y,prefixCls:"".concat(n,"-list"),ref:P}),(function(e){var t=e.pos,n=e.data,i=n.key,a=Object(yr.a)(n,["key"]),o=e.isStart,s=e.isEnd,c=Object(kf.e)(i,t);delete a.children;var u=Object(kf.f)(c,re);return l.createElement(Cf,Object(r.a)({},a,u,{active:!!M&&i===M.data.key,pos:t,data:e.data,isStart:o,isEnd:s,motion:g,motionNodes:i===Pf?X:null,motionType:$,onMotionStart:j,onMotionEnd:te,treeNodeRequiredProps:re,onMouseMove:function(){C(null)}}))})))},Bf=l.forwardRef(Df);Bf.displayName="NodeList";var Hf=Bf,Ff=n(109);var Vf=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){var e;return Object(a.a)(this,n),(e=t.apply(this,arguments)).destroyed=!1,e.state={keyEntities:{},indent:null,selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],dragging:!1,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null},e.dragStartMousePosition=null,e.listRef=l.createRef(),e.onNodeDragStart=function(t,n){var r=e.state,i=r.expandedKeys,a=r.keyEntities,o=e.props.onDragStart,s=n.props.eventKey;e.dragNode=n,e.dragStartMousePosition={x:t.clientX,y:t.clientY};var c=Object(Of.b)(i,s);e.setState({dragging:!0,dragChildrenKeys:Object(Of.g)(s,a),indent:e.listRef.current.getIndentWidth()}),e.setExpandedKeys(c),window.addEventListener("dragend",e.onWindowDragEnd),o&&o({event:t,node:Object(kf.b)(n.props)})},e.onNodeDragEnter=function(t,n){var r=e.state,i=r.expandedKeys,a=r.keyEntities,o=r.dragChildrenKeys,s=r.flattenNodes,c=r.indent,u=e.props,l=u.onDragEnter,f=u.onExpand,h=u.allowDrop,d=u.direction,p=n.props.pos,m=Object(R.a)(e).dragNode,v=Object(Of.c)(t,n,c,e.dragStartMousePosition,h,s,a,i,d),b=v.dropPosition,y=v.dropLevelOffset,w=v.dropTargetKey,x=v.dropContainerKey,M=v.dropTargetPos,O=v.dropAllowed,k=v.dragOverNodeKey;m&&-1===o.indexOf(w)&&O?(e.delayedDragEnterLogic||(e.delayedDragEnterLogic={}),Object.keys(e.delayedDragEnterLogic).forEach((function(t){clearTimeout(e.delayedDragEnterLogic[t])})),m.props.eventKey!==n.props.eventKey&&(t.persist(),e.delayedDragEnterLogic[p]=window.setTimeout((function(){if(e.state.dragging){var r=Object(g.a)(i),o=a[n.props.eventKey];o&&(o.children||[]).length&&(r=Object(Of.a)(i,n.props.eventKey)),"expandedKeys"in e.props||e.setExpandedKeys(r),f&&f(r,{node:Object(kf.b)(n.props),expanded:!0,nativeEvent:t.nativeEvent})}}),800)),m.props.eventKey!==w||0!==y?(e.setState({dragOverNodeKey:k,dropPosition:b,dropLevelOffset:y,dropTargetKey:w,dropContainerKey:x,dropTargetPos:M,dropAllowed:O}),l&&l({event:t,node:Object(kf.b)(n.props),expandedKeys:i})):e.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})):e.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})},e.onNodeDragOver=function(t,n){var r=e.state,i=r.dragChildrenKeys,a=r.flattenNodes,o=r.keyEntities,s=r.expandedKeys,c=r.indent,u=e.props,l=u.onDragOver,f=u.allowDrop,h=u.direction,d=Object(R.a)(e).dragNode,p=Object(Of.c)(t,n,c,e.dragStartMousePosition,f,a,o,s,h),m=p.dropPosition,v=p.dropLevelOffset,g=p.dropTargetKey,b=p.dropContainerKey,y=p.dropAllowed,w=p.dropTargetPos,x=p.dragOverNodeKey;d&&-1===i.indexOf(g)&&y&&(d.props.eventKey===g&&0===v?null===e.state.dropPosition&&null===e.state.dropLevelOffset&&null===e.state.dropTargetKey&&null===e.state.dropContainerKey&&null===e.state.dropTargetPos&&!1===e.state.dropAllowed&&null===e.state.dragOverNodeKey||e.setState({dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1,dragOverNodeKey:null}):m===e.state.dropPosition&&v===e.state.dropLevelOffset&&g===e.state.dropTargetKey&&b===e.state.dropContainerKey&&w===e.state.dropTargetPos&&y===e.state.dropAllowed&&x===e.state.dragOverNodeKey||e.setState({dropPosition:m,dropLevelOffset:v,dropTargetKey:g,dropContainerKey:b,dropTargetPos:w,dropAllowed:y,dragOverNodeKey:x}),l&&l({event:t,node:Object(kf.b)(n.props)}))},e.onNodeDragLeave=function(t,n){var r=e.props.onDragLeave;r&&r({event:t,node:Object(kf.b)(n.props)})},e.onWindowDragEnd=function(t){e.onNodeDragEnd(t,null,!0),window.removeEventListener("dragend",e.onWindowDragEnd)},e.onNodeDragEnd=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e.props.onDragEnd;e.setState({dragOverNodeKey:null}),e.cleanDragState(),i&&!r&&i({event:t,node:Object(kf.b)(n.props)}),e.dragNode=null},e.onNodeDrop=function(t,n){var r,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=e.state,o=a.dragChildrenKeys,s=a.dropPosition,c=a.dropTargetKey,u=a.dropTargetPos,l=a.dropAllowed;if(l){var f=e.props.onDrop;if(e.setState({dragOverNodeKey:null}),e.cleanDragState(),null!==c){var h=Object(mt.a)(Object(mt.a)({},Object(kf.f)(c,e.getTreeNodeRequiredProps())),{},{active:(null===(r=e.getActiveItem())||void 0===r?void 0:r.data.key)===c,data:e.state.keyEntities[c].node}),d=-1!==o.indexOf(c);Object(ft.a)(!d,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var p=Object(Of.k)(u),m={event:t,node:Object(kf.b)(h),dragNode:e.dragNode?Object(kf.b)(e.dragNode.props):null,dragNodesKeys:[e.dragNode.props.eventKey].concat(o),dropToGap:0!==s,dropPosition:s+Number(p[p.length-1])};f&&!i&&f(m),e.dragNode=null}}},e.cleanDragState=function(){e.state.dragging&&e.setState({dragging:!1,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),e.dragStartMousePosition=null},e.onNodeClick=function(t,n){var r=e.props.onClick;r&&r(t,n)},e.onNodeDoubleClick=function(t,n){var r=e.props.onDoubleClick;r&&r(t,n)},e.onNodeSelect=function(t,n){var r=e.state.selectedKeys,i=e.state.keyEntities,a=e.props,o=a.onSelect,s=a.multiple,c=n.selected,u=n.key,l=!c,f=(r=l?s?Object(Of.a)(r,u):[u]:Object(Of.b)(r,u)).map((function(e){var t=i[e];return t?t.node:null})).filter((function(e){return e}));e.setUncontrolledState({selectedKeys:r}),o&&o(r,{event:"select",selected:l,node:n,selectedNodes:f,nativeEvent:t.nativeEvent})},e.onNodeCheck=function(t,n,r){var i,a=e.state,o=a.keyEntities,s=a.checkedKeys,c=a.halfCheckedKeys,u=e.props,l=u.checkStrictly,f=u.onCheck,h=n.key,d={event:"check",node:n,checked:r,nativeEvent:t.nativeEvent};if(l){var p=r?Object(Of.a)(s,h):Object(Of.b)(s,h);i={checked:p,halfChecked:Object(Of.b)(c,h)},d.checkedNodes=p.map((function(e){return o[e]})).filter((function(e){return e})).map((function(e){return e.node})),e.setUncontrolledState({checkedKeys:p})}else{var m=Object(Ff.a)([].concat(Object(g.a)(s),[h]),!0,o),v=m.checkedKeys,b=m.halfCheckedKeys;if(!r){var y=new Set(v);y.delete(h);var w=Object(Ff.a)(Array.from(y),{checked:!1,halfCheckedKeys:b},o);v=w.checkedKeys,b=w.halfCheckedKeys}i=v,d.checkedNodes=[],d.checkedNodesPositions=[],d.halfCheckedKeys=b,v.forEach((function(e){var t=o[e];if(t){var n=t.node,r=t.pos;d.checkedNodes.push(n),d.checkedNodesPositions.push({node:n,pos:r})}})),e.setUncontrolledState({checkedKeys:v},!1,{halfCheckedKeys:b})}f&&f(i,d)},e.onNodeLoad=function(t){return new Promise((function(n){e.setState((function(r){var i=r.loadedKeys,a=void 0===i?[]:i,o=r.loadingKeys,s=void 0===o?[]:o,c=e.props,u=c.loadData,l=c.onLoad,f=t.key;return u&&-1===a.indexOf(f)&&-1===s.indexOf(f)?(u(t).then((function(){var r=e.state,i=r.loadedKeys,a=r.loadingKeys,o=Object(Of.a)(i,f),s=Object(Of.b)(a,f);l&&l(o,{event:"load",node:t}),e.setUncontrolledState({loadedKeys:o}),e.setState({loadingKeys:s}),n()})),{loadingKeys:Object(Of.a)(s,f)}):{}}))}))},e.onNodeMouseEnter=function(t,n){var r=e.props.onMouseEnter;r&&r({event:t,node:n})},e.onNodeMouseLeave=function(t,n){var r=e.props.onMouseLeave;r&&r({event:t,node:n})},e.onNodeContextMenu=function(t,n){var r=e.props.onRightClick;r&&(t.preventDefault(),r({event:t,node:n}))},e.onFocus=function(){var t=e.props.onFocus;e.setState({focused:!0}),t&&t.apply(void 0,arguments)},e.onBlur=function(){var t=e.props.onBlur;e.setState({focused:!1}),e.onActiveChange(null),t&&t.apply(void 0,arguments)},e.getTreeNodeRequiredProps=function(){var t=e.state;return{expandedKeys:t.expandedKeys||[],selectedKeys:t.selectedKeys||[],loadedKeys:t.loadedKeys||[],loadingKeys:t.loadingKeys||[],checkedKeys:t.checkedKeys||[],halfCheckedKeys:t.halfCheckedKeys||[],dragOverNodeKey:t.dragOverNodeKey,dropPosition:t.dropPosition,keyEntities:t.keyEntities}},e.setExpandedKeys=function(t){var n=e.state.treeData,r=Object(kf.d)(n,t);e.setUncontrolledState({expandedKeys:t,flattenNodes:r},!0)},e.onNodeExpand=function(t,n){var r=e.state.expandedKeys,i=e.state.listChanging,a=e.props,o=a.onExpand,s=a.loadData,c=n.key,u=n.expanded;if(!i){var l=r.indexOf(c),f=!u;if(Object(ft.a)(u&&-1!==l||!u&&-1===l,"Expand state not sync with index check"),r=f?Object(Of.a)(r,c):Object(Of.b)(r,c),e.setExpandedKeys(r),o&&o(r,{node:n,expanded:f,nativeEvent:t.nativeEvent}),f&&s){var h=e.onNodeLoad(n);h&&h.then((function(){var t=Object(kf.d)(e.state.treeData,r);e.setUncontrolledState({flattenNodes:t})}))}}},e.onListChangeStart=function(){e.setUncontrolledState({listChanging:!0})},e.onListChangeEnd=function(){setTimeout((function(){e.setUncontrolledState({listChanging:!1})}))},e.onActiveChange=function(t){var n=e.state.activeKey,r=e.props.onActiveChange;n!==t&&(e.setState({activeKey:t}),null!==t&&e.scrollTo({key:t}),r&&r(t))},e.getActiveItem=function(){var t=e.state,n=t.activeKey,r=t.flattenNodes;return null===n?null:r.find((function(e){return e.data.key===n}))||null},e.offsetActiveKey=function(t){var n=e.state,r=n.flattenNodes,i=n.activeKey,a=r.findIndex((function(e){return e.data.key===i}));-1===a&&t<0&&(a=r.length);var o=r[a=(a+t+r.length)%r.length];if(o){var s=o.data.key;e.onActiveChange(s)}else e.onActiveChange(null)},e.onKeyDown=function(t){var n=e.state,r=n.activeKey,i=n.expandedKeys,a=n.checkedKeys,o=e.props,s=o.onKeyDown,c=o.checkable,u=o.selectable;switch(t.which){case vt.a.UP:e.offsetActiveKey(-1),t.preventDefault();break;case vt.a.DOWN:e.offsetActiveKey(1),t.preventDefault()}var l=e.getActiveItem();if(l&&l.data){var f=e.getTreeNodeRequiredProps(),h=!1===l.data.isLeaf||!!(l.data.children||[]).length,d=Object(kf.b)(Object(mt.a)(Object(mt.a)({},Object(kf.f)(r,f)),{},{data:l.data,active:!0}));switch(t.which){case vt.a.LEFT:h&&i.includes(r)?e.onNodeExpand({},d):l.parent&&e.onActiveChange(l.parent.data.key),t.preventDefault();break;case vt.a.RIGHT:h&&!i.includes(r)?e.onNodeExpand({},d):l.children&&l.children.length&&e.onActiveChange(l.children[0].data.key),t.preventDefault();break;case vt.a.ENTER:case vt.a.SPACE:!c||d.disabled||!1===d.checkable||d.disableCheckbox?c||!u||d.disabled||!1===d.selectable||e.onNodeSelect({},d):e.onNodeCheck({},d,!a.includes(r))}}s&&s(t)},e.setUncontrolledState=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e.destroyed){var i=!1,a=!0,o={};Object.keys(t).forEach((function(n){n in e.props?a=!1:(i=!0,o[n]=t[n])})),!i||n&&!a||e.setState(Object(mt.a)(Object(mt.a)({},o),r))}},e.scrollTo=function(t){e.listRef.current.scrollTo(t)},e}return Object(o.a)(n,[{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"render",value:function(){var e,t=this.state,n=t.focused,a=t.flattenNodes,o=t.keyEntities,s=t.dragging,c=t.activeKey,u=t.dropLevelOffset,f=t.dropContainerKey,h=t.dropTargetKey,p=t.dropPosition,m=t.dragOverNodeKey,v=t.indent,g=this.props,b=g.prefixCls,y=g.className,w=g.style,x=g.showLine,M=g.focusable,O=g.tabIndex,k=void 0===O?0:O,E=g.selectable,_=g.showIcon,S=g.icon,C=g.switcherIcon,j=g.draggable,T=g.checkable,A=g.checkStrictly,P=g.disabled,N=g.motion,R=g.loadData,z=g.filterTreeNode,L=g.height,I=g.itemHeight,D=g.virtual,B=g.titleRender,H=g.dropIndicatorRender,F=g.onContextMenu,V=g.direction,U=Object(Of.f)(this.props);return l.createElement(Mf.a.Provider,{value:{prefixCls:b,selectable:E,showIcon:_,icon:S,switcherIcon:C,draggable:j,checkable:T,checkStrictly:A,disabled:P,keyEntities:o,dropLevelOffset:u,dropContainerKey:f,dropTargetKey:h,dropPosition:p,dragOverNodeKey:m,indent:v,direction:V,dropIndicatorRender:H,loadData:R,filterTreeNode:z,titleRender:B,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},l.createElement("div",{className:d()(b,y,(e={},Object(i.a)(e,"".concat(b,"-show-line"),x),Object(i.a)(e,"".concat(b,"-focused"),n),Object(i.a)(e,"".concat(b,"-active-focused"),null!==c),e))},l.createElement(Hf,Object(r.a)({ref:this.listRef,prefixCls:b,style:w,data:a,disabled:P,selectable:E,checkable:!!T,motion:N,dragging:s,height:L,itemHeight:I,virtual:D,focusable:M,focused:n,tabIndex:k,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:F},this.getTreeNodeRequiredProps(),U))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n,r=t.prevProps,a={prevProps:e};function o(t){return!r&&t in e||r&&r[t]!==e[t]}if(o("treeData")?n=e.treeData:o("children")&&(Object(ft.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),n=Object(kf.c)(e.children)),n){a.treeData=n;var s=Object(kf.a)(n);a.keyEntities=Object(mt.a)(Object(i.a)({},Pf,Rf),s.keyEntities)}var c,u=a.keyEntities||t.keyEntities;if(o("expandedKeys")||r&&o("autoExpandParent"))a.expandedKeys=e.autoExpandParent||!r&&e.defaultExpandParent?Object(Of.e)(e.expandedKeys,u):e.expandedKeys;else if(!r&&e.defaultExpandAll){var l=Object(mt.a)({},u);delete l[Pf],a.expandedKeys=Object.keys(l).map((function(e){return l[e].key}))}else!r&&e.defaultExpandedKeys&&(a.expandedKeys=e.autoExpandParent||e.defaultExpandParent?Object(Of.e)(e.defaultExpandedKeys,u):e.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,n||a.expandedKeys){var f=Object(kf.d)(n||t.treeData,a.expandedKeys||t.expandedKeys);a.flattenNodes=f}if((e.selectable&&(o("selectedKeys")?a.selectedKeys=Object(Of.d)(e.selectedKeys,e):!r&&e.defaultSelectedKeys&&(a.selectedKeys=Object(Of.d)(e.defaultSelectedKeys,e))),e.checkable)&&(o("checkedKeys")?c=Object(Of.j)(e.checkedKeys)||{}:!r&&e.defaultCheckedKeys?c=Object(Of.j)(e.defaultCheckedKeys)||{}:n&&(c=Object(Of.j)(e.checkedKeys)||{checkedKeys:t.checkedKeys,halfCheckedKeys:t.halfCheckedKeys}),c)){var h=c,d=h.checkedKeys,p=void 0===d?[]:d,m=h.halfCheckedKeys,v=void 0===m?[]:m;if(!e.checkStrictly){var g=Object(Ff.a)(p,!0,u);p=g.checkedKeys,v=g.halfCheckedKeys}a.checkedKeys=p,a.halfCheckedKeys=v}return o("loadedKeys")&&(a.loadedKeys=e.loadedKeys),a}}]),n}(l.Component);Vf.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:function(e){var t=e.dropPosition,n=e.dropLevelOffset,r=e.indent,i={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(t){case-1:i.top=0,i.left=-n*r;break;case 1:i.bottom=0,i.left=-n*r;break;case 0:i.bottom=0,i.left=r}return l.createElement("div",{style:i})},allowDrop:function(){return!0}},Vf.TreeNode=_f.a;var Uf,Wf=Vf,qf=n(192),Gf=n(283),Kf=n(284);function Yf(e,t){e.forEach((function(e){var n=e.key,r=e.children;!1!==t(n,e)&&Yf(r||[],t)}))}function Xf(e){var t=e.treeData,n=e.expandedKeys,r=e.startKey,i=e.endKey,a=[],o=Uf.None;if(r&&r===i)return[r];if(!r||!i)return[];return Yf(t,(function(e){if(o===Uf.End)return!1;if(function(e){return e===r||e===i}(e)){if(a.push(e),o===Uf.None)o=Uf.Start;else if(o===Uf.Start)return o=Uf.End,!1}else o===Uf.Start&&a.push(e);return-1!==n.indexOf(e)})),a}function Zf(e,t){var n=Object(g.a)(t),r=[];return Yf(e,(function(e,t){var i=n.indexOf(e);return-1!==i&&(r.push(t),n.splice(i,1)),!!n.length})),r}!function(e){e[e.None=0]="None",e[e.Start=1]="Start",e[e.End=2]="End"}(Uf||(Uf={}));var Jf=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i1&&void 0!==arguments[1]?arguments[1]:"select",r=arguments.length>2?arguments[2]:void 0,i=e.get(t);return!r&&mh(i,n)?null:i}),[e]),l.useCallback((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"select",r=arguments.length>2?arguments[2]:void 0,i=t.get(e);return!r&&mh(i,n)?null:i}),[t])]}function gh(e){return l.useMemo((function(){var t=new Map,n=new Map;return e.forEach((function(e){t.set(e.key,e),n.set(e.data.value,e)})),[t,n]}),[e])}var bh={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},yh=function(e,t){var n=e.prefixCls,r=e.height,i=e.itemHeight,a=e.virtual,o=e.options,s=e.flattenOptions,c=e.multiple,u=e.searchValue,f=e.onSelect,h=e.onToggleOpen,d=e.open,p=e.notFoundContent,m=e.onMouseEnter,v=l.useContext(ph),b=v.checkable,y=v.checkedKeys,w=v.halfCheckedKeys,x=v.treeExpandedKeys,M=v.treeDefaultExpandAll,O=v.treeDefaultExpandedKeys,k=v.onTreeExpand,E=v.treeIcon,_=v.showTreeIcon,S=v.switcherIcon,C=v.treeLine,j=v.treeNodeFilterProp,T=v.loadData,A=v.treeLoadedKeys,P=v.treeMotion,N=v.onTreeLoad,R=l.useRef(),z=Object(Qt.a)((function(){return o}),[d,o],(function(e,t){return t[0]&&e[1]!==t[1]})),L=gh(s),I=Object(q.a)(L,2),D=vh(I[0],I[1]),B=Object(q.a)(D,2),H=B[0],F=B[1],V=l.useMemo((function(){return y.map((function(e){var t=F(e);return t?t.key:null}))}),[y]),U=l.useMemo((function(){return b?{checked:V,halfChecked:w}:null}),[V,w,b]);l.useEffect((function(){var e;d&&!c&&V.length&&(null===(e=R.current)||void 0===e||e.scrollTo({key:V[0]}))}),[d]);var W=String(u).toLowerCase(),G=l.useState(O),K=Object(q.a)(G,2),Y=K[0],X=K[1],Z=l.useState(null),J=Object(q.a)(Z,2),Q=J[0],$=J[1],ee=l.useMemo((function(){return x?Object(g.a)(x):u?Q:Y}),[Y,Q,W,x]);l.useEffect((function(){u&&$(s.map((function(e){return e.key})))}),[u]);var te=function(e){e.preventDefault()},ne=function(e,t){var n=t.node.key,r=H(n,b?"checkbox":"select");null!==r&&f(r.data.value,{selected:!y.includes(r.data.value)}),c||h(!1)},re=l.useState(null),ie=Object(q.a)(re,2),ae=ie[0],oe=ie[1],se=H(ae);if(l.useImperativeHandle(t,(function(){return{onKeyDown:function(e){var t;switch(e.which){case vt.a.UP:case vt.a.DOWN:case vt.a.LEFT:case vt.a.RIGHT:null===(t=R.current)||void 0===t||t.onKeyDown(e);break;case vt.a.ENTER:null!==se&&ne(0,{node:{key:ae},selected:!y.includes(se.data.value)});break;case vt.a.ESC:h(!1)}},onKeyUp:function(){}}})),0===z.length)return l.createElement("div",{role:"listbox",className:"".concat(n,"-empty"),onMouseDown:te},p);var ce={};return A&&(ce.loadedKeys=A),ee&&(ce.expandedKeys=ee),l.createElement("div",{onMouseDown:te,onMouseEnter:m},se&&d&&l.createElement("span",{style:bh,"aria-live":"assertive"},se.data.value),l.createElement(Wf,Object.assign({ref:R,focusable:!1,prefixCls:"".concat(n,"-tree"),treeData:z,height:r,itemHeight:i,virtual:a,multiple:c,icon:E,showIcon:_,switcherIcon:S,showLine:C,loadData:u?null:T,motion:P,checkable:b,checkStrictly:!0,checkedKeys:U,selectedKeys:b?[]:V,defaultExpandAll:M},ce,{onActiveChange:oe,onSelect:ne,onCheck:ne,onExpand:function(e){X(e),$(e),k&&k(e)},onLoad:N,filterTreeNode:function(e){return!!W&&String(e[j]).toLowerCase().includes(W)}})))},wh=l.forwardRef(yh);wh.displayName="OptionList";var xh=wh,Mh=function(){return null};function Oh(e){if(!e)return e;var t=Object(mt.a)({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return Object(ft.a)(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),t}}),t}function kh(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}function Eh(e,t){var n=new Map;return t.forEach((function(e){var t=e.data;n.set(t.value,t)})),e.map((function(e){return Oh(n.get(e))}))}function _h(e){return e.disabled||e.disableCheckbox||!1===e.checkable}function Sh(e){for(var t=0,n=e.parent;n;)n=n.parent,t+=1;return t}function Ch(e){return Object(kf.d)(function e(t){return(t||[]).map((function(t){var n=t.value,r=t.key,i=t.children,a=Object(mt.a)(Object(mt.a)({},t),{},{key:"key"in t?r:n});return i&&(a.children=e(i)),a}))}(e),!0).map((function(e){return{key:e.data.key,data:e.data,level:Sh(e)}}))}function jh(e,t,n,r){var i=new Map;return kh(t).forEach((function(e){e&&"object"===Object(u.a)(e)&&"value"in e&&i.set(e.value,e)})),e.map((function(e){var t={value:e},a=n(e,"select",!0),o=a?r(a.data):e;if(i.has(e)){var s=i.get(e);t.label="label"in s?s.label:o,"halfChecked"in s&&(t.halfChecked=s.halfChecked)}else t.label=o;return t}))}function Th(e,t){new Set;return function e(n){return(n||[]).map((function(n){var r=n.key,i=n.value,a=n.children,o=Object(yr.a)(n,["key","value","children"]),s="value"in n?i:r,c=Object(mt.a)(Object(mt.a)({},o),{},{key:null!==r&&void 0!==r?r:s,value:s,title:t(n)});return"children"in n&&(c.children=e(a)),c}))}(e)}function Ah(e,t,n){var r=n.getLabelProp,i=n.simpleMode,a=l.useRef({});return e?(a.current.formatTreeData=a.current.treeData===e?a.current.formatTreeData:Th(i?function(e,t){var n=t.id,r=t.pId,i=t.rootPId,a={},o=[];return e.map((function(e){var t=Object(mt.a)({},e),r=t[n];return a[r]=t,t.key=t.key||r,t})).forEach((function(e){var t=e[r],n=a[t];n&&(n.children=n.children||[],n.children.push(e)),(t===i||!n&&null===i)&&o.push(e)})),o}(e,Object(mt.a)({id:"id",pId:"pId",rootPId:null},!0!==i?i:{})):e,r),a.current.treeData=e):a.current.formatTreeData=a.current.children===t?a.current.formatTreeData:Th(function e(t){return Object(G.a)(t).map((function(t){if(!l.isValidElement(t)||!t.type)return null;var n=t.key,r=t.props,i=r.children,a=r.value,o=Object(yr.a)(r,["children","value"]),s=Object(mt.a)({key:n,value:a},o),c=e(i);return c.length&&(s.children=c),s})).filter((function(e){return e}))}(t),r),a.current.formatTreeData}function Ph(e,t,n){var r=new Set(e);return"SHOW_CHILD"===t?e.filter((function(e){var t=n[e];return!(t&&t.children&&t.children.every((function(e){var t=e.node;return _h(t)||r.has(t.key)})))})):"SHOW_PARENT"===t?e.filter((function(e){var t=n[e],i=t?t.parent:null;return!(i&&!_h(i.node)&&r.has(i.node.key))})):e}var Nh=["expandedKeys","treeData","treeCheckable","showCheckedStrategy","searchPlaceholder","treeLine","treeIcon","showTreeIcon","switcherIcon","treeNodeFilterProp","filterTreeNode","dropdownPopupAlign","treeDefaultExpandAll","treeCheckStrictly","treeExpandedKeys","treeLoadedKeys","treeMotion","onTreeExpand","onTreeLoad","loadData","treeDataSimpleMode","treeNodeLabelProp","treeDefaultExpandedKeys"],Rh=Object(fh.a)({prefixCls:"rc-tree-select",components:{optionList:xh},convertChildrenToData:function(){return null},flattenOptions:Ch,getLabeledValue:hh.e,filterOptions:function(e,t,n){var r,i=n.optionFilterProp,a=n.filterOption;return!1===a?t:(r="function"===typeof a?a:function(e){return function(t,n){var r=n[e];return String(r).toLowerCase().includes(String(t).toLowerCase())}}(i),function t(n){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n.map((function(n){var a=n.children,o=i||r(e,Oh(n)),s=t(a||[],o);return o||s.length?Object(mt.a)(Object(mt.a)({},n),{},{children:s}):null})).filter((function(e){return e}))}(t))},isValueDisabled:function(e,t){var n=Eh([e],t)[0];return!!n&&n.disabled},findValueOption:Eh,omitDOMProps:function(e){var t=Object(mt.a)({},e);return Nh.forEach((function(e){delete t[e]})),t}});Rh.displayName="Select";var zh=l.forwardRef((function(e,t){var n=e.multiple,r=e.treeCheckable,i=e.treeCheckStrictly,a=e.showCheckedStrategy,o=void 0===a?"SHOW_CHILD":a,s=e.labelInValue,c=e.loadData,f=e.treeLoadedKeys,h=e.treeNodeFilterProp,d=void 0===h?"value":h,p=e.treeNodeLabelProp,m=e.treeDataSimpleMode,v=e.treeData,b=e.treeExpandedKeys,y=e.treeDefaultExpandedKeys,w=e.treeDefaultExpandAll,x=e.children,M=e.treeIcon,O=e.showTreeIcon,k=e.switcherIcon,E=e.treeLine,_=e.treeMotion,S=e.filterTreeNode,C=e.dropdownPopupAlign,j=e.onChange,T=e.onTreeExpand,A=e.onTreeLoad,P=e.onDropdownVisibleChange,N=e.onSelect,R=e.onDeselect,z=r||i,L=n||z,I=r&&!i,D=i||s,B=l.useRef(null);l.useImperativeHandle(t,(function(){return{focus:B.current.focus,blur:B.current.blur}}));var H=function(e){return v&&e.label||e.title},F=function(e){return p?e[p]:H(e)},V=Ah(v,x,{getLabelProp:H,simpleMode:m}),U=gh(Object(l.useMemo)((function(){return Ch(V)}),[V])),W=Object(q.a)(U,2),G=vh(W[0],W[1]),K=Object(q.a)(G,2),Y=K[0],X=K[1],Z=Object(l.useMemo)((function(){return I?Object(kf.a)(V):{keyEntities:null}}),[V,r,i]).keyEntities,J=Object(ze.a)(e.defaultValue,{value:e.value}),Q=Object(q.a)(J,2),$=Q[0],ee=Q[1],te=function(e){var t=[],n=[];return e.forEach((function(e){X(e)?n.push(e):t.push(e)})),{missingRawValues:t,existRawValues:n}},ne=Object(l.useMemo)((function(){var e=[],t=[];if(kh($).forEach((function(n){if(n&&"object"===Object(u.a)(n)&&"value"in n)if(n.halfChecked&&i){var r=X(n.value);e.push(r?r.key:n.value)}else t.push(n.value);else t.push(n)})),I){var n=te(t),r=n.missingRawValues,a=n.existRawValues.map((function(e){return X(e).key})),o=Object(Ff.a)(a,!0,Z),s=o.checkedKeys,c=o.halfCheckedKeys;return[[].concat(Object(g.a)(r),Object(g.a)(s.map((function(e){return Y(e).data.value})))),c]}return[t,e]}),[$,L,D,r,i]),re=Object(q.a)(ne,2),ie=re[0],ae=re[1],oe=function(e,t){var n=t.value,r=t.getEntityByValue,i=t.getEntityByKey,a=t.treeConduction,o=t.showCheckedStrategy,s=t.conductKeyEntities,c=t.getLabelProp;return l.useMemo((function(){var t=e;a&&(t=Ph(e.map((function(e){var t=r(e);return t?t.key:e})),o,s).map((function(e){var t=i(e);return t?t.data.value:e})));return jh(t,n,r,c)}),[e,n,a,o,r])}(ie,{treeConduction:I,value:$,showCheckedStrategy:o,conductKeyEntities:Z,getEntityByValue:X,getEntityByKey:Y,getLabelProp:F}),se=function(e,t,n){if(ee(L?e:e[0]),j){var r=e;if(I&&"SHOW_ALL"!==o){var a=Ph(e.map((function(e){var t=X(e);return t?t.key:e})),o,Z);r=a.map((function(e){var t=Y(e);return t?t.data.value:e}))}var s=t||{triggerValue:void 0,selected:void 0},c=s.triggerValue,u=s.selected,f=D?jh(r,$,X,F):r;if(i){var h=ae.map((function(e){var t=Y(e);return t?t.data.value:e})).filter((function(e){return!r.includes(e)}));f=[].concat(Object(g.a)(f),Object(g.a)(jh(h,$,X,F)))}var d={preValue:oe,triggerValue:c},p=!0;(i||"selection"===n&&!u)&&(p=!1),function(e,t,n,r,i){var a=null,o=null;function s(){o||(o=[],function e(r){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0",s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return r.map((function(r,c){var u="".concat(i,"-").concat(c),f=n.includes(r.value),h=e(r.children||[],u,f),d=l.createElement(Mh,Object.assign({},r),h.map((function(e){return e.node})));if(t===r.value&&(a=d),f){var p={pos:u,node:d,children:h};return s||o.push(p),p}return null})).filter((function(e){return e}))}(r),o.sort((function(e,t){var r=e.node.props.value,i=t.node.props.value;return n.indexOf(r)-n.indexOf(i)})))}Object.defineProperty(e,"triggerNode",{get:function(){return Object(ft.a)(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),s(),a}}),Object.defineProperty(e,"allCheckedNodes",{get:function(){return Object(ft.a)(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),s(),i?o:o.map((function(e){return e.node}))}})}(d,c,e,V,p),z?d.checked=u:d.selected=u,j(L?f:f[0],D?null:r.map((function(e){var t=X(e);return t?F(t.data):null})),d)}},ce=l.useCallback((function(e){if(P){var t={};Object.defineProperty(t,"documentClickClose",{get:function(){return Object(ft.a)(!1,"Second param of `onDropdownVisibleChange` has been removed."),!1}}),P(e,t)}}),[P]);var ue={optionLabelProp:null,optionFilterProp:d,dropdownAlign:C,internalProps:{mark:dh.a,onClear:function(){se([],null,"clear")},skipTriggerChange:!0,skipTriggerSelect:!0,onRawSelect:function(e,t,n){var r=e;if(L){var i=function(e,t){var n=new Set(e);return n.add(t),Array.from(n)}(ie,e);if(I){var a=te(i),o=a.missingRawValues,s=a.existRawValues.map((function(e){return X(e).key})),c=Object(Ff.a)(s,!0,Z).checkedKeys;i=[].concat(Object(g.a)(o),Object(g.a)(c.map((function(e){return Y(e).data.value}))))}se(i,{selected:!0,triggerValue:e},n)}else se([e],{selected:!0,triggerValue:e},n);N&&N(r,t)},onRawDeselect:function(e,t,n){var r=e,i=function(e,t){var n=new Set(e);return n.delete(t),Array.from(n)}(ie,e);if(I){var a=te(i),o=a.missingRawValues,s=a.existRawValues.map((function(e){return X(e).key})),c=Object(Ff.a)(s,{checked:!1,halfCheckedKeys:ae},Z).checkedKeys;i=[].concat(Object(g.a)(o),Object(g.a)(c.map((function(e){return Y(e).data.value}))))}se(i,{selected:!1,triggerValue:e},n),R&&R(r,t)}}};return"filterTreeNode"in e&&(ue.filterOption=S),l.createElement(ph.Provider,{value:{checkable:z,loadData:c,treeLoadedKeys:f,onTreeLoad:A,checkedKeys:ie,halfCheckedKeys:ae,treeDefaultExpandAll:w,treeExpandedKeys:b,treeDefaultExpandedKeys:y,onTreeExpand:T,treeIcon:M,treeMotion:_,showTreeIcon:O,switcherIcon:k,treeLine:E,treeNodeFilterProp:d}},l.createElement(Rh,Object.assign({ref:B,mode:L?"multiple":null},e,ue,{value:oe,labelInValue:!0,options:V,onChange:null,onSelect:null,onDeselect:null,onDropdownVisibleChange:ce})))})),Lh=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){var e;return Object(a.a)(this,n),(e=t.apply(this,arguments)).selectRef=l.createRef(),e.focus=function(){e.selectRef.current.focus()},e.blur=function(){e.selectRef.current.blur()},e}return Object(o.a)(n,[{key:"render",value:function(){return l.createElement(zh,Object.assign({ref:this.selectRef},this.props))}}]),n}(l.Component);Lh.TreeNode=Mh,Lh.SHOW_ALL="SHOW_ALL",Lh.SHOW_PARENT="SHOW_PARENT",Lh.SHOW_CHILD="SHOW_CHILD";var Ih=Lh,Dh=n(307),Bh=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.length,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=Math.floor((r+i)/2),s=n.slice(0,o);if(t.textContent=s,r>=i-1)for(var c=i;c>=r;c-=1){var u=n.slice(0,c);if(t.textContent=u,m()||!u)return c===n.length?{finished:!1,reactNode:n}:{finished:!0,reactNode:u}}return m()?e(t,n,o,i,o):e(t,n,r,o,a)}(i,r)}return{finished:!1,reactNode:null}}return y.appendChild(w),g.forEach((function(e){id.appendChild(e)})),v.some((function(e,t){var n=M(e,t),r=n.finished,i=n.reactNode;return i&&b.push(i),r})),{content:b,text:id.innerHTML,ellipsis:!0}},vd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i1&&S,T=u;if(M&&a&&!o&&!S){var A=y.title,P=A||"";A||"string"!==typeof u&&"number"!==typeof u||(P=String(u)),P=null===P||void 0===P?void 0:P.slice(String(n||"").length),T=l.createElement(l.Fragment,null,n,l.createElement("span",{title:P,"aria-hidden":"true"},"..."),O),k&&(T=l.createElement(Se.a,{title:!0===k?u:k},l.createElement("span",null,T)))}else T=l.createElement(l.Fragment,null,u,O);return T=function(e,t){var n=e.mark,r=e.code,i=e.underline,a=e.delete,o=e.strong,s=e.keyboard,c=t;function u(e,t){e&&(c=l.createElement(t,{},c))}return u(o,"strong"),u(i,"u"),u(a,"del"),u(r,"code"),u(n,"mark"),u(s,"kbd"),c}(this.props,T),l.createElement(Xn.a,{componentName:"Text"},(function(t){var n,a=t.edit,o=t.copy,s=t.copied,u=t.expand;return e.editStr=a,e.copyStr=o,e.copiedStr=s,e.expandStr=u,l.createElement(m.a,{onResize:e.resizeOnNextFrame,disabled:!M},l.createElement(ad,Object(r.a)({className:d()((n={},Object(i.a)(n,"".concat(E,"-").concat(h),h),Object(i.a)(n,"".concat(E,"-disabled"),v),Object(i.a)(n,"".concat(E,"-ellipsis"),M),Object(i.a)(n,"".concat(E,"-ellipsis-single-line"),C),Object(i.a)(n,"".concat(E,"-ellipsis-multiple-line"),j),n),f),style:Object(r.a)(Object(r.a)({},b),{WebkitLineClamp:j?M:void 0}),component:c,ref:e.contentRef,direction:w},_),T,e.renderOperations()))}))}},{key:"render",value:function(){return this.getEditable().editing?this.renderEditInput():this.renderContent()}}],[{key:"getDerivedStateFromProps",value:function(e){var t=e.children,n=e.editable;return Object(Y.a)(!n||"string"===typeof t,"Typography","When `editable` is enabled, the `children` should use string."),{}}}]),n}(l.Component);yd.contextType=v.b,yd.defaultProps={children:""};var wd=yd,xd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0&&(t.percent=t.loaded/t.total*100),e.onProgress(t)});var n=new FormData;e.data&&Object.keys(e.data).forEach((function(t){var r=e.data[t];Array.isArray(r)?r.forEach((function(e){n.append("".concat(t,"[]"),e)})):n.append(t,e.data[t])})),e.file instanceof Blob?n.append(e.filename,e.file,e.file.name):n.append(e.filename,e.file),t.onerror=function(t){e.onError(t)},t.onload=function(){return t.status<200||t.status>=300?e.onError(function(e,t){var n="cannot ".concat(e.method," ").concat(e.action," ").concat(t.status,"'"),r=new Error(n);return r.status=t.status,r.method=e.method,r.url=e.action,r}(e,t),Nd(t)):e.onSuccess(Nd(t),t)},t.open(e.method,e.action,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);var r=e.headers||{};return null!==r["X-Requested-With"]&&t.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(r).forEach((function(e){null!==r[e]&&t.setRequestHeader(e,r[e])})),t.send(n),{abort:function(){t.abort()}}}var zd=+new Date,Ld=0;function Id(){return"rc-upload-".concat(zd,"-").concat(++Ld)}var Dd=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",i=e.type||"",a=i.replace(/\/.*$/,"");return n.some((function(e){var t,n,o=e.trim();return"."===o.charAt(0)?(t=r.toLowerCase(),n=o.toLowerCase(),-1!==t.indexOf(n,t.length-n.length)):/\/\*$/.test(o)?a===o.replace(/\/.*$/,""):i===o}))}return!0};var Bd=function(e,t,n){var r=function e(r,i){r.path=i||"",r.isFile?r.file((function(e){n(e)&&(r.fullPath&&!e.webkitRelativePath&&(Object.defineProperties(e,{webkitRelativePath:{writable:!0}}),e.webkitRelativePath=r.fullPath.replace(/^\//,""),Object.defineProperties(e,{webkitRelativePath:{writable:!1}})),t([e]))})):r.isDirectory&&function(e,t){var n=e.createReader(),r=[];!function e(){n.readEntries((function(n){var i=Array.prototype.slice.apply(n);r=r.concat(i),!i.length?t(r):e()}))}()}(r,(function(t){t.forEach((function(t){e(t,"".concat(i).concat(r.name,"/"))}))}))};e.forEach((function(e){r(e.webkitGetAsEntry())}))},Hd=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){var e;return Object(a.a)(this,n),(e=t.apply(this,arguments)).state={uid:Id()},e.reqs={},e.onChange=function(t){var n=t.target.files;e.uploadFiles(n),e.reset()},e.onClick=function(t){var n=e.fileInput;if(n){var r=e.props,i=r.children,a=r.onClick;if(i&&"button"===i.type){var o=n.parentNode;o.focus(),o.querySelector("button").blur()}n.click(),a&&a(t)}},e.onKeyDown=function(t){"Enter"===t.key&&e.onClick(t)},e.onFileDrop=function(t){var n=e.props.multiple;if(t.preventDefault(),"dragover"!==t.type)if(e.props.directory)Bd(Array.prototype.slice.call(t.dataTransfer.items),e.uploadFiles,(function(t){return Dd(t,e.props.accept)}));else{var r=Array.prototype.slice.call(t.dataTransfer.files).filter((function(t){return Dd(t,e.props.accept)}));!1===n&&(r=r.slice(0,1)),e.uploadFiles(r)}},e.uploadFiles=function(t){var n=Array.prototype.slice.call(t);n.map((function(e){return e.uid=Id(),e})).forEach((function(t){e.upload(t,n)}))},e.saveFileInput=function(t){e.fileInput=t},e}return Object(o.a)(n,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(e,t){var n=this,r=this.props;if(r.beforeUpload){var i=r.beforeUpload(e,t);i&&"boolean"!==typeof i&&i.then?i.then((function(t){var r=Object.prototype.toString.call(t);"[object File]"!==r&&"[object Blob]"!==r?n.post(e):n.post(t)})).catch((function(e){console.log(e)})):!1!==i&&Promise.resolve().then((function(){n.post(e)}))}else Promise.resolve().then((function(){n.post(e)}))}},{key:"post",value:function(e){var t=this;if(this._isMounted){var n=this.props,r=n.onStart,i=n.onProgress,a=n.transformFile,o=void 0===a?function(e){return e}:a;new Promise((function(t){var r=n.action;return"function"===typeof r&&(r=r(e)),t(r)})).then((function(a){var s=e.uid,c=n.customRequest||Rd;Promise.resolve(o(e)).then((function(e){var t=n.data;return"function"===typeof t&&(t=t(e)),Promise.all([e,t])})).catch((function(e){console.error(e)})).then((function(o){var u=Object(q.a)(o,2),l=u[0],f=u[1],h={action:a,filename:n.name,data:f,file:l,headers:n.headers,withCredentials:n.withCredentials,method:n.method||"post",onProgress:i?function(t){i(t,e)}:null,onSuccess:function(r,i){delete t.reqs[s],n.onSuccess(r,e,i)},onError:function(r,i){delete t.reqs[s],n.onError(r,i,e)}};r(e),t.reqs[s]=c(h)}))}))}}},{key:"reset",value:function(){this.setState({uid:Id()})}},{key:"abort",value:function(e){var t=this.reqs;if(e){var n=e.uid?e.uid:e;t[n]&&t[n].abort&&t[n].abort(),delete t[n]}else Object.keys(t).forEach((function(e){t[e]&&t[e].abort&&t[e].abort(),delete t[e]}))}},{key:"render",value:function(){var e,t=this.props,n=t.component,a=t.prefixCls,o=t.className,s=t.disabled,c=t.id,u=t.style,l=t.multiple,h=t.accept,p=t.children,m=t.directory,v=t.openFileDialogOnClick,g=t.onMouseEnter,b=t.onMouseLeave,y=Object(yr.a)(t,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),w=d()((e={},Object(i.a)(e,a,!0),Object(i.a)(e,"".concat(a,"-disabled"),s),Object(i.a)(e,o,o),e)),x=m?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},M=s?{}:{onClick:v?this.onClick:function(){},onKeyDown:v?this.onKeyDown:function(){},onMouseEnter:g,onMouseLeave:b,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return f.a.createElement(n,Object(r.a)({},M,{className:w,role:"button",style:u}),f.a.createElement("input",Object(r.a)({},Object(Pd.a)(y,{aria:!0,data:!0}),{id:c,type:"file",ref:this.saveFileInput,onClick:function(e){return e.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:h},x,{multiple:l,onChange:this.onChange})),p)}}]),n}(l.Component);function Fd(){}var Vd=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){var e;return Object(a.a)(this,n),(e=t.apply(this,arguments)).saveUploader=function(t){e.uploader=t},e}return Object(o.a)(n,[{key:"abort",value:function(e){this.uploader.abort(e)}},{key:"render",value:function(){return f.a.createElement(Hd,Object(r.a)({},this.props,{ref:this.saveUploader}))}}]),n}(l.Component);Vd.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:Fd,onError:Fd,onSuccess:Fd,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var Ud=Vd,Wd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ia?u=-((s=a*(200/e))-o)/2:c=-((o=e*(200/a))-s)/2,r.drawImage(i,c,u,o,s);var l=n.toDataURL();document.body.removeChild(n),t(l)},i.src=window.URL.createObjectURL(e)}else t("")}))},isImageUrl:function(e){if(e.type&&!e.thumbUrl)return $d(e.type);var t=e.thumbUrl||e.url,n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.split("/"),n=t[t.length-1],r=n.split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(r)||[""])[0]}(t);return!(!/^data:image\//.test(t)&&!/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico)$/i.test(n))||!/^data:/.test(t)&&!n}};var ap=ip;function op(e,t){var n=Object(l.useRef)(e),r=Object(ko.a)(),i=Object(l.useRef)();function a(e){n.current=e,r()}function o(){b.a.cancel(i.current)}return Object(l.useEffect)((function(){var e;t&&(e=t,o(),i.current=Object(b.a)((function(){a(e)})))}),[t]),Object(l.useEffect)((function(){return function(){o()}}),[]),[function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e&&t||n.current},a]}var sp=function(e,t){var n,a=e.fileList,o=e.defaultFileList,s=e.onRemove,c=e.showUploadList,u=e.listType,f=e.onPreview,h=e.onDownload,p=e.onChange,m=e.previewFile,b=e.disabled,y=e.locale,w=e.iconRender,x=e.isImageUrl,M=e.progress,O=e.prefixCls,k=e.className,E=e.type,_=e.children,S=e.style,C=e.itemRender,j=e.maxCount,T=l.useState("drop"),A=Object(q.a)(T,2),P=A[0],N=A[1],R=Object(ko.a)(),z=op(a||o||[],a),L=Object(q.a)(z,2),I=L[0],D=L[1],B=l.useRef();l.useEffect((function(){Object(Y.a)("fileList"in e||!("value"in e),"Upload","`value` is not a valid prop, do you mean `fileList`?"),Object(Y.a)(!("transformFile"in e),"Upload","`transformFile` is deprecated. Please use `beforeUpload` directly.")}),[]),l.useEffect((function(){var e=Date.now();(a||[]).forEach((function(t,n){var r;t.uid=null!==(r=t.uid)&&void 0!==r?r:"__AUTO__".concat(e,"_").concat(n,"__")}))}),[a]);var H=function(e){var t=Object(g.a)(e.fileList);1===j?t=t.slice(-1):j&&(t=t.slice(0,j)),D(t),null===p||void 0===p||p(Object(r.a)(Object(r.a)({},e),{fileList:t}))},F=function(e){var t=Jd(e);t.status="uploading";var n=I().concat(),r=n.findIndex((function(e){return e.uid===t.uid}));-1===r?n.push(t):n[r]=t,H({file:t,fileList:n})},V=function(e,t,n){try{"string"===typeof e&&(e=JSON.parse(e))}catch(a){}var i=Qd(t,I());i&&(i.status="done",i.response=e,i.xhr=n,H({file:Object(r.a)({},i),fileList:I().concat()}))},U=function(e,t){var n=Qd(t,I());n&&(n.percent=e.percent,H({event:e,file:Object(r.a)({},n),fileList:I().concat()}))},W=function(e,t,n){var i=Qd(n,I());i&&(i.error=e,i.response=t,i.status="error",H({file:Object(r.a)({},i),fileList:I().concat()}))},G=function(e){var t;Promise.resolve("function"===typeof s?s(e):s).then((function(n){var i;if(!1!==n){var a=I(),o=function(e,t){var n=void 0!==e.uid?"uid":"name",r=t.filter((function(t){return t[n]!==e[n]}));return r.length===t.length?null:r}(e,a);o&&(t=Object(r.a)(Object(r.a)({},e),{status:"removed"}),null===a||void 0===a||a.forEach((function(e){var n=void 0!==t.uid?"uid":"name";e[n]===t[n]&&(e.status="removed")})),null===(i=B.current)||void 0===i||i.abort(t),H({file:t,fileList:o}))}}))},K=function(e){N(e.type)};l.useImperativeHandle(t,(function(){return{onStart:F,onSuccess:V,onProgress:U,onError:W,fileList:I(),upload:B.current,forceUpdate:R}}));var X=l.useContext(v.b),Z=X.getPrefixCls,J=X.direction,Q=Z("upload",O),$=Object(r.a)(Object(r.a)({onStart:F,onError:W,onProgress:U,onSuccess:V},e),{prefixCls:Q,beforeUpload:function(t,n){var r=e.beforeUpload;if(!r)return!0;var i=r(t,n);if(!1===i){var a=[];return I().concat(n.map(Jd)).forEach((function(e){a.every((function(t){return t.uid!==e.uid}))&&a.push(e)})),H({file:t,fileList:a}),!1}return!i||!i.then||i},onChange:void 0});delete $.className,delete $.style,_&&!b||delete $.id;var ee=function(e){return c?l.createElement(Xn.a,{componentName:"Upload",defaultLocale:ns.a.Upload},(function(t){var n="boolean"===typeof c?{}:c,i=n.showRemoveIcon,a=n.showPreviewIcon,o=n.showDownloadIcon,s=n.removeIcon,d=n.downloadIcon;return l.createElement(ap,{listType:u,items:I(!0),previewFile:m,onPreview:f,onDownload:h,onRemove:G,showRemoveIcon:!b&&i,showPreviewIcon:a,showDownloadIcon:o,removeIcon:s,downloadIcon:d,iconRender:w,locale:Object(r.a)(Object(r.a)({},t),y),isImageUrl:x,progress:M,appendAction:e,itemRender:C})})):e};if("drag"===E){var te,ne=d()(Q,(te={},Object(i.a)(te,"".concat(Q,"-drag"),!0),Object(i.a)(te,"".concat(Q,"-drag-uploading"),I().some((function(e){return"uploading"===e.status}))),Object(i.a)(te,"".concat(Q,"-drag-hover"),"dragover"===P),Object(i.a)(te,"".concat(Q,"-disabled"),b),Object(i.a)(te,"".concat(Q,"-rtl"),"rtl"===J),te),k);return l.createElement("span",null,l.createElement("div",{className:ne,onDrop:K,onDragOver:K,onDragLeave:K,style:S},l.createElement(Ud,Object(r.a)({},$,{ref:B,className:"".concat(Q,"-btn")}),l.createElement("div",{className:"".concat(Q,"-drag-container")},_))),ee())}var re=d()(Q,(n={},Object(i.a)(n,"".concat(Q,"-select"),!0),Object(i.a)(n,"".concat(Q,"-select-").concat(u),!0),Object(i.a)(n,"".concat(Q,"-disabled"),b),Object(i.a)(n,"".concat(Q,"-rtl"),"rtl"===J),n)),ie=l.createElement("div",{className:re,style:_?void 0:{display:"none"}},l.createElement(Ud,Object(r.a)({},$,{ref:B})));return"picture-card"===u?l.createElement("span",{className:d()("".concat(Q,"-picture-card-wrapper"),k)},ee(ie)):l.createElement("span",{className:k},ie,ee())},cp=l.forwardRef(sp);cp.Dragger=Kd,cp.displayName="Upload",cp.defaultProps={type:"select",multiple:!1,action:"",data:{},accept:"",beforeUpload:function(){return!0},showUploadList:!0,listType:"text",className:"",disabled:!1,supportServerRender:!0};var up=cp;up.Dragger=Kd;var lp=up,fp="4.12.3"},function(e,t,n){"use strict";var r,i="object"===typeof Reflect?Reflect:null,a=i&&"function"===typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"===typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(n,r){function i(){void 0!==a&&e.removeListener("error",a),n([].slice.call(arguments))}var a;"error"!==t&&(a=function(n){e.removeListener(t,i),r(n)},e.once("error",a)),e.once(t,i)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function u(e){if("function"!==typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function f(e,t,n,r){var i,a,o,s;if(u(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]),void 0===o)o=a[t]=n,++e._eventsCount;else if("function"===typeof o?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=l(e))>0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,s=c,console&&console.warn&&console.warn(s)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=h.bind(r);return i.listener=n,r.wrapFn=i,i}function p(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"===typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var c=i[e];if(void 0===c)return!1;if("function"===typeof c)a(c,this,t);else{var u=c.length,l=v(c,u);for(n=0;n=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){"use strict";var r=n(0),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},a=n(1),o=function(e,t){return r.createElement(a.a,Object.assign({},e,{ref:t,icon:i}))};o.displayName="RightOutlined";t.a=r.forwardRef(o)},function(e,t,n){"use strict";n.d(t,"b",(function(){return a}));var r=n(2),i=n(3),a=["xxl","xl","lg","md","sm","xs"],o={xs:"(max-width: 575px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",xxl:"(min-width: 1600px)"},s=new Map,c=-1,u={},l={matchHandlers:{},dispatch:function(e){return u=e,s.forEach((function(e){return e(u)})),s.size>=1},subscribe:function(e){return s.size||this.register(),c+=1,s.set(c,e),e(u),c},unsubscribe:function(e){s.delete(e),s.size||this.unregister()},unregister:function(){var e=this;Object.keys(o).forEach((function(t){var n=o[t],r=e.matchHandlers[n];null===r||void 0===r||r.mql.removeListener(null===r||void 0===r?void 0:r.listener)})),s.clear()},register:function(){var e=this;Object.keys(o).forEach((function(t){var n=o[t],a=function(n){var a=n.matches;e.dispatch(Object(i.a)(Object(i.a)({},u),Object(r.a)({},t,a)))},s=window.matchMedia(n);s.addListener(a),e.matchHandlers[n]={mql:s,listener:a},a(s)}))}};t.a=l},function(e,t,n){!function(e){"use strict";var t=function(e){var t,n=new Float64Array(16);if(e)for(t=0;t>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n,e[t+4]=r>>24&255,e[t+5]=r>>16&255,e[t+6]=r>>8&255,e[t+7]=255&r}function m(e,t,n,r,i){var a,o=0;for(a=0;a>>8)-1}function v(e,t,n,r){return m(e,t,n,r,16)}function g(e,t,n,r){return m(e,t,n,r,32)}function b(e,t,n,r){!function(e,t,n,r){for(var i,a=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,u=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,l=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,f=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,d=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,v=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,g=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,y=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,w=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,x=a,M=o,O=s,k=c,E=u,_=l,S=f,C=h,j=d,T=p,A=m,P=v,N=g,R=b,z=y,L=w,I=0;I<20;I+=2)x^=(i=(N^=(i=(j^=(i=(E^=(i=x+N|0)<<7|i>>>25)+x|0)<<9|i>>>23)+E|0)<<13|i>>>19)+j|0)<<18|i>>>14,_^=(i=(M^=(i=(R^=(i=(T^=(i=_+M|0)<<7|i>>>25)+_|0)<<9|i>>>23)+T|0)<<13|i>>>19)+R|0)<<18|i>>>14,A^=(i=(S^=(i=(O^=(i=(z^=(i=A+S|0)<<7|i>>>25)+A|0)<<9|i>>>23)+z|0)<<13|i>>>19)+O|0)<<18|i>>>14,L^=(i=(P^=(i=(C^=(i=(k^=(i=L+P|0)<<7|i>>>25)+L|0)<<9|i>>>23)+k|0)<<13|i>>>19)+C|0)<<18|i>>>14,x^=(i=(k^=(i=(O^=(i=(M^=(i=x+k|0)<<7|i>>>25)+x|0)<<9|i>>>23)+M|0)<<13|i>>>19)+O|0)<<18|i>>>14,_^=(i=(E^=(i=(C^=(i=(S^=(i=_+E|0)<<7|i>>>25)+_|0)<<9|i>>>23)+S|0)<<13|i>>>19)+C|0)<<18|i>>>14,A^=(i=(T^=(i=(j^=(i=(P^=(i=A+T|0)<<7|i>>>25)+A|0)<<9|i>>>23)+P|0)<<13|i>>>19)+j|0)<<18|i>>>14,L^=(i=(z^=(i=(R^=(i=(N^=(i=L+z|0)<<7|i>>>25)+L|0)<<9|i>>>23)+N|0)<<13|i>>>19)+R|0)<<18|i>>>14;x=x+a|0,M=M+o|0,O=O+s|0,k=k+c|0,E=E+u|0,_=_+l|0,S=S+f|0,C=C+h|0,j=j+d|0,T=T+p|0,A=A+m|0,P=P+v|0,N=N+g|0,R=R+b|0,z=z+y|0,L=L+w|0,e[0]=x>>>0&255,e[1]=x>>>8&255,e[2]=x>>>16&255,e[3]=x>>>24&255,e[4]=M>>>0&255,e[5]=M>>>8&255,e[6]=M>>>16&255,e[7]=M>>>24&255,e[8]=O>>>0&255,e[9]=O>>>8&255,e[10]=O>>>16&255,e[11]=O>>>24&255,e[12]=k>>>0&255,e[13]=k>>>8&255,e[14]=k>>>16&255,e[15]=k>>>24&255,e[16]=E>>>0&255,e[17]=E>>>8&255,e[18]=E>>>16&255,e[19]=E>>>24&255,e[20]=_>>>0&255,e[21]=_>>>8&255,e[22]=_>>>16&255,e[23]=_>>>24&255,e[24]=S>>>0&255,e[25]=S>>>8&255,e[26]=S>>>16&255,e[27]=S>>>24&255,e[28]=C>>>0&255,e[29]=C>>>8&255,e[30]=C>>>16&255,e[31]=C>>>24&255,e[32]=j>>>0&255,e[33]=j>>>8&255,e[34]=j>>>16&255,e[35]=j>>>24&255,e[36]=T>>>0&255,e[37]=T>>>8&255,e[38]=T>>>16&255,e[39]=T>>>24&255,e[40]=A>>>0&255,e[41]=A>>>8&255,e[42]=A>>>16&255,e[43]=A>>>24&255,e[44]=P>>>0&255,e[45]=P>>>8&255,e[46]=P>>>16&255,e[47]=P>>>24&255,e[48]=N>>>0&255,e[49]=N>>>8&255,e[50]=N>>>16&255,e[51]=N>>>24&255,e[52]=R>>>0&255,e[53]=R>>>8&255,e[54]=R>>>16&255,e[55]=R>>>24&255,e[56]=z>>>0&255,e[57]=z>>>8&255,e[58]=z>>>16&255,e[59]=z>>>24&255,e[60]=L>>>0&255,e[61]=L>>>8&255,e[62]=L>>>16&255,e[63]=L>>>24&255}(e,t,n,r)}function y(e,t,n,r){!function(e,t,n,r){for(var i,a=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,u=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,l=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,f=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,d=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,v=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,g=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,y=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,w=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,x=0;x<20;x+=2)a^=(i=(g^=(i=(d^=(i=(u^=(i=a+g|0)<<7|i>>>25)+a|0)<<9|i>>>23)+u|0)<<13|i>>>19)+d|0)<<18|i>>>14,l^=(i=(o^=(i=(b^=(i=(p^=(i=l+o|0)<<7|i>>>25)+l|0)<<9|i>>>23)+p|0)<<13|i>>>19)+b|0)<<18|i>>>14,m^=(i=(f^=(i=(s^=(i=(y^=(i=m+f|0)<<7|i>>>25)+m|0)<<9|i>>>23)+y|0)<<13|i>>>19)+s|0)<<18|i>>>14,w^=(i=(v^=(i=(h^=(i=(c^=(i=w+v|0)<<7|i>>>25)+w|0)<<9|i>>>23)+c|0)<<13|i>>>19)+h|0)<<18|i>>>14,a^=(i=(c^=(i=(s^=(i=(o^=(i=a+c|0)<<7|i>>>25)+a|0)<<9|i>>>23)+o|0)<<13|i>>>19)+s|0)<<18|i>>>14,l^=(i=(u^=(i=(h^=(i=(f^=(i=l+u|0)<<7|i>>>25)+l|0)<<9|i>>>23)+f|0)<<13|i>>>19)+h|0)<<18|i>>>14,m^=(i=(p^=(i=(d^=(i=(v^=(i=m+p|0)<<7|i>>>25)+m|0)<<9|i>>>23)+v|0)<<13|i>>>19)+d|0)<<18|i>>>14,w^=(i=(y^=(i=(b^=(i=(g^=(i=w+y|0)<<7|i>>>25)+w|0)<<9|i>>>23)+g|0)<<13|i>>>19)+b|0)<<18|i>>>14;e[0]=a>>>0&255,e[1]=a>>>8&255,e[2]=a>>>16&255,e[3]=a>>>24&255,e[4]=l>>>0&255,e[5]=l>>>8&255,e[6]=l>>>16&255,e[7]=l>>>24&255,e[8]=m>>>0&255,e[9]=m>>>8&255,e[10]=m>>>16&255,e[11]=m>>>24&255,e[12]=w>>>0&255,e[13]=w>>>8&255,e[14]=w>>>16&255,e[15]=w>>>24&255,e[16]=f>>>0&255,e[17]=f>>>8&255,e[18]=f>>>16&255,e[19]=f>>>24&255,e[20]=h>>>0&255,e[21]=h>>>8&255,e[22]=h>>>16&255,e[23]=h>>>24&255,e[24]=d>>>0&255,e[25]=d>>>8&255,e[26]=d>>>16&255,e[27]=d>>>24&255,e[28]=p>>>0&255,e[29]=p>>>8&255,e[30]=p>>>16&255,e[31]=p>>>24&255}(e,t,n,r)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function x(e,t,n,r,i,a,o){var s,c,u=new Uint8Array(16),l=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=a[c];for(;i>=64;){for(b(l,u,o,w),c=0;c<64;c++)e[t+c]=n[r+c]^l[c];for(s=1,c=8;c<16;c++)s=s+(255&u[c])|0,u[c]=255&s,s>>>=8;i-=64,t+=64,r+=64}if(i>0)for(b(l,u,o,w),c=0;c=64;){for(b(c,s,i,w),o=0;o<64;o++)e[t+o]=c[o];for(a=1,o=8;o<16;o++)a=a+(255&s[o])|0,s[o]=255&a,a>>>=8;n-=64,t+=64}if(n>0)for(b(c,s,i,w),o=0;o>>13|n<<3),r=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(n>>>10|r<<6),i=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(r>>>7|i<<9),a=255&e[8]|(255&e[9])<<8,this.r[4]=255&(i>>>4|a<<12),this.r[5]=a>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(a>>>14|o<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|s<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function _(e,t,n,r,i,a){var o=new E(a);return o.update(n,r,i),o.finish(e,t),0}function S(e,t,n,r,i,a){var o=new Uint8Array(16);return _(o,0,n,r,i,a),v(e,t,o,0)}function C(e,t,n,r,i){var a;if(n<32)return-1;for(k(e,0,t,0,n,r,i),_(e,16,e,32,n-32,e),a=0;a<16;a++)e[a]=0;return 0}function j(e,t,n,r,i){var a,o=new Uint8Array(32);if(n<32)return-1;if(O(o,0,32,r,i),0!==S(t,16,t,32,n-32,o))return-1;for(k(e,0,t,0,n,r,i),a=0;a<32;a++)e[a]=0;return 0}function T(e,t){var n;for(n=0;n<16;n++)e[n]=0|t[n]}function A(e){var t,n,r=1;for(t=0;t<16;t++)n=e[t]+r+65535,r=Math.floor(n/65536),e[t]=n-65536*r;e[0]+=r-1+37*(r-1)}function P(e,t,n){for(var r,i=~(n-1),a=0;a<16;a++)r=i&(e[a]^t[a]),e[a]^=r,t[a]^=r}function N(e,n){var r,i,a,o=t(),s=t();for(r=0;r<16;r++)s[r]=n[r];for(A(s),A(s),A(s),i=0;i<2;i++){for(o[0]=s[0]-65517,r=1;r<15;r++)o[r]=s[r]-65535-(o[r-1]>>16&1),o[r-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),a=o[15]>>16&1,o[14]&=65535,P(s,o,1-a)}for(r=0;r<16;r++)e[2*r]=255&s[r],e[2*r+1]=s[r]>>8}function R(e,t){var n=new Uint8Array(32),r=new Uint8Array(32);return N(n,e),N(r,t),g(n,0,r,0)}function z(e){var t=new Uint8Array(32);return N(t,e),1&t[0]}function L(e,t){var n;for(n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function I(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]+n[r]}function D(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]-n[r]}function B(e,t,n){var r,i,a=0,o=0,s=0,c=0,u=0,l=0,f=0,h=0,d=0,p=0,m=0,v=0,g=0,b=0,y=0,w=0,x=0,M=0,O=0,k=0,E=0,_=0,S=0,C=0,j=0,T=0,A=0,P=0,N=0,R=0,z=0,L=n[0],I=n[1],D=n[2],B=n[3],H=n[4],F=n[5],V=n[6],U=n[7],W=n[8],q=n[9],G=n[10],K=n[11],Y=n[12],X=n[13],Z=n[14],J=n[15];a+=(r=t[0])*L,o+=r*I,s+=r*D,c+=r*B,u+=r*H,l+=r*F,f+=r*V,h+=r*U,d+=r*W,p+=r*q,m+=r*G,v+=r*K,g+=r*Y,b+=r*X,y+=r*Z,w+=r*J,o+=(r=t[1])*L,s+=r*I,c+=r*D,u+=r*B,l+=r*H,f+=r*F,h+=r*V,d+=r*U,p+=r*W,m+=r*q,v+=r*G,g+=r*K,b+=r*Y,y+=r*X,w+=r*Z,x+=r*J,s+=(r=t[2])*L,c+=r*I,u+=r*D,l+=r*B,f+=r*H,h+=r*F,d+=r*V,p+=r*U,m+=r*W,v+=r*q,g+=r*G,b+=r*K,y+=r*Y,w+=r*X,x+=r*Z,M+=r*J,c+=(r=t[3])*L,u+=r*I,l+=r*D,f+=r*B,h+=r*H,d+=r*F,p+=r*V,m+=r*U,v+=r*W,g+=r*q,b+=r*G,y+=r*K,w+=r*Y,x+=r*X,M+=r*Z,O+=r*J,u+=(r=t[4])*L,l+=r*I,f+=r*D,h+=r*B,d+=r*H,p+=r*F,m+=r*V,v+=r*U,g+=r*W,b+=r*q,y+=r*G,w+=r*K,x+=r*Y,M+=r*X,O+=r*Z,k+=r*J,l+=(r=t[5])*L,f+=r*I,h+=r*D,d+=r*B,p+=r*H,m+=r*F,v+=r*V,g+=r*U,b+=r*W,y+=r*q,w+=r*G,x+=r*K,M+=r*Y,O+=r*X,k+=r*Z,E+=r*J,f+=(r=t[6])*L,h+=r*I,d+=r*D,p+=r*B,m+=r*H,v+=r*F,g+=r*V,b+=r*U,y+=r*W,w+=r*q,x+=r*G,M+=r*K,O+=r*Y,k+=r*X,E+=r*Z,_+=r*J,h+=(r=t[7])*L,d+=r*I,p+=r*D,m+=r*B,v+=r*H,g+=r*F,b+=r*V,y+=r*U,w+=r*W,x+=r*q,M+=r*G,O+=r*K,k+=r*Y,E+=r*X,_+=r*Z,S+=r*J,d+=(r=t[8])*L,p+=r*I,m+=r*D,v+=r*B,g+=r*H,b+=r*F,y+=r*V,w+=r*U,x+=r*W,M+=r*q,O+=r*G,k+=r*K,E+=r*Y,_+=r*X,S+=r*Z,C+=r*J,p+=(r=t[9])*L,m+=r*I,v+=r*D,g+=r*B,b+=r*H,y+=r*F,w+=r*V,x+=r*U,M+=r*W,O+=r*q,k+=r*G,E+=r*K,_+=r*Y,S+=r*X,C+=r*Z,j+=r*J,m+=(r=t[10])*L,v+=r*I,g+=r*D,b+=r*B,y+=r*H,w+=r*F,x+=r*V,M+=r*U,O+=r*W,k+=r*q,E+=r*G,_+=r*K,S+=r*Y,C+=r*X,j+=r*Z,T+=r*J,v+=(r=t[11])*L,g+=r*I,b+=r*D,y+=r*B,w+=r*H,x+=r*F,M+=r*V,O+=r*U,k+=r*W,E+=r*q,_+=r*G,S+=r*K,C+=r*Y,j+=r*X,T+=r*Z,A+=r*J,g+=(r=t[12])*L,b+=r*I,y+=r*D,w+=r*B,x+=r*H,M+=r*F,O+=r*V,k+=r*U,E+=r*W,_+=r*q,S+=r*G,C+=r*K,j+=r*Y,T+=r*X,A+=r*Z,P+=r*J,b+=(r=t[13])*L,y+=r*I,w+=r*D,x+=r*B,M+=r*H,O+=r*F,k+=r*V,E+=r*U,_+=r*W,S+=r*q,C+=r*G,j+=r*K,T+=r*Y,A+=r*X,P+=r*Z,N+=r*J,y+=(r=t[14])*L,w+=r*I,x+=r*D,M+=r*B,O+=r*H,k+=r*F,E+=r*V,_+=r*U,S+=r*W,C+=r*q,j+=r*G,T+=r*K,A+=r*Y,P+=r*X,N+=r*Z,R+=r*J,w+=(r=t[15])*L,o+=38*(M+=r*D),s+=38*(O+=r*B),c+=38*(k+=r*H),u+=38*(E+=r*F),l+=38*(_+=r*V),f+=38*(S+=r*U),h+=38*(C+=r*W),d+=38*(j+=r*q),p+=38*(T+=r*G),m+=38*(A+=r*K),v+=38*(P+=r*Y),g+=38*(N+=r*X),b+=38*(R+=r*Z),y+=38*(z+=r*J),a=(r=(a+=38*(x+=r*I))+(i=1)+65535)-65536*(i=Math.floor(r/65536)),o=(r=o+i+65535)-65536*(i=Math.floor(r/65536)),s=(r=s+i+65535)-65536*(i=Math.floor(r/65536)),c=(r=c+i+65535)-65536*(i=Math.floor(r/65536)),u=(r=u+i+65535)-65536*(i=Math.floor(r/65536)),l=(r=l+i+65535)-65536*(i=Math.floor(r/65536)),f=(r=f+i+65535)-65536*(i=Math.floor(r/65536)),h=(r=h+i+65535)-65536*(i=Math.floor(r/65536)),d=(r=d+i+65535)-65536*(i=Math.floor(r/65536)),p=(r=p+i+65535)-65536*(i=Math.floor(r/65536)),m=(r=m+i+65535)-65536*(i=Math.floor(r/65536)),v=(r=v+i+65535)-65536*(i=Math.floor(r/65536)),g=(r=g+i+65535)-65536*(i=Math.floor(r/65536)),b=(r=b+i+65535)-65536*(i=Math.floor(r/65536)),y=(r=y+i+65535)-65536*(i=Math.floor(r/65536)),w=(r=w+i+65535)-65536*(i=Math.floor(r/65536)),a=(r=(a+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(r/65536)),o=(r=o+i+65535)-65536*(i=Math.floor(r/65536)),s=(r=s+i+65535)-65536*(i=Math.floor(r/65536)),c=(r=c+i+65535)-65536*(i=Math.floor(r/65536)),u=(r=u+i+65535)-65536*(i=Math.floor(r/65536)),l=(r=l+i+65535)-65536*(i=Math.floor(r/65536)),f=(r=f+i+65535)-65536*(i=Math.floor(r/65536)),h=(r=h+i+65535)-65536*(i=Math.floor(r/65536)),d=(r=d+i+65535)-65536*(i=Math.floor(r/65536)),p=(r=p+i+65535)-65536*(i=Math.floor(r/65536)),m=(r=m+i+65535)-65536*(i=Math.floor(r/65536)),v=(r=v+i+65535)-65536*(i=Math.floor(r/65536)),g=(r=g+i+65535)-65536*(i=Math.floor(r/65536)),b=(r=b+i+65535)-65536*(i=Math.floor(r/65536)),y=(r=y+i+65535)-65536*(i=Math.floor(r/65536)),w=(r=w+i+65535)-65536*(i=Math.floor(r/65536)),a+=i-1+37*(i-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=u,e[5]=l,e[6]=f,e[7]=h,e[8]=d,e[9]=p,e[10]=m,e[11]=v,e[12]=g,e[13]=b,e[14]=y,e[15]=w}function H(e,t){B(e,t,t)}function F(e,n){var r,i=t();for(r=0;r<16;r++)i[r]=n[r];for(r=253;r>=0;r--)H(i,i),2!==r&&4!==r&&B(i,i,n);for(r=0;r<16;r++)e[r]=i[r]}function V(e,n){var r,i=t();for(r=0;r<16;r++)i[r]=n[r];for(r=250;r>=0;r--)H(i,i),1!==r&&B(i,i,n);for(r=0;r<16;r++)e[r]=i[r]}function U(e,n,r){var i,a,o=new Uint8Array(32),s=new Float64Array(80),u=t(),l=t(),f=t(),h=t(),d=t(),p=t();for(a=0;a<31;a++)o[a]=n[a];for(o[31]=127&n[31]|64,o[0]&=248,L(s,r),a=0;a<16;a++)l[a]=s[a],h[a]=u[a]=f[a]=0;for(u[0]=h[0]=1,a=254;a>=0;--a)P(u,l,i=o[a>>>3]>>>(7&a)&1),P(f,h,i),I(d,u,f),D(u,u,f),I(f,l,h),D(l,l,h),H(h,d),H(p,u),B(u,f,u),B(f,l,d),I(d,u,f),D(u,u,f),H(l,u),D(f,h,p),B(u,f,c),I(u,u,h),B(f,f,u),B(u,h,p),B(h,l,s),H(l,d),P(u,l,i),P(f,h,i);for(a=0;a<16;a++)s[a+16]=u[a],s[a+32]=f[a],s[a+48]=l[a],s[a+64]=h[a];var m=s.subarray(32),v=s.subarray(16);return F(m,m),B(v,v,m),N(e,v),0}function W(e,t){return U(e,t,a)}function q(e,t){return r(t,32),W(e,t)}function G(e,t,n){var r=new Uint8Array(32);return U(r,n,t),y(e,i,r,w)}E.prototype.blocks=function(e,t,n){for(var r,i,a,o,s,c,u,l,f,h,d,p,m,v,g,b,y,w,x,M=this.fin?0:2048,O=this.h[0],k=this.h[1],E=this.h[2],_=this.h[3],S=this.h[4],C=this.h[5],j=this.h[6],T=this.h[7],A=this.h[8],P=this.h[9],N=this.r[0],R=this.r[1],z=this.r[2],L=this.r[3],I=this.r[4],D=this.r[5],B=this.r[6],H=this.r[7],F=this.r[8],V=this.r[9];n>=16;)h=f=0,h+=(O+=8191&(r=255&e[t+0]|(255&e[t+1])<<8))*N,h+=(k+=8191&(r>>>13|(i=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*V),h+=(E+=8191&(i>>>10|(a=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*F),h+=(_+=8191&(a>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*H),f=(h+=(S+=8191&(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*B))>>>13,h&=8191,h+=(C+=s>>>1&8191)*(5*D),h+=(j+=8191&(s>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*I),h+=(T+=8191&(c>>>11|(u=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*L),h+=(A+=8191&(u>>>8|(l=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*z),d=f+=(h+=(P+=l>>>5|M)*(5*R))>>>13,d+=O*R,d+=k*N,d+=E*(5*V),d+=_*(5*F),f=(d+=S*(5*H))>>>13,d&=8191,d+=C*(5*B),d+=j*(5*D),d+=T*(5*I),d+=A*(5*L),f+=(d+=P*(5*z))>>>13,d&=8191,p=f,p+=O*z,p+=k*R,p+=E*N,p+=_*(5*V),f=(p+=S*(5*F))>>>13,p&=8191,p+=C*(5*H),p+=j*(5*B),p+=T*(5*D),p+=A*(5*I),m=f+=(p+=P*(5*L))>>>13,m+=O*L,m+=k*z,m+=E*R,m+=_*N,f=(m+=S*(5*V))>>>13,m&=8191,m+=C*(5*F),m+=j*(5*H),m+=T*(5*B),m+=A*(5*D),v=f+=(m+=P*(5*I))>>>13,v+=O*I,v+=k*L,v+=E*z,v+=_*R,f=(v+=S*N)>>>13,v&=8191,v+=C*(5*V),v+=j*(5*F),v+=T*(5*H),v+=A*(5*B),g=f+=(v+=P*(5*D))>>>13,g+=O*D,g+=k*I,g+=E*L,g+=_*z,f=(g+=S*R)>>>13,g&=8191,g+=C*N,g+=j*(5*V),g+=T*(5*F),g+=A*(5*H),b=f+=(g+=P*(5*B))>>>13,b+=O*B,b+=k*D,b+=E*I,b+=_*L,f=(b+=S*z)>>>13,b&=8191,b+=C*R,b+=j*N,b+=T*(5*V),b+=A*(5*F),y=f+=(b+=P*(5*H))>>>13,y+=O*H,y+=k*B,y+=E*D,y+=_*I,f=(y+=S*L)>>>13,y&=8191,y+=C*z,y+=j*R,y+=T*N,y+=A*(5*V),w=f+=(y+=P*(5*F))>>>13,w+=O*F,w+=k*H,w+=E*B,w+=_*D,f=(w+=S*I)>>>13,w&=8191,w+=C*L,w+=j*z,w+=T*R,w+=A*N,x=f+=(w+=P*(5*V))>>>13,x+=O*V,x+=k*F,x+=E*H,x+=_*B,f=(x+=S*D)>>>13,x&=8191,x+=C*I,x+=j*L,x+=T*z,x+=A*R,O=h=8191&(f=(f=((f+=(x+=P*N)>>>13)<<2)+f|0)+(h&=8191)|0),k=d+=f>>>=13,E=p&=8191,_=m&=8191,S=v&=8191,C=g&=8191,j=b&=8191,T=y&=8191,A=w&=8191,P=x&=8191,t+=16,n-=16;this.h[0]=O,this.h[1]=k,this.h[2]=E,this.h[3]=_,this.h[4]=S,this.h[5]=C,this.h[6]=j,this.h[7]=T,this.h[8]=A,this.h[9]=P},E.prototype.finish=function(e,t){var n,r,i,a,o=new Uint16Array(10);if(this.leftover){for(a=this.leftover,this.buffer[a++]=1;a<16;a++)this.buffer[a]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,a=2;a<10;a++)this.h[a]+=n,n=this.h[a]>>>13,this.h[a]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,o[0]=this.h[0]+5,n=o[0]>>>13,o[0]&=8191,a=1;a<10;a++)o[a]=this.h[a]+n,n=o[a]>>>13,o[a]&=8191;for(o[9]-=8192,r=(1^n)-1,a=0;a<10;a++)o[a]&=r;for(r=~r,a=0;a<10;a++)this.h[a]=this.h[a]&r|o[a];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),i=this.h[0]+this.pad[0],this.h[0]=65535&i,a=1;a<8;a++)i=(this.h[a]+this.pad[a]|0)+(i>>>16)|0,this.h[a]=65535&i;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},E.prototype.update=function(e,t,n){var r,i;if(this.leftover){for((i=16-this.leftover)>n&&(i=n),r=0;r=16&&(i=n-n%16,this.blocks(e,t,i),t+=i,n-=i),n){for(r=0;r=128;){for(M=0;M<16;M++)O=8*M+Y,T[M]=n[O+0]<<24|n[O+1]<<16|n[O+2]<<8|n[O+3],A[M]=n[O+4]<<24|n[O+5]<<16|n[O+6]<<8|n[O+7];for(M=0;M<80;M++)if(i=P,a=N,o=R,s=z,c=L,u=I,l=D,B,h=H,d=F,p=V,m=U,v=W,g=q,b=G,K,_=65535&(E=K),S=E>>>16,C=65535&(k=B),j=k>>>16,_+=65535&(E=(W>>>14|L<<18)^(W>>>18|L<<14)^(L>>>9|W<<23)),S+=E>>>16,C+=65535&(k=(L>>>14|W<<18)^(L>>>18|W<<14)^(W>>>9|L<<23)),j+=k>>>16,_+=65535&(E=W&q^~W&G),S+=E>>>16,C+=65535&(k=L&I^~L&D),j+=k>>>16,_+=65535&(E=X[2*M+1]),S+=E>>>16,C+=65535&(k=X[2*M]),j+=k>>>16,k=T[M%16],S+=(E=A[M%16])>>>16,C+=65535&k,j+=k>>>16,C+=(S+=(_+=65535&E)>>>16)>>>16,_=65535&(E=x=65535&_|S<<16),S=E>>>16,C=65535&(k=w=65535&C|(j+=C>>>16)<<16),j=k>>>16,_+=65535&(E=(H>>>28|P<<4)^(P>>>2|H<<30)^(P>>>7|H<<25)),S+=E>>>16,C+=65535&(k=(P>>>28|H<<4)^(H>>>2|P<<30)^(H>>>7|P<<25)),j+=k>>>16,S+=(E=H&F^H&V^F&V)>>>16,C+=65535&(k=P&N^P&R^N&R),j+=k>>>16,f=65535&(C+=(S+=(_+=65535&E)>>>16)>>>16)|(j+=C>>>16)<<16,y=65535&_|S<<16,_=65535&(E=m),S=E>>>16,C=65535&(k=s),j=k>>>16,S+=(E=x)>>>16,C+=65535&(k=w),j+=k>>>16,N=i,R=a,z=o,L=s=65535&(C+=(S+=(_+=65535&E)>>>16)>>>16)|(j+=C>>>16)<<16,I=c,D=u,B=l,P=f,F=h,V=d,U=p,W=m=65535&_|S<<16,q=v,G=g,K=b,H=y,M%16===15)for(O=0;O<16;O++)k=T[O],_=65535&(E=A[O]),S=E>>>16,C=65535&k,j=k>>>16,k=T[(O+9)%16],_+=65535&(E=A[(O+9)%16]),S+=E>>>16,C+=65535&k,j+=k>>>16,w=T[(O+1)%16],_+=65535&(E=((x=A[(O+1)%16])>>>1|w<<31)^(x>>>8|w<<24)^(x>>>7|w<<25)),S+=E>>>16,C+=65535&(k=(w>>>1|x<<31)^(w>>>8|x<<24)^w>>>7),j+=k>>>16,w=T[(O+14)%16],S+=(E=((x=A[(O+14)%16])>>>19|w<<13)^(w>>>29|x<<3)^(x>>>6|w<<26))>>>16,C+=65535&(k=(w>>>19|x<<13)^(x>>>29|w<<3)^w>>>6),j+=k>>>16,j+=(C+=(S+=(_+=65535&E)>>>16)>>>16)>>>16,T[O]=65535&C|j<<16,A[O]=65535&_|S<<16;_=65535&(E=H),S=E>>>16,C=65535&(k=P),j=k>>>16,k=e[0],S+=(E=t[0])>>>16,C+=65535&k,j+=k>>>16,j+=(C+=(S+=(_+=65535&E)>>>16)>>>16)>>>16,e[0]=P=65535&C|j<<16,t[0]=H=65535&_|S<<16,_=65535&(E=F),S=E>>>16,C=65535&(k=N),j=k>>>16,k=e[1],S+=(E=t[1])>>>16,C+=65535&k,j+=k>>>16,j+=(C+=(S+=(_+=65535&E)>>>16)>>>16)>>>16,e[1]=N=65535&C|j<<16,t[1]=F=65535&_|S<<16,_=65535&(E=V),S=E>>>16,C=65535&(k=R),j=k>>>16,k=e[2],S+=(E=t[2])>>>16,C+=65535&k,j+=k>>>16,j+=(C+=(S+=(_+=65535&E)>>>16)>>>16)>>>16,e[2]=R=65535&C|j<<16,t[2]=V=65535&_|S<<16,_=65535&(E=U),S=E>>>16,C=65535&(k=z),j=k>>>16,k=e[3],S+=(E=t[3])>>>16,C+=65535&k,j+=k>>>16,j+=(C+=(S+=(_+=65535&E)>>>16)>>>16)>>>16,e[3]=z=65535&C|j<<16,t[3]=U=65535&_|S<<16,_=65535&(E=W),S=E>>>16,C=65535&(k=L),j=k>>>16,k=e[4],S+=(E=t[4])>>>16,C+=65535&k,j+=k>>>16,j+=(C+=(S+=(_+=65535&E)>>>16)>>>16)>>>16,e[4]=L=65535&C|j<<16,t[4]=W=65535&_|S<<16,_=65535&(E=q),S=E>>>16,C=65535&(k=I),j=k>>>16,k=e[5],S+=(E=t[5])>>>16,C+=65535&k,j+=k>>>16,j+=(C+=(S+=(_+=65535&E)>>>16)>>>16)>>>16,e[5]=I=65535&C|j<<16,t[5]=q=65535&_|S<<16,_=65535&(E=G),S=E>>>16,C=65535&(k=D),j=k>>>16,k=e[6],S+=(E=t[6])>>>16,C+=65535&k,j+=k>>>16,j+=(C+=(S+=(_+=65535&E)>>>16)>>>16)>>>16,e[6]=D=65535&C|j<<16,t[6]=G=65535&_|S<<16,_=65535&(E=K),S=E>>>16,C=65535&(k=B),j=k>>>16,k=e[7],S+=(E=t[7])>>>16,C+=65535&k,j+=k>>>16,j+=(C+=(S+=(_+=65535&E)>>>16)>>>16)>>>16,e[7]=B=65535&C|j<<16,t[7]=K=65535&_|S<<16,Y+=128,r-=128}return r}function J(e,t,n){var r,i=new Int32Array(8),a=new Int32Array(8),o=new Uint8Array(256),s=n;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,a[0]=4089235720,a[1]=2227873595,a[2]=4271175723,a[3]=1595750129,a[4]=2917565137,a[5]=725511199,a[6]=4215389547,a[7]=327033209,Z(i,a,t,n),n%=128,r=0;r=0;--i)$(e,t,r=n[i/8|0]>>(7&i)&1),Q(t,e),Q(e,e),$(e,t,r)}function ne(e,n){var r=[t(),t(),t(),t()];T(r[0],f),T(r[1],h),T(r[2],s),B(r[3],f,h),te(e,r,n)}function re(e,n,i){var a,o=new Uint8Array(64),s=[t(),t(),t(),t()];for(i||r(n,32),J(o,n,32),o[0]&=248,o[31]&=127,o[31]|=64,ne(s,o),ee(e,s),a=0;a<32;a++)n[a+32]=e[a];return 0}var ie=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ae(e,t){var n,r,i,a;for(r=63;r>=32;--r){for(n=0,i=r-32,a=r-12;i>4)*ie[i],n=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=n*ie[i];for(r=0;r<32;r++)t[r+1]+=t[r]>>8,e[r]=255&t[r]}function oe(e){var t,n=new Float64Array(64);for(t=0;t<64;t++)n[t]=e[t];for(t=0;t<64;t++)e[t]=0;ae(e,n)}function se(e,n,r,i){var a,o,s=new Uint8Array(64),c=new Uint8Array(64),u=new Uint8Array(64),l=new Float64Array(64),f=[t(),t(),t(),t()];J(s,i,32),s[0]&=248,s[31]&=127,s[31]|=64;var h=r+64;for(a=0;a>7&&D(e[0],o,e[0]),B(e[3],e[0],e[1]),0)}(h,i))return-1;for(a=0;a=0},e.sign.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(64);return re(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(le(e),64!==e.length)throw new Error("bad secret key size");for(var t=new Uint8Array(32),n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).reduce((function(t,n){var r=e[n];switch(n){case"class":t.className=r,delete t.class;break;default:t[n]=r}return t}),{})}function d(e,t,n){return n?s.a.createElement(e.tag,Object(r.a)(Object(r.a)({key:t},h(e.attrs)),n),(e.children||[]).map((function(n,r){return d(n,"".concat(t,"-").concat(e.tag,"-").concat(r))}))):s.a.createElement(e.tag,Object(r.a)({key:t},h(e.attrs)),(e.children||[]).map((function(n,r){return d(n,"".concat(t,"-").concat(e.tag,"-").concat(r))})))}function p(e){return Object(a.a)(e)[0]}function m(e){return e?Array.isArray(e)?e:[e]:[]}var v={width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false"},g="\n.anticon {\n display: inline-block;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n",b=!1,y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;Object(o.useEffect)((function(){b||(Object(u.insertCss)(e,{prepend:!0}),b=!0)}),[])}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:1,n=P.length,r=0;r1&&void 0!==arguments[1]&&arguments[1];H(e);var n={source:t?"keyboard":"mouse"},r=P[e];r?C(r.data.value,e,n):C(null,-1,n)};a.useEffect((function(){F(!1!==h?L(0):-1)}),[P.length,l]),a.useEffect((function(){var e,t=setTimeout((function(){if(!f&&O&&1===u.size){var e=Array.from(u)[0],t=P.findIndex((function(t){return t.data.value===e}));F(t),z(t)}}));O&&(null===(e=N.current)||void 0===e||e.scrollTo(void 0));return function(){return clearTimeout(t)}}),[O]);var V=function(e){void 0!==e&&_(e,{selected:!u.has(e)}),f||S(!1)};if(a.useImperativeHandle(t,(function(){return{onKeyDown:function(e){var t=e.which;switch(t){case m.a.UP:case m.a.DOWN:var n=0;if(t===m.a.UP?n=-1:t===m.a.DOWN&&(n=1),0!==n){var r=L(B+n,n);z(r),F(r,!0)}break;case m.a.ENTER:var i=P[B];i&&!i.data.disabled?V(i.data.value):V(void 0),O&&e.preventDefault();break;case m.a.ESC:S(!1),O&&e.stopPropagation()}},onKeyUp:function(){},scrollTo:function(e){z(e)}}})),0===P.length)return a.createElement("div",{role:"listbox",id:"".concat(i,"_list"),className:"".concat(A,"-empty"),onMouseDown:R},M);function U(e){var t=P[e];if(!t)return null;var n=t.data||{},r=n.value,o=n.label,c=n.children,l=Object(v.a)(n,!0),f=s?c:o;return t?a.createElement("div",Object.assign({"aria-label":"string"===typeof f?f:null},l,{key:e,role:"option",id:"".concat(i,"_list_").concat(e),"aria-selected":u.has(r)}),r):null}return a.createElement(a.Fragment,null,a.createElement("div",{role:"listbox",id:"".concat(i,"_list"),style:{height:0,width:0,overflow:"hidden"}},U(B-1),U(B),U(B+1)),a.createElement(b.a,{itemKey:"key",ref:N,data:P,height:w,itemHeight:x,fullHeight:!1,onMouseDown:R,onScroll:j,virtual:E,onMouseEnter:T},(function(e,t){var n,i=e.group,o=e.groupOption,l=e.data,f=l.label,h=l.key;if(i)return a.createElement("div",{className:c()(A,"".concat(A,"-group"))},void 0!==f?f:h);var p=l.disabled,m=l.value,v=l.title,g=l.children,b=l.style,w=l.className,x=Object(d.a)(l,["disabled","value","title","children","style","className"]),M=u.has(m),O="".concat(A,"-option"),E=c()(A,O,w,(n={},Object(r.a)(n,"".concat(O,"-grouped"),o),Object(r.a)(n,"".concat(O,"-active"),B===t&&!p),Object(r.a)(n,"".concat(O,"-disabled"),p),Object(r.a)(n,"".concat(O,"-selected"),M),n)),_=!k||"function"===typeof k||M,S=(s?g:f)||m,C="string"===typeof S||"number"===typeof S?S.toString():void 0;return void 0!==v&&(C=v),a.createElement("div",Object.assign({},x,{"aria-selected":M,className:E,title:C,onMouseMove:function(){B===t||p||F(t)},onClick:function(){p||V(m)},style:b}),a.createElement("div",{className:"".concat(O,"-content")},S),a.isValidElement(k)||M,_&&a.createElement(y.a,{className:"".concat(A,"-option-state"),customizeIcon:k,customizeIconProps:{isSelected:M}},M?"\u2713":null))})))},x=a.forwardRef(w);x.displayName="OptionList";var M=x,O=function(){return null};O.isSelectOption=!0;var k=O,E=function(){return null};E.isSelectOptGroup=!0;var _=E,S=n(6),C=n(43);function j(e){var t=e.key,n=e.props,r=n.children,i=n.value,a=Object(d.a)(n,["children","value"]);return Object(S.a)({key:t,value:void 0!==i?i:t,children:r},a)}function T(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object(C.a)(e).map((function(e,n){if(!a.isValidElement(e)||!e.type)return null;var r=e.type.isSelectOptGroup,i=e.key,o=e.props,s=o.children,c=Object(d.a)(o,["children"]);return t||!r?j(e):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(null===i?n:i,"__"),label:i},c),{},{options:T(s)})})).filter((function(e){return e}))}var A=n(118),P=n(318),N=n(20),R=n(28),z=n(108);var L=function(e){var t=e.mode,n=e.options,r=e.children,i=e.backfill,o=e.allowClear,s=e.placeholder,c=e.getInputElement,u=e.showSearch,l=e.onSearch,f=e.defaultOpen,h=e.autoFocus,d=e.labelInValue,p=e.value,m=e.inputValue,v=e.optionLabelProp,g="multiple"===t||"tags"===t,b=void 0!==u?u:g||"combobox"===t,y=n||T(r);if(Object(R.a)("tags"!==t||y.every((function(e){return!e.disabled})),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),"tags"===t||"combobox"===t){var w=y.some((function(e){return e.options?e.options.some((function(e){return"number"===typeof("value"in e?e.value:e.key)})):"number"===typeof("value"in e?e.value:e.key)}));Object(R.a)(!w,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(R.a)("combobox"!==t||!v,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(R.a)("combobox"===t||!i,"`backfill` only works with `combobox` mode."),Object(R.a)("combobox"===t||!c,"`getInputElement` only work with `combobox` mode."),Object(R.b)("combobox"!==t||!c||!o||!s,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),l&&!b&&"combobox"!==t&&"tags"!==t&&Object(R.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(R.b)(!f||h,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),void 0!==p&&null!==p){var x=Object(z.d)(p);Object(R.a)(!d||x.every((function(e){return"object"===Object(N.a)(e)&&("key"in e||"value"in e)})),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(R.a)(!g||Array.isArray(p),"`value` should be array when `mode` is `multiple` or `tags`")}if(r){var M=null;Object(C.a)(r).some((function(e){if(!a.isValidElement(e)||!e.type)return!1;var t=e.type;return!t.isSelectOption&&(t.isSelectOptGroup?!Object(C.a)(e.props.children).every((function(t){return!(a.isValidElement(t)&&e.type&&!t.type.isSelectOption)||(M=t.type,!1)})):(M=t,!0))})),M&&Object(R.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(M.displayName||M.name||M,"`.")),Object(R.a)(void 0===m,"`inputValue` is deprecated, please use `searchValue` instead.")}},I=Object(P.a)({prefixCls:"rc-select",components:{optionList:M},convertChildrenToData:T,flattenOptions:A.d,getLabeledValue:A.e,filterOptions:A.b,isValueDisabled:A.g,findValueOption:A.c,warningProps:L,fillOptionsWithMissingValue:A.a}),D=function(e){Object(f.a)(n,e);var t=Object(h.a)(n);function n(){var e;return Object(u.a)(this,n),(e=t.apply(this,arguments)).selectRef=a.createRef(),e.focus=function(){e.selectRef.current.focus()},e.blur=function(){e.selectRef.current.blur()},e}return Object(l.a)(n,[{key:"render",value:function(){return a.createElement(I,Object.assign({ref:this.selectRef},this.props))}}]),n}(a.Component);D.Option=k,D.OptGroup=_;var B=D,H=n(62),F=n(307),V=n(50),U=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);is)throw new TypeError("version is longer than ".concat(s," characters"));a("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;var i=t.trim().match(n.loose?l[f.LOOSE]:l[f.FULL]);if(!i)throw new TypeError("Invalid Version: ".concat(t));if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>c||this.major<0)throw new TypeError("Invalid major version");if(this.minor>c||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>c||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"===typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: ".concat(e))}return this.format(),this.raw=this.version,this}}]),e}();e.exports=p},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"e",(function(){return ge})),n.d(t,"b",(function(){return Ae})),n.d(t,"d",(function(){return Ae})),n.d(t,"c",(function(){return Ne})),n.d(t,"a",(function(){return ze}));var r=n(6),i=n(16),a=n(17),o=n(27),s=n(18),c=n(19),u=n(0),l=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),f=u.createContext(null),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.render=function(){return u.createElement(f.Provider,{value:this.props.store},this.props.children)},t}(u.Component),d=n(89),p=n.n(d),m=n(232),v=n.n(m),g=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),b=function(){return(b=Object.assign||function(e){for(var t,n=1,r=arguments.length;n1&&void 0!==arguments[1]&&arguments[1],n=e&&"function"===typeof e.getBoundingClientRect&&e.getBoundingClientRect().width;if(n){if(t){var r=getComputedStyle(e),i=r.marginLeft,a=r.marginRight;n+=+i.replace("px","")+ +a.replace("px","")}n=+n.toFixed(6)}return n||0},te=function(e,t,n){e&&"object"===Object(T.a)(e.style)&&(e.style[t]=n)},ne=n(14),re=n(25),ie=n(148),ae=n(56),oe=n(87),se=n(34),ce=n(51),ue={adjustX:1,adjustY:1},le={topLeft:{points:["bl","tl"],overflow:ue,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:ue,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:ue,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:ue,offset:[4,0]}},fe={topLeft:{points:["bl","tl"],overflow:ue,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:ue,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:ue,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:ue,offset:[4,0]}},he=0,de={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},pe=function(e,t,n){var i=J(t),a=e.getState();e.setState({defaultActiveFirst:Object(r.a)(Object(r.a)({},a.defaultActiveFirst),{},Object(k.a)({},i,n))})},me=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var a;Object(i.a)(this,n),(a=t.call(this,e)).onDestroy=function(e){a.props.onDestroy(e)},a.onKeyDown=function(e){var t=e.keyCode,n=a.menuInstance,r=a.props.store,i=a.getVisible();if(t===E.a.ENTER)return a.onTitleClick(e),pe(r,a.props.eventKey,!0),!0;if(t===E.a.RIGHT)return i?n.onKeyDown(e):(a.triggerOpenChange(!0),pe(r,a.props.eventKey,!0)),!0;if(t===E.a.LEFT){var o;if(!i)return;return(o=n.onKeyDown(e))||(a.triggerOpenChange(!1),o=!0),o}return!i||t!==E.a.UP&&t!==E.a.DOWN?void 0:n.onKeyDown(e)},a.onOpenChange=function(e){a.props.onOpenChange(e)},a.onPopupVisibleChange=function(e){a.triggerOpenChange(e,e?"mouseenter":"mouseleave")},a.onMouseEnter=function(e){var t=a.props,n=t.eventKey,r=t.onMouseEnter,i=t.store;pe(i,a.props.eventKey,!1),r({key:n,domEvent:e})},a.onMouseLeave=function(e){var t=a.props,n=t.parentMenu,r=t.eventKey,i=t.onMouseLeave;n.subMenuInstance=Object(o.a)(a),i({key:r,domEvent:e})},a.onTitleMouseEnter=function(e){var t=a.props,n=t.eventKey,r=t.onItemHover,i=t.onTitleMouseEnter;r({key:n,hover:!0}),i({key:n,domEvent:e})},a.onTitleMouseLeave=function(e){var t=a.props,n=t.parentMenu,r=t.eventKey,i=t.onItemHover,s=t.onTitleMouseLeave;n.subMenuInstance=Object(o.a)(a),i({key:r,hover:!1}),s({key:r,domEvent:e})},a.onTitleClick=function(e){var t=Object(o.a)(a).props;t.onTitleClick({key:t.eventKey,domEvent:e}),"hover"!==t.triggerSubMenuAction&&(a.triggerOpenChange(!a.getVisible(),"click"),pe(t.store,a.props.eventKey,!1))},a.onSubMenuClick=function(e){"function"===typeof a.props.onClick&&a.props.onClick(a.addKeyPath(e))},a.onSelect=function(e){a.props.onSelect(e)},a.onDeselect=function(e){a.props.onDeselect(e)},a.getPrefixCls=function(){return"".concat(a.props.rootPrefixCls,"-submenu")},a.getActiveClassName=function(){return"".concat(a.getPrefixCls(),"-active")},a.getDisabledClassName=function(){return"".concat(a.getPrefixCls(),"-disabled")},a.getSelectedClassName=function(){return"".concat(a.getPrefixCls(),"-selected")},a.getOpenClassName=function(){return"".concat(a.props.rootPrefixCls,"-submenu-open")},a.getVisible=function(){return a.state.isOpen},a.getMode=function(){return a.state.mode},a.saveMenuInstance=function(e){a.menuInstance=e},a.addKeyPath=function(e){return Object(r.a)(Object(r.a)({},e),{},{keyPath:(e.keyPath||[]).concat(a.props.eventKey)})},a.triggerOpenChange=function(e,t){var n=a.props.eventKey,r=function(){a.onOpenChange({key:n,item:Object(o.a)(a),trigger:t,open:e})};"mouseenter"===t?a.mouseenterTimeout=setTimeout((function(){r()}),0):r()},a.isChildrenSelected=function(){var e={find:!1};return function e(t,n,r){t&&!r.find&&u.Children.forEach(t,(function(t){if(t){var i=t.type;if(!i||!(i.isSubMenu||i.isMenuItem||i.isMenuItemGroup))return;-1!==n.indexOf(t.key)?r.find=!0:t.props.children&&e(t.props.children,n,r)}}))}(a.props.children,a.props.selectedKeys,e),e.find},a.isInlineMode=function(){return"inline"===a.getMode()},a.adjustWidth=function(){if(a.subMenuTitle&&a.menuInstance){var e=ae.findDOMNode(a.menuInstance);e.offsetWidth>=a.subMenuTitle.offsetWidth||(e.style.minWidth="".concat(a.subMenuTitle.offsetWidth,"px"))}},a.saveSubMenuTitle=function(e){a.subMenuTitle=e},a.getBaseProps=function(){var e=Object(o.a)(a).props,t=a.getMode();return{mode:"horizontal"===t?"vertical":t,visible:a.getVisible(),level:e.level+1,inlineIndent:e.inlineIndent,focusable:!1,onClick:a.onSubMenuClick,onSelect:a.onSelect,onDeselect:a.onDeselect,onDestroy:a.onDestroy,selectedKeys:e.selectedKeys,eventKey:"".concat(e.eventKey,"-menu-"),openKeys:e.openKeys,motion:e.motion,onOpenChange:a.onOpenChange,subMenuOpenDelay:e.subMenuOpenDelay,parentMenu:Object(o.a)(a),subMenuCloseDelay:e.subMenuCloseDelay,forceSubMenuRender:e.forceSubMenuRender,triggerSubMenuAction:e.triggerSubMenuAction,builtinPlacements:e.builtinPlacements,defaultActiveFirst:e.store.getState().defaultActiveFirst[J(e.eventKey)],multiple:e.multiple,prefixCls:e.rootPrefixCls,id:a.internalMenuId,manualRef:a.saveMenuInstance,itemIcon:e.itemIcon,expandIcon:e.expandIcon,direction:e.direction}},a.getMotion=function(e,t){var n=Object(o.a)(a).haveRendered,i=a.props,s=i.motion,c=i.rootPrefixCls;return Object(r.a)(Object(r.a)({},s),{},{leavedClassName:"".concat(c,"-hidden"),removeOnLeave:!1,motionAppear:n||!t||"inline"!==e})};var s=e.store,c=e.eventKey,l=s.getState().defaultActiveFirst;a.isRootMenu=!1;var f=!1;return l&&(f=l[c]),pe(s,c,f),a.state={mode:e.mode,isOpen:e.isOpen},a}return Object(a.a)(n,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var e=this,t=this.props,n=t.mode,r=t.parentMenu,i=t.manualRef,a=t.isOpen,o=function(){e.setState({mode:n,isOpen:a})},s=a!==this.state.isOpen,c=n!==this.state.mode;(c||s)&&(se.a.cancel(this.updateStateRaf),c?this.updateStateRaf=Object(se.a)(o):o()),i&&i(this),"horizontal"===n&&(null===r||void 0===r?void 0:r.isRootMenu)&&a&&(this.minWidthTimeout=setTimeout((function(){return e.adjustWidth()}),0))}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.onDestroy,n=e.eventKey;t&&t(n),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),se.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(e,t){var n=this.getBaseProps();return u.createElement(Ee,Object.assign({},n,{id:this.internalMenuId,className:e,style:t}),this.props.children)}},{key:"renderChildren",value:function(){var e=this,t=this.getBaseProps(),n=t.mode,r=t.visible,i=t.forceSubMenuRender,a=t.direction,o=this.getMotion(n,r);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||r||i,!this.haveOpened)return u.createElement("div",null);var s=j()("".concat(t.prefixCls,"-sub"),Object(k.a)({},"".concat(t.prefixCls,"-rtl"),"rtl"===a));return this.isInlineMode()?u.createElement(ce.b,Object.assign({visible:t.visible},o),(function(t){var n=t.className,r=t.style,i=j()(s,n);return e.renderPopupMenu(i,r)})):this.renderPopupMenu(s)}},{key:"render",value:function(){var e,t,n,i=Object(r.a)({},this.props),a=this.getVisible(),o=this.getPrefixCls(),s=this.isInlineMode(),c=this.getMode(),l=j()(o,"".concat(o,"-").concat(c),(e={},Object(k.a)(e,i.className,!!i.className),Object(k.a)(e,this.getOpenClassName(),a),Object(k.a)(e,this.getActiveClassName(),i.active||a&&!s),Object(k.a)(e,this.getDisabledClassName(),i.disabled),Object(k.a)(e,this.getSelectedClassName(),this.isChildrenSelected()),e));this.internalMenuId||(i.eventKey?this.internalMenuId="".concat(i.eventKey,"$Menu"):(he+=1,this.internalMenuId="$__$".concat(he,"$Menu")));var f={},h={},d={};i.disabled||(f={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},h={onClick:this.onTitleClick},d={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var p={},m="rtl"===i.direction;s&&(m?p.paddingRight=i.inlineIndent*i.level:p.paddingLeft=i.inlineIndent*i.level);var v={};this.getVisible()&&(v={"aria-owns":this.internalMenuId});var g=null;"horizontal"!==c&&(g=this.props.expandIcon,"function"===typeof this.props.expandIcon&&(g=u.createElement(this.props.expandIcon,Object(r.a)({},this.props))));var b=u.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:p,className:"".concat(o,"-title"),role:"button"},d,h,{"aria-expanded":a},v,{"aria-haspopup":"true",title:"string"===typeof i.title?i.title:void 0}),i.title,g||u.createElement("i",{className:"".concat(o,"-arrow")})),y=this.renderChildren(),w=(null===(t=i.parentMenu)||void 0===t?void 0:t.isRootMenu)?i.parentMenu.props.getPopupContainer:function(e){return e.parentNode},x=de[c],M=i.popupOffset?{offset:i.popupOffset}:{},O=j()((n={},Object(k.a)(n,i.popupClassName,i.popupClassName&&!s),Object(k.a)(n,"".concat(o,"-rtl"),m),n)),E=i.disabled,_=i.triggerSubMenuAction,S=i.subMenuOpenDelay,C=i.forceSubMenuRender,T=i.subMenuCloseDelay,A=i.builtinPlacements;$.forEach((function(e){return delete i[e]})),delete i.onClick;var P=m?Object.assign({},fe,A):Object.assign({},le,A);delete i.direction;var N=this.getBaseProps(),R=s?null:this.getMotion(N.mode,N.visible);return u.createElement("li",Object.assign({},i,f,{className:l,role:"menuitem"}),u.createElement(oe.a,{prefixCls:o,popupClassName:j()("".concat(o,"-popup"),O),getPopupContainer:w,builtinPlacements:P,popupPlacement:x,popupVisible:!s&&a,popupAlign:M,popup:s?null:y,action:E||s?[]:[_],mouseEnterDelay:S,mouseLeaveDelay:T,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:C,popupMotion:R},b),s?y:null)}}]),n}(u.Component);me.defaultProps={onMouseEnter:X,onMouseLeave:X,onTitleMouseEnter:X,onTitleMouseLeave:X,onTitleClick:X,manualRef:X,mode:"vertical",title:""};var ve=w((function(e,t){var n=e.openKeys,r=e.activeKey,i=e.selectedKeys,a=t.eventKey,o=t.subMenuKey;return{isOpen:n.indexOf(a)>-1,active:r[o]===a,selectedKeys:i}}))(me);ve.isSubMenu=!0;var ge=ve,be=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){var e;return Object(i.a)(this,n),(e=t.apply(this,arguments)).resizeObserver=null,e.mutationObserver=null,e.originalTotalWidth=0,e.overflowedItems=[],e.menuItemSizes=[],e.cancelFrameId=null,e.state={lastVisibleIndex:void 0},e.childRef=u.createRef(),e.getMenuItemNodes=function(){var t=e.props.prefixCls,n=e.childRef.current;return n?[].slice.call(n.children).filter((function(e){return e.className.split(" ").indexOf("".concat(t,"-overflowed-submenu"))<0})):[]},e.getOverflowedSubMenuItem=function(t,n,i){var a=e.props,o=a.overflowedIndicator,s=a.level,c=a.mode,l=a.prefixCls,f=a.theme;if(1!==s||"horizontal"!==c)return null;var h=e.props.children[0].props,d=(h.children,h.title,h.style),p=Object(re.a)(h,["children","title","style"]),m=Object(r.a)({},d),v="".concat(t,"-overflowed-indicator"),g="".concat(t,"-overflowed-indicator");0===n.length&&!0!==i?m=Object(r.a)(Object(r.a)({},m),{},{display:"none"}):i&&(m=Object(r.a)(Object(r.a)({},m),{},{visibility:"hidden",position:"absolute"}),v="".concat(v,"-placeholder"),g="".concat(g,"-placeholder"));var b=f?"".concat(l,"-").concat(f):"",y={};return $.forEach((function(e){void 0!==p[e]&&(y[e]=p[e])})),u.createElement(ge,Object.assign({title:o,className:"".concat(l,"-overflowed-submenu"),popupClassName:b},y,{key:v,eventKey:g,disabled:!1,style:m}),n)},e.setChildrenWidthAndResize=function(){if("horizontal"===e.props.mode){var t=e.childRef.current;if(t){var n=t.children;if(n&&0!==n.length){var r=t.children[n.length-1];te(r,"display","inline-block");var i=e.getMenuItemNodes(),a=i.filter((function(e){return e.className.split(" ").indexOf("menuitem-overflowed")>=0}));a.forEach((function(e){te(e,"display","inline-block")})),e.menuItemSizes=i.map((function(e){return ee(e,!0)})),a.forEach((function(e){te(e,"display","none")})),e.overflowedIndicatorWidth=ee(t.children[t.children.length-1],!0),e.originalTotalWidth=e.menuItemSizes.reduce((function(e,t){return e+t}),0),e.handleResize(),te(r,"display","none")}}}},e.handleResize=function(){if("horizontal"===e.props.mode){var t=e.childRef.current;if(t){var n=ee(t);e.overflowedItems=[];var r,i=0;e.originalTotalWidth>n+.5&&(r=-1,e.menuItemSizes.forEach((function(t){(i+=t)+e.overflowedIndicatorWidth<=n&&(r+=1)}))),e.setState({lastVisibleIndex:r})}}},e}return Object(a.a)(n,[{key:"componentDidMount",value:function(){var e=this;if(this.setChildrenWidthAndResize(),1===this.props.level&&"horizontal"===this.props.mode){var t=this.childRef.current;if(!t)return;this.resizeObserver=new ie.a((function(t){t.forEach((function(){var t=e.cancelFrameId;cancelAnimationFrame(t),e.cancelFrameId=requestAnimationFrame(e.setChildrenWidthAndResize)}))})),[].slice.call(t.children).concat(t).forEach((function(t){e.resizeObserver.observe(t)})),"undefined"!==typeof MutationObserver&&(this.mutationObserver=new MutationObserver((function(){e.resizeObserver.disconnect(),[].slice.call(t.children).concat(t).forEach((function(t){e.resizeObserver.observe(t)})),e.setChildrenWidthAndResize()})),this.mutationObserver.observe(t,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(e){var t=this,n=this.state.lastVisibleIndex;return(e||[]).reduce((function(r,i,a){var o=i;if("horizontal"===t.props.mode){var s=t.getOverflowedSubMenuItem(i.props.eventKey,[]);void 0!==n&&-1!==t.props.className.indexOf("".concat(t.props.prefixCls,"-root"))&&(a>n&&(o=u.cloneElement(i,{style:{display:"none"},eventKey:"".concat(i.props.eventKey,"-hidden"),className:"".concat("menuitem-overflowed")})),a===n+1&&(t.overflowedItems=e.slice(n+1).map((function(e){return u.cloneElement(e,{key:e.props.eventKey,mode:"vertical-left"})})),s=t.getOverflowedSubMenuItem(i.props.eventKey,t.overflowedItems)));var c=[].concat(Object(ne.a)(r),[s,o]);return a===e.length-1&&c.push(t.getOverflowedSubMenuItem(i.props.eventKey,[],!0)),c}return[].concat(Object(ne.a)(r),[o])}),[])}},{key:"render",value:function(){var e=this.props,t=(e.visible,e.prefixCls,e.overflowedIndicator,e.mode,e.level,e.tag),n=e.children,r=(e.theme,Object(re.a)(e,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"])),i=t;return u.createElement(i,Object.assign({ref:this.childRef},r),this.renderChildren(n))}}]),n}(u.Component);be.defaultProps={tag:"div",className:""};var ye=be;function we(e,t,n){var i=e.getState();e.setState({activeKey:Object(r.a)(Object(r.a)({},i.activeKey),{},Object(k.a)({},t,n))})}function xe(e){return e.eventKey||"0-menu-"}function Me(e,t){var n,r=t,i=e.children,a=e.eventKey;if(r&&(Q(i,(function(e,t){e&&e.props&&!e.props.disabled&&r===Z(e,a,t)&&(n=!0)})),n))return r;return r=null,e.defaultActiveFirst?(Q(i,(function(e,t){r||!e||e.props.disabled||(r=Z(e,a,t))})),r):r}function Oe(e){if(e){var t=this.instanceArray.indexOf(e);-1!==t?this.instanceArray[t]=e:this.instanceArray.push(e)}}var ke=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var a;return Object(i.a)(this,n),(a=t.call(this,e)).onKeyDown=function(e,t){var n,r=e.keyCode;if(a.getFlatInstanceArray().forEach((function(t){t&&t.props.active&&t.onKeyDown&&(n=t.onKeyDown(e))})),n)return 1;var i=null;return r!==E.a.UP&&r!==E.a.DOWN||(i=a.step(r===E.a.UP?-1:1)),i?(e.preventDefault(),we(a.props.store,xe(a.props),i.props.eventKey),"function"===typeof t&&t(i),1):void 0},a.onItemHover=function(e){var t=e.key,n=e.hover;we(a.props.store,xe(a.props),n?t:null)},a.onDeselect=function(e){a.props.onDeselect(e)},a.onSelect=function(e){a.props.onSelect(e)},a.onClick=function(e){a.props.onClick(e)},a.onOpenChange=function(e){a.props.onOpenChange(e)},a.onDestroy=function(e){a.props.onDestroy(e)},a.getFlatInstanceArray=function(){return a.instanceArray},a.step=function(e){var t=a.getFlatInstanceArray(),n=a.props.store.getState().activeKey[xe(a.props)],r=t.length;if(!r)return null;e<0&&(t=t.concat().reverse());var i=-1;if(t.every((function(e,t){return!e||e.props.eventKey!==n||(i=t,!1)})),a.props.defaultActiveFirst||-1===i||(o=t.slice(i,r-1)).length&&!o.every((function(e){return!!e.props.disabled}))){var o,s=(i+1)%r,c=s;do{var u=t[c];if(u&&!u.props.disabled)return u;c=(c+1)%r}while(c!==s);return null}},a.renderCommonMenuItem=function(e,t,n){var i=a.props.store.getState(),s=Object(o.a)(a).props,c=Z(e,s.eventKey,t),l=e.props;if(!l||"string"===typeof e.type)return e;var f=c===i.activeKey,h=Object(r.a)(Object(r.a)({mode:l.mode||s.mode,level:s.level,inlineIndent:s.inlineIndent,renderMenuItem:a.renderMenuItem,rootPrefixCls:s.prefixCls,index:t,parentMenu:s.parentMenu,manualRef:l.disabled?void 0:_(e.ref,Oe.bind(Object(o.a)(a))),eventKey:c,active:!l.disabled&&f,multiple:s.multiple,onClick:function(e){(l.onClick||X)(e),a.onClick(e)},onItemHover:a.onItemHover,motion:s.motion,subMenuOpenDelay:s.subMenuOpenDelay,subMenuCloseDelay:s.subMenuCloseDelay,forceSubMenuRender:s.forceSubMenuRender,onOpenChange:a.onOpenChange,onDeselect:a.onDeselect,onSelect:a.onSelect,builtinPlacements:s.builtinPlacements,itemIcon:l.itemIcon||a.props.itemIcon,expandIcon:l.expandIcon||a.props.expandIcon},n),{},{direction:s.direction});return("inline"===s.mode||Y.any)&&(h.triggerSubMenuAction="click"),u.cloneElement(e,Object(r.a)(Object(r.a)({},h),{},{key:c||t}))},a.renderMenuItem=function(e,t,n){if(!e)return null;var r=a.props.store.getState(),i={openKeys:r.openKeys,selectedKeys:r.selectedKeys,triggerSubMenuAction:a.props.triggerSubMenuAction,subMenuKey:n};return a.renderCommonMenuItem(e,t,i)},e.store.setState({activeKey:Object(r.a)(Object(r.a)({},e.store.getState().activeKey),{},Object(k.a)({},e.eventKey,Me(e,e.activeKey)))}),a.instanceArray=[],a}return Object(a.a)(n,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(e){return this.props.visible||e.visible||this.props.className!==e.className||!p()(this.props.style,e.style)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n="activeKey"in t?t.activeKey:t.store.getState().activeKey[xe(t)],r=Me(t,n);if(r!==n)we(t.store,xe(t),r);else if("activeKey"in e){r!==Me(e,e.activeKey)&&we(t.store,xe(t),r)}}},{key:"render",value:function(){var e=this,t=Object(O.a)({},this.props);this.instanceArray=[];var n={className:j()(t.prefixCls,t.className,"".concat(t.prefixCls,"-").concat(t.mode)),role:t.role||"menu"};t.id&&(n.id=t.id),t.focusable&&(n.tabIndex=0,n.onKeyDown=this.onKeyDown);var r=t.prefixCls,i=t.eventKey,a=t.visible,o=t.level,s=t.mode,c=t.overflowedIndicator,l=t.theme;return $.forEach((function(e){return delete t[e]})),delete t.onClick,u.createElement(ye,Object.assign({},t,{prefixCls:r,mode:s,tag:"ul",level:o,theme:l,visible:a,overflowedIndicator:c},n),Object(S.a)(t.children).map((function(t,n){return e.renderMenuItem(t,n,i||"0-menu-")})))}}]),n}(u.Component);ke.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:X};var Ee=w()(ke),_e=n(28);function Se(e,t,n){var r=e.prefixCls,i=e.motion,a=e.defaultMotions,o=void 0===a?{}:a,s=e.openAnimation,c=e.openTransitionName,u=t.switchingModeFromInline;if(i)return i;if("object"===Object(T.a)(s)&&s)Object(_e.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if("string"===typeof s)return{motionName:"".concat(r,"-open-").concat(s)};if(c)return{motionName:c};var l=o[n];return l||(u?null:o.other)}var Ce=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var a;Object(i.a)(this,n),(a=t.call(this,e)).onSelect=function(e){var t=Object(o.a)(a).props;if(t.selectable){var n=a.store.getState().selectedKeys,i=e.key;n=t.multiple?n.concat([i]):[i],"selectedKeys"in t||a.store.setState({selectedKeys:n}),t.onSelect(Object(r.a)(Object(r.a)({},e),{},{selectedKeys:n}))}},a.onClick=function(e){var t=a.getRealMenuMode(),n=Object(o.a)(a),r=n.store,i=n.props.onOpenChange;"inline"===t||"openKeys"in a.props||(r.setState({openKeys:[]}),i([])),a.props.onClick(e)},a.onKeyDown=function(e,t){a.innerMenu.getWrappedInstance().onKeyDown(e,t)},a.onOpenChange=function(e){var t=Object(o.a)(a).props,n=a.store.getState().openKeys.concat(),r=!1,i=function(e){var t=!1;if(e.open)(t=-1===n.indexOf(e.key))&&n.push(e.key);else{var i=n.indexOf(e.key);(t=-1!==i)&&n.splice(i,1)}r=r||t};Array.isArray(e)?e.forEach(i):i(e),r&&("openKeys"in a.props||a.store.setState({openKeys:n}),t.onOpenChange(n))},a.onDeselect=function(e){var t=Object(o.a)(a).props;if(t.selectable){var n=a.store.getState().selectedKeys.concat(),i=e.key,s=n.indexOf(i);-1!==s&&n.splice(s,1),"selectedKeys"in t||a.store.setState({selectedKeys:n}),t.onDeselect(Object(r.a)(Object(r.a)({},e),{},{selectedKeys:n}))}},a.onMouseEnter=function(e){a.restoreModeVerticalFromInline();var t=a.props.onMouseEnter;t&&t(e)},a.onTransitionEnd=function(e){var t="width"===e.propertyName&&e.target===e.currentTarget,n=e.target.className,r="[object SVGAnimatedString]"===Object.prototype.toString.call(n)?n.animVal:n,i="font-size"===e.propertyName&&r.indexOf("anticon")>=0;(t||i)&&a.restoreModeVerticalFromInline()},a.setInnerMenu=function(e){a.innerMenu=e},a.isRootMenu=!0;var s=e.defaultSelectedKeys,c=e.defaultOpenKeys;return"selectedKeys"in e&&(s=e.selectedKeys||[]),"openKeys"in e&&(c=e.openKeys||[]),a.store=function(e){var t=e,n=[];return{setState:function(e){t=x(x({},t),e);for(var r=0;r=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function ye(e){var t,n,r;if(pe.isWindow(e)||9===e.nodeType){var i=pe.getWindow(e);t={left:pe.getWindowScrollLeft(i),top:pe.getWindowScrollTop(i)},n=pe.viewportWidth(i),r=pe.viewportHeight(i)}else t=pe.offset(e),n=pe.outerWidth(e),r=pe.outerHeight(e);return t.width=n,t.height=r,t}function we(e,t){var n=t.charAt(0),r=t.charAt(1),i=e.width,a=e.height,o=e.left,s=e.top;return"c"===n?s+=a/2:"b"===n&&(s+=a),"c"===r?o+=i/2:"r"===r&&(o+=i),{left:o,top:s}}function xe(e,t,n,r,i){var a=we(t,n[1]),o=we(e,n[0]),s=[o.left-a.left,o.top-a.top];return{left:Math.round(e.left-s[0]+r[0]-i[0]),top:Math.round(e.top-s[1]+r[1]-i[1])}}function Me(e,t,n){return e.leftn.right}function Oe(e,t,n){return e.topn.bottom}function ke(e,t,n){var r=[];return pe.each(e,(function(e){r.push(e.replace(t,(function(e){return n[e]})))})),r}function Ee(e,t){return e[t]=-e[t],e}function _e(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function Se(e,t){e[0]=_e(e[0],t.width),e[1]=_e(e[1],t.height)}function Ce(e,t,n,r){var i=n.points,a=n.offset||[0,0],o=n.targetOffset||[0,0],s=n.overflow,c=n.source||e;a=[].concat(a),o=[].concat(o);var u={},l=0,f=be(c,!(!(s=s||{})||!s.alwaysByViewport)),h=ye(c);Se(a,h),Se(o,t);var d=xe(h,t,i,a,o),p=pe.merge(h,d);if(f&&(s.adjustX||s.adjustY)&&r){if(s.adjustX&&Me(d,h,f)){var m=ke(i,/[lr]/gi,{l:"r",r:"l"}),v=Ee(a,0),g=Ee(o,0);(function(e,t,n){return e.left>n.right||e.left+t.widthn.bottom||e.top+t.height=n.left&&i.left+a.width>n.right&&(a.width-=i.left+a.width-n.right),r.adjustX&&i.left+a.width>n.right&&(i.left=Math.max(n.right-a.width,n.left)),r.adjustY&&i.top=n.top&&i.top+a.height>n.bottom&&(a.height-=i.top+a.height-n.bottom),r.adjustY&&i.top+a.height>n.bottom&&(i.top=Math.max(n.bottom-a.height,n.top)),pe.mix(i,a)}(d,h,f,u))}return p.width!==h.width&&pe.css(c,"width",pe.width(c)+p.width-h.width),p.height!==h.height&&pe.css(c,"height",pe.height(c)+p.height-h.height),pe.offset(c,{left:p.left,top:p.top},{useCssRight:n.useCssRight,useCssBottom:n.useCssBottom,useCssTransform:n.useCssTransform,ignoreShake:n.ignoreShake}),{points:i,offset:a,targetOffset:o,overflow:u}}function je(e,t,n){var r=n.target||t;return Ce(e,ye(r),n,!function(e,t){var n=be(e,t),r=ye(e);return!n||r.left+r.width<=n.left||r.top+r.height<=n.top||r.left>=n.right||r.top>=n.bottom}(r,n.overflow&&n.overflow.alwaysByViewport))}function Te(e,t,n){var r,i,a=pe.getDocument(e),o=a.defaultView||a.parentWindow,s=pe.getWindowScrollLeft(o),c=pe.getWindowScrollTop(o),u=pe.viewportWidth(o),l=pe.viewportHeight(o);r="pageX"in t?t.pageX:s+t.clientX,i="pageY"in t?t.pageY:c+t.clientY;var f=r>=0&&r<=s+u&&i>=0&&i<=c+l;return Ce(e,{left:r,top:i,width:0,height:0},function(e){for(var t=1;t1&&(K=u.createElement("div",{className:"".concat(i,"-content")},s)),u.createElement(E.b,Object.assign({visible:n,ref:S,leavedClassName:"".concat(i,"-hidden")},U,{onAppearPrepare:W,onEnterPrepare:W,removeOnLeave:f}),(function(e,t){var n=e.className,o=e.style,s=w()(i,a,T,n);return u.createElement(Le,{target:p||m,key:"popup",ref:k,monitorWindowResize:!0,disabled:G,align:h,onAlign:V},u.createElement("div",{ref:t,className:s,onMouseEnter:b,onMouseLeave:y,onMouseDown:x,onTouchStart:O,style:Object(r.a)(Object(r.a)({},o),q)},K))}))}));Fe.displayName="PopupInner";var Ve=Fe,Ue=u.forwardRef((function(e,t){var n=e.prefixCls,i=e.visible,a=e.zIndex,o=e.children,s=e.mobile,c=(s=void 0===s?{}:s).popupClassName,l=s.popupStyle,f=s.popupMotion,h=void 0===f?{}:f,d=s.popupRender,p=u.useRef();u.useImperativeHandle(t,(function(){return{forceAlign:function(){},getElement:function(){return p.current}}}));var m=Object(r.a)({zIndex:a},l),v=o;return u.Children.count(o)>1&&(v=u.createElement("div",{className:"".concat(n,"-content")},o)),d&&(v=d(v)),u.createElement(E.b,Object.assign({visible:i,ref:p,removeOnLeave:!0},h),(function(e,t){var i=e.className,a=e.style,o=w()(n,c,i);return u.createElement("div",{ref:t,className:o,style:Object(r.a)(Object(r.a)({},a),m)},v)}))}));Ue.displayName="MobilePopupInner";var We=Ue,qe=u.forwardRef((function(e,t){var n=e.visible,i=e.mobile,a=Object(O.a)(e,["visible","mobile"]),o=Object(u.useState)(n),s=Object(M.a)(o,2),c=s[0],l=s[1],f=Object(u.useState)(!1),h=Object(M.a)(f,2),d=h[0],p=h[1],m=Object(r.a)(Object(r.a)({},a),{},{visible:c});Object(u.useEffect)((function(){l(n),n&&i&&p(Object(k.a)())}),[n,!!i]);var v=d?u.createElement(We,Object.assign({},m,{mobile:i,ref:t})):u.createElement(Ve,Object.assign({},m,{ref:t}));return u.createElement("div",null,u.createElement(S,Object.assign({},m)),v)}));qe.displayName="Popup";var Ge=qe,Ke=u.createContext(null);function Ye(){}function Xe(){return""}function Ze(e){return e?e.ownerDocument:window.document}var Je=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];t.a=function(e){var t=function(t){Object(s.a)(l,t);var n=Object(c.a)(l);function l(e){var t,r;return Object(i.a)(this,l),(t=n.call(this,e)).popupRef=u.createRef(),t.triggerRef=u.createRef(),t.onMouseEnter=function(e){var n=t.props.mouseEnterDelay;t.fireEvents("onMouseEnter",e),t.delaySetPopupVisible(!0,n,n?null:e)},t.onMouseMove=function(e){t.fireEvents("onMouseMove",e),t.setPoint(e)},t.onMouseLeave=function(e){t.fireEvents("onMouseLeave",e),t.delaySetPopupVisible(!1,t.props.mouseLeaveDelay)},t.onPopupMouseEnter=function(){t.clearDelayTimer()},t.onPopupMouseLeave=function(e){var n;e.relatedTarget&&!e.relatedTarget.setTimeout&&Object(p.a)(null===(n=t.popupRef.current)||void 0===n?void 0:n.getElement(),e.relatedTarget)||t.delaySetPopupVisible(!1,t.props.mouseLeaveDelay)},t.onFocus=function(e){t.fireEvents("onFocus",e),t.clearDelayTimer(),t.isFocusToShow()&&(t.focusTime=Date.now(),t.delaySetPopupVisible(!0,t.props.focusDelay))},t.onMouseDown=function(e){t.fireEvents("onMouseDown",e),t.preClickTime=Date.now()},t.onTouchStart=function(e){t.fireEvents("onTouchStart",e),t.preTouchTime=Date.now()},t.onBlur=function(e){t.fireEvents("onBlur",e),t.clearDelayTimer(),t.isBlurToHide()&&t.delaySetPopupVisible(!1,t.props.blurDelay)},t.onContextMenu=function(e){e.preventDefault(),t.fireEvents("onContextMenu",e),t.setPopupVisible(!0,e)},t.onContextMenuClose=function(){t.isContextMenuToShow()&&t.close()},t.onClick=function(e){if(t.fireEvents("onClick",e),t.focusTime){var n;if(t.preClickTime&&t.preTouchTime?n=Math.min(t.preClickTime,t.preTouchTime):t.preClickTime?n=t.preClickTime:t.preTouchTime&&(n=t.preTouchTime),Math.abs(n-t.focusTime)<20)return;t.focusTime=0}t.preClickTime=0,t.preTouchTime=0,t.isClickToShow()&&(t.isClickToHide()||t.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault();var r=!t.state.popupVisible;(t.isClickToHide()&&!r||r&&t.isClickToShow())&&t.setPopupVisible(!t.state.popupVisible,e)},t.onPopupMouseDown=function(){var e;(t.hasPopupMouseDown=!0,clearTimeout(t.mouseDownTimeout),t.mouseDownTimeout=window.setTimeout((function(){t.hasPopupMouseDown=!1}),0),t.context)&&(e=t.context).onPopupMouseDown.apply(e,arguments)},t.onDocumentClick=function(e){if(!t.props.mask||t.props.maskClosable){var n=e.target,r=t.getRootDomNode(),i=t.getPopupDomNode();Object(p.a)(r,n)||Object(p.a)(i,n)||t.hasPopupMouseDown||t.close()}},t.getRootDomNode=function(){var e=t.props.getTriggerDOMNode;if(e)return e(t.triggerRef.current);try{var n=Object(m.a)(t.triggerRef.current);if(n)return n}catch(r){}return h.a.findDOMNode(Object(o.a)(t))},t.getPopupClassNameFromAlign=function(e){var n=[],r=t.props,i=r.popupPlacement,a=r.builtinPlacements,o=r.prefixCls,s=r.alignPoint,c=r.getPopupClassNameFromAlign;return i&&a&&n.push(function(e,t,n,r){for(var i=n.points,a=Object.keys(e),o=0;o1)for(var n=1;n3&&void 0!==arguments[3]&&arguments[3];return t.length&&r&&void 0===n&&!O(e,t.slice(0,-1))?e:_(e,t,n,r)}(e,t,n)}function T(e,t){var n={};return t.forEach((function(t){var r=C(e,t);n=j(n,t,r)})),n}function A(e,t){return e&&e.some((function(e){return z(e,t)}))}function P(e){return"object"===Object(x.a)(e)&&null!==e&&Object.getPrototypeOf(e)===Object.prototype}function N(e,t){var n=Array.isArray(e)?Object(c.a)(e):Object(s.a)({},e);return t?(Object.keys(t).forEach((function(e){var r=n[e],i=t[e],a=P(r)&&P(i);n[e]=a?N(r,i||{}):i})),n):n}function R(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=r||n<0||n>=r)return e;var i=e[t],a=t-n;return a>0?[].concat(Object(c.a)(e.slice(0,n)),[i],Object(c.a)(e.slice(n,t)),Object(c.a)(e.slice(t+1,r))):a<0?[].concat(Object(c.a)(e.slice(0,t)),Object(c.a)(e.slice(t+1,n+1)),[i],Object(c.a)(e.slice(n+1,r))):e}var D="'${name}' is not a valid ${type}",B={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:D,method:D,array:D,object:D,number:D,date:D,boolean:D,integer:D,float:D,regexp:D,email:D,url:D,hex:D},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},H=M.a;function F(e,t,n,r){var i=Object(s.a)(Object(s.a)({},n),{},{name:t,enum:(n.enum||[]).join(", ")}),a=function(e,t){return function(){return function(e,t){return e.replace(/\$\{\w+\}/g,(function(e){var n=e.slice(2,-1);return t[n]}))}(e,Object(s.a)(Object(s.a)({},i),t))}};return function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(t).forEach((function(i){var o=t[i];"string"===typeof o?n[i]=a(o,r):o&&"object"===Object(x.a)(o)?(n[i]={},e(o,n[i])):n[i]=o})),n}(R({},B,e))}function V(e,t,n,r,i){return U.apply(this,arguments)}function U(){return(U=Object(w.a)(y.a.mark((function e(t,n,i,a,u){var l,f,h,d,p,m;return y.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=Object(s.a)({},i),f=null,l&&"array"===l.type&&l.defaultField&&(f=l.defaultField,delete l.defaultField),h=new H(Object(o.a)({},t,[l])),d=F(a.validateMessages,t,l,u),h.messages(d),p=[],e.prev=7,e.next=10,Promise.resolve(h.validate(Object(o.a)({},t,n),Object(s.a)({},a)));case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(7),e.t0.errors?p=e.t0.errors.map((function(e,t){var n=e.message;return r.isValidElement(n)?r.cloneElement(n,{key:"error_".concat(t)}):n})):(console.error(e.t0),p=[d.default()]);case 15:if(p.length||!f){e.next=20;break}return e.next=18,Promise.all(n.map((function(e,n){return V("".concat(t,".").concat(n),e,f,a,u)})));case 18:return m=e.sent,e.abrupt("return",m.reduce((function(e,t){return[].concat(Object(c.a)(e),Object(c.a)(t))}),[]));case 20:return e.abrupt("return",p);case 21:case"end":return e.stop()}}),e,null,[[7,12]])})))).apply(this,arguments)}function W(e,t,n,r,i,a){var o,c=e.join("."),u=n.map((function(e){var t=e.validator;return t?Object(s.a)(Object(s.a)({},e),{},{validator:function(e,n,r){var i=!1,a=t(e,n,(function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:[];i.validatePromise===r&&(i.validatePromise=null,i.errors=e,i.reRender())})),f}));return i.validatePromise=r,i.dirty=!0,i.errors=[],i.reRender(),r},i.isFieldValidating=function(){return!!i.validatePromise},i.isFieldTouched=function(){return i.touched},i.isFieldDirty=function(){return i.dirty},i.getErrors=function(){return i.errors},i.isListField=function(){return i.props.isListField},i.isList=function(){return i.props.isList},i.isPreserve=function(){return i.props.preserve},i.getMeta=function(){return i.prevValidating=i.isFieldValidating(),{touched:i.isFieldTouched(),validating:i.prevValidating,errors:i.errors,name:i.getNamePath()}},i.getOnlyChild=function(e){if("function"===typeof e){var t=i.getMeta();return Object(s.a)(Object(s.a)({},i.getOnlyChild(e(i.getControlled(),t,i.props.fieldContext))),{},{isFunction:!0})}var n=Object(p.a)(e);return 1===n.length&&r.isValidElement(n[0])?{child:n[0],isFunction:!1}:{child:n,isFunction:!1}},i.getValue=function(e){var t=i.props.fieldContext.getFieldsValue,n=i.getNamePath();return C(e||t(!0),n)},i.getControlled=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=i.props,n=t.trigger,r=t.validateTrigger,a=t.getValueFromEvent,c=t.normalize,u=t.valuePropName,l=t.getValueProps,f=t.fieldContext,h=void 0!==r?r:f.validateTrigger,d=i.getNamePath(),p=f.getInternalHooks,m=f.getFieldsValue,b=p(v.a),y=b.dispatch,w=i.getValue(),x=l||function(e){return Object(o.a)({},u,e)},M=e[n],O=Object(s.a)(Object(s.a)({},e),x(w));O[n]=function(){var e;i.touched=!0,i.dirty=!0;for(var t=arguments.length,n=new Array(t),r=0;r=0&&t<=n.length?(l.keys=[].concat(Object(c.a)(l.keys.slice(0,t)),[l.id],Object(c.a)(l.keys.slice(t))),a([].concat(Object(c.a)(n.slice(0,t)),[e],Object(c.a)(n.slice(t))))):(l.keys=[].concat(Object(c.a)(l.keys),[l.id]),a([].concat(Object(c.a)(n),[e]))),l.id+=1},remove:function(e){var t=s(),n=new Set(Array.isArray(e)?e:[e]);n.size<=0||(l.keys=l.keys.filter((function(e,t){return!n.has(t)})),a(t.filter((function(e,t){return!n.has(t)}))))},move:function(e,t){if(e!==t){var n=s();e<0||e>=n.length||t<0||t>=n.length||(l.keys=I(l.keys,e,t),a(I(n,e,t)))}}},d=r||[];return Array.isArray(d)||(d=[]),i(d.map((function(e,t){var n=l.keys[t];return void 0===n&&(l.keys[t]=l.id,n=l.keys[t],l.id+=1),{name:t,key:n,isListField:!0}})),f,t)})))},J=n(9);var Q="__@field_split__";function $(e){return e.map((function(e){return"".concat(Object(x.a)(e),":").concat(e)})).join(Q)}var ee=function(){function e(){Object(u.a)(this,e),this.kvs=new Map}return Object(l.a)(e,[{key:"set",value:function(e,t){this.kvs.set($(e),t)}},{key:"get",value:function(e){return this.kvs.get($(e))}},{key:"update",value:function(e,t){var n=t(this.get(e));n?this.set(e,n):this.delete(e)}},{key:"delete",value:function(e){this.kvs.delete($(e))}},{key:"map",value:function(e){return Object(c.a)(this.kvs.entries()).map((function(t){var n=Object(J.a)(t,2),r=n[0],i=n[1],a=r.split(Q);return e({key:a.map((function(e){var t=e.match(/^([^:]*):(.*)$/),n=Object(J.a)(t,3),r=n[1],i=n[2];return"number"===r?Number(i):i})),value:i})}))}},{key:"toJSON",value:function(){var e={};return this.map((function(t){var n=t.key,r=t.value;return e[n.join(".")]=r,null})),e}}]),e}(),te=function e(t){var n=this;Object(u.a)(this,e),this.formHooked=!1,this.subscribable=!0,this.store={},this.fieldEntities=[],this.initialValues={},this.callbacks={},this.validateMessages=null,this.preserve=null,this.lastValidatePromise=null,this.getForm=function(){return{getFieldValue:n.getFieldValue,getFieldsValue:n.getFieldsValue,getFieldError:n.getFieldError,getFieldsError:n.getFieldsError,isFieldsTouched:n.isFieldsTouched,isFieldTouched:n.isFieldTouched,isFieldValidating:n.isFieldValidating,isFieldsValidating:n.isFieldsValidating,resetFields:n.resetFields,setFields:n.setFields,setFieldsValue:n.setFieldsValue,validateFields:n.validateFields,submit:n.submit,getInternalHooks:n.getInternalHooks}},this.getInternalHooks=function(e){return e===v.a?(n.formHooked=!0,{dispatch:n.dispatch,initEntityValue:n.initEntityValue,registerField:n.registerField,useSubscribe:n.useSubscribe,setInitialValues:n.setInitialValues,setCallbacks:n.setCallbacks,setValidateMessages:n.setValidateMessages,getFields:n.getFields,setPreserve:n.setPreserve}):(Object(m.a)(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)},this.useSubscribe=function(e){n.subscribable=e},this.setInitialValues=function(e,t){n.initialValues=e||{},t&&(n.store=R({},e,n.store))},this.getInitialValue=function(e){return C(n.initialValues,e)},this.setCallbacks=function(e){n.callbacks=e},this.setValidateMessages=function(e){n.validateMessages=e},this.setPreserve=function(e){n.preserve=e},this.timeoutId=null,this.warningUnhooked=function(){0},this.getFieldEntities=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?n.fieldEntities.filter((function(e){return e.getNamePath().length})):n.fieldEntities},this.getFieldsMap=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=new ee;return n.getFieldEntities(e).forEach((function(e){var n=e.getNamePath();t.set(n,e)})),t},this.getFieldEntitiesForNamePathList=function(e){if(!e)return n.getFieldEntities(!0);var t=n.getFieldsMap(!0);return e.map((function(e){var n=S(e);return t.get(n)||{INVALIDATE_NAME_PATH:S(e)}}))},this.getFieldsValue=function(e,t){if(n.warningUnhooked(),!0===e&&!t)return n.store;var r=n.getFieldEntitiesForNamePathList(Array.isArray(e)?e:null),i=[];return r.forEach((function(n){var r,a="INVALIDATE_NAME_PATH"in n?n.INVALIDATE_NAME_PATH:n.getNamePath();if(e||!(null===(r=n.isListField)||void 0===r?void 0:r.call(n)))if(t){var o="getMeta"in n?n.getMeta():null;t(o)&&i.push(a)}else i.push(a)})),T(n.store,i.map(S))},this.getFieldValue=function(e){n.warningUnhooked();var t=S(e);return C(n.store,t)},this.getFieldsError=function(e){return n.warningUnhooked(),n.getFieldEntitiesForNamePathList(e).map((function(t,n){return t&&!("INVALIDATE_NAME_PATH"in t)?{name:t.getNamePath(),errors:t.getErrors()}:{name:S(e[n]),errors:[]}}))},this.getFieldError=function(e){n.warningUnhooked();var t=S(e);return n.getFieldsError([t])[0].errors},this.isFieldsTouched=function(){n.warningUnhooked();for(var e=arguments.length,t=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=new ee,r=n.getFieldEntities(!0);r.forEach((function(e){var n=e.props.initialValue,r=e.getNamePath();if(void 0!==n){var i=t.get(r)||new Set;i.add({entity:e,value:n}),t.set(r,i)}}));var i,a=function(r){r.forEach((function(r){if(void 0!==r.props.initialValue){var i=r.getNamePath();if(void 0!==n.getInitialValue(i))Object(m.a)(!1,"Form already set 'initialValues' with path '".concat(i.join("."),"'. Field can not overwrite it."));else{var a=t.get(i);if(a&&a.size>1)Object(m.a)(!1,"Multiple Field with path '".concat(i.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(a){var o=n.getFieldValue(i);e.skipExist&&void 0!==o||(n.store=j(n.store,i,Object(c.a)(a)[0].value))}}}}))};e.entities?i=e.entities:e.namePathList?(i=[],e.namePathList.forEach((function(e){var n,r=t.get(e);r&&(n=i).push.apply(n,Object(c.a)(Object(c.a)(r).map((function(e){return e.entity}))))}))):i=r,a(i)},this.resetFields=function(e){n.warningUnhooked();var t=n.store;if(!e)return n.store=R({},n.initialValues),n.resetWithFieldInitialValue(),void n.notifyObservers(t,null,{type:"reset"});var r=e.map(S);r.forEach((function(e){var t=n.getInitialValue(e);n.store=j(n.store,e,t)})),n.resetWithFieldInitialValue({namePathList:r}),n.notifyObservers(t,r,{type:"reset"})},this.setFields=function(e){n.warningUnhooked();var t=n.store;e.forEach((function(e){var r=e.name,i=(e.errors,Object(a.a)(e,["name","errors"])),o=S(r);"value"in i&&(n.store=j(n.store,o,i.value)),n.notifyObservers(t,[o],{type:"setField",data:e})}))},this.getFields=function(){return n.getFieldEntities(!0).map((function(e){var t=e.getNamePath(),r=e.getMeta(),i=Object(s.a)(Object(s.a)({},r),{},{name:t,value:n.getFieldValue(t)});return Object.defineProperty(i,"originRCField",{value:!0}),i}))},this.initEntityValue=function(e){var t=e.props.initialValue;if(void 0!==t){var r=e.getNamePath();void 0===C(n.store,r)&&(n.store=j(n.store,r,t))}},this.registerField=function(e){if(n.fieldEntities.push(e),void 0!==e.props.initialValue){var t=n.store;n.resetWithFieldInitialValue({entities:[e],skipExist:!0}),n.notifyObservers(t,[e.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(t,r){if(n.fieldEntities=n.fieldEntities.filter((function(t){return t!==e})),!1===(void 0!==r?r:n.preserve)&&!t){var i=e.getNamePath(),a=C(n.initialValues,i);i.length&&n.getFieldValue(i)!==a&&n.fieldEntities.every((function(e){return!z(e.getNamePath(),i)}))&&(n.store=j(n.store,i,a))}}},this.dispatch=function(e){switch(e.type){case"updateValue":var t=e.namePath,r=e.value;n.updateValue(t,r);break;case"validateField":var i=e.namePath,a=e.triggerName;n.validateFields([i],{triggerName:a})}},this.notifyObservers=function(e,t,r){if(n.subscribable){var i=Object(s.a)(Object(s.a)({},r),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach((function(n){(0,n.onStoreChange)(e,t,i)}))}else n.forceRootUpdate()},this.updateValue=function(e,t){var r=S(e),i=n.store;n.store=j(n.store,r,t),n.notifyObservers(i,[r],{type:"valueUpdate",source:"internal"});var a=n.getDependencyChildrenFields(r);a.length&&n.validateFields(a),n.notifyObservers(i,a,{type:"dependenciesUpdate",relatedFields:[r].concat(Object(c.a)(a))});var o=n.callbacks.onValuesChange;o&&o(T(n.store,[r]),n.getFieldsValue());n.triggerOnFieldsChange([r].concat(Object(c.a)(a)))},this.setFieldsValue=function(e){n.warningUnhooked();var t=n.store;e&&(n.store=R(n.store,e)),n.notifyObservers(t,null,{type:"valueUpdate",source:"external"})},this.getDependencyChildrenFields=function(e){var t=new Set,r=[],i=new ee;n.getFieldEntities().forEach((function(e){(e.props.dependencies||[]).forEach((function(t){var n=S(t);i.update(n,(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Set;return t.add(e),t}))}))}));return function e(n){(i.get(n)||new Set).forEach((function(n){if(!t.has(n)){t.add(n);var i=n.getNamePath();n.isFieldDirty()&&i.length&&(r.push(i),e(i))}}))}(e),r},this.triggerOnFieldsChange=function(e,t){var r=n.callbacks.onFieldsChange;if(r){var i=n.getFields();if(t){var a=new ee;t.forEach((function(e){var t=e.name,n=e.errors;a.set(t,n)})),i.forEach((function(e){e.errors=a.get(e.name)||e.errors}))}r(i.filter((function(t){var n=t.name;return A(e,n)})),i)}},this.validateFields=function(e,t){n.warningUnhooked();var r=!!e,i=r?e.map(S):[],a=[];n.getFieldEntities(!0).forEach((function(o){if(r||i.push(o.getNamePath()),(null===t||void 0===t?void 0:t.recursive)&&r){var c=o.getNamePath();c.every((function(t,n){return e[n]===t||void 0===e[n]}))&&i.push(c)}if(o.props.rules&&o.props.rules.length){var u=o.getNamePath();if(!r||A(i,u)){var l=o.validateRules(Object(s.a)({validateMessages:Object(s.a)(Object(s.a)({},B),n.validateMessages)},t));a.push(l.then((function(){return{name:u,errors:[]}})).catch((function(e){return Promise.reject({name:u,errors:e})})))}}}));var o=function(e){var t=!1,n=e.length,r=[];return e.length?new Promise((function(i,a){e.forEach((function(e,o){e.catch((function(e){return t=!0,e})).then((function(e){n-=1,r[o]=e,n>0||(t&&a(r),i(r))}))}))})):Promise.resolve([])}(a);n.lastValidatePromise=o,o.catch((function(e){return e})).then((function(e){var t=e.map((function(e){return e.name}));n.notifyObservers(n.store,t,{type:"validateFinish"}),n.triggerOnFieldsChange(t,e)}));var c=o.then((function(){return n.lastValidatePromise===o?Promise.resolve(n.getFieldsValue(i)):Promise.reject([])})).catch((function(e){var t=e.filter((function(e){return e&&e.errors.length}));return Promise.reject({values:n.getFieldsValue(i),errorFields:t,outOfDate:n.lastValidatePromise!==o})}));return c.catch((function(e){return e})),c},this.submit=function(){n.warningUnhooked(),n.validateFields().then((function(e){var t=n.callbacks.onFinish;if(t)try{t(e)}catch(r){console.error(r)}})).catch((function(e){var t=n.callbacks.onFinishFailed;t&&t(e)}))},this.forceRootUpdate=t};var ne=function(e){var t=r.useRef(),n=r.useState({}),i=Object(J.a)(n,2)[1];if(!t.current)if(e)t.current=e;else{var a=new te((function(){i({})}));t.current=a.getForm()}return[t.current]},re=r.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),ie=function(e){var t=e.validateMessages,n=e.onFormChange,i=e.onFormFinish,a=e.children,c=r.useContext(re),u=r.useRef({});return r.createElement(re.Provider,{value:Object(s.a)(Object(s.a)({},c),{},{validateMessages:Object(s.a)(Object(s.a)({},c.validateMessages),t),triggerFormChange:function(e,t){n&&n(e,{changedFields:t,forms:u.current}),c.triggerFormChange(e,t)},triggerFormFinish:function(e,t){i&&i(e,{values:t,forms:u.current}),c.triggerFormFinish(e,t)},registerForm:function(e,t){e&&(u.current=Object(s.a)(Object(s.a)({},u.current),{},Object(o.a)({},e,t))),c.registerForm(e,t)},unregisterForm:function(e){var t=Object(s.a)({},u.current);delete t[e],u.current=t,c.unregisterForm(e)}})},a)},ae=re,oe=function(e,t){var n=e.name,o=e.initialValues,u=e.fields,l=e.form,f=e.preserve,h=e.children,d=e.component,p=void 0===d?"form":d,m=e.validateMessages,g=e.validateTrigger,b=void 0===g?"onChange":g,y=e.onValuesChange,w=e.onFieldsChange,M=e.onFinish,O=e.onFinishFailed,k=Object(a.a)(e,["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"]),E=r.useContext(ae),_=ne(l),S=Object(J.a)(_,1)[0],C=S.getInternalHooks(v.a),j=C.useSubscribe,T=C.setInitialValues,A=C.setCallbacks,P=C.setValidateMessages,N=C.setPreserve;r.useImperativeHandle(t,(function(){return S})),r.useEffect((function(){return E.registerForm(n,S),function(){E.unregisterForm(n)}}),[E,S,n]),P(Object(s.a)(Object(s.a)({},E.validateMessages),m)),A({onValuesChange:y,onFieldsChange:function(e){if(E.triggerFormChange(n,e),w){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;is[e]||console.log.apply(console,t)}function l(){for(var e=[],t=0;t>4]+c[15&r])}return t.join("")}}),f={16:10,24:12,32:14},h=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],p=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],m=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],v=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],g=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],b=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],y=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],w=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],x=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],M=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],O=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],k=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],E=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],_=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function S(e){for(var t=[],n=0;n>2,this._Ke[n][t%4]=a[t],this._Kd[e-n][t%4]=a[t];for(var o,s=0,c=i;c>16&255]<<24^d[o>>8&255]<<16^d[255&o]<<8^d[o>>24&255]^h[s]<<24,s+=1,8!=i)for(t=1;t>8&255]<<8^d[o>>16&255]<<16^d[o>>24&255]<<24,t=i/2+1;t>2,l=c%4,this._Ke[u][l]=a[t],this._Kd[e-u][l]=a[t++],c++}for(var u=1;u>24&255]^k[o>>16&255]^E[o>>8&255]^_[255&o]},C.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,n=[0,0,0,0],r=S(e),i=0;i<4;i++)r[i]^=this._Ke[0][i];for(var a=1;a>24&255]^v[r[(i+1)%4]>>16&255]^g[r[(i+2)%4]>>8&255]^b[255&r[(i+3)%4]]^this._Ke[a][i];r=n.slice()}var s,c=o(16);for(i=0;i<4;i++)s=this._Ke[t][i],c[4*i]=255&(d[r[i]>>24&255]^s>>24),c[4*i+1]=255&(d[r[(i+1)%4]>>16&255]^s>>16),c[4*i+2]=255&(d[r[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(d[255&r[(i+3)%4]]^s);return c},C.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,n=[0,0,0,0],r=S(e),i=0;i<4;i++)r[i]^=this._Kd[0][i];for(var a=1;a>24&255]^w[r[(i+3)%4]>>16&255]^x[r[(i+2)%4]>>8&255]^M[255&r[(i+1)%4]]^this._Kd[a][i];r=n.slice()}var s,c=o(16);for(i=0;i<4;i++)s=this._Kd[t][i],c[4*i]=255&(p[r[i]>>24&255]^s>>24),c[4*i+1]=255&(p[r[(i+3)%4]>>16&255]^s>>16),c[4*i+2]=255&(p[r[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(p[255&r[(i+1)%4]]^s);return c};var j=function e(t){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new C(t)};j.prototype.encrypt=function(e){if((e=a(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=o(e.length),n=o(16),r=0;r>=8},N.prototype.setBytes=function(e){if(16!=(e=a(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},N.prototype.increment=function(){for(var e=15;0<=e;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var R=function e(t,n){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",n instanceof N||(n=new N(n)),this._counter=n,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new C(t)};R.prototype.encrypt=function(e){for(var t=a(e,!0),n=0;n>>26-s&67108863,26<=(s+=24)&&(s-=26,i++);else if("le"===n)for(i=o=0;o>>26-s&67108863,26<=(s+=24)&&(s-=26,i++);return this.strip()},a.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n,r=0;r>>26-i&4194303,26<=(i+=24)&&(i-=26,a++);r+6!==t&&(n=s(e,t,r+6),this.words[a]|=n<>>26-i&4194303),this.strip()},a.prototype._parseBase=function(e,t,n){this.words=[0];for(var r=0,i=this.length=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var a=e.length-n,o=a%r,s=Math.min(a,a-o)+n,u=0,l=n;l"};var u=["","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"],l=[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],f=[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];function h(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0,i=(r=(n.length=r)-1|0,67108863&(f=(0|e.words[0])*(0|t.words[0]))),a=f/67108864|0;n.words[0]=i;for(var o=1;o>>26,c=67108863&a,u=Math.min(o,t.length-1),l=Math.max(0,o-e.length+1);l<=u;l++){var f,h=o-l|0;s+=(f=(0|e.words[h])*(0|t.words[l])+c)/67108864|0,c=67108863&f}n.words[o]=0|c,a=0|s}return 0!==a?n.words[o]=0|a:n.length--,n.strip()}a.prototype.toString=function(e,t){if(t=0|t||1,16===(e=e||10)||"hex"===e){c="";for(var n=0,i=0,a=0;a>>24-n&16777215)||a!==this.length-1?u[6-s.length]+s+c:s+c;26<=(n+=2)&&(n-=26,a--)}for(0!==i&&(c=i.toString(16)+c);c.length%t!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(e===(0|e)&&2<=e&&e<=36){var h=l[e],d=f[e];for(c="",(p=this.clone()).negative=0;!p.isZero();){var p,m=p.modn(d).toString(e);c=(p=p.idivn(d)).isZero()?m+c:u[h-m.length]+m+c}for(this.isZero()&&(c="0"+c);c.length%t!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}r(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:2>>=13),64<=t&&(n+=7,t>>>=7),8<=t&&(n+=4,t>>>=4),2<=t&&(n+=2,t>>>=2),n+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){for(var t=this.length>e.length?e:this,n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){for(var t,n=this.length>e.length?(t=this,e):(t=e,this),r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){r("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),0>26-n),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){r("number"==typeof e&&0<=e);var n=e/26|0,i=e%26;return this._expand(1+n),this.words[n]=t?this.words[n]|1<e.length?(n=this,e):(n=e,this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;r=0>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,h=0|o[1],d=8191&h,p=h>>>13,m=0|o[2],v=8191&m,g=m>>>13,b=0|o[3],y=8191&b,w=b>>>13,x=0|o[4],M=8191&x,O=x>>>13,k=0|o[5],E=8191&k,_=k>>>13,S=0|o[6],C=8191&S,j=S>>>13,T=0|o[7],A=8191&T,P=T>>>13,N=0|o[8],R=8191&N,z=N>>>13,L=0|o[9],I=8191&L,D=L>>>13,B=0|s[0],H=8191&B,F=B>>>13,V=0|s[1],U=8191&V,W=V>>>13,q=0|s[2],G=8191&q,K=q>>>13,Y=0|s[3],X=8191&Y,Z=Y>>>13,J=0|s[4],Q=8191&J,$=J>>>13,ee=0|s[5],te=8191&ee,ne=ee>>>13,re=0|s[6],ie=8191&re,ae=re>>>13,oe=0|s[7],se=8191&oe,ce=oe>>>13,ue=0|s[8],le=8191&ue,fe=ue>>>13,he=0|s[9],de=8191&he,pe=he>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(0+Math.imul(l,H)|0)+((8191&(i=Math.imul(l,F)+Math.imul(f,H)|0))<<13)|0,ve=(Math.imul(f,F)+(i>>>13)|0)+(me>>>26)|0;me&=67108863,r=Math.imul(d,H),i=Math.imul(d,F)+Math.imul(p,H)|0,a=Math.imul(p,F);var ge=(ve+(r+Math.imul(l,U)|0)|0)+((8191&(i=(i+Math.imul(l,W)|0)+Math.imul(f,U)|0))<<13)|0;ve=((a+Math.imul(f,W)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(v,H),i=Math.imul(v,F)+Math.imul(g,H)|0,a=Math.imul(g,F),r=r+Math.imul(d,U)|0,i=(i+Math.imul(d,W)|0)+Math.imul(p,U)|0,a=a+Math.imul(p,W)|0;var be=(ve+(r+Math.imul(l,G)|0)|0)+((8191&(i=(i+Math.imul(l,K)|0)+Math.imul(f,G)|0))<<13)|0;ve=((a+Math.imul(f,K)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(y,H),i=Math.imul(y,F)+Math.imul(w,H)|0,a=Math.imul(w,F),r=r+Math.imul(v,U)|0,i=(i+Math.imul(v,W)|0)+Math.imul(g,U)|0,a=a+Math.imul(g,W)|0,r=r+Math.imul(d,G)|0,i=(i+Math.imul(d,K)|0)+Math.imul(p,G)|0,a=a+Math.imul(p,K)|0;var ye=(ve+(r+Math.imul(l,X)|0)|0)+((8191&(i=(i+Math.imul(l,Z)|0)+Math.imul(f,X)|0))<<13)|0;ve=((a+Math.imul(f,Z)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(M,H),i=Math.imul(M,F)+Math.imul(O,H)|0,a=Math.imul(O,F),r=r+Math.imul(y,U)|0,i=(i+Math.imul(y,W)|0)+Math.imul(w,U)|0,a=a+Math.imul(w,W)|0,r=r+Math.imul(v,G)|0,i=(i+Math.imul(v,K)|0)+Math.imul(g,G)|0,a=a+Math.imul(g,K)|0,r=r+Math.imul(d,X)|0,i=(i+Math.imul(d,Z)|0)+Math.imul(p,X)|0,a=a+Math.imul(p,Z)|0;var we=(ve+(r+Math.imul(l,Q)|0)|0)+((8191&(i=(i+Math.imul(l,$)|0)+Math.imul(f,Q)|0))<<13)|0;ve=((a+Math.imul(f,$)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(E,H),i=Math.imul(E,F)+Math.imul(_,H)|0,a=Math.imul(_,F),r=r+Math.imul(M,U)|0,i=(i+Math.imul(M,W)|0)+Math.imul(O,U)|0,a=a+Math.imul(O,W)|0,r=r+Math.imul(y,G)|0,i=(i+Math.imul(y,K)|0)+Math.imul(w,G)|0,a=a+Math.imul(w,K)|0,r=r+Math.imul(v,X)|0,i=(i+Math.imul(v,Z)|0)+Math.imul(g,X)|0,a=a+Math.imul(g,Z)|0,r=r+Math.imul(d,Q)|0,i=(i+Math.imul(d,$)|0)+Math.imul(p,Q)|0,a=a+Math.imul(p,$)|0;var xe=(ve+(r+Math.imul(l,te)|0)|0)+((8191&(i=(i+Math.imul(l,ne)|0)+Math.imul(f,te)|0))<<13)|0;ve=((a+Math.imul(f,ne)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(C,H),i=Math.imul(C,F)+Math.imul(j,H)|0,a=Math.imul(j,F),r=r+Math.imul(E,U)|0,i=(i+Math.imul(E,W)|0)+Math.imul(_,U)|0,a=a+Math.imul(_,W)|0,r=r+Math.imul(M,G)|0,i=(i+Math.imul(M,K)|0)+Math.imul(O,G)|0,a=a+Math.imul(O,K)|0,r=r+Math.imul(y,X)|0,i=(i+Math.imul(y,Z)|0)+Math.imul(w,X)|0,a=a+Math.imul(w,Z)|0,r=r+Math.imul(v,Q)|0,i=(i+Math.imul(v,$)|0)+Math.imul(g,Q)|0,a=a+Math.imul(g,$)|0,r=r+Math.imul(d,te)|0,i=(i+Math.imul(d,ne)|0)+Math.imul(p,te)|0,a=a+Math.imul(p,ne)|0;var Me=(ve+(r+Math.imul(l,ie)|0)|0)+((8191&(i=(i+Math.imul(l,ae)|0)+Math.imul(f,ie)|0))<<13)|0;ve=((a+Math.imul(f,ae)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(A,H),i=Math.imul(A,F)+Math.imul(P,H)|0,a=Math.imul(P,F),r=r+Math.imul(C,U)|0,i=(i+Math.imul(C,W)|0)+Math.imul(j,U)|0,a=a+Math.imul(j,W)|0,r=r+Math.imul(E,G)|0,i=(i+Math.imul(E,K)|0)+Math.imul(_,G)|0,a=a+Math.imul(_,K)|0,r=r+Math.imul(M,X)|0,i=(i+Math.imul(M,Z)|0)+Math.imul(O,X)|0,a=a+Math.imul(O,Z)|0,r=r+Math.imul(y,Q)|0,i=(i+Math.imul(y,$)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,$)|0,r=r+Math.imul(v,te)|0,i=(i+Math.imul(v,ne)|0)+Math.imul(g,te)|0,a=a+Math.imul(g,ne)|0,r=r+Math.imul(d,ie)|0,i=(i+Math.imul(d,ae)|0)+Math.imul(p,ie)|0,a=a+Math.imul(p,ae)|0;var Oe=(ve+(r+Math.imul(l,se)|0)|0)+((8191&(i=(i+Math.imul(l,ce)|0)+Math.imul(f,se)|0))<<13)|0;ve=((a+Math.imul(f,ce)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(R,H),i=Math.imul(R,F)+Math.imul(z,H)|0,a=Math.imul(z,F),r=r+Math.imul(A,U)|0,i=(i+Math.imul(A,W)|0)+Math.imul(P,U)|0,a=a+Math.imul(P,W)|0,r=r+Math.imul(C,G)|0,i=(i+Math.imul(C,K)|0)+Math.imul(j,G)|0,a=a+Math.imul(j,K)|0,r=r+Math.imul(E,X)|0,i=(i+Math.imul(E,Z)|0)+Math.imul(_,X)|0,a=a+Math.imul(_,Z)|0,r=r+Math.imul(M,Q)|0,i=(i+Math.imul(M,$)|0)+Math.imul(O,Q)|0,a=a+Math.imul(O,$)|0,r=r+Math.imul(y,te)|0,i=(i+Math.imul(y,ne)|0)+Math.imul(w,te)|0,a=a+Math.imul(w,ne)|0,r=r+Math.imul(v,ie)|0,i=(i+Math.imul(v,ae)|0)+Math.imul(g,ie)|0,a=a+Math.imul(g,ae)|0,r=r+Math.imul(d,se)|0,i=(i+Math.imul(d,ce)|0)+Math.imul(p,se)|0,a=a+Math.imul(p,ce)|0;var ke=(ve+(r+Math.imul(l,le)|0)|0)+((8191&(i=(i+Math.imul(l,fe)|0)+Math.imul(f,le)|0))<<13)|0;ve=((a+Math.imul(f,fe)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(I,H),i=Math.imul(I,F)+Math.imul(D,H)|0,a=Math.imul(D,F),r=r+Math.imul(R,U)|0,i=(i+Math.imul(R,W)|0)+Math.imul(z,U)|0,a=a+Math.imul(z,W)|0,r=r+Math.imul(A,G)|0,i=(i+Math.imul(A,K)|0)+Math.imul(P,G)|0,a=a+Math.imul(P,K)|0,r=r+Math.imul(C,X)|0,i=(i+Math.imul(C,Z)|0)+Math.imul(j,X)|0,a=a+Math.imul(j,Z)|0,r=r+Math.imul(E,Q)|0,i=(i+Math.imul(E,$)|0)+Math.imul(_,Q)|0,a=a+Math.imul(_,$)|0,r=r+Math.imul(M,te)|0,i=(i+Math.imul(M,ne)|0)+Math.imul(O,te)|0,a=a+Math.imul(O,ne)|0,r=r+Math.imul(y,ie)|0,i=(i+Math.imul(y,ae)|0)+Math.imul(w,ie)|0,a=a+Math.imul(w,ae)|0,r=r+Math.imul(v,se)|0,i=(i+Math.imul(v,ce)|0)+Math.imul(g,se)|0,a=a+Math.imul(g,ce)|0,r=r+Math.imul(d,le)|0,i=(i+Math.imul(d,fe)|0)+Math.imul(p,le)|0,a=a+Math.imul(p,fe)|0;var Ee=(ve+(r+Math.imul(l,de)|0)|0)+((8191&(i=(i+Math.imul(l,pe)|0)+Math.imul(f,de)|0))<<13)|0;ve=((a+Math.imul(f,pe)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(I,U),i=Math.imul(I,W)+Math.imul(D,U)|0,a=Math.imul(D,W),r=r+Math.imul(R,G)|0,i=(i+Math.imul(R,K)|0)+Math.imul(z,G)|0,a=a+Math.imul(z,K)|0,r=r+Math.imul(A,X)|0,i=(i+Math.imul(A,Z)|0)+Math.imul(P,X)|0,a=a+Math.imul(P,Z)|0,r=r+Math.imul(C,Q)|0,i=(i+Math.imul(C,$)|0)+Math.imul(j,Q)|0,a=a+Math.imul(j,$)|0,r=r+Math.imul(E,te)|0,i=(i+Math.imul(E,ne)|0)+Math.imul(_,te)|0,a=a+Math.imul(_,ne)|0,r=r+Math.imul(M,ie)|0,i=(i+Math.imul(M,ae)|0)+Math.imul(O,ie)|0,a=a+Math.imul(O,ae)|0,r=r+Math.imul(y,se)|0,i=(i+Math.imul(y,ce)|0)+Math.imul(w,se)|0,a=a+Math.imul(w,ce)|0,r=r+Math.imul(v,le)|0,i=(i+Math.imul(v,fe)|0)+Math.imul(g,le)|0,a=a+Math.imul(g,fe)|0;var _e=(ve+(r+Math.imul(d,de)|0)|0)+((8191&(i=(i+Math.imul(d,pe)|0)+Math.imul(p,de)|0))<<13)|0;ve=((a+Math.imul(p,pe)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(I,G),i=Math.imul(I,K)+Math.imul(D,G)|0,a=Math.imul(D,K),r=r+Math.imul(R,X)|0,i=(i+Math.imul(R,Z)|0)+Math.imul(z,X)|0,a=a+Math.imul(z,Z)|0,r=r+Math.imul(A,Q)|0,i=(i+Math.imul(A,$)|0)+Math.imul(P,Q)|0,a=a+Math.imul(P,$)|0,r=r+Math.imul(C,te)|0,i=(i+Math.imul(C,ne)|0)+Math.imul(j,te)|0,a=a+Math.imul(j,ne)|0,r=r+Math.imul(E,ie)|0,i=(i+Math.imul(E,ae)|0)+Math.imul(_,ie)|0,a=a+Math.imul(_,ae)|0,r=r+Math.imul(M,se)|0,i=(i+Math.imul(M,ce)|0)+Math.imul(O,se)|0,a=a+Math.imul(O,ce)|0,r=r+Math.imul(y,le)|0,i=(i+Math.imul(y,fe)|0)+Math.imul(w,le)|0,a=a+Math.imul(w,fe)|0;var Se=(ve+(r+Math.imul(v,de)|0)|0)+((8191&(i=(i+Math.imul(v,pe)|0)+Math.imul(g,de)|0))<<13)|0;ve=((a+Math.imul(g,pe)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(I,X),i=Math.imul(I,Z)+Math.imul(D,X)|0,a=Math.imul(D,Z),r=r+Math.imul(R,Q)|0,i=(i+Math.imul(R,$)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,$)|0,r=r+Math.imul(A,te)|0,i=(i+Math.imul(A,ne)|0)+Math.imul(P,te)|0,a=a+Math.imul(P,ne)|0,r=r+Math.imul(C,ie)|0,i=(i+Math.imul(C,ae)|0)+Math.imul(j,ie)|0,a=a+Math.imul(j,ae)|0,r=r+Math.imul(E,se)|0,i=(i+Math.imul(E,ce)|0)+Math.imul(_,se)|0,a=a+Math.imul(_,ce)|0,r=r+Math.imul(M,le)|0,i=(i+Math.imul(M,fe)|0)+Math.imul(O,le)|0,a=a+Math.imul(O,fe)|0;var Ce=(ve+(r+Math.imul(y,de)|0)|0)+((8191&(i=(i+Math.imul(y,pe)|0)+Math.imul(w,de)|0))<<13)|0;ve=((a+Math.imul(w,pe)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(I,Q),i=Math.imul(I,$)+Math.imul(D,Q)|0,a=Math.imul(D,$),r=r+Math.imul(R,te)|0,i=(i+Math.imul(R,ne)|0)+Math.imul(z,te)|0,a=a+Math.imul(z,ne)|0,r=r+Math.imul(A,ie)|0,i=(i+Math.imul(A,ae)|0)+Math.imul(P,ie)|0,a=a+Math.imul(P,ae)|0,r=r+Math.imul(C,se)|0,i=(i+Math.imul(C,ce)|0)+Math.imul(j,se)|0,a=a+Math.imul(j,ce)|0,r=r+Math.imul(E,le)|0,i=(i+Math.imul(E,fe)|0)+Math.imul(_,le)|0,a=a+Math.imul(_,fe)|0;var je=(ve+(r+Math.imul(M,de)|0)|0)+((8191&(i=(i+Math.imul(M,pe)|0)+Math.imul(O,de)|0))<<13)|0;ve=((a+Math.imul(O,pe)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(I,te),i=Math.imul(I,ne)+Math.imul(D,te)|0,a=Math.imul(D,ne),r=r+Math.imul(R,ie)|0,i=(i+Math.imul(R,ae)|0)+Math.imul(z,ie)|0,a=a+Math.imul(z,ae)|0,r=r+Math.imul(A,se)|0,i=(i+Math.imul(A,ce)|0)+Math.imul(P,se)|0,a=a+Math.imul(P,ce)|0,r=r+Math.imul(C,le)|0,i=(i+Math.imul(C,fe)|0)+Math.imul(j,le)|0,a=a+Math.imul(j,fe)|0;var Te=(ve+(r+Math.imul(E,de)|0)|0)+((8191&(i=(i+Math.imul(E,pe)|0)+Math.imul(_,de)|0))<<13)|0;ve=((a+Math.imul(_,pe)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(I,ie),i=Math.imul(I,ae)+Math.imul(D,ie)|0,a=Math.imul(D,ae),r=r+Math.imul(R,se)|0,i=(i+Math.imul(R,ce)|0)+Math.imul(z,se)|0,a=a+Math.imul(z,ce)|0,r=r+Math.imul(A,le)|0,i=(i+Math.imul(A,fe)|0)+Math.imul(P,le)|0,a=a+Math.imul(P,fe)|0;var Ae=(ve+(r+Math.imul(C,de)|0)|0)+((8191&(i=(i+Math.imul(C,pe)|0)+Math.imul(j,de)|0))<<13)|0;ve=((a+Math.imul(j,pe)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(I,se),i=Math.imul(I,ce)+Math.imul(D,se)|0,a=Math.imul(D,ce),r=r+Math.imul(R,le)|0,i=(i+Math.imul(R,fe)|0)+Math.imul(z,le)|0,a=a+Math.imul(z,fe)|0;var Pe=(ve+(r+Math.imul(A,de)|0)|0)+((8191&(i=(i+Math.imul(A,pe)|0)+Math.imul(P,de)|0))<<13)|0;ve=((a+Math.imul(P,pe)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(I,le),i=Math.imul(I,fe)+Math.imul(D,le)|0,a=Math.imul(D,fe);var Ne=(ve+(r+Math.imul(R,de)|0)|0)+((8191&(i=(i+Math.imul(R,pe)|0)+Math.imul(z,de)|0))<<13)|0;ve=((a+Math.imul(z,pe)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Re=(ve+Math.imul(I,de)|0)+((8191&(i=Math.imul(I,pe)+Math.imul(D,de)|0))<<13)|0;return ve=(Math.imul(D,pe)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,c[0]=me,c[1]=ge,c[2]=be,c[3]=ye,c[4]=we,c[5]=xe,c[6]=Me,c[7]=Oe,c[8]=ke,c[9]=Ee,c[10]=_e,c[11]=Se,c[12]=Ce,c[13]=je,c[14]=Te,c[15]=Ae,c[16]=Pe,c[17]=Ne,c[18]=Re,0!=ve&&(c[19]=ve,n.length++),n};function p(e,t,n){return(new m).mulp(e,t,n)}function m(e,t){this.x=e,this.y=t}Math.imul||(d=h),a.prototype.mulTo=function(e,t){var n=this.length+e.length;return(10===this.length&&10===e.length?d:n<63?h:n<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}n.words[a]=s,r=o,o=i}return 0!==r?n.words[a]=r:n.length--,n.strip()}:p)(this,e,t)},m.prototype.makeRBT=function(e){for(var t=new Array(e),n=a.prototype._countBits(e)-1,r=0;r>=1;return r},m.prototype.permute=function(e,t,n,r,i,a){for(var o=0;o>>=1)r++;return 1<>>=13,n[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=a>>>26,this.words[n]=67108863&a}return 0!==t&&(this.words[n]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i}return t}(e);if(0===t.length)return new a(1);for(var n=this,r=0;r>>26-t<<26-t;if(0!=t){for(var a=0,o=0;o>>26-t}a&&(this.words[o]=a,this.length++)}if(0!=n){for(o=this.length-1;0<=o;o--)this.words[o+n]=this.words[o];for(o=0;o>>a<o)for(this.length-=o,u=0;u>>a,l=f&s}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){r("number"==typeof e&&0<=e);var t=e%26,n=(e-t)/26,i=1<>>n<>26)-(c/67108864|0),this.words[s+n]=67108863&i}for(;s>26,this.words[s+n]=67108863&i;if(0===o)return this.strip();for(r(-1===o),s=o=0;s>26,this.words[s]=67108863&i;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,o=0|i.words[i.length-1];0!=(n=26-this._countBits(o))&&(i=i.ushln(n),r.iushln(n),o=0|i.words[i.length-1]);var s,c=r.length-i.length;if("mod"!==t){(s=new a(null)).length=1+c,s.words=new Array(s.length);for(var u=0;uthis.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),a=n.cmp(r);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;0<=i;i--)n=(t*n+(0|this.words[i]))%e;return n},a.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;0<=n;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());for(var t=this,n=e.clone(),i=(t=0!==t.negative?t.umod(e):t.clone(),new a(1)),o=new a(0),s=new a(0),c=new a(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;0==(t.words[0]&d)&&h<26;++h,d<<=1);if(0>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,n,i=e<0;return 0===this.negative||i?0===this.negative&&i?1:(this.strip(),n=1e.length)return 1;if(this.lengththis.n;);var r=t>>22,i=a}i>>>=22,0===(e.words[r-10]=i)&&10>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new y;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return v[e]=t},M.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return 0<=n.cmp(this.m)&&n.isub(this.m),n._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return 0<=n.cmp(this.m)&&n.isub(this.m),n},M.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new a(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);r(!i.isZero());for(var s=new a(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),l=new a(2*(l=this.m.bitLength())*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var f=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=o;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr();r(v>l&1;i!==n[0]&&(i=this.sqr(i)),0!=f||0!==o?(o<<=1,o|=f,(4===++s||0===r&&0===l)&&(i=this.mul(i,n[o]),o=s=0)):s=0}c=26}return i},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new O(e)},i(O,M),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},O.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return 0<=i.cmp(this.m)?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return 0<=i.cmp(this.m)?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)},{buffer:11}],10:[function(e,n,r){(function(e){n.exports=function(t){var n=new Uint8Array(t);return(e.crypto||e.msCrypto).getRandomValues(n),n}}).call(this,"undefined"!=typeof t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(e,t,n){},{}],12:[function(e,t,n){"use strict";var r=n;r.version=e("../package.json").version,r.utils=e("./elliptic/utils"),r.rand=e("brorand"),r.curve=e("./elliptic/curve"),r.curves=e("./elliptic/curves"),r.ec=e("./elliptic/ec"),r.eddsa=e("./elliptic/eddsa")},{"../package.json":25,"./elliptic/curve":15,"./elliptic/curves":18,"./elliptic/ec":19,"./elliptic/eddsa":22,"./elliptic/utils":24,brorand:10}],13:[function(e,t,n){"use strict";var r=e("bn.js"),i=e("../utils"),a=i.getNAF,o=i.getJSF,s=i.assert;function c(e,t){this.type=e,this.p=new r(t.p,16),this.red=t.prime?r.red(t.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=t.n&&new r(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||0>1]):c.mixedAdd(i[-l-1>>1].neg()):0>1]):c.add(i[-l-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,n,r,i){for(var s=this._wnafT1,c=this._wnafT2,u=this._wnafT3,l=0,f=0;f>1]:_<0&&(E=c[b][-_-1>>1].neg()),x="affine"===E.type?x.mixedAdd(E):x.add(E))}}for(f=0;f=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i":""},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},u.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),a=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},u.prototype.jmulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},u.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},u.prototype.neg=function(e){if(this.inf)return this;var t,n,r=this.curve.point(this.x,this.y.redNeg());return e&&this.precomputed&&(t=this.precomputed,n=function(e){return e.neg()},r.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}),r},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(l,o.BasePoint),c.prototype.jpoint=function(e,t,n){return new l(this,e,t,n)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),i=e.x.redMul(n),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(n.redMul(this.z)),s=r.redSub(i),c=a.redSub(o);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),l=u.redMul(s),f=r.redMul(u),h=c.redSqr().redIAdd(l).redISub(f).redISub(f),d=c.redMul(f.redISub(h)).redISub(a.redMul(l)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,d,p)},l.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),i=this.y,a=e.y.redMul(t).redMul(this.z),o=n.redSub(r),s=i.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),l=n.redMul(c),f=s.redSqr().redIAdd(u).redISub(l).redISub(l),h=s.redMul(l.redISub(f)).redISub(i.redMul(u)),d=this.z.redMul(o);return this.curve.jpoint(f,h,d)},l.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,n=0;n":""},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":24,"./base":13,"bn.js":9,inherits:39}],18:[function(e,t,n){"use strict";var r,i=n,a=e("hash.js"),o=e("./curve"),s=e("./utils").assert;function c(e){"short"===e.type?this.curve=new o.short(e):"edwards"===e.type?this.curve=new o.edwards(e):this.curve=new o.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var n=new c(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:n}),n}})}i.PresetCurve=c,u("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:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("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:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("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:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("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:a.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"]}),u("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:a.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"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("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:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=e("./precomputed/secp256k1")}catch(e){r=void 0}u("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:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},{"./curve":15,"./precomputed/secp256k1":23,"./utils":24,"hash.js":26}],19:[function(e,t,n){"use strict";var r=e("bn.js"),i=e("hmac-drbg"),a=e("../utils"),o=e("../curves"),s=e("brorand"),c=a.assert,u=e("./key"),l=e("./signature");function f(e){if(!(this instanceof f))return new f(e);"string"==typeof e&&(c(o.hasOwnProperty(e),"Unknown curve "+e),e=o[e]),e instanceof o.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}(t.exports=f).prototype.keyPair=function(e){return new u(this,e)},f.prototype.keyFromPrivate=function(e,t){return u.fromPrivate(this,e,t)},f.prototype.keyFromPublic=function(e,t){return u.fromPublic(this,e,t)},f.prototype.genKeyPair=function(e){e=e||{};for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||s(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),a=this.n.sub(new r(2));;){var o=new r(t.generate(n));if(!(0>1;if(0<=s.cmp(this.curve.p.umod(this.curve.n))&&h)throw new Error("Unable to find sencond key candinate");s=h?this.curve.pointFromX(s.add(this.curve.n),f):this.curve.pointFromX(s,f);var d=t.r.invm(a),p=a.sub(o).mul(d).umod(a),m=u.mul(d).umod(a);return this.g.mulAdd(p,s,m)},f.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new l(t,r)).recoveryParam)return t.recoveryParam;for(var i,a=0;a<4;a++){try{i=this.recoverPubKey(e,t,a)}catch(e){continue}if(i.eq(n))return a}throw new Error("Unable to find valid recovery factor")}},{"../curves":18,"../utils":24,"./key":20,"./signature":21,"bn.js":9,brorand:10,"hmac-drbg":38}],20:[function(e,t,n){"use strict";var r=e("bn.js"),i=e("../utils").assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=a).fromPublic=function(e,t,n){return t instanceof a?t:new a(e,{pub:t,pubEnc:n})},a.fromPrivate=function(e,t,n){return t instanceof a?t:new a(e,{priv:t,privEnc:n})},a.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.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"}},a.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new r(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.mul(this.priv).getX()},a.prototype.sign=function(e,t,n){return this.ec.sign(e,this,t,n)},a.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},a.prototype.inspect=function(){return""}},{"../utils":24,"bn.js":9}],21:[function(e,t,n){"use strict";var r=e("bn.js"),i=e("../utils"),a=i.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(a(e.r&&e.s,"Signature without r or s"),this.r=new r(e.r,16),this.s=new r(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function c(e,t){var n=e[t.place++];if(!(128&n))return n;var r=15&n;if(0==r||4>>=0;return!(i<=127)&&(t.place=o,i)}function u(e){for(var t=0,n=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}(t.exports=o).prototype._importDER=function(e,t){e=i.toArray(e,t);var n=new s;if(48!==e[n.place++])return!1;var a=c(e,n);if(!1===a)return!1;if(a+n.place!==e.length)return!1;if(2!==e[n.place++])return!1;var o=c(e,n);if(!1===o)return!1;var u=e.slice(n.place,o+n.place);if(n.place+=o,2!==e[n.place++])return!1;var l=c(e,n);if(!1===l)return!1;if(e.length!==l+n.place)return!1;var f=e.slice(n.place,l+n.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new r(u),this.s=new r(f),!(this.recoveryParam=null)},o.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=u(t),n=u(n);!(n[0]||128&n[1]);)n=n.slice(1);var r=[2];l(r,t.length),(r=r.concat(t)).push(2),l(r,n.length);var a=r.concat(n),o=[48];return l(o,a.length),o=o.concat(a),i.encode(o,e)}},{"../utils":24,"bn.js":9}],22:[function(e,t,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],23:[function(e,t,n){t.exports=void 0},{}],24:[function(e,t,n){"use strict";var r=n,i=e("bn.js"),a=e("minimalistic-assert"),o=e("minimalistic-crypto-utils");r.assert=a,r.toArray=o.toArray,r.zero2=o.zero2,r.toHex=o.toHex,r.encode=o.encode,r.getNAF=function(e,t,n){var r=new Array(Math.max(e.bitLength(),n)+1);r.fill(0);for(var i=1<>1)-1>1)-c:c,a.isubn(s)):s=0,r[o]=s,a.iushrn(1)}return r},r.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r=0,i=0;0=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,r[i++]=e>>>16&255,r[i++]=e>>>8&255,r[i++]=255&e}else for(r[i++]=255&e,r[i++]=e>>>8&255,r[i++]=e>>>16&255,r[i++]=e>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t>>3},n.g1_256=function(e){return r(e,17)^r(e,19)^e>>>10}},{"../utils":37}],37:[function(e,t,n){"use strict";var r=e("minimalistic-assert"),i=e("inherits");function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function s(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}n.inherits=i,n.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),r=0;r>8,o=255&i;a?n.push(a,o):n.push(o)}else for(r=0;r>>0}return o},n.split32=function(e,t){for(var n=new Array(4*e.length),r=0,i=0;r>>24,n[i+1]=a>>>16&255,n[i+2]=a>>>8&255,n[i+3]=255&a):(n[i+3]=a>>>24,n[i+2]=a>>>16&255,n[i+1]=a>>>8&255,n[i]=255&a)}return n},n.rotr32=function(e,t){return e>>>t|e<<32-t},n.rotl32=function(e,t){return e<>>32-t},n.sum32=function(e,t){return e+t>>>0},n.sum32_3=function(e,t,n){return e+t+n>>>0},n.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},n.sum32_5=function(e,t,n,r,i){return e+t+n+r+i>>>0},n.sum64=function(e,t,n,r){var i=e[t],a=r+e[t+1]>>>0,o=(a>>0,e[t+1]=a},n.sum64_hi=function(e,t,n,r){return(t+r>>>0>>0},n.sum64_lo=function(e,t,n,r){return t+r>>>0},n.sum64_4_hi=function(e,t,n,r,i,a,o,s){var c=0,u=t;return c+=(u=u+r>>>0)>>0)>>0)>>0},n.sum64_4_lo=function(e,t,n,r,i,a,o,s){return t+r+a+s>>>0},n.sum64_5_hi=function(e,t,n,r,i,a,o,s,c,u){var l=0,f=t;return l+=(f=f+r>>>0)>>0)>>0)>>0)>>0},n.sum64_5_lo=function(e,t,n,r,i,a,o,s,c,u){return t+r+a+s+u>>>0},n.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},n.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},n.shr64_hi=function(e,t,n){return e>>>n},n.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},{inherits:39,"minimalistic-assert":41}],38:[function(e,t,n){"use strict";var r=e("hash.js"),i=e("minimalistic-crypto-utils"),a=e("minimalistic-assert");function o(e){if(!(this instanceof o))return new o(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),n=i.toArray(e.nonce,e.nonceEnc||"hex"),r=i.toArray(e.pers,e.persEnc||"hex");a(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}(t.exports=o).prototype._init=function(e,t,n){var r=e.concat(t).concat(n);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(e.concat(n||[])),this._reseed=1},o.prototype.generate=function(e,t,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(r=n,n=t,t=null),n&&(n=i.toArray(n,r||"hex"),this._update(n));for(var a=[];a.length>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}x.prototype.update=function(e){var t="string"!=typeof e;t&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e));for(var n,r,i=e.length,a=this.blocks,s=this.byteCount,c=this.blockCount,u=0,l=this.s;u>2]|=e[u]<>2]|=r<>2]|=(192|r>>6)<>2]|=(224|r>>12)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t>4&15]+a[15&e]+a[e>>12&15]+a[e>>8&15]+a[e>>20&15]+a[e>>16&15]+a[e>>28&15]+a[e>>24&15];s%t==0&&(M(n),o=0)}return i&&(e=n[o],0>4&15]+a[15&e]),1>12&15]+a[e>>8&15]),2>20&15]+a[e>>16&15])),c},x.prototype.buffer=x.prototype.arrayBuffer=function(){this.finalize();for(var e=this.blockCount,t=this.s,n=this.outputBlocks,r=this.extraBytes,i=0,a=0,o=this.outputBits>>3,s=r?new ArrayBuffer(n+1<<2):new ArrayBuffer(o),c=new Uint32Array(s);a>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;s%n==0&&M(r)}return a&&(e=s<<2,t=r[o],0>8&255),2>16&255)),c};var M=function(e){for(var t,n,r,i,a,o,c,u,l,f,h,d,p,m,v,g,b,y,w,x,M,O,k,E,_,S,C,j,T,A,P,N,R,z,L,I,D,B,H,F,V,U,W,q,G,K,Y,X,Z,J,Q,$,ee,te,ne,re,ie,ae,oe,se,ce,ue,le=0;le<48;le+=2)r=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],o=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(h=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|o>>>31),n=(d=e[9]^e[19]^e[29]^e[39]^e[49])^(o<<1|a>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=r^(c<<1|u>>>31),n=i^(u<<1|c>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=a^(l<<1|f>>>31),n=o^(f<<1|l>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=c^(h<<1|d>>>31),n=u^(d<<1|h>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=l^(r<<1|i>>>31),n=f^(i<<1|r>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,p=e[0],m=e[1],G=e[11]<<4|e[10]>>>28,K=e[10]<<4|e[11]>>>28,C=e[20]<<3|e[21]>>>29,j=e[21]<<3|e[20]>>>29,oe=e[31]<<9|e[30]>>>23,se=e[30]<<9|e[31]>>>23,V=e[40]<<18|e[41]>>>14,U=e[41]<<18|e[40]>>>14,R=e[2]<<1|e[3]>>>31,z=e[3]<<1|e[2]>>>31,v=e[13]<<12|e[12]>>>20,g=e[12]<<12|e[13]>>>20,Y=e[22]<<10|e[23]>>>22,X=e[23]<<10|e[22]>>>22,T=e[33]<<13|e[32]>>>19,A=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,ue=e[43]<<2|e[42]>>>30,ee=e[5]<<30|e[4]>>>2,te=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,I=e[15]<<6|e[14]>>>26,b=e[25]<<11|e[24]>>>21,y=e[24]<<11|e[25]>>>21,Z=e[34]<<15|e[35]>>>17,J=e[35]<<15|e[34]>>>17,P=e[45]<<29|e[44]>>>3,N=e[44]<<29|e[45]>>>3,k=e[6]<<28|e[7]>>>4,E=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,re=e[16]<<23|e[17]>>>9,D=e[26]<<25|e[27]>>>7,B=e[27]<<25|e[26]>>>7,w=e[36]<<21|e[37]>>>11,x=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,$=e[46]<<24|e[47]>>>8,W=e[8]<<27|e[9]>>>5,q=e[9]<<27|e[8]>>>5,_=e[18]<<20|e[19]>>>12,S=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,H=e[38]<<8|e[39]>>>24,F=e[39]<<8|e[38]>>>24,M=e[48]<<14|e[49]>>>18,O=e[49]<<14|e[48]>>>18,e[0]=p^~v&b,e[1]=m^~g&y,e[10]=k^~_&C,e[11]=E^~S&j,e[20]=R^~L&D,e[21]=z^~I&B,e[30]=W^~G&Y,e[31]=q^~K&X,e[40]=ee^~ne&ie,e[41]=te^~re&ae,e[2]=v^~b&w,e[3]=g^~y&x,e[12]=_^~C&T,e[13]=S^~j&A,e[22]=L^~D&H,e[23]=I^~B&F,e[32]=G^~Y&Z,e[33]=K^~X&J,e[42]=ne^~ie&oe,e[43]=re^~ae&se,e[4]=b^~w&M,e[5]=y^~x&O,e[14]=C^~T&P,e[15]=j^~A&N,e[24]=D^~H&V,e[25]=B^~F&U,e[34]=Y^~Z&Q,e[35]=X^~J&$,e[44]=ie^~oe&ce,e[45]=ae^~se&ue,e[6]=w^~M&p,e[7]=x^~O&m,e[16]=T^~P&k,e[17]=A^~N&E,e[26]=H^~V&R,e[27]=F^~U&z,e[36]=Z^~Q&W,e[37]=J^~$&q,e[46]=oe^~ce&ee,e[47]=se^~ue&te,e[8]=M^~p&v,e[9]=O^~m&g,e[18]=P^~k&_,e[19]=N^~E&S,e[28]=V^~R&L,e[29]=U^~z&I,e[38]=Q^~W&G,e[39]=$^~q&K,e[48]=ce^~ee&ne,e[49]=ue^~te&re,e[0]^=s[le],e[1]^=s[le+1]};if(i)n.exports=p;else for(v=0;v>8,o=255&i;a?n.push(a,o):n.push(o)}return n},r.zero2=i,r.toHex=a,r.encode=function(e,t){return"hex"===t?a(e):e}},{}],43:[function(e,t,n){t.exports={browser:!0}},{}],44:[function(e,t,n){(function(e){"use strict";function r(e){var t=[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],n=1779033703,r=3144134277,i=1013904242,a=2773480762,o=1359893119,s=2600822924,c=528734635,u=1541459225,l=new Array(64);function f(e){for(var f=0,h=e.length;64<=h;){for(var d,p,m,v,g=n,b=r,y=i,w=a,x=o,M=s,O=c,k=u,E=0;E<16;E++)p=f+4*E,l[E]=(255&e[p])<<24|(255&e[p+1])<<16|(255&e[p+2])<<8|255&e[p+3];for(E=16;E<64;E++)m=((d=l[E-2])>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,v=((d=l[E-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3,l[E]=(m+l[E-7]|0)+(v+l[E-16]|0)|0;for(E=0;E<64;E++)m=(((x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7))+(x&M^~x&O)|0)+(k+(t[E]+l[E]|0)|0)|0,v=((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+(g&b^g&y^b&y)|0,k=O,O=M,M=x,x=w+m|0,w=y,y=b,b=g,g=m+v|0;n=n+g|0,r=r+b|0,i=i+y|0,a=a+w|0,o=o+x|0,s=s+M|0,c=c+O|0,u=u+k|0,f+=64,h-=64}}f(e);var h,d=e.length%64,p=e.length/536870912|0,m=e.length<<3,v=d<56?56:120,g=e.slice(e.length-d,e.length);for(g.push(128),h=1+d;h>>24&255),g.push(p>>>16&255),g.push(p>>>8&255),g.push(p>>>0&255),g.push(m>>>24&255),g.push(m>>>16&255),g.push(m>>>8&255),g.push(m>>>0&255),f(g),[n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255]}function i(e,t,n){e=e.length<=64?e:r(e);for(var i=64+t.length+4,a=new Array(i),o=new Array(64),s=[],c=0;c<64;c++)a[c]=54;for(c=0;c>>32-t}function s(e,t,n,r){for(var i=0;i>0&255),m.push(v[n]>>8&255),m.push(v[n]>>16&255),m.push(v[n]>>24&255);var g=i(t,m,h);return p(null,1,g)}N(e)}()}var h,d;h=this,d=2147483647,void 0!==n?t.exports=f:h&&(h.scrypt&&(h._scrypt=h.scrypt),h.scrypt=f)}).call(this,e("timers").setImmediate)},{timers:46}],45:[function(e,n,r){(function(e,t,n){!function(t,n){"use strict";var r,i,a,o,s,c,u,l,f;function h(e){return i[r]=d.apply(n,e),r++}function d(e){var t=[].slice.call(arguments,1);return function(){"function"==typeof e?e.apply(n,t):new Function(""+e)()}}function p(e){if(a)setTimeout(d(p,e),0);else{var t=i[e];if(t){a=!0;try{t()}finally{m(e),a=!1}}}}function m(e){delete i[e]}function v(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(l)&&p(+e.data.slice(l.length))}t.setImmediate||(r=1,a=!(i={}),o=t.document,f=(f=Object.getPrototypeOf&&Object.getPrototypeOf(t))&&f.setTimeout?f:t,s="[object process]"==={}.toString.call(t.process)?function(){var t=h(arguments);return e.nextTick(d(p,t)),t}:function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?(l="setImmediate$"+Math.random()+"$",t.addEventListener?t.addEventListener("message",v,!1):t.attachEvent("onmessage",v),function(){var e=h(arguments);return t.postMessage(l+e,"*"),e}):t.MessageChannel?((u=new MessageChannel).port1.onmessage=function(e){p(e.data)},function(){var e=h(arguments);return u.port2.postMessage(e),e}):o&&"onreadystatechange"in o.createElement("script")?(c=o.documentElement,function(){var e=h(arguments),t=o.createElement("script");return t.onreadystatechange=function(){p(e),t.onreadystatechange=null,c.removeChild(t),t=null},c.appendChild(t),e}):function(){var e=h(arguments);return setTimeout(d(p,e),0),e},f.setImmediate=s,f.clearImmediate=m)}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,e("_process"),"undefined"!=typeof t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("timers").clearImmediate)},{_process:43,timers:46}],46:[function(e,n,r){(function(e){n.exports={setImmediate:e.setImmediate}}).call(this,"undefined"!=typeof t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],47:[function(e,n,r){(function(e){var t,r,i;e.crypto&&crypto.getRandomValues&&(t=new Uint8Array(16),r=function(){return crypto.getRandomValues(t),t}),r||(i=new Array(16),r=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),i[t]=e>>>((3&t)<<3)&255;return i}),n.exports=r}).call(this,"undefined"!=typeof t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],48:[function(e,t,n){for(var r=e("./rng"),i=[],a={},o=0;o<256;o++)i[o]=(o+256).toString(16).substr(1),a[i[o]]=o;function s(e,t){var n=t||0;return i[e[n++]]+i[e[n++]]+i[e[n++]]+i[e[n++]]+"-"+i[e[n++]]+i[e[n++]]+"-"+i[e[n++]]+i[e[n++]]+"-"+i[e[n++]]+i[e[n++]]+"-"+i[e[n++]]+i[e[n++]]+i[e[n++]]+i[e[n++]]+i[e[n++]]+i[e[n++]]}var c=r(),u=[1|c[0],c[1],c[2],c[3],c[4],c[5]],l=16383&(c[6]<<8|c[7]),f=0,h=0;function d(e,t,n){var i=t&&n||0;"string"==typeof e&&(t="binary"==e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||r)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var o=0;o<16;o++)t[i+o]=a[o];return t||s(a)}var p=d;p.v1=function(e,t,n){var r=t&&n||0,i=t||[],a=void 0!==(e=e||{}).clockseq?e.clockseq:l,o=void 0!==e.msecs?e.msecs:(new Date).getTime(),c=void 0!==e.nsecs?e.nsecs:h+1,d=o-f+(c-h)/1e4;if(d<0&&void 0===e.clockseq&&(a=a+1&16383),(d<0||f>>24&255,i[r++]=p>>>16&255,i[r++]=p>>>8&255,i[r++]=255&p;var m=o/4294967296*1e4&268435455;i[r++]=m>>>8&255,i[r++]=255&m,i[r++]=m>>>24&15|16,i[r++]=m>>>16&255,i[r++]=a>>>8|128,i[r++]=255&a;for(var v=e.node||u,g=0;g<6;g++)i[r+g]=v[g];return t||s(i)},p.v4=d,p.parse=function(e,t,n){var r=t&&n||0,i=0;for(t=t||[],e.toLowerCase().replace(/[0-9a-f]{2}/g,(function(e){i<16&&(t[r+i++]=a[e])}));i<16;)t[r+i++]=0;return t},p.unparse=s,t.exports=p},{"./rng":47}],49:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});try{t.exports.XMLHttpRequest=XMLHttpRequest}catch(e){console.log("Warning: XMLHttpRequest is not defined"),t.exports.XMLHttpRequest=null}},{}],50:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("../utils/properties"),i=(a.isProvider=function(e){return r.isType(e,"Provider")},a);function a(){r.setType(this,"Provider")}n.Provider=i},{"../utils/properties":74}],51:[function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(n,"__esModule",{value:!0});var o=e("../utils/address"),s=e("../utils/bignumber"),c=e("../utils/bytes"),u=e("../constants"),l=e("../utils/hash"),f=e("../utils/networks"),h=e("../utils/properties"),d=e("../utils/rlp"),p=e("../utils/transaction"),m=e("../utils/utf8"),v=e("../utils/web"),g=a(e("../errors")),b=e("./abstract-provider");function y(e,t){var n={};for(var r in e)try{var i=e[r](t[r]);void 0!==i&&(n[r]=i)}catch(e){throw e.checkKey=r,e.checkValue=t[r],e}return n}function w(e,t){return function(n){return null==n?t:e(n)}}function x(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");var n=[];return t.forEach((function(t){n.push(e(t))})),n}}function M(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),32===c.hexDataLength(e))?e.toLowerCase():(g.throwError("invalid hash",g.INVALID_ARGUMENT,{arg:"hash",value:e}),null)}function O(e){return s.bigNumberify(e).toNumber()}function k(e){if(!c.isHexString(e))throw new Error("invalid uint256");for(;e.length<66;)e="0x0"+e.substring(2);return e}function E(e){if(null==e)return"latest";if("earliest"===e)return"0x0";if("latest"===e||"pending"===e)return e;if("number"==typeof e)return c.hexStripZeros(c.hexlify(e));if(c.isHexString(e))return c.hexStripZeros(e);throw new Error("invalid blockTag")}var _={hash:M,blockHash:w(M,null),blockNumber:w(O,null),transactionIndex:w(O,null),confirmations:w(O,null),from:o.getAddress,gasPrice:s.bigNumberify,gasLimit:s.bigNumberify,to:w(o.getAddress,null),value:s.bigNumberify,nonce:O,data:c.hexlify,r:w(k),s:w(k),v:w(O),creates:w(o.getAddress,null),raw:w(c.hexlify)};function S(e){var t;null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&s.bigNumberify(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=o.getContractAddress(e)),e.raw||e.v&&e.r&&e.s&&(t=[c.stripZeros(c.hexlify(e.nonce)),c.stripZeros(c.hexlify(e.gasPrice)),c.stripZeros(c.hexlify(e.gasLimit)),e.to||"0x",c.stripZeros(c.hexlify(e.value||"0x")),c.hexlify(e.data||"0x"),c.stripZeros(c.hexlify(e.v||"0x")),c.stripZeros(c.hexlify(e.r)),c.stripZeros(c.hexlify(e.s))],e.raw=d.encode(t));var n=y(_,e),r=e.networkId;return null!=e.chainId&&null==r&&null==n.v&&(r=e.chainId),c.isHexString(r)&&(r=s.bigNumberify(r).toNumber()),"number"!=typeof r&&null!=n.v&&((r=(n.v-35)/2)<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),n.networkId=r,null==n.chainId&&null!=r&&(n.chainId=r),n.blockHash&&"x"===n.blockHash.replace(/0/g,"")&&(n.blockHash=null),n}var C={hash:M,parentHash:M,number:O,timestamp:O,nonce:w(c.hexlify),difficulty:function(e){var t=s.bigNumberify(e);try{return t.toNumber()}catch(e){}return null},gasLimit:s.bigNumberify,gasUsed:s.bigNumberify,miner:o.getAddress,extraData:c.hexlify,transactions:w(x(M))},j=h.shallowCopy(C);function T(e,t){return null!=e.author&&null==e.miner&&(e.miner=e.author),y(t?j:C,e)}j.transactions=w(x(S));var A={from:w(o.getAddress),nonce:w(O),gasLimit:w(s.bigNumberify),gasPrice:w(s.bigNumberify),to:w(o.getAddress),value:w(s.bigNumberify),data:w(c.hexlify)};function P(e){return y(A,e)}var N={transactionLogIndex:w(O),transactionIndex:O,blockNumber:O,transactionHash:M,address:o.getAddress,topics:x(M),data:c.hexlify,logIndex:O,blockHash:M},R={to:w(o.getAddress,null),from:w(o.getAddress,null),contractAddress:w(o.getAddress,null),transactionIndex:O,root:w(M),gasUsed:s.bigNumberify,logsBloom:w(c.hexlify),blockHash:M,transactionHash:M,logs:x((function(e){return y(N,e)})),blockNumber:O,confirmations:w(O,null),cumulativeGasUsed:s.bigNumberify,status:w(O)};function z(e){return Array.isArray(e)?e.forEach((function(e){z(e)})):null!=e&&M(e),e}var L,I={fromBlock:w(E,void 0),toBlock:w(E,void 0),address:w(o.getAddress,void 0),topics:w(z,void 0)},D={blockHash:w(M,void 0),address:w(o.getAddress,void 0),topics:w(z,void 0)},B={blockNumber:w(O),blockHash:w(M),transactionIndex:O,removed:w((function(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===e)return!0;if("false"===e)return!1}throw new Error("invaid boolean - "+e)})),address:o.getAddress,data:(L=c.hexlify,function(e){return e?L(e):"0x"}),topics:x(M),transactionHash:M,logIndex:O};function H(e){return y(B,e)}function F(e){return e.map((function(e){return"string"==typeof e?e:Array.isArray(e)?(e.forEach((function(e){null!==e&&32!==c.hexDataLength(e)&&g.throwError("invalid topic",g.INVALID_ARGUMENT,{argument:"topic",value:e})})),e.join(",")):null===e?"":g.throwError("invalid topic value",g.INVALID_ARGUMENT,{argument:"topic",value:e})})).join("&")}function V(e){if("string"==typeof e){if(20===c.hexDataLength(e))return"address:"+o.getAddress(e);if(e=e.toLowerCase(),32===c.hexDataLength(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter::"+F(e);if(e&&"object"==typeof e)return"filter:"+(e.address||"")+":"+F(e.topics||[])}throw new Error("invalid event - "+e)}function U(){return(new Date).getTime()}var W,q=(i(G,W=b.Provider),G.prototype._doPoll=function(){var e=this;this.getBlockNumber().then((function(t){if(e.polling&&(e._setFastBlockNumber(t),t!==e._lastBlockNumber)){-2===e._emitted.block&&(e._emitted.block=t-1);for(var n=e._emitted.block+1;n<=t;n++)e.emit("block",n);e._emitted.block!==t&&(e._emitted.block=t,Object.keys(e._emitted).forEach((function(n){var r;"block"===n||"pending"!==(r=e._emitted[n])&&122*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((function(t){return(null==e._fastBlockNumber||t>e._fastBlockNumber)&&(e._fastBlockNumber=t),e._fastBlockNumber}))),this._fastBlockNumberPromise},G.prototype._setFastBlockNumber=function(e){null!=this._fastBlockNumber&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))},G.prototype.waitForTransaction=function(e,t){var n=this;return null==t&&(t=1),this.getTransactionReceipt(e).then((function(r){return 0===t||r&&r.confirmations>=t?r:new Promise((function(r){n.on(e,(function i(a){a.confirmations(t=t.substring(64)).length)return null;var r=m.toUtf8String("0x"+t.substring(0,2*n));return i.resolveName(r).then((function(t){return t!=e?null:r}))}))},G.checkTransactionResponse=S,G.prototype.doPoll=function(){},G.prototype.perform=function(e,t){return g.throwError(e+" not implemented",g.NOT_IMPLEMENTED,{operation:e}),null},G.prototype._startPending=function(){g.warn("WARNING: this provider does not support pending events")},G.prototype._stopPending=function(){},G.prototype._addEventListener=function(e,t,n){this._events.push({tag:V(e),listener:t,once:n}),"pending"===e&&this._startPending(),this.polling=!0},G.prototype.on=function(e,t){return this._addEventListener(e,t,!1),this},G.prototype.once=function(e,t){return this._addEventListener(e,t,!0),this},G.prototype.addEventListener=function(e,t){return this.on(e,t)},G.prototype.emit=function(e){for(var t=this,n=[],r=1;re.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},S);function S(e,t){return E.call(this,e,"null","",t,!1)||this}var C,j=(i(T,C=x),T.prototype.encode=function(e){try{var t=u.bigNumberify(e);if(this.signed){var n=o.MaxUint256.maskn(8*this.size-1);if(t.gt(n))throw new Error("out-of-bounds");if(n=n.add(o.One).mul(o.NegativeOne),t.lt(n))throw new Error("out-of-bounds")}else if(t.lt(o.Zero)||t.gt(o.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return t=t.toTwos(8*this.size).maskn(8*this.size),this.signed&&(t=t.fromTwos(8*this.size).toTwos(256)),l.padZeros(l.arrayify(t),32)}catch(t){s.throwError("invalid number value",s.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e})}return null},T.prototype.decode=function(e,t){e.length>1]>>4&&(t[i]=t[i].toUpperCase()),8<=(15&n[i>>1])&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}for(var l={},f=0;f<10;f++)l[String(f)]=String(f);for(f=0;f<26;f++)l[String.fromCharCode(65+f)]=String(10+f);var h,d=Math.floor((h=9007199254740991,Math.log10?Math.log10(h):Math.log(h)/Math.LN10));function p(e){e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00";var t="";for(e.split("").forEach((function(e){t+=l[e]}));t.length>=d;){var n=t.substring(0,d);t=parseInt(n,10)%97+t.substring(n.length)}for(var r=String(98-parseInt(t,10)%97);r.length<2;)r="0"+r;return r}function m(e){var t=null;if("string"!=typeof e&&c.throwError("invalid address",c.INVALID_ARGUMENT,{arg:"address",value:e}),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=u(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&c.throwError("bad address checksum",c.INVALID_ARGUMENT,{arg:"address",value:e});else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==p(e)&&c.throwError("bad icap checksum",c.INVALID_ARGUMENT,{arg:"address",value:e}),t=new i.default.BN(e.substring(4),36).toString(16);t.length<40;)t="0"+t;t=u("0x"+t)}else c.throwError("invalid address",c.INVALID_ARGUMENT,{arg:"address",value:e});return t}n.getAddress=m,n.getIcapAddress=function(e){for(var t=new i.default.BN(m(e).substring(2),16).toString(36).toUpperCase();t.length<30;)t="0"+t;return"XE"+p("XE00"+t)+t},n.getContractAddress=function(e){if(!e.from)throw new Error("missing from address");var t=e.nonce;return m("0x"+o.keccak256(s.encode([m(e.from),a.stripZeros(a.hexlify(t))])).substring(26))},n.getCreate2Address=function(e){var t=e.initCodeHash;e.initCode&&(t?o.keccak256(e.initCode)!==t&&c.throwError("initCode/initCodeHash mismatch",c.INVALID_ARGUMENT,{arg:"options",value:e}):t=o.keccak256(e.initCode)),t||c.throwError("missing initCode or initCodeHash",c.INVALID_ARGUMENT,{arg:"options",value:e});var n=m(e.from),r=a.arrayify(e.salt);return 32!==r.length&&c.throwError("invalid salt",c.INVALID_ARGUMENT,{arg:"options",value:e}),m("0x"+o.keccak256(a.concat(["0xff",n,r,t])).substring(26))}},{"../errors":5,"./bytes":64,"./keccak256":71,"./rlp":76,"bn.js":9}],61:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("../utils/bytes");t.exports={decode:function(e){e=atob(e);for(var t=[],n=0;n>=8;for(;0>=8}for(var s=0;e[s]===this._leader&&s>4]+f[15&c])}return"0x"+r.join("")}return i.throwError("invalid hexlify value",null,{arg:"value",value:e}),"never"}function d(e,t){for(l(e)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:e});e.length<2*t+2;)e="0x0"+e.substring(2);return e}function p(e){var t,n=0,r="0x",a="0x";if((t=e)&&null!=t.r&&null!=t.s){null==e.v&&null==e.recoveryParam&&i.throwError("at least on of recoveryParam or v must be specified",i.INVALID_ARGUMENT,{argument:"signature",value:e}),r=d(e.r,32),a=d(e.s,32),"string"==typeof(n=e.v)&&(n=parseInt(n,16));var o=e.recoveryParam;null==o&&null!=e.v&&(o=1-n%2),n=27+o}else{var s=c(e);if(65!==s.length)throw new Error("invalid signature");r=h(s.slice(0,32)),a=h(s.slice(32,64)),27!==(n=s[64])&&28!==n&&(n=27+n%2)}return{r:r,s:a,recoveryParam:n-27,v:n}}n.hexlify=h,n.hexDataLength=function(e){return l(e)&&e.length%2==0?(e.length-2)/2:null},n.hexDataSlice=function(e,t,n){return l(e)||i.throwError("invalid hex data",i.INVALID_ARGUMENT,{arg:"value",value:e}),e.length%2!=0&&i.throwError("hex data length must be even",i.INVALID_ARGUMENT,{arg:"value",value:e}),t=2+2*t,null!=n?"0x"+e.substring(t,2+2*n):"0x"+e.substring(t)},n.hexStripZeros=function(e){for(l(e)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:e});3>3)]=e>>24-r&255;var i=f.computeHmac(f.SupportedAlgorithms.sha512,this.chainCode,n),a=i.slice(0,32),o=i.slice(32),u=null,l=null;return this.privateKey?u=y(c.bigNumberify(a).add(this.privateKey).mod(m)):l=new d.KeyPair(s.hexlify(a))._addPoint(this.publicKey),new O(x,u,l,this.fingerprint,y(o),e,this.depth+1,this.mnemonic,t)},O.prototype.derivePath=function(e){var t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();for(var n=this,r=0;r>3]|=1<<7-o%8),o++}var f=32*n.length/3,h=b(n.length/3),d=s.arrayify(p.sha256(r.slice(0,f/8)))[0];if((d&=h)!=(r[r.length-1]&h))throw new Error("invalid checksum");return s.hexlify(r.slice(0,f/8))}function S(e,t){if((e=s.arrayify(e)).length%4!=0||e.length<16||32>8-r,n.push(e[i]&(1<<8-r)-1),r+=3);var o=s.arrayify(p.sha256(e))[0],c=e.length/4;return o&=b(c),n[n.length-1]<<=c,n[n.length-1]|=o>>8-c,(t=t||a.langEn).join(n.map((function(e){return t.getWord(e)})))}n.HDNode=M,n.fromExtendedKey=function(e){var t=o.Base58.decode(e);82===t.length&&w(t.slice(0,78))===e||i.throwError("invalid extended key",i.INVALID_ARGUMENT,{argument:"extendedKey",value:"[REDACTED]"});var n=t[4],r=s.hexlify(t.slice(5,9)),a=parseInt(s.hexlify(t.slice(9,13)).substring(2),16),c=s.hexlify(t.slice(13,45)),u=t.slice(45,78);switch(s.hexlify(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new M(x,null,s.hexlify(u),r,c,a,n,null,null);case"0x0488ade4":case"0x04358394":if(0!==u[0])break;return new M(x,s.hexlify(u.slice(1)),null,r,c,a,n,null,null)}return i.throwError("invalid extended key",i.INVALID_ARGUMENT,{argument:"extendedKey",value:"[REDACTED]"})},n.fromMnemonic=function(e,t,n){return k(E(e=S(_(e,t),t),n),e)},n.fromSeed=function(e){return k(e,null)},n.mnemonicToSeed=E,n.mnemonicToEntropy=_,n.entropyToMnemonic=S,n.isValidMnemonic=function(e,t){try{return _(e,t),!0}catch(e){}return!1}},{"../errors":5,"../wordlists/lang-en":90,"./basex":62,"./bignumber":63,"./bytes":64,"./hmac":67,"./pbkdf2":73,"./properties":74,"./secp256k1":77,"./sha2":79,"./utf8":85}],67:[function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(n,"__esModule",{value:!0});var i,a,o=r(e("hash.js")),s=e("../utils/bytes"),c=r(e("../errors"));(a=i=n.SupportedAlgorithms||(n.SupportedAlgorithms={})).sha256="sha256",a.sha512="sha512",n.computeHmac=function(e,t,n){return i[e]||c.throwError("unsupported algorithm "+e,c.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),s.arrayify(o.hmac(o[e],s.arrayify(t)).update(s.arrayify(n)).digest())}},{"../errors":5,"../utils/bytes":64,"hash.js":26}],68:[function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(n,"__esModule",{value:!0});var i=e("./abi-coder");n.AbiCoder=i.AbiCoder,n.defaultAbiCoder=i.defaultAbiCoder,n.formatSignature=i.formatSignature,n.formatParamType=i.formatParamType,n.parseSignature=i.parseSignature,n.parseParamType=i.parseParamType;var a=e("./address");n.getAddress=a.getAddress,n.getContractAddress=a.getContractAddress,n.getCreate2Address=a.getCreate2Address,n.getIcapAddress=a.getIcapAddress;var o=r(e("./base64"));n.base64=o;var s=e("./bignumber");n.BigNumber=s.BigNumber,n.bigNumberify=s.bigNumberify;var c=e("./bytes");n.arrayify=c.arrayify,n.concat=c.concat,n.hexDataSlice=c.hexDataSlice,n.hexDataLength=c.hexDataLength,n.hexlify=c.hexlify,n.hexStripZeros=c.hexStripZeros,n.hexZeroPad=c.hexZeroPad,n.isHexString=c.isHexString,n.joinSignature=c.joinSignature,n.padZeros=c.padZeros,n.splitSignature=c.splitSignature,n.stripZeros=c.stripZeros;var u=e("./hash");n.hashMessage=u.hashMessage,n.id=u.id,n.namehash=u.namehash;var l=r(e("./hdnode"));n.HDNode=l;var f=e("./interface");n.Interface=f.Interface;var h=e("./json-wallet");n.getJsonWalletAddress=h.getJsonWalletAddress;var d=e("./keccak256");n.keccak256=d.keccak256;var p=e("./sha2");n.sha256=p.sha256;var m=e("./solidity");n.solidityKeccak256=m.keccak256,n.solidityPack=m.pack,n.soliditySha256=m.sha256;var v=e("./random-bytes");n.randomBytes=v.randomBytes;var g=e("./networks");n.getNetwork=g.getNetwork;var b=e("./properties");n.checkProperties=b.checkProperties,n.deepCopy=b.deepCopy,n.defineReadOnly=b.defineReadOnly,n.resolveProperties=b.resolveProperties,n.shallowCopy=b.shallowCopy;var y=r(e("./rlp"));n.RLP=y;var w=e("./secp256k1");n.computeAddress=w.computeAddress,n.computePublicKey=w.computePublicKey,n.recoverAddress=w.recoverAddress,n.recoverPublicKey=w.recoverPublicKey,n.verifyMessage=w.verifyMessage;var x=e("./signing-key");n.SigningKey=x.SigningKey;var M=e("./transaction");n.populateTransaction=M.populateTransaction;var O=e("./transaction");n.parseTransaction=O.parse,n.serializeTransaction=O.serialize;var k=e("./utf8");n.formatBytes32String=k.formatBytes32String,n.parseBytes32String=k.parseBytes32String,n.toUtf8Bytes=k.toUtf8Bytes,n.toUtf8String=k.toUtf8String;var E=e("./units");n.commify=E.commify,n.formatEther=E.formatEther,n.parseEther=E.parseEther,n.formatUnits=E.formatUnits,n.parseUnits=E.parseUnits;var _=e("./web");n.fetchJson=_.fetchJson,n.poll=_.poll;var S=e("./hmac");n.SupportedAlgorithms=S.SupportedAlgorithms;var C=e("./utf8");n.UnicodeNormalizationForm=C.UnicodeNormalizationForm;var j=e("./wordlist");n.Wordlist=j.Wordlist},{"./abi-coder":59,"./address":60,"./base64":61,"./bignumber":63,"./bytes":64,"./hash":65,"./hdnode":66,"./hmac":67,"./interface":69,"./json-wallet":70,"./keccak256":71,"./networks":72,"./properties":74,"./random-bytes":75,"./rlp":76,"./secp256k1":77,"./sha2":79,"./signing-key":81,"./solidity":82,"./transaction":83,"./units":84,"./utf8":85,"./web":86,"./wordlist":87}],69:[function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};function o(e){for(var t in p.setType(this,"Description"),e)p.defineReadOnly(this,t,p.deepCopy(e[t],!0));Object.freeze(this)}Object.defineProperty(n,"__esModule",{value:!0});var s,c=e("./address"),u=e("./abi-coder"),l=e("./bignumber"),f=e("./bytes"),h=e("./hash"),d=e("./keccak256"),p=e("./properties"),m=a(e("../errors")),v=function(e){p.setType(this,"Indexed"),p.defineReadOnly(this,"hash",e)},g=(i(b,s=o),b.prototype.encode=function(e,t){f.isHexString(e)||m.throwError("invalid contract bytecode",m.INVALID_ARGUMENT,{arg:"bytecode",value:e}),m.checkArgumentCount(t.length,this.inputs.length," in Interface constructor");try{return e+u.defaultAbiCoder.encode(this.inputs,t).substring(2)}catch(e){m.throwError("invalid constructor argument",m.INVALID_ARGUMENT,{arg:e.arg,reason:e.reason,value:e.value})}return null},b);function b(){return null!==s&&s.apply(this,arguments)||this}var y,w=(i(x,y=o),x.prototype.encode=function(e){m.checkArgumentCount(e.length,this.inputs.length," in interface function "+this.name);try{return this.sighash+u.defaultAbiCoder.encode(this.inputs,e).substring(2)}catch(e){m.throwError("invalid input argument",m.INVALID_ARGUMENT,{arg:e.arg,reason:e.reason,value:e.value})}return null},x.prototype.decode=function(t){try{return u.defaultAbiCoder.decode(this.outputs,f.arrayify(t))}catch(e){m.throwError("invalid data for function output",m.INVALID_ARGUMENT,{arg:"data",errorArg:e.arg,errorValue:e.value,value:t,reason:e.reason})}},x);function x(){return null!==y&&y.apply(this,arguments)||this}var M,O=(i(k,M=o),k);function k(){return null!==M&&M.apply(this,arguments)||this}var E,_=(i(S,E=o),S.prototype.encodeTopics=function(e){var t=this;e.length>this.inputs.length&&m.throwError("too many arguments for "+this.name,m.UNEXPECTED_ARGUMENT,{maxCount:e.length,expectedCount:this.inputs.length});var n=[];for(this.anonymous||n.push(this.topic),e.forEach((function(e,r){var i=t.inputs[r];i.indexed?null==e?n.push(null):"string"===i.type?n.push(h.id(e)):"bytes"===i.type?n.push(d.keccak256(e)):-1!==i.type.indexOf("[")||"tuple"===i.type.substring(0,5)?m.throwError("filtering with tuples or arrays not implemented yet; bug us on GitHub",m.NOT_IMPLEMENTED,{operation:"filter(array|tuple)"}):("address"===i.type&&c.getAddress(e),n.push(f.hexZeroPad(f.hexlify(e),32).toLowerCase())):null!=e&&m.throwError("cannot filter non-indexed parameters; must be null",m.INVALID_ARGUMENT,{argument:i.name||r,value:e})}));n.length&&null===n[n.length-1];)n.pop();return n},S.prototype.decode=function(e,t){null==t||this.anonymous||(t=t.slice(1));var n,r=[],i=[],a=[];this.inputs.forEach((function(e,t){e.indexed?"string"===e.type||"bytes"===e.type||0<=e.type.indexOf("[")||"tuple"===e.type.substring(0,5)?(r.push({type:"bytes32",name:e.name||""}),a.push(!0)):(r.push(e),a.push(!1)):(i.push(e),a.push(!1))})),null!=t&&(n=u.defaultAbiCoder.decode(r,f.concat(t)));var o=u.defaultAbiCoder.decode(i,f.arrayify(e)),s={},c=0,l=0;return this.inputs.forEach((function(e,r){e.indexed?null==t?s[r]=new v(null):a[r]?s[r]=new v(n[l++]):s[r]=n[l++]:s[r]=o[c++],e.name&&(s[e.name]=s[r])})),s.length=this.inputs.length,new O(s)},S);function S(){return null!==E&&E.apply(this,arguments)||this}var C,j=(i(T,C=o),T);function T(){return null!==C&&C.apply(this,arguments)||this}var A,P=(i(N,A=o),N);function N(){return null!==A&&A.apply(this,arguments)||this}function R(e){switch(e.type){case"constructor":var t=new g({inputs:e.inputs,payable:null==e.payable||!!e.payable});this.deployFunction||(this.deployFunction=t);break;case"function":var n=u.formatSignature(e).replace(/tuple/g,""),r=h.id(n).substring(0,10),i=!1;null!=e.constant?i=e.constant:null!=e.stateMutability&&(i="view"==e.stateMutability||"pure"==e.stateMutability),t=new w({inputs:e.inputs,outputs:e.outputs,gas:e.gas,payable:null==e.payable||!!e.payable,type:i?"call":"transaction",name:e.name,signature:n,sighash:r}),e.name&&(null==this.functions[e.name]?p.defineReadOnly(this.functions,e.name,t):m.warn("WARNING: Multiple definitions for "+e.name)),null==this.functions[t.signature]&&p.defineReadOnly(this.functions,t.signature,t);break;case"event":n=u.formatSignature(e).replace(/tuple/g,""),t=new _({name:e.name,signature:n,inputs:e.inputs,topic:h.id(n),anonymous:!!e.anonymous}),e.name&&null==this.events[e.name]&&p.defineReadOnly(this.events,e.name,t),null==this.events[t.signature]&&p.defineReadOnly(this.events,t.signature,t);break;case"receive":case"fallback":break;default:m.warn("WARNING: unsupported ABI type - "+e.type)}}var z=(L.prototype.parseTransaction=function(e){var t=e.data.substring(0,10).toLowerCase();for(var n in this.functions)if(-1!==n.indexOf("(")){var r=this.functions[n];if(r.sighash===t){var i=u.defaultAbiCoder.decode(r.inputs,"0x"+e.data.substring(10));return new j({args:i,decode:r.decode,name:r.name,signature:r.signature,sighash:r.sighash,value:l.bigNumberify(e.value||"0")})}}return null},L.prototype.parseLog=function(e){for(var t in this.events)if(-1!==t.indexOf("(")){var n=this.events[t];if(!n.anonymous&&n.topic===e.topics[0])return new P({decode:n.decode,name:n.name,signature:n.signature,topic:n.topic,values:n.decode(e.data,e.topics)})}return null},L.isInterface=function(e){return p.isType(e,"Interface")},L.isIndexed=function(e){return p.isType(e,"Indexed")},L);function L(t){if(m.checkNew(this,L),"string"==typeof t){try{t=JSON.parse(t)}catch(e){m.throwError("could not parse ABI JSON",m.INVALID_ARGUMENT,{arg:"abi",errorMessage:e.message,value:t})}if(!Array.isArray(t))return m.throwError("invalid abi",m.INVALID_ARGUMENT,{arg:"abi",value:t}),null}p.defineReadOnly(this,"functions",{}),p.defineReadOnly(this,"events",{});var n=[];t.forEach((function(e){"string"==typeof e&&(e=u.parseSignature(e)),n.push(e)})),p.defineReadOnly(this,"abi",p.deepCopy(n,!0)),n.forEach(R,this),this.deployFunction||R.call(this,{type:"constructor",inputs:[]}),p.setType(this,"Interface")}n.Interface=z},{"../errors":5,"./abi-coder":59,"./address":60,"./bignumber":63,"./bytes":64,"./hash":65,"./keccak256":71,"./properties":74}],70:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("./address");function i(e){try{var t=JSON.parse(e)}catch(e){return!1}return t.encseed&&t.ethaddr}function a(e){try{var t=JSON.parse(e)}catch(e){return!1}return!(!t.version||parseInt(t.version)!==t.version||3!==parseInt(t.version))}n.isCrowdsaleWallet=i,n.isSecretStorageWallet=a,n.getJsonWalletAddress=function(e){if(i(e))try{return r.getAddress(JSON.parse(e).ethaddr)}catch(e){return null}if(a(e))try{return r.getAddress(JSON.parse(e).address)}catch(e){return null}return null}},{"./address":60}],71:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("js-sha3"),i=e("./bytes");n.keccak256=function(e){return"0x"+r.keccak_256(i.arrayify(e))}},{"./bytes":64,"js-sha3":40}],72:[function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(n,"__esModule",{value:!0});var i=r(e("../errors"));function a(e){return function(t){var n=[];return t.InfuraProvider&&n.push(new t.InfuraProvider(e)),t.EtherscanProvider&&n.push(new t.EtherscanProvider(e)),0===n.length?null:t.FallbackProvider?new t.FallbackProvider(n):n[0]}}function o(e,t){return function(n){return n.JsonRpcProvider?new n.JsonRpcProvider(e,t):null}}var s={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:a("homestead")},c={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:a("ropsten")},u={unspecified:{chainId:0,name:"unspecified"},homestead:s,mainnet:s,morden:{chainId:2,name:"morden"},ropsten:c,testnet:c,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:a("rinkeby")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:a("goerli")},kovan:{chainId:42,name:"kovan",_defaultProvider:a("kovan")},classic:{chainId:61,name:"classic",_defaultProvider:o("https://web3.gastracker.io","classic")},classicTestnet:{chainId:62,name:"classicTestnet",_defaultProvider:o("https://web3.gastracker.io/morden","classicTestnet")}};n.getNetwork=function(e){if(null==e)return null;if("number"==typeof e){for(var t in u){var n=u[t];if(n.chainId===e)return{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress||null,_defaultProvider:n._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){var r=u[e];return null==r?null:{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress,_defaultProvider:r._defaultProvider||null}}var a=u[e.name];return a?(0!==e.chainId&&e.chainId!==a.chainId&&i.throwError("network chainId mismatch",i.INVALID_ARGUMENT,{arg:"network",value:e}),{name:e.name,chainId:a.chainId,ensAddress:e.ensAddress||a.ensAddress||null,_defaultProvider:e._defaultProvider||a._defaultProvider||null}):("number"!=typeof e.chainId&&i.throwError("invalid network chainId",i.INVALID_ARGUMENT,{arg:"network",value:e}),e)}},{"../errors":5}],73:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("../utils/bytes"),i=e("./hmac");n.pbkdf2=function(e,t,n,a,o){var s;e=r.arrayify(e),t=r.arrayify(t);var c,u,l=1,f=new Uint8Array(a),h=new Uint8Array(t.length+4);h.set(t);for(var d=1;d<=l;d++){h[t.length]=d>>24&255,h[t.length+1]=d>>16&255,h[t.length+2]=d>>8&255,h[t.length+3]=255&d;var p=i.computeHmac(o,e,h);s||(s=p.length,u=new Uint8Array(s),c=a-((l=Math.ceil(a/s))-1)*s),u.set(p);for(var m=1;m>=8;return t}function a(e,t,n){for(var r=0,i=0;ie.length)throw new Error("too short");if(t+1+n+(i=a(e,t+1,n))>e.length)throw new Error("to short");return o(e,t,t+1+n,n+i)}if(192<=e[t]){if(t+1+(i=e[t]-192)>e.length)throw new Error("invalid rlp data");return o(e,t,t+1,i)}if(184<=e[t]){var n;if(t+1+(n=e[t]-183)>e.length)throw new Error("invalid rlp data");if(t+1+n+(i=a(e,t+1,n))>e.length)throw new Error("invalid rlp data");return{consumed:1+n+i,result:r.hexlify(e.slice(t+1+n,t+1+n+i))}}if(128<=e[t]){var i;if(t+1+(i=e[t]-128)>e.length)throw new Error("invalid rlp data");return{consumed:1+i,result:r.hexlify(e.slice(t+1,t+1+i))}}return{consumed:1,result:r.hexlify(e[t])}}n.encode=function(e){return r.hexlify(function e(t){if(Array.isArray(t)){var n=[];return t.forEach((function(t){n=n.concat(e(t))})),n.length<=55?(n.unshift(192+n.length),n):((a=i(n.length)).unshift(247+a.length),a.concat(n))}var a,o=Array.prototype.slice.call(r.arrayify(t));return 1===o.length&&o[0]<=127?o:o.length<=55?(o.unshift(128+o.length),o):((a=i(o.length)).unshift(183+a.length),a.concat(o))}(e))},n.decode=function(e){var t=r.arrayify(e),n=s(t,0);if(n.consumed!==t.length)throw new Error("invalid rlp data");return n.result}},{"./bytes":64}],77:[function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(n,"__esModule",{value:!0});var i=e("elliptic"),a=e("./address"),o=e("./bytes"),s=e("./hash"),c=e("./keccak256"),u=e("./properties"),l=r(e("../errors")),f=null;function h(){return f=f||new i.ec("secp256k1")}var d=(p.prototype.sign=function(e){var t=h().keyFromPrivate(o.arrayify(this.privateKey)).sign(o.arrayify(e),{canonical:!0});return{recoveryParam:t.recoveryParam,r:o.hexZeroPad("0x"+t.r.toString(16),32),s:o.hexZeroPad("0x"+t.s.toString(16),32),v:27+t.recoveryParam}},p.prototype.computeSharedSecret=function(e){var t=h().keyFromPrivate(o.arrayify(this.privateKey)),n=h().keyFromPublic(o.arrayify(m(e)));return o.hexZeroPad("0x"+t.derive(n.getPublic()).toString(16),32)},p.prototype._addPoint=function(e){var t=h().keyFromPublic(o.arrayify(this.publicKey)),n=h().keyFromPublic(o.arrayify(e));return"0x"+t.pub.add(n.pub).encodeCompressed("hex")},p);function p(e){var t=h().keyFromPrivate(o.arrayify(e));u.defineReadOnly(this,"privateKey",o.hexlify(t.priv.toArray("be",32))),u.defineReadOnly(this,"publicKey","0x"+t.getPublic(!1,"hex")),u.defineReadOnly(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),u.defineReadOnly(this,"publicKeyBytes",t.getPublic().encode(null,!0))}function m(e,t){var n=o.arrayify(e);if(32!==n.length)return 33===n.length?t?o.hexlify(n):"0x"+h().keyFromPublic(n).getPublic(!1,"hex"):65===n.length?t?"0x"+h().keyFromPublic(n).getPublic(!0,"hex"):o.hexlify(n):(l.throwError("invalid public or private key",l.INVALID_ARGUMENT,{arg:"key",value:"[REDACTED]"}),null);var r=new d(n);return t?r.compressedPublicKey:r.publicKey}function v(e){var t="0x"+m(e).slice(4);return a.getAddress("0x"+c.keccak256(t).substring(26))}function g(e,t){var n=o.splitSignature(t),r={r:o.arrayify(n.r),s:o.arrayify(n.s)};return"0x"+h().recoverPubKey(o.arrayify(e),r,n.recoveryParam).encode("hex",!1)}function b(e,t){return v(g(o.arrayify(e),t))}n.KeyPair=d,n.computePublicKey=m,n.computeAddress=v,n.recoverPublicKey=g,n.recoverAddress=b,n.verifyMessage=function(e,t){return b(s.hashMessage(e),t)}},{"../errors":5,"./address":60,"./bytes":64,"./hash":65,"./keccak256":71,"./properties":74,elliptic:12}],78:[function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(n,"__esModule",{value:!0});var a=r(e("aes-js")),o=r(e("scrypt-js")),s=r(e("uuid")),c=e("./signing-key"),u=i(e("./hdnode")),l=e("./address"),f=e("./bytes"),h=e("./pbkdf2"),d=e("./keccak256"),p=e("./utf8"),m=e("./random-bytes");function v(e){return"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),f.arrayify(e)}function g(e,t){for(e=String(e);e.lengtht.maxLength&&a.throwError("invalid length for "+t.name,a.INVALID_ARGUMENT,{arg:"transaction"+t.name,value:r}),n.push(u.hexlify(r))})),null!=e.chainId&&0!==e.chainId&&(n.push(u.hexlify(e.chainId)),n.push("0x"),n.push("0x"));var r=h.encode(n);if(!t)return r;var i=u.splitSignature(t),o=27+i.recoveryParam;return 9===n.length&&(n.pop(),n.pop(),n.pop(),o+=2*e.chainId+8),n.push(u.hexlify(o)),n.push(u.stripZeros(u.arrayify(i.r))),n.push(u.stripZeros(u.arrayify(i.s))),h.encode(n)},n.parse=function(e){var t=h.decode(e);9!==t.length&&6!==t.length&&a.throwError("invalid raw transaction",a.INVALID_ARGUMENT,{arg:"rawTransactin",value:e});var n,r={nonce:p(t[0]).toNumber(),gasPrice:p(t[1]),gasLimit:p(t[2]),to:"0x"===(n=t[3])?null:s.getAddress(n),value:p(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=c.bigNumberify(t[6]).toNumber()}catch(e){return a.info(e),r}if(r.r=u.hexZeroPad(t[7],32),r.s=u.hexZeroPad(t[8],32),c.bigNumberify(r.r).isZero()&&c.bigNumberify(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);var i=r.v-27,f=t.slice(0,6);0!==r.chainId&&(f.push(u.hexlify(r.chainId)),f.push("0x"),f.push("0x"),i-=2*r.chainId+8);var d=l.keccak256(h.encode(f));try{r.from=o.recoverAddress(d,{r:u.hexlify(r.r),s:u.hexlify(r.s),recoveryParam:i})}catch(e){a.info(e)}r.hash=l.keccak256(e)}return r},n.populateTransaction=function(e,t,n){d.Provider.isProvider(t)||a.throwError("missing provider",a.INVALID_ARGUMENT,{argument:"provider",value:t}),f.checkProperties(e,v);var r,i=f.shallowCopy(e);return null!=i.to&&(i.to=t.resolveName(i.to)),null==i.gasPrice&&(i.gasPrice=t.getGasPrice()),null==i.nonce&&(i.nonce=t.getTransactionCount(n)),null==i.gasLimit&&((r=f.shallowCopy(i)).from=n,i.gasLimit=t.estimateGas(r)),null==i.chainId&&(i.chainId=t.getNetwork().then((function(e){return e.chainId}))),f.resolveProperties(i)}},{"../constants":3,"../errors":5,"../providers/abstract-provider":50,"./address":60,"./bignumber":63,"./bytes":64,"./keccak256":71,"./properties":74,"./rlp":76,"./secp256k1":77}],84:[function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(n,"__esModule",{value:!0});var i,a=e("../constants"),o=r(e("../errors")),s=e("./bignumber"),c={};function u(e){return{decimals:e.length-1,tenPower:s.bigNumberify(e)}}function l(e){var t=c[String(e).toLowerCase()];if(!t&&"number"==typeof e&&parseInt(String(e))==e&&0<=e&&e<=256){for(var n="1",r=0;rn.decimals&&o.throwError("underflow occurred",o.NUMERIC_FAULT,{operation:"division",fault:"underflow"});u.length>6|192),n.push(63&a|128);else if(55296==(64512&a)){i++;var c=e.charCodeAt(i);if(i>=e.length||56320!=(64512&c))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&c),n.push(a>>18|240),n.push(a>>12&63|128),n.push(a>>6&63|128),n.push(63&a|128)}else n.push(a>>12|224),n.push(a>>6&63|128),n.push(63&a|128)}return s.arrayify(n)}function u(e,t){e=s.arrayify(e);for(var n="",r=0;r>7!=0){var a=null,o=null;if(192==(224&i))a=1,o=127;else if(224==(240&i))a=2,o=2047;else{if(240!=(248&i)){if(t)continue;if(128==(192&i))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}a=3,o=65535}if(r+a>e.length){if(!t)throw new Error("invalid utf8 byte sequence; too short");for(;r>6==2;r++);}else{for(var c=i&(1<<8-a-1)-1,u=0;u>10&1023),56320+(1023&c)));else if(!t)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else n+=String.fromCharCode(i)}return n}(i=r=n.UnicodeNormalizationForm||(n.UnicodeNormalizationForm={})).current="",i.NFC="NFC",i.NFD="NFD",i.NFKC="NFKC",i.NFKD="NFKD",n.toUtf8Bytes=c,n.toUtf8String=u,n.formatBytes32String=function(e){var t=c(e);if(31t.ceiling&&(r=t.ceiling),s&&(c--,r=s,s=null),setTimeout(i,r)),null}),(function(e){o()&&r(e)}))}()}))}},{"../errors":5,"./base64":61,"./properties":74,"./utf8":85,xmlhttprequest:49}],87:[function(e,n,r){(function(t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("../utils/hash"),i=e("../utils/properties");r.check=function(e){for(var t=[],r=0;r<2048;r++){var i=e.getWord(r);if(r!==e.getWordIndex(i))return"0x";t.push(i)}return n.id(t.join("\n")+"\n")};var a=(o.prototype.split=function(e){return e.toLowerCase().split(/ +/g)},o.prototype.join=function(e){return e.join(" ")},o);function o(e){i.defineReadOnly(this,"locale",e)}r.Wordlist=a,r.register=function(e,t){t=t||e.locale}}).call(this,"undefined"!=typeof t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils/hash":65,"../utils/properties":74}],88:[function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(n,"__esModule",{value:!0});var o,s=e("./utils/bytes"),c=e("./utils/hash"),u=e("./utils/hdnode"),l=e("./utils/json-wallet"),f=e("./utils/keccak256"),h=e("./utils/properties"),d=e("./utils/random-bytes"),p=a(e("./utils/secret-storage")),m=e("./utils/signing-key"),v=e("./utils/transaction"),g=e("./abstract-signer"),b=e("./providers/abstract-provider"),y=a(e("./errors")),w=(i(x,o=g.Signer),Object.defineProperty(x.prototype,"address",{get:function(){return this.signingKey.address},enumerable:!0,configurable:!0}),Object.defineProperty(x.prototype,"mnemonic",{get:function(){return this.signingKey.mnemonic},enumerable:!0,configurable:!0}),Object.defineProperty(x.prototype,"path",{get:function(){return this.signingKey.path},enumerable:!0,configurable:!0}),Object.defineProperty(x.prototype,"privateKey",{get:function(){return this.signingKey.privateKey},enumerable:!0,configurable:!0}),x.prototype.connect=function(e){return b.Provider.isProvider(e)||y.throwError("invalid provider",y.INVALID_ARGUMENT,{argument:"provider",value:e}),new x(this.signingKey,e)},x.prototype.getAddress=function(){return Promise.resolve(this.address)},x.prototype.sign=function(e){var t=this;return h.resolveProperties(e).then((function(e){var n=v.serialize(e),r=t.signingKey.signDigest(f.keccak256(n));return v.serialize(e,r)}))},x.prototype.signMessage=function(e){return Promise.resolve(s.joinSignature(this.signingKey.signDigest(c.hashMessage(e))))},x.prototype.getBalance=function(e){if(!this.provider)throw new Error("missing provider");return this.provider.getBalance(this.address,e)},x.prototype.getTransactionCount=function(e){if(!this.provider)throw new Error("missing provider");return this.provider.getTransactionCount(this.address,e)},x.prototype.sendTransaction=function(e){var t=this;if(!this.provider)throw new Error("missing provider");return null==e.nonce&&((e=h.shallowCopy(e)).nonce=this.getTransactionCount("pending")),v.populateTransaction(e,this.provider,this.address).then((function(e){return t.sign(e).then((function(e){return t.provider.sendTransaction(e)}))}))},x.prototype.encrypt=function(e,t,n){if("function"!=typeof t||n||(n=t,t={}),n&&"function"!=typeof n)throw new Error("invalid callback");return t=t||{},this.mnemonic&&((t=h.shallowCopy(t)).mnemonic=this.mnemonic,t.path=this.path),p.encrypt(this.privateKey,e,t,n)},x.createRandom=function(e){var t=d.randomBytes(16);(e=e||{}).extraEntropy&&(t=s.arrayify(f.keccak256(s.concat([t,e.extraEntropy])).substring(0,34)));var n=u.entropyToMnemonic(t,e.locale);return x.fromMnemonic(n,e.path,e.locale)},x.fromEncryptedJson=function(e,t,n){if(l.isCrowdsaleWallet(e))try{n&&n(0);var r=p.decryptCrowdsale(e,t);return n&&n(1),Promise.resolve(new x(r))}catch(e){return Promise.reject(e)}else if(l.isSecretStorageWallet(e))return p.decrypt(e,t,n).then((function(e){return new x(e)}));return Promise.reject("invalid wallet JSON")},x.fromMnemonic=function(e,t,n){return t=t||u.defaultPath,new x(u.fromMnemonic(e,n).derivePath(t))},x);function x(e,t){var n=o.call(this)||this;return y.checkNew(n,x),m.SigningKey.isSigningKey(e)?h.defineReadOnly(n,"signingKey",e):h.defineReadOnly(n,"signingKey",new m.SigningKey(e)),h.defineReadOnly(n,"provider",t),n}n.Wallet=w},{"./abstract-signer":2,"./errors":5,"./providers/abstract-provider":50,"./utils/bytes":64,"./utils/hash":65,"./utils/hdnode":66,"./utils/json-wallet":70,"./utils/keccak256":71,"./utils/properties":74,"./utils/random-bytes":75,"./utils/secret-storage":78,"./utils/signing-key":81,"./utils/transaction":83}],89:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("../wordlists/lang-en").langEn;n.en=r},{"../wordlists/lang-en":90}],90:[function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var a,o=e("../utils/wordlist"),s=null;function c(e){if(null==s&&(s="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==o.check(e)))throw s=null,new Error("BIP39 Wordlist for en (English) FAILED")}function u(){return a.call(this,"en")||this}var l=new(i(u,a=o.Wordlist),u.prototype.getWord=function(e){return c(this),s[e]},u.prototype.getWordIndex=function(e){return c(this),s.indexOf(e)},u);n.langEn=l,o.register(l)},{"../utils/wordlist":87}]},{},[7])(7)}).call(this,n(71))},function(e,t,n){"use strict";var r=n(165);t.a=r.a},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(296);function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Object(r.a)(e,t)}},function(e,t,n){"use strict";t.a=function(e,t){if(!e)throw new Error("Invariant failed")}},function(e,t){"function"===typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";var r=t,i=n(126),a=n(159),o=n(389);r.assert=a,r.toArray=o.toArray,r.zero2=o.zero2,r.toHex=o.toHex,r.encode=o.encode,r.getNAF=function(e,t,n){var r=new Array(Math.max(e.bitLength(),n)+1);r.fill(0);for(var i=1<(i>>1)-1?(i>>1)-c:c,a.isubn(s)):s=0,r[o]=s,a.iushrn(1)}return r},r.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,i=0,a=0;e.cmpn(-i)>0||t.cmpn(-a)>0;){var o,s,c=e.andln(3)+i&3,u=t.andln(3)+a&3;3===c&&(c=-1),3===u&&(u=-1),o=0===(1&c)?0:3!==(r=e.andln(7)+i&7)&&5!==r||2!==u?c:-c,n[0].push(o),s=0===(1&u)?0:3!==(r=t.andln(7)+a&7)&&5!==r||2!==c?u:-u,n[1].push(s),2*i===o+1&&(i=1-i),2*a===s+1&&(a=1-a),e.iushrn(1),t.iushrn(1)}return n},r.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},r.parseBytes=function(e){return"string"===typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new i(e,"hex","le")}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(147);function i(e){if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=Object(r.a)(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a,o=!0,s=!1;return{s:function(){i=e[Symbol.iterator]()},n:function(){var e=i.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}},function(e,t,n){"use strict";var r=n(0),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"},a=n(1),o=function(e,t){return r.createElement(a.a,Object.assign({},e,{ref:t,icon:i}))};o.displayName="CheckCircleFilled";t.a=r.forwardRef(o)},function(e,t,n){"use strict";var r=n(0),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"},a=n(1),o=function(e,t){return r.createElement(a.a,Object.assign({},e,{ref:t,icon:i}))};o.displayName="ExclamationCircleFilled";t.a=r.forwardRef(o)},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);function i(e,t,n){var i=r.useRef({});return"value"in i.current&&!n(i.current.condition,t)||(i.current.value=e(),i.current.condition=t),i.current.value}},function(e,t,n){"use strict";var r=n(9),i=n(0),a=n(75);t.a=function(){var e=Object(i.useState)({}),t=Object(r.a)(e,2),n=t[0],o=t[1];return Object(i.useEffect)((function(){var e=a.a.subscribe((function(e){o(e)}));return function(){return a.a.unsubscribe(e)}}),[]),n}},,function(e,t,n){"use strict";function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"d",(function(){return i})),n.d(t,"e",(function(){return a})),n.d(t,"f",(function(){return o})),n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return l}));var r=n(14);function i(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}function a(e,t){var n=t.labelInValue,r=t.combobox,i=new Map;if(void 0===e||""===e&&r)return[[],i];var a=Array.isArray(e)?e:[e],o=a;return n&&(o=a.map((function(e){var t=e.key,n=e.value,r=void 0!==n?n:t;return i.set(r,e),r}))),[o,i]}function o(e,t){var n=t.optionLabelProp,r=t.labelInValue,i=t.prevValueMap,a=t.options,o=t.getLabeledValue,s=e;return r&&(s=s.map((function(e){return o(e,{options:a,prevValueMap:i,labelInValue:r,optionLabelProp:n})}))),s}function s(e,t){var n,i=Object(r.a)(t);for(n=e.length-1;n>=0&&e[n].disabled;n-=1);var a=null;return-1!==n&&(a=i[n],i.splice(n,1)),{values:i,removedValue:a}}var c="undefined"!==typeof window&&window.document&&window.document.documentElement,u=0;function l(){var e;return c?(e=u,u+=1):e="TEST_OR_SSR",e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(28);function i(e,t){var n=new Set;return e.forEach((function(e){t.has(e)||n.add(e)})),n}function a(e){var t=e||{},n=t.disabled,r=t.disableCheckbox,i=t.checkable;return!(!n&&!r)||!1===i}function o(e,t,n,o){var s,c=[];s=o||a;var u=new Set(e.filter((function(e){var t=!!n[e];return t||c.push(e),t}))),l=new Map,f=0;return Object.keys(n).forEach((function(e){var t=n[e],r=t.level,i=l.get(r);i||(i=new Set,l.set(r,i)),i.add(t),f=Math.max(f,r)})),Object(r.a)(!c.length,"Tree missing follow keys: ".concat(c.slice(0,100).map((function(e){return"'".concat(e,"'")})).join(", "))),!0===t?function(e,t,n,r){for(var a=new Set(e),o=new Set,s=0;s<=n;s+=1){(t.get(s)||new Set).forEach((function(e){var t=e.key,n=e.node,i=e.children,o=void 0===i?[]:i;a.has(t)&&!r(n)&&o.filter((function(e){return!r(e.node)})).forEach((function(e){a.add(e.key)}))}))}for(var c=new Set,u=n;u>=0;u-=1){(t.get(u)||new Set).forEach((function(e){var t=e.parent,n=e.node;if(!r(n)&&e.parent&&!c.has(e.parent.key))if(r(e.parent.node))c.add(t.key);else{var i=!0,s=!1;(t.children||[]).filter((function(e){return!r(e.node)})).forEach((function(e){var t=e.key,n=a.has(t);i&&!n&&(i=!1),s||!n&&!o.has(t)||(s=!0)})),i&&a.add(t.key),s&&o.add(t.key),c.add(t.key)}}))}return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(i(o,a))}}(u,l,f,s):function(e,t,n,r,a){for(var o=new Set(e),s=new Set(t),c=0;c<=r;c+=1){(n.get(c)||new Set).forEach((function(e){var t=e.key,n=e.node,r=e.children,i=void 0===r?[]:r;o.has(t)||s.has(t)||a(n)||i.filter((function(e){return!a(e.node)})).forEach((function(e){o.delete(e.key)}))}))}s=new Set;for(var u=new Set,l=r;l>=0;l-=1){(n.get(l)||new Set).forEach((function(e){var t=e.parent,n=e.node;if(!a(n)&&e.parent&&!u.has(e.parent.key))if(a(e.parent.node))u.add(t.key);else{var r=!0,i=!1;(t.children||[]).filter((function(e){return!a(e.node)})).forEach((function(e){var t=e.key,n=o.has(t);r&&!n&&(r=!1),i||!n&&!s.has(t)||(i=!0)})),r||o.delete(t.key),i&&s.add(t.key),u.add(t.key)}}))}return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(i(s,o))}}(u,t.halfCheckedKeys,l,f,s)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return x})),n.d(t,"b",(function(){return _})),n.d(t,"d",(function(){return C})),n.d(t,"c",(function(){return m})),n.d(t,"f",(function(){return v})),n.d(t,"e",(function(){return p}));var r=n(3);function i(e){return"/"===e.charAt(0)}function a(e,t){for(var n=t,r=n+1,i=e.length;r=0;h--){var d=o[h];"."===d?a(o,h):".."===d?(a(o,h),f++):f&&(a(o,h),f--)}if(!u)for(;f--;f)o.unshift("..");!u||""===o[0]||o[0]&&i(o[0])||o.unshift("");var p=o.join("/");return n&&"/"!==p.substr(-1)&&(p+="/"),p};function s(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var c=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"===typeof t||"object"===typeof n){var r=s(t),i=s(n);return r!==t||i!==n?e(r,i):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1},u=n(97);function l(e){return"/"===e.charAt(0)?e:"/"+e}function f(e){return"/"===e.charAt(0)?e.substr(1):e}function h(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function d(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function p(e){var t=e.pathname,n=e.search,r=e.hash,i=t||"/";return n&&"?"!==n&&(i+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(i+="#"===r.charAt(0)?r:"#"+r),i}function m(e,t,n,i){var a;"string"===typeof e?(a=function(e){var t=e||"/",n="",r="",i=t.indexOf("#");-1!==i&&(r=t.substr(i),t=t.substr(0,i));var a=t.indexOf("?");return-1!==a&&(n=t.substr(a),t=t.substr(0,a)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(a=Object(r.a)({},e)).pathname&&(a.pathname=""),a.search?"?"!==a.search.charAt(0)&&(a.search="?"+a.search):a.search="",a.hash?"#"!==a.hash.charAt(0)&&(a.hash="#"+a.hash):a.hash="",void 0!==t&&void 0===a.state&&(a.state=t));try{a.pathname=decodeURI(a.pathname)}catch(s){throw s instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):s}return n&&(a.key=n),i?a.pathname?"/"!==a.pathname.charAt(0)&&(a.pathname=o(a.pathname,i.pathname)):a.pathname=i.pathname:a.pathname||(a.pathname="/"),a}function v(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&c(e.state,t.state)}function g(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,i){if(null!=e){var a="function"===typeof e?e(t,n):e;"string"===typeof a?"function"===typeof r?r(a,i):i(!0):i(!1!==a)}else i(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,r):n.push(r),f({action:"PUSH",location:r,index:t,entries:n})}}))},replace:function(e,t){var r=m(e,t,h(),w.location);l.confirmTransitionTo(r,"REPLACE",n,(function(e){e&&(w.entries[w.index]=r,f({action:"REPLACE",location:r}))}))},go:y,goBack:function(){y(-1)},goForward:function(){y(1)},canGo:function(e){var t=w.index+e;return t>=0&&t",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(u),f=["%","/","?",";","#"].concat(l),h=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=n(451);function y(e,t,n){if(e&&i.isObject(e)&&e instanceof a)return e;var r=new a;return r.parse(e,t,n),r}a.prototype.parse=function(e,t,n){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var a=e.indexOf("?"),s=-1!==a&&a127?N+="x":N+=P[R];if(!N.match(d)){var L=T.slice(0,S),I=T.slice(S+1),D=P.match(p);D&&(L.push(D[1]),I.unshift(D[2])),I.length&&(y="/"+I.join(".")+y),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),j||(this.hostname=r.toASCII(this.hostname));var B=this.port?":"+this.port:"",H=this.hostname||"";this.host=H+B,this.href+=this.host,j&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!m[M])for(S=0,A=l.length;S0)&&n.host.split("@"))&&(n.auth=j.shift(),n.host=n.hostname=j.shift());return n.search=e.search,n.query=e.query,i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!O.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var E=O.slice(-1)[0],_=(n.host||e.host||O.length>1)&&("."===E||".."===E)||""===E,S=0,C=O.length;C>=0;C--)"."===(E=O[C])?O.splice(C,1):".."===E?(O.splice(C,1),S++):S&&(O.splice(C,1),S--);if(!x&&!M)for(;S--;S)O.unshift("..");!x||""===O[0]||O[0]&&"/"===O[0].charAt(0)||O.unshift(""),_&&"/"!==O.join("/").substr(-1)&&O.push("");var j,T=""===O[0]||O[0]&&"/"===O[0].charAt(0);k&&(n.hostname=n.host=T?"":O.length?O.shift():"",(j=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=j.shift(),n.host=n.hostname=j.shift()));return(x=x||n.host&&O.length)&&!T&&O.unshift(""),O.length?n.pathname=O.join("/"):(n.pathname=null,n.path=null),i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},a.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){var r=n(82);e.exports=function(e,t,n){return new r(e,n).compare(new r(t,n))}},function(e,t,n){var r=n(178),i=n(120),a=n(78),o=n(79),s=function(){"use strict";function e(t,n){var r=this;if(a(this,e),n=u(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof l)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t,this.set=t.split(/\s*\|\|\s*/).map((function(e){return r.parseRange(e.trim())})).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(t));if(this.set.length>1){var o=this.set[0];if(this.set=this.set.filter((function(e){return!y(e[0])})),0===this.set.length)this.set=[o];else if(this.set.length>1){var s,c=i(this.set);try{for(c.s();!(s=c.n()).done;){var f=s.value;if(1===f.length&&w(f[0])){this.set=[f];break}}}catch(h){c.e(h)}finally{c.f()}}}this.format()}return o(e,[{key:"format",value:function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(e){var t=this;e=e.trim();var n=Object.keys(this.options).join(","),a="parseRange:".concat(n,":").concat(e),o=c.get(a);if(o)return o;var s=this.options.loose,u=s?p[m.HYPHENRANGELOOSE]:p[m.HYPHENRANGE];e=e.replace(u,P(this.options.includePrerelease)),f("hyphen replace",e),e=e.replace(p[m.COMPARATORTRIM],v),f("comparator trim",e,p[m.COMPARATORTRIM]),e=(e=(e=e.replace(p[m.TILDETRIM],g)).replace(p[m.CARETTRIM],b)).split(/\s+/).join(" ");var h,d=s?p[m.COMPARATORLOOSE]:p[m.COMPARATOR],w=e.split(" ").map((function(e){return M(e,t.options)})).join(" ").split(/\s+/).map((function(e){return A(e,t.options)})).filter(this.options.loose?function(e){return!!e.match(d)}:function(){return!0}).map((function(e){return new l(e,t.options)})),x=(w.length,new Map),O=i(w);try{for(O.s();!(h=O.n()).done;){var k=h.value;if(y(k))return[k];x.set(k.value,k)}}catch(_){O.e(_)}finally{O.f()}x.size>1&&x.has("")&&x.delete("");var E=r(x.values());return c.set(a,E),E}},{key:"intersects",value:function(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((function(e){return x(e,n)&&t.set.some((function(t){return x(t,n)&&e.every((function(e){return t.every((function(t){return e.intersects(t,n)}))}))}))}))}},{key:"test",value:function(e){if(!e)return!1;if("string"===typeof e)try{e=new h(e,this.options)}catch(n){return!1}for(var t=0;t=".concat(n,".").concat(i,".0").concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".0").concat(r," <").concat(+n+1,".0.0-0"):o?(f("replaceCaret pr",o),s="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(a,"-").concat(o," <").concat(n,".").concat(i,".").concat(+a+1,"-0"):">=".concat(n,".").concat(i,".").concat(a,"-").concat(o," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(a,"-").concat(o," <").concat(+n+1,".0.0-0")):(f("no pr"),s="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(a).concat(r," <").concat(n,".").concat(i,".").concat(+a+1,"-0"):">=".concat(n,".").concat(i,".").concat(a).concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(a," <").concat(+n+1,".0.0-0")),f("caret return",s),s}))},C=function(e,t){return f("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return j(e,t)})).join(" ")},j=function(e,t){e=e.trim();var n=t.loose?p[m.XRANGELOOSE]:p[m.XRANGE];return e.replace(n,(function(n,r,i,a,o,s){f("xRange",e,n,r,i,a,o,s);var c=O(i),u=c||O(a),l=u||O(o),h=l;return"="===r&&h&&(r=""),s=t.includePrerelease?"-0":"",c?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&h?(u&&(a=0),o=0,">"===r?(r=">=",u?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):"<="===r&&(r="<",u?i=+i+1:a=+a+1),"<"===r&&(s="-0"),n="".concat(r+i,".").concat(a,".").concat(o).concat(s)):u?n=">=".concat(i,".0.0").concat(s," <").concat(+i+1,".0.0-0"):l&&(n=">=".concat(i,".").concat(a,".0").concat(s," <").concat(i,".").concat(+a+1,".0-0")),f("xRange return",n),n}))},T=function(e,t){return f("replaceStars",e,t),e.trim().replace(p[m.STAR],"")},A=function(e,t){return f("replaceGTE0",e,t),e.trim().replace(p[t.includePrerelease?m.GTE0PRE:m.GTE0],"")},P=function(e){return function(t,n,r,i,a,o,s,c,u,l,f,h,d){return n=O(r)?"":O(i)?">=".concat(r,".0.0").concat(e?"-0":""):O(a)?">=".concat(r,".").concat(i,".0").concat(e?"-0":""):o?">=".concat(n):">=".concat(n).concat(e?"-0":""),c=O(u)?"":O(l)?"<".concat(+u+1,".0.0-0"):O(f)?"<".concat(u,".").concat(+l+1,".0-0"):h?"<=".concat(u,".").concat(l,".").concat(f,"-").concat(h):e?"<".concat(u,".").concat(l,".").concat(+f+1,"-0"):"<=".concat(c),"".concat(n," ").concat(c).trim()}},N=function(e,t,n){for(var r=0;r0){var a=e[i].semver;if(a.major===t.major&&a.minor===t.minor&&a.patch===t.patch)return!0}return!1}return!0}},function(e,t,n){"use strict";var r=n(2),i=n(3),a=n(0),o=n(5),s=n.n(o),c=n(310),u=n(14),l=n(9),f=n(35),h=n(62),d=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0&&(n=P().map((function(e){return a.createElement(x,{prefixCls:N,key:e.value.toString(),disabled:"disabled"in e?e.disabled:y.disabled,value:e.value,checked:-1!==_.indexOf(e.value),onChange:e.onChange,className:"".concat(R,"-item"),style:e.style},e.label)})));var L={toggleOption:function(e){var t=_.indexOf(e.value),n=Object(u.a)(_);if(-1===t?n.push(e.value):n.splice(t,1),"value"in y||S(n),b){var r=P();b(n.filter((function(e){return-1!==T.indexOf(e)})).sort((function(e,t){return r.findIndex((function(t){return t.value===e}))-r.findIndex((function(e){return e.value===t}))})))}},value:_,disabled:y.disabled,name:y.name,registerValue:function(e){A((function(t){return[].concat(Object(u.a)(t),[e])}))},cancelValue:function(e){A((function(t){return t.filter((function(t){return t!==e}))}))}},I=s()(R,Object(r.a)({},"".concat(R,"-rtl"),"rtl"===O),v);return a.createElement("div",Object(i.a)({className:I,style:g},z),a.createElement(p.Provider,{value:L},n))},v=a.memo(m),g=n(29),b=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i=0||(i[n]=e[n]);return i}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return ue})),n.d(t,"b",(function(){return ee})),n.d(t,"c",(function(){return ae})),n.d(t,"d",(function(){return te})),n.d(t,"e",(function(){return ne}));var r=n(101),i=n(314);function a(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var o=n(38),s=n(316),c=n(36),u=n(42),l=n(3),f=n(40),h=n(442),d=n.n(h),p=n(234),m=n(0),v=n.n(m),g=n(443),b=n(235),y=n.n(b),w=[];function x(e,t,n){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],c=Object(r.a)(t);try{for(c.s();!(i=c.n()).done;){var u=i.value;if(y()(n,u.args)){if(s)return;if(u.error)throw u.error;if(u.response)return u.response;throw u.promise}}}catch(f){c.e(f)}finally{c.f()}var l={args:n,promise:e.apply(void 0,Object(o.a)(n)).then((function(e){return l.response=null==e||e})).catch((function(e){return l.error=null!=e?e:"unknown error"})).then((function(){a>0&&setTimeout((function(){var e=t.indexOf(l);-1!==e&&t.splice(e,1)}),a)}))};if(t.push(l),!s)throw l.promise}function M(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(i)for(n=0;n0)?P(r,e,n):0})),t=0;t0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!0===e)_.forEach((function(e){var n=e.containerInfo.__state;n.current.frames=n.current.ready?n.current.frames+t:t}));else if(e&&e.current){if(e.current.vr)return;e.current.frames=e.current.ready?e.current.frames+t:t}N||(N=!0,requestAnimationFrame(R))}var L={};function I(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=e.__container,l=[],h=[],d=Object.keys(t);for(n=0;n-1&&delete v[d[n]];for(d=Object.keys(p),n=0;n0){if(g.forEach((function(t){var n=Object(c.a)(t,2),r=n[0],i=n[1];if(!h.includes(r)){var a,u,l=e,d=l[r];if(r.includes("-")){var p=r.split("-");if(!(d=p.reduce((function(e,t){return e[t]}),e))||!d.set){var m=p.reverse(),v=Object(s.a)(m),g=v[0];l=v.slice(1).reverse().reduce((function(e,t){return e[t]}),e),r=g}}var b,y=null==(a=e.__container)||null==(u=a.__state)?void 0:u.current.colorManagement;if(d&&d.set&&(d.copy||d instanceof f.Layers))if(Array.isArray(i))(b=d).set.apply(b,Object(o.a)(i));else d.copy&&i&&i.constructor&&d.constructor.name===i.constructor.name?d.copy(i):void 0!==i&&(d.set(i),y&&d instanceof f.Color&&d.convertSRGBToLinear());else l[r]=i,y&&l[r]instanceof f.Texture&&(l[r].encoding=f.sRGBEncoding);D(e)}})),i&&a&&e.raycast&&e.__handlers){e.__handlers=void 0;var b=a.__interaction.indexOf(e);b>-1&&a.__interaction.splice(b,1)}h.length&&(i&&a&&e.raycast&&a.__interaction.push(e),e.__handlers=h.reduce((function(e,n){return e[n.charAt(2).toLowerCase()+n.substr(3)]=t[n],e}),{})),e.parent&&B(e)}}function D(e){e.__container&&e.__container.__state&&z(e.__container.__state)}function B(e){e.onUpdate&&e.onUpdate(e)}function H(e,t,n,r,s){var c,l=t.args,h=void 0===l?[]:l,d=a(t,["args"]),p="".concat(e[0].toUpperCase()).concat(e.slice(1));if("primitive"===e)(c=(d=Object(u.a)({dispose:null},d)).object).__instance=!0,c.__dispose=c.dispose;else{var m=L[p]||f[p];if(!m)throw'"'.concat(p,'" is not part of the THREE namespace! Did you forget to extend it? See: https://github.com/pmndrs/react-three-fiber/blob/master/markdown/api.md#using-3rd-party-objects-declaratively');c=C.arr(h)?Object(i.a)(m,Object(o.a)(h)):new m(h)}for(;n.__container;)n=n.__container;if(!_.has(n)){n=function e(t){return t.return?e(t.return):t.stateNode&&t.stateNode.containerInfo}(s)}return c.__objects=[],c.__container=n,p.endsWith("Geometry")?d=Object(u.a)({attach:"geometry"},d):p.endsWith("Material")&&(d=Object(u.a)({attach:"material"},d)),I(c,d,{}),c}function F(e,t){t&&(t.isObject3D?e.add(t):(e.__objects.push(t),t.parent=e,t.attachArray?(C.arr(e[t.attachArray])||(e[t.attachArray]=[]),e[t.attachArray].push(t)):t.attachObject?(C.obj(e[t.attachObject[0]])||(e[t.attachObject[0]]={}),e[t.attachObject[0]][t.attachObject[1]]=t):t.attach&&(e[t.attach]=t)),B(t),D(t))}function V(e,t,n){if(t){if(t.isObject3D){t.parent=e,t.dispatchEvent({type:"added"});var r=e.children.filter((function(e){return e!==t})),i=r.indexOf(n);e.children=[].concat(Object(o.a)(r.slice(0,i)),[t],Object(o.a)(r.slice(i))),B(t)}else F(e,t);D(t)}}function U(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e){var r=n?Object(o.a)(e):e;r.forEach((function(e){return W(t,e)}))}}function W(e,t){t&&(t.isObject3D?e.remove(t):(t.parent=null,e.__objects&&(e.__objects=e.__objects.filter((function(e){return e!==t}))),t.attachArray?e[t.attachArray]=e[t.attachArray].filter((function(e){return e!==t})):t.attachObject?delete e[t.attachObject[0]][t.attachObject[1]]:t.attach&&(e[t.attach]=null)),t.__container&&(t.__container.__interaction=t.__container.__interaction.filter((function(e){return e!==t}))),D(t),null!==t.dispose&&Object(p.unstable_runWithPriority)(p.unstable_IdlePriority,(function(){U(t.__objects,t),U(t.children,t,!0),t.dispose&&"Scene"!==t.type?t.dispose():t.__dispose&&t.__dispose(),delete t.__container,delete t.__objects})))}function q(e,t,n,r){var i=e.parent,a=H(t,n,e.__container,0,r);W(i,e),F(i,a),[r,r.alternate].forEach((function(e){null!==e&&(e.stateNode=a,e.ref&&(C.fun(e.ref)?e.ref(a):e.ref.current=a))}))}var G=d()({now:p.unstable_now,createInstance:H,removeChild:W,appendChild:F,insertBefore:V,warnsIfNotActing:!0,supportsMutation:!0,isPrimaryRenderer:!1,scheduleTimeout:C.fun(setTimeout)?setTimeout:void 0,cancelTimeout:C.fun(clearTimeout)?clearTimeout:void 0,setTimeout:C.fun(setTimeout)?setTimeout:void 0,clearTimeout:C.fun(clearTimeout)?clearTimeout:void 0,noTimeout:-1,appendInitialChild:F,appendChildToContainer:F,removeChildFromContainer:W,insertInContainerBefore:V,commitUpdate:function(e,t,n,r,i,o){if(e.__instance&&i.object&&i.object!==e)q(e,n,i,o);else{var s=i.args,u=void 0===s?[]:s,l=a(i,["args"]),f=r.args,h=void 0===f?[]:f,d=a(r,["args"]);u.some((function(e,t){return C.obj(e)?Object.entries(e).some((function(e){var n=Object(c.a)(e,2),r=n[0];return n[1]!==h[t][r]})):e!==h[t]}))?q(e,n,i,o):I(e,l,d,!0)}},hideInstance:function(e){e.isObject3D&&(e.visible=!1,D(e))},unhideInstance:function(e,t){(e.isObject3D&&null==t.visible||t.visible)&&(e.visible=!0,D(e))},hideTextInstance:function(){throw new Error("Text is not allowed in the react-three-fibre tree. You may have extraneous whitespace between components.")},getPublicInstance:function(e){return e},getRootHostContext:function(){return S},getChildHostContext:function(){return S},createTextInstance:function(){},finalizeInitialChildren:function(e){return e.__handlers},commitMount:function(e){var t=e.__container;t&&e.raycast&&e.__handlers&&t.__interaction.push(e)},prepareUpdate:function(){return S},shouldDeprioritizeSubtree:function(){return!1},prepareForCommit:function(){return null},preparePortalMount:function(){return null},resetAfterCommit:function(){},shouldSetTextContent:function(){return!1},clearContainer:function(){return!1}});C.fun(Symbol)&&Symbol.for&&Symbol.for("react.portal");G.injectIntoDevTools({bundleType:0,findHostInstanceByFiber:function(){return null},version:"5.3.18",rendererPackageName:"react-three-fiber"});function K(e){return e.isOrthographicCamera}function Y(e){return(e.eventObject||e.object).uuid+"/"+e.index}var X=Object(m.createContext)({}),Z=function(e){var t=e.children,n=e.gl,i=e.camera,s=e.orthographic,l=e.raycaster,h=e.size,d=e.pixelRatio,p=e.vr,v=void 0!==p&&p,b=e.concurrent,y=void 0!==b&&b,w=e.shadowMap,x=void 0!==w&&w,M=e.colorManagement,O=void 0===M||M,k=e.invalidateFrameloop,E=void 0!==k&&k,S=e.updateDefaultCamera,C=void 0===S||S,j=e.noEvents,T=void 0!==j&&j,A=e.onCreated,N=e.onPointerMissed,R=e.forceResize,L=Object(m.useState)(!1),D=Object(c.a)(L,2),B=D[0],H=D[1],F=Object(m.useState)((function(){return new f.Vector2})),V=Object(c.a)(F,1)[0],U=Object(m.useState)((function(){var e=new f.Raycaster;if(l){l.filter,l.computeOffsets;I(e,a(l,["filter","computeOffsets"]),{})}return e})),W=Object(c.a)(U,1)[0],q=Object(m.useState)((function(){var e=new f.Scene;return e.__interaction=[],e.__objects=[],e})),Z=Object(c.a)(q,1)[0],$=Object(m.useState)((function(){var e=s?new f.OrthographicCamera(0,0,0,0,.1,1e3):new f.PerspectiveCamera(75,0,.1,1e3);return e.position.z=5,i&&I(e,i,{}),e.lookAt(0,0,0),e})),ee=Object(c.a)($,2),te=ee[0],ne=ee[1],re=Object(m.useState)((function(){return new f.Clock})),ie=Object(c.a)(re,1)[0],ae=Object(m.useRef)({ready:!1,active:!0,manual:0,colorManagement:O,vr:v,concurrent:y,noEvents:T,invalidateFrameloop:!1,frames:0,aspect:0,subscribers:[],camera:te,scene:Z,raycaster:W,mouse:V,clock:ie,gl:n,size:h,viewport:null,initialClick:[0,0],initialHits:[],pointer:new g.TinyEmitter,captured:void 0,events:void 0,subscribe:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t&&ae.current.manual++,ae.current.subscribers.push({ref:e,priority:t}),ae.current.subscribers=ae.current.subscribers.sort((function(e,t){return e.priority-t.priority})),function(){var n;(null==(n=ae.current)?void 0:n.subscribers)&&(t&&ae.current.manual--,ae.current.subscribers=ae.current.subscribers.filter((function(t){return t.ref!==e})))}},setDefaultCamera:function(e){return ne(e)},invalidate:function(){return z(ae)},intersect:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return ge(e,t)},forceResize:R}),oe=new f.Vector3,se=Object(m.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ae.current.camera,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new f.Vector3(0,0,0),n=ae.current.size,r=n.width,i=n.height,a=e.getWorldPosition(oe).distanceTo(t);if(K(e))return{width:r/e.zoom,height:i/e.zoom,factor:1,distance:a};var o=e.fov*Math.PI/180,s=2*Math.tan(o/2)*a,c=s*(r/i);return{width:c,height:s,factor:r/c,distance:a}}),[]);Object(m.useMemo)((function(){ae.current.ready=B,ae.current.size=h,ae.current.camera=te,ae.current.invalidateFrameloop=E,ae.current.vr=v,ae.current.gl=n,ae.current.concurrent=y,ae.current.noEvents=T,ae.current.viewport=se}),[E,v,y,T,B,h,te,n]),Object(m.useMemo)((function(){ae.current.aspect=h.width/h.height,Object.assign(ae.current.viewport,se()),C&&(K(te)?(te.left=h.width/-2,te.right=h.width/2,te.top=h.height/2,te.bottom=h.height/-2):te.aspect=ae.current.aspect,te.updateProjectionMatrix(),te.updateMatrixWorld()),n.setSize(h.width,h.height),B&&z(ae)}),[te,n,h,C,B]);var ce=Object(m.useRef)(null);Object(m.useMemo)((function(){var e=ae.current,t=(e.ready,e.manual,e.vr,e.noEvents,e.invalidateFrameloop,e.frames,e.subscribers,e.captured,e.initialClick,e.initialHits,a(e,["ready","manual","vr","noEvents","invalidateFrameloop","frames","subscribers","captured","initialClick","initialHits"]));ce.current=t}),[h,te]),Object(m.useLayoutEffect)((function(){d&&(Array.isArray(d)?n.setPixelRatio(Math.max(Math.min(d[0],window.devicePixelRatio),d[1])):n.setPixelRatio(d))}),[n,d]),Object(m.useLayoutEffect)((function(){x&&(n.shadowMap.enabled=!0,"object"===typeof x?Object.assign(n.shadowMap,x):n.shadowMap.type=f.PCFSoftShadowMap),O&&(n.toneMapping=f.ACESFilmicToneMapping,n.outputEncoding=f.sRGBEncoding)}),[x,O]);var ue=Object(m.useMemo)((function(){return new Map}),[]),le=new f.Vector3,fe=Object(m.useCallback)((function(e){var t=(null==l||null==l.computeOffsets?void 0:l.computeOffsets(e,ce.current))||e.nativeEvent;if(t){var n=t.offsetX,r=t.offsetY,i=ae.current.size,a=i.width,o=i.height;V.set(n/a*2-1,-r/o*2+1),W.setFromCamera(V,ae.current.camera)}}),[]),he=Object(m.useCallback)((function(e){if(ae.current.noEvents)return[];var t=new Set,n=[],i=e?e(ae.current.scene.__interaction):ae.current.scene.__interaction,a=W.intersectObjects(i,!0).filter((function(e){var n=Y(e);return!t.has(n)&&(t.add(n),!0)}));l&&l.filter&&ce.current&&(a=l.filter(a,ce.current));var o,s=Object(r.a)(a);try{for(s.s();!(o=s.n()).done;)for(var c=o.value,f=c.object;f;){f.__handlers&&n.push(Object(u.a)(Object(u.a)({},c),{},{eventObject:f})),f=f.parent}}catch(h){s.e(h)}finally{s.f()}return n}),[]),de=Object(m.useCallback)((function(e){var t=e.nativeEvent.offsetX-ae.current.initialClick[0],n=e.nativeEvent.offsetY-ae.current.initialClick[1];return Math.round(Math.sqrt(t*t+n*n))}),[]),pe=Object(m.useCallback)((function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];ae.current.pointer.emit("pointerCancel",e),n&&fe(e),Array.from(ue.values()).forEach((function(e){if(t&&(!t.length||!t.find((function(t){return t.object===e.object&&t.index===e.index})))){var n=e.eventObject.__handlers;if(ue.delete(Y(e)),n){var r=Object(u.a)(Object(u.a)({},e),{},{intersections:t||[]});n.pointerOut&&n.pointerOut(Object(u.a)(Object(u.a)({},r),{},{type:"pointerout"})),n.pointerLeave&&n.pointerLeave(Object(u.a)(Object(u.a)({},r),{},{type:"pointerleave"}))}}}))}),[]),me=Object(m.useCallback)((function(e,t){var n=he(t);return ae.current.captured&&"click"!==e.type&&"wheel"!==e.type&&ae.current.captured.forEach((function(e){n.find((function(t){return t.eventObject===e.eventObject}))||n.push(e)})),n}),[]),ve=Object(m.useCallback)((function(e,t,n){return e.length&&function(){var i,a=le.set(V.x,V.y,0).unproject(ae.current.camera),s="click"===t.type?de(t):0,c=function(e){return t.target.releasePointerCapture(e)},l={stopped:!1,captured:!1},f=Object(r.a)(e);try{var h=function(){var r=i.value,f=function(e){l.captured||(l.captured=!0,ae.current.captured=[]),ae.current.captured&&ae.current.captured.push(r),t.target.setPointerCapture(e)},h=Object(u.a)(Object(u.a)(Object(u.a)({},t),r),{},{intersections:e,stopped:l.stopped,delta:s,unprojectedPoint:a,ray:W.ray,camera:ae.current.camera,stopPropagation:function(){var t=ae.current.captured;if((!t||t.find((function(e){return e.eventObject.id===r.eventObject.id})))&&(h.stopped=l.stopped=!0,ue.size&&Array.from(ue.values()).find((function(e){return e.eventObject===r.eventObject})))){var n=e.slice(0,e.indexOf(r));pe(h,[].concat(Object(o.a)(n),[r]))}},target:Object(u.a)(Object(u.a)({},t.target),{},{setPointerCapture:f,releasePointerCapture:c}),currentTarget:Object(u.a)(Object(u.a)({},t.currentTarget),{},{setPointerCapture:f,releasePointerCapture:c}),sourceEvent:t});if(n(h),!0===l.stopped)return"break"};for(f.s();!(i=f.n()).done;){if("break"===h())break}}catch(d){f.e(d)}finally{f.f()}}(),e}),[]),ge=Object(m.useCallback)((function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];ae.current.pointer.emit("pointerMove",e),t&&fe(e);var n=me(e,(function(e){return e.filter((function(e){return["Move","Over","Enter","Out","Leave"].some((function(t){return e.__handlers["pointer"+t]}))}))}));return pe(e,n),ve(n,e,(function(e){var t=e.eventObject.__handlers;if(t){if(t.pointerOver||t.pointerEnter||t.pointerOut||t.pointerLeave){var n=Y(e),r=ue.get(n);r?r.stopped&&e.stopPropagation():(ue.set(n,e),t.pointerOver&&t.pointerOver(Object(u.a)(Object(u.a)({},e),{},{type:"pointerover"})),t.pointerEnter&&t.pointerEnter(Object(u.a)(Object(u.a)({},e),{},{type:"pointerenter"})))}t.pointerMove&&t.pointerMove(e)}})),n}),[]),be=Object(m.useCallback)((function(e){return function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];ae.current.pointer.emit(e,t),n&&fe(t);var r=me(t);ve(r,t,(function(n){var r=n.eventObject,i=r.__handlers;i&&i[e]&&("click"!==e&&"contextMenu"!==e&&"doubleClick"!==e||ae.current.initialHits.includes(r))&&(i[e](n),J(t,Z.__interaction,(function(e){return e!==r})))})),"pointerDown"===e&&(ae.current.initialClick=[t.nativeEvent.offsetX,t.nativeEvent.offsetY],ae.current.initialHits=r.map((function(e){return e.eventObject}))),"click"!==e&&"contextMenu"!==e&&"doubleClick"!==e||r.length||de(t)<=2&&(J(t,Z.__interaction),N&&N())}}),[N,de,me,ve,fe]);Object(m.useMemo)((function(){ae.current.events={onClick:be("click"),onContextMenu:be("contextMenu"),onDoubleClick:be("doubleClick"),onWheel:be("wheel"),onPointerDown:be("pointerDown"),onPointerUp:be("pointerUp"),onPointerLeave:function(e){return pe(e,[])},onPointerMove:ge,onGotPointerCaptureLegacy:function(e){return ae.current.captured=he(e)},onLostPointerCapture:function(e){return ae.current.captured=void 0,pe(e)}}}),[be,he,pe,ge]);var ye=Object(m.useCallback)((function(e){var t=function(){return H(!0)};return Object(m.useLayoutEffect)((function(){n.compile(Z,te)}),[]),Object(m.useEffect)((function(){var e=A&&A(ae.current);e&&e.then?e.then(t):t()}),[]),e.children}),[]);return Object(m.useLayoutEffect)((function(){!function(e,t,n){var r=_.get(t);if(!r){t.__state=n;var i=r=G.createContainer(t,void 0!==n&&n.current.concurrent?2:0,!1,null);_.set(t,i)}G.updateContainer(e,r,null,(function(){})),G.getPublicRootInstance(r)}(Object(m.createElement)(ye,null,Object(m.createElement)(X.Provider,{value:ce.current},"function"===typeof t?t(ae.current):t)),Z,ae)}),[B,t,ce.current]),Object(m.useLayoutEffect)((function(){B&&(ae.current.vr?(n.xr||n.vr)&&n.setAnimationLoop?((n.xr||n.vr).enabled=!0,n.setAnimationLoop((function(e){return P(ae,e,0,!0)}))):console.warn("the gl instance does not support VR!"):0===ae.current.frames&&z(ae))}),[n,B,E]),Object(m.useEffect)((function(){return function(){ae.current.gl&&(ae.current.gl.renderLists&&ae.current.gl.renderLists.dispose(),ae.current.gl.forceContextLoss&&ae.current.gl.forceContextLoss(),Q(ae.current.gl)),function(e,t){var n=_.get(e);n&&G.updateContainer(null,n,null,(function(){_.delete(e),t&&t(e)}))}(ae.current.scene,(function(){Q(ae.current.raycaster),Q(ae.current.camera),Q(ae.current)}))}}),[]),ae.current.events};function J(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(e){return!0};t.filter(n).forEach((function(t){var n,r;return null==(n=(r=t.__handlers).pointerMissed)?void 0:n.call(r,e)}))}function Q(e){for(var t in e.dispose&&"Scene"!==e.type&&e.dispose(),e)"object"===typeof t&&t.dispose&&t.dispose(),delete e[t]}function $(e){var t=Object(m.useContext)(e);if(!("subscribe"in t))throw new Error("\u26a1\ufe0f react-three-fiber hooks can only be used within the Canvas component! https://github.com/pmndrs/react-three-fiber/blob/master/markdown/api.md#hooks");return t}function ee(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=$(X),r=n.subscribe,i=Object(m.useRef)(e);return Object(m.useLayoutEffect)((function(){i.current=e}),[e]),Object(m.useEffect)((function(){var e=r(i,t);return function(){return e()}}),[t,r]),null}function te(){return $(X)}function ne(e,t,n){var r=$(X).invalidate,i=Object(m.useRef)(),a=n||i;return Object(m.useLayoutEffect)((function(){a.current&&(e(a.current),r())}),t),a}function re(e){var t={nodes:{},materials:{}};return e&&e.traverse((function(e){e.name&&(t.nodes[e.name]=e),e.material&&!t.materials[e.material.name]&&(t.materials[e.material.name]=e.material)})),t}function ie(e,t){return function(n){var r=new n;e&&e(r);for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o2&&void 0!==arguments[2]?arguments[2]:{},r=n.prevValueOptions,i=void 0===r?[]:r,a=new Map;return t.forEach((function(e){if(!e.group){var t=e.data;a.set(t.value,t)}})),e.map((function(e){var t=a.get(e);return t||(t=Object(s.a)({},i.find((function(t){return t._INTERNAL_OPTION_VALUE_===e})))),h(t)}))}var p=function(e,t){var n=t.options,r=t.prevValueMap,i=t.labelInValue,a=t.optionLabelProp,s=d([e],n)[0],u={value:e},l=i?r.get(e):void 0;return l&&"object"===Object(o.a)(l)&&"label"in l?(u.label=l.label,s&&"string"===typeof l.label&&"string"===typeof s[a]&&l.label.trim()!==s[a].trim()&&Object(c.a)(!1,"`label` of `value` is not same as `label` in Select options.")):s&&a in s?u.label=s[a]:(u.label=e,u.isCacheable=!0),u.key=u.value,u};function m(e){return Object(u.d)(e).join("")}function v(e,t,n){var r,i=n.optionFilterProp,o=n.filterOption,c=[];return!1===o?Object(a.a)(t):(r="function"===typeof o?o:function(e){return function(t,n){var r=t.toLowerCase();return"options"in n?m(n.label).toLowerCase().includes(r):m(n[e]).toLowerCase().includes(r)}}(i),t.forEach((function(t){if("options"in t)if(r(e,t))c.push(t);else{var n=t.options.filter((function(t){return r(e,t)}));n.length&&c.push(Object(s.a)(Object(s.a)({},t),{},{options:n}))}else r(e,h(t))&&c.push(t)})),c)}function g(e,t){if(!t||!t.length)return null;var n=!1;var r=function e(t,r){var o=Object(i.a)(r),s=o[0],c=o.slice(1);if(!s)return[t];var u=t.split(s);return n=n||u.length>1,u.reduce((function(t,n){return[].concat(Object(a.a)(t),Object(a.a)(e(n,c)))}),[]).filter((function(e){return e}))}(e,t);return n?r:null}function b(e,t){return d([e],t)[0].disabled}function y(e,t,n,i){var o=Object(u.d)(t).slice().sort(),s=Object(a.a)(e),c=new Set;return e.forEach((function(e){e.options?e.options.forEach((function(e){c.add(e.value)})):c.add(e.value)})),o.forEach((function(e){var t,a=i?e.value:e;c.has(a)||s.push(i?(t={},Object(r.a)(t,n,e.label),Object(r.a)(t,"value",a),t):{value:a})})),s}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TokenInstructions=t.EVENT_QUEUE_LAYOUT=t.REQUEST_QUEUE_LAYOUT=t.decodeRequestQueue=t.decodeEventQueue=t.getLayoutVersion=t.MARKETS=t.TOKEN_MINTS=t.supportsSrmFeeDiscounts=t.getFeeRates=t.getFeeTier=t.NEW_ORDER_OWNER_INDEX=t.NEW_ORDER_OPEN_ORDERS_INDEX=t.SETTLE_FUNDS_QUOTE_WALLET_INDEX=t.SETTLE_FUNDS_BASE_WALLET_INDEX=t.decodeInstruction=t.DexInstructions=t.OpenOrders=t.Orderbook=t.Market=void 0;var o=n(693);Object.defineProperty(t,"Market",{enumerable:!0,get:function(){return o.Market}}),Object.defineProperty(t,"Orderbook",{enumerable:!0,get:function(){return o.Orderbook}}),Object.defineProperty(t,"OpenOrders",{enumerable:!0,get:function(){return o.OpenOrders}});var s=n(424);Object.defineProperty(t,"DexInstructions",{enumerable:!0,get:function(){return s.DexInstructions}}),Object.defineProperty(t,"decodeInstruction",{enumerable:!0,get:function(){return s.decodeInstruction}}),Object.defineProperty(t,"SETTLE_FUNDS_BASE_WALLET_INDEX",{enumerable:!0,get:function(){return s.SETTLE_FUNDS_BASE_WALLET_INDEX}}),Object.defineProperty(t,"SETTLE_FUNDS_QUOTE_WALLET_INDEX",{enumerable:!0,get:function(){return s.SETTLE_FUNDS_QUOTE_WALLET_INDEX}}),Object.defineProperty(t,"NEW_ORDER_OPEN_ORDERS_INDEX",{enumerable:!0,get:function(){return s.NEW_ORDER_OPEN_ORDERS_INDEX}}),Object.defineProperty(t,"NEW_ORDER_OWNER_INDEX",{enumerable:!0,get:function(){return s.NEW_ORDER_OWNER_INDEX}});var c=n(426);Object.defineProperty(t,"getFeeTier",{enumerable:!0,get:function(){return c.getFeeTier}}),Object.defineProperty(t,"getFeeRates",{enumerable:!0,get:function(){return c.getFeeRates}}),Object.defineProperty(t,"supportsSrmFeeDiscounts",{enumerable:!0,get:function(){return c.supportsSrmFeeDiscounts}});var u=n(355);Object.defineProperty(t,"TOKEN_MINTS",{enumerable:!0,get:function(){return u.TOKEN_MINTS}}),Object.defineProperty(t,"MARKETS",{enumerable:!0,get:function(){return u.MARKETS}}),Object.defineProperty(t,"getLayoutVersion",{enumerable:!0,get:function(){return u.getLayoutVersion}});var l=n(425);Object.defineProperty(t,"decodeEventQueue",{enumerable:!0,get:function(){return l.decodeEventQueue}}),Object.defineProperty(t,"decodeRequestQueue",{enumerable:!0,get:function(){return l.decodeRequestQueue}}),Object.defineProperty(t,"REQUEST_QUEUE_LAYOUT",{enumerable:!0,get:function(){return l.REQUEST_QUEUE_LAYOUT}}),Object.defineProperty(t,"EVENT_QUEUE_LAYOUT",{enumerable:!0,get:function(){return l.EVENT_QUEUE_LAYOUT}}),t.TokenInstructions=a(n(354))},function(e,t,n){var r=n(331);e.exports=function(e){if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=r(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a,o=!0,s=!1;return{s:function(){i=e[Symbol.iterator]()},n:function(){var e=i.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}},function(e,t,n){"use strict";var r=n(159),i=n(98);function a(e,t){return 55296===(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320===(64512&e.charCodeAt(t+1)))}function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function c(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"===typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(e="0"+e),i=0;i>6|192,n[r++]=63&o|128):a(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),n[r++]=o>>18|240,n[r++]=o>>12&63|128,n[r++]=o>>6&63|128,n[r++]=63&o|128):(n[r++]=o>>12|224,n[r++]=o>>6&63|128,n[r++]=63&o|128)}else for(i=0;i>>0}return o},t.split32=function(e,t){for(var n=new Array(4*e.length),r=0,i=0;r>>24,n[i+1]=a>>>16&255,n[i+2]=a>>>8&255,n[i+3]=255&a):(n[i+3]=a>>>24,n[i+2]=a>>>16&255,n[i+1]=a>>>8&255,n[i]=255&a)}return n},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,n){return e+t+n>>>0},t.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},t.sum32_5=function(e,t,n,r,i){return e+t+n+r+i>>>0},t.sum64=function(e,t,n,r){var i=e[t],a=r+e[t+1]>>>0,o=(a>>0,e[t+1]=a},t.sum64_hi=function(e,t,n,r){return(t+r>>>0>>0},t.sum64_lo=function(e,t,n,r){return t+r>>>0},t.sum64_4_hi=function(e,t,n,r,i,a,o,s){var c=0,u=t;return c+=(u=u+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,n,r,i,a,o,s){return t+r+a+s>>>0},t.sum64_5_hi=function(e,t,n,r,i,a,o,s,c,u){var l=0,f=t;return l+=(f=f+r>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,n,r,i,a,o,s,c,u){return t+r+a+s+u>>>0},t.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},t.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},t.shr64_hi=function(e,t,n){return e>>>n},t.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},function(e,t,n){var r=n(400),i="object"==typeof self&&self&&self.Object===Object&&self,a=r||i||Function("return this")();e.exports=a},,function(e,t,n){"use strict";var r=n(0),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},a=n(1),o=function(e,t){return r.createElement(a.a,Object.assign({},e,{ref:t,icon:i}))};o.displayName="CheckOutlined";t.a=r.forwardRef(o)},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(56),i=n.n(r);function a(e){return e instanceof HTMLElement?e:i.a.findDOMNode(e)}},function(e,t,n){(function(e){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function a(e,t,n){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"===typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{o=n(506).Buffer}catch(k){}function s(e,t,n){for(var r=0,i=Math.min(e.length,n),a=t;a=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return r}function c(e,t,n,r){for(var i=0,a=Math.min(e.length,n),o=t;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"===typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),t,n)},a.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},a.prototype._initArray=function(e,t,n){if(r("number"===typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===n)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=6)i=s(e,n,n+6),this.words[r]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,r++);n+6!==t&&(i=s(e,t,n+6),this.words[r]|=i<>>26-a&4194303),this.strip()},a.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var a=e.length-n,o=a%r,s=Math.min(a,a-o)+n,u=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var u=["","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"],l=[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],f=[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];function h(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,c=o/67108864|0;n.words[0]=s;for(var u=1;u>>26,f=67108863&c,h=Math.min(u,t.length-1),d=Math.max(0,u-e.length+1);d<=h;d++){var p=u-d|0;l+=(o=(i=0|e.words[p])*(a=0|t.words[d])+f)/67108864|0,f=67108863&o}n.words[u]=0|f,c=0|l}return 0!==c?n.words[u]=0|c:n.length--,n.strip()}a.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?u[6-c.length]+c+n:c+n,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(n=a.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var h=l[e],d=f[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e);n=(p=p.idivn(d)).isZero()?m+n:u[h-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return r("undefined"!==typeof o),this.toArrayLike(o,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),a=n||Math.max(1,i);r(i<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0"),this.strip();var o,s,c="le"===t,u=new e(a),l=this.clone();if(c){for(s=0;!l.isZero();s++)o=l.andln(255),l.iushrn(8),u[s]=o;for(;s=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var a=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,d=0|o[1],p=8191&d,m=d>>>13,v=0|o[2],g=8191&v,b=v>>>13,y=0|o[3],w=8191&y,x=y>>>13,M=0|o[4],O=8191&M,k=M>>>13,E=0|o[5],_=8191&E,S=E>>>13,C=0|o[6],j=8191&C,T=C>>>13,A=0|o[7],P=8191&A,N=A>>>13,R=0|o[8],z=8191&R,L=R>>>13,I=0|o[9],D=8191&I,B=I>>>13,H=0|s[0],F=8191&H,V=H>>>13,U=0|s[1],W=8191&U,q=U>>>13,G=0|s[2],K=8191&G,Y=G>>>13,X=0|s[3],Z=8191&X,J=X>>>13,Q=0|s[4],$=8191&Q,ee=Q>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,le=0|s[8],fe=8191&le,he=le>>>13,de=0|s[9],pe=8191&de,me=de>>>13;n.negative=e.negative^t.negative,n.length=19;var ve=(u+(r=Math.imul(f,F))|0)+((8191&(i=(i=Math.imul(f,V))+Math.imul(h,F)|0))<<13)|0;u=((a=Math.imul(h,V))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(p,F),i=(i=Math.imul(p,V))+Math.imul(m,F)|0,a=Math.imul(m,V);var ge=(u+(r=r+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,q)|0)+Math.imul(h,W)|0))<<13)|0;u=((a=a+Math.imul(h,q)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,F),i=(i=Math.imul(g,V))+Math.imul(b,F)|0,a=Math.imul(b,V),r=r+Math.imul(p,W)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,q)|0;var be=(u+(r=r+Math.imul(f,K)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(h,K)|0))<<13)|0;u=((a=a+Math.imul(h,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(w,F),i=(i=Math.imul(w,V))+Math.imul(x,F)|0,a=Math.imul(x,V),r=r+Math.imul(g,W)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(b,W)|0,a=a+Math.imul(b,q)|0,r=r+Math.imul(p,K)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,K)|0,a=a+Math.imul(m,Y)|0;var ye=(u+(r=r+Math.imul(f,Z)|0)|0)+((8191&(i=(i=i+Math.imul(f,J)|0)+Math.imul(h,Z)|0))<<13)|0;u=((a=a+Math.imul(h,J)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(O,F),i=(i=Math.imul(O,V))+Math.imul(k,F)|0,a=Math.imul(k,V),r=r+Math.imul(w,W)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(x,W)|0,a=a+Math.imul(x,q)|0,r=r+Math.imul(g,K)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(b,K)|0,a=a+Math.imul(b,Y)|0,r=r+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,Z)|0,a=a+Math.imul(m,J)|0;var we=(u+(r=r+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(h,$)|0))<<13)|0;u=((a=a+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(_,F),i=(i=Math.imul(_,V))+Math.imul(S,F)|0,a=Math.imul(S,V),r=r+Math.imul(O,W)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,q)|0,r=r+Math.imul(w,K)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(x,K)|0,a=a+Math.imul(x,Y)|0,r=r+Math.imul(g,Z)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(b,Z)|0,a=a+Math.imul(b,J)|0,r=r+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,ee)|0;var xe=(u+(r=r+Math.imul(f,ne)|0)|0)+((8191&(i=(i=i+Math.imul(f,re)|0)+Math.imul(h,ne)|0))<<13)|0;u=((a=a+Math.imul(h,re)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(j,F),i=(i=Math.imul(j,V))+Math.imul(T,F)|0,a=Math.imul(T,V),r=r+Math.imul(_,W)|0,i=(i=i+Math.imul(_,q)|0)+Math.imul(S,W)|0,a=a+Math.imul(S,q)|0,r=r+Math.imul(O,K)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(k,K)|0,a=a+Math.imul(k,Y)|0,r=r+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(x,Z)|0,a=a+Math.imul(x,J)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,ee)|0,r=r+Math.imul(p,ne)|0,i=(i=i+Math.imul(p,re)|0)+Math.imul(m,ne)|0,a=a+Math.imul(m,re)|0;var Me=(u+(r=r+Math.imul(f,ae)|0)|0)+((8191&(i=(i=i+Math.imul(f,oe)|0)+Math.imul(h,ae)|0))<<13)|0;u=((a=a+Math.imul(h,oe)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(P,F),i=(i=Math.imul(P,V))+Math.imul(N,F)|0,a=Math.imul(N,V),r=r+Math.imul(j,W)|0,i=(i=i+Math.imul(j,q)|0)+Math.imul(T,W)|0,a=a+Math.imul(T,q)|0,r=r+Math.imul(_,K)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(S,K)|0,a=a+Math.imul(S,Y)|0,r=r+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(k,Z)|0,a=a+Math.imul(k,J)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,$)|0,a=a+Math.imul(x,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(b,ne)|0,a=a+Math.imul(b,re)|0,r=r+Math.imul(p,ae)|0,i=(i=i+Math.imul(p,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var Oe=(u+(r=r+Math.imul(f,ce)|0)|0)+((8191&(i=(i=i+Math.imul(f,ue)|0)+Math.imul(h,ce)|0))<<13)|0;u=((a=a+Math.imul(h,ue)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(z,F),i=(i=Math.imul(z,V))+Math.imul(L,F)|0,a=Math.imul(L,V),r=r+Math.imul(P,W)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(N,W)|0,a=a+Math.imul(N,q)|0,r=r+Math.imul(j,K)|0,i=(i=i+Math.imul(j,Y)|0)+Math.imul(T,K)|0,a=a+Math.imul(T,Y)|0,r=r+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,J)|0)+Math.imul(S,Z)|0,a=a+Math.imul(S,J)|0,r=r+Math.imul(O,$)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(x,ne)|0,a=a+Math.imul(x,re)|0,r=r+Math.imul(g,ae)|0,i=(i=i+Math.imul(g,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,r=r+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,a=a+Math.imul(m,ue)|0;var ke=(u+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;u=((a=a+Math.imul(h,he)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(D,F),i=(i=Math.imul(D,V))+Math.imul(B,F)|0,a=Math.imul(B,V),r=r+Math.imul(z,W)|0,i=(i=i+Math.imul(z,q)|0)+Math.imul(L,W)|0,a=a+Math.imul(L,q)|0,r=r+Math.imul(P,K)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(N,K)|0,a=a+Math.imul(N,Y)|0,r=r+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,J)|0)+Math.imul(T,Z)|0,a=a+Math.imul(T,J)|0,r=r+Math.imul(_,$)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,ee)|0,r=r+Math.imul(O,ne)|0,i=(i=i+Math.imul(O,re)|0)+Math.imul(k,ne)|0,a=a+Math.imul(k,re)|0,r=r+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,oe)|0)+Math.imul(x,ae)|0,a=a+Math.imul(x,oe)|0,r=r+Math.imul(g,ce)|0,i=(i=i+Math.imul(g,ue)|0)+Math.imul(b,ce)|0,a=a+Math.imul(b,ue)|0,r=r+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,fe)|0,a=a+Math.imul(m,he)|0;var Ee=(u+(r=r+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(h,pe)|0))<<13)|0;u=((a=a+Math.imul(h,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(D,W),i=(i=Math.imul(D,q))+Math.imul(B,W)|0,a=Math.imul(B,q),r=r+Math.imul(z,K)|0,i=(i=i+Math.imul(z,Y)|0)+Math.imul(L,K)|0,a=a+Math.imul(L,Y)|0,r=r+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(N,Z)|0,a=a+Math.imul(N,J)|0,r=r+Math.imul(j,$)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(T,$)|0,a=a+Math.imul(T,ee)|0,r=r+Math.imul(_,ne)|0,i=(i=i+Math.imul(_,re)|0)+Math.imul(S,ne)|0,a=a+Math.imul(S,re)|0,r=r+Math.imul(O,ae)|0,i=(i=i+Math.imul(O,oe)|0)+Math.imul(k,ae)|0,a=a+Math.imul(k,oe)|0,r=r+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(x,ce)|0,a=a+Math.imul(x,ue)|0,r=r+Math.imul(g,fe)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(b,fe)|0,a=a+Math.imul(b,he)|0;var _e=(u+(r=r+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((a=a+Math.imul(m,me)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(D,K),i=(i=Math.imul(D,Y))+Math.imul(B,K)|0,a=Math.imul(B,Y),r=r+Math.imul(z,Z)|0,i=(i=i+Math.imul(z,J)|0)+Math.imul(L,Z)|0,a=a+Math.imul(L,J)|0,r=r+Math.imul(P,$)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(N,$)|0,a=a+Math.imul(N,ee)|0,r=r+Math.imul(j,ne)|0,i=(i=i+Math.imul(j,re)|0)+Math.imul(T,ne)|0,a=a+Math.imul(T,re)|0,r=r+Math.imul(_,ae)|0,i=(i=i+Math.imul(_,oe)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,oe)|0,r=r+Math.imul(O,ce)|0,i=(i=i+Math.imul(O,ue)|0)+Math.imul(k,ce)|0,a=a+Math.imul(k,ue)|0,r=r+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(x,fe)|0,a=a+Math.imul(x,he)|0;var Se=(u+(r=r+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,me)|0)+Math.imul(b,pe)|0))<<13)|0;u=((a=a+Math.imul(b,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(D,Z),i=(i=Math.imul(D,J))+Math.imul(B,Z)|0,a=Math.imul(B,J),r=r+Math.imul(z,$)|0,i=(i=i+Math.imul(z,ee)|0)+Math.imul(L,$)|0,a=a+Math.imul(L,ee)|0,r=r+Math.imul(P,ne)|0,i=(i=i+Math.imul(P,re)|0)+Math.imul(N,ne)|0,a=a+Math.imul(N,re)|0,r=r+Math.imul(j,ae)|0,i=(i=i+Math.imul(j,oe)|0)+Math.imul(T,ae)|0,a=a+Math.imul(T,oe)|0,r=r+Math.imul(_,ce)|0,i=(i=i+Math.imul(_,ue)|0)+Math.imul(S,ce)|0,a=a+Math.imul(S,ue)|0,r=r+Math.imul(O,fe)|0,i=(i=i+Math.imul(O,he)|0)+Math.imul(k,fe)|0,a=a+Math.imul(k,he)|0;var Ce=(u+(r=r+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(x,pe)|0))<<13)|0;u=((a=a+Math.imul(x,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(D,$),i=(i=Math.imul(D,ee))+Math.imul(B,$)|0,a=Math.imul(B,ee),r=r+Math.imul(z,ne)|0,i=(i=i+Math.imul(z,re)|0)+Math.imul(L,ne)|0,a=a+Math.imul(L,re)|0,r=r+Math.imul(P,ae)|0,i=(i=i+Math.imul(P,oe)|0)+Math.imul(N,ae)|0,a=a+Math.imul(N,oe)|0,r=r+Math.imul(j,ce)|0,i=(i=i+Math.imul(j,ue)|0)+Math.imul(T,ce)|0,a=a+Math.imul(T,ue)|0,r=r+Math.imul(_,fe)|0,i=(i=i+Math.imul(_,he)|0)+Math.imul(S,fe)|0,a=a+Math.imul(S,he)|0;var je=(u+(r=r+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,me)|0)+Math.imul(k,pe)|0))<<13)|0;u=((a=a+Math.imul(k,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(D,ne),i=(i=Math.imul(D,re))+Math.imul(B,ne)|0,a=Math.imul(B,re),r=r+Math.imul(z,ae)|0,i=(i=i+Math.imul(z,oe)|0)+Math.imul(L,ae)|0,a=a+Math.imul(L,oe)|0,r=r+Math.imul(P,ce)|0,i=(i=i+Math.imul(P,ue)|0)+Math.imul(N,ce)|0,a=a+Math.imul(N,ue)|0,r=r+Math.imul(j,fe)|0,i=(i=i+Math.imul(j,he)|0)+Math.imul(T,fe)|0,a=a+Math.imul(T,he)|0;var Te=(u+(r=r+Math.imul(_,pe)|0)|0)+((8191&(i=(i=i+Math.imul(_,me)|0)+Math.imul(S,pe)|0))<<13)|0;u=((a=a+Math.imul(S,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(D,ae),i=(i=Math.imul(D,oe))+Math.imul(B,ae)|0,a=Math.imul(B,oe),r=r+Math.imul(z,ce)|0,i=(i=i+Math.imul(z,ue)|0)+Math.imul(L,ce)|0,a=a+Math.imul(L,ue)|0,r=r+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,he)|0)+Math.imul(N,fe)|0,a=a+Math.imul(N,he)|0;var Ae=(u+(r=r+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(T,pe)|0))<<13)|0;u=((a=a+Math.imul(T,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(D,ce),i=(i=Math.imul(D,ue))+Math.imul(B,ce)|0,a=Math.imul(B,ue),r=r+Math.imul(z,fe)|0,i=(i=i+Math.imul(z,he)|0)+Math.imul(L,fe)|0,a=a+Math.imul(L,he)|0;var Pe=(u+(r=r+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,me)|0)+Math.imul(N,pe)|0))<<13)|0;u=((a=a+Math.imul(N,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(D,fe),i=(i=Math.imul(D,he))+Math.imul(B,fe)|0,a=Math.imul(B,he);var Ne=(u+(r=r+Math.imul(z,pe)|0)|0)+((8191&(i=(i=i+Math.imul(z,me)|0)+Math.imul(L,pe)|0))<<13)|0;u=((a=a+Math.imul(L,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Re=(u+(r=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,me))+Math.imul(B,pe)|0))<<13)|0;return u=((a=Math.imul(B,me))+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,c[0]=ve,c[1]=ge,c[2]=be,c[3]=ye,c[4]=we,c[5]=xe,c[6]=Me,c[7]=Oe,c[8]=ke,c[9]=Ee,c[10]=_e,c[11]=Se,c[12]=Ce,c[13]=je,c[14]=Te,c[15]=Ae,c[16]=Pe,c[17]=Ne,c[18]=Re,0!==u&&(c[19]=u,n.length++),n};function p(e,t,n){return(new m).mulp(e,t,n)}function m(e,t){this.x=e,this.y=t}Math.imul||(d=h),a.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?d(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}n.words[a]=s,r=o,o=i}return 0!==r?n.words[a]=r:n.length--,n.strip()}(this,e,t):p(this,e,t)},m.prototype.makeRBT=function(e){for(var t=new Array(e),n=a.prototype._countBits(e)-1,r=0;r>=1;return r},m.prototype.permute=function(e,t,n,r,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,n[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=a>>>26,this.words[n]=67108863&a}return 0!==t&&(this.words[n]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i}return t}(e);if(0===t.length)return new a(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,a=67108863>>>26-n<<26-n;if(0!==n){var o=0;for(t=0;t>>26-n}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,u=0;u=0&&(0!==l||u>=i);u--){var f=0|this.words[u];this.words[u]=l<<26-a|f>>>a,l=f&s}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&a}for(;i>26,this.words[i+n]=67108863&a;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,o=0|i.words[i.length-1];0!==(n=26-this._countBits(o))&&(i=i.ushln(n),r.iushln(n),o=0|i.words[i.length-1]);var s,c=r.length-i.length;if("mod"!==t){(s=new a(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;f--){var h=67108864*(0|r.words[i.length+f])+(0|r.words[i.length+f-1]);for(h=Math.min(h/o|0,67108863),r._ishlnsubmul(i,h,f);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(i,1,f),r.isZero()||(r.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},a.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),a=n.cmp(r);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},a.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),c=new a(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;0===(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(l),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var p=0,m=1;0===(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(l),c.isub(f)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),o.isub(c)):(n.isub(t),s.isub(i),c.isub(o))}return{a:s,b:c,gcd:n.iushln(u)}},a.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,o=new a(1),s=new a(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;0===(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);for(var f=0,h=1;0===(n.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(n.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s)):(n.isub(t),s.isub(o))}return(i=0===t.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var a=t;t=n,n=a}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0===(1&this.words[0])},a.prototype.isOdd=function(){return 1===(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new M(e)},a.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"===typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function O(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(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)}g.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},i(b,g),b.prototype.split=function(e,t){for(var n=Math.min(e.length,9),r=0;r>>22,i=a}i>>>=22,e.words[r-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new y;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return v[e]=t,t},M.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},M.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new a(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);r(!i.isZero());var s=new a(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new a(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var f=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=o;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr();r(v=0;r--){for(var u=t.words[r],l=c-1;l>=0;l--){var f=u>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===r&&0===l)&&(i=this.mul(i,n[o]),s=0,o=0)):s=0}c=26}return i},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new O(e)},i(O,M),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},O.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(99)(e))},function(e,t,n){"use strict";n.r(t),n.d(t,"BrowserRouter",(function(){return f})),n.d(t,"HashRouter",(function(){return h})),n.d(t,"Link",(function(){return b})),n.d(t,"NavLink",(function(){return x}));var r=n(66);n.d(t,"MemoryRouter",(function(){return r.a})),n.d(t,"Prompt",(function(){return r.b})),n.d(t,"Redirect",(function(){return r.c})),n.d(t,"Route",(function(){return r.d})),n.d(t,"Router",(function(){return r.e})),n.d(t,"StaticRouter",(function(){return r.f})),n.d(t,"Switch",(function(){return r.g})),n.d(t,"generatePath",(function(){return r.i})),n.d(t,"matchPath",(function(){return r.j})),n.d(t,"useHistory",(function(){return r.k})),n.d(t,"useLocation",(function(){return r.l})),n.d(t,"useParams",(function(){return r.m})),n.d(t,"useRouteMatch",(function(){return r.n})),n.d(t,"withRouter",(function(){return r.o}));var i=n(96),a=n(0),o=n.n(a),s=n(110),c=(n(226),n(3)),u=n(115),l=n(97),f=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i=0||t.relatedTarget.className.indexOf("".concat(a,"-next"))>=0)||(e.setState({goInputText:""}),i(e.getValidValue()))},e.go=function(t){""!==e.state.goInputText&&(t.keyCode!==m&&"click"!==t.type||(e.setState({goInputText:""}),e.props.quickGo(e.getValidValue())))},e}return Object(u.a)(n,[{key:"getValidValue",value:function(){var e=this.state.goInputText;return!e||isNaN(e)?void 0:Number(e)}},{key:"getPageSizeOptions",value:function(){var e=this.props,t=e.pageSize,n=e.pageSizeOptions;return n.some((function(e){return e.toString()===t.toString()}))?n:n.concat([t.toString()]).sort((function(e,t){return(isNaN(Number(e))?0:Number(e))-(isNaN(Number(t))?0:Number(t))}))}},{key:"render",value:function(){var e=this,t=this.props,n=t.pageSize,r=t.locale,i=t.rootPrefixCls,a=t.changeSize,s=t.quickGo,c=t.goButton,u=t.selectComponentClass,l=t.buildOptionText,f=t.selectPrefixCls,h=t.disabled,d=this.state.goInputText,p="".concat(i,"-options"),m=u,v=null,g=null,b=null;if(!a&&!s)return null;var y=this.getPageSizeOptions();if(a&&m){var w=y.map((function(t,n){return o.a.createElement(m.Option,{key:n,value:t.toString()},(l||e.buildOptionText)(t))}));v=o.a.createElement(m,{disabled:h,prefixCls:f,showSearch:!1,className:"".concat(p,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(n||y[0]).toString(),onChange:this.changeSize,getPopupContainer:function(e){return e.parentNode}},w)}return s&&(c&&(b="boolean"===typeof c?o.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:h,className:"".concat(p,"-quick-jumper-button")},r.jump_to_confirm):o.a.createElement("span",{onClick:this.go,onKeyUp:this.go},c)),g=o.a.createElement("div",{className:"".concat(p,"-quick-jumper")},r.jump_to,o.a.createElement("input",{disabled:h,type:"text",value:d,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),r.page,b)),o.a.createElement("li",{className:"".concat(p)},v,g)}}]),n}(o.a.Component);b.defaultProps={pageSizeOptions:["10","20","50","100"]};var y=b;function w(){}function x(e,t,n){var r="undefined"===typeof e?t.pageSize:e;return Math.floor((n.total-1)/r)+1}var M=function(e){Object(l.a)(n,e);var t=Object(f.a)(n);function n(e){var r;Object(c.a)(this,n),(r=t.call(this,e)).getJumpPrevPage=function(){return Math.max(1,r.state.current-(r.props.showLessItems?3:5))},r.getJumpNextPage=function(){return Math.min(x(void 0,r.state,r.props),r.state.current+(r.props.showLessItems?3:5))},r.getItemIcon=function(e,t){var n=r.props.prefixCls,i=e||o.a.createElement("button",{type:"button","aria-label":t,className:"".concat(n,"-item-link")});return"function"===typeof e&&(i=o.a.createElement(e,Object(s.a)({},r.props))),i},r.savePaginationNode=function(e){r.paginationNode=e},r.isValid=function(e){return"number"===typeof(t=e)&&isFinite(t)&&Math.floor(t)===t&&e!==r.state.current;var t},r.shouldDisplayQuickJumper=function(){var e=r.props,t=e.showQuickJumper,n=e.pageSize;return!(e.total<=n)&&t},r.handleKeyDown=function(e){e.keyCode!==v&&e.keyCode!==g||e.preventDefault()},r.handleKeyUp=function(e){var t=r.getValidValue(e);t!==r.state.currentInputValue&&r.setState({currentInputValue:t}),e.keyCode===m?r.handleChange(t):e.keyCode===v?r.handleChange(t-1):e.keyCode===g&&r.handleChange(t+1)},r.changePageSize=function(e){var t=r.state.current,n=x(e,r.state,r.props);t=t>n?n:t,0===n&&(t=r.state.current),"number"===typeof e&&("pageSize"in r.props||r.setState({pageSize:e}),"current"in r.props||r.setState({current:t,currentInputValue:t})),r.props.onShowSizeChange(t,e),"onChange"in r.props&&r.props.onChange&&r.props.onChange(t,e)},r.handleChange=function(e){var t=r.props.disabled,n=e;if(r.isValid(n)&&!t){var i=x(void 0,r.state,r.props);n>i?n=i:n<1&&(n=1),"current"in r.props||r.setState({current:n,currentInputValue:n});var a=r.state.pageSize;return r.props.onChange(n,a),n}return r.state.current},r.prev=function(){r.hasPrev()&&r.handleChange(r.state.current-1)},r.next=function(){r.hasNext()&&r.handleChange(r.state.current+1)},r.jumpPrev=function(){r.handleChange(r.getJumpPrevPage())},r.jumpNext=function(){r.handleChange(r.getJumpNextPage())},r.hasPrev=function(){return r.state.current>1},r.hasNext=function(){return r.state.current2?n-2:0),i=2;i=n?n:Number(t)}},{key:"getShowSizeChanger",value:function(){var e=this.props,t=e.showSizeChanger,n=e.total,r=e.totalBoundaryShowSizeChanger;return"undefined"!==typeof t?t:n>r}},{key:"renderPrev",value:function(e){var t=this.props,n=t.prevIcon,r=(0,t.itemRender)(e,"prev",this.getItemIcon(n,"prev page")),i=!this.hasPrev();return Object(a.isValidElement)(r)?Object(a.cloneElement)(r,{disabled:i}):r}},{key:"renderNext",value:function(e){var t=this.props,n=t.nextIcon,r=(0,t.itemRender)(e,"next",this.getItemIcon(n,"next page")),i=!this.hasNext();return Object(a.isValidElement)(r)?Object(a.cloneElement)(r,{disabled:i}):r}},{key:"render",value:function(){var e=this,t=this.props,n=t.prefixCls,s=t.className,c=t.style,u=t.disabled,l=t.hideOnSinglePage,f=t.total,h=t.locale,m=t.showQuickJumper,v=t.showLessItems,g=t.showTitle,b=t.showTotal,w=t.simple,M=t.itemRender,O=t.showPrevNextJumpers,k=t.jumpPrevIcon,E=t.jumpNextIcon,_=t.selectComponentClass,S=t.selectPrefixCls,C=t.pageSizeOptions,j=this.state,T=j.current,A=j.pageSize,P=j.currentInputValue;if(!0===l&&f<=A)return null;var N=x(void 0,this.state,this.props),R=[],z=null,L=null,I=null,D=null,B=null,H=m&&m.goButton,F=v?1:2,V=T-1>0?T-1:0,U=T+1=2*F&&3!==T&&(R[0]=Object(a.cloneElement)(R[0],{className:"".concat(n,"-item-after-jump-prev")}),R.unshift(z)),N-T>=2*F&&T!==N-2&&(R[R.length-1]=Object(a.cloneElement)(R[R.length-1],{className:"".concat(n,"-item-before-jump-next")}),R.push(L)),1!==Z&&R.unshift(I),J!==N&&R.push(D)}var ee=null;b&&(ee=o.a.createElement("li",{className:"".concat(n,"-total-text")},b(f,[0===f?0:(T-1)*A+1,T*A>f?f:T*A])));var te=!this.hasPrev()||!N,ne=!this.hasNext()||!N;return o.a.createElement("ul",Object(i.a)({className:d()(n,s,Object(r.a)({},"".concat(n,"-disabled"),u)),style:c,unselectable:"unselectable",ref:this.savePaginationNode},W),ee,o.a.createElement("li",{title:g?h.prev_page:null,onClick:this.prev,tabIndex:te?null:0,onKeyPress:this.runIfEnterPrev,className:d()("".concat(n,"-prev"),Object(r.a)({},"".concat(n,"-disabled"),te)),"aria-disabled":te},this.renderPrev(V)),R,o.a.createElement("li",{title:g?h.next_page:null,onClick:this.next,tabIndex:ne?null:0,onKeyPress:this.runIfEnterNext,className:d()("".concat(n,"-next"),Object(r.a)({},"".concat(n,"-disabled"),ne)),"aria-disabled":ne},this.renderNext(U)),o.a.createElement(y,{disabled:u,locale:h,rootPrefixCls:n,selectComponentClass:_,selectPrefixCls:S,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:T,pageSize:A,pageSizeOptions:C,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:H}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n={};if("current"in e&&(n.current=e.current,e.current!==t.current&&(n.currentInputValue=n.current)),"pageSize"in e&&e.pageSize!==t.pageSize){var r=t.current,i=x(e.pageSize,t,e);r=r>i?i:r,"current"in e||(n.current=r,n.currentInputValue=r),n.pageSize=e.pageSize}return n}}]),n}(o.a.Component);M.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:w,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:w,locale:{items_per_page:"\u6761/\u9875",jump_to:"\u8df3\u81f3",jump_to_confirm:"\u786e\u5b9a",page:"\u9875",prev_page:"\u4e0a\u4e00\u9875",next_page:"\u4e0b\u4e00\u9875",prev_5:"\u5411\u524d 5 \u9875",next_5:"\u5411\u540e 5 \u9875",prev_3:"\u5411\u524d 3 \u9875",next_3:"\u5411\u540e 3 \u9875"},style:{},itemRender:function(e,t,n){return n},totalBoundaryShowSizeChanger:50};var O=M,k=n(298),E=n(88),_=n(74),S=n(273),C=n(274),j=n(80),T=function(e){return a.createElement(j.a,Object(i.a)({size:"small"},e))};T.Option=j.a.Option;var A=T,P=n(53),N=n(62),R=n(105),z=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0},e.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),s?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;o.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),u=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),x="undefined"!==typeof WeakMap?new WeakMap:new n,M=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=c.getInstance(),r=new w(t,n,this);x.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){M.prototype[e]=function(){var t;return(t=x.get(this))[e].apply(t,arguments)}}));var O="undefined"!==typeof i.ResizeObserver?i.ResizeObserver:M;t.a=O}).call(this,n(71))},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(2);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t