From 1b18fe78dd72a6972f1643b9fce163fdb5e350e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Mon, 3 Jul 2023 15:23:19 +0900 Subject: [PATCH 01/91] Add tests --- .../server/middleware-build-manifest/input.js | 1 + .../input.js | 1 + .../raw/server/next-font-manifest/input.js | 1 + .../_buildManifest/input.js | 1 + .../_ssgManifest/input.js | 1 + .../chunks/02d83f53-5ea55415ffb981b3/input.js | 15 + .../chunks/285-f5f3e6efedc01eee/input.js | 8549 +++++++++++++++++ .../framework-529c7d20608a3f1b/input.js | 495 + .../chunks/main-6dc4d57ec5ea64ec/input.js | 6783 +++++++++++++ .../pages/_app-1d26df6f164d2627/input.js | 25 + .../pages/_error-5ef6c214c2eee217/input.js | 25 + .../[[...ost]]-43a1bb8ab774b1a7/input.js | 146 + .../chunks/webpack-af63f9e007a01abb/input.js | 189 + 13 files changed, 16232 insertions(+) create mode 100644 crates/swc_ecma_minifier/tests/fixture/next/raw/server/middleware-build-manifest/input.js create mode 100644 crates/swc_ecma_minifier/tests/fixture/next/raw/server/middleware-react-loadable-manifest/input.js create mode 100644 crates/swc_ecma_minifier/tests/fixture/next/raw/server/next-font-manifest/input.js create mode 100644 crates/swc_ecma_minifier/tests/fixture/next/raw/static/3jb7R5iAsOPS2fcY6LMxg/_buildManifest/input.js create mode 100644 crates/swc_ecma_minifier/tests/fixture/next/raw/static/3jb7R5iAsOPS2fcY6LMxg/_ssgManifest/input.js create mode 100644 crates/swc_ecma_minifier/tests/fixture/next/raw/static/chunks/02d83f53-5ea55415ffb981b3/input.js create mode 100644 crates/swc_ecma_minifier/tests/fixture/next/raw/static/chunks/285-f5f3e6efedc01eee/input.js create mode 100644 crates/swc_ecma_minifier/tests/fixture/next/raw/static/chunks/framework-529c7d20608a3f1b/input.js create mode 100644 crates/swc_ecma_minifier/tests/fixture/next/raw/static/chunks/main-6dc4d57ec5ea64ec/input.js create mode 100644 crates/swc_ecma_minifier/tests/fixture/next/raw/static/chunks/pages/_app-1d26df6f164d2627/input.js create mode 100644 crates/swc_ecma_minifier/tests/fixture/next/raw/static/chunks/pages/_error-5ef6c214c2eee217/input.js create mode 100644 crates/swc_ecma_minifier/tests/fixture/next/raw/static/chunks/pages/outstatic/[[...ost]]-43a1bb8ab774b1a7/input.js create mode 100644 crates/swc_ecma_minifier/tests/fixture/next/raw/static/chunks/webpack-af63f9e007a01abb/input.js diff --git a/crates/swc_ecma_minifier/tests/fixture/next/raw/server/middleware-build-manifest/input.js b/crates/swc_ecma_minifier/tests/fixture/next/raw/server/middleware-build-manifest/input.js new file mode 100644 index 000000000000..dadb9b7642fa --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/next/raw/server/middleware-build-manifest/input.js @@ -0,0 +1 @@ +self.__BUILD_MANIFEST={"polyfillFiles":["static/chunks/polyfills-78c92fac7aa8fdd8.js"],"devFiles":[],"ampDevFiles":[],"lowPriorityFiles":["static/3jb7R5iAsOPS2fcY6LMxg/_buildManifest.js","static/3jb7R5iAsOPS2fcY6LMxg/_ssgManifest.js"],"rootMainFiles":[],"pages":{"/_app":["static/chunks/webpack-af63f9e007a01abb.js","static/chunks/framework-529c7d20608a3f1b.js","static/chunks/main-6dc4d57ec5ea64ec.js","static/chunks/pages/_app-1d26df6f164d2627.js"],"/_error":["static/chunks/webpack-af63f9e007a01abb.js","static/chunks/framework-529c7d20608a3f1b.js","static/chunks/main-6dc4d57ec5ea64ec.js","static/chunks/pages/_error-5ef6c214c2eee217.js"],"/outstatic/[[...ost]]":["static/chunks/webpack-af63f9e007a01abb.js","static/chunks/framework-529c7d20608a3f1b.js","static/chunks/main-6dc4d57ec5ea64ec.js","static/chunks/02d83f53-5ea55415ffb981b3.js","static/chunks/285-f5f3e6efedc01eee.js","static/chunks/pages/outstatic/[[...ost]]-43a1bb8ab774b1a7.js"]},"ampFirstPages":[]} \ No newline at end of file diff --git a/crates/swc_ecma_minifier/tests/fixture/next/raw/server/middleware-react-loadable-manifest/input.js b/crates/swc_ecma_minifier/tests/fixture/next/raw/server/middleware-react-loadable-manifest/input.js new file mode 100644 index 000000000000..ca34f09f9ec5 --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/next/raw/server/middleware-react-loadable-manifest/input.js @@ -0,0 +1 @@ +self.__REACT_LOADABLE_MANIFEST="{}" \ No newline at end of file diff --git a/crates/swc_ecma_minifier/tests/fixture/next/raw/server/next-font-manifest/input.js b/crates/swc_ecma_minifier/tests/fixture/next/raw/server/next-font-manifest/input.js new file mode 100644 index 000000000000..5cc97ebd00ab --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/next/raw/server/next-font-manifest/input.js @@ -0,0 +1 @@ +self.__NEXT_FONT_MANIFEST="{\"pages\":{},\"app\":{},\"appUsingSizeAdjust\":false,\"pagesUsingSizeAdjust\":false}" \ No newline at end of file diff --git a/crates/swc_ecma_minifier/tests/fixture/next/raw/static/3jb7R5iAsOPS2fcY6LMxg/_buildManifest/input.js b/crates/swc_ecma_minifier/tests/fixture/next/raw/static/3jb7R5iAsOPS2fcY6LMxg/_buildManifest/input.js new file mode 100644 index 000000000000..ce07a6e41c8f --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/next/raw/static/3jb7R5iAsOPS2fcY6LMxg/_buildManifest/input.js @@ -0,0 +1 @@ +self.__BUILD_MANIFEST = {__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/_error":["static\u002Fchunks\u002Fpages\u002F_error-5ef6c214c2eee217.js"],"/outstatic/[[...ost]]":["static\u002Fchunks\u002F02d83f53-5ea55415ffb981b3.js","static\u002Fchunks\u002F285-f5f3e6efedc01eee.js","static\u002Fchunks\u002Fpages\u002Foutstatic\u002F[[...ost]]-43a1bb8ab774b1a7.js"],sortedPages:["\u002F_app","\u002F_error","\u002Foutstatic\u002F[[...ost]]"]};self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB() \ No newline at end of file diff --git a/crates/swc_ecma_minifier/tests/fixture/next/raw/static/3jb7R5iAsOPS2fcY6LMxg/_ssgManifest/input.js b/crates/swc_ecma_minifier/tests/fixture/next/raw/static/3jb7R5iAsOPS2fcY6LMxg/_ssgManifest/input.js new file mode 100644 index 000000000000..2260768dc5ed --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/next/raw/static/3jb7R5iAsOPS2fcY6LMxg/_ssgManifest/input.js @@ -0,0 +1 @@ +self.__SSG_MANIFEST=new Set;self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() \ No newline at end of file diff --git a/crates/swc_ecma_minifier/tests/fixture/next/raw/static/chunks/02d83f53-5ea55415ffb981b3/input.js b/crates/swc_ecma_minifier/tests/fixture/next/raw/static/chunks/02d83f53-5ea55415ffb981b3/input.js new file mode 100644 index 000000000000..11baab5179cd --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/next/raw/static/chunks/02d83f53-5ea55415ffb981b3/input.js @@ -0,0 +1,15 @@ +(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[190],{ + +/***/ 8307: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var __dirname = "/"; +/* provided dependency */ var Buffer = __webpack_require__(7861)["Buffer"]; +/* provided dependency */ var process = __webpack_require__(8448); +(function(){var e={7160:function(e,t,r){var i=t;i.bignum=r(711);i.define=r(495).define;i.base=r(853);i.constants=r(7335);i.decoders=r(6701);i.encoders=r(3418)},495:function(e,t,r){var i=r(7160);var n=r(3782);var a=t;a.define=function define(e,t){return new Entity(e,t)};function Entity(e,t){this.name=e;this.body=t;this.decoders={};this.encoders={}}Entity.prototype._createNamed=function createNamed(e){var t;try{t=r(6144).runInThisContext("(function "+this.name+"(entity) {\n"+" this._initNamed(entity);\n"+"})")}catch(e){t=function(e){this._initNamed(e)}}n(t,e);t.prototype._initNamed=function initnamed(t){e.call(this,t)};return new t(this)};Entity.prototype._getDecoder=function _getDecoder(e){e=e||"der";if(!this.decoders.hasOwnProperty(e))this.decoders[e]=this._createNamed(i.decoders[e]);return this.decoders[e]};Entity.prototype.decode=function decode(e,t,r){return this._getDecoder(t).decode(e,r)};Entity.prototype._getEncoder=function _getEncoder(e){e=e||"der";if(!this.encoders.hasOwnProperty(e))this.encoders[e]=this._createNamed(i.encoders[e]);return this.encoders[e]};Entity.prototype.encode=function encode(e,t,r){return this._getEncoder(t).encode(e,r)}},6483:function(e,t,r){var i=r(3782);var n=r(853).Reporter;var a=r(4300).Buffer;function DecoderBuffer(e,t){n.call(this,t);if(!a.isBuffer(e)){this.error("Input not Buffer");return}this.base=e;this.offset=0;this.length=e.length}i(DecoderBuffer,n);t.C=DecoderBuffer;DecoderBuffer.prototype.save=function save(){return{offset:this.offset,reporter:n.prototype.save.call(this)}};DecoderBuffer.prototype.restore=function restore(e){var t=new DecoderBuffer(this.base);t.offset=e.offset;t.length=this.offset;this.offset=e.offset;n.prototype.restore.call(this,e.reporter);return t};DecoderBuffer.prototype.isEmpty=function isEmpty(){return this.offset===this.length};DecoderBuffer.prototype.readUInt8=function readUInt8(e){if(this.offset+1<=this.length)return this.base.readUInt8(this.offset++,true);else return this.error(e||"DecoderBuffer overrun")};DecoderBuffer.prototype.skip=function skip(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var r=new DecoderBuffer(this.base);r._reporterState=this._reporterState;r.offset=this.offset;r.length=this.offset+e;this.offset+=e;return r};DecoderBuffer.prototype.raw=function raw(e){return this.base.slice(e?e.offset:this.offset,this.length)};function EncoderBuffer(e,t){if(Array.isArray(e)){this.length=0;this.value=e.map((function(e){if(!(e instanceof EncoderBuffer))e=new EncoderBuffer(e,t);this.length+=e.length;return e}),this)}else if(typeof e==="number"){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e;this.length=1}else if(typeof e==="string"){this.value=e;this.length=a.byteLength(e)}else if(a.isBuffer(e)){this.value=e;this.length=e.length}else{return t.error("Unsupported type: "+typeof e)}}t.R=EncoderBuffer;EncoderBuffer.prototype.join=function join(e,t){if(!e)e=new a(this.length);if(!t)t=0;if(this.length===0)return e;if(Array.isArray(this.value)){this.value.forEach((function(r){r.join(e,t);t+=r.length}))}else{if(typeof this.value==="number")e[t]=this.value;else if(typeof this.value==="string")e.write(this.value,t);else if(a.isBuffer(this.value))this.value.copy(e,t);t+=this.length}return e}},853:function(e,t,r){var i=t;i.Reporter=r(1293).b;i.DecoderBuffer=r(6483).C;i.EncoderBuffer=r(6483).R;i.Node=r(9374)},9374:function(e,t,r){var i=r(853).Reporter;var n=r(853).EncoderBuffer;var a=r(853).DecoderBuffer;var s=r(3523);var o=["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"];var h=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(o);var u=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function Node(e,t){var r={};this._baseState=r;r.enc=e;r.parent=t||null;r.children=null;r.tag=null;r.args=null;r.reverseArgs=null;r.choice=null;r.optional=false;r.any=false;r.obj=false;r.use=null;r.useDecoder=null;r.key=null;r["default"]=null;r.explicit=null;r.implicit=null;r.contains=null;if(!r.parent){r.children=[];this._wrap()}}e.exports=Node;var d=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Node.prototype.clone=function clone(){var e=this._baseState;var t={};d.forEach((function(r){t[r]=e[r]}));var r=new this.constructor(t.parent);r._baseState=t;return r};Node.prototype._wrap=function wrap(){var e=this._baseState;h.forEach((function(t){this[t]=function _wrappedMethod(){var r=new this.constructor(this);e.children.push(r);return r[t].apply(r,arguments)}}),this)};Node.prototype._init=function init(e){var t=this._baseState;s(t.parent===null);e.call(this);t.children=t.children.filter((function(e){return e._baseState.parent===this}),this);s.equal(t.children.length,1,"Root node can have only one child")};Node.prototype._useArgs=function useArgs(e){var t=this._baseState;var r=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this);if(r.length!==0){s(t.children===null);t.children=r;r.forEach((function(e){e._baseState.parent=this}),this)}if(e.length!==0){s(t.args===null);t.args=e;t.reverseArgs=e.map((function(e){if(typeof e!=="object"||e.constructor!==Object)return e;var t={};Object.keys(e).forEach((function(r){if(r==(r|0))r|=0;var i=e[r];t[i]=r}));return t}))}};u.forEach((function(e){Node.prototype[e]=function _overrided(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}}));o.forEach((function(e){Node.prototype[e]=function _tagMethod(){var t=this._baseState;var r=Array.prototype.slice.call(arguments);s(t.tag===null);t.tag=e;this._useArgs(r);return this}}));Node.prototype.use=function use(e){s(e);var t=this._baseState;s(t.use===null);t.use=e;return this};Node.prototype.optional=function optional(){var e=this._baseState;e.optional=true;return this};Node.prototype.def=function def(e){var t=this._baseState;s(t["default"]===null);t["default"]=e;t.optional=true;return this};Node.prototype.explicit=function explicit(e){var t=this._baseState;s(t.explicit===null&&t.implicit===null);t.explicit=e;return this};Node.prototype.implicit=function implicit(e){var t=this._baseState;s(t.explicit===null&&t.implicit===null);t.implicit=e;return this};Node.prototype.obj=function obj(){var e=this._baseState;var t=Array.prototype.slice.call(arguments);e.obj=true;if(t.length!==0)this._useArgs(t);return this};Node.prototype.key=function key(e){var t=this._baseState;s(t.key===null);t.key=e;return this};Node.prototype.any=function any(){var e=this._baseState;e.any=true;return this};Node.prototype.choice=function choice(e){var t=this._baseState;s(t.choice===null);t.choice=e;this._useArgs(Object.keys(e).map((function(t){return e[t]})));return this};Node.prototype.contains=function contains(e){var t=this._baseState;s(t.use===null);t.contains=e;return this};Node.prototype._decode=function decode(e,t){var r=this._baseState;if(r.parent===null)return e.wrapResult(r.children[0]._decode(e,t));var i=r["default"];var n=true;var s=null;if(r.key!==null)s=e.enterKey(r.key);if(r.optional){var o=null;if(r.explicit!==null)o=r.explicit;else if(r.implicit!==null)o=r.implicit;else if(r.tag!==null)o=r.tag;if(o===null&&!r.any){var h=e.save();try{if(r.choice===null)this._decodeGeneric(r.tag,e,t);else this._decodeChoice(e,t);n=true}catch(e){n=false}e.restore(h)}else{n=this._peekTag(e,o,r.any);if(e.isError(n))return n}}var u;if(r.obj&&n)u=e.enterObject();if(n){if(r.explicit!==null){var d=this._decodeTag(e,r.explicit);if(e.isError(d))return d;e=d}var c=e.offset;if(r.use===null&&r.choice===null){if(r.any)var h=e.save();var l=this._decodeTag(e,r.implicit!==null?r.implicit:r.tag,r.any);if(e.isError(l))return l;if(r.any)i=e.raw(h);else e=l}if(t&&t.track&&r.tag!==null)t.track(e.path(),c,e.length,"tagged");if(t&&t.track&&r.tag!==null)t.track(e.path(),e.offset,e.length,"content");if(r.any)i=i;else if(r.choice===null)i=this._decodeGeneric(r.tag,e,t);else i=this._decodeChoice(e,t);if(e.isError(i))return i;if(!r.any&&r.choice===null&&r.children!==null){r.children.forEach((function decodeChildren(r){r._decode(e,t)}))}if(r.contains&&(r.tag==="octstr"||r.tag==="bitstr")){var p=new a(i);i=this._getUse(r.contains,e._reporterState.obj)._decode(p,t)}}if(r.obj&&n)i=e.leaveObject(u);if(r.key!==null&&(i!==null||n===true))e.leaveKey(s,r.key,i);else if(s!==null)e.exitKey(s);return i};Node.prototype._decodeGeneric=function decodeGeneric(e,t,r){var i=this._baseState;if(e==="seq"||e==="set")return null;if(e==="seqof"||e==="setof")return this._decodeList(t,e,i.args[0],r);else if(/str$/.test(e))return this._decodeStr(t,e,r);else if(e==="objid"&&i.args)return this._decodeObjid(t,i.args[0],i.args[1],r);else if(e==="objid")return this._decodeObjid(t,null,null,r);else if(e==="gentime"||e==="utctime")return this._decodeTime(t,e,r);else if(e==="null_")return this._decodeNull(t,r);else if(e==="bool")return this._decodeBool(t,r);else if(e==="objDesc")return this._decodeStr(t,e,r);else if(e==="int"||e==="enum")return this._decodeInt(t,i.args&&i.args[0],r);if(i.use!==null){return this._getUse(i.use,t._reporterState.obj)._decode(t,r)}else{return t.error("unknown tag: "+e)}};Node.prototype._getUse=function _getUse(e,t){var r=this._baseState;r.useDecoder=this._use(e,t);s(r.useDecoder._baseState.parent===null);r.useDecoder=r.useDecoder._baseState.children[0];if(r.implicit!==r.useDecoder._baseState.implicit){r.useDecoder=r.useDecoder.clone();r.useDecoder._baseState.implicit=r.implicit}return r.useDecoder};Node.prototype._decodeChoice=function decodeChoice(e,t){var r=this._baseState;var i=null;var n=false;Object.keys(r.choice).some((function(a){var s=e.save();var o=r.choice[a];try{var h=o._decode(e,t);if(e.isError(h))return false;i={type:a,value:h};n=true}catch(t){e.restore(s);return false}return true}),this);if(!n)return e.error("Choice not matched");return i};Node.prototype._createEncoderBuffer=function createEncoderBuffer(e){return new n(e,this.reporter)};Node.prototype._encode=function encode(e,t,r){var i=this._baseState;if(i["default"]!==null&&i["default"]===e)return;var n=this._encodeValue(e,t,r);if(n===undefined)return;if(this._skipDefault(n,t,r))return;return n};Node.prototype._encodeValue=function encode(e,t,r){var n=this._baseState;if(n.parent===null)return n.children[0]._encode(e,t||new i);var a=null;this.reporter=t;if(n.optional&&e===undefined){if(n["default"]!==null)e=n["default"];else return}var s=null;var o=false;if(n.any){a=this._createEncoderBuffer(e)}else if(n.choice){a=this._encodeChoice(e,t)}else if(n.contains){s=this._getUse(n.contains,r)._encode(e,t);o=true}else if(n.children){s=n.children.map((function(r){if(r._baseState.tag==="null_")return r._encode(null,t,e);if(r._baseState.key===null)return t.error("Child should have a key");var i=t.enterKey(r._baseState.key);if(typeof e!=="object")return t.error("Child expected, but input is not object");var n=r._encode(e[r._baseState.key],t,e);t.leaveKey(i);return n}),this).filter((function(e){return e}));s=this._createEncoderBuffer(s)}else{if(n.tag==="seqof"||n.tag==="setof"){if(!(n.args&&n.args.length===1))return t.error("Too many args for : "+n.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var h=this.clone();h._baseState.implicit=null;s=this._createEncoderBuffer(e.map((function(r){var i=this._baseState;return this._getUse(i.args[0],e)._encode(r,t)}),h))}else if(n.use!==null){a=this._getUse(n.use,r)._encode(e,t)}else{s=this._encodePrimitive(n.tag,e);o=true}}var a;if(!n.any&&n.choice===null){var u=n.implicit!==null?n.implicit:n.tag;var d=n.implicit===null?"universal":"context";if(u===null){if(n.use===null)t.error("Tag could be omitted only for .use()")}else{if(n.use===null)a=this._encodeComposite(u,o,d,s)}}if(n.explicit!==null)a=this._encodeComposite(n.explicit,false,"context",a);return a};Node.prototype._encodeChoice=function encodeChoice(e,t){var r=this._baseState;var i=r.choice[e.type];if(!i){s(false,e.type+" not found in "+JSON.stringify(Object.keys(r.choice)))}return i._encode(e.value,t)};Node.prototype._encodePrimitive=function encodePrimitive(e,t){var r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);else if(e==="objid"&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);else if(e==="objid")return this._encodeObjid(t,null,null);else if(e==="gentime"||e==="utctime")return this._encodeTime(t,e);else if(e==="null_")return this._encodeNull();else if(e==="int"||e==="enum")return this._encodeInt(t,r.args&&r.reverseArgs[0]);else if(e==="bool")return this._encodeBool(t);else if(e==="objDesc")return this._encodeStr(t,e);else throw new Error("Unsupported tag: "+e)};Node.prototype._isNumstr=function isNumstr(e){return/^[0-9 ]*$/.test(e)};Node.prototype._isPrintstr=function isPrintstr(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}},1293:function(e,t,r){var i=r(3782);function Reporter(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}t.b=Reporter;Reporter.prototype.isError=function isError(e){return e instanceof ReporterError};Reporter.prototype.save=function save(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};Reporter.prototype.restore=function restore(e){var t=this._reporterState;t.obj=e.obj;t.path=t.path.slice(0,e.pathLen)};Reporter.prototype.enterKey=function enterKey(e){return this._reporterState.path.push(e)};Reporter.prototype.exitKey=function exitKey(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)};Reporter.prototype.leaveKey=function leaveKey(e,t,r){var i=this._reporterState;this.exitKey(e);if(i.obj!==null)i.obj[t]=r};Reporter.prototype.path=function path(){return this._reporterState.path.join("/")};Reporter.prototype.enterObject=function enterObject(){var e=this._reporterState;var t=e.obj;e.obj={};return t};Reporter.prototype.leaveObject=function leaveObject(e){var t=this._reporterState;var r=t.obj;t.obj=e;return r};Reporter.prototype.error=function error(e){var t;var r=this._reporterState;var i=e instanceof ReporterError;if(i){t=e}else{t=new ReporterError(r.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack)}if(!r.options.partial)throw t;if(!i)r.errors.push(t);return t};Reporter.prototype.wrapResult=function wrapResult(e){var t=this._reporterState;if(!t.options.partial)return e;return{result:this.isError(e)?null:e,errors:t.errors}};function ReporterError(e,t){this.path=e;this.rethrow(t)}i(ReporterError,Error);ReporterError.prototype.rethrow=function rethrow(e){this.message=e+" at: "+(this.path||"(shallow)");if(Error.captureStackTrace)Error.captureStackTrace(this,ReporterError);if(!this.stack){try{throw new Error(this.message)}catch(e){this.stack=e.stack}}return this}},9791:function(e,t,r){var i=r(7335);t.tagClass={0:"universal",1:"application",2:"context",3:"private"};t.tagClassByName=i._reverse(t.tagClass);t.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"};t.tagByName=i._reverse(t.tag)},7335:function(e,t,r){var i=t;i._reverse=function reverse(e){var t={};Object.keys(e).forEach((function(r){if((r|0)==r)r=r|0;var i=e[r];t[i]=r}));return t};i.der=r(9791)},2259:function(e,t,r){var i=r(3782);var n=r(7160);var a=n.base;var s=n.bignum;var o=n.constants.der;function DERDecoder(e){this.enc="der";this.name=e.name;this.entity=e;this.tree=new DERNode;this.tree._init(e.body)}e.exports=DERDecoder;DERDecoder.prototype.decode=function decode(e,t){if(!(e instanceof a.DecoderBuffer))e=new a.DecoderBuffer(e,t);return this.tree._decode(e,t)};function DERNode(e){a.Node.call(this,"der",e)}i(DERNode,a.Node);DERNode.prototype._peekTag=function peekTag(e,t,r){if(e.isEmpty())return false;var i=e.save();var n=derDecodeTag(e,'Failed to peek tag: "'+t+'"');if(e.isError(n))return n;e.restore(i);return n.tag===t||n.tagStr===t||n.tagStr+"of"===t||r};DERNode.prototype._decodeTag=function decodeTag(e,t,r){var i=derDecodeTag(e,'Failed to decode tag of "'+t+'"');if(e.isError(i))return i;var n=derDecodeLen(e,i.primitive,'Failed to get length of "'+t+'"');if(e.isError(n))return n;if(!r&&i.tag!==t&&i.tagStr!==t&&i.tagStr+"of"!==t){return e.error('Failed to match tag: "'+t+'"')}if(i.primitive||n!==null)return e.skip(n,'Failed to match body of: "'+t+'"');var a=e.save();var s=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');if(e.isError(s))return s;n=e.offset-a.offset;e.restore(a);return e.skip(n,'Failed to match body of: "'+t+'"')};DERNode.prototype._skipUntilEnd=function skipUntilEnd(e,t){while(true){var r=derDecodeTag(e,t);if(e.isError(r))return r;var i=derDecodeLen(e,r.primitive,t);if(e.isError(i))return i;var n;if(r.primitive||i!==null)n=e.skip(i);else n=this._skipUntilEnd(e,t);if(e.isError(n))return n;if(r.tagStr==="end")break}};DERNode.prototype._decodeList=function decodeList(e,t,r,i){var n=[];while(!e.isEmpty()){var a=this._peekTag(e,"end");if(e.isError(a))return a;var s=r.decode(e,"der",i);if(e.isError(s)&&a)break;n.push(s)}return n};DERNode.prototype._decodeStr=function decodeStr(e,t){if(t==="bitstr"){var r=e.readUInt8();if(e.isError(r))return r;return{unused:r,data:e.raw()}}else if(t==="bmpstr"){var i=e.raw();if(i.length%2===1)return e.error("Decoding of string type: bmpstr length mismatch");var n="";for(var a=0;a>6];var n=(r&32)===0;if((r&31)===31){var a=r;r=0;while((a&128)===128){a=e.readUInt8(t);if(e.isError(a))return a;r<<=7;r|=a&127}}else{r&=31}var s=o.tag[r];return{cls:i,primitive:n,tag:r,tagStr:s}}function derDecodeLen(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&i===128)return null;if((i&128)===0){return i}var n=i&127;if(n>4)return e.error("length octect is too long");i=0;for(var a=0;a=256;h>>=8)o++;var s=new n(1+1+o);s[0]=a;s[1]=128|o;for(var h=1+o,u=i.length;u>0;h--,u>>=8)s[h]=u&255;return this._createEncoderBuffer([s,i])};DERNode.prototype._encodeStr=function encodeStr(e,t){if(t==="bitstr"){return this._createEncoderBuffer([e.unused|0,e.data])}else if(t==="bmpstr"){var r=new n(e.length*2);for(var i=0;i=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,e[0]*40+e[1])}var a=0;for(var i=0;i=128;s>>=7)a++}var o=new n(a);var h=o.length-1;for(var i=e.length-1;i>=0;i--){var s=e[i];o[h--]=s&127;while((s>>=7)>0)o[h--]=128|s&127}return this._createEncoderBuffer(o)};function two(e){if(e<10)return"0"+e;else return e}DERNode.prototype._encodeTime=function encodeTime(e,t){var r;var i=new Date(e);if(t==="gentime"){r=[two(i.getFullYear()),two(i.getUTCMonth()+1),two(i.getUTCDate()),two(i.getUTCHours()),two(i.getUTCMinutes()),two(i.getUTCSeconds()),"Z"].join("")}else if(t==="utctime"){r=[two(i.getFullYear()%100),two(i.getUTCMonth()+1),two(i.getUTCDate()),two(i.getUTCHours()),two(i.getUTCMinutes()),two(i.getUTCSeconds()),"Z"].join("")}else{this.reporter.error("Encoding "+t+" time is not supported yet")}return this._encodeStr(r,"octstr")};DERNode.prototype._encodeNull=function encodeNull(){return this._createEncoderBuffer("")};DERNode.prototype._encodeInt=function encodeInt(e,t){if(typeof e==="string"){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e)){return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e))}e=t[e]}if(typeof e!=="number"&&!n.isBuffer(e)){var r=e.toArray();if(!e.sign&&r[0]&128){r.unshift(0)}e=new n(r)}if(n.isBuffer(e)){var i=e.length;if(e.length===0)i++;var a=new n(i);e.copy(a);if(e.length===0)a[0]=0;return this._createEncoderBuffer(a)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);var i=1;for(var s=e;s>=256;s>>=8)i++;var a=new Array(i);for(var s=a.length-1;s>=0;s--){a[s]=e&255;e>>=8}if(a[0]&128){a.unshift(0)}return this._createEncoderBuffer(new n(a))};DERNode.prototype._encodeBool=function encodeBool(e){return this._createEncoderBuffer(e?255:0)};DERNode.prototype._use=function use(e,t){if(typeof e==="function")e=e(t);return e._getEncoder("der").tree};DERNode.prototype._skipDefault=function skipDefault(e,t,r){var i=this._baseState;var n;if(i["default"]===null)return false;var a=e.join();if(i.defaultBuffer===undefined)i.defaultBuffer=this._encodeValue(i["default"],t,r).join();if(a.length!==i.defaultBuffer.length)return false;for(n=0;n=31)return i.error("Multi-octet tag encoding unsupported");if(!t)n|=32;n|=o.tagClassByName[r||"universal"]<<6;return n}},3418:function(e,t,r){var i=t;i.der=r(7804);i.pem=r(1564)},1564:function(e,t,r){var i=r(3782);var n=r(7804);function PEMEncoder(e){n.call(this,e);this.enc="pem"}i(PEMEncoder,n);e.exports=PEMEncoder;PEMEncoder.prototype.encode=function encode(e,t){var r=n.prototype.encode.call(this,e);var i=r.toString("base64");var a=["-----BEGIN "+t.label+"-----"];for(var s=0;s0)return e;return t};BN.min=function min(e,t){if(e.cmp(t)<0)return e;return t};BN.prototype._init=function init(e,t,r){if(typeof e==="number"){return this._initNumber(e,t,r)}if(typeof e==="object"){return this._initArray(e,t,r)}if(t==="hex"){t=16}assert(t===(t|0)&&t>=2&&t<=36);e=e.toString().replace(/\s+/g,"");var i=0;if(e[0]==="-"){i++}if(t===16){this._parseHex(e,i)}else{this._parseBase(e,t,i)}if(e[0]==="-"){this.negative=1}this.strip();if(r!=="le")return;this._initArray(this.toArray(),t,r)};BN.prototype._initNumber=function _initNumber(e,t,r){if(e<0){this.negative=1;e=-e}if(e<67108864){this.words=[e&67108863];this.length=1}else if(e<4503599627370496){this.words=[e&67108863,e/67108864&67108863];this.length=2}else{assert(e<9007199254740992);this.words=[e&67108863,e/67108864&67108863,1];this.length=3}if(r!=="le")return;this._initArray(this.toArray(),t,r)};BN.prototype._initArray=function _initArray(e,t,r){assert(typeof e.length==="number");if(e.length<=0){this.words=[0];this.length=1;return 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[n]|=a<>>26-s&67108863;s+=24;if(s>=26){s-=26;n++}}}else if(r==="le"){for(i=0,n=0;i>>26-s&67108863;s+=24;if(s>=26){s-=26;n++}}}return this.strip()};function parseHex(e,t,r){var i=0;var n=Math.min(e.length,r);for(var a=t;a=49&&s<=54){i|=s-49+10}else if(s>=17&&s<=22){i|=s-17+10}else{i|=s&15}}return i}BN.prototype._parseHex=function _parseHex(e,t){this.length=Math.ceil((e.length-t)/6);this.words=new Array(this.length);for(var r=0;r=t;r-=6){n=parseHex(e,r,r+6);this.words[i]|=n<>>26-a&4194303;a+=24;if(a>=26){a-=26;i++}}if(r+6!==t){n=parseHex(e,t,r+6);this.words[i]|=n<>>26-a&4194303}this.strip()};function parseBase(e,t,r,i){var n=0;var a=Math.min(e.length,r);for(var s=t;s=49){n+=o-49+10}else if(o>=17){n+=o-17+10}else{n+=o}}return n}BN.prototype._parseBase=function _parseBase(e,t,r){this.words=[0];this.length=1;for(var i=0,n=1;n<=67108863;n*=t){i++}i--;n=n/t|0;var a=e.length-r;var s=a%i;var o=Math.min(a,a-s)+r;var h=0;for(var u=r;u1&&this.words[this.length-1]===0){this.length--}return this._normSign()};BN.prototype._normSign=function _normSign(){if(this.length===1&&this.words[0]===0){this.negative=0}return this};BN.prototype.inspect=function inspect(){return(this.red?""};var n=["","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"];var a=[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];var s=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];BN.prototype.toString=function toString(e,t){e=e||10;t=t|0||1;var r;if(e===16||e==="hex"){r="";var i=0;var o=0;for(var h=0;h>>24-i&16777215;if(o!==0||h!==this.length-1){r=n[6-d.length]+d+r}else{r=d+r}i+=2;if(i>=26){i-=26;h--}}if(o!==0){r=o.toString(16)+r}while(r.length%t!==0){r="0"+r}if(this.negative!==0){r="-"+r}return r}if(e===(e|0)&&e>=2&&e<=36){var c=a[e];var l=s[e];r="";var p=this.clone();p.negative=0;while(!p.isZero()){var v=p.modn(l).toString(e);p=p.idivn(l);if(!p.isZero()){r=n[c-v.length]+v+r}else{r=v+r}}if(this.isZero()){r="0"+r}while(r.length%t!==0){r="0"+r}if(this.negative!==0){r="-"+r}return r}assert(false,"Base should be between 2 and 36")};BN.prototype.toNumber=function toNumber(){var e=this.words[0];if(this.length===2){e+=this.words[1]*67108864}else if(this.length===3&&this.words[2]===1){e+=4503599627370496+this.words[1]*67108864}else if(this.length>2){assert(false,"Number can only safely store up to 53 bits")}return this.negative!==0?-e:e};BN.prototype.toJSON=function toJSON(){return this.toString(16)};BN.prototype.toBuffer=function toBuffer(e,t){assert(typeof i!=="undefined");return this.toArrayLike(i,e,t)};BN.prototype.toArray=function toArray(e,t){return this.toArrayLike(Array,e,t)};BN.prototype.toArrayLike=function toArrayLike(e,t,r){var i=this.byteLength();var n=r||Math.max(1,i);assert(i<=n,"byte array longer than desired length");assert(n>0,"Requested array length <= 0");this.strip();var a=t==="le";var s=new e(n);var o,h;var u=this.clone();if(!a){for(h=0;h=4096){r+=13;t>>>=13}if(t>=64){r+=7;t>>>=7}if(t>=8){r+=4;t>>>=4}if(t>=2){r+=2;t>>>=2}return r+t}}BN.prototype._zeroBits=function _zeroBits(e){if(e===0)return 26;var t=e;var r=0;if((t&8191)===0){r+=13;t>>>=13}if((t&127)===0){r+=7;t>>>=7}if((t&15)===0){r+=4;t>>>=4}if((t&3)===0){r+=2;t>>>=2}if((t&1)===0){r++}return r};BN.prototype.bitLength=function bitLength(){var e=this.words[this.length-1];var t=this._countBits(e);return(this.length-1)*26+t};function toBitArray(e){var t=new Array(e.bitLength());for(var r=0;r>>n}return t}BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;var e=0;for(var t=0;te.length)return this.clone().ior(e);return e.clone().ior(this)};BN.prototype.uor=function uor(e){if(this.length>e.length)return this.clone().iuor(e);return e.clone().iuor(this)};BN.prototype.iuand=function iuand(e){var t;if(this.length>e.length){t=e}else{t=this}for(var r=0;re.length)return this.clone().iand(e);return e.clone().iand(this)};BN.prototype.uand=function uand(e){if(this.length>e.length)return this.clone().iuand(e);return e.clone().iuand(this)};BN.prototype.iuxor=function iuxor(e){var t;var r;if(this.length>e.length){t=this;r=e}else{t=e;r=this}for(var i=0;ie.length)return this.clone().ixor(e);return e.clone().ixor(this)};BN.prototype.uxor=function uxor(e){if(this.length>e.length)return this.clone().iuxor(e);return e.clone().iuxor(this)};BN.prototype.inotn=function inotn(e){assert(typeof e==="number"&&e>=0);var t=Math.ceil(e/26)|0;var r=e%26;this._expand(t);if(r>0){t--}for(var i=0;i0){this.words[i]=~this.words[i]&67108863>>26-r}return this.strip()};BN.prototype.notn=function notn(e){return this.clone().inotn(e)};BN.prototype.setn=function setn(e,t){assert(typeof e==="number"&&e>=0);var r=e/26|0;var i=e%26;this._expand(r+1);if(t){this.words[r]=this.words[r]|1<e.length){r=this;i=e}else{r=e;i=this}var n=0;for(var a=0;a>>26}for(;n!==0&&a>>26}this.length=r.length;if(n!==0){this.words[this.length]=n;this.length++}else if(r!==this){for(;ae.length)return this.clone().iadd(e);return e.clone().iadd(this)};BN.prototype.isub=function isub(e){if(e.negative!==0){e.negative=0;var t=this.iadd(e);e.negative=1;return t._normSign()}else if(this.negative!==0){this.negative=0;this.iadd(e);this.negative=1;return this._normSign()}var r=this.cmp(e);if(r===0){this.negative=0;this.length=1;this.words[0]=0;return this}var i,n;if(r>0){i=this;n=e}else{i=e;n=this}var a=0;for(var s=0;s>26;this.words[s]=t&67108863}for(;a!==0&&s>26;this.words[s]=t&67108863}if(a===0&&s>>26;var c=h&67108863;var l=Math.min(u,t.length-1);for(var p=Math.max(0,u-e.length+1);p<=l;p++){var v=u-p|0;n=e.words[v]|0;a=t.words[p]|0;s=n*a+c;d+=s/67108864|0;c=s&67108863}r.words[u]=c|0;h=d|0}if(h!==0){r.words[u]=h|0}else{r.length--}return r.strip()}var o=function comb10MulTo(e,t,r){var i=e.words;var n=t.words;var a=r.words;var s=0;var o;var h;var u;var d=i[0]|0;var c=d&8191;var l=d>>>13;var p=i[1]|0;var v=p&8191;var b=p>>>13;var m=i[2]|0;var y=m&8191;var g=m>>>13;var _=i[3]|0;var w=_&8191;var M=_>>>13;var B=i[4]|0;var E=B&8191;var k=B>>>13;var A=i[5]|0;var N=A&8191;var P=A>>>13;var x=i[6]|0;var I=x&8191;var C=x>>>13;var D=i[7]|0;var T=D&8191;var j=D>>>13;var q=i[8]|0;var O=q&8191;var H=q>>>13;var L=i[9]|0;var z=L&8191;var F=L>>>13;var U=n[0]|0;var W=U&8191;var V=U>>>13;var G=n[1]|0;var J=G&8191;var Z=G>>>13;var X=n[2]|0;var Y=X&8191;var $=X>>>13;var Q=n[3]|0;var ee=Q&8191;var te=Q>>>13;var re=n[4]|0;var ie=re&8191;var ne=re>>>13;var ae=n[5]|0;var fe=ae&8191;var se=ae>>>13;var oe=n[6]|0;var he=oe&8191;var ue=oe>>>13;var de=n[7]|0;var ce=de&8191;var le=de>>>13;var pe=n[8]|0;var ve=pe&8191;var be=pe>>>13;var me=n[9]|0;var ye=me&8191;var ge=me>>>13;r.negative=e.negative^t.negative;r.length=19;o=Math.imul(c,W);h=Math.imul(c,V);h=h+Math.imul(l,W)|0;u=Math.imul(l,V);var _e=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(_e>>>26)|0;_e&=67108863;o=Math.imul(v,W);h=Math.imul(v,V);h=h+Math.imul(b,W)|0;u=Math.imul(b,V);o=o+Math.imul(c,J)|0;h=h+Math.imul(c,Z)|0;h=h+Math.imul(l,J)|0;u=u+Math.imul(l,Z)|0;var we=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(we>>>26)|0;we&=67108863;o=Math.imul(y,W);h=Math.imul(y,V);h=h+Math.imul(g,W)|0;u=Math.imul(g,V);o=o+Math.imul(v,J)|0;h=h+Math.imul(v,Z)|0;h=h+Math.imul(b,J)|0;u=u+Math.imul(b,Z)|0;o=o+Math.imul(c,Y)|0;h=h+Math.imul(c,$)|0;h=h+Math.imul(l,Y)|0;u=u+Math.imul(l,$)|0;var Me=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Me>>>26)|0;Me&=67108863;o=Math.imul(w,W);h=Math.imul(w,V);h=h+Math.imul(M,W)|0;u=Math.imul(M,V);o=o+Math.imul(y,J)|0;h=h+Math.imul(y,Z)|0;h=h+Math.imul(g,J)|0;u=u+Math.imul(g,Z)|0;o=o+Math.imul(v,Y)|0;h=h+Math.imul(v,$)|0;h=h+Math.imul(b,Y)|0;u=u+Math.imul(b,$)|0;o=o+Math.imul(c,ee)|0;h=h+Math.imul(c,te)|0;h=h+Math.imul(l,ee)|0;u=u+Math.imul(l,te)|0;var Se=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Se>>>26)|0;Se&=67108863;o=Math.imul(E,W);h=Math.imul(E,V);h=h+Math.imul(k,W)|0;u=Math.imul(k,V);o=o+Math.imul(w,J)|0;h=h+Math.imul(w,Z)|0;h=h+Math.imul(M,J)|0;u=u+Math.imul(M,Z)|0;o=o+Math.imul(y,Y)|0;h=h+Math.imul(y,$)|0;h=h+Math.imul(g,Y)|0;u=u+Math.imul(g,$)|0;o=o+Math.imul(v,ee)|0;h=h+Math.imul(v,te)|0;h=h+Math.imul(b,ee)|0;u=u+Math.imul(b,te)|0;o=o+Math.imul(c,ie)|0;h=h+Math.imul(c,ne)|0;h=h+Math.imul(l,ie)|0;u=u+Math.imul(l,ne)|0;var Be=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Be>>>26)|0;Be&=67108863;o=Math.imul(N,W);h=Math.imul(N,V);h=h+Math.imul(P,W)|0;u=Math.imul(P,V);o=o+Math.imul(E,J)|0;h=h+Math.imul(E,Z)|0;h=h+Math.imul(k,J)|0;u=u+Math.imul(k,Z)|0;o=o+Math.imul(w,Y)|0;h=h+Math.imul(w,$)|0;h=h+Math.imul(M,Y)|0;u=u+Math.imul(M,$)|0;o=o+Math.imul(y,ee)|0;h=h+Math.imul(y,te)|0;h=h+Math.imul(g,ee)|0;u=u+Math.imul(g,te)|0;o=o+Math.imul(v,ie)|0;h=h+Math.imul(v,ne)|0;h=h+Math.imul(b,ie)|0;u=u+Math.imul(b,ne)|0;o=o+Math.imul(c,fe)|0;h=h+Math.imul(c,se)|0;h=h+Math.imul(l,fe)|0;u=u+Math.imul(l,se)|0;var Ee=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Ee>>>26)|0;Ee&=67108863;o=Math.imul(I,W);h=Math.imul(I,V);h=h+Math.imul(C,W)|0;u=Math.imul(C,V);o=o+Math.imul(N,J)|0;h=h+Math.imul(N,Z)|0;h=h+Math.imul(P,J)|0;u=u+Math.imul(P,Z)|0;o=o+Math.imul(E,Y)|0;h=h+Math.imul(E,$)|0;h=h+Math.imul(k,Y)|0;u=u+Math.imul(k,$)|0;o=o+Math.imul(w,ee)|0;h=h+Math.imul(w,te)|0;h=h+Math.imul(M,ee)|0;u=u+Math.imul(M,te)|0;o=o+Math.imul(y,ie)|0;h=h+Math.imul(y,ne)|0;h=h+Math.imul(g,ie)|0;u=u+Math.imul(g,ne)|0;o=o+Math.imul(v,fe)|0;h=h+Math.imul(v,se)|0;h=h+Math.imul(b,fe)|0;u=u+Math.imul(b,se)|0;o=o+Math.imul(c,he)|0;h=h+Math.imul(c,ue)|0;h=h+Math.imul(l,he)|0;u=u+Math.imul(l,ue)|0;var ke=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(ke>>>26)|0;ke&=67108863;o=Math.imul(T,W);h=Math.imul(T,V);h=h+Math.imul(j,W)|0;u=Math.imul(j,V);o=o+Math.imul(I,J)|0;h=h+Math.imul(I,Z)|0;h=h+Math.imul(C,J)|0;u=u+Math.imul(C,Z)|0;o=o+Math.imul(N,Y)|0;h=h+Math.imul(N,$)|0;h=h+Math.imul(P,Y)|0;u=u+Math.imul(P,$)|0;o=o+Math.imul(E,ee)|0;h=h+Math.imul(E,te)|0;h=h+Math.imul(k,ee)|0;u=u+Math.imul(k,te)|0;o=o+Math.imul(w,ie)|0;h=h+Math.imul(w,ne)|0;h=h+Math.imul(M,ie)|0;u=u+Math.imul(M,ne)|0;o=o+Math.imul(y,fe)|0;h=h+Math.imul(y,se)|0;h=h+Math.imul(g,fe)|0;u=u+Math.imul(g,se)|0;o=o+Math.imul(v,he)|0;h=h+Math.imul(v,ue)|0;h=h+Math.imul(b,he)|0;u=u+Math.imul(b,ue)|0;o=o+Math.imul(c,ce)|0;h=h+Math.imul(c,le)|0;h=h+Math.imul(l,ce)|0;u=u+Math.imul(l,le)|0;var Ae=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Ae>>>26)|0;Ae&=67108863;o=Math.imul(O,W);h=Math.imul(O,V);h=h+Math.imul(H,W)|0;u=Math.imul(H,V);o=o+Math.imul(T,J)|0;h=h+Math.imul(T,Z)|0;h=h+Math.imul(j,J)|0;u=u+Math.imul(j,Z)|0;o=o+Math.imul(I,Y)|0;h=h+Math.imul(I,$)|0;h=h+Math.imul(C,Y)|0;u=u+Math.imul(C,$)|0;o=o+Math.imul(N,ee)|0;h=h+Math.imul(N,te)|0;h=h+Math.imul(P,ee)|0;u=u+Math.imul(P,te)|0;o=o+Math.imul(E,ie)|0;h=h+Math.imul(E,ne)|0;h=h+Math.imul(k,ie)|0;u=u+Math.imul(k,ne)|0;o=o+Math.imul(w,fe)|0;h=h+Math.imul(w,se)|0;h=h+Math.imul(M,fe)|0;u=u+Math.imul(M,se)|0;o=o+Math.imul(y,he)|0;h=h+Math.imul(y,ue)|0;h=h+Math.imul(g,he)|0;u=u+Math.imul(g,ue)|0;o=o+Math.imul(v,ce)|0;h=h+Math.imul(v,le)|0;h=h+Math.imul(b,ce)|0;u=u+Math.imul(b,le)|0;o=o+Math.imul(c,ve)|0;h=h+Math.imul(c,be)|0;h=h+Math.imul(l,ve)|0;u=u+Math.imul(l,be)|0;var Ne=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Ne>>>26)|0;Ne&=67108863;o=Math.imul(z,W);h=Math.imul(z,V);h=h+Math.imul(F,W)|0;u=Math.imul(F,V);o=o+Math.imul(O,J)|0;h=h+Math.imul(O,Z)|0;h=h+Math.imul(H,J)|0;u=u+Math.imul(H,Z)|0;o=o+Math.imul(T,Y)|0;h=h+Math.imul(T,$)|0;h=h+Math.imul(j,Y)|0;u=u+Math.imul(j,$)|0;o=o+Math.imul(I,ee)|0;h=h+Math.imul(I,te)|0;h=h+Math.imul(C,ee)|0;u=u+Math.imul(C,te)|0;o=o+Math.imul(N,ie)|0;h=h+Math.imul(N,ne)|0;h=h+Math.imul(P,ie)|0;u=u+Math.imul(P,ne)|0;o=o+Math.imul(E,fe)|0;h=h+Math.imul(E,se)|0;h=h+Math.imul(k,fe)|0;u=u+Math.imul(k,se)|0;o=o+Math.imul(w,he)|0;h=h+Math.imul(w,ue)|0;h=h+Math.imul(M,he)|0;u=u+Math.imul(M,ue)|0;o=o+Math.imul(y,ce)|0;h=h+Math.imul(y,le)|0;h=h+Math.imul(g,ce)|0;u=u+Math.imul(g,le)|0;o=o+Math.imul(v,ve)|0;h=h+Math.imul(v,be)|0;h=h+Math.imul(b,ve)|0;u=u+Math.imul(b,be)|0;o=o+Math.imul(c,ye)|0;h=h+Math.imul(c,ge)|0;h=h+Math.imul(l,ye)|0;u=u+Math.imul(l,ge)|0;var Re=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Re>>>26)|0;Re&=67108863;o=Math.imul(z,J);h=Math.imul(z,Z);h=h+Math.imul(F,J)|0;u=Math.imul(F,Z);o=o+Math.imul(O,Y)|0;h=h+Math.imul(O,$)|0;h=h+Math.imul(H,Y)|0;u=u+Math.imul(H,$)|0;o=o+Math.imul(T,ee)|0;h=h+Math.imul(T,te)|0;h=h+Math.imul(j,ee)|0;u=u+Math.imul(j,te)|0;o=o+Math.imul(I,ie)|0;h=h+Math.imul(I,ne)|0;h=h+Math.imul(C,ie)|0;u=u+Math.imul(C,ne)|0;o=o+Math.imul(N,fe)|0;h=h+Math.imul(N,se)|0;h=h+Math.imul(P,fe)|0;u=u+Math.imul(P,se)|0;o=o+Math.imul(E,he)|0;h=h+Math.imul(E,ue)|0;h=h+Math.imul(k,he)|0;u=u+Math.imul(k,ue)|0;o=o+Math.imul(w,ce)|0;h=h+Math.imul(w,le)|0;h=h+Math.imul(M,ce)|0;u=u+Math.imul(M,le)|0;o=o+Math.imul(y,ve)|0;h=h+Math.imul(y,be)|0;h=h+Math.imul(g,ve)|0;u=u+Math.imul(g,be)|0;o=o+Math.imul(v,ye)|0;h=h+Math.imul(v,ge)|0;h=h+Math.imul(b,ye)|0;u=u+Math.imul(b,ge)|0;var Pe=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Pe>>>26)|0;Pe&=67108863;o=Math.imul(z,Y);h=Math.imul(z,$);h=h+Math.imul(F,Y)|0;u=Math.imul(F,$);o=o+Math.imul(O,ee)|0;h=h+Math.imul(O,te)|0;h=h+Math.imul(H,ee)|0;u=u+Math.imul(H,te)|0;o=o+Math.imul(T,ie)|0;h=h+Math.imul(T,ne)|0;h=h+Math.imul(j,ie)|0;u=u+Math.imul(j,ne)|0;o=o+Math.imul(I,fe)|0;h=h+Math.imul(I,se)|0;h=h+Math.imul(C,fe)|0;u=u+Math.imul(C,se)|0;o=o+Math.imul(N,he)|0;h=h+Math.imul(N,ue)|0;h=h+Math.imul(P,he)|0;u=u+Math.imul(P,ue)|0;o=o+Math.imul(E,ce)|0;h=h+Math.imul(E,le)|0;h=h+Math.imul(k,ce)|0;u=u+Math.imul(k,le)|0;o=o+Math.imul(w,ve)|0;h=h+Math.imul(w,be)|0;h=h+Math.imul(M,ve)|0;u=u+Math.imul(M,be)|0;o=o+Math.imul(y,ye)|0;h=h+Math.imul(y,ge)|0;h=h+Math.imul(g,ye)|0;u=u+Math.imul(g,ge)|0;var xe=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(xe>>>26)|0;xe&=67108863;o=Math.imul(z,ee);h=Math.imul(z,te);h=h+Math.imul(F,ee)|0;u=Math.imul(F,te);o=o+Math.imul(O,ie)|0;h=h+Math.imul(O,ne)|0;h=h+Math.imul(H,ie)|0;u=u+Math.imul(H,ne)|0;o=o+Math.imul(T,fe)|0;h=h+Math.imul(T,se)|0;h=h+Math.imul(j,fe)|0;u=u+Math.imul(j,se)|0;o=o+Math.imul(I,he)|0;h=h+Math.imul(I,ue)|0;h=h+Math.imul(C,he)|0;u=u+Math.imul(C,ue)|0;o=o+Math.imul(N,ce)|0;h=h+Math.imul(N,le)|0;h=h+Math.imul(P,ce)|0;u=u+Math.imul(P,le)|0;o=o+Math.imul(E,ve)|0;h=h+Math.imul(E,be)|0;h=h+Math.imul(k,ve)|0;u=u+Math.imul(k,be)|0;o=o+Math.imul(w,ye)|0;h=h+Math.imul(w,ge)|0;h=h+Math.imul(M,ye)|0;u=u+Math.imul(M,ge)|0;var Ie=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Ie>>>26)|0;Ie&=67108863;o=Math.imul(z,ie);h=Math.imul(z,ne);h=h+Math.imul(F,ie)|0;u=Math.imul(F,ne);o=o+Math.imul(O,fe)|0;h=h+Math.imul(O,se)|0;h=h+Math.imul(H,fe)|0;u=u+Math.imul(H,se)|0;o=o+Math.imul(T,he)|0;h=h+Math.imul(T,ue)|0;h=h+Math.imul(j,he)|0;u=u+Math.imul(j,ue)|0;o=o+Math.imul(I,ce)|0;h=h+Math.imul(I,le)|0;h=h+Math.imul(C,ce)|0;u=u+Math.imul(C,le)|0;o=o+Math.imul(N,ve)|0;h=h+Math.imul(N,be)|0;h=h+Math.imul(P,ve)|0;u=u+Math.imul(P,be)|0;o=o+Math.imul(E,ye)|0;h=h+Math.imul(E,ge)|0;h=h+Math.imul(k,ye)|0;u=u+Math.imul(k,ge)|0;var Ce=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Ce>>>26)|0;Ce&=67108863;o=Math.imul(z,fe);h=Math.imul(z,se);h=h+Math.imul(F,fe)|0;u=Math.imul(F,se);o=o+Math.imul(O,he)|0;h=h+Math.imul(O,ue)|0;h=h+Math.imul(H,he)|0;u=u+Math.imul(H,ue)|0;o=o+Math.imul(T,ce)|0;h=h+Math.imul(T,le)|0;h=h+Math.imul(j,ce)|0;u=u+Math.imul(j,le)|0;o=o+Math.imul(I,ve)|0;h=h+Math.imul(I,be)|0;h=h+Math.imul(C,ve)|0;u=u+Math.imul(C,be)|0;o=o+Math.imul(N,ye)|0;h=h+Math.imul(N,ge)|0;h=h+Math.imul(P,ye)|0;u=u+Math.imul(P,ge)|0;var De=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(De>>>26)|0;De&=67108863;o=Math.imul(z,he);h=Math.imul(z,ue);h=h+Math.imul(F,he)|0;u=Math.imul(F,ue);o=o+Math.imul(O,ce)|0;h=h+Math.imul(O,le)|0;h=h+Math.imul(H,ce)|0;u=u+Math.imul(H,le)|0;o=o+Math.imul(T,ve)|0;h=h+Math.imul(T,be)|0;h=h+Math.imul(j,ve)|0;u=u+Math.imul(j,be)|0;o=o+Math.imul(I,ye)|0;h=h+Math.imul(I,ge)|0;h=h+Math.imul(C,ye)|0;u=u+Math.imul(C,ge)|0;var Te=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Te>>>26)|0;Te&=67108863;o=Math.imul(z,ce);h=Math.imul(z,le);h=h+Math.imul(F,ce)|0;u=Math.imul(F,le);o=o+Math.imul(O,ve)|0;h=h+Math.imul(O,be)|0;h=h+Math.imul(H,ve)|0;u=u+Math.imul(H,be)|0;o=o+Math.imul(T,ye)|0;h=h+Math.imul(T,ge)|0;h=h+Math.imul(j,ye)|0;u=u+Math.imul(j,ge)|0;var je=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(je>>>26)|0;je&=67108863;o=Math.imul(z,ve);h=Math.imul(z,be);h=h+Math.imul(F,ve)|0;u=Math.imul(F,be);o=o+Math.imul(O,ye)|0;h=h+Math.imul(O,ge)|0;h=h+Math.imul(H,ye)|0;u=u+Math.imul(H,ge)|0;var qe=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(qe>>>26)|0;qe&=67108863;o=Math.imul(z,ye);h=Math.imul(z,ge);h=h+Math.imul(F,ye)|0;u=Math.imul(F,ge);var Oe=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Oe>>>26)|0;Oe&=67108863;a[0]=_e;a[1]=we;a[2]=Me;a[3]=Se;a[4]=Be;a[5]=Ee;a[6]=ke;a[7]=Ae;a[8]=Ne;a[9]=Re;a[10]=Pe;a[11]=xe;a[12]=Ie;a[13]=Ce;a[14]=De;a[15]=Te;a[16]=je;a[17]=qe;a[18]=Oe;if(s!==0){a[19]=s;r.length++}return r};if(!Math.imul){o=smallMulTo}function bigMulTo(e,t,r){r.negative=t.negative^e.negative;r.length=e.length+t.length;var i=0;var n=0;for(var a=0;a>>26)|0;n+=s>>>26;s&=67108863}r.words[a]=o;i=s;s=n}if(i!==0){r.words[a]=i}else{r.length--}return r.strip()}function jumboMulTo(e,t,r){var i=new FFTM;return i.mulp(e,t,r)}BN.prototype.mulTo=function mulTo(e,t){var r;var i=this.length+e.length;if(this.length===10&&e.length===10){r=o(this,e,t)}else if(i<63){r=smallMulTo(this,e,t)}else if(i<1024){r=bigMulTo(this,e,t)}else{r=jumboMulTo(this,e,t)}return r};function FFTM(e,t){this.x=e;this.y=t}FFTM.prototype.makeRBT=function makeRBT(e){var t=new Array(e);var r=BN.prototype._countBits(e)-1;for(var i=0;i>=1}return i};FFTM.prototype.permute=function permute(e,t,r,i,n,a){for(var s=0;s>>1){n++}return 1<>>13;r[2*a+1]=n&8191;n=n>>>13}for(a=2*t;a>=26;t+=i/67108864|0;t+=n>>>26;this.words[r]=n&67108863}if(t!==0){this.words[r]=t;this.length++}return this};BN.prototype.muln=function muln(e){return this.clone().imuln(e)};BN.prototype.sqr=function sqr(){return this.mul(this)};BN.prototype.isqr=function isqr(){return this.imul(this.clone())};BN.prototype.pow=function pow(e){var t=toBitArray(e);if(t.length===0)return new BN(1);var r=this;for(var i=0;i=0);var t=e%26;var r=(e-t)/26;var i=67108863>>>26-t<<26-t;var n;if(t!==0){var a=0;for(n=0;n>>26-t}if(a){this.words[n]=a;this.length++}}if(r!==0){for(n=this.length-1;n>=0;n--){this.words[n+r]=this.words[n]}for(n=0;n=0);var i;if(t){i=(t-t%26)/26}else{i=0}var n=e%26;var a=Math.min((e-n)/26,this.length);var s=67108863^67108863>>>n<a){this.length-=a;for(h=0;h=0&&(u!==0||h>=i);h--){var d=this.words[h]|0;this.words[h]=u<<26-n|d>>>n;u=d&s}if(o&&u!==0){o.words[o.length++]=u}if(this.length===0){this.words[0]=0;this.length=1}return this.strip()};BN.prototype.ishrn=function ishrn(e,t,r){assert(this.negative===0);return this.iushrn(e,t,r)};BN.prototype.shln=function shln(e){return this.clone().ishln(e)};BN.prototype.ushln=function ushln(e){return this.clone().iushln(e)};BN.prototype.shrn=function shrn(e){return this.clone().ishrn(e)};BN.prototype.ushrn=function ushrn(e){return this.clone().iushrn(e)};BN.prototype.testn=function testn(e){assert(typeof e==="number"&&e>=0);var t=e%26;var r=(e-t)/26;var i=1<=0);var t=e%26;var r=(e-t)/26;assert(this.negative===0,"imaskn works only with positive numbers");if(this.length<=r){return this}if(t!==0){r++}this.length=Math.min(r,this.length);if(t!==0){var i=67108863^67108863>>>t<=67108864;t++){this.words[t]-=67108864;if(t===this.length-1){this.words[t+1]=1}else{this.words[t+1]++}}this.length=Math.max(this.length,t+1);return this};BN.prototype.isubn=function isubn(e){assert(typeof e==="number");assert(e<67108864);if(e<0)return this.iaddn(-e);if(this.negative!==0){this.negative=0;this.iaddn(e);this.negative=1;return this}this.words[0]-=e;if(this.length===1&&this.words[0]<0){this.words[0]=-this.words[0];this.negative=1}else{for(var t=0;t>26)-(o/67108864|0);this.words[n+r]=a&67108863}for(;n>26;this.words[n+r]=a&67108863}if(s===0)return this.strip();assert(s===-1);s=0;for(n=0;n>26;this.words[n]=a&67108863}this.negative=1;return this.strip()};BN.prototype._wordDiv=function _wordDiv(e,t){var r=this.length-e.length;var i=this.clone();var n=e;var a=n.words[n.length-1]|0;var s=this._countBits(a);r=26-s;if(r!==0){n=n.ushln(r);i.iushln(r);a=n.words[n.length-1]|0}var o=i.length-n.length;var h;if(t!=="mod"){h=new BN(null);h.length=o+1;h.words=new Array(h.length);for(var u=0;u=0;c--){var l=(i.words[n.length+c]|0)*67108864+(i.words[n.length+c-1]|0);l=Math.min(l/a|0,67108863);i._ishlnsubmul(n,l,c);while(i.negative!==0){l--;i.negative=0;i._ishlnsubmul(n,1,c);if(!i.isZero()){i.negative^=1}}if(h){h.words[c]=l}}if(h){h.strip()}i.strip();if(t!=="div"&&r!==0){i.iushrn(r)}return{div:h||null,mod:i}};BN.prototype.divmod=function divmod(e,t,r){assert(!e.isZero());if(this.isZero()){return{div:new BN(0),mod:new BN(0)}}var i,n,a;if(this.negative!==0&&e.negative===0){a=this.neg().divmod(e,t);if(t!=="mod"){i=a.div.neg()}if(t!=="div"){n=a.mod.neg();if(r&&n.negative!==0){n.iadd(e)}}return{div:i,mod:n}}if(this.negative===0&&e.negative!==0){a=this.divmod(e.neg(),t);if(t!=="mod"){i=a.div.neg()}return{div:i,mod:a.mod}}if((this.negative&e.negative)!==0){a=this.neg().divmod(e.neg(),t);if(t!=="div"){n=a.mod.neg();if(r&&n.negative!==0){n.isub(e)}}return{div:a.div,mod:n}}if(e.length>this.length||this.cmp(e)<0){return{div:new BN(0),mod:this}}if(e.length===1){if(t==="div"){return{div:this.divn(e.words[0]),mod:null}}if(t==="mod"){return{div:null,mod:new BN(this.modn(e.words[0]))}}return{div:this.divn(e.words[0]),mod:new BN(this.modn(e.words[0]))}}return this._wordDiv(e,t)};BN.prototype.div=function div(e){return this.divmod(e,"div",false).div};BN.prototype.mod=function mod(e){return this.divmod(e,"mod",false).mod};BN.prototype.umod=function umod(e){return this.divmod(e,"mod",true).mod};BN.prototype.divRound=function divRound(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=t.div.negative!==0?t.mod.isub(e):t.mod;var i=e.ushrn(1);var n=e.andln(1);var a=r.cmp(i);if(a<0||n===1&&a===0)return t.div;return t.div.negative!==0?t.div.isubn(1):t.div.iaddn(1)};BN.prototype.modn=function modn(e){assert(e<=67108863);var t=(1<<26)%e;var r=0;for(var i=this.length-1;i>=0;i--){r=(t*r+(this.words[i]|0))%e}return r};BN.prototype.idivn=function idivn(e){assert(e<=67108863);var t=0;for(var r=this.length-1;r>=0;r--){var i=(this.words[r]|0)+t*67108864;this.words[r]=i/e|0;t=i%e}return this.strip()};BN.prototype.divn=function divn(e){return this.clone().idivn(e)};BN.prototype.egcd=function egcd(e){assert(e.negative===0);assert(!e.isZero());var t=this;var r=e.clone();if(t.negative!==0){t=t.umod(e)}else{t=t.clone()}var i=new BN(1);var n=new BN(0);var a=new BN(0);var s=new BN(1);var o=0;while(t.isEven()&&r.isEven()){t.iushrn(1);r.iushrn(1);++o}var h=r.clone();var u=t.clone();while(!t.isZero()){for(var d=0,c=1;(t.words[0]&c)===0&&d<26;++d,c<<=1);if(d>0){t.iushrn(d);while(d-- >0){if(i.isOdd()||n.isOdd()){i.iadd(h);n.isub(u)}i.iushrn(1);n.iushrn(1)}}for(var l=0,p=1;(r.words[0]&p)===0&&l<26;++l,p<<=1);if(l>0){r.iushrn(l);while(l-- >0){if(a.isOdd()||s.isOdd()){a.iadd(h);s.isub(u)}a.iushrn(1);s.iushrn(1)}}if(t.cmp(r)>=0){t.isub(r);i.isub(a);n.isub(s)}else{r.isub(t);a.isub(i);s.isub(n)}}return{a:a,b:s,gcd:r.iushln(o)}};BN.prototype._invmp=function _invmp(e){assert(e.negative===0);assert(!e.isZero());var t=this;var r=e.clone();if(t.negative!==0){t=t.umod(e)}else{t=t.clone()}var i=new BN(1);var n=new BN(0);var a=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var s=0,o=1;(t.words[0]&o)===0&&s<26;++s,o<<=1);if(s>0){t.iushrn(s);while(s-- >0){if(i.isOdd()){i.iadd(a)}i.iushrn(1)}}for(var h=0,u=1;(r.words[0]&u)===0&&h<26;++h,u<<=1);if(h>0){r.iushrn(h);while(h-- >0){if(n.isOdd()){n.iadd(a)}n.iushrn(1)}}if(t.cmp(r)>=0){t.isub(r);i.isub(n)}else{r.isub(t);n.isub(i)}}var d;if(t.cmpn(1)===0){d=i}else{d=n}if(d.cmpn(0)<0){d.iadd(e)}return d};BN.prototype.gcd=function gcd(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone();var r=e.clone();t.negative=0;r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++){t.iushrn(1);r.iushrn(1)}do{while(t.isEven()){t.iushrn(1)}while(r.isEven()){r.iushrn(1)}var n=t.cmp(r);if(n<0){var a=t;t=r;r=a}else if(n===0||r.cmpn(1)===0){break}t.isub(r)}while(true);return r.iushln(i)};BN.prototype.invm=function invm(e){return this.egcd(e).a.umod(e)};BN.prototype.isEven=function isEven(){return(this.words[0]&1)===0};BN.prototype.isOdd=function isOdd(){return(this.words[0]&1)===1};BN.prototype.andln=function andln(e){return this.words[0]&e};BN.prototype.bincn=function bincn(e){assert(typeof e==="number");var t=e%26;var r=(e-t)/26;var i=1<>>26;s&=67108863;this.words[a]=s}if(n!==0){this.words[a]=n;this.length++}return this};BN.prototype.isZero=function isZero(){return this.length===1&&this.words[0]===0};BN.prototype.cmpn=function cmpn(e){var t=e<0;if(this.negative!==0&&!t)return-1;if(this.negative===0&&t)return 1;this.strip();var r;if(this.length>1){r=1}else{if(t){e=-e}assert(e<=67108863,"Number is too big");var i=this.words[0]|0;r=i===e?0:ie.length)return 1;if(this.length=0;r--){var i=this.words[r]|0;var n=e.words[r]|0;if(i===n)continue;if(in){t=1}break}return t};BN.prototype.gtn=function gtn(e){return this.cmpn(e)===1};BN.prototype.gt=function gt(e){return this.cmp(e)===1};BN.prototype.gten=function gten(e){return this.cmpn(e)>=0};BN.prototype.gte=function gte(e){return this.cmp(e)>=0};BN.prototype.ltn=function ltn(e){return this.cmpn(e)===-1};BN.prototype.lt=function lt(e){return this.cmp(e)===-1};BN.prototype.lten=function lten(e){return this.cmpn(e)<=0};BN.prototype.lte=function lte(e){return this.cmp(e)<=0};BN.prototype.eqn=function eqn(e){return this.cmpn(e)===0};BN.prototype.eq=function eq(e){return this.cmp(e)===0};BN.red=function red(e){return new Red(e)};BN.prototype.toRed=function toRed(e){assert(!this.red,"Already a number in reduction context");assert(this.negative===0,"red works only with positives");return e.convertTo(this)._forceRed(e)};BN.prototype.fromRed=function fromRed(){assert(this.red,"fromRed works only with numbers in reduction context");return this.red.convertFrom(this)};BN.prototype._forceRed=function _forceRed(e){this.red=e;return this};BN.prototype.forceRed=function forceRed(e){assert(!this.red,"Already a number in reduction context");return this._forceRed(e)};BN.prototype.redAdd=function redAdd(e){assert(this.red,"redAdd works only with red numbers");return this.red.add(this,e)};BN.prototype.redIAdd=function redIAdd(e){assert(this.red,"redIAdd works only with red numbers");return this.red.iadd(this,e)};BN.prototype.redSub=function redSub(e){assert(this.red,"redSub works only with red numbers");return this.red.sub(this,e)};BN.prototype.redISub=function redISub(e){assert(this.red,"redISub works only with red numbers");return this.red.isub(this,e)};BN.prototype.redShl=function redShl(e){assert(this.red,"redShl works only with red numbers");return this.red.shl(this,e)};BN.prototype.redMul=function redMul(e){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,e);return this.red.mul(this,e)};BN.prototype.redIMul=function redIMul(e){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,e);return this.red.imul(this,e)};BN.prototype.redSqr=function redSqr(){assert(this.red,"redSqr works only with red numbers");this.red._verify1(this);return this.red.sqr(this)};BN.prototype.redISqr=function redISqr(){assert(this.red,"redISqr works only with red numbers");this.red._verify1(this);return this.red.isqr(this)};BN.prototype.redSqrt=function redSqrt(){assert(this.red,"redSqrt works only with red numbers");this.red._verify1(this);return this.red.sqrt(this)};BN.prototype.redInvm=function redInvm(){assert(this.red,"redInvm works only with red numbers");this.red._verify1(this);return this.red.invm(this)};BN.prototype.redNeg=function redNeg(){assert(this.red,"redNeg works only with red numbers");this.red._verify1(this);return this.red.neg(this)};BN.prototype.redPow=function redPow(e){assert(this.red&&!e.red,"redPow(normalNum)");this.red._verify1(this);return this.red.pow(this,e)};var h={k256:null,p224:null,p192:null,p25519:null};function MPrime(e,t){this.name=e;this.p=new BN(t,16);this.n=this.p.bitLength();this.k=new BN(1).iushln(this.n).isub(this.p);this.tmp=this._tmp()}MPrime.prototype._tmp=function _tmp(){var e=new BN(null);e.words=new Array(Math.ceil(this.n/13));return e};MPrime.prototype.ireduce=function ireduce(e){var t=e;var r;do{this.split(t,this.tmp);t=this.imulK(t);t=t.iadd(this.tmp);r=t.bitLength()}while(r>this.n);var i=r0){t.isub(this.p)}else{if(t.strip!==undefined){t.strip()}else{t._strip()}}return t};MPrime.prototype.split=function split(e,t){e.iushrn(this.n,0,t)};MPrime.prototype.imulK=function imulK(e){return e.imul(this.k)};function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}inherits(K256,MPrime);K256.prototype.split=function split(e,t){var r=4194303;var i=Math.min(e.length,9);for(var n=0;n>>22;a=s}a>>>=22;e.words[n-10]=a;if(a===0&&e.length>10){e.length-=10}else{e.length-=9}};K256.prototype.imulK=function imulK(e){e.words[e.length]=0;e.words[e.length+1]=0;e.length+=2;var t=0;for(var r=0;r>>=26;e.words[r]=n;t=i}if(t!==0){e.words[e.length++]=t}return e};BN._prime=function prime(e){if(h[e])return h[e];var prime;if(e==="k256"){prime=new K256}else if(e==="p224"){prime=new P224}else if(e==="p192"){prime=new P192}else if(e==="p25519"){prime=new P25519}else{throw new Error("Unknown prime "+e)}h[e]=prime;return prime};function Red(e){if(typeof e==="string"){var t=BN._prime(e);this.m=t.p;this.prime=t}else{assert(e.gtn(1),"modulus must be greater than 1");this.m=e;this.prime=null}}Red.prototype._verify1=function _verify1(e){assert(e.negative===0,"red works only with positives");assert(e.red,"red works only with red numbers")};Red.prototype._verify2=function _verify2(e,t){assert((e.negative|t.negative)===0,"red works only with positives");assert(e.red&&e.red===t.red,"red works only with red numbers")};Red.prototype.imod=function imod(e){if(this.prime)return this.prime.ireduce(e)._forceRed(this);return e.umod(this.m)._forceRed(this)};Red.prototype.neg=function neg(e){if(e.isZero()){return e.clone()}return this.m.sub(e)._forceRed(this)};Red.prototype.add=function add(e,t){this._verify2(e,t);var r=e.add(t);if(r.cmp(this.m)>=0){r.isub(this.m)}return r._forceRed(this)};Red.prototype.iadd=function iadd(e,t){this._verify2(e,t);var r=e.iadd(t);if(r.cmp(this.m)>=0){r.isub(this.m)}return r};Red.prototype.sub=function sub(e,t){this._verify2(e,t);var r=e.sub(t);if(r.cmpn(0)<0){r.iadd(this.m)}return r._forceRed(this)};Red.prototype.isub=function isub(e,t){this._verify2(e,t);var r=e.isub(t);if(r.cmpn(0)<0){r.iadd(this.m)}return r};Red.prototype.shl=function shl(e,t){this._verify1(e);return this.imod(e.ushln(t))};Red.prototype.imul=function imul(e,t){this._verify2(e,t);return this.imod(e.imul(t))};Red.prototype.mul=function mul(e,t){this._verify2(e,t);return this.imod(e.mul(t))};Red.prototype.isqr=function isqr(e){return this.imul(e,e.clone())};Red.prototype.sqr=function sqr(e){return this.mul(e,e)};Red.prototype.sqrt=function sqrt(e){if(e.isZero())return e.clone();var t=this.m.andln(3);assert(t%2===1);if(t===3){var r=this.m.add(new BN(1)).iushrn(2);return this.pow(e,r)}var i=this.m.subn(1);var n=0;while(!i.isZero()&&i.andln(1)===0){n++;i.iushrn(1)}assert(!i.isZero());var a=new BN(1).toRed(this);var s=a.redNeg();var o=this.m.subn(1).iushrn(1);var h=this.m.bitLength();h=new BN(2*h*h).toRed(this);while(this.pow(h,o).cmp(s)!==0){h.redIAdd(s)}var u=this.pow(h,i);var d=this.pow(e,i.addn(1).iushrn(1));var c=this.pow(e,i);var l=n;while(c.cmp(a)!==0){var p=c;for(var v=0;p.cmp(a)!==0;v++){p=p.redSqr()}assert(v=0;n--){var u=t.words[n];for(var d=h-1;d>=0;d--){var c=u>>d&1;if(a!==i[0]){a=this.sqr(a)}if(c===0&&s===0){o=0;continue}s<<=1;s|=c;o++;if(o!==r&&(n!==0||d!==0))continue;a=this.mul(a,i[s]);o=0;s=0}h=26}return a};Red.prototype.convertTo=function convertTo(e){var t=e.umod(this.m);return t===e?t.clone():t};Red.prototype.convertFrom=function convertFrom(e){var t=e.clone();t.red=null;return t};BN.mont=function mont(e){return new Mont(e)};function Mont(e){Red.call(this,e);this.shift=this.m.bitLength();if(this.shift%26!==0){this.shift+=26-this.shift%26}this.r=new BN(1).iushln(this.shift);this.r2=this.imod(this.r.sqr());this.rinv=this.r._invmp(this.m);this.minv=this.rinv.mul(this.r).isubn(1).div(this.m);this.minv=this.minv.umod(this.r);this.minv=this.r.sub(this.minv)}inherits(Mont,Red);Mont.prototype.convertTo=function convertTo(e){return this.imod(e.ushln(this.shift))};Mont.prototype.convertFrom=function convertFrom(e){var t=this.imod(e.mul(this.rinv));t.red=null;return t};Mont.prototype.imul=function imul(e,t){if(e.isZero()||t.isZero()){e.words[0]=0;e.length=1;return e}var r=e.imul(t);var i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var n=r.isub(i).iushrn(this.shift);var a=n;if(n.cmp(this.m)>=0){a=n.isub(this.m)}else if(n.cmpn(0)<0){a=n.iadd(this.m)}return a._forceRed(this)};Mont.prototype.mul=function mul(e,t){if(e.isZero()||t.isZero())return new BN(0)._forceRed(this);var r=e.mul(t);var i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var n=r.isub(i).iushrn(this.shift);var a=n;if(n.cmp(this.m)>=0){a=n.isub(this.m)}else if(n.cmpn(0)<0){a=n.iadd(this.m)}return a._forceRed(this)};Mont.prototype.invm=function invm(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}})( false||e,this)},1670:function(e,t,r){e=r.nmd(e);(function(e,t){"use strict";function assert(e,t){if(!e)throw new Error(t||"Assertion failed")}function inherits(e,t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype;e.prototype=new TempCtor;e.prototype.constructor=e}function BN(e,t,r){if(BN.isBN(e)){return e}this.negative=0;this.words=null;this.length=0;this.red=null;if(e!==null){if(t==="le"||t==="be"){r=t;t=10}this._init(e||0,t||10,r||"be")}}if(typeof e==="object"){e.exports=BN}else{t.BN=BN}BN.BN=BN;BN.wordSize=26;var i;try{i=r(4300).Buffer}catch(e){}BN.isBN=function isBN(e){if(e instanceof BN){return true}return e!==null&&typeof e==="object"&&e.constructor.wordSize===BN.wordSize&&Array.isArray(e.words)};BN.max=function max(e,t){if(e.cmp(t)>0)return e;return t};BN.min=function min(e,t){if(e.cmp(t)<0)return e;return t};BN.prototype._init=function init(e,t,r){if(typeof e==="number"){return this._initNumber(e,t,r)}if(typeof e==="object"){return this._initArray(e,t,r)}if(t==="hex"){t=16}assert(t===(t|0)&&t>=2&&t<=36);e=e.toString().replace(/\s+/g,"");var i=0;if(e[0]==="-"){i++}if(t===16){this._parseHex(e,i)}else{this._parseBase(e,t,i)}if(e[0]==="-"){this.negative=1}this._strip();if(r!=="le")return;this._initArray(this.toArray(),t,r)};BN.prototype._initNumber=function _initNumber(e,t,r){if(e<0){this.negative=1;e=-e}if(e<67108864){this.words=[e&67108863];this.length=1}else if(e<4503599627370496){this.words=[e&67108863,e/67108864&67108863];this.length=2}else{assert(e<9007199254740992);this.words=[e&67108863,e/67108864&67108863,1];this.length=3}if(r!=="le")return;this._initArray(this.toArray(),t,r)};BN.prototype._initArray=function _initArray(e,t,r){assert(typeof e.length==="number");if(e.length<=0){this.words=[0];this.length=1;return 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[n]|=a<>>26-s&67108863;s+=24;if(s>=26){s-=26;n++}}}else if(r==="le"){for(i=0,n=0;i>>26-s&67108863;s+=24;if(s>=26){s-=26;n++}}}return this._strip()};function parseHex(e,t,r){var i=0;var n=Math.min(e.length,r);var a=0;for(var s=t;s=49&&o<=54){h=o-49+10}else if(o>=17&&o<=22){h=o-17+10}else{h=o}i|=h;a|=h}assert(!(a&240),"Invalid character in "+e);return i}BN.prototype._parseHex=function _parseHex(e,t){this.length=Math.ceil((e.length-t)/6);this.words=new Array(this.length);for(var r=0;r=t;r-=6){n=parseHex(e,r,r+6);this.words[i]|=n<>>26-a&4194303;a+=24;if(a>=26){a-=26;i++}}if(r+6!==t){n=parseHex(e,t,r+6);this.words[i]|=n<>>26-a&4194303}this._strip()};function parseBase(e,t,r,i){var n=0;var a=0;var s=Math.min(e.length,r);for(var o=t;o=49){a=h-49+10}else if(h>=17){a=h-17+10}else{a=h}assert(h>=0&&a1&&this.words[this.length-1]===0){this.length--}return this._normSign()};BN.prototype._normSign=function _normSign(){if(this.length===1&&this.words[0]===0){this.negative=0}return this};if(typeof Symbol!=="undefined"&&typeof Symbol.for==="function"){BN.prototype[Symbol.for("nodejs.util.inspect.custom")]=inspect}else{BN.prototype.inspect=inspect}function inspect(){return(this.red?""}var n=["","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"];var a=[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];var s=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];BN.prototype.toString=function toString(e,t){e=e||10;t=t|0||1;var r;if(e===16||e==="hex"){r="";var i=0;var o=0;for(var h=0;h>>24-i&16777215;if(o!==0||h!==this.length-1){r=n[6-d.length]+d+r}else{r=d+r}i+=2;if(i>=26){i-=26;h--}}if(o!==0){r=o.toString(16)+r}while(r.length%t!==0){r="0"+r}if(this.negative!==0){r="-"+r}return r}if(e===(e|0)&&e>=2&&e<=36){var c=a[e];var l=s[e];r="";var p=this.clone();p.negative=0;while(!p.isZero()){var v=p.modrn(l).toString(e);p=p.idivn(l);if(!p.isZero()){r=n[c-v.length]+v+r}else{r=v+r}}if(this.isZero()){r="0"+r}while(r.length%t!==0){r="0"+r}if(this.negative!==0){r="-"+r}return r}assert(false,"Base should be between 2 and 36")};BN.prototype.toNumber=function toNumber(){var e=this.words[0];if(this.length===2){e+=this.words[1]*67108864}else if(this.length===3&&this.words[2]===1){e+=4503599627370496+this.words[1]*67108864}else if(this.length>2){assert(false,"Number can only safely store up to 53 bits")}return this.negative!==0?-e:e};BN.prototype.toJSON=function toJSON(){return this.toString(16,2)};if(i){BN.prototype.toBuffer=function toBuffer(e,t){return this.toArrayLike(i,e,t)}}BN.prototype.toArray=function toArray(e,t){return this.toArrayLike(Array,e,t)};var o=function allocate(e,t){if(e.allocUnsafe){return e.allocUnsafe(t)}return new e(t)};BN.prototype.toArrayLike=function toArrayLike(e,t,r){this._strip();var i=this.byteLength();var n=r||Math.max(1,i);assert(i<=n,"byte array longer than desired length");assert(n>0,"Requested array length <= 0");var a=o(e,n);var s=t==="le"?"LE":"BE";this["_toArrayLike"+s](a,i);return a};BN.prototype._toArrayLikeLE=function _toArrayLikeLE(e,t){var r=0;var i=0;for(var n=0,a=0;n>8&255}if(r>16&255}if(a===6){if(r>24&255}i=0;a=0}else{i=s>>>24;a+=2}}if(r=0){e[r--]=s>>8&255}if(r>=0){e[r--]=s>>16&255}if(a===6){if(r>=0){e[r--]=s>>24&255}i=0;a=0}else{i=s>>>24;a+=2}}if(r>=0){e[r--]=i;while(r>=0){e[r--]=0}}};if(Math.clz32){BN.prototype._countBits=function _countBits(e){return 32-Math.clz32(e)}}else{BN.prototype._countBits=function _countBits(e){var t=e;var r=0;if(t>=4096){r+=13;t>>>=13}if(t>=64){r+=7;t>>>=7}if(t>=8){r+=4;t>>>=4}if(t>=2){r+=2;t>>>=2}return r+t}}BN.prototype._zeroBits=function _zeroBits(e){if(e===0)return 26;var t=e;var r=0;if((t&8191)===0){r+=13;t>>>=13}if((t&127)===0){r+=7;t>>>=7}if((t&15)===0){r+=4;t>>>=4}if((t&3)===0){r+=2;t>>>=2}if((t&1)===0){r++}return r};BN.prototype.bitLength=function bitLength(){var e=this.words[this.length-1];var t=this._countBits(e);return(this.length-1)*26+t};function toBitArray(e){var t=new Array(e.bitLength());for(var r=0;r>>n&1}return t}BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;var e=0;for(var t=0;te.length)return this.clone().ior(e);return e.clone().ior(this)};BN.prototype.uor=function uor(e){if(this.length>e.length)return this.clone().iuor(e);return e.clone().iuor(this)};BN.prototype.iuand=function iuand(e){var t;if(this.length>e.length){t=e}else{t=this}for(var r=0;re.length)return this.clone().iand(e);return e.clone().iand(this)};BN.prototype.uand=function uand(e){if(this.length>e.length)return this.clone().iuand(e);return e.clone().iuand(this)};BN.prototype.iuxor=function iuxor(e){var t;var r;if(this.length>e.length){t=this;r=e}else{t=e;r=this}for(var i=0;ie.length)return this.clone().ixor(e);return e.clone().ixor(this)};BN.prototype.uxor=function uxor(e){if(this.length>e.length)return this.clone().iuxor(e);return e.clone().iuxor(this)};BN.prototype.inotn=function inotn(e){assert(typeof e==="number"&&e>=0);var t=Math.ceil(e/26)|0;var r=e%26;this._expand(t);if(r>0){t--}for(var i=0;i0){this.words[i]=~this.words[i]&67108863>>26-r}return this._strip()};BN.prototype.notn=function notn(e){return this.clone().inotn(e)};BN.prototype.setn=function setn(e,t){assert(typeof e==="number"&&e>=0);var r=e/26|0;var i=e%26;this._expand(r+1);if(t){this.words[r]=this.words[r]|1<e.length){r=this;i=e}else{r=e;i=this}var n=0;for(var a=0;a>>26}for(;n!==0&&a>>26}this.length=r.length;if(n!==0){this.words[this.length]=n;this.length++}else if(r!==this){for(;ae.length)return this.clone().iadd(e);return e.clone().iadd(this)};BN.prototype.isub=function isub(e){if(e.negative!==0){e.negative=0;var t=this.iadd(e);e.negative=1;return t._normSign()}else if(this.negative!==0){this.negative=0;this.iadd(e);this.negative=1;return this._normSign()}var r=this.cmp(e);if(r===0){this.negative=0;this.length=1;this.words[0]=0;return this}var i,n;if(r>0){i=this;n=e}else{i=e;n=this}var a=0;for(var s=0;s>26;this.words[s]=t&67108863}for(;a!==0&&s>26;this.words[s]=t&67108863}if(a===0&&s>>26;var c=h&67108863;var l=Math.min(u,t.length-1);for(var p=Math.max(0,u-e.length+1);p<=l;p++){var v=u-p|0;n=e.words[v]|0;a=t.words[p]|0;s=n*a+c;d+=s/67108864|0;c=s&67108863}r.words[u]=c|0;h=d|0}if(h!==0){r.words[u]=h|0}else{r.length--}return r._strip()}var h=function comb10MulTo(e,t,r){var i=e.words;var n=t.words;var a=r.words;var s=0;var o;var h;var u;var d=i[0]|0;var c=d&8191;var l=d>>>13;var p=i[1]|0;var v=p&8191;var b=p>>>13;var m=i[2]|0;var y=m&8191;var g=m>>>13;var _=i[3]|0;var w=_&8191;var M=_>>>13;var B=i[4]|0;var E=B&8191;var k=B>>>13;var A=i[5]|0;var N=A&8191;var P=A>>>13;var x=i[6]|0;var I=x&8191;var C=x>>>13;var D=i[7]|0;var T=D&8191;var j=D>>>13;var q=i[8]|0;var O=q&8191;var H=q>>>13;var L=i[9]|0;var z=L&8191;var F=L>>>13;var U=n[0]|0;var W=U&8191;var V=U>>>13;var G=n[1]|0;var J=G&8191;var Z=G>>>13;var X=n[2]|0;var Y=X&8191;var $=X>>>13;var Q=n[3]|0;var ee=Q&8191;var te=Q>>>13;var re=n[4]|0;var ie=re&8191;var ne=re>>>13;var ae=n[5]|0;var fe=ae&8191;var se=ae>>>13;var oe=n[6]|0;var he=oe&8191;var ue=oe>>>13;var de=n[7]|0;var ce=de&8191;var le=de>>>13;var pe=n[8]|0;var ve=pe&8191;var be=pe>>>13;var me=n[9]|0;var ye=me&8191;var ge=me>>>13;r.negative=e.negative^t.negative;r.length=19;o=Math.imul(c,W);h=Math.imul(c,V);h=h+Math.imul(l,W)|0;u=Math.imul(l,V);var _e=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(_e>>>26)|0;_e&=67108863;o=Math.imul(v,W);h=Math.imul(v,V);h=h+Math.imul(b,W)|0;u=Math.imul(b,V);o=o+Math.imul(c,J)|0;h=h+Math.imul(c,Z)|0;h=h+Math.imul(l,J)|0;u=u+Math.imul(l,Z)|0;var we=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(we>>>26)|0;we&=67108863;o=Math.imul(y,W);h=Math.imul(y,V);h=h+Math.imul(g,W)|0;u=Math.imul(g,V);o=o+Math.imul(v,J)|0;h=h+Math.imul(v,Z)|0;h=h+Math.imul(b,J)|0;u=u+Math.imul(b,Z)|0;o=o+Math.imul(c,Y)|0;h=h+Math.imul(c,$)|0;h=h+Math.imul(l,Y)|0;u=u+Math.imul(l,$)|0;var Me=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Me>>>26)|0;Me&=67108863;o=Math.imul(w,W);h=Math.imul(w,V);h=h+Math.imul(M,W)|0;u=Math.imul(M,V);o=o+Math.imul(y,J)|0;h=h+Math.imul(y,Z)|0;h=h+Math.imul(g,J)|0;u=u+Math.imul(g,Z)|0;o=o+Math.imul(v,Y)|0;h=h+Math.imul(v,$)|0;h=h+Math.imul(b,Y)|0;u=u+Math.imul(b,$)|0;o=o+Math.imul(c,ee)|0;h=h+Math.imul(c,te)|0;h=h+Math.imul(l,ee)|0;u=u+Math.imul(l,te)|0;var Se=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Se>>>26)|0;Se&=67108863;o=Math.imul(E,W);h=Math.imul(E,V);h=h+Math.imul(k,W)|0;u=Math.imul(k,V);o=o+Math.imul(w,J)|0;h=h+Math.imul(w,Z)|0;h=h+Math.imul(M,J)|0;u=u+Math.imul(M,Z)|0;o=o+Math.imul(y,Y)|0;h=h+Math.imul(y,$)|0;h=h+Math.imul(g,Y)|0;u=u+Math.imul(g,$)|0;o=o+Math.imul(v,ee)|0;h=h+Math.imul(v,te)|0;h=h+Math.imul(b,ee)|0;u=u+Math.imul(b,te)|0;o=o+Math.imul(c,ie)|0;h=h+Math.imul(c,ne)|0;h=h+Math.imul(l,ie)|0;u=u+Math.imul(l,ne)|0;var Be=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Be>>>26)|0;Be&=67108863;o=Math.imul(N,W);h=Math.imul(N,V);h=h+Math.imul(P,W)|0;u=Math.imul(P,V);o=o+Math.imul(E,J)|0;h=h+Math.imul(E,Z)|0;h=h+Math.imul(k,J)|0;u=u+Math.imul(k,Z)|0;o=o+Math.imul(w,Y)|0;h=h+Math.imul(w,$)|0;h=h+Math.imul(M,Y)|0;u=u+Math.imul(M,$)|0;o=o+Math.imul(y,ee)|0;h=h+Math.imul(y,te)|0;h=h+Math.imul(g,ee)|0;u=u+Math.imul(g,te)|0;o=o+Math.imul(v,ie)|0;h=h+Math.imul(v,ne)|0;h=h+Math.imul(b,ie)|0;u=u+Math.imul(b,ne)|0;o=o+Math.imul(c,fe)|0;h=h+Math.imul(c,se)|0;h=h+Math.imul(l,fe)|0;u=u+Math.imul(l,se)|0;var Ee=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Ee>>>26)|0;Ee&=67108863;o=Math.imul(I,W);h=Math.imul(I,V);h=h+Math.imul(C,W)|0;u=Math.imul(C,V);o=o+Math.imul(N,J)|0;h=h+Math.imul(N,Z)|0;h=h+Math.imul(P,J)|0;u=u+Math.imul(P,Z)|0;o=o+Math.imul(E,Y)|0;h=h+Math.imul(E,$)|0;h=h+Math.imul(k,Y)|0;u=u+Math.imul(k,$)|0;o=o+Math.imul(w,ee)|0;h=h+Math.imul(w,te)|0;h=h+Math.imul(M,ee)|0;u=u+Math.imul(M,te)|0;o=o+Math.imul(y,ie)|0;h=h+Math.imul(y,ne)|0;h=h+Math.imul(g,ie)|0;u=u+Math.imul(g,ne)|0;o=o+Math.imul(v,fe)|0;h=h+Math.imul(v,se)|0;h=h+Math.imul(b,fe)|0;u=u+Math.imul(b,se)|0;o=o+Math.imul(c,he)|0;h=h+Math.imul(c,ue)|0;h=h+Math.imul(l,he)|0;u=u+Math.imul(l,ue)|0;var ke=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(ke>>>26)|0;ke&=67108863;o=Math.imul(T,W);h=Math.imul(T,V);h=h+Math.imul(j,W)|0;u=Math.imul(j,V);o=o+Math.imul(I,J)|0;h=h+Math.imul(I,Z)|0;h=h+Math.imul(C,J)|0;u=u+Math.imul(C,Z)|0;o=o+Math.imul(N,Y)|0;h=h+Math.imul(N,$)|0;h=h+Math.imul(P,Y)|0;u=u+Math.imul(P,$)|0;o=o+Math.imul(E,ee)|0;h=h+Math.imul(E,te)|0;h=h+Math.imul(k,ee)|0;u=u+Math.imul(k,te)|0;o=o+Math.imul(w,ie)|0;h=h+Math.imul(w,ne)|0;h=h+Math.imul(M,ie)|0;u=u+Math.imul(M,ne)|0;o=o+Math.imul(y,fe)|0;h=h+Math.imul(y,se)|0;h=h+Math.imul(g,fe)|0;u=u+Math.imul(g,se)|0;o=o+Math.imul(v,he)|0;h=h+Math.imul(v,ue)|0;h=h+Math.imul(b,he)|0;u=u+Math.imul(b,ue)|0;o=o+Math.imul(c,ce)|0;h=h+Math.imul(c,le)|0;h=h+Math.imul(l,ce)|0;u=u+Math.imul(l,le)|0;var Ae=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Ae>>>26)|0;Ae&=67108863;o=Math.imul(O,W);h=Math.imul(O,V);h=h+Math.imul(H,W)|0;u=Math.imul(H,V);o=o+Math.imul(T,J)|0;h=h+Math.imul(T,Z)|0;h=h+Math.imul(j,J)|0;u=u+Math.imul(j,Z)|0;o=o+Math.imul(I,Y)|0;h=h+Math.imul(I,$)|0;h=h+Math.imul(C,Y)|0;u=u+Math.imul(C,$)|0;o=o+Math.imul(N,ee)|0;h=h+Math.imul(N,te)|0;h=h+Math.imul(P,ee)|0;u=u+Math.imul(P,te)|0;o=o+Math.imul(E,ie)|0;h=h+Math.imul(E,ne)|0;h=h+Math.imul(k,ie)|0;u=u+Math.imul(k,ne)|0;o=o+Math.imul(w,fe)|0;h=h+Math.imul(w,se)|0;h=h+Math.imul(M,fe)|0;u=u+Math.imul(M,se)|0;o=o+Math.imul(y,he)|0;h=h+Math.imul(y,ue)|0;h=h+Math.imul(g,he)|0;u=u+Math.imul(g,ue)|0;o=o+Math.imul(v,ce)|0;h=h+Math.imul(v,le)|0;h=h+Math.imul(b,ce)|0;u=u+Math.imul(b,le)|0;o=o+Math.imul(c,ve)|0;h=h+Math.imul(c,be)|0;h=h+Math.imul(l,ve)|0;u=u+Math.imul(l,be)|0;var Ne=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Ne>>>26)|0;Ne&=67108863;o=Math.imul(z,W);h=Math.imul(z,V);h=h+Math.imul(F,W)|0;u=Math.imul(F,V);o=o+Math.imul(O,J)|0;h=h+Math.imul(O,Z)|0;h=h+Math.imul(H,J)|0;u=u+Math.imul(H,Z)|0;o=o+Math.imul(T,Y)|0;h=h+Math.imul(T,$)|0;h=h+Math.imul(j,Y)|0;u=u+Math.imul(j,$)|0;o=o+Math.imul(I,ee)|0;h=h+Math.imul(I,te)|0;h=h+Math.imul(C,ee)|0;u=u+Math.imul(C,te)|0;o=o+Math.imul(N,ie)|0;h=h+Math.imul(N,ne)|0;h=h+Math.imul(P,ie)|0;u=u+Math.imul(P,ne)|0;o=o+Math.imul(E,fe)|0;h=h+Math.imul(E,se)|0;h=h+Math.imul(k,fe)|0;u=u+Math.imul(k,se)|0;o=o+Math.imul(w,he)|0;h=h+Math.imul(w,ue)|0;h=h+Math.imul(M,he)|0;u=u+Math.imul(M,ue)|0;o=o+Math.imul(y,ce)|0;h=h+Math.imul(y,le)|0;h=h+Math.imul(g,ce)|0;u=u+Math.imul(g,le)|0;o=o+Math.imul(v,ve)|0;h=h+Math.imul(v,be)|0;h=h+Math.imul(b,ve)|0;u=u+Math.imul(b,be)|0;o=o+Math.imul(c,ye)|0;h=h+Math.imul(c,ge)|0;h=h+Math.imul(l,ye)|0;u=u+Math.imul(l,ge)|0;var Re=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Re>>>26)|0;Re&=67108863;o=Math.imul(z,J);h=Math.imul(z,Z);h=h+Math.imul(F,J)|0;u=Math.imul(F,Z);o=o+Math.imul(O,Y)|0;h=h+Math.imul(O,$)|0;h=h+Math.imul(H,Y)|0;u=u+Math.imul(H,$)|0;o=o+Math.imul(T,ee)|0;h=h+Math.imul(T,te)|0;h=h+Math.imul(j,ee)|0;u=u+Math.imul(j,te)|0;o=o+Math.imul(I,ie)|0;h=h+Math.imul(I,ne)|0;h=h+Math.imul(C,ie)|0;u=u+Math.imul(C,ne)|0;o=o+Math.imul(N,fe)|0;h=h+Math.imul(N,se)|0;h=h+Math.imul(P,fe)|0;u=u+Math.imul(P,se)|0;o=o+Math.imul(E,he)|0;h=h+Math.imul(E,ue)|0;h=h+Math.imul(k,he)|0;u=u+Math.imul(k,ue)|0;o=o+Math.imul(w,ce)|0;h=h+Math.imul(w,le)|0;h=h+Math.imul(M,ce)|0;u=u+Math.imul(M,le)|0;o=o+Math.imul(y,ve)|0;h=h+Math.imul(y,be)|0;h=h+Math.imul(g,ve)|0;u=u+Math.imul(g,be)|0;o=o+Math.imul(v,ye)|0;h=h+Math.imul(v,ge)|0;h=h+Math.imul(b,ye)|0;u=u+Math.imul(b,ge)|0;var Pe=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Pe>>>26)|0;Pe&=67108863;o=Math.imul(z,Y);h=Math.imul(z,$);h=h+Math.imul(F,Y)|0;u=Math.imul(F,$);o=o+Math.imul(O,ee)|0;h=h+Math.imul(O,te)|0;h=h+Math.imul(H,ee)|0;u=u+Math.imul(H,te)|0;o=o+Math.imul(T,ie)|0;h=h+Math.imul(T,ne)|0;h=h+Math.imul(j,ie)|0;u=u+Math.imul(j,ne)|0;o=o+Math.imul(I,fe)|0;h=h+Math.imul(I,se)|0;h=h+Math.imul(C,fe)|0;u=u+Math.imul(C,se)|0;o=o+Math.imul(N,he)|0;h=h+Math.imul(N,ue)|0;h=h+Math.imul(P,he)|0;u=u+Math.imul(P,ue)|0;o=o+Math.imul(E,ce)|0;h=h+Math.imul(E,le)|0;h=h+Math.imul(k,ce)|0;u=u+Math.imul(k,le)|0;o=o+Math.imul(w,ve)|0;h=h+Math.imul(w,be)|0;h=h+Math.imul(M,ve)|0;u=u+Math.imul(M,be)|0;o=o+Math.imul(y,ye)|0;h=h+Math.imul(y,ge)|0;h=h+Math.imul(g,ye)|0;u=u+Math.imul(g,ge)|0;var xe=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(xe>>>26)|0;xe&=67108863;o=Math.imul(z,ee);h=Math.imul(z,te);h=h+Math.imul(F,ee)|0;u=Math.imul(F,te);o=o+Math.imul(O,ie)|0;h=h+Math.imul(O,ne)|0;h=h+Math.imul(H,ie)|0;u=u+Math.imul(H,ne)|0;o=o+Math.imul(T,fe)|0;h=h+Math.imul(T,se)|0;h=h+Math.imul(j,fe)|0;u=u+Math.imul(j,se)|0;o=o+Math.imul(I,he)|0;h=h+Math.imul(I,ue)|0;h=h+Math.imul(C,he)|0;u=u+Math.imul(C,ue)|0;o=o+Math.imul(N,ce)|0;h=h+Math.imul(N,le)|0;h=h+Math.imul(P,ce)|0;u=u+Math.imul(P,le)|0;o=o+Math.imul(E,ve)|0;h=h+Math.imul(E,be)|0;h=h+Math.imul(k,ve)|0;u=u+Math.imul(k,be)|0;o=o+Math.imul(w,ye)|0;h=h+Math.imul(w,ge)|0;h=h+Math.imul(M,ye)|0;u=u+Math.imul(M,ge)|0;var Ie=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Ie>>>26)|0;Ie&=67108863;o=Math.imul(z,ie);h=Math.imul(z,ne);h=h+Math.imul(F,ie)|0;u=Math.imul(F,ne);o=o+Math.imul(O,fe)|0;h=h+Math.imul(O,se)|0;h=h+Math.imul(H,fe)|0;u=u+Math.imul(H,se)|0;o=o+Math.imul(T,he)|0;h=h+Math.imul(T,ue)|0;h=h+Math.imul(j,he)|0;u=u+Math.imul(j,ue)|0;o=o+Math.imul(I,ce)|0;h=h+Math.imul(I,le)|0;h=h+Math.imul(C,ce)|0;u=u+Math.imul(C,le)|0;o=o+Math.imul(N,ve)|0;h=h+Math.imul(N,be)|0;h=h+Math.imul(P,ve)|0;u=u+Math.imul(P,be)|0;o=o+Math.imul(E,ye)|0;h=h+Math.imul(E,ge)|0;h=h+Math.imul(k,ye)|0;u=u+Math.imul(k,ge)|0;var Ce=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Ce>>>26)|0;Ce&=67108863;o=Math.imul(z,fe);h=Math.imul(z,se);h=h+Math.imul(F,fe)|0;u=Math.imul(F,se);o=o+Math.imul(O,he)|0;h=h+Math.imul(O,ue)|0;h=h+Math.imul(H,he)|0;u=u+Math.imul(H,ue)|0;o=o+Math.imul(T,ce)|0;h=h+Math.imul(T,le)|0;h=h+Math.imul(j,ce)|0;u=u+Math.imul(j,le)|0;o=o+Math.imul(I,ve)|0;h=h+Math.imul(I,be)|0;h=h+Math.imul(C,ve)|0;u=u+Math.imul(C,be)|0;o=o+Math.imul(N,ye)|0;h=h+Math.imul(N,ge)|0;h=h+Math.imul(P,ye)|0;u=u+Math.imul(P,ge)|0;var De=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(De>>>26)|0;De&=67108863;o=Math.imul(z,he);h=Math.imul(z,ue);h=h+Math.imul(F,he)|0;u=Math.imul(F,ue);o=o+Math.imul(O,ce)|0;h=h+Math.imul(O,le)|0;h=h+Math.imul(H,ce)|0;u=u+Math.imul(H,le)|0;o=o+Math.imul(T,ve)|0;h=h+Math.imul(T,be)|0;h=h+Math.imul(j,ve)|0;u=u+Math.imul(j,be)|0;o=o+Math.imul(I,ye)|0;h=h+Math.imul(I,ge)|0;h=h+Math.imul(C,ye)|0;u=u+Math.imul(C,ge)|0;var Te=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Te>>>26)|0;Te&=67108863;o=Math.imul(z,ce);h=Math.imul(z,le);h=h+Math.imul(F,ce)|0;u=Math.imul(F,le);o=o+Math.imul(O,ve)|0;h=h+Math.imul(O,be)|0;h=h+Math.imul(H,ve)|0;u=u+Math.imul(H,be)|0;o=o+Math.imul(T,ye)|0;h=h+Math.imul(T,ge)|0;h=h+Math.imul(j,ye)|0;u=u+Math.imul(j,ge)|0;var je=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(je>>>26)|0;je&=67108863;o=Math.imul(z,ve);h=Math.imul(z,be);h=h+Math.imul(F,ve)|0;u=Math.imul(F,be);o=o+Math.imul(O,ye)|0;h=h+Math.imul(O,ge)|0;h=h+Math.imul(H,ye)|0;u=u+Math.imul(H,ge)|0;var qe=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(qe>>>26)|0;qe&=67108863;o=Math.imul(z,ye);h=Math.imul(z,ge);h=h+Math.imul(F,ye)|0;u=Math.imul(F,ge);var Oe=(s+o|0)+((h&8191)<<13)|0;s=(u+(h>>>13)|0)+(Oe>>>26)|0;Oe&=67108863;a[0]=_e;a[1]=we;a[2]=Me;a[3]=Se;a[4]=Be;a[5]=Ee;a[6]=ke;a[7]=Ae;a[8]=Ne;a[9]=Re;a[10]=Pe;a[11]=xe;a[12]=Ie;a[13]=Ce;a[14]=De;a[15]=Te;a[16]=je;a[17]=qe;a[18]=Oe;if(s!==0){a[19]=s;r.length++}return r};if(!Math.imul){h=smallMulTo}function bigMulTo(e,t,r){r.negative=t.negative^e.negative;r.length=e.length+t.length;var i=0;var n=0;for(var a=0;a>>26)|0;n+=s>>>26;s&=67108863}r.words[a]=o;i=s;s=n}if(i!==0){r.words[a]=i}else{r.length--}return r._strip()}function jumboMulTo(e,t,r){return bigMulTo(e,t,r)}BN.prototype.mulTo=function mulTo(e,t){var r;var i=this.length+e.length;if(this.length===10&&e.length===10){r=h(this,e,t)}else if(i<63){r=smallMulTo(this,e,t)}else if(i<1024){r=bigMulTo(this,e,t)}else{r=jumboMulTo(this,e,t)}return r};function FFTM(e,t){this.x=e;this.y=t}FFTM.prototype.makeRBT=function makeRBT(e){var t=new Array(e);var r=BN.prototype._countBits(e)-1;for(var i=0;i>=1}return i};FFTM.prototype.permute=function permute(e,t,r,i,n,a){for(var s=0;s>>1){n++}return 1<>>13;r[2*a+1]=n&8191;n=n>>>13}for(a=2*t;a>=26;r+=n/67108864|0;r+=a>>>26;this.words[i]=a&67108863}if(r!==0){this.words[i]=r;this.length++}return t?this.ineg():this};BN.prototype.muln=function muln(e){return this.clone().imuln(e)};BN.prototype.sqr=function sqr(){return this.mul(this)};BN.prototype.isqr=function isqr(){return this.imul(this.clone())};BN.prototype.pow=function pow(e){var t=toBitArray(e);if(t.length===0)return new BN(1);var r=this;for(var i=0;i=0);var t=e%26;var r=(e-t)/26;var i=67108863>>>26-t<<26-t;var n;if(t!==0){var a=0;for(n=0;n>>26-t}if(a){this.words[n]=a;this.length++}}if(r!==0){for(n=this.length-1;n>=0;n--){this.words[n+r]=this.words[n]}for(n=0;n=0);var i;if(t){i=(t-t%26)/26}else{i=0}var n=e%26;var a=Math.min((e-n)/26,this.length);var s=67108863^67108863>>>n<a){this.length-=a;for(h=0;h=0&&(u!==0||h>=i);h--){var d=this.words[h]|0;this.words[h]=u<<26-n|d>>>n;u=d&s}if(o&&u!==0){o.words[o.length++]=u}if(this.length===0){this.words[0]=0;this.length=1}return this._strip()};BN.prototype.ishrn=function ishrn(e,t,r){assert(this.negative===0);return this.iushrn(e,t,r)};BN.prototype.shln=function shln(e){return this.clone().ishln(e)};BN.prototype.ushln=function ushln(e){return this.clone().iushln(e)};BN.prototype.shrn=function shrn(e){return this.clone().ishrn(e)};BN.prototype.ushrn=function ushrn(e){return this.clone().iushrn(e)};BN.prototype.testn=function testn(e){assert(typeof e==="number"&&e>=0);var t=e%26;var r=(e-t)/26;var i=1<=0);var t=e%26;var r=(e-t)/26;assert(this.negative===0,"imaskn works only with positive numbers");if(this.length<=r){return this}if(t!==0){r++}this.length=Math.min(r,this.length);if(t!==0){var i=67108863^67108863>>>t<=67108864;t++){this.words[t]-=67108864;if(t===this.length-1){this.words[t+1]=1}else{this.words[t+1]++}}this.length=Math.max(this.length,t+1);return this};BN.prototype.isubn=function isubn(e){assert(typeof e==="number");assert(e<67108864);if(e<0)return this.iaddn(-e);if(this.negative!==0){this.negative=0;this.iaddn(e);this.negative=1;return this}this.words[0]-=e;if(this.length===1&&this.words[0]<0){this.words[0]=-this.words[0];this.negative=1}else{for(var t=0;t>26)-(o/67108864|0);this.words[n+r]=a&67108863}for(;n>26;this.words[n+r]=a&67108863}if(s===0)return this._strip();assert(s===-1);s=0;for(n=0;n>26;this.words[n]=a&67108863}this.negative=1;return this._strip()};BN.prototype._wordDiv=function _wordDiv(e,t){var r=this.length-e.length;var i=this.clone();var n=e;var a=n.words[n.length-1]|0;var s=this._countBits(a);r=26-s;if(r!==0){n=n.ushln(r);i.iushln(r);a=n.words[n.length-1]|0}var o=i.length-n.length;var h;if(t!=="mod"){h=new BN(null);h.length=o+1;h.words=new Array(h.length);for(var u=0;u=0;c--){var l=(i.words[n.length+c]|0)*67108864+(i.words[n.length+c-1]|0);l=Math.min(l/a|0,67108863);i._ishlnsubmul(n,l,c);while(i.negative!==0){l--;i.negative=0;i._ishlnsubmul(n,1,c);if(!i.isZero()){i.negative^=1}}if(h){h.words[c]=l}}if(h){h._strip()}i._strip();if(t!=="div"&&r!==0){i.iushrn(r)}return{div:h||null,mod:i}};BN.prototype.divmod=function divmod(e,t,r){assert(!e.isZero());if(this.isZero()){return{div:new BN(0),mod:new BN(0)}}var i,n,a;if(this.negative!==0&&e.negative===0){a=this.neg().divmod(e,t);if(t!=="mod"){i=a.div.neg()}if(t!=="div"){n=a.mod.neg();if(r&&n.negative!==0){n.iadd(e)}}return{div:i,mod:n}}if(this.negative===0&&e.negative!==0){a=this.divmod(e.neg(),t);if(t!=="mod"){i=a.div.neg()}return{div:i,mod:a.mod}}if((this.negative&e.negative)!==0){a=this.neg().divmod(e.neg(),t);if(t!=="div"){n=a.mod.neg();if(r&&n.negative!==0){n.isub(e)}}return{div:a.div,mod:n}}if(e.length>this.length||this.cmp(e)<0){return{div:new BN(0),mod:this}}if(e.length===1){if(t==="div"){return{div:this.divn(e.words[0]),mod:null}}if(t==="mod"){return{div:null,mod:new BN(this.modrn(e.words[0]))}}return{div:this.divn(e.words[0]),mod:new BN(this.modrn(e.words[0]))}}return this._wordDiv(e,t)};BN.prototype.div=function div(e){return this.divmod(e,"div",false).div};BN.prototype.mod=function mod(e){return this.divmod(e,"mod",false).mod};BN.prototype.umod=function umod(e){return this.divmod(e,"mod",true).mod};BN.prototype.divRound=function divRound(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=t.div.negative!==0?t.mod.isub(e):t.mod;var i=e.ushrn(1);var n=e.andln(1);var a=r.cmp(i);if(a<0||n===1&&a===0)return t.div;return t.div.negative!==0?t.div.isubn(1):t.div.iaddn(1)};BN.prototype.modrn=function modrn(e){var t=e<0;if(t)e=-e;assert(e<=67108863);var r=(1<<26)%e;var i=0;for(var n=this.length-1;n>=0;n--){i=(r*i+(this.words[n]|0))%e}return t?-i:i};BN.prototype.modn=function modn(e){return this.modrn(e)};BN.prototype.idivn=function idivn(e){var t=e<0;if(t)e=-e;assert(e<=67108863);var r=0;for(var i=this.length-1;i>=0;i--){var n=(this.words[i]|0)+r*67108864;this.words[i]=n/e|0;r=n%e}this._strip();return t?this.ineg():this};BN.prototype.divn=function divn(e){return this.clone().idivn(e)};BN.prototype.egcd=function egcd(e){assert(e.negative===0);assert(!e.isZero());var t=this;var r=e.clone();if(t.negative!==0){t=t.umod(e)}else{t=t.clone()}var i=new BN(1);var n=new BN(0);var a=new BN(0);var s=new BN(1);var o=0;while(t.isEven()&&r.isEven()){t.iushrn(1);r.iushrn(1);++o}var h=r.clone();var u=t.clone();while(!t.isZero()){for(var d=0,c=1;(t.words[0]&c)===0&&d<26;++d,c<<=1);if(d>0){t.iushrn(d);while(d-- >0){if(i.isOdd()||n.isOdd()){i.iadd(h);n.isub(u)}i.iushrn(1);n.iushrn(1)}}for(var l=0,p=1;(r.words[0]&p)===0&&l<26;++l,p<<=1);if(l>0){r.iushrn(l);while(l-- >0){if(a.isOdd()||s.isOdd()){a.iadd(h);s.isub(u)}a.iushrn(1);s.iushrn(1)}}if(t.cmp(r)>=0){t.isub(r);i.isub(a);n.isub(s)}else{r.isub(t);a.isub(i);s.isub(n)}}return{a:a,b:s,gcd:r.iushln(o)}};BN.prototype._invmp=function _invmp(e){assert(e.negative===0);assert(!e.isZero());var t=this;var r=e.clone();if(t.negative!==0){t=t.umod(e)}else{t=t.clone()}var i=new BN(1);var n=new BN(0);var a=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var s=0,o=1;(t.words[0]&o)===0&&s<26;++s,o<<=1);if(s>0){t.iushrn(s);while(s-- >0){if(i.isOdd()){i.iadd(a)}i.iushrn(1)}}for(var h=0,u=1;(r.words[0]&u)===0&&h<26;++h,u<<=1);if(h>0){r.iushrn(h);while(h-- >0){if(n.isOdd()){n.iadd(a)}n.iushrn(1)}}if(t.cmp(r)>=0){t.isub(r);i.isub(n)}else{r.isub(t);n.isub(i)}}var d;if(t.cmpn(1)===0){d=i}else{d=n}if(d.cmpn(0)<0){d.iadd(e)}return d};BN.prototype.gcd=function gcd(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone();var r=e.clone();t.negative=0;r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++){t.iushrn(1);r.iushrn(1)}do{while(t.isEven()){t.iushrn(1)}while(r.isEven()){r.iushrn(1)}var n=t.cmp(r);if(n<0){var a=t;t=r;r=a}else if(n===0||r.cmpn(1)===0){break}t.isub(r)}while(true);return r.iushln(i)};BN.prototype.invm=function invm(e){return this.egcd(e).a.umod(e)};BN.prototype.isEven=function isEven(){return(this.words[0]&1)===0};BN.prototype.isOdd=function isOdd(){return(this.words[0]&1)===1};BN.prototype.andln=function andln(e){return this.words[0]&e};BN.prototype.bincn=function bincn(e){assert(typeof e==="number");var t=e%26;var r=(e-t)/26;var i=1<>>26;s&=67108863;this.words[a]=s}if(n!==0){this.words[a]=n;this.length++}return this};BN.prototype.isZero=function isZero(){return this.length===1&&this.words[0]===0};BN.prototype.cmpn=function cmpn(e){var t=e<0;if(this.negative!==0&&!t)return-1;if(this.negative===0&&t)return 1;this._strip();var r;if(this.length>1){r=1}else{if(t){e=-e}assert(e<=67108863,"Number is too big");var i=this.words[0]|0;r=i===e?0:ie.length)return 1;if(this.length=0;r--){var i=this.words[r]|0;var n=e.words[r]|0;if(i===n)continue;if(in){t=1}break}return t};BN.prototype.gtn=function gtn(e){return this.cmpn(e)===1};BN.prototype.gt=function gt(e){return this.cmp(e)===1};BN.prototype.gten=function gten(e){return this.cmpn(e)>=0};BN.prototype.gte=function gte(e){return this.cmp(e)>=0};BN.prototype.ltn=function ltn(e){return this.cmpn(e)===-1};BN.prototype.lt=function lt(e){return this.cmp(e)===-1};BN.prototype.lten=function lten(e){return this.cmpn(e)<=0};BN.prototype.lte=function lte(e){return this.cmp(e)<=0};BN.prototype.eqn=function eqn(e){return this.cmpn(e)===0};BN.prototype.eq=function eq(e){return this.cmp(e)===0};BN.red=function red(e){return new Red(e)};BN.prototype.toRed=function toRed(e){assert(!this.red,"Already a number in reduction context");assert(this.negative===0,"red works only with positives");return e.convertTo(this)._forceRed(e)};BN.prototype.fromRed=function fromRed(){assert(this.red,"fromRed works only with numbers in reduction context");return this.red.convertFrom(this)};BN.prototype._forceRed=function _forceRed(e){this.red=e;return this};BN.prototype.forceRed=function forceRed(e){assert(!this.red,"Already a number in reduction context");return this._forceRed(e)};BN.prototype.redAdd=function redAdd(e){assert(this.red,"redAdd works only with red numbers");return this.red.add(this,e)};BN.prototype.redIAdd=function redIAdd(e){assert(this.red,"redIAdd works only with red numbers");return this.red.iadd(this,e)};BN.prototype.redSub=function redSub(e){assert(this.red,"redSub works only with red numbers");return this.red.sub(this,e)};BN.prototype.redISub=function redISub(e){assert(this.red,"redISub works only with red numbers");return this.red.isub(this,e)};BN.prototype.redShl=function redShl(e){assert(this.red,"redShl works only with red numbers");return this.red.shl(this,e)};BN.prototype.redMul=function redMul(e){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,e);return this.red.mul(this,e)};BN.prototype.redIMul=function redIMul(e){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,e);return this.red.imul(this,e)};BN.prototype.redSqr=function redSqr(){assert(this.red,"redSqr works only with red numbers");this.red._verify1(this);return this.red.sqr(this)};BN.prototype.redISqr=function redISqr(){assert(this.red,"redISqr works only with red numbers");this.red._verify1(this);return this.red.isqr(this)};BN.prototype.redSqrt=function redSqrt(){assert(this.red,"redSqrt works only with red numbers");this.red._verify1(this);return this.red.sqrt(this)};BN.prototype.redInvm=function redInvm(){assert(this.red,"redInvm works only with red numbers");this.red._verify1(this);return this.red.invm(this)};BN.prototype.redNeg=function redNeg(){assert(this.red,"redNeg works only with red numbers");this.red._verify1(this);return this.red.neg(this)};BN.prototype.redPow=function redPow(e){assert(this.red&&!e.red,"redPow(normalNum)");this.red._verify1(this);return this.red.pow(this,e)};var u={k256:null,p224:null,p192:null,p25519:null};function MPrime(e,t){this.name=e;this.p=new BN(t,16);this.n=this.p.bitLength();this.k=new BN(1).iushln(this.n).isub(this.p);this.tmp=this._tmp()}MPrime.prototype._tmp=function _tmp(){var e=new BN(null);e.words=new Array(Math.ceil(this.n/13));return e};MPrime.prototype.ireduce=function ireduce(e){var t=e;var r;do{this.split(t,this.tmp);t=this.imulK(t);t=t.iadd(this.tmp);r=t.bitLength()}while(r>this.n);var i=r0){t.isub(this.p)}else{if(t.strip!==undefined){t.strip()}else{t._strip()}}return t};MPrime.prototype.split=function split(e,t){e.iushrn(this.n,0,t)};MPrime.prototype.imulK=function imulK(e){return e.imul(this.k)};function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}inherits(K256,MPrime);K256.prototype.split=function split(e,t){var r=4194303;var i=Math.min(e.length,9);for(var n=0;n>>22;a=s}a>>>=22;e.words[n-10]=a;if(a===0&&e.length>10){e.length-=10}else{e.length-=9}};K256.prototype.imulK=function imulK(e){e.words[e.length]=0;e.words[e.length+1]=0;e.length+=2;var t=0;for(var r=0;r>>=26;e.words[r]=n;t=i}if(t!==0){e.words[e.length++]=t}return e};BN._prime=function prime(e){if(u[e])return u[e];var prime;if(e==="k256"){prime=new K256}else if(e==="p224"){prime=new P224}else if(e==="p192"){prime=new P192}else if(e==="p25519"){prime=new P25519}else{throw new Error("Unknown prime "+e)}u[e]=prime;return prime};function Red(e){if(typeof e==="string"){var t=BN._prime(e);this.m=t.p;this.prime=t}else{assert(e.gtn(1),"modulus must be greater than 1");this.m=e;this.prime=null}}Red.prototype._verify1=function _verify1(e){assert(e.negative===0,"red works only with positives");assert(e.red,"red works only with red numbers")};Red.prototype._verify2=function _verify2(e,t){assert((e.negative|t.negative)===0,"red works only with positives");assert(e.red&&e.red===t.red,"red works only with red numbers")};Red.prototype.imod=function imod(e){if(this.prime)return this.prime.ireduce(e)._forceRed(this);move(e,e.umod(this.m)._forceRed(this));return e};Red.prototype.neg=function neg(e){if(e.isZero()){return e.clone()}return this.m.sub(e)._forceRed(this)};Red.prototype.add=function add(e,t){this._verify2(e,t);var r=e.add(t);if(r.cmp(this.m)>=0){r.isub(this.m)}return r._forceRed(this)};Red.prototype.iadd=function iadd(e,t){this._verify2(e,t);var r=e.iadd(t);if(r.cmp(this.m)>=0){r.isub(this.m)}return r};Red.prototype.sub=function sub(e,t){this._verify2(e,t);var r=e.sub(t);if(r.cmpn(0)<0){r.iadd(this.m)}return r._forceRed(this)};Red.prototype.isub=function isub(e,t){this._verify2(e,t);var r=e.isub(t);if(r.cmpn(0)<0){r.iadd(this.m)}return r};Red.prototype.shl=function shl(e,t){this._verify1(e);return this.imod(e.ushln(t))};Red.prototype.imul=function imul(e,t){this._verify2(e,t);return this.imod(e.imul(t))};Red.prototype.mul=function mul(e,t){this._verify2(e,t);return this.imod(e.mul(t))};Red.prototype.isqr=function isqr(e){return this.imul(e,e.clone())};Red.prototype.sqr=function sqr(e){return this.mul(e,e)};Red.prototype.sqrt=function sqrt(e){if(e.isZero())return e.clone();var t=this.m.andln(3);assert(t%2===1);if(t===3){var r=this.m.add(new BN(1)).iushrn(2);return this.pow(e,r)}var i=this.m.subn(1);var n=0;while(!i.isZero()&&i.andln(1)===0){n++;i.iushrn(1)}assert(!i.isZero());var a=new BN(1).toRed(this);var s=a.redNeg();var o=this.m.subn(1).iushrn(1);var h=this.m.bitLength();h=new BN(2*h*h).toRed(this);while(this.pow(h,o).cmp(s)!==0){h.redIAdd(s)}var u=this.pow(h,i);var d=this.pow(e,i.addn(1).iushrn(1));var c=this.pow(e,i);var l=n;while(c.cmp(a)!==0){var p=c;for(var v=0;p.cmp(a)!==0;v++){p=p.redSqr()}assert(v=0;n--){var u=t.words[n];for(var d=h-1;d>=0;d--){var c=u>>d&1;if(a!==i[0]){a=this.sqr(a)}if(c===0&&s===0){o=0;continue}s<<=1;s|=c;o++;if(o!==r&&(n!==0||d!==0))continue;a=this.mul(a,i[s]);o=0;s=0}h=26}return a};Red.prototype.convertTo=function convertTo(e){var t=e.umod(this.m);return t===e?t.clone():t};Red.prototype.convertFrom=function convertFrom(e){var t=e.clone();t.red=null;return t};BN.mont=function mont(e){return new Mont(e)};function Mont(e){Red.call(this,e);this.shift=this.m.bitLength();if(this.shift%26!==0){this.shift+=26-this.shift%26}this.r=new BN(1).iushln(this.shift);this.r2=this.imod(this.r.sqr());this.rinv=this.r._invmp(this.m);this.minv=this.rinv.mul(this.r).isubn(1).div(this.m);this.minv=this.minv.umod(this.r);this.minv=this.r.sub(this.minv)}inherits(Mont,Red);Mont.prototype.convertTo=function convertTo(e){return this.imod(e.ushln(this.shift))};Mont.prototype.convertFrom=function convertFrom(e){var t=this.imod(e.mul(this.rinv));t.red=null;return t};Mont.prototype.imul=function imul(e,t){if(e.isZero()||t.isZero()){e.words[0]=0;e.length=1;return e}var r=e.imul(t);var i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var n=r.isub(i).iushrn(this.shift);var a=n;if(n.cmp(this.m)>=0){a=n.isub(this.m)}else if(n.cmpn(0)<0){a=n.iadd(this.m)}return a._forceRed(this)};Mont.prototype.mul=function mul(e,t){if(e.isZero()||t.isZero())return new BN(0)._forceRed(this);var r=e.mul(t);var i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var n=r.isub(i).iushrn(this.shift);var a=n;if(n.cmp(this.m)>=0){a=n.isub(this.m)}else if(n.cmpn(0)<0){a=n.iadd(this.m)}return a._forceRed(this)};Mont.prototype.invm=function invm(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}})( false||e,this)},3500:function(e,t,r){var i;e.exports=function rand(e){if(!i)i=new Rand(null);return i.generate(e)};function Rand(e){this.rand=e}e.exports.Rand=Rand;Rand.prototype.generate=function generate(e){return this._rand(e)};Rand.prototype._rand=function _rand(e){if(this.rand.getBytes)return this.rand.getBytes(e);var t=new Uint8Array(e);for(var r=0;r>>24]^s[d>>>16&255]^o[c>>>8&255]^h[l&255]^t[y++];v=a[d>>>24]^s[c>>>16&255]^o[l>>>8&255]^h[u&255]^t[y++];b=a[c>>>24]^s[l>>>16&255]^o[u>>>8&255]^h[d&255]^t[y++];m=a[l>>>24]^s[u>>>16&255]^o[d>>>8&255]^h[c&255]^t[y++];u=p;d=v;c=b;l=m}p=(i[u>>>24]<<24|i[d>>>16&255]<<16|i[c>>>8&255]<<8|i[l&255])^t[y++];v=(i[d>>>24]<<24|i[c>>>16&255]<<16|i[l>>>8&255]<<8|i[u&255])^t[y++];b=(i[c>>>24]<<24|i[l>>>16&255]<<16|i[u>>>8&255]<<8|i[d&255])^t[y++];m=(i[l>>>24]<<24|i[u>>>16&255]<<16|i[d>>>8&255]<<8|i[c&255])^t[y++];p=p>>>0;v=v>>>0;b=b>>>0;m=m>>>0;return[p,v,b,m]}var n=[0,1,2,4,8,16,32,64,128,27,54];var a=function(){var e=new Array(256);for(var t=0;t<256;t++){if(t<128){e[t]=t<<1}else{e[t]=t<<1^283}}var r=[];var i=[];var n=[[],[],[],[]];var a=[[],[],[],[]];var s=0;var o=0;for(var h=0;h<256;++h){var u=o^o<<1^o<<2^o<<3^o<<4;u=u>>>8^u&255^99;r[s]=u;i[u]=s;var d=e[s];var c=e[d];var l=e[c];var p=e[u]*257^u*16843008;n[0][s]=p<<24|p>>>8;n[1][s]=p<<16|p>>>16;n[2][s]=p<<8|p>>>24;n[3][s]=p;p=l*16843009^c*65537^d*257^s*16843008;a[0][u]=p<<24|p>>>8;a[1][u]=p<<16|p>>>16;a[2][u]=p<<8|p>>>24;a[3][u]=p;if(s===0){s=o=1}else{s=d^e[e[e[l^d]]];o^=e[e[o]]}}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:a}}();function AES(e){this._key=asUInt32Array(e);this._reset()}AES.blockSize=4*4;AES.keySize=256/8;AES.prototype.blockSize=AES.blockSize;AES.prototype.keySize=AES.keySize;AES.prototype._reset=function(){var e=this._key;var t=e.length;var r=t+6;var i=(r+1)*4;var s=[];for(var o=0;o>>24;h=a.SBOX[h>>>24]<<24|a.SBOX[h>>>16&255]<<16|a.SBOX[h>>>8&255]<<8|a.SBOX[h&255];h^=n[o/t|0]<<24}else if(t>6&&o%t===4){h=a.SBOX[h>>>24]<<24|a.SBOX[h>>>16&255]<<16|a.SBOX[h>>>8&255]<<8|a.SBOX[h&255]}s[o]=s[o-t]^h}var u=[];for(var d=0;d>>24]]^a.INV_SUB_MIX[1][a.SBOX[l>>>16&255]]^a.INV_SUB_MIX[2][a.SBOX[l>>>8&255]]^a.INV_SUB_MIX[3][a.SBOX[l&255]]}}this._nRounds=r;this._keySchedule=s;this._invKeySchedule=u};AES.prototype.encryptBlockRaw=function(e){e=asUInt32Array(e);return cryptBlock(e,this._keySchedule,a.SUB_MIX,a.SBOX,this._nRounds)};AES.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e);var r=i.allocUnsafe(16);r.writeUInt32BE(t[0],0);r.writeUInt32BE(t[1],4);r.writeUInt32BE(t[2],8);r.writeUInt32BE(t[3],12);return r};AES.prototype.decryptBlock=function(e){e=asUInt32Array(e);var t=e[1];e[1]=e[3];e[3]=t;var r=cryptBlock(e,this._invKeySchedule,a.INV_SUB_MIX,a.INV_SBOX,this._nRounds);var n=i.allocUnsafe(16);n.writeUInt32BE(r[0],0);n.writeUInt32BE(r[3],4);n.writeUInt32BE(r[2],8);n.writeUInt32BE(r[1],12);return n};AES.prototype.scrub=function(){scrubVec(this._keySchedule);scrubVec(this._invKeySchedule);scrubVec(this._key)};e.exports.AES=AES},6624:function(e,t,r){var i=r(1387);var n=r(6911).Buffer;var a=r(1043);var s=r(3782);var o=r(7225);var h=r(4734);var u=r(598);function xorTest(e,t){var r=0;if(e.length!==t.length)r++;var i=Math.min(e.length,t.length);for(var n=0;n16){t=this.cache.slice(0,16);this.cache=this.cache.slice(16);return t}}else{if(this.cache.length>=16){t=this.cache.slice(0,16);this.cache=this.cache.slice(16);return t}}return null};Splitter.prototype.flush=function(){if(this.cache.length)return this.cache};function unpad(e){var t=e[15];if(t<1||t>16){throw new Error("unable to decrypt data")}var r=-1;while(++r15){var e=this.cache.slice(0,16);this.cache=this.cache.slice(16);return e}return null};Splitter.prototype.flush=function(){var e=16-this.cache.length;var t=a.allocUnsafe(e);var r=-1;while(++r>>0,0);t.writeUInt32BE(e[1]>>>0,4);t.writeUInt32BE(e[2]>>>0,8);t.writeUInt32BE(e[3]>>>0,12);return t}function GHASH(e){this.h=e;this.state=i.alloc(16,0);this.cache=i.allocUnsafe(0)}GHASH.prototype.ghash=function(e){var t=-1;while(++t0;r--){e[r]=e[r]>>>1|(e[r-1]&1)<<31}e[0]=e[0]>>>1;if(n){e[0]=e[0]^225<<24}}this.state=fromArray(t)};GHASH.prototype.update=function(e){this.cache=i.concat([this.cache,e]);var t;while(this.cache.length>=16){t=this.cache.slice(0,16);this.cache=this.cache.slice(16);this.ghash(t)}};GHASH.prototype.final=function(e,t){if(this.cache.length){this.ghash(i.concat([this.cache,n],16))}this.ghash(fromArray([0,e,0,t]));return this.state};e.exports=GHASH},598:function(e){function incr32(e){var t=e.length;var r;while(t--){r=e.readUInt8(t);if(r===255){e.writeUInt8(0,t)}else{r++;e.writeUInt8(r,t);break}}}e.exports=incr32},9825:function(e,t,r){var i=r(4734);t.encrypt=function(e,t){var r=i(t,e._prev);e._prev=e._cipher.encryptBlock(r);return e._prev};t.decrypt=function(e,t){var r=e._prev;e._prev=t;var n=e._cipher.decryptBlock(t);return i(n,r)}},321:function(e,t,r){var i=r(6911).Buffer;var n=r(4734);function encryptStart(e,t,r){var a=t.length;var s=n(t,e._cache);e._cache=e._cache.slice(a);e._prev=i.concat([e._prev,r?t:s]);return s}t.encrypt=function(e,t,r){var n=i.allocUnsafe(0);var a;while(t.length){if(e._cache.length===0){e._cache=e._cipher.encryptBlock(e._prev);e._prev=i.allocUnsafe(0)}if(e._cache.length<=t.length){a=e._cache.length;n=i.concat([n,encryptStart(e,t.slice(0,a),r)]);t=t.slice(a)}else{n=i.concat([n,encryptStart(e,t,r)]);break}}return n}},3147:function(e,t,r){var i=r(6911).Buffer;function encryptByte(e,t,r){var i;var n=-1;var a=8;var s=0;var o,h;while(++n>n%8;e._prev=shiftIn(e._prev,r?o:h)}return s}function shiftIn(e,t){var r=e.length;var n=-1;var a=i.allocUnsafe(e.length);e=i.concat([e,i.from([t])]);while(++n>7}return a}t.encrypt=function(e,t,r){var n=t.length;var a=i.allocUnsafe(n);var s=-1;while(++s=0||!r.umod(e.prime1)||!r.umod(e.prime2)){r=new i(n(t))}return r}},9276:function(e,t,r){e.exports=r(2908)},4078:function(e,t,r){var i=r(6911).Buffer;var n=r(9739);var a=r(3726);var s=r(3782);var o=r(9807);var h=r(4013);var u=r(2908);Object.keys(u).forEach((function(e){u[e].id=i.from(u[e].id,"hex");u[e.toLowerCase()]=u[e]}));function Sign(e){a.Writable.call(this);var t=u[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash;this._hash=n(t.hash);this._tag=t.id;this._signType=t.sign}s(Sign,a.Writable);Sign.prototype._write=function _write(e,t,r){this._hash.update(e);r()};Sign.prototype.update=function update(e,t){if(typeof e==="string")e=i.from(e,t);this._hash.update(e);return this};Sign.prototype.sign=function signMethod(e,t){this.end();var r=this._hash.digest();var i=o(r,e,this._hashType,this._signType,this._tag);return t?i.toString(t):i};function Verify(e){a.Writable.call(this);var t=u[e];if(!t)throw new Error("Unknown message digest");this._hash=n(t.hash);this._tag=t.id;this._signType=t.sign}s(Verify,a.Writable);Verify.prototype._write=function _write(e,t,r){this._hash.update(e);r()};Verify.prototype.update=function update(e,t){if(typeof e==="string")e=i.from(e,t);this._hash.update(e);return this};Verify.prototype.verify=function verifyMethod(e,t,r){if(typeof t==="string")t=i.from(t,r);this.end();var n=this._hash.digest();return h(t,n,e,this._signType,this._tag)};function createSign(e){return new Sign(e)}function createVerify(e){return new Verify(e)}e.exports={Sign:createSign,Verify:createVerify,createSign:createSign,createVerify:createVerify}},9807:function(e,t,r){var i=r(6911).Buffer;var n=r(4873);var a=r(7166);var s=r(949).ec;var o=r(1670);var h=r(9902);var u=r(9267);function sign(e,t,r,n,s){var o=h(t);if(o.curve){if(n!=="ecdsa"&&n!=="ecdsa/rsa")throw new Error("wrong private key type");return ecSign(e,o)}else if(o.type==="dsa"){if(n!=="dsa")throw new Error("wrong private key type");return dsaSign(e,o,r)}else{if(n!=="rsa"&&n!=="ecdsa/rsa")throw new Error("wrong private key type")}e=i.concat([s,e]);var u=o.modulus.byteLength();var d=[0,1];while(e.length+d.length+10)r.ishrn(i);return r}function bits2octets(e,t){e=bits2int(e,t);e=e.mod(t);var r=i.from(e.toArray());if(r.length=t)throw new Error("invalid sig")}e.exports=verify},4734:function(e){e.exports=function xor(e,t){var r=Math.min(e.length,t.length);var i=new Buffer(r);for(var n=0;nr){var i=e==="rmd160"?new h:u(e);t=i.update(t).digest()}else if(t.lengtho){t=e(t)}else if(t.length0;i--){t+=this._buffer(e,t);r+=this._flushBuffer(n,r)}t+=this._buffer(e,t);return n};Cipher.prototype.final=function final(e){var t;if(e)t=this.update(e);var r;if(this.type==="encrypt")r=this._finalEncrypt();else r=this._finalDecrypt();if(t)return t.concat(r);else return r};Cipher.prototype._pad=function _pad(e,t){if(t===0)return false;while(t>>1];r=a.r28shl(r,h);n=a.r28shl(n,h);a.pc2(r,n,e.keys,s)}};DES.prototype._update=function _update(e,t,r,i){var n=this._desState;var s=a.readUInt32BE(e,t);var o=a.readUInt32BE(e,t+4);a.ip(s,o,n.tmp,0);s=n.tmp[0];o=n.tmp[1];if(this.type==="encrypt")this._encrypt(n,s,o,n.tmp,0);else this._decrypt(n,s,o,n.tmp,0);s=n.tmp[0];o=n.tmp[1];a.writeUInt32BE(r,s,i);a.writeUInt32BE(r,o,i+4)};DES.prototype._pad=function _pad(e,t){var r=e.length-t;for(var i=t;i>>0;s=p}a.rip(o,s,i,n)};DES.prototype._decrypt=function _decrypt(e,t,r,i,n){var s=r;var o=t;for(var h=e.keys.length-2;h>=0;h-=2){var u=e.keys[h];var d=e.keys[h+1];a.expand(s,e.tmp,0);u^=e.tmp[0];d^=e.tmp[1];var c=a.substitute(u,d);var l=a.permute(c);var p=s;s=(o^l)>>>0;o=p}a.rip(s,o,i,n)}},6159:function(e,t,r){"use strict";var i=r(3523);var n=r(3782);var a=r(9876);var s=r(1016);function EDEState(e,t){i.equal(t.length,24,"Invalid key length");var r=t.slice(0,8);var n=t.slice(8,16);var a=t.slice(16,24);if(e==="encrypt"){this.ciphers=[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:a})]}else{this.ciphers=[s.create({type:"decrypt",key:a}),s.create({type:"encrypt",key:n}),s.create({type:"decrypt",key:r})]}}function EDE(e){a.call(this,e);var t=new EDEState(this.type,this.options.key);this._edeState=t}n(EDE,a);e.exports=EDE;EDE.create=function create(e){return new EDE(e)};EDE.prototype._update=function _update(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i);n.ciphers[1]._update(r,i,r,i);n.ciphers[2]._update(r,i,r,i)};EDE.prototype._pad=s.prototype._pad;EDE.prototype._unpad=s.prototype._unpad},5334:function(e,t){"use strict";t.readUInt32BE=function readUInt32BE(e,t){var r=e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t];return r>>>0};t.writeUInt32BE=function writeUInt32BE(e,t,r){e[0+r]=t>>>24;e[1+r]=t>>>16&255;e[2+r]=t>>>8&255;e[3+r]=t&255};t.ip=function ip(e,t,r,i){var n=0;var a=0;for(var s=6;s>=0;s-=2){for(var o=0;o<=24;o+=8){n<<=1;n|=t>>>o+s&1}for(var o=0;o<=24;o+=8){n<<=1;n|=e>>>o+s&1}}for(var s=6;s>=0;s-=2){for(var o=1;o<=25;o+=8){a<<=1;a|=t>>>o+s&1}for(var o=1;o<=25;o+=8){a<<=1;a|=e>>>o+s&1}}r[i+0]=n>>>0;r[i+1]=a>>>0};t.rip=function rip(e,t,r,i){var n=0;var a=0;for(var s=0;s<4;s++){for(var o=24;o>=0;o-=8){n<<=1;n|=t>>>o+s&1;n<<=1;n|=e>>>o+s&1}}for(var s=4;s<8;s++){for(var o=24;o>=0;o-=8){a<<=1;a|=t>>>o+s&1;a<<=1;a|=e>>>o+s&1}}r[i+0]=n>>>0;r[i+1]=a>>>0};t.pc1=function pc1(e,t,r,i){var n=0;var a=0;for(var s=7;s>=5;s--){for(var o=0;o<=24;o+=8){n<<=1;n|=t>>o+s&1}for(var o=0;o<=24;o+=8){n<<=1;n|=e>>o+s&1}}for(var o=0;o<=24;o+=8){n<<=1;n|=t>>o+s&1}for(var s=1;s<=3;s++){for(var o=0;o<=24;o+=8){a<<=1;a|=t>>o+s&1}for(var o=0;o<=24;o+=8){a<<=1;a|=e>>o+s&1}}for(var o=0;o<=24;o+=8){a<<=1;a|=e>>o+s&1}r[i+0]=n>>>0;r[i+1]=a>>>0};t.r28shl=function r28shl(e,t){return e<>>28-t};var r=[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];t.pc2=function pc2(e,t,i,n){var a=0;var s=0;var o=r.length>>>1;for(var h=0;h>>r[h]&1}for(var h=o;h>>r[h]&1}i[n+0]=a>>>0;i[n+1]=s>>>0};t.expand=function expand(e,t,r){var i=0;var n=0;i=(e&1)<<5|e>>>27;for(var a=23;a>=15;a-=4){i<<=6;i|=e>>>a&63}for(var a=11;a>=3;a-=4){n|=e>>>a&63;n<<=6}n|=(e&31)<<1|e>>>31;t[r+0]=i>>>0;t[r+1]=n>>>0};var i=[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];t.substitute=function substitute(e,t){var r=0;for(var n=0;n<4;n++){var a=e>>>18-n*6&63;var s=i[n*64+a];r<<=4;r|=s}for(var n=0;n<4;n++){var a=t>>>18-n*6&63;var s=i[4*64+n*64+a];r<<=4;r|=s}return r>>>0};var n=[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];t.permute=function permute(e){var t=0;for(var r=0;r>>n[r]&1}return t>>>0};t.padSplit=function padSplit(e,t,r){var i=e.toString(2);while(i.lengthe){r.ishrn(1)}if(r.isEven()){r.iadd(h)}if(!r.testn(1)){r.iadd(u)}if(!t.cmp(u)){while(r.mod(a).cmp(m)){r.iadd(y)}}else if(!t.cmp(d)){while(r.mod(p).cmp(v)){r.iadd(y)}}s=r.shrn(1);if(simpleSieve(s)&&simpleSieve(r)&&fermatTest(s)&&fermatTest(r)&&o.test(s)&&o.test(r)){return r}}}},949:function(e,t,r){"use strict";var i=t;i.version=r(2531).i8;i.utils=r(4401);i.rand=r(3500);i.curve=r(9359);i.curves=r(6226);i.ec=r(4088);i.eddsa=r(8511)},2727:function(e,t,r){"use strict";var i=r(711);var n=r(4401);var a=n.getNAF;var s=n.getJSF;var o=n.assert;function BaseCurve(e,t){this.type=e;this.p=new i(t.p,16);this.red=t.prime?i.red(t.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=t.n&&new i(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 r=this.n&&this.p.div(this.n);if(!r||r.cmpn(100)>0){this.redN=null}else{this._maxwellTrick=true;this.redN=this.n.toRed(this.red)}}e.exports=BaseCurve;BaseCurve.prototype.point=function point(){throw new Error("Not implemented")};BaseCurve.prototype.validate=function validate(){throw new Error("Not implemented")};BaseCurve.prototype._fixedNafMul=function _fixedNafMul(e,t){o(e.precomputed);var r=e._getDoubles();var i=a(t,1,this._bitLength);var n=(1<=h;t--)u=(u<<1)+i[t];s.push(u)}var d=this.jpoint(null,null,null);var c=this.jpoint(null,null,null);for(var l=n;l>0;l--){for(var h=0;h=0;u--){for(var t=0;u>=0&&s[u]===0;u--)t++;if(u>=0)t++;h=h.dblp(t);if(u<0)break;var d=s[u];o(d!==0);if(e.type==="affine"){if(d>0)h=h.mixedAdd(n[d-1>>1]);else h=h.mixedAdd(n[-d-1>>1].neg())}else{if(d>0)h=h.add(n[d-1>>1]);else h=h.add(n[-d-1>>1].neg())}}return e.type==="affine"?h.toP():h};BaseCurve.prototype._wnafMulAdd=function _wnafMulAdd(e,t,r,i,n){var o=this._wnafT1;var h=this._wnafT2;var u=this._wnafT3;var d=0;for(var c=0;c=1;c-=2){var v=c-1;var b=c;if(o[v]!==1||o[b]!==1){u[v]=a(r[v],o[v],this._bitLength);u[b]=a(r[b],o[b],this._bitLength);d=Math.max(u[v].length,d);d=Math.max(u[b].length,d);continue}var m=[t[v],null,null,t[b]];if(t[v].y.cmp(t[b].y)===0){m[1]=t[v].add(t[b]);m[2]=t[v].toJ().mixedAdd(t[b].neg())}else if(t[v].y.cmp(t[b].y.redNeg())===0){m[1]=t[v].toJ().mixedAdd(t[b]);m[2]=t[v].add(t[b].neg())}else{m[1]=t[v].toJ().mixedAdd(t[b]);m[2]=t[v].toJ().mixedAdd(t[b].neg())}var y=[-3,-1,-5,-7,0,7,5,1,3];var g=s(r[v],r[b]);d=Math.max(g[0].length,d);u[v]=new Array(d);u[b]=new Array(d);for(var _=0;_=0;c--){var k=0;while(c>=0){var A=true;for(var _=0;_=0)k++;B=B.dblp(k);if(c<0)break;for(var _=0;_0)l=h[_][N-1>>1];else if(N<0)l=h[_][-N-1>>1].neg();if(l.type==="affine")B=B.mixedAdd(l);else B=B.add(l)}}for(var c=0;c=Math.ceil((e.bitLength()+1)/t.step)};BasePoint.prototype._getDoubles=function _getDoubles(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;var r=[this];var i=this;for(var n=0;n";return""};Point.prototype.isInfinity=function isInfinity(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Point.prototype._extDbl=function _extDbl(){var e=this.x.redSqr();var t=this.y.redSqr();var r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e);var n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t);var a=i.redAdd(t);var s=a.redSub(r);var o=i.redSub(t);var h=n.redMul(s);var u=a.redMul(o);var d=n.redMul(o);var c=s.redMul(a);return this.curve.point(h,u,c,d)};Point.prototype._projDbl=function _projDbl(){var e=this.x.redAdd(this.y).redSqr();var t=this.x.redSqr();var r=this.y.redSqr();var i;var n;var a;if(this.curve.twisted){var s=this.curve._mulA(t);var o=s.redAdd(r);if(this.zOne){i=e.redSub(t).redSub(r).redMul(o.redSub(this.curve.two));n=o.redMul(s.redSub(r));a=o.redSqr().redSub(o).redSub(o)}else{var h=this.z.redSqr();var u=o.redSub(h).redISub(h);i=e.redSub(t).redISub(r).redMul(u);n=o.redMul(s.redSub(r));a=o.redMul(u)}}else{var s=t.redAdd(r);var h=this.curve._mulC(this.z).redSqr();var u=s.redSub(h).redSub(h);i=this.curve._mulC(e.redISub(s)).redMul(u);n=this.curve._mulC(s).redMul(t.redISub(r));a=s.redMul(u)}return this.curve.point(i,n,a)};Point.prototype.dbl=function dbl(){if(this.isInfinity())return this;if(this.curve.extended)return this._extDbl();else return this._projDbl()};Point.prototype._extAdd=function _extAdd(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x));var r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x));var i=this.t.redMul(this.curve.dd).redMul(e.t);var n=this.z.redMul(e.z.redAdd(e.z));var a=r.redSub(t);var s=n.redSub(i);var o=n.redAdd(i);var h=r.redAdd(t);var u=a.redMul(s);var d=o.redMul(h);var c=a.redMul(h);var l=s.redMul(o);return this.curve.point(u,d,l,c)};Point.prototype._projAdd=function _projAdd(e){var t=this.z.redMul(e.z);var r=t.redSqr();var i=this.x.redMul(e.x);var n=this.y.redMul(e.y);var a=this.curve.d.redMul(i).redMul(n);var s=r.redSub(a);var o=r.redAdd(a);var h=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(n);var u=t.redMul(s).redMul(h);var d;var c;if(this.curve.twisted){d=t.redMul(o).redMul(n.redSub(this.curve._mulA(i)));c=s.redMul(o)}else{d=t.redMul(o).redMul(n.redSub(i));c=this.curve._mulC(s).redMul(o)}return this.curve.point(u,d,c)};Point.prototype.add=function add(e){if(this.isInfinity())return e;if(e.isInfinity())return this;if(this.curve.extended)return this._extAdd(e);else return this._projAdd(e)};Point.prototype.mul=function mul(e){if(this._hasDoubles(e))return this.curve._fixedNafMul(this,e);else return this.curve._wnafMul(this,e)};Point.prototype.mulAdd=function mulAdd(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,false)};Point.prototype.jmulAdd=function jmulAdd(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,true)};Point.prototype.normalize=function normalize(){if(this.zOne)return this;var e=this.z.redInvm();this.x=this.x.redMul(e);this.y=this.y.redMul(e);if(this.t)this.t=this.t.redMul(e);this.z=this.curve.one;this.zOne=true;return this};Point.prototype.neg=function neg(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Point.prototype.getX=function getX(){this.normalize();return this.x.fromRed()};Point.prototype.getY=function getY(){this.normalize();return this.y.fromRed()};Point.prototype.eq=function eq(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};Point.prototype.eqXToP=function eqXToP(e){var t=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(t)===0)return true;var r=e.clone();var i=this.curve.redN.redMul(this.z);for(;;){r.iadd(this.curve.n);if(r.cmp(this.curve.p)>=0)return false;t.redIAdd(i);if(this.x.cmp(t)===0)return true}};Point.prototype.toP=Point.prototype.normalize;Point.prototype.mixedAdd=Point.prototype.add},9359:function(e,t,r){"use strict";var i=t;i.base=r(2727);i.short=r(4720);i.mont=r(6653);i.edwards=r(2705)},6653:function(e,t,r){"use strict";var i=r(711);var n=r(3782);var a=r(2727);var s=r(4401);function MontCurve(e){a.call(this,"mont",e);this.a=new i(e.a,16).toRed(this.red);this.b=new i(e.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))}n(MontCurve,a);e.exports=MontCurve;MontCurve.prototype.validate=function validate(e){var t=e.normalize().x;var r=t.redSqr();var i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);var n=i.redSqrt();return n.redSqr().cmp(i)===0};function Point(e,t,r){a.BasePoint.call(this,e,"projective");if(t===null&&r===null){this.x=this.curve.one;this.z=this.curve.zero}else{this.x=new i(t,16);this.z=new i(r,16);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}}n(Point,a.BasePoint);MontCurve.prototype.decodePoint=function decodePoint(e,t){return this.point(s.toArray(e,t),1)};MontCurve.prototype.point=function point(e,t){return new Point(this,e,t)};MontCurve.prototype.pointFromJSON=function pointFromJSON(e){return Point.fromJSON(this,e)};Point.prototype.precompute=function precompute(){};Point.prototype._encode=function _encode(){return this.getX().toArray("be",this.curve.p.byteLength())};Point.fromJSON=function fromJSON(e,t){return new Point(e,t[0],t[1]||e.one)};Point.prototype.inspect=function inspect(){if(this.isInfinity())return"";return""};Point.prototype.isInfinity=function isInfinity(){return this.z.cmpn(0)===0};Point.prototype.dbl=function dbl(){var e=this.x.redAdd(this.z);var t=e.redSqr();var r=this.x.redSub(this.z);var i=r.redSqr();var n=t.redSub(i);var a=t.redMul(i);var s=n.redMul(i.redAdd(this.curve.a24.redMul(n)));return this.curve.point(a,s)};Point.prototype.add=function add(){throw new Error("Not supported on Montgomery curve")};Point.prototype.diffAdd=function diffAdd(e,t){var r=this.x.redAdd(this.z);var i=this.x.redSub(this.z);var n=e.x.redAdd(e.z);var a=e.x.redSub(e.z);var s=a.redMul(r);var o=n.redMul(i);var h=t.z.redMul(s.redAdd(o).redSqr());var u=t.x.redMul(s.redISub(o).redSqr());return this.curve.point(h,u)};Point.prototype.mul=function mul(e){var t=e.clone();var r=this;var i=this.curve.point(null,null);var n=this;for(var a=[];t.cmpn(0)!==0;t.iushrn(1))a.push(t.andln(1));for(var s=a.length-1;s>=0;s--){if(a[s]===0){r=r.diffAdd(i,n);i=i.dbl()}else{i=r.diffAdd(i,n);r=r.dbl()}}return i};Point.prototype.mulAdd=function mulAdd(){throw new Error("Not supported on Montgomery curve")};Point.prototype.jumlAdd=function jumlAdd(){throw new Error("Not supported on Montgomery curve")};Point.prototype.eq=function eq(e){return this.getX().cmp(e.getX())===0};Point.prototype.normalize=function normalize(){this.x=this.x.redMul(this.z.redInvm());this.z=this.curve.one;return this};Point.prototype.getX=function getX(){this.normalize();return this.x.fromRed()}},4720:function(e,t,r){"use strict";var i=r(4401);var n=r(711);var a=r(3782);var s=r(2727);var o=i.assert;function ShortCurve(e){s.call(this,"short",e);this.a=new n(e.a,16).toRed(this.red);this.b=new n(e.b,16).toRed(this.red);this.tinv=this.two.redInvm();this.zeroA=this.a.fromRed().cmpn(0)===0;this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0;this.endo=this._getEndomorphism(e);this._endoWnafT1=new Array(4);this._endoWnafT2=new Array(4)}a(ShortCurve,s);e.exports=ShortCurve;ShortCurve.prototype._getEndomorphism=function _getEndomorphism(e){if(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)return;var t;var r;if(e.beta){t=new n(e.beta,16).toRed(this.red)}else{var i=this._getEndoRoots(this.p);t=i[0].cmp(i[1])<0?i[0]:i[1];t=t.toRed(this.red)}if(e.lambda){r=new n(e.lambda,16)}else{var a=this._getEndoRoots(this.n);if(this.g.mul(a[0]).x.cmp(this.g.x.redMul(t))===0){r=a[0]}else{r=a[1];o(this.g.mul(r).x.cmp(this.g.x.redMul(t))===0)}}var s;if(e.basis){s=e.basis.map((function(e){return{a:new n(e.a,16),b:new n(e.b,16)}}))}else{s=this._getEndoBasis(r)}return{beta:t,lambda:r,basis:s}};ShortCurve.prototype._getEndoRoots=function _getEndoRoots(e){var t=e===this.p?this.red:n.mont(e);var r=new n(2).toRed(t).redInvm();var i=r.redNeg();var a=new n(3).toRed(t).redNeg().redSqrt().redMul(r);var s=i.redAdd(a).fromRed();var o=i.redSub(a).fromRed();return[s,o]};ShortCurve.prototype._getEndoBasis=function _getEndoBasis(e){var t=this.n.ushrn(Math.floor(this.n.bitLength()/2));var r=e;var i=this.n.clone();var a=new n(1);var s=new n(0);var o=new n(0);var h=new n(1);var u;var d;var c;var l;var p;var v;var b;var m=0;var y;var g;while(r.cmpn(0)!==0){var _=i.div(r);y=i.sub(_.mul(r));g=o.sub(_.mul(a));var w=h.sub(_.mul(s));if(!c&&y.cmp(t)<0){u=b.neg();d=a;c=y.neg();l=g}else if(c&&++m===2){break}b=y;i=r;r=y;o=a;a=g;h=s;s=w}p=y.neg();v=g;var M=c.sqr().add(l.sqr());var B=p.sqr().add(v.sqr());if(B.cmp(M)>=0){p=u;v=d}if(c.negative){c=c.neg();l=l.neg()}if(p.negative){p=p.neg();v=v.neg()}return[{a:c,b:l},{a:p,b:v}]};ShortCurve.prototype._endoSplit=function _endoSplit(e){var t=this.endo.basis;var r=t[0];var i=t[1];var n=i.b.mul(e).divRound(this.n);var a=r.b.neg().mul(e).divRound(this.n);var s=n.mul(r.a);var o=a.mul(i.a);var h=n.mul(r.b);var u=a.mul(i.b);var d=e.sub(s).sub(o);var c=h.add(u).neg();return{k1:d,k2:c}};ShortCurve.prototype.pointFromX=function pointFromX(e,t){e=new n(e,16);if(!e.red)e=e.toRed(this.red);var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b);var i=r.redSqrt();if(i.redSqr().redSub(r).cmp(this.zero)!==0)throw new Error("invalid point");var a=i.fromRed().isOdd();if(t&&!a||!t&&a)i=i.redNeg();return this.point(e,i)};ShortCurve.prototype.validate=function validate(e){if(e.inf)return true;var t=e.x;var r=e.y;var i=this.a.redMul(t);var n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return r.redSqr().redISub(n).cmpn(0)===0};ShortCurve.prototype._endoWnafMulAdd=function _endoWnafMulAdd(e,t,r){var i=this._endoWnafT1;var n=this._endoWnafT2;for(var a=0;a";return""};Point.prototype.isInfinity=function isInfinity(){return this.inf};Point.prototype.add=function add(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(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);if(t.cmpn(0)!==0)t=t.redMul(this.x.redSub(e.x).redInvm());var r=t.redSqr().redISub(this.x).redISub(e.x);var i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)};Point.prototype.dbl=function dbl(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a;var r=this.x.redSqr();var i=e.redInvm();var n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i);var a=n.redSqr().redISub(this.x.redAdd(this.x));var s=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,s)};Point.prototype.getX=function getX(){return this.x.fromRed()};Point.prototype.getY=function getY(){return this.y.fromRed()};Point.prototype.mul=function mul(e){e=new n(e,16);if(this.isInfinity())return this;else if(this._hasDoubles(e))return this.curve._fixedNafMul(this,e);else if(this.curve.endo)return this.curve._endoWnafMulAdd([this],[e]);else return this.curve._wnafMul(this,e)};Point.prototype.mulAdd=function mulAdd(e,t,r){var i=[this,t];var n=[e,r];if(this.curve.endo)return this.curve._endoWnafMulAdd(i,n);else return this.curve._wnafMulAdd(1,i,n,2)};Point.prototype.jmulAdd=function jmulAdd(e,t,r){var i=[this,t];var n=[e,r];if(this.curve.endo)return this.curve._endoWnafMulAdd(i,n,true);else return this.curve._wnafMulAdd(1,i,n,2,true)};Point.prototype.eq=function eq(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Point.prototype.neg=function neg(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed;var negate=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(negate)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(negate)}}}return t};Point.prototype.toJ=function toJ(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function JPoint(e,t,r,i){s.BasePoint.call(this,e,"jacobian");if(t===null&&r===null&&i===null){this.x=this.curve.one;this.y=this.curve.one;this.z=new n(0)}else{this.x=new n(t,16);this.y=new n(r,16);this.z=new n(i,16)}if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);this.zOne=this.z===this.curve.one}a(JPoint,s.BasePoint);ShortCurve.prototype.jpoint=function jpoint(e,t,r){return new JPoint(this,e,t,r)};JPoint.prototype.toP=function toP(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm();var t=e.redSqr();var r=this.x.redMul(t);var i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)};JPoint.prototype.neg=function neg(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};JPoint.prototype.add=function add(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr();var r=this.z.redSqr();var i=this.x.redMul(t);var n=e.x.redMul(r);var a=this.y.redMul(t.redMul(e.z));var s=e.y.redMul(r.redMul(this.z));var o=i.redSub(n);var h=a.redSub(s);if(o.cmpn(0)===0){if(h.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl()}var u=o.redSqr();var d=u.redMul(o);var c=i.redMul(u);var l=h.redSqr().redIAdd(d).redISub(c).redISub(c);var p=h.redMul(c.redISub(l)).redISub(a.redMul(d));var v=this.z.redMul(e.z).redMul(o);return this.curve.jpoint(l,p,v)};JPoint.prototype.mixedAdd=function mixedAdd(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr();var r=this.x;var i=e.x.redMul(t);var n=this.y;var a=e.y.redMul(t).redMul(this.z);var s=r.redSub(i);var o=n.redSub(a);if(s.cmpn(0)===0){if(o.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl()}var h=s.redSqr();var u=h.redMul(s);var d=r.redMul(h);var c=o.redSqr().redIAdd(u).redISub(d).redISub(d);var l=o.redMul(d.redISub(c)).redISub(n.redMul(u));var p=this.z.redMul(s);return this.curve.jpoint(c,l,p)};JPoint.prototype.dblp=function dblp(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var t=this;for(var r=0;r=0)return false;r.redIAdd(n);if(this.x.cmp(r)===0)return true}};JPoint.prototype.inspect=function inspect(){if(this.isInfinity())return"";return""};JPoint.prototype.isInfinity=function isInfinity(){return this.z.cmpn(0)===0}},6226:function(e,t,r){"use strict";var i=t;var n=r(7028);var a=r(9359);var s=r(4401);var o=s.assert;function PresetCurve(e){if(e.type==="short")this.curve=new a.short(e);else if(e.type==="edwards")this.curve=new a.edwards(e);else this.curve=new a.mont(e);this.g=this.curve.g;this.n=this.curve.n;this.hash=e.hash;o(this.g.validate(),"Invalid curve");o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}i.PresetCurve=PresetCurve;function defineCurve(e,t){Object.defineProperty(i,e,{configurable:true,enumerable:true,get:function(){var r=new PresetCurve(t);Object.defineProperty(i,e,{configurable:true,enumerable:true,value:r});return r}})}defineCurve("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:n.sha256,gRed:false,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});defineCurve("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:n.sha256,gRed:false,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});defineCurve("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:n.sha256,gRed:false,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});defineCurve("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff "+"fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff "+"fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f "+"5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 "+"f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:n.sha384,gRed:false,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 "+"5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 "+"0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]});defineCurve("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff "+"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff "+"ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff "+"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff "+"ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b "+"99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd "+"3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff "+"ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 "+"f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:n.sha512,gRed:false,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 "+"053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 "+"a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 "+"579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 "+"3fad0761 353c7086 a272c240 88be9476 9fd16650"]});defineCurve("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:false,g:["9"]});defineCurve("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:false,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var h;try{h=r(9702)}catch(e){h=undefined}defineCurve("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:n.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:false,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",h]})},4088:function(e,t,r){"use strict";var i=r(711);var n=r(4910);var a=r(4401);var s=r(6226);var o=r(3500);var h=a.assert;var u=r(4724);var d=r(7526);function EC(e){if(!(this instanceof EC))return new EC(e);if(typeof e==="string"){h(s.hasOwnProperty(e),"Unknown curve "+e);e=s[e]}if(e instanceof s.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}e.exports=EC;EC.prototype.keyPair=function keyPair(e){return new u(this,e)};EC.prototype.keyFromPrivate=function keyFromPrivate(e,t){return u.fromPrivate(this,e,t)};EC.prototype.keyFromPublic=function keyFromPublic(e,t){return u.fromPublic(this,e,t)};EC.prototype.genKeyPair=function genKeyPair(e){if(!e)e={};var t=new n({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||o(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()});var r=this.n.byteLength();var a=this.n.sub(new i(2));do{var s=new i(t.generate(r));if(s.cmp(a)>0)continue;s.iaddn(1);return this.keyFromPrivate(s)}while(true)};EC.prototype._truncateToN=function truncateToN(e,t){var r=e.byteLength()*8-this.n.bitLength();if(r>0)e=e.ushrn(r);if(!t&&e.cmp(this.n)>=0)return e.sub(this.n);else return e};EC.prototype.sign=function sign(e,t,r,a){if(typeof r==="object"){a=r;r=null}if(!a)a={};t=this.keyFromPrivate(t,r);e=this._truncateToN(new i(e,16));var s=this.n.byteLength();var o=t.getPrivate().toArray("be",s);var h=e.toArray("be",s);var u=new n({hash:this.hash,entropy:o,nonce:h,pers:a.pers,persEnc:a.persEnc||"utf8"});var c=this.n.sub(new i(1));for(var l=0;true;l++){var p=a.k?a.k(l):new i(u.generate(this.n.byteLength()));p=this._truncateToN(p,true);if(p.cmpn(1)<=0||p.cmp(c)>=0)continue;var v=this.g.mul(p);if(v.isInfinity())continue;var b=v.getX();var m=b.umod(this.n);if(m.cmpn(0)===0)continue;var y=p.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));y=y.umod(this.n);if(y.cmpn(0)===0)continue;var g=(v.getY().isOdd()?1:0)|(b.cmp(m)!==0?2:0);if(a.canonical&&y.cmp(this.nh)>0){y=this.n.sub(y);g^=1}return new d({r:m,s:y,recoveryParam:g})}};EC.prototype.verify=function verify(e,t,r,n){e=this._truncateToN(new i(e,16));r=this.keyFromPublic(r,n);t=new d(t,"hex");var a=t.r;var s=t.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return false;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return false;var o=s.invm(this.n);var h=o.mul(e).umod(this.n);var u=o.mul(a).umod(this.n);if(!this.curve._maxwellTrick){var c=this.g.mulAdd(h,r.getPublic(),u);if(c.isInfinity())return false;return c.getX().umod(this.n).cmp(a)===0}var c=this.g.jmulAdd(h,r.getPublic(),u);if(c.isInfinity())return false;return c.eqXToP(a)};EC.prototype.recoverPubKey=function(e,t,r,n){h((3&r)===r,"The recovery param is more than two bits");t=new d(t,n);var a=this.n;var s=new i(e);var o=t.r;var u=t.s;var c=r&1;var l=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");if(l)o=this.curve.pointFromX(o.add(this.curve.n),c);else o=this.curve.pointFromX(o,c);var p=t.r.invm(a);var v=a.sub(s).mul(p).umod(a);var b=u.mul(p).umod(a);return this.g.mulAdd(v,o,b)};EC.prototype.getKeyRecoveryParam=function(e,t,r,i){t=new d(t,i);if(t.recoveryParam!==null)return t.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(e,t,n)}catch(e){continue}if(a.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},4724:function(e,t,r){"use strict";var i=r(711);var n=r(4401);var a=n.assert;function KeyPair(e,t){this.ec=e;this.priv=null;this.pub=null;if(t.priv)this._importPrivate(t.priv,t.privEnc);if(t.pub)this._importPublic(t.pub,t.pubEnc)}e.exports=KeyPair;KeyPair.fromPublic=function fromPublic(e,t,r){if(t instanceof KeyPair)return t;return new KeyPair(e,{pub:t,pubEnc:r})};KeyPair.fromPrivate=function fromPrivate(e,t,r){if(t instanceof KeyPair)return t;return new KeyPair(e,{priv:t,privEnc:r})};KeyPair.prototype.validate=function validate(){var e=this.getPublic();if(e.isInfinity())return{result:false,reason:"Invalid public key"};if(!e.validate())return{result:false,reason:"Public key is not a point"};if(!e.mul(this.ec.curve.n).isInfinity())return{result:false,reason:"Public key * N != O"};return{result:true,reason:null}};KeyPair.prototype.getPublic=function getPublic(e,t){if(typeof e==="string"){t=e;e=null}if(!this.pub)this.pub=this.ec.g.mul(this.priv);if(!t)return this.pub;return this.pub.encode(t,e)};KeyPair.prototype.getPrivate=function getPrivate(e){if(e==="hex")return this.priv.toString(16,2);else return this.priv};KeyPair.prototype._importPrivate=function _importPrivate(e,t){this.priv=new i(e,t||16);this.priv=this.priv.umod(this.ec.curve.n)};KeyPair.prototype._importPublic=function _importPublic(e,t){if(e.x||e.y){if(this.ec.curve.type==="mont"){a(e.x,"Need x coordinate")}else if(this.ec.curve.type==="short"||this.ec.curve.type==="edwards"){a(e.x&&e.y,"Need both x and y coordinate")}this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)};KeyPair.prototype.derive=function derive(e){return e.mul(this.priv).getX()};KeyPair.prototype.sign=function sign(e,t,r){return this.ec.sign(e,this,t,r)};KeyPair.prototype.verify=function verify(e,t){return this.ec.verify(e,t,this)};KeyPair.prototype.inspect=function inspect(){return""}},7526:function(e,t,r){"use strict";var i=r(711);var n=r(4401);var a=n.assert;function Signature(e,t){if(e instanceof Signature)return e;if(this._importDER(e,t))return;a(e.r&&e.s,"Signature without r or s");this.r=new i(e.r,16);this.s=new i(e.s,16);if(e.recoveryParam===undefined)this.recoveryParam=null;else this.recoveryParam=e.recoveryParam}e.exports=Signature;function Position(){this.place=0}function getLength(e,t){var r=e[t.place++];if(!(r&128)){return r}var i=r&15;if(i===0||i>4){return false}var n=0;for(var a=0,s=t.place;a>>=0}if(n<=127){return false}t.place=s;return n}function rmPadding(e){var t=0;var r=e.length-1;while(!e[t]&&!(e[t+1]&128)&&t>>3);e.push(r|128);while(--r){e.push(t>>>(r<<3)&255)}e.push(t)}Signature.prototype.toDER=function toDER(e){var t=this.r.toArray();var r=this.s.toArray();if(t[0]&128)t=[0].concat(t);if(r[0]&128)r=[0].concat(r);t=rmPadding(t);r=rmPadding(r);while(!r[0]&&!(r[1]&128)){r=r.slice(1)}var i=[2];constructLength(i,t.length);i=i.concat(t);i.push(2);constructLength(i,r.length);var a=i.concat(r);var s=[48];constructLength(s,a.length);s=s.concat(a);return n.encode(s,e)}},8511:function(e,t,r){"use strict";var i=r(7028);var n=r(6226);var a=r(4401);var s=a.assert;var o=a.parseBytes;var h=r(9917);var u=r(9314);function EDDSA(e){s(e==="ed25519","only tested with ed25519 so far");if(!(this instanceof EDDSA))return new EDDSA(e);var e=n[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=i.sha512}e.exports=EDDSA;EDDSA.prototype.sign=function sign(e,t){e=o(e);var r=this.keyFromSecret(t);var i=this.hashInt(r.messagePrefix(),e);var n=this.g.mul(i);var a=this.encodePoint(n);var s=this.hashInt(a,r.pubBytes(),e).mul(r.priv());var h=i.add(s).umod(this.curve.n);return this.makeSignature({R:n,S:h,Rencoded:a})};EDDSA.prototype.verify=function verify(e,t,r){e=o(e);t=this.makeSignature(t);var i=this.keyFromPublic(r);var n=this.hashInt(t.Rencoded(),i.pubBytes(),e);var a=this.g.mul(t.S());var s=t.R().add(i.pub().mul(n));return s.eq(a)};EDDSA.prototype.hashInt=function hashInt(){var e=this.hash();for(var t=0;t(n>>1)-1)o=(n>>1)-h;else o=h;a.isubn(o)}else{o=0}i[s]=o;a.iushrn(1)}return i}i.getNAF=getNAF;function getJSF(e,t){var r=[[],[]];e=e.clone();t=t.clone();var i=0;var n=0;while(e.cmpn(-i)>0||t.cmpn(-n)>0){var a=e.andln(3)+i&3;var s=t.andln(3)+n&3;if(a===3)a=-1;if(s===3)s=-1;var o;if((a&1)===0){o=0}else{var h=e.andln(7)+i&7;if((h===3||h===5)&&s===2)o=-a;else o=a}r[0].push(o);var u;if((s&1)===0){u=0}else{var h=t.andln(7)+n&7;if((h===3||h===5)&&a===2)u=-s;else u=s}r[1].push(u);if(2*i===o+1)i=1-i;if(2*n===u+1)n=1-n;e.iushrn(1);t.iushrn(1)}return r}i.getJSF=getJSF;function cachedProperty(e,t,r){var i="_"+t;e.prototype[t]=function cachedProperty(){return this[i]!==undefined?this[i]:this[i]=r.call(this)}}i.cachedProperty=cachedProperty;function parseBytes(e){return typeof e==="string"?i.toArray(e,"hex"):e}i.parseBytes=parseBytes;function intFromLE(e){return new n(e,"hex","le")}i.intFromLE=intFromLE},8368:function(e,t,r){var i=r(6911).Buffer;var n=r(3533);function EVP_BytesToKey(e,t,r,a){if(!i.isBuffer(e))e=i.from(e,"binary");if(t){if(!i.isBuffer(t))t=i.from(t,"binary");if(t.length!==8)throw new RangeError("salt should be Buffer with 8 byte length")}var s=r/8;var o=i.alloc(s);var h=i.alloc(a||0);var u=i.alloc(0);while(s>0||a>0){var d=new n;d.update(u);d.update(e);if(t)d.update(t);u=d.digest();var c=0;if(s>0){var l=o.length-s;c=Math.min(s,u.length);u.copy(o,l,0,c);s-=c}if(c0){var p=h.length-a;var v=Math.min(a,u.length-c);u.copy(h,p,c,c+v);a-=v}}u.fill(0);return{key:o,iv:h}}e.exports=EVP_BytesToKey},9029:function(e,t,r){"use strict";var i=r(6911).Buffer;var n=r(3726).Transform;var a=r(3782);function throwIfNotStringOrBuffer(e,t){if(!i.isBuffer(e)&&typeof e!=="string"){throw new TypeError(t+" must be a string or a buffer")}}function HashBase(e){n.call(this);this._block=i.allocUnsafe(e);this._blockSize=e;this._blockOffset=0;this._length=[0,0,0,0];this._finalized=false}a(HashBase,n);HashBase.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)};HashBase.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)};HashBase.prototype.update=function(e,t){throwIfNotStringOrBuffer(e,"Data");if(this._finalized)throw new Error("Digest already called");if(!i.isBuffer(e))e=i.from(e,t);var r=this._block;var n=0;while(this._blockOffset+e.length-n>=this._blockSize){for(var a=this._blockOffset;a0;++s){this._length[s]+=o;o=this._length[s]/4294967296|0;if(o>0)this._length[s]-=4294967296*o}return this};HashBase.prototype._update=function(){throw new Error("_update is not implemented")};HashBase.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=true;var t=this._digest();if(e!==undefined)t=t.toString(e);this._block.fill(0);this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t};HashBase.prototype._digest=function(){throw new Error("_digest is not implemented")};e.exports=HashBase},7028:function(e,t,r){var i=t;i.utils=r(263);i.common=r(1330);i.sha=r(301);i.ripemd=r(3079);i.hmac=r(3092);i.sha1=i.sha.sha1;i.sha256=i.sha.sha256;i.sha224=i.sha.sha224;i.sha384=i.sha.sha384;i.sha512=i.sha.sha512;i.ripemd160=i.ripemd.ripemd160},1330:function(e,t,r){"use strict";var i=r(263);var n=r(3523);function BlockHash(){this.pending=null;this.pendingTotal=0;this.blockSize=this.constructor.blockSize;this.outSize=this.constructor.outSize;this.hmacStrength=this.constructor.hmacStrength;this.padLength=this.constructor.padLength/8;this.endian="big";this._delta8=this.blockSize/8;this._delta32=this.blockSize/32}t.BlockHash=BlockHash;BlockHash.prototype.update=function update(e,t){e=i.toArray(e,t);if(!this.pending)this.pending=e;else this.pending=this.pending.concat(e);this.pendingTotal+=e.length;if(this.pending.length>=this._delta8){e=this.pending;var r=e.length%this._delta8;this.pending=e.slice(e.length-r,e.length);if(this.pending.length===0)this.pending=null;e=i.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255;i[n++]=e>>>16&255;i[n++]=e>>>8&255;i[n++]=e&255}else{i[n++]=e&255;i[n++]=e>>>8&255;i[n++]=e>>>16&255;i[n++]=e>>>24&255;i[n++]=0;i[n++]=0;i[n++]=0;i[n++]=0;for(a=8;athis.blockSize)e=(new this.Hash).update(e).digest();n(e.length<=this.blockSize);for(var t=e.length;t>>3}t.g0_256=g0_256;function g1_256(e){return n(e,17)^n(e,19)^e>>>10}t.g1_256=g1_256},263:function(e,t,r){"use strict";var i=r(3523);var n=r(3782);t.inherits=n;function isSurrogatePair(e,t){if((e.charCodeAt(t)&64512)!==55296){return false}if(t<0||t+1>=e.length){return false}return(e.charCodeAt(t+1)&64512)===56320}function toArray(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e==="string"){if(!t){var i=0;for(var n=0;n>6|192;r[i++]=a&63|128}else if(isSurrogatePair(e,n)){a=65536+((a&1023)<<10)+(e.charCodeAt(++n)&1023);r[i++]=a>>18|240;r[i++]=a>>12&63|128;r[i++]=a>>6&63|128;r[i++]=a&63|128}else{r[i++]=a>>12|224;r[i++]=a>>6&63|128;r[i++]=a&63|128}}}else if(t==="hex"){e=e.replace(/[^a-z0-9]+/gi,"");if(e.length%2!==0)e="0"+e;for(n=0;n>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24;return t>>>0}t.htonl=htonl;function toHex32(e,t){var r="";for(var i=0;i>>0}return s}t.join32=join32;function split32(e,t){var r=new Array(e.length*4);for(var i=0,n=0;i>>24;r[n+1]=a>>>16&255;r[n+2]=a>>>8&255;r[n+3]=a&255}else{r[n+3]=a>>>24;r[n+2]=a>>>16&255;r[n+1]=a>>>8&255;r[n]=a&255}}return r}t.split32=split32;function rotr32(e,t){return e>>>t|e<<32-t}t.rotr32=rotr32;function rotl32(e,t){return e<>>32-t}t.rotl32=rotl32;function sum32(e,t){return e+t>>>0}t.sum32=sum32;function sum32_3(e,t,r){return e+t+r>>>0}t.sum32_3=sum32_3;function sum32_4(e,t,r,i){return e+t+r+i>>>0}t.sum32_4=sum32_4;function sum32_5(e,t,r,i,n){return e+t+r+i+n>>>0}t.sum32_5=sum32_5;function sum64(e,t,r,i){var n=e[t];var a=e[t+1];var s=i+a>>>0;var o=(s>>0;e[t+1]=s}t.sum64=sum64;function sum64_hi(e,t,r,i){var n=t+i>>>0;var a=(n>>0}t.sum64_hi=sum64_hi;function sum64_lo(e,t,r,i){var n=t+i;return n>>>0}t.sum64_lo=sum64_lo;function sum64_4_hi(e,t,r,i,n,a,s,o){var h=0;var u=t;u=u+i>>>0;h+=u>>0;h+=u>>0;h+=u>>0}t.sum64_4_hi=sum64_4_hi;function sum64_4_lo(e,t,r,i,n,a,s,o){var h=t+i+a+o;return h>>>0}t.sum64_4_lo=sum64_4_lo;function sum64_5_hi(e,t,r,i,n,a,s,o,h,u){var d=0;var c=t;c=c+i>>>0;d+=c>>0;d+=c>>0;d+=c>>0;d+=c>>0}t.sum64_5_hi=sum64_5_hi;function sum64_5_lo(e,t,r,i,n,a,s,o,h,u){var d=t+i+a+o+u;return d>>>0}t.sum64_5_lo=sum64_5_lo;function rotr64_hi(e,t,r){var i=t<<32-r|e>>>r;return i>>>0}t.rotr64_hi=rotr64_hi;function rotr64_lo(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}t.rotr64_lo=rotr64_lo;function shr64_hi(e,t,r){return e>>>r}t.shr64_hi=shr64_hi;function shr64_lo(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}t.shr64_lo=shr64_lo},4910:function(e,t,r){"use strict";var i=r(7028);var n=r(6545);var a=r(3523);function HmacDRBG(e){if(!(this instanceof HmacDRBG))return new HmacDRBG(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=n.toArray(e.entropy,e.entropyEnc||"hex");var r=n.toArray(e.nonce,e.nonceEnc||"hex");var i=n.toArray(e.pers,e.persEnc||"hex");a(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits");this._init(t,r,i)}e.exports=HmacDRBG;HmacDRBG.prototype._init=function init(e,t,r){var i=e.concat(t).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(e.concat(r||[]));this._reseed=1};HmacDRBG.prototype.generate=function generate(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");if(typeof t!=="string"){i=r;r=t;t=null}if(r){r=n.toArray(r,i||"hex");this._update(r)}var a=[];while(a.length56){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=a.allocUnsafe(16);e.writeInt32LE(this._a,0);e.writeInt32LE(this._b,4);e.writeInt32LE(this._c,8);e.writeInt32LE(this._d,12);return e};function rotl(e,t){return e<>>32-t}function fnF(e,t,r,i,n,a,s){return rotl(e+(t&r|~t&i)+n+a|0,s)+t|0}function fnG(e,t,r,i,n,a,s){return rotl(e+(t&i|r&~i)+n+a|0,s)+t|0}function fnH(e,t,r,i,n,a,s){return rotl(e+(t^r^i)+n+a|0,s)+t|0}function fnI(e,t,r,i,n,a,s){return rotl(e+(r^(t|~i))+n+a|0,s)+t|0}e.exports=MD5},1354:function(e,t,r){var i=r(711);var n=r(3500);function MillerRabin(e){this.rand=e||new n.Rand}e.exports=MillerRabin;MillerRabin.create=function create(e){return new MillerRabin(e)};MillerRabin.prototype._randbelow=function _randbelow(e){var t=e.bitLength();var r=Math.ceil(t/8);do{var n=new i(this.rand.generate(r))}while(n.cmp(e)>=0);return n};MillerRabin.prototype._randrange=function _randrange(e,t){var r=t.sub(e);return e.add(this._randbelow(r))};MillerRabin.prototype.test=function test(e,t,r){var n=e.bitLength();var a=i.mont(e);var s=new i(1).toRed(a);if(!t)t=Math.max(1,n/48|0);var o=e.subn(1);for(var h=0;!o.testn(h);h++){}var u=e.shrn(h);var d=o.toRed(a);var c=true;for(;t>0;t--){var l=this._randrange(new i(2),o);if(r)r(l);var p=l.toRed(a).redPow(u);if(p.cmp(s)===0||p.cmp(d)===0)continue;for(var v=1;v0;t--){var d=this._randrange(new i(2),s);var c=e.gcd(d);if(c.cmpn(1)!==0)return c;var l=d.toRed(n).redPow(h);if(l.cmp(a)===0||l.cmp(u)===0)continue;for(var p=1;p>8;var s=n&255;if(a)r.push(a,s);else r.push(s)}}return r}r.toArray=toArray;function zero2(e){if(e.length===1)return"0"+e;else return e}r.zero2=zero2;function toHex(e){var t="";for(var r=0;rt||r!==r){throw new TypeError("Bad key length")}}},2127:function(e,t,r){var i={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};var n=r(4873);var a=r(6911).Buffer;var s=r(5349);var o=r(7007);var h=r(5407);function pbkdf2(e,t,r,u,d){s(r,u);e=h(e,o,"Password");t=h(t,o,"Salt");d=d||"sha1";var c=a.allocUnsafe(u);var l=a.allocUnsafe(t.length+4);t.copy(l,0,0,t.length);var p=0;var v=i[d];var b=Math.ceil(u/v);for(var m=1;m<=b;m++){l.writeUInt32BE(m,t.length);var y=n(d,e).update(l).digest();var g=y;for(var _=1;_h||new s(t).cmp(a.modulus)>=0){throw new Error("decryption error")}var c;if(r){c=u(new s(t),a)}else{c=o(t,a)}var l=d.alloc(h-c.length);c=d.concat([l,c],h);if(n===4){return oaep(a,c)}else if(n===1){return pkcs1(a,c,r)}else if(n===3){return c}else{throw new Error("unknown padding")}};function oaep(e,t){var r=e.modulus.byteLength();var i=h("sha1").update(d.alloc(0)).digest();var s=i.length;if(t[0]!==0){throw new Error("decryption error")}var o=t.slice(1,s+1);var u=t.slice(s+1);var c=a(o,n(u,s));var l=a(u,n(c,r-s-1));if(compare(i,l.slice(0,s))){throw new Error("decryption error")}var p=s;while(l[p]===0){p++}if(l[p++]!==1){throw new Error("decryption error")}return l.slice(p)}function pkcs1(e,t,r){var i=t.slice(0,2);var n=2;var a=0;while(t[n++]!==0){if(n>=t.length){a++;break}}var s=t.slice(2,n-1);if(i.toString("hex")!=="0002"&&!r||i.toString("hex")!=="0001"&&r){a++}if(s.length<8){a++}if(a){throw new Error("decryption error")}return t.slice(n)}function compare(e,t){e=d.from(e);t=d.from(t);var r=0;var i=e.length;if(e.length!==t.length){r++;i=Math.min(e.length,t.length)}var n=-1;while(++n=0){throw new Error("data too long for modulus")}}else{throw new Error("unknown padding")}if(r){return d(s,a)}else{return u(s,a)}};function oaep(e,t){var r=e.modulus.byteLength();var i=t.length;var u=a("sha1").update(c.alloc(0)).digest();var d=u.length;var l=2*d;if(i>r-l-2){throw new Error("message too long")}var p=c.alloc(r-i-l-2);var v=r-d-1;var b=n(d);var m=o(c.concat([u,p,c.alloc(1,1),t],v),s(b,v));var y=o(b,s(m,d));return new h(c.concat([c.alloc(1),y,m],r))}function pkcs1(e,t,r){var i=t.length;var n=e.modulus.byteLength();if(i>n-11){throw new Error("message too long")}var a;if(r){a=c.alloc(n-i-3,255)}else{a=nonZero(n-i-3)}return new h(c.concat([c.from([0,r?1:2]),a,c.alloc(1),t],n))}function nonZero(e){var t=c.allocUnsafe(e);var r=0;var i=n(e*2);var a=0;var s;while(rn)throw new RangeError("requested too many random bytes");var r=a.allocUnsafe(e);if(e>0){if(e>i){for(var o=0;oh||e<0){throw new TypeError("offset must be a uint32")}if(e>s||e>t){throw new RangeError("offset out of range")}}function assertSize(e,t,r){if(typeof e!=="number"||e!==e){throw new TypeError("size must be a number")}if(e>h||e<0){throw new TypeError("size must be a uint32")}if(e+t>r||e>s){throw new RangeError("buffer too small")}}if(o&&o.getRandomValues||!true){t.randomFill=randomFill;t.randomFillSync=randomFillSync}else{t.randomFill=oldBrowser;t.randomFillSync=oldBrowser}function randomFill(e,t,r,i){if(!a.isBuffer(e)&&!(e instanceof __webpack_require__.g.Uint8Array)){throw new TypeError('"buf" argument must be a Buffer or Uint8Array')}if(typeof t==="function"){i=t;t=0;r=e.length}else if(typeof r==="function"){i=r;r=e.length-t}else if(typeof i!=="function"){throw new TypeError('"cb" argument must be a function')}assertOffset(t,e.length);assertSize(r,t,e.length);return actualFill(e,t,r,i)}function actualFill(e,t,r,i){if(true){var a=e.buffer;var s=new Uint8Array(a,t,r);o.getRandomValues(s);if(i){process.nextTick((function(){i(null,e)}));return}return e}if(i){n(r,(function(r,n){if(r){return i(r)}n.copy(e,t);i(null,e)}));return}var h=n(r);h.copy(e,t);return e}function randomFillSync(e,t,r){if(typeof t==="undefined"){t=0}if(!a.isBuffer(e)&&!(e instanceof __webpack_require__.g.Uint8Array)){throw new TypeError('"buf" argument must be a Buffer or Uint8Array')}assertOffset(t,e.length);if(r===undefined)r=e.length-t;assertSize(r,t,e.length);return actualFill(e,t,r)}},4646:function(e){"use strict";const t={};function createErrorType(e,r,i){if(!i){i=Error}function getMessage(e,t,i){if(typeof r==="string"){return r}else{return r(e,t,i)}}class NodeError extends i{constructor(e,t,r){super(getMessage(e,t,r))}}NodeError.prototype.name=i.name;NodeError.prototype.code=e;t[e]=NodeError}function oneOf(e,t){if(Array.isArray(e)){const r=e.length;e=e.map((e=>String(e)));if(r>2){return`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]}else if(r===2){return`one of ${t} ${e[0]} or ${e[1]}`}else{return`of ${t} ${e[0]}`}}else{return`of ${t} ${String(e)}`}}function startsWith(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function endsWith(e,t,r){if(r===undefined||r>e.length){r=e.length}return e.substring(r-t.length,r)===t}function includes(e,t,r){if(typeof r!=="number"){r=0}if(r+t.length>e.length){return false}else{return e.indexOf(t,r)!==-1}}createErrorType("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError);createErrorType("ERR_INVALID_ARG_TYPE",(function(e,t,r){let i;if(typeof t==="string"&&startsWith(t,"not ")){i="must not be";t=t.replace(/^not /,"")}else{i="must be"}let n;if(endsWith(e," argument")){n=`The ${e} ${i} ${oneOf(t,"type")}`}else{const r=includes(e,".")?"property":"argument";n=`The "${e}" ${r} ${i} ${oneOf(t,"type")}`}n+=`. Received type ${typeof r}`;return n}),TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"}));createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"}));createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");e.exports.q=t},2403:function(e,t,r){"use strict";var i=Object.keys||function(e){var t=[];for(var r in e){t.push(r)}return t};e.exports=Duplex;var n=r(1709);var a=r(7337);r(3782)(Duplex,n);{var s=i(a.prototype);for(var o=0;o0){if(typeof t!=="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==o.prototype){t=_uint8ArrayToBuffer(t)}if(i){if(a.endEmitted)E(e,new _);else addChunk(e,a,t,true)}else if(a.ended){E(e,new y)}else if(a.destroyed){return false}else{a.reading=false;if(a.decoder&&!r){t=a.decoder.write(t);if(a.objectMode||t.length!==0)addChunk(e,a,t,false);else maybeReadMore(e,a)}else{addChunk(e,a,t,false)}}}else if(!i){a.reading=false;maybeReadMore(e,a)}}return!a.ended&&(a.length=A){e=A}else{e--;e|=e>>>1;e|=e>>>2;e|=e>>>4;e|=e>>>8;e|=e>>>16;e++}return e}function howMuchToRead(e,t){if(e<=0||t.length===0&&t.ended)return 0;if(t.objectMode)return 1;if(e!==e){if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length}if(e>t.highWaterMark)t.highWaterMark=computeNewHighWaterMark(e);if(e<=t.length)return e;if(!t.ended){t.needReadable=true;return 0}return t.length}Readable.prototype.read=function(e){d("read",e);e=parseInt(e,10);var t=this._readableState;var r=e;if(e!==0)t.emittedReadable=false;if(e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended)){d("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)endReadable(this);else emitReadable(this);return null}e=howMuchToRead(e,t);if(e===0&&t.ended){if(t.length===0)endReadable(this);return null}var i=t.needReadable;d("need readable",i);if(t.length===0||t.length-e0)n=fromList(e,t);else n=null;if(n===null){t.needReadable=t.length<=t.highWaterMark;e=0}else{t.length-=e;t.awaitDrain=0}if(t.length===0){if(!t.ended)t.needReadable=true;if(r!==e&&t.ended)endReadable(this)}if(n!==null)this.emit("data",n);return n};function onEofChunk(e,t){d("onEofChunk");if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;if(t.sync){emitReadable(e)}else{t.needReadable=false;if(!t.emittedReadable){t.emittedReadable=true;emitReadable_(e)}}}function emitReadable(e){var t=e._readableState;d("emitReadable",t.needReadable,t.emittedReadable);t.needReadable=false;if(!t.emittedReadable){d("emitReadable",t.flowing);t.emittedReadable=true;process.nextTick(emitReadable_,e)}}function emitReadable_(e){var t=e._readableState;d("emitReadable_",t.destroyed,t.length,t.ended);if(!t.destroyed&&(t.length||t.ended)){e.emit("readable");t.emittedReadable=false}t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark;flow(e)}function maybeReadMore(e,t){if(!t.readingMore){t.readingMore=true;process.nextTick(maybeReadMore_,e,t)}}function maybeReadMore_(e,t){while(!t.reading&&!t.ended&&(t.length1&&indexOf(i.pipes,e)!==-1)&&!h){d("false write response, pause",i.awaitDrain);i.awaitDrain++}r.pause()}}function onerror(t){d("onerror",t);unpipe();e.removeListener("error",onerror);if(a(e,"error")===0)E(e,t)}prependListener(e,"error",onerror);function onclose(){e.removeListener("finish",onfinish);unpipe()}e.once("close",onclose);function onfinish(){d("onfinish");e.removeListener("close",onclose);unpipe()}e.once("finish",onfinish);function unpipe(){d("unpipe");r.unpipe(e)}e.emit("pipe",r);if(!i.flowing){d("pipe resume");r.resume()}return e};function pipeOnDrain(e){return function pipeOnDrainFunctionResult(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain);if(t.awaitDrain)t.awaitDrain--;if(t.awaitDrain===0&&a(e,"data")){t.flowing=true;flow(e)}}}Readable.prototype.unpipe=function(e){var t=this._readableState;var r={hasUnpiped:false};if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;t.pipes=null;t.pipesCount=0;t.flowing=false;if(e)e.emit("unpipe",this,r);return this}if(!e){var i=t.pipes;var n=t.pipesCount;t.pipes=null;t.pipesCount=0;t.flowing=false;for(var a=0;a0;if(i.flowing!==false)this.resume()}else if(e==="readable"){if(!i.endEmitted&&!i.readableListening){i.readableListening=i.needReadable=true;i.flowing=false;i.emittedReadable=false;d("on readable",i.length,i.reading);if(i.length){emitReadable(this)}else if(!i.reading){process.nextTick(nReadingNextTick,this)}}}return r};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);if(e==="readable"){process.nextTick(updateReadableListening,this)}return r};Readable.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);if(e==="readable"||e===undefined){process.nextTick(updateReadableListening,this)}return t};function updateReadableListening(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0;if(t.resumeScheduled&&!t.paused){t.flowing=true}else if(e.listenerCount("data")>0){e.resume()}}function nReadingNextTick(e){d("readable nexttick read 0");e.read(0)}Readable.prototype.resume=function(){var e=this._readableState;if(!e.flowing){d("resume");e.flowing=!e.readableListening;resume(this,e)}e.paused=false;return this};function resume(e,t){if(!t.resumeScheduled){t.resumeScheduled=true;process.nextTick(resume_,e,t)}}function resume_(e,t){d("resume",t.reading);if(!t.reading){e.read(0)}t.resumeScheduled=false;e.emit("resume");flow(e);if(t.flowing&&!t.reading)e.read(0)}Readable.prototype.pause=function(){d("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){d("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function flow(e){var t=e._readableState;d("flow",t.flowing);while(t.flowing&&e.read()!==null){}}Readable.prototype.wrap=function(e){var t=this;var r=this._readableState;var i=false;e.on("end",(function(){d("wrapped end");if(r.decoder&&!r.ended){var e=r.decoder.end();if(e&&e.length)t.push(e)}t.push(null)}));e.on("data",(function(n){d("wrapped data");if(r.decoder)n=r.decoder.write(n);if(r.objectMode&&(n===null||n===undefined))return;else if(!r.objectMode&&(!n||!n.length))return;var a=t.push(n);if(!a){i=true;e.pause()}}));for(var n in e){if(this[n]===undefined&&typeof e[n]==="function"){this[n]=function methodWrap(t){return function methodWrapReturnFunction(){return e[t].apply(e,arguments)}}(n)}}for(var a=0;a=t.length){if(t.decoder)r=t.buffer.join("");else if(t.buffer.length===1)r=t.buffer.first();else r=t.buffer.concat(t.length);t.buffer.clear()}else{r=t.buffer.consume(e,t.decoder)}return r}function endReadable(e){var t=e._readableState;d("endReadable",t.endEmitted);if(!t.endEmitted){t.ended=true;process.nextTick(endReadableNT,t,e)}}function endReadableNT(e,t){d("endReadableNT",e.endEmitted,e.length);if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end");if(e.autoDestroy){var r=t._writableState;if(!r||r.autoDestroy&&r.finished){t.destroy()}}}}if(typeof Symbol==="function"){Readable.from=function(e,t){if(B===undefined){B=r(9727)}return B(Readable,e,t)}}function indexOf(e,t){for(var r=0,i=e.length;r-1))throw new _(e);this._writableState.defaultEncoding=e;return this};Object.defineProperty(Writable.prototype,"writableBuffer",{enumerable:false,get:function get(){return this._writableState&&this._writableState.getBuffer()}});function decodeChunk(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=s.from(t,r)}return t}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function get(){return this._writableState.highWaterMark}});function writeOrBuffer(e,t,r,i,n,a){if(!r){var s=decodeChunk(t,i,n);if(i!==s){r=true;n="buffer";i=s}}var o=t.objectMode?1:i.length;t.length+=o;var h=t.length0)this.tail.next=t;else this.head=t;this.tail=t;++this.length}},{key:"unshift",value:function unshift(e){var t={data:e,next:this.head};if(this.length===0)this.tail=t;this.head=t;++this.length}},{key:"shift",value:function shift(){if(this.length===0)return;var e=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return e}},{key:"clear",value:function clear(){this.head=this.tail=null;this.length=0}},{key:"join",value:function join(e){if(this.length===0)return"";var t=this.head;var r=""+t.data;while(t=t.next){r+=e+t.data}return r}},{key:"concat",value:function concat(e){if(this.length===0)return n.alloc(0);var t=n.allocUnsafe(e>>>0);var r=this.head;var i=0;while(r){copyBuffer(r.data,t,i);i+=r.data.length;r=r.next}return t}},{key:"consume",value:function consume(e,t){var r;if(en.length?n.length:e;if(a===n.length)i+=n;else i+=n.slice(0,e);e-=a;if(e===0){if(a===n.length){++r;if(t.next)this.head=t.next;else this.head=this.tail=null}else{this.head=t;t.data=n.slice(a)}break}++r}this.length-=r;return i}},{key:"_getBuffer",value:function _getBuffer(e){var t=n.allocUnsafe(e);var r=this.head;var i=1;r.data.copy(t);e-=r.data.length;while(r=r.next){var a=r.data;var s=e>a.length?a.length:e;a.copy(t,t.length-e,0,s);e-=s;if(e===0){if(s===a.length){++i;if(r.next)this.head=r.next;else this.head=this.tail=null}else{this.head=r;r.data=a.slice(s)}break}++i}this.length-=i;return t}},{key:o,value:function value(e,t){return s(this,_objectSpread({},t,{depth:0,customInspect:false}))}}]);return BufferList}()},7025:function(e){"use strict";function destroy(e,t){var r=this;var i=this._readableState&&this._readableState.destroyed;var n=this._writableState&&this._writableState.destroyed;if(i||n){if(t){t(e)}else if(e){if(!this._writableState){process.nextTick(emitErrorNT,this,e)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;process.nextTick(emitErrorNT,this,e)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(e||null,(function(e){if(!t&&e){if(!r._writableState){process.nextTick(emitErrorAndCloseNT,r,e)}else if(!r._writableState.errorEmitted){r._writableState.errorEmitted=true;process.nextTick(emitErrorAndCloseNT,r,e)}else{process.nextTick(emitCloseNT,r)}}else if(t){process.nextTick(emitCloseNT,r);t(e)}else{process.nextTick(emitCloseNT,r)}}));return this}function emitErrorAndCloseNT(e,t){emitErrorNT(e,t);emitCloseNT(e)}function emitCloseNT(e){if(e._writableState&&!e._writableState.emitClose)return;if(e._readableState&&!e._readableState.emitClose)return;e.emit("close")}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(e,t){e.emit("error",t)}function errorOrDestroy(e,t){var r=e._readableState;var i=e._writableState;if(r&&r.autoDestroy||i&&i.autoDestroy)e.destroy(t);else e.emit("error",t)}e.exports={destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy}},9698:function(e,t,r){"use strict";var i=r(4646).q.ERR_STREAM_PREMATURE_CLOSE;function once(e){var t=false;return function(){if(t)return;t=true;for(var r=arguments.length,i=new Array(r),n=0;n0;return destroyer(e,a,o,(function(e){if(!n)n=e;if(e)s.forEach(call);if(a)return;s.forEach(call);i(n)}))}));return t.reduce(pipe)}e.exports=pipeline},6776:function(e,t,r){"use strict";var i=r(4646).q.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function getHighWaterMark(e,t,r,n){var a=highWaterMarkFrom(t,n,r);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var s=n?r:"highWaterMark";throw new i(s,a)}return Math.floor(a)}return e.objectMode?16:16*1024}e.exports={getHighWaterMark:getHighWaterMark}},4678:function(e,t,r){e.exports=r(2781)},3726:function(e,t,r){var i=r(2781);if(process.env.READABLE_STREAM==="disable"&&i){e.exports=i.Readable;Object.assign(e.exports,i);e.exports.Stream=i}else{t=e.exports=r(1709);t.Stream=i||t;t.Readable=t;t.Writable=r(7337);t.Duplex=r(2403);t.Transform=r(1170);t.PassThrough=r(7889);t.finished=r(9698);t.pipeline=r(8442)}},3225:function(e,t,r){"use strict";var i=r(4300).Buffer;var n=r(3782);var a=r(9029);var s=new Array(16);var o=[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];var 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];var 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];var d=[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];var c=[0,1518500249,1859775393,2400959708,2840853838];var l=[1352829926,1548603684,1836072691,2053994217,0];function RIPEMD160(){a.call(this,64);this._a=1732584193;this._b=4023233417;this._c=2562383102;this._d=271733878;this._e=3285377520}n(RIPEMD160,a);RIPEMD160.prototype._update=function(){var e=s;for(var t=0;t<16;++t)e[t]=this._block.readInt32LE(t*4);var r=this._a|0;var i=this._b|0;var n=this._c|0;var a=this._d|0;var p=this._e|0;var v=this._a|0;var b=this._b|0;var m=this._c|0;var y=this._d|0;var g=this._e|0;for(var _=0;_<80;_+=1){var w;var M;if(_<16){w=fn1(r,i,n,a,p,e[o[_]],c[0],u[_]);M=fn5(v,b,m,y,g,e[h[_]],l[0],d[_])}else if(_<32){w=fn2(r,i,n,a,p,e[o[_]],c[1],u[_]);M=fn4(v,b,m,y,g,e[h[_]],l[1],d[_])}else if(_<48){w=fn3(r,i,n,a,p,e[o[_]],c[2],u[_]);M=fn3(v,b,m,y,g,e[h[_]],l[2],d[_])}else if(_<64){w=fn4(r,i,n,a,p,e[o[_]],c[3],u[_]);M=fn2(v,b,m,y,g,e[h[_]],l[3],d[_])}else{w=fn5(r,i,n,a,p,e[o[_]],c[4],u[_]);M=fn1(v,b,m,y,g,e[h[_]],l[4],d[_])}r=p;p=a;a=rotl(n,10);n=i;i=w;v=g;g=y;y=rotl(m,10);m=b;b=M}var B=this._b+n+y|0;this._b=this._c+a+g|0;this._c=this._d+p+v|0;this._d=this._e+r+b|0;this._e=this._a+i+m|0;this._a=B};RIPEMD160.prototype._digest=function(){this._block[this._blockOffset++]=128;if(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=i.alloc?i.alloc(20):new i(20);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);return e};function rotl(e,t){return e<>>32-t}function fn1(e,t,r,i,n,a,s,o){return rotl(e+(t^r^i)+a+s|0,o)+n|0}function fn2(e,t,r,i,n,a,s,o){return rotl(e+(t&r|~t&i)+a+s|0,o)+n|0}function fn3(e,t,r,i,n,a,s,o){return rotl(e+((t|~r)^i)+a+s|0,o)+n|0}function fn4(e,t,r,i,n,a,s,o){return rotl(e+(t&i|r&~i)+a+s|0,o)+n|0}function fn5(e,t,r,i,n,a,s,o){return rotl(e+(t^(r|~i))+a+s|0,o)+n|0}e.exports=RIPEMD160},5055:function(e,t,r){var i=r(4300);var n=i.Buffer;function copyProps(e,t){for(var r in e){t[r]=e[r]}}if(n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow){e.exports=i}else{copyProps(i,t);t.Buffer=SafeBuffer}function SafeBuffer(e,t,r){return n(e,t,r)}SafeBuffer.prototype=Object.create(n.prototype);copyProps(n,SafeBuffer);SafeBuffer.from=function(e,t,r){if(typeof e==="number"){throw new TypeError("Argument must not be a number")}return n(e,t,r)};SafeBuffer.alloc=function(e,t,r){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}var i=n(e);if(t!==undefined){if(typeof r==="string"){i.fill(t,r)}else{i.fill(t)}}else{i.fill(0)}return i};SafeBuffer.allocUnsafe=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return n(e)};SafeBuffer.allocUnsafeSlow=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return i.SlowBuffer(e)}},6911:function(e,t,r){ +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ +var i=r(4300);var n=i.Buffer;function copyProps(e,t){for(var r in e){t[r]=e[r]}}if(n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow){e.exports=i}else{copyProps(i,t);t.Buffer=SafeBuffer}function SafeBuffer(e,t,r){return n(e,t,r)}SafeBuffer.prototype=Object.create(n.prototype);copyProps(n,SafeBuffer);SafeBuffer.from=function(e,t,r){if(typeof e==="number"){throw new TypeError("Argument must not be a number")}return n(e,t,r)};SafeBuffer.alloc=function(e,t,r){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}var i=n(e);if(t!==undefined){if(typeof r==="string"){i.fill(t,r)}else{i.fill(t)}}else{i.fill(0)}return i};SafeBuffer.allocUnsafe=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return n(e)};SafeBuffer.allocUnsafeSlow=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return i.SlowBuffer(e)}},2858:function(e,t,r){var i=r(6911).Buffer;function Hash(e,t){this._block=i.alloc(e);this._finalSize=t;this._blockSize=e;this._len=0}Hash.prototype.update=function(e,t){if(typeof e==="string"){t=t||"utf8";e=i.from(e,t)}var r=this._block;var n=this._blockSize;var a=e.length;var s=this._len;for(var o=0;o=this._finalSize){this._update(this._block);this._block.fill(0)}var r=this._len*8;if(r<=4294967295){this._block.writeUInt32BE(r,this._blockSize-4)}else{var i=(r&4294967295)>>>0;var n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8);this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var a=this._hash();return e?a.toString(e):a};Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")};e.exports=Hash},4371:function(e,t,r){var i=e.exports=function SHA(e){e=e.toLowerCase();var t=i[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};i.sha=r(4018);i.sha1=r(4179);i.sha224=r(532);i.sha256=r(1843);i.sha384=r(7455);i.sha512=r(9934)},4018:function(e,t,r){var i=r(3782);var n=r(2858);var a=r(6911).Buffer;var s=[1518500249,1859775393,2400959708|0,3395469782|0];var o=new Array(80);function Sha(){this.init();this._w=o;n.call(this,64,56)}i(Sha,n);Sha.prototype.init=function(){this._a=1732584193;this._b=4023233417;this._c=2562383102;this._d=271733878;this._e=3285377520;return this};function rotl5(e){return e<<5|e>>>27}function rotl30(e){return e<<30|e>>>2}function ft(e,t,r,i){if(e===0)return t&r|~t&i;if(e===2)return t&r|t&i|r&i;return t^r^i}Sha.prototype._update=function(e){var t=this._w;var r=this._a|0;var i=this._b|0;var n=this._c|0;var a=this._d|0;var o=this._e|0;for(var h=0;h<16;++h)t[h]=e.readInt32BE(h*4);for(;h<80;++h)t[h]=t[h-3]^t[h-8]^t[h-14]^t[h-16];for(var u=0;u<80;++u){var d=~~(u/20);var c=rotl5(r)+ft(d,i,n,a)+o+t[u]+s[d]|0;o=a;a=n;n=rotl30(i);i=r;r=c}this._a=r+this._a|0;this._b=i+this._b|0;this._c=n+this._c|0;this._d=a+this._d|0;this._e=o+this._e|0};Sha.prototype._hash=function(){var e=a.allocUnsafe(20);e.writeInt32BE(this._a|0,0);e.writeInt32BE(this._b|0,4);e.writeInt32BE(this._c|0,8);e.writeInt32BE(this._d|0,12);e.writeInt32BE(this._e|0,16);return e};e.exports=Sha},4179:function(e,t,r){var i=r(3782);var n=r(2858);var a=r(6911).Buffer;var s=[1518500249,1859775393,2400959708|0,3395469782|0];var o=new Array(80);function Sha1(){this.init();this._w=o;n.call(this,64,56)}i(Sha1,n);Sha1.prototype.init=function(){this._a=1732584193;this._b=4023233417;this._c=2562383102;this._d=271733878;this._e=3285377520;return this};function rotl1(e){return e<<1|e>>>31}function rotl5(e){return e<<5|e>>>27}function rotl30(e){return e<<30|e>>>2}function ft(e,t,r,i){if(e===0)return t&r|~t&i;if(e===2)return t&r|t&i|r&i;return t^r^i}Sha1.prototype._update=function(e){var t=this._w;var r=this._a|0;var i=this._b|0;var n=this._c|0;var a=this._d|0;var o=this._e|0;for(var h=0;h<16;++h)t[h]=e.readInt32BE(h*4);for(;h<80;++h)t[h]=rotl1(t[h-3]^t[h-8]^t[h-14]^t[h-16]);for(var u=0;u<80;++u){var d=~~(u/20);var c=rotl5(r)+ft(d,i,n,a)+o+t[u]+s[d]|0;o=a;a=n;n=rotl30(i);i=r;r=c}this._a=r+this._a|0;this._b=i+this._b|0;this._c=n+this._c|0;this._d=a+this._d|0;this._e=o+this._e|0};Sha1.prototype._hash=function(){var e=a.allocUnsafe(20);e.writeInt32BE(this._a|0,0);e.writeInt32BE(this._b|0,4);e.writeInt32BE(this._c|0,8);e.writeInt32BE(this._d|0,12);e.writeInt32BE(this._e|0,16);return e};e.exports=Sha1},532:function(e,t,r){var i=r(3782);var n=r(1843);var a=r(2858);var s=r(6911).Buffer;var o=new Array(64);function Sha224(){this.init();this._w=o;a.call(this,64,56)}i(Sha224,n);Sha224.prototype.init=function(){this._a=3238371032;this._b=914150663;this._c=812702999;this._d=4144912697;this._e=4290775857;this._f=1750603025;this._g=1694076839;this._h=3204075428;return this};Sha224.prototype._hash=function(){var e=s.allocUnsafe(28);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);return e};e.exports=Sha224},1843:function(e,t,r){var i=r(3782);var n=r(2858);var a=r(6911).Buffer;var 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];var o=new Array(64);function Sha256(){this.init();this._w=o;n.call(this,64,56)}i(Sha256,n);Sha256.prototype.init=function(){this._a=1779033703;this._b=3144134277;this._c=1013904242;this._d=2773480762;this._e=1359893119;this._f=2600822924;this._g=528734635;this._h=1541459225;return this};function ch(e,t,r){return r^e&(t^r)}function maj(e,t,r){return e&t|r&(e|t)}function sigma0(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function sigma1(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function gamma0(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function gamma1(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Sha256.prototype._update=function(e){var t=this._w;var r=this._a|0;var i=this._b|0;var n=this._c|0;var a=this._d|0;var o=this._e|0;var h=this._f|0;var u=this._g|0;var d=this._h|0;for(var c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<64;++c)t[c]=gamma1(t[c-2])+t[c-7]+gamma0(t[c-15])+t[c-16]|0;for(var l=0;l<64;++l){var p=d+sigma1(o)+ch(o,h,u)+s[l]+t[l]|0;var v=sigma0(r)+maj(r,i,n)|0;d=u;u=h;h=o;o=a+p|0;a=n;n=i;i=r;r=p+v|0}this._a=r+this._a|0;this._b=i+this._b|0;this._c=n+this._c|0;this._d=a+this._d|0;this._e=o+this._e|0;this._f=h+this._f|0;this._g=u+this._g|0;this._h=d+this._h|0};Sha256.prototype._hash=function(){var e=a.allocUnsafe(32);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);return e};e.exports=Sha256},7455:function(e,t,r){var i=r(3782);var n=r(9934);var a=r(2858);var s=r(6911).Buffer;var o=new Array(160);function Sha384(){this.init();this._w=o;a.call(this,128,112)}i(Sha384,n);Sha384.prototype.init=function(){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;return this};Sha384.prototype._hash=function(){var e=s.allocUnsafe(48);function writeInt64BE(t,r,i){e.writeInt32BE(t,i);e.writeInt32BE(r,i+4)}writeInt64BE(this._ah,this._al,0);writeInt64BE(this._bh,this._bl,8);writeInt64BE(this._ch,this._cl,16);writeInt64BE(this._dh,this._dl,24);writeInt64BE(this._eh,this._el,32);writeInt64BE(this._fh,this._fl,40);return e};e.exports=Sha384},9934:function(e,t,r){var i=r(3782);var n=r(2858);var a=r(6911).Buffer;var 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];var o=new Array(160);function Sha512(){this.init();this._w=o;n.call(this,128,112)}i(Sha512,n);Sha512.prototype.init=function(){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;return this};function Ch(e,t,r){return r^e&(t^r)}function maj(e,t,r){return e&t|r&(e|t)}function sigma0(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function sigma1(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Gamma0(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Gamma0l(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Gamma1(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Gamma1l(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function getCarry(e,t){return e>>>0>>0?1:0}Sha512.prototype._update=function(e){var t=this._w;var r=this._ah|0;var i=this._bh|0;var n=this._ch|0;var a=this._dh|0;var o=this._eh|0;var h=this._fh|0;var u=this._gh|0;var d=this._hh|0;var c=this._al|0;var l=this._bl|0;var p=this._cl|0;var v=this._dl|0;var b=this._el|0;var m=this._fl|0;var y=this._gl|0;var g=this._hl|0;for(var _=0;_<32;_+=2){t[_]=e.readInt32BE(_*4);t[_+1]=e.readInt32BE(_*4+4)}for(;_<160;_+=2){var w=t[_-15*2];var M=t[_-15*2+1];var B=Gamma0(w,M);var E=Gamma0l(M,w);w=t[_-2*2];M=t[_-2*2+1];var k=Gamma1(w,M);var A=Gamma1l(M,w);var N=t[_-7*2];var P=t[_-7*2+1];var x=t[_-16*2];var I=t[_-16*2+1];var C=E+P|0;var D=B+N+getCarry(C,E)|0;C=C+A|0;D=D+k+getCarry(C,A)|0;C=C+I|0;D=D+x+getCarry(C,I)|0;t[_]=D;t[_+1]=C}for(var T=0;T<160;T+=2){D=t[T];C=t[T+1];var j=maj(r,i,n);var q=maj(c,l,p);var O=sigma0(r,c);var H=sigma0(c,r);var L=sigma1(o,b);var z=sigma1(b,o);var F=s[T];var U=s[T+1];var W=Ch(o,h,u);var V=Ch(b,m,y);var G=g+z|0;var J=d+L+getCarry(G,g)|0;G=G+V|0;J=J+W+getCarry(G,V)|0;G=G+U|0;J=J+F+getCarry(G,U)|0;G=G+C|0;J=J+D+getCarry(G,C)|0;var Z=H+q|0;var X=O+j+getCarry(Z,H)|0;d=u;g=y;u=h;y=m;h=o;m=b;b=v+G|0;o=a+J+getCarry(b,v)|0;a=n;v=p;n=i;p=l;i=r;l=c;c=G+Z|0;r=J+X+getCarry(c,G)|0}this._al=this._al+c|0;this._bl=this._bl+l|0;this._cl=this._cl+p|0;this._dl=this._dl+v|0;this._el=this._el+b|0;this._fl=this._fl+m|0;this._gl=this._gl+y|0;this._hl=this._hl+g|0;this._ah=this._ah+r+getCarry(this._al,c)|0;this._bh=this._bh+i+getCarry(this._bl,l)|0;this._ch=this._ch+n+getCarry(this._cl,p)|0;this._dh=this._dh+a+getCarry(this._dl,v)|0;this._eh=this._eh+o+getCarry(this._el,b)|0;this._fh=this._fh+h+getCarry(this._fl,m)|0;this._gh=this._gh+u+getCarry(this._gl,y)|0;this._hh=this._hh+d+getCarry(this._hl,g)|0};Sha512.prototype._hash=function(){var e=a.allocUnsafe(64);function writeInt64BE(t,r,i){e.writeInt32BE(t,i);e.writeInt32BE(r,i+4)}writeInt64BE(this._ah,this._al,0);writeInt64BE(this._bh,this._bl,8);writeInt64BE(this._ch,this._cl,16);writeInt64BE(this._dh,this._dl,24);writeInt64BE(this._eh,this._el,32);writeInt64BE(this._fh,this._fl,40);writeInt64BE(this._gh,this._gl,48);writeInt64BE(this._hh,this._hl,56);return e};e.exports=Sha512},3704:function(e,t,r){"use strict";var i=r(5055).Buffer;var n=i.isEncoding||function(e){e=""+e;switch(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 true;default:return false}};function _normalizeEncoding(e){if(!e)return"utf8";var t;while(true){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=true}}}function normalizeEncoding(e){var t=_normalizeEncoding(e);if(typeof t!=="string"&&(i.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}t.s=StringDecoder;function StringDecoder(e){this.encoding=normalizeEncoding(e);var t;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;t=4;break;case"utf8":this.fillLast=utf8FillLast;t=4;break;case"base64":this.text=base64Text;this.end=base64End;t=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=i.allocUnsafe(t)}StringDecoder.prototype.write=function(e){if(e.length===0)return"";var t;var r;if(this.lastNeed){t=this.fillLast(e);if(t===undefined)return"";r=this.lastNeed;this.lastNeed=0}else{r=0}if(r>5===6)return 2;else if(e>>4===14)return 3;else if(e>>3===30)return 4;return e>>6===2?-1:-2}function utf8CheckIncomplete(e,t,r){var i=t.length-1;if(i=0){if(n>0)e.lastNeed=n-1;return n}if(--i=0){if(n>0)e.lastNeed=n-2;return n}if(--i=0){if(n>0){if(n===2)n=0;else e.lastNeed=n-3}return n}return 0}function utf8CheckExtraBytes(e,t,r){if((t[0]&192)!==128){e.lastNeed=0;return"�"}if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128){e.lastNeed=1;return"�"}if(e.lastNeed>2&&t.length>2){if((t[2]&192)!==128){e.lastNeed=2;return"�"}}}}function utf8FillLast(e){var t=this.lastTotal-this.lastNeed;var r=utf8CheckExtraBytes(this,e,t);if(r!==undefined)return r;if(this.lastNeed<=e.length){e.copy(this.lastChar,t,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}e.copy(this.lastChar,t,0,e.length);this.lastNeed-=e.length}function utf8Text(e,t){var r=utf8CheckIncomplete(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);e.copy(this.lastChar,0,i);return e.toString("utf8",t,i)}function utf8End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+"�";return t}function utf16Text(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1];return r.slice(0,-1)}}return r}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=e[e.length-1];return e.toString("utf16le",t,e.length-1)}function utf16End(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 base64Text(e,t){var r=(e.length-t)%3;if(r===0)return e.toString("base64",t);this.lastNeed=3-r;this.lastTotal=3;if(r===1){this.lastChar[0]=e[e.length-1]}else{this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1]}return e.toString("base64",t,e.length-r)}function base64End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+this.lastChar.toString("base64",0,3-this.lastNeed);return t}function simpleWrite(e){return e.toString(this.encoding)}function simpleEnd(e){return e&&e.length?this.write(e):""}},6769:function(e){e.exports=deprecate;function deprecate(e,t){if(config("noDeprecation")){return e}var r=false;function deprecated(){if(!r){if(config("throwDeprecation")){throw new Error(t)}else if(config("traceDeprecation")){console.trace(t)}else{console.warn(t)}r=true}return e.apply(this,arguments)}return deprecated}function config(e){try{if(!__webpack_require__.g.localStorage)return false}catch(e){return false}var t=__webpack_require__.g.localStorage[e];if(null==t)return false;return String(t).toLowerCase()==="true"}},4300:function(e){"use strict";e.exports=__webpack_require__(7861)},6113:function(e){"use strict";e.exports=__webpack_require__(8307)},2361:function(e){"use strict";e.exports=__webpack_require__(7324)},2781:function(e){"use strict";e.exports=__webpack_require__(5434)},1576:function(e){"use strict";e.exports=__webpack_require__(3457)},3837:function(e){"use strict";e.exports=__webpack_require__(911)},6144:function(e){"use strict";e.exports=__webpack_require__(1973)},5866:function(e){"use strict";e.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},2908:function(e){"use strict";e.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},9267:function(e){"use strict";e.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},7992:function(e){"use strict";e.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"}}')},2531:function(e){"use strict";e.exports={i8:"6.5.3"}},2510:function(e){"use strict";e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')}};var t={};function __nccwpck_require__(r){var i=t[r];if(i!==undefined){return i.exports}var n=t[r]={id:r,loaded:false,exports:{}};var a=true;try{e[r].call(n.exports,n,n.exports,__nccwpck_require__);a=false}finally{if(a)delete t[r]}n.loaded=true;return n.exports}!function(){__nccwpck_require__.nmd=function(e){e.paths=[];if(!e.children)e.children=[];return e}}();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r={};!function(){"use strict";var e=r;e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=__nccwpck_require__(7223);e.createHash=e.Hash=__nccwpck_require__(9739);e.createHmac=e.Hmac=__nccwpck_require__(4873);var t=__nccwpck_require__(9276);var i=Object.keys(t);var n=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);e.getHashes=function(){return n};var a=__nccwpck_require__(4978);e.pbkdf2=a.pbkdf2;e.pbkdf2Sync=a.pbkdf2Sync;var s=__nccwpck_require__(8996);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 o=__nccwpck_require__(6587);e.DiffieHellmanGroup=o.DiffieHellmanGroup;e.createDiffieHellmanGroup=o.createDiffieHellmanGroup;e.getDiffieHellman=o.getDiffieHellman;e.createDiffieHellman=o.createDiffieHellman;e.DiffieHellman=o.DiffieHellman;var h=__nccwpck_require__(4078);e.createSign=h.createSign;e.Sign=h.Sign;e.createVerify=h.createVerify;e.Verify=h.Verify;e.createECDH=__nccwpck_require__(9942);var u=__nccwpck_require__(9783);e.publicEncrypt=u.publicEncrypt;e.privateEncrypt=u.privateEncrypt;e.publicDecrypt=u.publicDecrypt;e.privateDecrypt=u.privateDecrypt;var d=__nccwpck_require__(6445);e.randomFill=d.randomFill;e.randomFillSync=d.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}}();module.exports=r})(); + +/***/ }) + +}]); \ No newline at end of file diff --git a/crates/swc_ecma_minifier/tests/fixture/next/raw/static/chunks/285-f5f3e6efedc01eee/input.js b/crates/swc_ecma_minifier/tests/fixture/next/raw/static/chunks/285-f5f3e6efedc01eee/input.js new file mode 100644 index 000000000000..5b38fb76c571 --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/next/raw/static/chunks/285-f5f3e6efedc01eee/input.js @@ -0,0 +1,8549 @@ +(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[285],{ + +/***/ 9980: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; +/* provided dependency */ var Buffer = __webpack_require__(7861)["Buffer"]; + + +/* + Decode functions adapted from: + Version 1.0 12/25/99 Copyright (C) 1999 Masanao Izumo + http://www.onicos.com/staff/iz/amuse/javascript/expert/base64.txt +*/ + +const Stream = __webpack_require__(5434); + + +const internals = { + decodeChars: [ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, + -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, + -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 + ] +}; + + +exports.decode = function (buffer) { + + const decodeChars = internals.decodeChars; + const len = buffer.length; + const allocated = Math.ceil(len / 4) * 3; + const result = Buffer.alloc(allocated); + + let c1; + let c2; + let c3; + let c4; + let j = 0; + + for (let i = 0; i < len; ) { + do { + c1 = decodeChars[buffer[i++] & 0xff]; + } + while (i < len && c1 === -1); + + if (c1 === -1) { + break; + } + + do { + c2 = decodeChars[buffer[i++] & 0xff]; + } + while (i < len && c2 === -1); + + if (c2 === -1) { + break; + } + + result[j++] = (c1 << 2) | ((c2 & 0x30) >> 4); + + do { + c3 = buffer[i++] & 0xff; + if (c3 === 61) { // = + return result.slice(0, j); + } + + c3 = decodeChars[c3]; + } + while (i < len && c3 === -1); + + if (c3 === -1) { + break; + } + + result[j++] = ((c2 & 0x0f) << 4) | ((c3 & 0x3c) >> 2); + + do { + c4 = buffer[i++] & 0xff; + if (c4 === 61) { // = + return result.slice(0, j); + } + + c4 = decodeChars[c4]; + } + while (i < len && c4 === -1); + + if (c4 !== -1) { + result[j++] = ((c3 & 0x03) << 6) | c4; + } + } + + return (j === allocated ? result : result.slice(0, j)); +}; + + +exports.Decoder = class Decoder extends Stream.Transform { + constructor() { + + super(); + this._reminder = null; + } + + _transform(chunk, encoding, callback) { + + let part = this._reminder ? Buffer.concat([this._reminder, chunk]) : chunk; + const remaining = part.length % 4; + if (remaining) { + this._reminder = part.slice(part.length - remaining); + part = part.slice(0, part.length - remaining); + } + else { + this._reminder = null; + } + + this.push(exports.decode(part)); + return callback(); + } + + _flush(callback) { + + if (this._reminder) { + this.push(exports.decode(this._reminder)); + } + + return callback(); + } +}; + + +/***/ }), + +/***/ 2596: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; +/* provided dependency */ var Buffer = __webpack_require__(7861)["Buffer"]; + + +/* + Encode functions adapted from: + Version 1.0 12/25/99 Copyright (C) 1999 Masanao Izumo + http://www.onicos.com/staff/iz/amuse/javascript/expert/base64.txt +*/ + +const Stream = __webpack_require__(5434); + + +const internals = {}; + + +exports.encode = function (buffer) { + + return Buffer.from(buffer.toString('base64')); +}; + + +exports.Encoder = class Encoder extends Stream.Transform { + constructor() { + + super(); + this._reminder = null; + } + + _transform(chunk, encoding, callback) { + + let part = this._reminder ? Buffer.concat([this._reminder, chunk]) : chunk; + const remaining = part.length % 3; + if (remaining) { + this._reminder = part.slice(part.length - remaining); + part = part.slice(0, part.length - remaining); + } + else { + this._reminder = null; + } + + this.push(exports.encode(part)); + return callback(); + } + + _flush(callback) { + + if (this._reminder) { + this.push(exports.encode(this._reminder)); + } + + return callback(); + } +}; + + +/***/ }), + +/***/ 1481: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; +/* provided dependency */ var Buffer = __webpack_require__(7861)["Buffer"]; + + +const Hoek = __webpack_require__(2148); + +const Decoder = __webpack_require__(9980); +const Encoder = __webpack_require__(2596); + + +exports.decode = Decoder.decode; + +exports.encode = Encoder.encode; + +exports.Decoder = Decoder.Decoder; + +exports.Encoder = Encoder.Encoder; + + +// Base64url (RFC 4648) encode + +exports.base64urlEncode = function (value, encoding) { + + Hoek.assert(typeof value === 'string' || Buffer.isBuffer(value), 'value must be string or buffer'); + const buf = (Buffer.isBuffer(value) ? value : Buffer.from(value, encoding || 'binary')); + return buf.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, ''); +}; + + +// Base64url (RFC 4648) decode + +exports.base64urlDecode = function (value, encoding) { + + if (typeof value !== 'string') { + + throw new Error('Value not a string'); + } + + if (!/^[\w\-]*$/.test(value)) { + + throw new Error('Invalid character'); + } + + const buf = Buffer.from(value, 'base64'); + return (encoding === 'buffer' ? buf : buf.toString(encoding || 'binary')); +}; + + +/***/ }), + +/***/ 2730: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +const Hoek = __webpack_require__(2148); + + +const internals = { + codes: new Map([ + [100, 'Continue'], + [101, 'Switching Protocols'], + [102, 'Processing'], + [200, 'OK'], + [201, 'Created'], + [202, 'Accepted'], + [203, 'Non-Authoritative Information'], + [204, 'No Content'], + [205, 'Reset Content'], + [206, 'Partial Content'], + [207, 'Multi-Status'], + [300, 'Multiple Choices'], + [301, 'Moved Permanently'], + [302, 'Moved Temporarily'], + [303, 'See Other'], + [304, 'Not Modified'], + [305, 'Use Proxy'], + [307, 'Temporary Redirect'], + [400, 'Bad Request'], + [401, 'Unauthorized'], + [402, 'Payment Required'], + [403, 'Forbidden'], + [404, 'Not Found'], + [405, 'Method Not Allowed'], + [406, 'Not Acceptable'], + [407, 'Proxy Authentication Required'], + [408, 'Request Time-out'], + [409, 'Conflict'], + [410, 'Gone'], + [411, 'Length Required'], + [412, 'Precondition Failed'], + [413, 'Request Entity Too Large'], + [414, 'Request-URI Too Large'], + [415, 'Unsupported Media Type'], + [416, 'Requested Range Not Satisfiable'], + [417, 'Expectation Failed'], + [418, 'I\'m a teapot'], + [422, 'Unprocessable Entity'], + [423, 'Locked'], + [424, 'Failed Dependency'], + [425, 'Too Early'], + [426, 'Upgrade Required'], + [428, 'Precondition Required'], + [429, 'Too Many Requests'], + [431, 'Request Header Fields Too Large'], + [451, 'Unavailable For Legal Reasons'], + [500, 'Internal Server Error'], + [501, 'Not Implemented'], + [502, 'Bad Gateway'], + [503, 'Service Unavailable'], + [504, 'Gateway Time-out'], + [505, 'HTTP Version Not Supported'], + [506, 'Variant Also Negotiates'], + [507, 'Insufficient Storage'], + [509, 'Bandwidth Limit Exceeded'], + [510, 'Not Extended'], + [511, 'Network Authentication Required'] + ]) +}; + + +exports.Boom = class extends Error { + + constructor(message, options = {}) { + + if (message instanceof Error) { + return exports.boomify(Hoek.clone(message), options); + } + + const { statusCode = 500, data = null, ctor = exports.Boom } = options; + const error = new Error(message ? message : undefined); // Avoids settings null message + Error.captureStackTrace(error, ctor); // Filter the stack to our external API + error.data = data; + const boom = internals.initialize(error, statusCode); + + Object.defineProperty(boom, 'typeof', { value: ctor }); + + if (options.decorate) { + Object.assign(boom, options.decorate); + } + + return boom; + } + + static [Symbol.hasInstance](instance) { + + if (this === exports.Boom) { + return exports.isBoom(instance); + } + + // Cannot use 'instanceof' as it creates infinite recursion + + return this.prototype.isPrototypeOf(instance); + } +}; + + +exports.isBoom = function (err, statusCode) { + + return err instanceof Error && !!err.isBoom && (!statusCode || err.output.statusCode === statusCode); +}; + + +exports.boomify = function (err, options) { + + Hoek.assert(err instanceof Error, 'Cannot wrap non-Error object'); + + options = options || {}; + + if (options.data !== undefined) { + err.data = options.data; + } + + if (options.decorate) { + Object.assign(err, options.decorate); + } + + if (!err.isBoom) { + return internals.initialize(err, options.statusCode ?? 500, options.message); + } + + if (options.override === false || // Defaults to true + !options.statusCode && !options.message) { + + return err; + } + + return internals.initialize(err, options.statusCode ?? err.output.statusCode, options.message); +}; + + +// 4xx Client Errors + +exports.badRequest = function (message, data) { + + return new exports.Boom(message, { statusCode: 400, data, ctor: exports.badRequest }); +}; + + +exports.unauthorized = function (message, scheme, attributes) { // Or (message, wwwAuthenticate[]) + + const err = new exports.Boom(message, { statusCode: 401, ctor: exports.unauthorized }); + + // function (message) + + if (!scheme) { + return err; + } + + // function (message, wwwAuthenticate[]) + + if (typeof scheme !== 'string') { + err.output.headers['WWW-Authenticate'] = scheme.join(', '); + return err; + } + + // function (message, scheme, attributes) + + let wwwAuthenticate = `${scheme}`; + + if (attributes || + message) { + + err.output.payload.attributes = {}; + } + + if (attributes) { + if (typeof attributes === 'string') { + wwwAuthenticate += ' ' + Hoek.escapeHeaderAttribute(attributes); + err.output.payload.attributes = attributes; + } + else { + wwwAuthenticate += ' ' + Object.keys(attributes).map((name) => { + + const value = attributes[name] ?? ''; + + err.output.payload.attributes[name] = value; + return `${name}="${Hoek.escapeHeaderAttribute(value.toString())}"`; + }) + .join(', '); + } + } + + if (message) { + if (attributes) { + wwwAuthenticate += ','; + } + + wwwAuthenticate += ` error="${Hoek.escapeHeaderAttribute(message)}"`; + err.output.payload.attributes.error = message; + } + else { + err.isMissing = true; + } + + err.output.headers['WWW-Authenticate'] = wwwAuthenticate; + return err; +}; + + +exports.paymentRequired = function (message, data) { + + return new exports.Boom(message, { statusCode: 402, data, ctor: exports.paymentRequired }); +}; + + +exports.forbidden = function (message, data) { + + return new exports.Boom(message, { statusCode: 403, data, ctor: exports.forbidden }); +}; + + +exports.notFound = function (message, data) { + + return new exports.Boom(message, { statusCode: 404, data, ctor: exports.notFound }); +}; + + +exports.methodNotAllowed = function (message, data, allow) { + + const err = new exports.Boom(message, { statusCode: 405, data, ctor: exports.methodNotAllowed }); + + if (typeof allow === 'string') { + allow = [allow]; + } + + if (Array.isArray(allow)) { + err.output.headers.Allow = allow.join(', '); + } + + return err; +}; + + +exports.notAcceptable = function (message, data) { + + return new exports.Boom(message, { statusCode: 406, data, ctor: exports.notAcceptable }); +}; + + +exports.proxyAuthRequired = function (message, data) { + + return new exports.Boom(message, { statusCode: 407, data, ctor: exports.proxyAuthRequired }); +}; + + +exports.clientTimeout = function (message, data) { + + return new exports.Boom(message, { statusCode: 408, data, ctor: exports.clientTimeout }); +}; + + +exports.conflict = function (message, data) { + + return new exports.Boom(message, { statusCode: 409, data, ctor: exports.conflict }); +}; + + +exports.resourceGone = function (message, data) { + + return new exports.Boom(message, { statusCode: 410, data, ctor: exports.resourceGone }); +}; + + +exports.lengthRequired = function (message, data) { + + return new exports.Boom(message, { statusCode: 411, data, ctor: exports.lengthRequired }); +}; + + +exports.preconditionFailed = function (message, data) { + + return new exports.Boom(message, { statusCode: 412, data, ctor: exports.preconditionFailed }); +}; + + +exports.entityTooLarge = function (message, data) { + + return new exports.Boom(message, { statusCode: 413, data, ctor: exports.entityTooLarge }); +}; + + +exports.uriTooLong = function (message, data) { + + return new exports.Boom(message, { statusCode: 414, data, ctor: exports.uriTooLong }); +}; + + +exports.unsupportedMediaType = function (message, data) { + + return new exports.Boom(message, { statusCode: 415, data, ctor: exports.unsupportedMediaType }); +}; + + +exports.rangeNotSatisfiable = function (message, data) { + + return new exports.Boom(message, { statusCode: 416, data, ctor: exports.rangeNotSatisfiable }); +}; + + +exports.expectationFailed = function (message, data) { + + return new exports.Boom(message, { statusCode: 417, data, ctor: exports.expectationFailed }); +}; + + +exports.teapot = function (message, data) { + + return new exports.Boom(message, { statusCode: 418, data, ctor: exports.teapot }); +}; + + +exports.badData = function (message, data) { + + return new exports.Boom(message, { statusCode: 422, data, ctor: exports.badData }); +}; + + +exports.locked = function (message, data) { + + return new exports.Boom(message, { statusCode: 423, data, ctor: exports.locked }); +}; + + +exports.failedDependency = function (message, data) { + + return new exports.Boom(message, { statusCode: 424, data, ctor: exports.failedDependency }); +}; + +exports.tooEarly = function (message, data) { + + return new exports.Boom(message, { statusCode: 425, data, ctor: exports.tooEarly }); +}; + + +exports.preconditionRequired = function (message, data) { + + return new exports.Boom(message, { statusCode: 428, data, ctor: exports.preconditionRequired }); +}; + + +exports.tooManyRequests = function (message, data) { + + return new exports.Boom(message, { statusCode: 429, data, ctor: exports.tooManyRequests }); +}; + + +exports.illegal = function (message, data) { + + return new exports.Boom(message, { statusCode: 451, data, ctor: exports.illegal }); +}; + + +// 5xx Server Errors + +exports.internal = function (message, data, statusCode = 500) { + + return internals.serverError(message, data, statusCode, exports.internal); +}; + + +exports.notImplemented = function (message, data) { + + return internals.serverError(message, data, 501, exports.notImplemented); +}; + + +exports.badGateway = function (message, data) { + + return internals.serverError(message, data, 502, exports.badGateway); +}; + + +exports.serverUnavailable = function (message, data) { + + return internals.serverError(message, data, 503, exports.serverUnavailable); +}; + + +exports.gatewayTimeout = function (message, data) { + + return internals.serverError(message, data, 504, exports.gatewayTimeout); +}; + + +exports.badImplementation = function (message, data) { + + const err = internals.serverError(message, data, 500, exports.badImplementation); + err.isDeveloperError = true; + return err; +}; + + +internals.initialize = function (err, statusCode, message) { + + const numberCode = parseInt(statusCode, 10); + Hoek.assert(!isNaN(numberCode) && numberCode >= 400, 'First argument must be a number (400+):', statusCode); + + err.isBoom = true; + err.isServer = numberCode >= 500; + + if (!err.hasOwnProperty('data')) { + err.data = null; + } + + err.output = { + statusCode: numberCode, + payload: {}, + headers: {} + }; + + Object.defineProperty(err, 'reformat', { value: internals.reformat, configurable: true }); + + if (!message && + !err.message) { + + err.reformat(); + message = err.output.payload.error; + } + + if (message) { + const props = Object.getOwnPropertyDescriptor(err, 'message') || Object.getOwnPropertyDescriptor(Object.getPrototypeOf(err), 'message'); + Hoek.assert(!props || props.configurable && !props.get, 'The error is not compatible with boom'); + + err.message = message + (err.message ? ': ' + err.message : ''); + err.output.payload.message = err.message; + } + + err.reformat(); + return err; +}; + + +internals.reformat = function (debug = false) { + + this.output.payload.statusCode = this.output.statusCode; + this.output.payload.error = internals.codes.get(this.output.statusCode) || 'Unknown'; + + if (this.output.statusCode === 500 && debug !== true) { + this.output.payload.message = 'An internal server error occurred'; // Hide actual error from user + } + else if (this.message) { + this.output.payload.message = this.message; + } +}; + + +internals.serverError = function (message, data, statusCode, ctor) { + + if (data instanceof Error && + !data.isBoom) { + + return exports.boomify(data, { statusCode, message }); + } + + return new exports.Boom(message, { statusCode, data, ctor }); +}; + + +/***/ }), + +/***/ 1195: +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + + +const internals = { + suspectRx: /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*\:/ +}; + + +exports.parse = function (text, ...args) { + + // Normalize arguments + + const firstOptions = typeof args[0] === 'object' && args[0]; + const reviver = args.length > 1 || !firstOptions ? args[0] : undefined; + const options = (args.length > 1 && args[1]) || firstOptions || {}; + + // Parse normally, allowing exceptions + + const obj = JSON.parse(text, reviver); + + // options.protoAction: 'error' (default) / 'remove' / 'ignore' + + if (options.protoAction === 'ignore') { + return obj; + } + + // Ignore null and non-objects + + if (!obj || + typeof obj !== 'object') { + + return obj; + } + + // Check original string for potential exploit + + if (!text.match(internals.suspectRx)) { + return obj; + } + + // Scan result for proto keys + + exports.scan(obj, options); + + return obj; +}; + + +exports.scan = function (obj, options = {}) { + + let next = [obj]; + + while (next.length) { + const nodes = next; + next = []; + + for (const node of nodes) { + if (Object.prototype.hasOwnProperty.call(node, '__proto__')) { // Avoid calling node.hasOwnProperty directly + if (options.protoAction !== 'remove') { + throw new SyntaxError('Object contains forbidden prototype property'); + } + + delete node.__proto__; + } + + for (const key in node) { + const value = node[key]; + if (value && + typeof value === 'object') { + + next.push(node[key]); + } + } + } + } +}; + + +exports.safeParse = function (text, reviver) { + + try { + return exports.parse(text, reviver); + } + catch (ignoreError) { + return null; + } +}; + + +/***/ }), + +/***/ 9681: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; +/* provided dependency */ var Buffer = __webpack_require__(7861)["Buffer"]; + + +const Crypto = __webpack_require__(8307); + +const Boom = __webpack_require__(2730); + + +const internals = {}; + + +// Generate a cryptographically strong pseudo-random data + +exports.randomString = function (size) { + + const buffer = exports.randomBits((size + 1) * 6); + const string = buffer.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, ''); + return string.slice(0, size); +}; + + +// Generate a cryptographically strong pseudo-random alphanum data + +exports.randomAlphanumString = function (size) { + + let result = ''; + + while (result.length < size) { + const buffer = exports.randomBits((size + 1) * 6); + result += buffer.toString('base64').replace(/[^a-zA-Z0-9]/g, ''); + } + + return result.slice(0, size); +}; + + +// Return a random string of digits + +exports.randomDigits = function (size) { + + const digits = []; + + let buffer = internals.random(size * 2); // Provision twice the amount of bytes needed to increase chance of single pass + let pos = 0; + + while (digits.length < size) { + if (pos >= buffer.length) { + buffer = internals.random(size * 2); + pos = 0; + } + + if (buffer[pos] < 250) { + digits.push(buffer[pos] % 10); + } + + ++pos; + } + + return digits.join(''); +}; + + +// Generate a buffer of random bits + +exports.randomBits = function (bits) { + + if (!bits || + bits < 0) { + + throw Boom.internal('Invalid random bits count'); + } + + const bytes = Math.ceil(bits / 8); + return internals.random(bytes); +}; + + +exports.fixedTimeComparison = function (a, b) { + + try { + return Crypto.timingSafeEqual(Buffer.from(a), Buffer.from(b)); + } + catch (err) { + return false; + } +}; + + +internals.random = function (bytes) { + + try { + return Crypto.randomBytes(bytes); + } + catch (err) { + throw Boom.internal('Failed generating random bits: ' + err.message); + } +}; + + +/***/ }), + +/***/ 5965: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +const Assert = __webpack_require__(3736); +const Clone = __webpack_require__(6198); +const Merge = __webpack_require__(2686); +const Reach = __webpack_require__(6622); + + +const internals = {}; + + +module.exports = function (defaults, source, options = {}) { + + Assert(defaults && typeof defaults === 'object', 'Invalid defaults value: must be an object'); + Assert(!source || source === true || typeof source === 'object', 'Invalid source value: must be true, falsy or an object'); + Assert(typeof options === 'object', 'Invalid options: must be an object'); + + if (!source) { // If no source, return null + return null; + } + + if (options.shallow) { + return internals.applyToDefaultsWithShallow(defaults, source, options); + } + + const copy = Clone(defaults); + + if (source === true) { // If source is set to true, use defaults + return copy; + } + + const nullOverride = options.nullOverride !== undefined ? options.nullOverride : false; + return Merge(copy, source, { nullOverride, mergeArrays: false }); +}; + + +internals.applyToDefaultsWithShallow = function (defaults, source, options) { + + const keys = options.shallow; + Assert(Array.isArray(keys), 'Invalid keys'); + + const seen = new Map(); + const merge = source === true ? null : new Set(); + + for (let key of keys) { + key = Array.isArray(key) ? key : key.split('.'); // Pre-split optimization + + const ref = Reach(defaults, key); + if (ref && + typeof ref === 'object') { + + seen.set(ref, merge && Reach(source, key) || ref); + } + else if (merge) { + merge.add(key); + } + } + + const copy = Clone(defaults, {}, seen); + + if (!merge) { + return copy; + } + + for (const key of merge) { + internals.reachCopy(copy, source, key); + } + + const nullOverride = options.nullOverride !== undefined ? options.nullOverride : false; + return Merge(copy, source, { nullOverride, mergeArrays: false }); +}; + + +internals.reachCopy = function (dst, src, path) { + + for (const segment of path) { + if (!(segment in src)) { + return; + } + + const val = src[segment]; + + if (typeof val !== 'object' || val === null) { + return; + } + + src = val; + } + + const value = src; + let ref = dst; + for (let i = 0; i < path.length - 1; ++i) { + const segment = path[i]; + if (typeof ref[segment] !== 'object') { + ref[segment] = {}; + } + + ref = ref[segment]; + } + + ref[path[path.length - 1]] = value; +}; + + +/***/ }), + +/***/ 3736: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +const AssertError = __webpack_require__(605); + + +const internals = {}; + + +module.exports = function (condition, ...args) { + + if (condition) { + return; + } + + if (args.length === 1 && + args[0] instanceof Error) { + + throw args[0]; + } + + throw new AssertError(args); +}; + + +/***/ }), + +/***/ 8916: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* provided dependency */ var process = __webpack_require__(8448); + + +const internals = {}; + + +module.exports = internals.Bench = class { + + constructor() { + + this.ts = 0; + this.reset(); + } + + reset() { + + this.ts = internals.Bench.now(); + } + + elapsed() { + + return internals.Bench.now() - this.ts; + } + + static now() { + + const ts = process.hrtime(); + return (ts[0] * 1e3) + (ts[1] / 1e6); + } +}; + + +/***/ }), + +/***/ 5515: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +const Ignore = __webpack_require__(4127); + + +const internals = {}; + + +module.exports = function () { + + return new Promise(Ignore); +}; + + +/***/ }), + +/***/ 6198: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* provided dependency */ var Buffer = __webpack_require__(7861)["Buffer"]; + + +const Reach = __webpack_require__(6622); +const Types = __webpack_require__(4360); +const Utils = __webpack_require__(1377); + + +const internals = { + needsProtoHack: new Set([Types.set, Types.map, Types.weakSet, Types.weakMap]) +}; + + +module.exports = internals.clone = function (obj, options = {}, _seen = null) { + + if (typeof obj !== 'object' || + obj === null) { + + return obj; + } + + let clone = internals.clone; + let seen = _seen; + + if (options.shallow) { + if (options.shallow !== true) { + return internals.cloneWithShallow(obj, options); + } + + clone = (value) => value; + } + else if (seen) { + const lookup = seen.get(obj); + if (lookup) { + return lookup; + } + } + else { + seen = new Map(); + } + + // Built-in object types + + const baseProto = Types.getInternalProto(obj); + if (baseProto === Types.buffer) { + return Buffer && Buffer.from(obj); // $lab:coverage:ignore$ + } + + if (baseProto === Types.date) { + return new Date(obj.getTime()); + } + + if (baseProto === Types.regex) { + return new RegExp(obj); + } + + // Generic objects + + const newObj = internals.base(obj, baseProto, options); + if (newObj === obj) { + return obj; + } + + if (seen) { + seen.set(obj, newObj); // Set seen, since obj could recurse + } + + if (baseProto === Types.set) { + for (const value of obj) { + newObj.add(clone(value, options, seen)); + } + } + else if (baseProto === Types.map) { + for (const [key, value] of obj) { + newObj.set(key, clone(value, options, seen)); + } + } + + const keys = Utils.keys(obj, options); + for (const key of keys) { + if (key === '__proto__') { + continue; + } + + if (baseProto === Types.array && + key === 'length') { + + newObj.length = obj.length; + continue; + } + + const descriptor = Object.getOwnPropertyDescriptor(obj, key); + if (descriptor) { + if (descriptor.get || + descriptor.set) { + + Object.defineProperty(newObj, key, descriptor); + } + else if (descriptor.enumerable) { + newObj[key] = clone(obj[key], options, seen); + } + else { + Object.defineProperty(newObj, key, { enumerable: false, writable: true, configurable: true, value: clone(obj[key], options, seen) }); + } + } + else { + Object.defineProperty(newObj, key, { + enumerable: true, + writable: true, + configurable: true, + value: clone(obj[key], options, seen) + }); + } + } + + return newObj; +}; + + +internals.cloneWithShallow = function (source, options) { + + const keys = options.shallow; + options = Object.assign({}, options); + options.shallow = false; + + const seen = new Map(); + + for (const key of keys) { + const ref = Reach(source, key); + if (typeof ref === 'object' || + typeof ref === 'function') { + + seen.set(ref, ref); + } + } + + return internals.clone(source, options, seen); +}; + + +internals.base = function (obj, baseProto, options) { + + if (options.prototype === false) { // Defaults to true + if (internals.needsProtoHack.has(baseProto)) { + return new baseProto.constructor(); + } + + return baseProto === Types.array ? [] : {}; + } + + const proto = Object.getPrototypeOf(obj); + if (proto && + proto.isImmutable) { + + return obj; + } + + if (baseProto === Types.array) { + const newObj = []; + if (proto !== baseProto) { + Object.setPrototypeOf(newObj, proto); + } + + return newObj; + } + + if (internals.needsProtoHack.has(baseProto)) { + const newObj = new proto.constructor(); + if (proto !== baseProto) { + Object.setPrototypeOf(newObj, proto); + } + + return newObj; + } + + return Object.create(proto); +}; + + +/***/ }), + +/***/ 8041: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +const Assert = __webpack_require__(3736); +const DeepEqual = __webpack_require__(2513); +const EscapeRegex = __webpack_require__(5527); +const Utils = __webpack_require__(1377); + + +const internals = {}; + + +module.exports = function (ref, values, options = {}) { // options: { deep, once, only, part, symbols } + + /* + string -> string(s) + array -> item(s) + object -> key(s) + object -> object (key:value) + */ + + if (typeof values !== 'object') { + values = [values]; + } + + Assert(!Array.isArray(values) || values.length, 'Values array cannot be empty'); + + // String + + if (typeof ref === 'string') { + return internals.string(ref, values, options); + } + + // Array + + if (Array.isArray(ref)) { + return internals.array(ref, values, options); + } + + // Object + + Assert(typeof ref === 'object', 'Reference must be string or an object'); + return internals.object(ref, values, options); +}; + + +internals.array = function (ref, values, options) { + + if (!Array.isArray(values)) { + values = [values]; + } + + if (!ref.length) { + return false; + } + + if (options.only && + options.once && + ref.length !== values.length) { + + return false; + } + + let compare; + + // Map values + + const map = new Map(); + for (const value of values) { + if (!options.deep || + !value || + typeof value !== 'object') { + + const existing = map.get(value); + if (existing) { + ++existing.allowed; + } + else { + map.set(value, { allowed: 1, hits: 0 }); + } + } + else { + compare = compare ?? internals.compare(options); + + let found = false; + for (const [key, existing] of map.entries()) { + if (compare(key, value)) { + ++existing.allowed; + found = true; + break; + } + } + + if (!found) { + map.set(value, { allowed: 1, hits: 0 }); + } + } + } + + // Lookup values + + let hits = 0; + for (const item of ref) { + let match; + if (!options.deep || + !item || + typeof item !== 'object') { + + match = map.get(item); + } + else { + compare = compare ?? internals.compare(options); + + for (const [key, existing] of map.entries()) { + if (compare(key, item)) { + match = existing; + break; + } + } + } + + if (match) { + ++match.hits; + ++hits; + + if (options.once && + match.hits > match.allowed) { + + return false; + } + } + } + + // Validate results + + if (options.only && + hits !== ref.length) { + + return false; + } + + for (const match of map.values()) { + if (match.hits === match.allowed) { + continue; + } + + if (match.hits < match.allowed && + !options.part) { + + return false; + } + } + + return !!hits; +}; + + +internals.object = function (ref, values, options) { + + Assert(options.once === undefined, 'Cannot use option once with object'); + + const keys = Utils.keys(ref, options); + if (!keys.length) { + return false; + } + + // Keys list + + if (Array.isArray(values)) { + return internals.array(keys, values, options); + } + + // Key value pairs + + const symbols = Object.getOwnPropertySymbols(values).filter((sym) => values.propertyIsEnumerable(sym)); + const targets = [...Object.keys(values), ...symbols]; + + const compare = internals.compare(options); + const set = new Set(targets); + + for (const key of keys) { + if (!set.has(key)) { + if (options.only) { + return false; + } + + continue; + } + + if (!compare(values[key], ref[key])) { + return false; + } + + set.delete(key); + } + + if (set.size) { + return options.part ? set.size < targets.length : false; + } + + return true; +}; + + +internals.string = function (ref, values, options) { + + // Empty string + + if (ref === '') { + return values.length === 1 && values[0] === '' || // '' contains '' + !options.once && !values.some((v) => v !== ''); // '' contains multiple '' if !once + } + + // Map values + + const map = new Map(); + const patterns = []; + + for (const value of values) { + Assert(typeof value === 'string', 'Cannot compare string reference to non-string value'); + + if (value) { + const existing = map.get(value); + if (existing) { + ++existing.allowed; + } + else { + map.set(value, { allowed: 1, hits: 0 }); + patterns.push(EscapeRegex(value)); + } + } + else if (options.once || + options.only) { + + return false; + } + } + + if (!patterns.length) { // Non-empty string contains unlimited empty string + return true; + } + + // Match patterns + + const regex = new RegExp(`(${patterns.join('|')})`, 'g'); + const leftovers = ref.replace(regex, ($0, $1) => { + + ++map.get($1).hits; + return ''; // Remove from string + }); + + // Validate results + + if (options.only && + leftovers) { + + return false; + } + + let any = false; + for (const match of map.values()) { + if (match.hits) { + any = true; + } + + if (match.hits === match.allowed) { + continue; + } + + if (match.hits < match.allowed && + !options.part) { + + return false; + } + + // match.hits > match.allowed + + if (options.once) { + return false; + } + } + + return !!any; +}; + + +internals.compare = function (options) { + + if (!options.deep) { + return internals.shallow; + } + + const hasOnly = options.only !== undefined; + const hasPart = options.part !== undefined; + + const flags = { + prototype: hasOnly ? options.only : hasPart ? !options.part : false, + part: hasOnly ? !options.only : hasPart ? options.part : false + }; + + return (a, b) => DeepEqual(a, b, flags); +}; + + +internals.shallow = function (a, b) { + + return a === b; +}; + + +/***/ }), + +/***/ 2513: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* provided dependency */ var Buffer = __webpack_require__(7861)["Buffer"]; + + +const Types = __webpack_require__(4360); + + +const internals = { + mismatched: null +}; + + +module.exports = function (obj, ref, options) { + + options = Object.assign({ prototype: true }, options); + + return !!internals.isDeepEqual(obj, ref, options, []); +}; + + +internals.isDeepEqual = function (obj, ref, options, seen) { + + if (obj === ref) { // Copied from Deep-eql, copyright(c) 2013 Jake Luer, jake@alogicalparadox.com, MIT Licensed, https://github.com/chaijs/deep-eql + return obj !== 0 || 1 / obj === 1 / ref; + } + + const type = typeof obj; + + if (type !== typeof ref) { + return false; + } + + if (obj === null || + ref === null) { + + return false; + } + + if (type === 'function') { + if (!options.deepFunction || + obj.toString() !== ref.toString()) { + + return false; + } + + // Continue as object + } + else if (type !== 'object') { + return obj !== obj && ref !== ref; // NaN + } + + const instanceType = internals.getSharedType(obj, ref, !!options.prototype); + switch (instanceType) { + case Types.buffer: + return Buffer && Buffer.prototype.equals.call(obj, ref); // $lab:coverage:ignore$ + case Types.promise: + return obj === ref; + case Types.regex: + return obj.toString() === ref.toString(); + case internals.mismatched: + return false; + } + + for (let i = seen.length - 1; i >= 0; --i) { + if (seen[i].isSame(obj, ref)) { + return true; // If previous comparison failed, it would have stopped execution + } + } + + seen.push(new internals.SeenEntry(obj, ref)); + + try { + return !!internals.isDeepEqualObj(instanceType, obj, ref, options, seen); + } + finally { + seen.pop(); + } +}; + + +internals.getSharedType = function (obj, ref, checkPrototype) { + + if (checkPrototype) { + if (Object.getPrototypeOf(obj) !== Object.getPrototypeOf(ref)) { + return internals.mismatched; + } + + return Types.getInternalProto(obj); + } + + const type = Types.getInternalProto(obj); + if (type !== Types.getInternalProto(ref)) { + return internals.mismatched; + } + + return type; +}; + + +internals.valueOf = function (obj) { + + const objValueOf = obj.valueOf; + if (objValueOf === undefined) { + return obj; + } + + try { + return objValueOf.call(obj); + } + catch (err) { + return err; + } +}; + + +internals.hasOwnEnumerableProperty = function (obj, key) { + + return Object.prototype.propertyIsEnumerable.call(obj, key); +}; + + +internals.isSetSimpleEqual = function (obj, ref) { + + for (const entry of Set.prototype.values.call(obj)) { + if (!Set.prototype.has.call(ref, entry)) { + return false; + } + } + + return true; +}; + + +internals.isDeepEqualObj = function (instanceType, obj, ref, options, seen) { + + const { isDeepEqual, valueOf, hasOwnEnumerableProperty } = internals; + const { keys, getOwnPropertySymbols } = Object; + + if (instanceType === Types.array) { + if (options.part) { + + // Check if any index match any other index + + for (const objValue of obj) { + for (const refValue of ref) { + if (isDeepEqual(objValue, refValue, options, seen)) { + return true; + } + } + } + } + else { + if (obj.length !== ref.length) { + return false; + } + + for (let i = 0; i < obj.length; ++i) { + if (!isDeepEqual(obj[i], ref[i], options, seen)) { + return false; + } + } + + return true; + } + } + else if (instanceType === Types.set) { + if (obj.size !== ref.size) { + return false; + } + + if (!internals.isSetSimpleEqual(obj, ref)) { + + // Check for deep equality + + const ref2 = new Set(Set.prototype.values.call(ref)); + for (const objEntry of Set.prototype.values.call(obj)) { + if (ref2.delete(objEntry)) { + continue; + } + + let found = false; + for (const refEntry of ref2) { + if (isDeepEqual(objEntry, refEntry, options, seen)) { + ref2.delete(refEntry); + found = true; + break; + } + } + + if (!found) { + return false; + } + } + } + } + else if (instanceType === Types.map) { + if (obj.size !== ref.size) { + return false; + } + + for (const [key, value] of Map.prototype.entries.call(obj)) { + if (value === undefined && !Map.prototype.has.call(ref, key)) { + return false; + } + + if (!isDeepEqual(value, Map.prototype.get.call(ref, key), options, seen)) { + return false; + } + } + } + else if (instanceType === Types.error) { + + // Always check name and message + + if (obj.name !== ref.name || + obj.message !== ref.message) { + + return false; + } + } + + // Check .valueOf() + + const valueOfObj = valueOf(obj); + const valueOfRef = valueOf(ref); + if ((obj !== valueOfObj || ref !== valueOfRef) && + !isDeepEqual(valueOfObj, valueOfRef, options, seen)) { + + return false; + } + + // Check properties + + const objKeys = keys(obj); + if (!options.part && + objKeys.length !== keys(ref).length && + !options.skip) { + + return false; + } + + let skipped = 0; + for (const key of objKeys) { + if (options.skip && + options.skip.includes(key)) { + + if (ref[key] === undefined) { + ++skipped; + } + + continue; + } + + if (!hasOwnEnumerableProperty(ref, key)) { + return false; + } + + if (!isDeepEqual(obj[key], ref[key], options, seen)) { + return false; + } + } + + if (!options.part && + objKeys.length - skipped !== keys(ref).length) { + + return false; + } + + // Check symbols + + if (options.symbols !== false) { // Defaults to true + const objSymbols = getOwnPropertySymbols(obj); + const refSymbols = new Set(getOwnPropertySymbols(ref)); + + for (const key of objSymbols) { + if (!options.skip?.includes(key)) { + + if (hasOwnEnumerableProperty(obj, key)) { + if (!hasOwnEnumerableProperty(ref, key)) { + return false; + } + + if (!isDeepEqual(obj[key], ref[key], options, seen)) { + return false; + } + } + else if (hasOwnEnumerableProperty(ref, key)) { + return false; + } + } + + refSymbols.delete(key); + } + + for (const key of refSymbols) { + if (hasOwnEnumerableProperty(ref, key)) { + return false; + } + } + } + + return true; +}; + + +internals.SeenEntry = class { + + constructor(obj, ref) { + + this.obj = obj; + this.ref = ref; + } + + isSame(obj, ref) { + + return this.obj === obj && this.ref === ref; + } +}; + + +/***/ }), + +/***/ 605: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +const Stringify = __webpack_require__(9708); + + +const internals = {}; + + +module.exports = class extends Error { + + constructor(args) { + + const msgs = args + .filter((arg) => arg !== '') + .map((arg) => { + + return typeof arg === 'string' ? arg : arg instanceof Error ? arg.message : Stringify(arg); + }); + + super(msgs.join(' ') || 'Unknown error'); + + if (typeof Error.captureStackTrace === 'function') { // $lab:coverage:ignore$ + Error.captureStackTrace(this, exports.assert); + } + } +}; + + +/***/ }), + +/***/ 6029: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +const Assert = __webpack_require__(3736); + + +const internals = {}; + + +module.exports = function (attribute) { + + // Allowed value characters: !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9, \, " + + Assert(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(attribute), 'Bad attribute value (' + attribute + ')'); + + return attribute.replace(/\\/g, '\\\\').replace(/\"/g, '\\"'); // Escape quotes and slash +}; + + +/***/ }), + +/***/ 2119: +/***/ (function(module) { + +"use strict"; + + +const internals = {}; + + +module.exports = function (input) { + + if (!input) { + return ''; + } + + let escaped = ''; + + for (let i = 0; i < input.length; ++i) { + + const charCode = input.charCodeAt(i); + + if (internals.isSafe(charCode)) { + escaped += input[i]; + } + else { + escaped += internals.escapeHtmlChar(charCode); + } + } + + return escaped; +}; + + +internals.escapeHtmlChar = function (charCode) { + + const namedEscape = internals.namedHtml.get(charCode); + if (namedEscape) { + return namedEscape; + } + + if (charCode >= 256) { + return '&#' + charCode + ';'; + } + + const hexValue = charCode.toString(16).padStart(2, '0'); + return `&#x${hexValue};`; +}; + + +internals.isSafe = function (charCode) { + + return internals.safeCharCodes.has(charCode); +}; + + +internals.namedHtml = new Map([ + [38, '&'], + [60, '<'], + [62, '>'], + [34, '"'], + [160, ' '], + [162, '¢'], + [163, '£'], + [164, '¤'], + [169, '©'], + [174, '®'] +]); + + +internals.safeCharCodes = (function () { + + const safe = new Set(); + + for (let i = 32; i < 123; ++i) { + + if ((i >= 97) || // a-z + (i >= 65 && i <= 90) || // A-Z + (i >= 48 && i <= 57) || // 0-9 + i === 32 || // space + i === 46 || // . + i === 44 || // , + i === 45 || // - + i === 58 || // : + i === 95) { // _ + + safe.add(i); + } + } + + return safe; +}()); + + +/***/ }), + +/***/ 8483: +/***/ (function(module) { + +"use strict"; + + +const internals = {}; + + +module.exports = function (input) { + + if (!input) { + return ''; + } + + return input.replace(/[<>&\u2028\u2029]/g, internals.escape); +}; + + +internals.escape = function (char) { + + return internals.replacements.get(char); +}; + + +internals.replacements = new Map([ + ['<', '\\u003c'], + ['>', '\\u003e'], + ['&', '\\u0026'], + ['\u2028', '\\u2028'], + ['\u2029', '\\u2029'] +]); + + +/***/ }), + +/***/ 5527: +/***/ (function(module) { + +"use strict"; + + +const internals = {}; + + +module.exports = function (string) { + + // Escape ^$.*+-?=!:|\/()[]{}, + + return string.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g, '\\$&'); +}; + + +/***/ }), + +/***/ 1409: +/***/ (function(module) { + +"use strict"; + + +const internals = {}; + + +module.exports = internals.flatten = function (array, target) { + + const result = target || []; + + for (const entry of array) { + if (Array.isArray(entry)) { + internals.flatten(entry, result); + } + else { + result.push(entry); + } + } + + return result; +}; + + +/***/ }), + +/***/ 4127: +/***/ (function(module) { + +"use strict"; + + +const internals = {}; + + +module.exports = function () { }; + + +/***/ }), + +/***/ 2148: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +exports.applyToDefaults = __webpack_require__(5965); + +exports.assert = __webpack_require__(3736); + +exports.Bench = __webpack_require__(8916); + +exports.block = __webpack_require__(5515); + +exports.clone = __webpack_require__(6198); + +exports.contain = __webpack_require__(8041); + +exports.deepEqual = __webpack_require__(2513); + +exports.Error = __webpack_require__(605); + +exports.escapeHeaderAttribute = __webpack_require__(6029); + +exports.escapeHtml = __webpack_require__(2119); + +exports.escapeJson = __webpack_require__(8483); + +exports.escapeRegex = __webpack_require__(5527); + +exports.flatten = __webpack_require__(1409); + +exports.ignore = __webpack_require__(4127); + +exports.intersect = __webpack_require__(1623); + +exports.isPromise = __webpack_require__(4697); + +exports.merge = __webpack_require__(2686); + +exports.once = __webpack_require__(2439); + +exports.reach = __webpack_require__(6622); + +exports.reachTemplate = __webpack_require__(9865); + +exports.stringify = __webpack_require__(9708); + +exports.wait = __webpack_require__(762); + + +/***/ }), + +/***/ 1623: +/***/ (function(module) { + +"use strict"; + + +const internals = {}; + + +module.exports = function (array1, array2, options = {}) { + + if (!array1 || + !array2) { + + return (options.first ? null : []); + } + + const common = []; + const hash = (Array.isArray(array1) ? new Set(array1) : array1); + const found = new Set(); + for (const value of array2) { + if (internals.has(hash, value) && + !found.has(value)) { + + if (options.first) { + return value; + } + + common.push(value); + found.add(value); + } + } + + return (options.first ? null : common); +}; + + +internals.has = function (ref, key) { + + if (typeof ref.has === 'function') { + return ref.has(key); + } + + return ref[key] !== undefined; +}; + + +/***/ }), + +/***/ 4697: +/***/ (function(module) { + +"use strict"; + + +const internals = {}; + + +module.exports = function (promise) { + + return typeof promise?.then === 'function'; +}; + + +/***/ }), + +/***/ 2686: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* provided dependency */ var Buffer = __webpack_require__(7861)["Buffer"]; + + +const Assert = __webpack_require__(3736); +const Clone = __webpack_require__(6198); +const Utils = __webpack_require__(1377); + + +const internals = {}; + + +module.exports = internals.merge = function (target, source, options) { + + Assert(target && typeof target === 'object', 'Invalid target value: must be an object'); + Assert(source === null || source === undefined || typeof source === 'object', 'Invalid source value: must be null, undefined, or an object'); + + if (!source) { + return target; + } + + options = Object.assign({ nullOverride: true, mergeArrays: true }, options); + + if (Array.isArray(source)) { + Assert(Array.isArray(target), 'Cannot merge array onto an object'); + if (!options.mergeArrays) { + target.length = 0; // Must not change target assignment + } + + for (let i = 0; i < source.length; ++i) { + target.push(Clone(source[i], { symbols: options.symbols })); + } + + return target; + } + + const keys = Utils.keys(source, options); + for (let i = 0; i < keys.length; ++i) { + const key = keys[i]; + if (key === '__proto__' || + !Object.prototype.propertyIsEnumerable.call(source, key)) { + + continue; + } + + const value = source[key]; + if (value && + typeof value === 'object') { + + if (target[key] === value) { + continue; // Can occur for shallow merges + } + + if (!target[key] || + typeof target[key] !== 'object' || + (Array.isArray(target[key]) !== Array.isArray(value)) || + value instanceof Date || + (Buffer && Buffer.isBuffer(value)) || // $lab:coverage:ignore$ + value instanceof RegExp) { + + target[key] = Clone(value, { symbols: options.symbols }); + } + else { + internals.merge(target[key], value, options); + } + } + else { + if (value !== null && + value !== undefined) { // Explicit to preserve empty strings + + target[key] = value; + } + else if (options.nullOverride) { + target[key] = value; + } + } + } + + return target; +}; + + +/***/ }), + +/***/ 2439: +/***/ (function(module) { + +"use strict"; + + +const internals = { + wrapped: Symbol('wrapped') +}; + + +module.exports = function (method) { + + if (method[internals.wrapped]) { + return method; + } + + let once = false; + const wrappedFn = function (...args) { + + if (!once) { + once = true; + method(...args); + } + }; + + wrappedFn[internals.wrapped] = true; + return wrappedFn; +}; + + +/***/ }), + +/***/ 6622: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +const Assert = __webpack_require__(3736); + + +const internals = {}; + + +module.exports = function (obj, chain, options) { + + if (chain === false || + chain === null || + chain === undefined) { + + return obj; + } + + options = options || {}; + if (typeof options === 'string') { + options = { separator: options }; + } + + const isChainArray = Array.isArray(chain); + + Assert(!isChainArray || !options.separator, 'Separator option is not valid for array-based chain'); + + const path = isChainArray ? chain : chain.split(options.separator || '.'); + let ref = obj; + for (let i = 0; i < path.length; ++i) { + let key = path[i]; + const type = options.iterables && internals.iterables(ref); + + if (Array.isArray(ref) || + type === 'set') { + + const number = Number(key); + if (Number.isInteger(number)) { + key = number < 0 ? ref.length + number : number; + } + } + + if (!ref || + typeof ref === 'function' && options.functions === false || // Defaults to true + !type && ref[key] === undefined) { + + Assert(!options.strict || i + 1 === path.length, 'Missing segment', key, 'in reach path ', chain); + Assert(typeof ref === 'object' || options.functions === true || typeof ref !== 'function', 'Invalid segment', key, 'in reach path ', chain); + ref = options.default; + break; + } + + if (!type) { + ref = ref[key]; + } + else if (type === 'set') { + ref = [...ref][key]; + } + else { // type === 'map' + ref = ref.get(key); + } + } + + return ref; +}; + + +internals.iterables = function (ref) { + + if (ref instanceof Set) { + return 'set'; + } + + if (ref instanceof Map) { + return 'map'; + } +}; + + +/***/ }), + +/***/ 9865: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +const Reach = __webpack_require__(6622); + + +const internals = {}; + + +module.exports = function (obj, template, options) { + + return template.replace(/{([^{}]+)}/g, ($0, chain) => { + + const value = Reach(obj, chain, options); + return value ?? ''; + }); +}; + + +/***/ }), + +/***/ 9708: +/***/ (function(module) { + +"use strict"; + + +const internals = {}; + + +module.exports = function (...args) { + + try { + return JSON.stringify(...args); + } + catch (err) { + return '[Cannot display object: ' + err.message + ']'; + } +}; + + +/***/ }), + +/***/ 4360: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* provided dependency */ var Buffer = __webpack_require__(7861)["Buffer"]; + + +const internals = {}; + + +exports = module.exports = { + array: Array.prototype, + buffer: Buffer && Buffer.prototype, // $lab:coverage:ignore$ + date: Date.prototype, + error: Error.prototype, + generic: Object.prototype, + map: Map.prototype, + promise: Promise.prototype, + regex: RegExp.prototype, + set: Set.prototype, + weakMap: WeakMap.prototype, + weakSet: WeakSet.prototype +}; + + +internals.typeMap = new Map([ + ['[object Error]', exports.error], + ['[object Map]', exports.map], + ['[object Promise]', exports.promise], + ['[object Set]', exports.set], + ['[object WeakMap]', exports.weakMap], + ['[object WeakSet]', exports.weakSet] +]); + + +exports.getInternalProto = function (obj) { + + if (Array.isArray(obj)) { + return exports.array; + } + + if (Buffer && obj instanceof Buffer) { // $lab:coverage:ignore$ + return exports.buffer; + } + + if (obj instanceof Date) { + return exports.date; + } + + if (obj instanceof RegExp) { + return exports.regex; + } + + if (obj instanceof Error) { + return exports.error; + } + + const objName = Object.prototype.toString.call(obj); + return internals.typeMap.get(objName) || exports.generic; +}; + + +/***/ }), + +/***/ 1377: +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +const internals = {}; + + +exports.keys = function (obj, options = {}) { + + return options.symbols !== false ? Reflect.ownKeys(obj) : Object.getOwnPropertyNames(obj); // Defaults to true +}; + + +/***/ }), + +/***/ 762: +/***/ (function(module) { + +"use strict"; + + +const internals = { + maxTimer: 2 ** 31 - 1 // ~25 days +}; + + +module.exports = function (timeout, returnValue, options) { + + if (typeof timeout === 'bigint') { + timeout = Number(timeout); + } + + if (timeout >= Number.MAX_SAFE_INTEGER) { // Thousands of years + timeout = Infinity; + } + + if (typeof timeout !== 'number' && timeout !== undefined) { + throw new TypeError('Timeout must be a number or bigint'); + } + + return new Promise((resolve) => { + + const _setTimeout = options ? options.setTimeout : setTimeout; + + const activate = () => { + + const time = Math.min(timeout, internals.maxTimer); + timeout -= time; + _setTimeout(() => (timeout > 0 ? activate() : resolve(returnValue)), time); + }; + + if (timeout !== Infinity) { + activate(); + } + }); +}; + + +/***/ }), + +/***/ 6731: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; +/* provided dependency */ var Buffer = __webpack_require__(7861)["Buffer"]; + + +const Crypto = __webpack_require__(8307); + +const B64 = __webpack_require__(1481); +const Boom = __webpack_require__(2730); +const Bourne = __webpack_require__(1195); +const Cryptiles = __webpack_require__(9681); +const Hoek = __webpack_require__(2148); + + +const internals = {}; + + +exports.defaults = { + encryption: { + saltBits: 256, + algorithm: 'aes-256-cbc', + iterations: 1, + minPasswordlength: 32 + }, + + integrity: { + saltBits: 256, + algorithm: 'sha256', + iterations: 1, + minPasswordlength: 32 + }, + + ttl: 0, // Milliseconds, 0 means forever + timestampSkewSec: 60, // Seconds of permitted clock skew for incoming expirations + localtimeOffsetMsec: 0 // Local clock time offset express in a number of milliseconds (positive or negative) +}; + + +// Algorithm configuration + +exports.algorithms = { + 'aes-128-ctr': { keyBits: 128, ivBits: 128 }, + 'aes-256-cbc': { keyBits: 256, ivBits: 128 }, + 'sha256': { keyBits: 256 } +}; + + +// MAC normalization format version + +exports.macFormatVersion = '2'; // Prevent comparison of mac values generated with different normalized string formats + +exports.macPrefix = 'Fe26.' + exports.macFormatVersion; + + +// Generate a unique encryption key + +/* + const options = { + saltBits: 256, // Ignored if salt is set + salt: '4d8nr9q384nr9q384nr93q8nruq9348run', + algorithm: 'aes-128-ctr', + iterations: 10000, + iv: 'sdfsdfsdfsdfscdrgercgesrcgsercg', // Optional + minPasswordlength: 32 + }; +*/ + +exports.generateKey = async function (password, options) { + + if (!password) { + throw new Boom.Boom('Empty password'); + } + + if (!options || + typeof options !== 'object') { + + throw new Boom.Boom('Bad options'); + } + + const algorithm = exports.algorithms[options.algorithm]; + if (!algorithm) { + throw new Boom.Boom('Unknown algorithm: ' + options.algorithm); + } + + const result = {}; + + if (Buffer.isBuffer(password)) { + if (password.length < algorithm.keyBits / 8) { + throw new Boom.Boom('Key buffer (password) too small'); + } + + result.key = password; + result.salt = ''; + } + else { + if (password.length < options.minPasswordlength) { + throw new Boom.Boom('Password string too short (min ' + options.minPasswordlength + ' characters required)'); + } + + let salt = options.salt; + if (!salt) { + if (!options.saltBits) { + throw new Boom.Boom('Missing salt and saltBits options'); + } + + const randomSalt = Cryptiles.randomBits(options.saltBits); + salt = randomSalt.toString('hex'); + } + + const derivedKey = await internals.pbkdf2(password, salt, options.iterations, algorithm.keyBits / 8, 'sha1'); + + result.key = derivedKey; + result.salt = salt; + } + + if (options.iv) { + result.iv = options.iv; + } + else if (algorithm.ivBits) { + result.iv = Cryptiles.randomBits(algorithm.ivBits); + } + + return result; +}; + + +// Encrypt data +// options: see exports.generateKey() + +exports.encrypt = async function (password, options, data) { + + const key = await exports.generateKey(password, options); + const cipher = Crypto.createCipheriv(options.algorithm, key.key, key.iv); + const encrypted = Buffer.concat([cipher.update(data, 'utf8'), cipher.final()]); + + return { encrypted, key }; +}; + + +// Decrypt data +// options: see exports.generateKey() + +exports.decrypt = async function (password, options, data) { + + const key = await exports.generateKey(password, options); + const decipher = Crypto.createDecipheriv(options.algorithm, key.key, key.iv); + let dec = decipher.update(data, null, 'utf8'); + dec = dec + decipher.final('utf8'); + + return dec; +}; + + +// HMAC using a password +// options: see exports.generateKey() + +exports.hmacWithPassword = async function (password, options, data) { + + const key = await exports.generateKey(password, options); + const hmac = Crypto.createHmac(options.algorithm, key.key).update(data); + const digest = hmac.digest('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, ''); + + return { + digest, + salt: key.salt + }; +}; + + +// Normalizes a password parameter into a { id, encryption, integrity } object +// password: string, buffer or object with { id, secret } or { id, encryption, integrity } + +internals.normalizePassword = function (password) { + + if (password && + typeof password === 'object' && + !Buffer.isBuffer(password)) { + + return { + id: password.id, + encryption: password.secret ?? password.encryption, + integrity: password.secret ?? password.integrity + }; + } + + return { + encryption: password, + integrity: password + }; +}; + + +// Encrypt and HMAC an object +// password: string, buffer or object with { id, secret } or { id, encryption, integrity } +// options: see exports.defaults + +exports.seal = async function (object, password, options) { + + options = Object.assign({}, options); // Shallow cloned to prevent changes during async operations + + const now = Date.now() + (options.localtimeOffsetMsec ?? 0); // Measure now before any other processing + + // Serialize object + + const objectString = internals.stringify(object); + + // Obtain password + + let passwordId = ''; + password = internals.normalizePassword(password); + if (password.id) { + if (!/^\w+$/.test(password.id)) { + throw new Boom.Boom('Invalid password id'); + } + + passwordId = password.id; + } + + // Encrypt object string + + const { encrypted, key } = await exports.encrypt(password.encryption, options.encryption, objectString); + + // Base64url the encrypted value + + const encryptedB64 = B64.base64urlEncode(encrypted); + const iv = B64.base64urlEncode(key.iv); + const expiration = (options.ttl ? now + options.ttl : ''); + const macBaseString = exports.macPrefix + '*' + passwordId + '*' + key.salt + '*' + iv + '*' + encryptedB64 + '*' + expiration; + + // Mac the combined values + + const mac = await exports.hmacWithPassword(password.integrity, options.integrity, macBaseString); + + // Put it all together + + // prefix*[password-id]*encryption-salt*encryption-iv*encrypted*[expiration]*hmac-salt*hmac + // Allowed URI query name/value characters: *-. \d \w + + const sealed = macBaseString + '*' + mac.salt + '*' + mac.digest; + return sealed; +}; + + +// Decrypt and validate sealed string +// password: string, buffer or object with { id: secret } or { id: { encryption, integrity } } +// options: see exports.defaults + +exports.unseal = async function (sealed, password, options) { + + options = Object.assign({}, options); // Shallow cloned to prevent changes during async operations + + const now = Date.now() + (options.localtimeOffsetMsec ?? 0); // Measure now before any other processing + + // Break string into components + + const parts = sealed.split('*'); + if (parts.length !== 8) { + throw new Boom.Boom('Incorrect number of sealed components'); + } + + const macPrefix = parts[0]; + const passwordId = parts[1]; + const encryptionSalt = parts[2]; + const encryptionIv = parts[3]; + const encryptedB64 = parts[4]; + const expiration = parts[5]; + const hmacSalt = parts[6]; + const hmac = parts[7]; + const macBaseString = macPrefix + '*' + passwordId + '*' + encryptionSalt + '*' + encryptionIv + '*' + encryptedB64 + '*' + expiration; + + // Check prefix + + if (macPrefix !== exports.macPrefix) { + throw new Boom.Boom('Wrong mac prefix'); + } + + // Check expiration + + if (expiration) { + if (!expiration.match(/^\d+$/)) { + throw new Boom.Boom('Invalid expiration'); + } + + const exp = parseInt(expiration, 10); + if (exp <= (now - (options.timestampSkewSec * 1000))) { + throw new Boom.Boom('Expired seal'); + } + } + + // Obtain password + + if (!password) { + throw new Boom.Boom('Empty password'); + } + + if (typeof password === 'object' && + !Buffer.isBuffer(password)) { + + password = password[passwordId || 'default']; + if (!password) { + throw new Boom.Boom('Cannot find password: ' + passwordId); + } + } + + password = internals.normalizePassword(password); + + // Check hmac + + const macOptions = Hoek.clone(options.integrity); + macOptions.salt = hmacSalt; + const mac = await exports.hmacWithPassword(password.integrity, macOptions, macBaseString); + + if (!Cryptiles.fixedTimeComparison(mac.digest, hmac)) { + throw new Boom.Boom('Bad hmac value'); + } + + // Decrypt + + try { + var encrypted = B64.base64urlDecode(encryptedB64, 'buffer'); + } + catch (err) { + throw Boom.boomify(err); + } + + const decryptOptions = Hoek.clone(options.encryption); + decryptOptions.salt = encryptionSalt; + + try { + decryptOptions.iv = B64.base64urlDecode(encryptionIv, 'buffer'); + } + catch (err) { + throw Boom.boomify(err); + } + + const decrypted = await exports.decrypt(password.encryption, decryptOptions, encrypted); + + // Parse JSON + + try { + return Bourne.parse(decrypted); + } + catch (err) { + throw new Boom.Boom('Failed parsing sealed object JSON: ' + err.message); + } +}; + + +internals.stringify = function (object) { + + try { + return JSON.stringify(object); + } + catch (err) { + throw new Boom.Boom('Failed to stringify object: ' + err.message); + } +}; + + +internals.pbkdf2 = function (...args) { + + return new Promise((resolve, reject) => { + + const next = (err, result) => { + + if (err) { + return reject(Boom.boomify(err)); + } + + resolve(result); + }; + + args.push(next); + Crypto.pbkdf2(...args); + }); +}; + + +/***/ }), + +/***/ 6446: +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +exports.byteLength = byteLength +exports.toByteArray = toByteArray +exports.fromByteArray = fromByteArray + +var lookup = [] +var revLookup = [] +var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array + +var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' +for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i] + revLookup[code.charCodeAt(i)] = i +} + +// Support decoding URL-safe base64 strings, as Node.js does. +// See: https://en.wikipedia.org/wiki/Base64#URL_applications +revLookup['-'.charCodeAt(0)] = 62 +revLookup['_'.charCodeAt(0)] = 63 + +function getLens (b64) { + var len = b64.length + + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + var validLen = b64.indexOf('=') + if (validLen === -1) validLen = len + + var placeHoldersLen = validLen === len + ? 0 + : 4 - (validLen % 4) + + return [validLen, placeHoldersLen] +} + +// base64 is 4/3 + up to two characters of the original data +function byteLength (b64) { + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen +} + +function _byteLength (b64, validLen, placeHoldersLen) { + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen +} + +function toByteArray (b64) { + var tmp + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] + + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) + + var curByte = 0 + + // if there are placeholders, only get up to the last complete 4 chars + var len = placeHoldersLen > 0 + ? validLen - 4 + : validLen + + var i + for (i = 0; i < len; i += 4) { + tmp = + (revLookup[b64.charCodeAt(i)] << 18) | + (revLookup[b64.charCodeAt(i + 1)] << 12) | + (revLookup[b64.charCodeAt(i + 2)] << 6) | + revLookup[b64.charCodeAt(i + 3)] + arr[curByte++] = (tmp >> 16) & 0xFF + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF + } + + if (placeHoldersLen === 2) { + tmp = + (revLookup[b64.charCodeAt(i)] << 2) | + (revLookup[b64.charCodeAt(i + 1)] >> 4) + arr[curByte++] = tmp & 0xFF + } + + if (placeHoldersLen === 1) { + tmp = + (revLookup[b64.charCodeAt(i)] << 10) | + (revLookup[b64.charCodeAt(i + 1)] << 4) | + (revLookup[b64.charCodeAt(i + 2)] >> 2) + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF + } + + return arr +} + +function tripletToBase64 (num) { + return lookup[num >> 18 & 0x3F] + + lookup[num >> 12 & 0x3F] + + lookup[num >> 6 & 0x3F] + + lookup[num & 0x3F] +} + +function encodeChunk (uint8, start, end) { + var tmp + var output = [] + for (var i = start; i < end; i += 3) { + tmp = + ((uint8[i] << 16) & 0xFF0000) + + ((uint8[i + 1] << 8) & 0xFF00) + + (uint8[i + 2] & 0xFF) + output.push(tripletToBase64(tmp)) + } + return output.join('') +} + +function fromByteArray (uint8) { + var tmp + var len = uint8.length + var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes + var parts = [] + var maxChunkLength = 16383 // must be multiple of 3 + + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) + } + + // pad the end with zeros, but make sure to not forget the extra bytes + if (extraBytes === 1) { + tmp = uint8[len - 1] + parts.push( + lookup[tmp >> 2] + + lookup[(tmp << 4) & 0x3F] + + '==' + ) + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1] + parts.push( + lookup[tmp >> 10] + + lookup[(tmp >> 4) & 0x3F] + + lookup[(tmp << 2) & 0x3F] + + '=' + ) + } + + return parts.join('') +} + + +/***/ }), + +/***/ 7861: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +/* eslint-disable no-proto */ + + + +var base64 = __webpack_require__(6446) +var ieee754 = __webpack_require__(7164) +var customInspectSymbol = + (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation + ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation + : null + +exports.Buffer = Buffer +exports.SlowBuffer = SlowBuffer +exports.INSPECT_MAX_BYTES = 50 + +var K_MAX_LENGTH = 0x7fffffff +exports.kMaxLength = K_MAX_LENGTH + +/** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Print warning and recommend using `buffer` v4.x which has an Object + * implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * We report that the browser does not support typed arrays if the are not subclassable + * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` + * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support + * for __proto__ and has a buggy typed array implementation. + */ +Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport() + +if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && + typeof console.error === 'function') { + console.error( + 'This browser lacks typed array (Uint8Array) support which is required by ' + + '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.' + ) +} + +function typedArraySupport () { + // Can typed array instances can be augmented? + try { + var arr = new Uint8Array(1) + var proto = { foo: function () { return 42 } } + Object.setPrototypeOf(proto, Uint8Array.prototype) + Object.setPrototypeOf(arr, proto) + return arr.foo() === 42 + } catch (e) { + return false + } +} + +Object.defineProperty(Buffer.prototype, 'parent', { + enumerable: true, + get: function () { + if (!Buffer.isBuffer(this)) return undefined + return this.buffer + } +}) + +Object.defineProperty(Buffer.prototype, 'offset', { + enumerable: true, + get: function () { + if (!Buffer.isBuffer(this)) return undefined + return this.byteOffset + } +}) + +function createBuffer (length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"') + } + // Return an augmented `Uint8Array` instance + var buf = new Uint8Array(length) + Object.setPrototypeOf(buf, Buffer.prototype) + return buf +} + +/** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + +function Buffer (arg, encodingOrOffset, length) { + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new TypeError( + 'The "string" argument must be of type string. Received type number' + ) + } + return allocUnsafe(arg) + } + return from(arg, encodingOrOffset, length) +} + +Buffer.poolSize = 8192 // not used by this implementation + +function from (value, encodingOrOffset, length) { + if (typeof value === 'string') { + return fromString(value, encodingOrOffset) + } + + if (ArrayBuffer.isView(value)) { + return fromArrayView(value) + } + + if (value == null) { + throw new TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) + } + + if (isInstance(value, ArrayBuffer) || + (value && isInstance(value.buffer, ArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length) + } + + if (typeof SharedArrayBuffer !== 'undefined' && + (isInstance(value, SharedArrayBuffer) || + (value && isInstance(value.buffer, SharedArrayBuffer)))) { + return fromArrayBuffer(value, encodingOrOffset, length) + } + + if (typeof value === 'number') { + throw new TypeError( + 'The "value" argument must not be of type number. Received type number' + ) + } + + var valueOf = value.valueOf && value.valueOf() + if (valueOf != null && valueOf !== value) { + return Buffer.from(valueOf, encodingOrOffset, length) + } + + var b = fromObject(value) + if (b) return b + + if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && + typeof value[Symbol.toPrimitive] === 'function') { + return Buffer.from( + value[Symbol.toPrimitive]('string'), encodingOrOffset, length + ) + } + + throw new TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) +} + +/** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ +Buffer.from = function (value, encodingOrOffset, length) { + return from(value, encodingOrOffset, length) +} + +// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: +// https://github.com/feross/buffer/pull/148 +Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype) +Object.setPrototypeOf(Buffer, Uint8Array) + +function assertSize (size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be of type number') + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } +} + +function alloc (size, fill, encoding) { + assertSize(size) + if (size <= 0) { + return createBuffer(size) + } + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpreted as a start offset. + return typeof encoding === 'string' + ? createBuffer(size).fill(fill, encoding) + : createBuffer(size).fill(fill) + } + return createBuffer(size) +} + +/** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ +Buffer.alloc = function (size, fill, encoding) { + return alloc(size, fill, encoding) +} + +function allocUnsafe (size) { + assertSize(size) + return createBuffer(size < 0 ? 0 : checked(size) | 0) +} + +/** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ +Buffer.allocUnsafe = function (size) { + return allocUnsafe(size) +} +/** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ +Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(size) +} + +function fromString (string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8' + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + + var length = byteLength(string, encoding) | 0 + var buf = createBuffer(length) + + var actual = buf.write(string, encoding) + + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + buf = buf.slice(0, actual) + } + + return buf +} + +function fromArrayLike (array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0 + var buf = createBuffer(length) + for (var i = 0; i < length; i += 1) { + buf[i] = array[i] & 255 + } + return buf +} + +function fromArrayView (arrayView) { + if (isInstance(arrayView, Uint8Array)) { + var copy = new Uint8Array(arrayView) + return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength) + } + return fromArrayLike(arrayView) +} + +function fromArrayBuffer (array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds') + } + + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds') + } + + var buf + if (byteOffset === undefined && length === undefined) { + buf = new Uint8Array(array) + } else if (length === undefined) { + buf = new Uint8Array(array, byteOffset) + } else { + buf = new Uint8Array(array, byteOffset, length) + } + + // Return an augmented `Uint8Array` instance + Object.setPrototypeOf(buf, Buffer.prototype) + + return buf +} + +function fromObject (obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0 + var buf = createBuffer(len) + + if (buf.length === 0) { + return buf + } + + obj.copy(buf, 0, 0, len) + return buf + } + + if (obj.length !== undefined) { + if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { + return createBuffer(0) + } + return fromArrayLike(obj) + } + + if (obj.type === 'Buffer' && Array.isArray(obj.data)) { + return fromArrayLike(obj.data) + } +} + +function checked (length) { + // Note: cannot use `length < K_MAX_LENGTH` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= K_MAX_LENGTH) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes') + } + return length | 0 +} + +function SlowBuffer (length) { + if (+length != length) { // eslint-disable-line eqeqeq + length = 0 + } + return Buffer.alloc(+length) +} + +Buffer.isBuffer = function isBuffer (b) { + return b != null && b._isBuffer === true && + b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false +} + +Buffer.compare = function compare (a, b) { + if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength) + if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength) + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError( + 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' + ) + } + + if (a === b) return 0 + + var x = a.length + var y = b.length + + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i] + y = b[i] + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 +} + +Buffer.isEncoding = function isEncoding (encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true + default: + return false + } +} + +Buffer.concat = function concat (list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + + if (list.length === 0) { + return Buffer.alloc(0) + } + + var i + if (length === undefined) { + length = 0 + for (i = 0; i < list.length; ++i) { + length += list[i].length + } + } + + var buffer = Buffer.allocUnsafe(length) + var pos = 0 + for (i = 0; i < list.length; ++i) { + var buf = list[i] + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer.length) { + Buffer.from(buf).copy(buffer, pos) + } else { + Uint8Array.prototype.set.call( + buffer, + buf, + pos + ) + } + } else if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } else { + buf.copy(buffer, pos) + } + pos += buf.length + } + return buffer +} + +function byteLength (string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length + } + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { + return string.byteLength + } + if (typeof string !== 'string') { + throw new TypeError( + 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + + 'Received type ' + typeof string + ) + } + + var len = string.length + var mustMatch = (arguments.length > 2 && arguments[2] === true) + if (!mustMatch && len === 0) return 0 + + // Use a for loop to avoid recursion + var loweredCase = false + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len + case 'utf8': + case 'utf-8': + return utf8ToBytes(string).length + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2 + case 'hex': + return len >>> 1 + case 'base64': + return base64ToBytes(string).length + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8 + } + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} +Buffer.byteLength = byteLength + +function slowToString (encoding, start, end) { + var loweredCase = false + + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + if (start === undefined || start < 0) { + start = 0 + } + // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + if (start > this.length) { + return '' + } + + if (end === undefined || end > this.length) { + end = this.length + } + + if (end <= 0) { + return '' + } + + // Force coercion to uint32. This will also coerce falsey/NaN values to 0. + end >>>= 0 + start >>>= 0 + + if (end <= start) { + return '' + } + + if (!encoding) encoding = 'utf8' + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end) + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end) + + case 'ascii': + return asciiSlice(this, start, end) + + case 'latin1': + case 'binary': + return latin1Slice(this, start, end) + + case 'base64': + return base64Slice(this, start, end) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = (encoding + '').toLowerCase() + loweredCase = true + } + } +} + +// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) +// to detect a Buffer instance. It's not possible to use `instanceof Buffer` +// reliably in a browserify context because there could be multiple different +// copies of the 'buffer' package in use. This method works even for Buffer +// instances that were created from another copy of the `buffer` package. +// See: https://github.com/feross/buffer/issues/154 +Buffer.prototype._isBuffer = true + +function swap (b, n, m) { + var i = b[n] + b[n] = b[m] + b[m] = i +} + +Buffer.prototype.swap16 = function swap16 () { + var len = this.length + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits') + } + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1) + } + return this +} + +Buffer.prototype.swap32 = function swap32 () { + var len = this.length + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits') + } + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3) + swap(this, i + 1, i + 2) + } + return this +} + +Buffer.prototype.swap64 = function swap64 () { + var len = this.length + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits') + } + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7) + swap(this, i + 1, i + 6) + swap(this, i + 2, i + 5) + swap(this, i + 3, i + 4) + } + return this +} + +Buffer.prototype.toString = function toString () { + var length = this.length + if (length === 0) return '' + if (arguments.length === 0) return utf8Slice(this, 0, length) + return slowToString.apply(this, arguments) +} + +Buffer.prototype.toLocaleString = Buffer.prototype.toString + +Buffer.prototype.equals = function equals (b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return true + return Buffer.compare(this, b) === 0 +} + +Buffer.prototype.inspect = function inspect () { + var str = '' + var max = exports.INSPECT_MAX_BYTES + str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim() + if (this.length > max) str += ' ... ' + return '' +} +if (customInspectSymbol) { + Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect +} + +Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer.from(target, target.offset, target.byteLength) + } + if (!Buffer.isBuffer(target)) { + throw new TypeError( + 'The "target" argument must be one of type Buffer or Uint8Array. ' + + 'Received type ' + (typeof target) + ) + } + + if (start === undefined) { + start = 0 + } + if (end === undefined) { + end = target ? target.length : 0 + } + if (thisStart === undefined) { + thisStart = 0 + } + if (thisEnd === undefined) { + thisEnd = this.length + } + + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index') + } + + if (thisStart >= thisEnd && start >= end) { + return 0 + } + if (thisStart >= thisEnd) { + return -1 + } + if (start >= end) { + return 1 + } + + start >>>= 0 + end >>>= 0 + thisStart >>>= 0 + thisEnd >>>= 0 + + if (this === target) return 0 + + var x = thisEnd - thisStart + var y = end - start + var len = Math.min(x, y) + + var thisCopy = this.slice(thisStart, thisEnd) + var targetCopy = target.slice(start, end) + + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i] + y = targetCopy[i] + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 +} + +// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, +// OR the last index of `val` in `buffer` at offset <= `byteOffset`. +// +// Arguments: +// - buffer - a Buffer to search +// - val - a string, Buffer, or number +// - byteOffset - an index into `buffer`; will be clamped to an int32 +// - encoding - an optional encoding, relevant is val is a string +// - dir - true for indexOf, false for lastIndexOf +function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1 + + // Normalize byteOffset + if (typeof byteOffset === 'string') { + encoding = byteOffset + byteOffset = 0 + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff + } else if (byteOffset < -0x80000000) { + byteOffset = -0x80000000 + } + byteOffset = +byteOffset // Coerce to Number. + if (numberIsNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : (buffer.length - 1) + } + + // Normalize byteOffset: negative offsets start from the end of the buffer + if (byteOffset < 0) byteOffset = buffer.length + byteOffset + if (byteOffset >= buffer.length) { + if (dir) return -1 + else byteOffset = buffer.length - 1 + } else if (byteOffset < 0) { + if (dir) byteOffset = 0 + else return -1 + } + + // Normalize val + if (typeof val === 'string') { + val = Buffer.from(val, encoding) + } + + // Finally, search either indexOf (if dir is true) or lastIndexOf + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1 + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir) + } else if (typeof val === 'number') { + val = val & 0xFF // Search for a byte value [0-255] + if (typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) + } + } + return arrayIndexOf(buffer, [val], byteOffset, encoding, dir) + } + + throw new TypeError('val must be string, number or Buffer') +} + +function arrayIndexOf (arr, val, byteOffset, encoding, dir) { + var indexSize = 1 + var arrLength = arr.length + var valLength = val.length + + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase() + if (encoding === 'ucs2' || encoding === 'ucs-2' || + encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1 + } + indexSize = 2 + arrLength /= 2 + valLength /= 2 + byteOffset /= 2 + } + } + + function read (buf, i) { + if (indexSize === 1) { + return buf[i] + } else { + return buf.readUInt16BE(i * indexSize) + } + } + + var i + if (dir) { + var foundIndex = -1 + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize + } else { + if (foundIndex !== -1) i -= i - foundIndex + foundIndex = -1 + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength + for (i = byteOffset; i >= 0; i--) { + var found = true + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false + break + } + } + if (found) return i + } + } + + return -1 +} + +Buffer.prototype.includes = function includes (val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1 +} + +Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true) +} + +Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false) +} + +function hexWrite (buf, string, offset, length) { + offset = Number(offset) || 0 + var remaining = buf.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining + } + } + + var strLen = string.length + + if (length > strLen / 2) { + length = strLen / 2 + } + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16) + if (numberIsNaN(parsed)) return i + buf[offset + i] = parsed + } + return i +} + +function utf8Write (buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) +} + +function asciiWrite (buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length) +} + +function base64Write (buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length) +} + +function ucs2Write (buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) +} + +Buffer.prototype.write = function write (string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8' + length = this.length + offset = 0 + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset + length = this.length + offset = 0 + // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset >>> 0 + if (isFinite(length)) { + length = length >>> 0 + if (encoding === undefined) encoding = 'utf8' + } else { + encoding = length + length = undefined + } + } else { + throw new Error( + 'Buffer.write(string, encoding, offset[, length]) is no longer supported' + ) + } + + var remaining = this.length - offset + if (length === undefined || length > remaining) length = remaining + + if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds') + } + + if (!encoding) encoding = 'utf8' + + var loweredCase = false + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length) + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length) + + case 'ascii': + case 'latin1': + case 'binary': + return asciiWrite(this, string, offset, length) + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} + +Buffer.prototype.toJSON = function toJSON () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } +} + +function base64Slice (buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf) + } else { + return base64.fromByteArray(buf.slice(start, end)) + } +} + +function utf8Slice (buf, start, end) { + end = Math.min(buf.length, end) + var res = [] + + var i = start + while (i < end) { + var firstByte = buf[i] + var codePoint = null + var bytesPerSequence = (firstByte > 0xEF) + ? 4 + : (firstByte > 0xDF) + ? 3 + : (firstByte > 0xBF) + ? 2 + : 1 + + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte + } + break + case 2: + secondByte = buf[i + 1] + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint + } + } + break + case 3: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint + } + } + break + case 4: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + fourthByte = buf[i + 3] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint + } + } + } + } + + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD + bytesPerSequence = 1 + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000 + res.push(codePoint >>> 10 & 0x3FF | 0xD800) + codePoint = 0xDC00 | codePoint & 0x3FF + } + + res.push(codePoint) + i += bytesPerSequence + } + + return decodeCodePointsArray(res) +} + +// Based on http://stackoverflow.com/a/22747272/680742, the browser with +// the lowest limit is Chrome, with 0x10000 args. +// We go 1 magnitude less, for safety +var MAX_ARGUMENTS_LENGTH = 0x1000 + +function decodeCodePointsArray (codePoints) { + var len = codePoints.length + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints) // avoid extra slice() + } + + // Decode in chunks to avoid "call stack size exceeded". + var res = '' + var i = 0 + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) + ) + } + return res +} + +function asciiSlice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F) + } + return ret +} + +function latin1Slice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]) + } + return ret +} + +function hexSlice (buf, start, end) { + var len = buf.length + + if (!start || start < 0) start = 0 + if (!end || end < 0 || end > len) end = len + + var out = '' + for (var i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]] + } + return out +} + +function utf16leSlice (buf, start, end) { + var bytes = buf.slice(start, end) + var res = '' + // If bytes.length is odd, the last 8 bits must be ignored (same as node.js) + for (var i = 0; i < bytes.length - 1; i += 2) { + res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256)) + } + return res +} + +Buffer.prototype.slice = function slice (start, end) { + var len = this.length + start = ~~start + end = end === undefined ? len : ~~end + + if (start < 0) { + start += len + if (start < 0) start = 0 + } else if (start > len) { + start = len + } + + if (end < 0) { + end += len + if (end < 0) end = 0 + } else if (end > len) { + end = len + } + + if (end < start) end = start + + var newBuf = this.subarray(start, end) + // Return an augmented `Uint8Array` instance + Object.setPrototypeOf(newBuf, Buffer.prototype) + + return newBuf +} + +/* + * Need to make sure that buffer isn't trying to write out of bounds. + */ +function checkOffset (offset, ext, length) { + if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') +} + +Buffer.prototype.readUintLE = +Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + + return val +} + +Buffer.prototype.readUintBE = +Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) { + checkOffset(offset, byteLength, this.length) + } + + var val = this[offset + --byteLength] + var mul = 1 + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul + } + + return val +} + +Buffer.prototype.readUint8 = +Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 1, this.length) + return this[offset] +} + +Buffer.prototype.readUint16LE = +Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + return this[offset] | (this[offset + 1] << 8) +} + +Buffer.prototype.readUint16BE = +Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + return (this[offset] << 8) | this[offset + 1] +} + +Buffer.prototype.readUint32LE = +Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + + return ((this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16)) + + (this[offset + 3] * 0x1000000) +} + +Buffer.prototype.readUint32BE = +Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] * 0x1000000) + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) +} + +Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val +} + +Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var i = byteLength + var mul = 1 + var val = this[offset + --i] + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val +} + +Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 1, this.length) + if (!(this[offset] & 0x80)) return (this[offset]) + return ((0xff - this[offset] + 1) * -1) +} + +Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset] | (this[offset + 1] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset + 1] | (this[offset] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16) | + (this[offset + 3] << 24) +} + +Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + (this[offset + 3]) +} + +Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, true, 23, 4) +} + +Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, false, 23, 4) +} + +Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, true, 52, 8) +} + +Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, false, 52, 8) +} + +function checkInt (buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') + if (offset + ext > buf.length) throw new RangeError('Index out of range') +} + +Buffer.prototype.writeUintLE = +Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } + + var mul = 1 + var i = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUintBE = +Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } + + var i = byteLength - 1 + var mul = 1 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUint8 = +Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) + this[offset] = (value & 0xff) + return offset + 1 +} + +Buffer.prototype.writeUint16LE = +Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + return offset + 2 +} + +Buffer.prototype.writeUint16BE = +Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + return offset + 2 +} + +Buffer.prototype.writeUint32LE = +Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + this[offset + 3] = (value >>> 24) + this[offset + 2] = (value >>> 16) + this[offset + 1] = (value >>> 8) + this[offset] = (value & 0xff) + return offset + 4 +} + +Buffer.prototype.writeUint32BE = +Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + return offset + 4 +} + +Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + var limit = Math.pow(2, (8 * byteLength) - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = 0 + var mul = 1 + var sub = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1 + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + var limit = Math.pow(2, (8 * byteLength) - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = byteLength - 1 + var mul = 1 + var sub = 0 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1 + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) + if (value < 0) value = 0xff + value + 1 + this[offset] = (value & 0xff) + return offset + 1 +} + +Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + return offset + 2 +} + +Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + return offset + 2 +} + +Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + this[offset + 2] = (value >>> 16) + this[offset + 3] = (value >>> 24) + return offset + 4 +} + +Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (value < 0) value = 0xffffffff + value + 1 + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + return offset + 4 +} + +function checkIEEE754 (buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range') + if (offset < 0) throw new RangeError('Index out of range') +} + +function writeFloat (buf, value, offset, littleEndian, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) + } + ieee754.write(buf, value, offset, littleEndian, 23, 4) + return offset + 4 +} + +Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) +} + +function writeDouble (buf, value, offset, littleEndian, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) + } + ieee754.write(buf, value, offset, littleEndian, 52, 8) + return offset + 8 +} + +Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) +} + +// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) +Buffer.prototype.copy = function copy (target, targetStart, start, end) { + if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer') + if (!start) start = 0 + if (!end && end !== 0) end = this.length + if (targetStart >= target.length) targetStart = target.length + if (!targetStart) targetStart = 0 + if (end > 0 && end < start) end = start + + // Copy 0 bytes; we're done + if (end === start) return 0 + if (target.length === 0 || this.length === 0) return 0 + + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds') + } + if (start < 0 || start >= this.length) throw new RangeError('Index out of range') + if (end < 0) throw new RangeError('sourceEnd out of bounds') + + // Are we oob? + if (end > this.length) end = this.length + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start + } + + var len = end - start + + if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { + // Use built-in when available, missing from IE11 + this.copyWithin(targetStart, start, end) + } else { + Uint8Array.prototype.set.call( + target, + this.subarray(start, end), + targetStart + ) + } + + return len +} + +// Usage: +// buffer.fill(number[, offset[, end]]) +// buffer.fill(buffer[, offset[, end]]) +// buffer.fill(string[, offset[, end]][, encoding]) +Buffer.prototype.fill = function fill (val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start + start = 0 + end = this.length + } else if (typeof end === 'string') { + encoding = end + end = this.length + } + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string') + } + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + if (val.length === 1) { + var code = val.charCodeAt(0) + if ((encoding === 'utf8' && code < 128) || + encoding === 'latin1') { + // Fast path: If `val` fits into a single byte, use that numeric value. + val = code + } + } + } else if (typeof val === 'number') { + val = val & 255 + } else if (typeof val === 'boolean') { + val = Number(val) + } + + // Invalid ranges are not set to a default, so can range check early. + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index') + } + + if (end <= start) { + return this + } + + start = start >>> 0 + end = end === undefined ? this.length : end >>> 0 + + if (!val) val = 0 + + var i + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val + } + } else { + var bytes = Buffer.isBuffer(val) + ? val + : Buffer.from(val, encoding) + var len = bytes.length + if (len === 0) { + throw new TypeError('The value "' + val + + '" is invalid for argument "value"') + } + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len] + } + } + + return this +} + +// HELPER FUNCTIONS +// ================ + +var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g + +function base64clean (str) { + // Node takes equal signs as end of the Base64 encoding + str = str.split('=')[0] + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = str.trim().replace(INVALID_BASE64_RE, '') + // Node converts strings with length < 2 to '' + if (str.length < 2) return '' + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '=' + } + return str +} + +function utf8ToBytes (string, units) { + units = units || Infinity + var codePoint + var length = string.length + var leadSurrogate = null + var bytes = [] + + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i) + + // is surrogate component + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } + + // valid lead + leadSurrogate = codePoint + + continue + } + + // 2 leads in a row + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + leadSurrogate = codePoint + continue + } + + // valid surrogate pair + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + } + + leadSurrogate = null + + // encode utf8 + if (codePoint < 0x80) { + if ((units -= 1) < 0) break + bytes.push(codePoint) + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break + bytes.push( + codePoint >> 0x6 | 0xC0, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break + bytes.push( + codePoint >> 0xC | 0xE0, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break + bytes.push( + codePoint >> 0x12 | 0xF0, + codePoint >> 0xC & 0x3F | 0x80, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else { + throw new Error('Invalid code point') + } + } + + return bytes +} + +function asciiToBytes (str) { + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF) + } + return byteArray +} + +function utf16leToBytes (str, units) { + var c, hi, lo + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break + + c = str.charCodeAt(i) + hi = c >> 8 + lo = c % 256 + byteArray.push(lo) + byteArray.push(hi) + } + + return byteArray +} + +function base64ToBytes (str) { + return base64.toByteArray(base64clean(str)) +} + +function blitBuffer (src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if ((i + offset >= dst.length) || (i >= src.length)) break + dst[i + offset] = src[i] + } + return i +} + +// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass +// the `instanceof` check but they should be treated as of that type. +// See: https://github.com/feross/buffer/issues/166 +function isInstance (obj, type) { + return obj instanceof type || + (obj != null && obj.constructor != null && obj.constructor.name != null && + obj.constructor.name === type.name) +} +function numberIsNaN (obj) { + // For IE11 support + return obj !== obj // eslint-disable-line no-self-compare +} + +// Create lookup table for `toString('hex')` +// See: https://github.com/feross/buffer/issues/219 +var hexSliceLookupTable = (function () { + var alphabet = '0123456789abcdef' + var table = new Array(256) + for (var i = 0; i < 16; ++i) { + var i16 = i * 16 + for (var j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j] + } + } + return table +})() + + +/***/ }), + +/***/ 2864: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(6653); + +var callBind = __webpack_require__(5592); + +var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); + +module.exports = function callBoundIntrinsic(name, allowMissing) { + var intrinsic = GetIntrinsic(name, !!allowMissing); + if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { + return callBind(intrinsic); + } + return intrinsic; +}; + + +/***/ }), + +/***/ 5592: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(2698); +var GetIntrinsic = __webpack_require__(6653); + +var $apply = GetIntrinsic('%Function.prototype.apply%'); +var $call = GetIntrinsic('%Function.prototype.call%'); +var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); + +var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); +var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); +var $max = GetIntrinsic('%Math.max%'); + +if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + } catch (e) { + // IE 8 has a broken defineProperty + $defineProperty = null; + } +} + +module.exports = function callBind(originalFunction) { + var func = $reflectApply(bind, $call, arguments); + if ($gOPD && $defineProperty) { + var desc = $gOPD(func, 'length'); + if (desc.configurable) { + // original length, plus the receiver, minus any additional arguments (after the receiver) + $defineProperty( + func, + 'length', + { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) } + ); + } + } + return func; +}; + +var applyBind = function applyBind() { + return $reflectApply(bind, $apply, arguments); +}; + +if ($defineProperty) { + $defineProperty(module.exports, 'apply', { value: applyBind }); +} else { + module.exports.apply = applyBind; +} + + +/***/ }), + +/***/ 6179: +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; +/*! + * cookie + * Copyright(c) 2012-2014 Roman Shtylman + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + + + +/** + * Module exports. + * @public + */ + +exports.parse = parse; +exports.serialize = serialize; + +/** + * Module variables. + * @private + */ + +var __toString = Object.prototype.toString + +/** + * RegExp to match field-content in RFC 7230 sec 3.2 + * + * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] + * field-vchar = VCHAR / obs-text + * obs-text = %x80-FF + */ + +var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/; + +/** + * Parse a cookie header. + * + * Parse the given cookie header string into an object + * The object has the various cookies as keys(names) => values + * + * @param {string} str + * @param {object} [options] + * @return {object} + * @public + */ + +function parse(str, options) { + if (typeof str !== 'string') { + throw new TypeError('argument str must be a string'); + } + + var obj = {} + var opt = options || {}; + var dec = opt.decode || decode; + + var index = 0 + while (index < str.length) { + var eqIdx = str.indexOf('=', index) + + // no more cookie pairs + if (eqIdx === -1) { + break + } + + var endIdx = str.indexOf(';', index) + + if (endIdx === -1) { + endIdx = str.length + } else if (endIdx < eqIdx) { + // backtrack on prior semicolon + index = str.lastIndexOf(';', eqIdx - 1) + 1 + continue + } + + var key = str.slice(index, eqIdx).trim() + + // only assign once + if (undefined === obj[key]) { + var val = str.slice(eqIdx + 1, endIdx).trim() + + // quoted values + if (val.charCodeAt(0) === 0x22) { + val = val.slice(1, -1) + } + + obj[key] = tryDecode(val, dec); + } + + index = endIdx + 1 + } + + return obj; +} + +/** + * Serialize data into a cookie header. + * + * Serialize the a name value pair into a cookie string suitable for + * http headers. An optional options object specified cookie parameters. + * + * serialize('foo', 'bar', { httpOnly: true }) + * => "foo=bar; httpOnly" + * + * @param {string} name + * @param {string} val + * @param {object} [options] + * @return {string} + * @public + */ + +function serialize(name, val, options) { + var opt = options || {}; + var enc = opt.encode || encode; + + if (typeof enc !== 'function') { + throw new TypeError('option encode is invalid'); + } + + if (!fieldContentRegExp.test(name)) { + throw new TypeError('argument name is invalid'); + } + + var value = enc(val); + + if (value && !fieldContentRegExp.test(value)) { + throw new TypeError('argument val is invalid'); + } + + var str = name + '=' + value; + + if (null != opt.maxAge) { + var maxAge = opt.maxAge - 0; + + if (isNaN(maxAge) || !isFinite(maxAge)) { + throw new TypeError('option maxAge is invalid') + } + + str += '; Max-Age=' + Math.floor(maxAge); + } + + if (opt.domain) { + if (!fieldContentRegExp.test(opt.domain)) { + throw new TypeError('option domain is invalid'); + } + + str += '; Domain=' + opt.domain; + } + + if (opt.path) { + if (!fieldContentRegExp.test(opt.path)) { + throw new TypeError('option path is invalid'); + } + + str += '; Path=' + opt.path; + } + + if (opt.expires) { + var expires = opt.expires + + if (!isDate(expires) || isNaN(expires.valueOf())) { + throw new TypeError('option expires is invalid'); + } + + str += '; Expires=' + expires.toUTCString() + } + + if (opt.httpOnly) { + str += '; HttpOnly'; + } + + if (opt.secure) { + str += '; Secure'; + } + + if (opt.priority) { + var priority = typeof opt.priority === 'string' + ? opt.priority.toLowerCase() + : opt.priority + + switch (priority) { + case 'low': + str += '; Priority=Low' + break + case 'medium': + str += '; Priority=Medium' + break + case 'high': + str += '; Priority=High' + break + default: + throw new TypeError('option priority is invalid') + } + } + + if (opt.sameSite) { + var sameSite = typeof opt.sameSite === 'string' + ? opt.sameSite.toLowerCase() : opt.sameSite; + + switch (sameSite) { + case true: + str += '; SameSite=Strict'; + break; + case 'lax': + str += '; SameSite=Lax'; + break; + case 'strict': + str += '; SameSite=Strict'; + break; + case 'none': + str += '; SameSite=None'; + break; + default: + throw new TypeError('option sameSite is invalid'); + } + } + + return str; +} + +/** + * URL-decode string value. Optimized to skip native call when no %. + * + * @param {string} str + * @returns {string} + */ + +function decode (str) { + return str.indexOf('%') !== -1 + ? decodeURIComponent(str) + : str +} + +/** + * URL-encode value. + * + * @param {string} str + * @returns {string} + */ + +function encode (val) { + return encodeURIComponent(val) +} + +/** + * Determine if value is a Date. + * + * @param {*} val + * @private + */ + +function isDate (val) { + return __toString.call(val) === '[object Date]' || + val instanceof Date +} + +/** + * Try decoding a string using a decoding function. + * + * @param {string} str + * @param {function} decode + * @private + */ + +function tryDecode(str, decode) { + try { + return decode(str); + } catch (e) { + return str; + } +} + + +/***/ }), + +/***/ 7324: +/***/ (function(module) { + +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +var R = typeof Reflect === 'object' ? Reflect : null +var ReflectApply = R && typeof R.apply === 'function' + ? R.apply + : function ReflectApply(target, receiver, args) { + return Function.prototype.apply.call(target, receiver, args); + } + +var ReflectOwnKeys +if (R && typeof R.ownKeys === 'function') { + ReflectOwnKeys = R.ownKeys +} else if (Object.getOwnPropertySymbols) { + ReflectOwnKeys = function ReflectOwnKeys(target) { + return Object.getOwnPropertyNames(target) + .concat(Object.getOwnPropertySymbols(target)); + }; +} else { + ReflectOwnKeys = function ReflectOwnKeys(target) { + return Object.getOwnPropertyNames(target); + }; +} + +function ProcessEmitWarning(warning) { + if (console && console.warn) console.warn(warning); +} + +var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) { + return value !== value; +} + +function EventEmitter() { + EventEmitter.init.call(this); +} +module.exports = EventEmitter; +module.exports.once = once; + +// Backwards-compat with node 0.10.x +EventEmitter.EventEmitter = EventEmitter; + +EventEmitter.prototype._events = undefined; +EventEmitter.prototype._eventsCount = 0; +EventEmitter.prototype._maxListeners = undefined; + +// By default EventEmitters will print a warning if more than 10 listeners are +// added to it. This is a useful default which helps finding memory leaks. +var defaultMaxListeners = 10; + +function checkListener(listener) { + if (typeof listener !== 'function') { + throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); + } +} + +Object.defineProperty(EventEmitter, 'defaultMaxListeners', { + enumerable: true, + get: function() { + return defaultMaxListeners; + }, + set: function(arg) { + if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) { + throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.'); + } + defaultMaxListeners = arg; + } +}); + +EventEmitter.init = function() { + + if (this._events === undefined || + this._events === Object.getPrototypeOf(this)._events) { + this._events = Object.create(null); + this._eventsCount = 0; + } + + this._maxListeners = this._maxListeners || undefined; +}; + +// Obviously not all Emitters should be limited to 10. This function allows +// that to be increased. Set to zero for unlimited. +EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { + if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) { + throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.'); + } + this._maxListeners = n; + return this; +}; + +function _getMaxListeners(that) { + if (that._maxListeners === undefined) + return EventEmitter.defaultMaxListeners; + return that._maxListeners; +} + +EventEmitter.prototype.getMaxListeners = function getMaxListeners() { + return _getMaxListeners(this); +}; + +EventEmitter.prototype.emit = function emit(type) { + var args = []; + for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); + var doError = (type === 'error'); + + var events = this._events; + if (events !== undefined) + doError = (doError && events.error === undefined); + else if (!doError) + return false; + + // If there is no 'error' event listener then throw. + if (doError) { + var er; + if (args.length > 0) + er = args[0]; + if (er instanceof Error) { + // Note: The comments on the `throw` lines are intentional, they show + // up in Node's output if this results in an unhandled exception. + throw er; // Unhandled 'error' event + } + // At least give some kind of context to the user + var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : '')); + err.context = er; + throw err; // Unhandled 'error' event + } + + var handler = events[type]; + + if (handler === undefined) + return false; + + if (typeof handler === 'function') { + ReflectApply(handler, this, args); + } else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + ReflectApply(listeners[i], this, args); + } + + return true; +}; + +function _addListener(target, type, listener, prepend) { + var m; + var events; + var existing; + + checkListener(listener); + + events = target._events; + if (events === undefined) { + events = target._events = Object.create(null); + target._eventsCount = 0; + } else { + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (events.newListener !== undefined) { + target.emit('newListener', type, + listener.listener ? listener.listener : listener); + + // Re-assign `events` because a newListener handler could have caused the + // this._events to be assigned to a new object + events = target._events; + } + existing = events[type]; + } + + if (existing === undefined) { + // Optimize the case of one listener. Don't need the extra array object. + existing = events[type] = listener; + ++target._eventsCount; + } else { + if (typeof existing === 'function') { + // Adding the second element, need to change to array. + existing = events[type] = + prepend ? [listener, existing] : [existing, listener]; + // If we've already got an array, just append. + } else if (prepend) { + existing.unshift(listener); + } else { + existing.push(listener); + } + + // Check for listener leak + m = _getMaxListeners(target); + if (m > 0 && existing.length > m && !existing.warned) { + existing.warned = true; + // No error code for this since it is a Warning + // eslint-disable-next-line no-restricted-syntax + var w = new Error('Possible EventEmitter memory leak detected. ' + + existing.length + ' ' + String(type) + ' listeners ' + + 'added. Use emitter.setMaxListeners() to ' + + 'increase limit'); + w.name = 'MaxListenersExceededWarning'; + w.emitter = target; + w.type = type; + w.count = existing.length; + ProcessEmitWarning(w); + } + } + + return target; +} + +EventEmitter.prototype.addListener = function addListener(type, listener) { + return _addListener(this, type, listener, false); +}; + +EventEmitter.prototype.on = EventEmitter.prototype.addListener; + +EventEmitter.prototype.prependListener = + function prependListener(type, listener) { + return _addListener(this, type, listener, true); + }; + +function onceWrapper() { + if (!this.fired) { + this.target.removeListener(this.type, this.wrapFn); + this.fired = true; + if (arguments.length === 0) + return this.listener.call(this.target); + return this.listener.apply(this.target, arguments); + } +} + +function _onceWrap(target, type, listener) { + var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; + var wrapped = onceWrapper.bind(state); + wrapped.listener = listener; + state.wrapFn = wrapped; + return wrapped; +} + +EventEmitter.prototype.once = function once(type, listener) { + checkListener(listener); + this.on(type, _onceWrap(this, type, listener)); + return this; +}; + +EventEmitter.prototype.prependOnceListener = + function prependOnceListener(type, listener) { + checkListener(listener); + this.prependListener(type, _onceWrap(this, type, listener)); + return this; + }; + +// Emits a 'removeListener' event if and only if the listener was removed. +EventEmitter.prototype.removeListener = + function removeListener(type, listener) { + var list, events, position, i, originalListener; + + checkListener(listener); + + events = this._events; + if (events === undefined) + return this; + + list = events[type]; + if (list === undefined) + return this; + + if (list === listener || list.listener === listener) { + if (--this._eventsCount === 0) + this._events = Object.create(null); + else { + delete events[type]; + if (events.removeListener) + this.emit('removeListener', type, list.listener || listener); + } + } else if (typeof list !== 'function') { + position = -1; + + for (i = list.length - 1; i >= 0; i--) { + if (list[i] === listener || list[i].listener === listener) { + originalListener = list[i].listener; + position = i; + break; + } + } + + if (position < 0) + return this; + + if (position === 0) + list.shift(); + else { + spliceOne(list, position); + } + + if (list.length === 1) + events[type] = list[0]; + + if (events.removeListener !== undefined) + this.emit('removeListener', type, originalListener || listener); + } + + return this; + }; + +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; + +EventEmitter.prototype.removeAllListeners = + function removeAllListeners(type) { + var listeners, events, i; + + events = this._events; + if (events === undefined) + return this; + + // not listening for removeListener, no need to emit + if (events.removeListener === undefined) { + if (arguments.length === 0) { + this._events = Object.create(null); + this._eventsCount = 0; + } else if (events[type] !== undefined) { + if (--this._eventsCount === 0) + this._events = Object.create(null); + else + delete events[type]; + } + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + var keys = Object.keys(events); + var key; + for (i = 0; i < keys.length; ++i) { + key = keys[i]; + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = Object.create(null); + this._eventsCount = 0; + return this; + } + + listeners = events[type]; + + if (typeof listeners === 'function') { + this.removeListener(type, listeners); + } else if (listeners !== undefined) { + // LIFO order + for (i = listeners.length - 1; i >= 0; i--) { + this.removeListener(type, listeners[i]); + } + } + + return this; + }; + +function _listeners(target, type, unwrap) { + var events = target._events; + + if (events === undefined) + return []; + + var evlistener = events[type]; + if (evlistener === undefined) + return []; + + if (typeof evlistener === 'function') + return unwrap ? [evlistener.listener || evlistener] : [evlistener]; + + return unwrap ? + unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); +} + +EventEmitter.prototype.listeners = function listeners(type) { + return _listeners(this, type, true); +}; + +EventEmitter.prototype.rawListeners = function rawListeners(type) { + return _listeners(this, type, false); +}; + +EventEmitter.listenerCount = function(emitter, type) { + if (typeof emitter.listenerCount === 'function') { + return emitter.listenerCount(type); + } else { + return listenerCount.call(emitter, type); + } +}; + +EventEmitter.prototype.listenerCount = listenerCount; +function listenerCount(type) { + var events = this._events; + + if (events !== undefined) { + var evlistener = events[type]; + + if (typeof evlistener === 'function') { + return 1; + } else if (evlistener !== undefined) { + return evlistener.length; + } + } + + return 0; +} + +EventEmitter.prototype.eventNames = function eventNames() { + return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; +}; + +function arrayClone(arr, n) { + var copy = new Array(n); + for (var i = 0; i < n; ++i) + copy[i] = arr[i]; + return copy; +} + +function spliceOne(list, index) { + for (; index + 1 < list.length; index++) + list[index] = list[index + 1]; + list.pop(); +} + +function unwrapListeners(arr) { + var ret = new Array(arr.length); + for (var i = 0; i < ret.length; ++i) { + ret[i] = arr[i].listener || arr[i]; + } + return ret; +} + +function once(emitter, name) { + return new Promise(function (resolve, reject) { + function errorListener(err) { + emitter.removeListener(name, resolver); + reject(err); + } + + function resolver() { + if (typeof emitter.removeListener === 'function') { + emitter.removeListener('error', errorListener); + } + resolve([].slice.call(arguments)); + }; + + eventTargetAgnosticAddListener(emitter, name, resolver, { once: true }); + if (name !== 'error') { + addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true }); + } + }); +} + +function addErrorHandlerIfEventEmitter(emitter, handler, flags) { + if (typeof emitter.on === 'function') { + eventTargetAgnosticAddListener(emitter, 'error', handler, flags); + } +} + +function eventTargetAgnosticAddListener(emitter, name, listener, flags) { + if (typeof emitter.on === 'function') { + if (flags.once) { + emitter.once(name, listener); + } else { + emitter.on(name, listener); + } + } else if (typeof emitter.addEventListener === 'function') { + // EventTarget does not have `error` event semantics like Node + // EventEmitters, we do not listen for `error` events here. + emitter.addEventListener(name, function wrapListener(arg) { + // IE does not have builtin `{ once: true }` support so we + // have to do it manually. + if (flags.once) { + emitter.removeEventListener(name, wrapListener); + } + listener(arg); + }); + } else { + throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter); + } +} + + +/***/ }), + +/***/ 98: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var isCallable = __webpack_require__(9861); + +var toStr = Object.prototype.toString; +var hasOwnProperty = Object.prototype.hasOwnProperty; + +var forEachArray = function forEachArray(array, iterator, receiver) { + for (var i = 0, len = array.length; i < len; i++) { + if (hasOwnProperty.call(array, i)) { + if (receiver == null) { + iterator(array[i], i, array); + } else { + iterator.call(receiver, array[i], i, array); + } + } + } +}; + +var forEachString = function forEachString(string, iterator, receiver) { + for (var i = 0, len = string.length; i < len; i++) { + // no such thing as a sparse string. + if (receiver == null) { + iterator(string.charAt(i), i, string); + } else { + iterator.call(receiver, string.charAt(i), i, string); + } + } +}; + +var forEachObject = function forEachObject(object, iterator, receiver) { + for (var k in object) { + if (hasOwnProperty.call(object, k)) { + if (receiver == null) { + iterator(object[k], k, object); + } else { + iterator.call(receiver, object[k], k, object); + } + } + } +}; + +var forEach = function forEach(list, iterator, thisArg) { + if (!isCallable(iterator)) { + throw new TypeError('iterator must be a function'); + } + + var receiver; + if (arguments.length >= 3) { + receiver = thisArg; + } + + if (toStr.call(list) === '[object Array]') { + forEachArray(list, iterator, receiver); + } else if (typeof list === 'string') { + forEachString(list, iterator, receiver); + } else { + forEachObject(list, iterator, receiver); + } +}; + +module.exports = forEach; + + +/***/ }), + +/***/ 9748: +/***/ (function(module) { + +"use strict"; + + +/* eslint no-invalid-this: 1 */ + +var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; +var slice = Array.prototype.slice; +var toStr = Object.prototype.toString; +var funcType = '[object Function]'; + +module.exports = function bind(that) { + var target = this; + if (typeof target !== 'function' || toStr.call(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + var args = slice.call(arguments, 1); + + var bound; + var binder = function () { + if (this instanceof bound) { + var result = target.apply( + this, + args.concat(slice.call(arguments)) + ); + if (Object(result) === result) { + return result; + } + return this; + } else { + return target.apply( + that, + args.concat(slice.call(arguments)) + ); + } + }; + + var boundLength = Math.max(0, target.length - args.length); + var boundArgs = []; + for (var i = 0; i < boundLength; i++) { + boundArgs.push('$' + i); + } + + bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); + + if (target.prototype) { + var Empty = function Empty() {}; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + + return bound; +}; + + +/***/ }), + +/***/ 2698: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var implementation = __webpack_require__(9748); + +module.exports = Function.prototype.bind || implementation; + + +/***/ }), + +/***/ 6653: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var undefined; + +var $SyntaxError = SyntaxError; +var $Function = Function; +var $TypeError = TypeError; + +// eslint-disable-next-line consistent-return +var getEvalledConstructor = function (expressionSyntax) { + try { + return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); + } catch (e) {} +}; + +var $gOPD = Object.getOwnPropertyDescriptor; +if ($gOPD) { + try { + $gOPD({}, ''); + } catch (e) { + $gOPD = null; // this is IE 8, which has a broken gOPD + } +} + +var throwTypeError = function () { + throw new $TypeError(); +}; +var ThrowTypeError = $gOPD + ? (function () { + try { + // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties + arguments.callee; // IE 8 does not throw here + return throwTypeError; + } catch (calleeThrows) { + try { + // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') + return $gOPD(arguments, 'callee').get; + } catch (gOPDthrows) { + return throwTypeError; + } + } + }()) + : throwTypeError; + +var hasSymbols = __webpack_require__(2770)(); +var hasProto = __webpack_require__(7877)(); + +var getProto = Object.getPrototypeOf || ( + hasProto + ? function (x) { return x.__proto__; } // eslint-disable-line no-proto + : null +); + +var needsEval = {}; + +var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array); + +var INTRINSICS = { + '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, + '%Array%': Array, + '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, + '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined, + '%AsyncFromSyncIteratorPrototype%': undefined, + '%AsyncFunction%': needsEval, + '%AsyncGenerator%': needsEval, + '%AsyncGeneratorFunction%': needsEval, + '%AsyncIteratorPrototype%': needsEval, + '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, + '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, + '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array, + '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array, + '%Boolean%': Boolean, + '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, + '%Date%': Date, + '%decodeURI%': decodeURI, + '%decodeURIComponent%': decodeURIComponent, + '%encodeURI%': encodeURI, + '%encodeURIComponent%': encodeURIComponent, + '%Error%': Error, + '%eval%': eval, // eslint-disable-line no-eval + '%EvalError%': EvalError, + '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, + '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, + '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, + '%Function%': $Function, + '%GeneratorFunction%': needsEval, + '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, + '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, + '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, + '%isFinite%': isFinite, + '%isNaN%': isNaN, + '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined, + '%JSON%': typeof JSON === 'object' ? JSON : undefined, + '%Map%': typeof Map === 'undefined' ? undefined : Map, + '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()), + '%Math%': Math, + '%Number%': Number, + '%Object%': Object, + '%parseFloat%': parseFloat, + '%parseInt%': parseInt, + '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, + '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, + '%RangeError%': RangeError, + '%ReferenceError%': ReferenceError, + '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, + '%RegExp%': RegExp, + '%Set%': typeof Set === 'undefined' ? undefined : Set, + '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()), + '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, + '%String%': String, + '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined, + '%Symbol%': hasSymbols ? Symbol : undefined, + '%SyntaxError%': $SyntaxError, + '%ThrowTypeError%': ThrowTypeError, + '%TypedArray%': TypedArray, + '%TypeError%': $TypeError, + '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, + '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, + '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, + '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, + '%URIError%': URIError, + '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, + '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, + '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet +}; + +if (getProto) { + try { + null.error; // eslint-disable-line no-unused-expressions + } catch (e) { + // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229 + var errorProto = getProto(getProto(e)); + INTRINSICS['%Error.prototype%'] = errorProto; + } +} + +var doEval = function doEval(name) { + var value; + if (name === '%AsyncFunction%') { + value = getEvalledConstructor('async function () {}'); + } else if (name === '%GeneratorFunction%') { + value = getEvalledConstructor('function* () {}'); + } else if (name === '%AsyncGeneratorFunction%') { + value = getEvalledConstructor('async function* () {}'); + } else if (name === '%AsyncGenerator%') { + var fn = doEval('%AsyncGeneratorFunction%'); + if (fn) { + value = fn.prototype; + } + } else if (name === '%AsyncIteratorPrototype%') { + var gen = doEval('%AsyncGenerator%'); + if (gen && getProto) { + value = getProto(gen.prototype); + } + } + + INTRINSICS[name] = value; + + return value; +}; + +var LEGACY_ALIASES = { + '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], + '%ArrayPrototype%': ['Array', 'prototype'], + '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], + '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], + '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], + '%ArrayProto_values%': ['Array', 'prototype', 'values'], + '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], + '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], + '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], + '%BooleanPrototype%': ['Boolean', 'prototype'], + '%DataViewPrototype%': ['DataView', 'prototype'], + '%DatePrototype%': ['Date', 'prototype'], + '%ErrorPrototype%': ['Error', 'prototype'], + '%EvalErrorPrototype%': ['EvalError', 'prototype'], + '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], + '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], + '%FunctionPrototype%': ['Function', 'prototype'], + '%Generator%': ['GeneratorFunction', 'prototype'], + '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], + '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], + '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], + '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], + '%JSONParse%': ['JSON', 'parse'], + '%JSONStringify%': ['JSON', 'stringify'], + '%MapPrototype%': ['Map', 'prototype'], + '%NumberPrototype%': ['Number', 'prototype'], + '%ObjectPrototype%': ['Object', 'prototype'], + '%ObjProto_toString%': ['Object', 'prototype', 'toString'], + '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], + '%PromisePrototype%': ['Promise', 'prototype'], + '%PromiseProto_then%': ['Promise', 'prototype', 'then'], + '%Promise_all%': ['Promise', 'all'], + '%Promise_reject%': ['Promise', 'reject'], + '%Promise_resolve%': ['Promise', 'resolve'], + '%RangeErrorPrototype%': ['RangeError', 'prototype'], + '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], + '%RegExpPrototype%': ['RegExp', 'prototype'], + '%SetPrototype%': ['Set', 'prototype'], + '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], + '%StringPrototype%': ['String', 'prototype'], + '%SymbolPrototype%': ['Symbol', 'prototype'], + '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], + '%TypedArrayPrototype%': ['TypedArray', 'prototype'], + '%TypeErrorPrototype%': ['TypeError', 'prototype'], + '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], + '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], + '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], + '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], + '%URIErrorPrototype%': ['URIError', 'prototype'], + '%WeakMapPrototype%': ['WeakMap', 'prototype'], + '%WeakSetPrototype%': ['WeakSet', 'prototype'] +}; + +var bind = __webpack_require__(2698); +var hasOwn = __webpack_require__(2786); +var $concat = bind.call(Function.call, Array.prototype.concat); +var $spliceApply = bind.call(Function.apply, Array.prototype.splice); +var $replace = bind.call(Function.call, String.prototype.replace); +var $strSlice = bind.call(Function.call, String.prototype.slice); +var $exec = bind.call(Function.call, RegExp.prototype.exec); + +/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ +var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; +var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ +var stringToPath = function stringToPath(string) { + var first = $strSlice(string, 0, 1); + var last = $strSlice(string, -1); + if (first === '%' && last !== '%') { + throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); + } else if (last === '%' && first !== '%') { + throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); + } + var result = []; + $replace(string, rePropName, function (match, number, quote, subString) { + result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; + }); + return result; +}; +/* end adaptation */ + +var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { + var intrinsicName = name; + var alias; + if (hasOwn(LEGACY_ALIASES, intrinsicName)) { + alias = LEGACY_ALIASES[intrinsicName]; + intrinsicName = '%' + alias[0] + '%'; + } + + if (hasOwn(INTRINSICS, intrinsicName)) { + var value = INTRINSICS[intrinsicName]; + if (value === needsEval) { + value = doEval(intrinsicName); + } + if (typeof value === 'undefined' && !allowMissing) { + throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); + } + + return { + alias: alias, + name: intrinsicName, + value: value + }; + } + + throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); +}; + +module.exports = function GetIntrinsic(name, allowMissing) { + if (typeof name !== 'string' || name.length === 0) { + throw new $TypeError('intrinsic name must be a non-empty string'); + } + if (arguments.length > 1 && typeof allowMissing !== 'boolean') { + throw new $TypeError('"allowMissing" argument must be a boolean'); + } + + if ($exec(/^%?[^%]*%?$/, name) === null) { + throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name'); + } + var parts = stringToPath(name); + var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; + + var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); + var intrinsicRealName = intrinsic.name; + var value = intrinsic.value; + var skipFurtherCaching = false; + + var alias = intrinsic.alias; + if (alias) { + intrinsicBaseName = alias[0]; + $spliceApply(parts, $concat([0, 1], alias)); + } + + for (var i = 1, isOwn = true; i < parts.length; i += 1) { + var part = parts[i]; + var first = $strSlice(part, 0, 1); + var last = $strSlice(part, -1); + if ( + ( + (first === '"' || first === "'" || first === '`') + || (last === '"' || last === "'" || last === '`') + ) + && first !== last + ) { + throw new $SyntaxError('property names with quotes must have matching quotes'); + } + if (part === 'constructor' || !isOwn) { + skipFurtherCaching = true; + } + + intrinsicBaseName += '.' + part; + intrinsicRealName = '%' + intrinsicBaseName + '%'; + + if (hasOwn(INTRINSICS, intrinsicRealName)) { + value = INTRINSICS[intrinsicRealName]; + } else if (value != null) { + if (!(part in value)) { + if (!allowMissing) { + throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); + } + return void undefined; + } + if ($gOPD && (i + 1) >= parts.length) { + var desc = $gOPD(value, part); + isOwn = !!desc; + + // By convention, when a data property is converted to an accessor + // property to emulate a data property that does not suffer from + // the override mistake, that accessor's getter is marked with + // an `originalValue` property. Here, when we detect this, we + // uphold the illusion by pretending to see that original data + // property, i.e., returning the value rather than the getter + // itself. + if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { + value = desc.get; + } else { + value = value[part]; + } + } else { + isOwn = hasOwn(value, part); + value = value[part]; + } + + if (isOwn && !skipFurtherCaching) { + INTRINSICS[intrinsicRealName] = value; + } + } + } + return value; +}; + + +/***/ }), + +/***/ 8158: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(6653); + +var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); + +if ($gOPD) { + try { + $gOPD([], 'length'); + } catch (e) { + // IE 8 has a broken gOPD + $gOPD = null; + } +} + +module.exports = $gOPD; + + +/***/ }), + +/***/ 7877: +/***/ (function(module) { + +"use strict"; + + +var test = { + foo: {} +}; + +var $Object = Object; + +module.exports = function hasProto() { + return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object); +}; + + +/***/ }), + +/***/ 2770: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var origSymbol = typeof Symbol !== 'undefined' && Symbol; +var hasSymbolSham = __webpack_require__(9578); + +module.exports = function hasNativeSymbols() { + if (typeof origSymbol !== 'function') { return false; } + if (typeof Symbol !== 'function') { return false; } + if (typeof origSymbol('foo') !== 'symbol') { return false; } + if (typeof Symbol('bar') !== 'symbol') { return false; } + + return hasSymbolSham(); +}; + + +/***/ }), + +/***/ 9578: +/***/ (function(module) { + +"use strict"; + + +/* eslint complexity: [2, 18], max-statements: [2, 33] */ +module.exports = function hasSymbols() { + if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } + if (typeof Symbol.iterator === 'symbol') { return true; } + + var obj = {}; + var sym = Symbol('test'); + var symObj = Object(sym); + if (typeof sym === 'string') { return false; } + + if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } + if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } + + // temp disabled per https://github.com/ljharb/object.assign/issues/17 + // if (sym instanceof Symbol) { return false; } + // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 + // if (!(symObj instanceof Symbol)) { return false; } + + // if (typeof Symbol.prototype.toString !== 'function') { return false; } + // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } + + var symVal = 42; + obj[sym] = symVal; + for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop + if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } + + if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } + + var syms = Object.getOwnPropertySymbols(obj); + if (syms.length !== 1 || syms[0] !== sym) { return false; } + + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } + + if (typeof Object.getOwnPropertyDescriptor === 'function') { + var descriptor = Object.getOwnPropertyDescriptor(obj, sym); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } + } + + return true; +}; + + +/***/ }), + +/***/ 3342: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var hasSymbols = __webpack_require__(9578); + +module.exports = function hasToStringTagShams() { + return hasSymbols() && !!Symbol.toStringTag; +}; + + +/***/ }), + +/***/ 2786: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(2698); + +module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); + + +/***/ }), + +/***/ 7164: +/***/ (function(__unused_webpack_module, exports) { + +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ +exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var nBits = -7 + var i = isLE ? (nBytes - 1) : 0 + var d = isLE ? -1 : 1 + var s = buffer[offset + i] + + i += d + + e = s & ((1 << (-nBits)) - 1) + s >>= (-nBits) + nBits += eLen + for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1) + e >>= (-nBits) + nBits += mLen + for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity) + } else { + m = m + Math.pow(2, mLen) + e = e - eBias + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) +} + +exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) + var i = isLE ? 0 : (nBytes - 1) + var d = isLE ? 1 : -1 + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 + + value = Math.abs(value) + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0 + e = eMax + } else { + e = Math.floor(Math.log(value) / Math.LN2) + if (value * (c = Math.pow(2, -e)) < 1) { + e-- + c *= 2 + } + if (e + eBias >= 1) { + value += rt / c + } else { + value += rt * Math.pow(2, 1 - eBias) + } + if (value * c >= 2) { + e++ + c /= 2 + } + + if (e + eBias >= eMax) { + m = 0 + e = eMax + } else if (e + eBias >= 1) { + m = ((value * c) - 1) * Math.pow(2, mLen) + e = e + eBias + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) + e = 0 + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m + eLen += mLen + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128 +} + + +/***/ }), + +/***/ 7483: +/***/ (function(module) { + +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }) + } + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } + } +} + + +/***/ }), + +/***/ 9462: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var hasToStringTag = __webpack_require__(3342)(); +var callBound = __webpack_require__(2864); + +var $toString = callBound('Object.prototype.toString'); + +var isStandardArguments = function isArguments(value) { + if (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) { + return false; + } + return $toString(value) === '[object Arguments]'; +}; + +var isLegacyArguments = function isArguments(value) { + if (isStandardArguments(value)) { + return true; + } + return value !== null && + typeof value === 'object' && + typeof value.length === 'number' && + value.length >= 0 && + $toString(value) !== '[object Array]' && + $toString(value.callee) === '[object Function]'; +}; + +var supportsStandardArguments = (function () { + return isStandardArguments(arguments); +}()); + +isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests + +module.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments; + + +/***/ }), + +/***/ 9861: +/***/ (function(module) { + +"use strict"; + + +var fnToStr = Function.prototype.toString; +var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply; +var badArrayLike; +var isCallableMarker; +if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') { + try { + badArrayLike = Object.defineProperty({}, 'length', { + get: function () { + throw isCallableMarker; + } + }); + isCallableMarker = {}; + // eslint-disable-next-line no-throw-literal + reflectApply(function () { throw 42; }, null, badArrayLike); + } catch (_) { + if (_ !== isCallableMarker) { + reflectApply = null; + } + } +} else { + reflectApply = null; +} + +var constructorRegex = /^\s*class\b/; +var isES6ClassFn = function isES6ClassFunction(value) { + try { + var fnStr = fnToStr.call(value); + return constructorRegex.test(fnStr); + } catch (e) { + return false; // not a function + } +}; + +var tryFunctionObject = function tryFunctionToStr(value) { + try { + if (isES6ClassFn(value)) { return false; } + fnToStr.call(value); + return true; + } catch (e) { + return false; + } +}; +var toStr = Object.prototype.toString; +var objectClass = '[object Object]'; +var fnClass = '[object Function]'; +var genClass = '[object GeneratorFunction]'; +var ddaClass = '[object HTMLAllCollection]'; // IE 11 +var ddaClass2 = '[object HTML document.all class]'; +var ddaClass3 = '[object HTMLCollection]'; // IE 9-10 +var hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag` + +var isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing + +var isDDA = function isDocumentDotAll() { return false; }; +if (typeof document === 'object') { + // Firefox 3 canonicalizes DDA to undefined when it's not accessed directly + var all = document.all; + if (toStr.call(all) === toStr.call(document.all)) { + isDDA = function isDocumentDotAll(value) { + /* globals document: false */ + // in IE 6-8, typeof document.all is "object" and it's truthy + if ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) { + try { + var str = toStr.call(value); + return ( + str === ddaClass + || str === ddaClass2 + || str === ddaClass3 // opera 12.16 + || str === objectClass // IE 6-8 + ) && value('') == null; // eslint-disable-line eqeqeq + } catch (e) { /**/ } + } + return false; + }; + } +} + +module.exports = reflectApply + ? function isCallable(value) { + if (isDDA(value)) { return true; } + if (!value) { return false; } + if (typeof value !== 'function' && typeof value !== 'object') { return false; } + try { + reflectApply(value, null, badArrayLike); + } catch (e) { + if (e !== isCallableMarker) { return false; } + } + return !isES6ClassFn(value) && tryFunctionObject(value); + } + : function isCallable(value) { + if (isDDA(value)) { return true; } + if (!value) { return false; } + if (typeof value !== 'function' && typeof value !== 'object') { return false; } + if (hasToStringTag) { return tryFunctionObject(value); } + if (isES6ClassFn(value)) { return false; } + var strClass = toStr.call(value); + if (strClass !== fnClass && strClass !== genClass && !(/^\[object HTML/).test(strClass)) { return false; } + return tryFunctionObject(value); + }; + + +/***/ }), + +/***/ 7136: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var toStr = Object.prototype.toString; +var fnToStr = Function.prototype.toString; +var isFnRegex = /^\s*(?:function)?\*/; +var hasToStringTag = __webpack_require__(3342)(); +var getProto = Object.getPrototypeOf; +var getGeneratorFunc = function () { // eslint-disable-line consistent-return + if (!hasToStringTag) { + return false; + } + try { + return Function('return function*() {}')(); + } catch (e) { + } +}; +var GeneratorFunction; + +module.exports = function isGeneratorFunction(fn) { + if (typeof fn !== 'function') { + return false; + } + if (isFnRegex.test(fnToStr.call(fn))) { + return true; + } + if (!hasToStringTag) { + var str = toStr.call(fn); + return str === '[object GeneratorFunction]'; + } + if (!getProto) { + return false; + } + if (typeof GeneratorFunction === 'undefined') { + var generatorFunc = getGeneratorFunc(); + GeneratorFunction = generatorFunc ? getProto(generatorFunc) : false; + } + return getProto(fn) === GeneratorFunction; +}; + + +/***/ }), + +/***/ 1407: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var forEach = __webpack_require__(98); +var availableTypedArrays = __webpack_require__(3719); +var callBound = __webpack_require__(2864); + +var $toString = callBound('Object.prototype.toString'); +var hasToStringTag = __webpack_require__(3342)(); +var gOPD = __webpack_require__(8158); + +var g = typeof globalThis === 'undefined' ? __webpack_require__.g : globalThis; +var typedArrays = availableTypedArrays(); + +var $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) { + for (var i = 0; i < array.length; i += 1) { + if (array[i] === value) { + return i; + } + } + return -1; +}; +var $slice = callBound('String.prototype.slice'); +var toStrTags = {}; +var getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof'); +if (hasToStringTag && gOPD && getPrototypeOf) { + forEach(typedArrays, function (typedArray) { + var arr = new g[typedArray](); + if (Symbol.toStringTag in arr) { + var proto = getPrototypeOf(arr); + var descriptor = gOPD(proto, Symbol.toStringTag); + if (!descriptor) { + var superProto = getPrototypeOf(proto); + descriptor = gOPD(superProto, Symbol.toStringTag); + } + toStrTags[typedArray] = descriptor.get; + } + }); +} + +var tryTypedArrays = function tryAllTypedArrays(value) { + var anyTrue = false; + forEach(toStrTags, function (getter, typedArray) { + if (!anyTrue) { + try { + anyTrue = getter.call(value) === typedArray; + } catch (e) { /**/ } + } + }); + return anyTrue; +}; + +module.exports = function isTypedArray(value) { + if (!value || typeof value !== 'object') { return false; } + if (!hasToStringTag || !(Symbol.toStringTag in value)) { + var tag = $slice($toString(value), 8, -1); + return $indexOf(typedArrays, tag) > -1; + } + if (!gOPD) { return false; } + return tryTypedArrays(value); +}; + + +/***/ }), + +/***/ 8448: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + +var _global_process, _global_process1; +module.exports = ((_global_process = __webpack_require__.g.process) == null ? void 0 : _global_process.env) && typeof ((_global_process1 = __webpack_require__.g.process) == null ? void 0 : _global_process1.env) === "object" ? __webpack_require__.g.process : __webpack_require__(1580); + +//# sourceMappingURL=process.js.map + +/***/ }), + +/***/ 1580: +/***/ (function(module) { + +var __dirname = "/"; +(function(){var e={229:function(e){var t=e.exports={};var r;var n;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){r=setTimeout}else{r=defaultSetTimout}}catch(e){r=defaultSetTimout}try{if(typeof clearTimeout==="function"){n=clearTimeout}else{n=defaultClearTimeout}}catch(e){n=defaultClearTimeout}})();function runTimeout(e){if(r===setTimeout){return setTimeout(e,0)}if((r===defaultSetTimout||!r)&&setTimeout){r=setTimeout;return 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 runClearTimeout(e){if(n===clearTimeout){return clearTimeout(e)}if((n===defaultClearTimeout||!n)&&clearTimeout){n=clearTimeout;return clearTimeout(e)}try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}var i=[];var o=false;var u;var a=-1;function cleanUpNextTick(){if(!o||!u){return}o=false;if(u.length){i=u.concat(i)}else{a=-1}if(i.length){drainQueue()}}function drainQueue(){if(o){return}var e=runTimeout(cleanUpNextTick);o=true;var t=i.length;while(t){u=i;i=[];while(++a1){for(var r=1;rString(e)));if(r>2){return`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]}else if(r===2){return`one of ${t} ${e[0]} or ${e[1]}`}else{return`of ${t} ${e[0]}`}}else{return`of ${t} ${String(e)}`}}function startsWith(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function endsWith(e,t,r){if(r===undefined||r>e.length){r=e.length}return e.substring(r-t.length,r)===t}function includes(e,t,r){if(typeof r!=="number"){r=0}if(r+t.length>e.length){return false}else{return e.indexOf(t,r)!==-1}}createErrorType("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError);createErrorType("ERR_INVALID_ARG_TYPE",(function(e,t,r){let n;if(typeof t==="string"&&startsWith(t,"not ")){n="must not be";t=t.replace(/^not /,"")}else{n="must be"}let i;if(endsWith(e," argument")){i=`The ${e} ${n} ${oneOf(t,"type")}`}else{const r=includes(e,".")?"property":"argument";i=`The "${e}" ${r} ${n} ${oneOf(t,"type")}`}i+=`. Received type ${typeof r}`;return i}),TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"}));createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"}));createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");e.exports.q=t},403:function(e,t,r){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e){t.push(r)}return t};e.exports=Duplex;var i=r(709);var a=r(337);r(782)(Duplex,i);{var o=n(a.prototype);for(var s=0;s0){if(typeof t!=="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==s.prototype){t=_uint8ArrayToBuffer(t)}if(n){if(a.endEmitted)R(e,new v);else addChunk(e,a,t,true)}else if(a.ended){R(e,new y)}else if(a.destroyed){return false}else{a.reading=false;if(a.decoder&&!r){t=a.decoder.write(t);if(a.objectMode||t.length!==0)addChunk(e,a,t,false);else maybeReadMore(e,a)}else{addChunk(e,a,t,false)}}}else if(!n){a.reading=false;maybeReadMore(e,a)}}return!a.ended&&(a.length=T){e=T}else{e--;e|=e>>>1;e|=e>>>2;e|=e>>>4;e|=e>>>8;e|=e>>>16;e++}return e}function howMuchToRead(e,t){if(e<=0||t.length===0&&t.ended)return 0;if(t.objectMode)return 1;if(e!==e){if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length}if(e>t.highWaterMark)t.highWaterMark=computeNewHighWaterMark(e);if(e<=t.length)return e;if(!t.ended){t.needReadable=true;return 0}return t.length}Readable.prototype.read=function(e){u("read",e);e=parseInt(e,10);var t=this._readableState;var r=e;if(e!==0)t.emittedReadable=false;if(e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)endReadable(this);else emitReadable(this);return null}e=howMuchToRead(e,t);if(e===0&&t.ended){if(t.length===0)endReadable(this);return null}var n=t.needReadable;u("need readable",n);if(t.length===0||t.length-e0)i=fromList(e,t);else i=null;if(i===null){t.needReadable=t.length<=t.highWaterMark;e=0}else{t.length-=e;t.awaitDrain=0}if(t.length===0){if(!t.ended)t.needReadable=true;if(r!==e&&t.ended)endReadable(this)}if(i!==null)this.emit("data",i);return i};function onEofChunk(e,t){u("onEofChunk");if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;if(t.sync){emitReadable(e)}else{t.needReadable=false;if(!t.emittedReadable){t.emittedReadable=true;emitReadable_(e)}}}function emitReadable(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable);t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;process.nextTick(emitReadable_,e)}}function emitReadable_(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended);if(!t.destroyed&&(t.length||t.ended)){e.emit("readable");t.emittedReadable=false}t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark;flow(e)}function maybeReadMore(e,t){if(!t.readingMore){t.readingMore=true;process.nextTick(maybeReadMore_,e,t)}}function maybeReadMore_(e,t){while(!t.reading&&!t.ended&&(t.length1&&indexOf(n.pipes,e)!==-1)&&!f){u("false write response, pause",n.awaitDrain);n.awaitDrain++}r.pause()}}function onerror(t){u("onerror",t);unpipe();e.removeListener("error",onerror);if(a(e,"error")===0)R(e,t)}prependListener(e,"error",onerror);function onclose(){e.removeListener("finish",onfinish);unpipe()}e.once("close",onclose);function onfinish(){u("onfinish");e.removeListener("close",onclose);unpipe()}e.once("finish",onfinish);function unpipe(){u("unpipe");r.unpipe(e)}e.emit("pipe",r);if(!n.flowing){u("pipe resume");r.resume()}return e};function pipeOnDrain(e){return function pipeOnDrainFunctionResult(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain);if(t.awaitDrain)t.awaitDrain--;if(t.awaitDrain===0&&a(e,"data")){t.flowing=true;flow(e)}}}Readable.prototype.unpipe=function(e){var t=this._readableState;var r={hasUnpiped:false};if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;t.pipes=null;t.pipesCount=0;t.flowing=false;if(e)e.emit("unpipe",this,r);return this}if(!e){var n=t.pipes;var i=t.pipesCount;t.pipes=null;t.pipesCount=0;t.flowing=false;for(var a=0;a0;if(n.flowing!==false)this.resume()}else if(e==="readable"){if(!n.endEmitted&&!n.readableListening){n.readableListening=n.needReadable=true;n.flowing=false;n.emittedReadable=false;u("on readable",n.length,n.reading);if(n.length){emitReadable(this)}else if(!n.reading){process.nextTick(nReadingNextTick,this)}}}return r};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);if(e==="readable"){process.nextTick(updateReadableListening,this)}return r};Readable.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);if(e==="readable"||e===undefined){process.nextTick(updateReadableListening,this)}return t};function updateReadableListening(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0;if(t.resumeScheduled&&!t.paused){t.flowing=true}else if(e.listenerCount("data")>0){e.resume()}}function nReadingNextTick(e){u("readable nexttick read 0");e.read(0)}Readable.prototype.resume=function(){var e=this._readableState;if(!e.flowing){u("resume");e.flowing=!e.readableListening;resume(this,e)}e.paused=false;return this};function resume(e,t){if(!t.resumeScheduled){t.resumeScheduled=true;process.nextTick(resume_,e,t)}}function resume_(e,t){u("resume",t.reading);if(!t.reading){e.read(0)}t.resumeScheduled=false;e.emit("resume");flow(e);if(t.flowing&&!t.reading)e.read(0)}Readable.prototype.pause=function(){u("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){u("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function flow(e){var t=e._readableState;u("flow",t.flowing);while(t.flowing&&e.read()!==null){}}Readable.prototype.wrap=function(e){var t=this;var r=this._readableState;var n=false;e.on("end",(function(){u("wrapped end");if(r.decoder&&!r.ended){var e=r.decoder.end();if(e&&e.length)t.push(e)}t.push(null)}));e.on("data",(function(i){u("wrapped data");if(r.decoder)i=r.decoder.write(i);if(r.objectMode&&(i===null||i===undefined))return;else if(!r.objectMode&&(!i||!i.length))return;var a=t.push(i);if(!a){n=true;e.pause()}}));for(var i in e){if(this[i]===undefined&&typeof e[i]==="function"){this[i]=function methodWrap(t){return function methodWrapReturnFunction(){return e[t].apply(e,arguments)}}(i)}}for(var a=0;a=t.length){if(t.decoder)r=t.buffer.join("");else if(t.buffer.length===1)r=t.buffer.first();else r=t.buffer.concat(t.length);t.buffer.clear()}else{r=t.buffer.consume(e,t.decoder)}return r}function endReadable(e){var t=e._readableState;u("endReadable",t.endEmitted);if(!t.endEmitted){t.ended=true;process.nextTick(endReadableNT,t,e)}}function endReadableNT(e,t){u("endReadableNT",e.endEmitted,e.length);if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end");if(e.autoDestroy){var r=t._writableState;if(!r||r.autoDestroy&&r.finished){t.destroy()}}}}if(typeof Symbol==="function"){Readable.from=function(e,t){if(S===undefined){S=r(727)}return S(Readable,e,t)}}function indexOf(e,t){for(var r=0,n=e.length;r-1))throw new v(e);this._writableState.defaultEncoding=e;return this};Object.defineProperty(Writable.prototype,"writableBuffer",{enumerable:false,get:function get(){return this._writableState&&this._writableState.getBuffer()}});function decodeChunk(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=o.from(t,r)}return t}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function get(){return this._writableState.highWaterMark}});function writeOrBuffer(e,t,r,n,i,a){if(!r){var o=decodeChunk(t,n,i);if(n!==o){r=true;i="buffer";n=o}}var s=t.objectMode?1:n.length;t.length+=s;var f=t.length0)this.tail.next=t;else this.head=t;this.tail=t;++this.length}},{key:"unshift",value:function unshift(e){var t={data:e,next:this.head};if(this.length===0)this.tail=t;this.head=t;++this.length}},{key:"shift",value:function shift(){if(this.length===0)return;var e=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return e}},{key:"clear",value:function clear(){this.head=this.tail=null;this.length=0}},{key:"join",value:function join(e){if(this.length===0)return"";var t=this.head;var r=""+t.data;while(t=t.next){r+=e+t.data}return r}},{key:"concat",value:function concat(e){if(this.length===0)return i.alloc(0);var t=i.allocUnsafe(e>>>0);var r=this.head;var n=0;while(r){copyBuffer(r.data,t,n);n+=r.data.length;r=r.next}return t}},{key:"consume",value:function consume(e,t){var r;if(ei.length?i.length:e;if(a===i.length)n+=i;else n+=i.slice(0,e);e-=a;if(e===0){if(a===i.length){++r;if(t.next)this.head=t.next;else this.head=this.tail=null}else{this.head=t;t.data=i.slice(a)}break}++r}this.length-=r;return n}},{key:"_getBuffer",value:function _getBuffer(e){var t=i.allocUnsafe(e);var r=this.head;var n=1;r.data.copy(t);e-=r.data.length;while(r=r.next){var a=r.data;var o=e>a.length?a.length:e;a.copy(t,t.length-e,0,o);e-=o;if(e===0){if(o===a.length){++n;if(r.next)this.head=r.next;else this.head=this.tail=null}else{this.head=r;r.data=a.slice(o)}break}++n}this.length-=n;return t}},{key:s,value:function value(e,t){return o(this,_objectSpread({},t,{depth:0,customInspect:false}))}}]);return BufferList}()},25:function(e){"use strict";function destroy(e,t){var r=this;var n=this._readableState&&this._readableState.destroyed;var i=this._writableState&&this._writableState.destroyed;if(n||i){if(t){t(e)}else if(e){if(!this._writableState){process.nextTick(emitErrorNT,this,e)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;process.nextTick(emitErrorNT,this,e)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(e||null,(function(e){if(!t&&e){if(!r._writableState){process.nextTick(emitErrorAndCloseNT,r,e)}else if(!r._writableState.errorEmitted){r._writableState.errorEmitted=true;process.nextTick(emitErrorAndCloseNT,r,e)}else{process.nextTick(emitCloseNT,r)}}else if(t){process.nextTick(emitCloseNT,r);t(e)}else{process.nextTick(emitCloseNT,r)}}));return this}function emitErrorAndCloseNT(e,t){emitErrorNT(e,t);emitCloseNT(e)}function emitCloseNT(e){if(e._writableState&&!e._writableState.emitClose)return;if(e._readableState&&!e._readableState.emitClose)return;e.emit("close")}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(e,t){e.emit("error",t)}function errorOrDestroy(e,t){var r=e._readableState;var n=e._writableState;if(r&&r.autoDestroy||n&&n.autoDestroy)e.destroy(t);else e.emit("error",t)}e.exports={destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy}},698:function(e,t,r){"use strict";var n=r(646).q.ERR_STREAM_PREMATURE_CLOSE;function once(e){var t=false;return function(){if(t)return;t=true;for(var r=arguments.length,n=new Array(r),i=0;i0;return destroyer(e,a,s,(function(e){if(!i)i=e;if(e)o.forEach(call);if(a)return;o.forEach(call);n(i)}))}));return t.reduce(pipe)}e.exports=pipeline},776:function(e,t,r){"use strict";var n=r(646).q.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function getHighWaterMark(e,t,r,i){var a=highWaterMarkFrom(t,i,r);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var o=i?r:"highWaterMark";throw new n(o,a)}return Math.floor(a)}return e.objectMode?16:16*1024}e.exports={getHighWaterMark:getHighWaterMark}},678:function(e,t,r){e.exports=r(781)},55:function(e,t,r){var n=r(300);var i=n.Buffer;function copyProps(e,t){for(var r in e){t[r]=e[r]}}if(i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow){e.exports=n}else{copyProps(n,t);t.Buffer=SafeBuffer}function SafeBuffer(e,t,r){return i(e,t,r)}SafeBuffer.prototype=Object.create(i.prototype);copyProps(i,SafeBuffer);SafeBuffer.from=function(e,t,r){if(typeof e==="number"){throw new TypeError("Argument must not be a number")}return i(e,t,r)};SafeBuffer.alloc=function(e,t,r){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}var n=i(e);if(t!==undefined){if(typeof r==="string"){n.fill(t,r)}else{n.fill(t)}}else{n.fill(0)}return n};SafeBuffer.allocUnsafe=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return i(e)};SafeBuffer.allocUnsafeSlow=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return n.SlowBuffer(e)}},173:function(e,t,r){e.exports=Stream;var n=r(361).EventEmitter;var i=r(782);i(Stream,n);Stream.Readable=r(709);Stream.Writable=r(337);Stream.Duplex=r(403);Stream.Transform=r(170);Stream.PassThrough=r(889);Stream.finished=r(698);Stream.pipeline=r(442);Stream.Stream=Stream;function Stream(){n.call(this)}Stream.prototype.pipe=function(e,t){var r=this;function ondata(t){if(e.writable){if(false===e.write(t)&&r.pause){r.pause()}}}r.on("data",ondata);function ondrain(){if(r.readable&&r.resume){r.resume()}}e.on("drain",ondrain);if(!e._isStdio&&(!t||t.end!==false)){r.on("end",onend);r.on("close",onclose)}var i=false;function onend(){if(i)return;i=true;e.end()}function onclose(){if(i)return;i=true;if(typeof e.destroy==="function")e.destroy()}function onerror(e){cleanup();if(n.listenerCount(this,"error")===0){throw e}}r.on("error",onerror);e.on("error",onerror);function cleanup(){r.removeListener("data",ondata);e.removeListener("drain",ondrain);r.removeListener("end",onend);r.removeListener("close",onclose);r.removeListener("error",onerror);e.removeListener("error",onerror);r.removeListener("end",cleanup);r.removeListener("close",cleanup);e.removeListener("close",cleanup)}r.on("end",cleanup);r.on("close",cleanup);e.on("close",cleanup);e.emit("pipe",r);return e}},704:function(e,t,r){"use strict";var n=r(55).Buffer;var i=n.isEncoding||function(e){e=""+e;switch(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 true;default:return false}};function _normalizeEncoding(e){if(!e)return"utf8";var t;while(true){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=true}}}function normalizeEncoding(e){var t=_normalizeEncoding(e);if(typeof t!=="string"&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}t.s=StringDecoder;function StringDecoder(e){this.encoding=normalizeEncoding(e);var t;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;t=4;break;case"utf8":this.fillLast=utf8FillLast;t=4;break;case"base64":this.text=base64Text;this.end=base64End;t=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=n.allocUnsafe(t)}StringDecoder.prototype.write=function(e){if(e.length===0)return"";var t;var r;if(this.lastNeed){t=this.fillLast(e);if(t===undefined)return"";r=this.lastNeed;this.lastNeed=0}else{r=0}if(r>5===6)return 2;else if(e>>4===14)return 3;else if(e>>3===30)return 4;return e>>6===2?-1:-2}function utf8CheckIncomplete(e,t,r){var n=t.length-1;if(n=0){if(i>0)e.lastNeed=i-1;return i}if(--n=0){if(i>0)e.lastNeed=i-2;return i}if(--n=0){if(i>0){if(i===2)i=0;else e.lastNeed=i-3}return i}return 0}function utf8CheckExtraBytes(e,t,r){if((t[0]&192)!==128){e.lastNeed=0;return"�"}if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128){e.lastNeed=1;return"�"}if(e.lastNeed>2&&t.length>2){if((t[2]&192)!==128){e.lastNeed=2;return"�"}}}}function utf8FillLast(e){var t=this.lastTotal-this.lastNeed;var r=utf8CheckExtraBytes(this,e,t);if(r!==undefined)return r;if(this.lastNeed<=e.length){e.copy(this.lastChar,t,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}e.copy(this.lastChar,t,0,e.length);this.lastNeed-=e.length}function utf8Text(e,t){var r=utf8CheckIncomplete(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);e.copy(this.lastChar,0,n);return e.toString("utf8",t,n)}function utf8End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+"�";return t}function utf16Text(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){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1];return r.slice(0,-1)}}return r}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=e[e.length-1];return e.toString("utf16le",t,e.length-1)}function utf16End(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 base64Text(e,t){var r=(e.length-t)%3;if(r===0)return e.toString("base64",t);this.lastNeed=3-r;this.lastTotal=3;if(r===1){this.lastChar[0]=e[e.length-1]}else{this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1]}return e.toString("base64",t,e.length-r)}function base64End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+this.lastChar.toString("base64",0,3-this.lastNeed);return t}function simpleWrite(e){return e.toString(this.encoding)}function simpleEnd(e){return e&&e.length?this.write(e):""}},769:function(e){e.exports=deprecate;function deprecate(e,t){if(config("noDeprecation")){return e}var r=false;function deprecated(){if(!r){if(config("throwDeprecation")){throw new Error(t)}else if(config("traceDeprecation")){console.trace(t)}else{console.warn(t)}r=true}return e.apply(this,arguments)}return deprecated}function config(e){try{if(!__webpack_require__.g.localStorage)return false}catch(e){return false}var t=__webpack_require__.g.localStorage[e];if(null==t)return false;return String(t).toLowerCase()==="true"}},300:function(e){"use strict";e.exports=__webpack_require__(7861)},361:function(e){"use strict";e.exports=__webpack_require__(7324)},781:function(e){"use strict";e.exports=(__webpack_require__(7324).EventEmitter)},837:function(e){"use strict";e.exports=__webpack_require__(911)}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var i=t[r]={exports:{}};var a=true;try{e[r](i,i.exports,__nccwpck_require__);a=false}finally{if(a)delete t[r]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(173);module.exports=r})(); + +/***/ }), + +/***/ 1973: +/***/ (function(module) { + +var __dirname = "/"; +(function(){var __webpack_modules__={950:function(__unused_webpack_module,exports){var indexOf=function(e,t){if(e.indexOf)return e.indexOf(t);else for(var r=0;r"checkbox"===e.type,s=e=>e instanceof Date,a=e=>null==e;const n=e=>"object"==typeof e;var i=e=>!a(e)&&!Array.isArray(e)&&n(e)&&!s(e),o=e=>i(e)&&e.target?r(e.target)?e.target.checked:e.target.value:e,u=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),l=e=>Array.isArray(e)?e.filter(Boolean):[],c=e=>void 0===e,d=(e,t,r)=>{if(!t||!i(e))return r;const s=l(t.split(/[,[\].]+?/)).reduce((e,t)=>a(e)?e:e[t],e);return c(s)||s===e?c(e[t])?r:e[t]:s};const f="blur",m="focusout",y="change",g="onBlur",h="onChange",p="onSubmit",_="onTouched",v="all",b="max",x="min",A="maxLength",F="minLength",V="pattern",S="required",w="validate",k=t.default.createContext(null),D=()=>t.default.useContext(k);var C=(e,t,r,s=!0)=>{const a={};for(const n in e)Object.defineProperty(a,n,{get:()=>{const a=n;return t[a]!==v&&(t[a]=!s||v),r&&(r[a]=!0),e[a]}});return a},j=e=>i(e)&&!Object.keys(e).length,E=(e,t,r)=>{const{name:s,...a}=e;return j(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(e=>t[e]===(!r||v))},O=e=>Array.isArray(e)?e:[e],U=(e,t,r)=>r&&t?e===t:!e||!t||e===t||O(e).some(e=>e&&(e.startsWith(t)||t.startsWith(e)));function B(e){const r=t.default.useRef(e);r.current=e,t.default.useEffect(()=>{const t=!e.disabled&&r.current.subject.subscribe({next:r.current.callback});return()=>(e=>{e&&e.unsubscribe()})(t)},[e.disabled])}function T(e){const r=D(),{control:s=r.control,disabled:a,name:n,exact:i}=e||{},[o,u]=t.default.useState(s._formState),l=t.default.useRef({isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),c=t.default.useRef(n),d=t.default.useRef(!0);c.current=n;return B({disabled:a,callback:t.default.useCallback(e=>d.current&&U(c.current,e.name,i)&&E(e,l.current)&&u({...s._formState,...e}),[s,i]),subject:s._subjects.state}),t.default.useEffect(()=>(d.current=!0,()=>{d.current=!1}),[]),C(o,s._proxyFormState,l.current,!1)}var M=e=>"string"==typeof e,N=(e,t,r,s)=>{const a=Array.isArray(e);return M(e)?(s&&t.watch.add(e),d(r,e)):a?e.map(e=>(s&&t.watch.add(e),d(r,e))):(s&&(t.watchAll=!0),r)},L=e=>"function"==typeof e,R=e=>{for(const t in e)if(L(e[t]))return!0;return!1};function q(e){const r=D(),{control:s=r.control,name:a,defaultValue:n,disabled:o,exact:u}=e||{},l=t.default.useRef(a);l.current=a;const d=t.default.useCallback(e=>{if(U(l.current,e.name,u)){const t=N(l.current,s._names,e.values||s._formValues);m(c(l.current)||i(t)&&!R(t)?{...t}:Array.isArray(t)?[...t]:c(t)?n:t)}},[s,u,n]);B({disabled:o,subject:s._subjects.watch,callback:d});const[f,m]=t.default.useState(c(n)?s._getWatch(a):n);return t.default.useEffect(()=>{s._removeUnmounted()}),f}function W(e){const r=D(),{name:s,control:a=r.control,shouldUnregister:n}=e,i=u(a._names.array,s),l=q({control:a,name:s,defaultValue:d(a._formValues,s,d(a._defaultValues,s,e.defaultValue)),exact:!0}),c=T({control:a,name:s}),m=t.default.useRef(a.register(s,{...e.rules,value:l}));return t.default.useEffect(()=>{const e=(e,t)=>{const r=d(a._fields,e);r&&(r._f.mount=t)};return e(s,!0),()=>{const t=a._options.shouldUnregister||n;(i?t&&!a._stateFlags.action:t)?a.unregister(s):e(s,!1)}},[s,a,i,n]),{field:{name:s,value:l,onChange:t.default.useCallback(e=>{m.current.onChange({target:{value:o(e),name:s},type:y})},[s]),onBlur:t.default.useCallback(()=>{m.current.onBlur({target:{value:d(a._formValues,s),name:s},type:f})},[s,a]),ref:t.default.useCallback(e=>{const t=d(a._fields,s);e&&t&&e.focus&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})},[s,a._fields])},formState:c,fieldState:Object.defineProperties({},{invalid:{get:()=>!!d(c.errors,s)},isDirty:{get:()=>!!d(c.dirtyFields,s)},isTouched:{get:()=>!!d(c.touchedFields,s)},error:{get:()=>d(c.errors,s)}})}}var P=(e,t,r,s,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[s]:a||!0}}:{},$=e=>/^\w*$/.test(e),I=e=>l(e.replace(/["|']|\]/g,"").split(/\.|\[/));function H(e,t,r){let s=-1;const a=$(t)?[t]:I(t),n=a.length,o=n-1;for(;++s{for(const s of r||Object.keys(e)){const r=d(e,s);if(r){const{_f:e,...s}=r;if(e&&t(e.name)){if(e.ref.focus&&c(e.ref.focus()))break;if(e.refs){e.refs[0].focus();break}}else i(s)&&z(s,t)}}};var G=()=>{const e="undefined"==typeof performance?Date.now():1e3*performance.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=(16*Math.random()+e)%16|0;return("x"==t?r:3&r|8).toString(16)})},J=(e,t,r={})=>r.shouldFocus||c(r.shouldFocus)?r.focusName||`${e}.${c(r.focusIndex)?t:r.focusIndex}.`:"",K=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length)))),Q=(e,t,r)=>{const s=l(d(e,r));return H(s,"root",t[r]),H(e,r,s),e},X=e=>"boolean"==typeof e,Y=e=>"file"===e.type,Z=e=>M(e)||t.default.isValidElement(e),ee=e=>"radio"===e.type,te=e=>e instanceof RegExp;const re={value:!1,isValid:!1},se={value:!0,isValid:!0};var ae=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!c(e[0].attributes.value)?c(e[0].value)||""===e[0].value?se:{value:e[0].value,isValid:!0}:se:re}return re};const ne={isValid:!1,value:null};var ie=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,ne):ne;function oe(e,t,r="validate"){if(Z(e)||Array.isArray(e)&&e.every(Z)||X(e)&&!e)return{type:r,message:Z(e)?e:"",ref:t}}var ue=e=>i(e)&&!te(e)?e:{value:e,message:""},le=async(e,t,s,n,o)=>{const{ref:u,refs:l,required:c,maxLength:d,minLength:f,min:m,max:y,pattern:g,validate:h,name:p,valueAsNumber:_,mount:v,disabled:k}=e._f;if(!v||k)return{};const D=l?l[0]:u,C=e=>{n&&D.reportValidity&&(D.setCustomValidity(X(e)?"":e||" "),D.reportValidity())},E={},O=ee(u),U=r(u),B=O||U,T=(_||Y(u))&&!u.value||""===t||Array.isArray(t)&&!t.length,N=P.bind(null,p,s,E),R=(e,t,r,s=A,a=F)=>{const n=e?t:r;E[p]={type:e?s:a,message:n,ref:u,...N(e?s:a,n)}};if(o?!Array.isArray(t)||!t.length:c&&(!B&&(T||a(t))||X(t)&&!t||U&&!ae(l).isValid||O&&!ie(l).isValid)){const{value:e,message:t}=Z(c)?{value:!!c,message:c}:ue(c);if(e&&(E[p]={type:S,message:t,ref:D,...N(S,t)},!s))return C(t),E}if(!(T||a(m)&&a(y))){let e,r;const n=ue(y),i=ue(m);if(a(t)||isNaN(t)){const s=u.valueAsDate||new Date(t);M(n.value)&&(e=s>new Date(n.value)),M(i.value)&&(r=sn.value),a(i.value)||(r=se.value,i=!a(r.value)&&t.lengthArray.isArray(e)?e.map(()=>{}):void 0,ye=e=>({isOnSubmit:!e||e===p,isOnBlur:e===g,isOnChange:e===h,isOnAll:e===v,isOnTouch:e===_});function ge(e,t,r){return[...e.slice(0,t),...O(r),...e.slice(t)]}var he=(e,t,r)=>Array.isArray(e)?(c(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[];function pe(e,t){return[...O(t),...O(e)]}var _e=(e,t)=>c(t)?[]:function(e,t){let r=0;const s=[...e];for(const e of t)s.splice(e-r,1),r++;return l(s).length?s:[]}(e,O(t).sort((e,t)=>e-t)),ve=(e,t,r)=>{e[t]=[e[r],e[r]=e[t]][0]};function be(e){for(const t in e)if(!c(e[t]))return!1;return!0}function xe(e,t){const r=$(t)?[t]:I(t),s=1==r.length?e:function(e,t){const r=t.slice(0,-1).length;let s=0;for(;s0&&(n=e);++a(e[t]=r,e);function Fe(){let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}}var Ve=e=>a(e)||!n(e);function Se(e,t){if(Ve(e)||Ve(t))return e===t;if(s(e)&&s(t))return e.getTime()===t.getTime();const r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(const n of r){const r=e[n];if(!a.includes(n))return!1;if("ref"!==n){const e=t[n];if(s(r)&&s(e)||i(r)&&i(e)||Array.isArray(r)&&Array.isArray(e)?!Se(r,e):r!==e)return!1}}return!0}var we=e=>{const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ke=e=>"select-multiple"===e.type,De=e=>we(e)&&e.isConnected;function Ce(e,t={}){const r=Array.isArray(e);if(i(e)||r)for(const r in e)Array.isArray(e[r])||i(e[r])&&!R(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Ce(e[r],t[r])):a(e[r])||(t[r]=!0);return t}var je=(e,t)=>function e(t,r,s){const n=Array.isArray(t);if(i(t)||n)for(const n in t)Array.isArray(t[n])||i(t[n])&&!R(t[n])?c(r)||Ve(s[n])?s[n]=Array.isArray(t[n])?Ce(t[n],[]):{...Ce(t[n])}:e(t[n],a(r)?{}:r[n],s[n]):s[n]=!Se(t[n],r[n]);return s}(e,t,Ce(t)),Ee=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:s})=>c(e)?e:t?""===e||a(e)?NaN:+e:r&&M(e)?new Date(e):s?s(e):e;function Oe(e){const t=e.ref;if(!(e.refs?e.refs.every(e=>e.disabled):t.disabled))return Y(t)?t.files:ee(t)?ie(e.refs).value:ke(t)?[...t.selectedOptions].map(({value:e})=>e):r(t)?ae(e.refs).value:Ee(c(t.value)?e.ref.value:t.value,e)}var Ue=e=>c(e)?void 0:te(e)?e.source:i(e)?te(e.value)?e.value.source:e.value:e;function Be(e,t,r){const s=d(e,r);if(s||$(r))return{error:s,name:r};const a=r.split(".");for(;a.length;){const s=a.join("."),n=d(t,s),i=d(e,s);if(n&&!Array.isArray(n)&&r!==s)return{name:r};if(i&&i.type)return{name:s,error:i};a.pop()}return{name:r}}const Te={mode:p,reValidateMode:h,shouldFocusError:!0};function Me(e={}){let t,n={...Te,...e},i={isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touchedFields:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,errors:{}},y={},g=fe(n.defaultValues)||{},h=n.shouldUnregister?{}:fe(g),p={action:!1,mount:!1,watch:!1},_={mount:new Set,unMount:new Set,array:new Set,watch:new Set},b=0,x={};const A={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},F={watch:Fe(),array:Fe(),state:Fe()},V=ye(n.mode),S=ye(n.reValidateMode),w=n.criteriaMode===v,k=async e=>{let t=!1;return A.isValid&&(t=n.resolver?j((await U()).errors):await B(y,!0),e||t===i.isValid||(i.isValid=t,F.state.next({isValid:t}))),t},D=(e,t,r,s)=>{const a=d(y,e);if(a){const n=d(h,e,c(r)?d(g,e):r);c(n)||s&&s.defaultChecked||t?H(h,e,t?n:Oe(a._f)):q(e,n),p.mount&&k()}},C=(e,t,r,s,a)=>{let n=!1;const o={name:e},u=d(i.touchedFields,e);if(A.isDirty){const e=i.isDirty;i.isDirty=o.isDirty=T(),n=e!==o.isDirty}if(A.dirtyFields&&(!r||s)){const r=d(i.dirtyFields,e);Se(d(g,e),t)?xe(i.dirtyFields,e):H(i.dirtyFields,e,!0),o.dirtyFields=i.dirtyFields,n=n||r!==d(i.dirtyFields,e)}return r&&!u&&(H(i.touchedFields,e,r),o.touchedFields=i.touchedFields,n=n||A.touchedFields&&u!==r),n&&a&&F.state.next(o),n?o:{}},E=async(r,s,a,n)=>{const o=d(i.errors,r),u=A.isValid&&i.isValid!==s;var l;if(e.delayError&&a?(l=()=>((e,t)=>{H(i.errors,e,t),F.state.next({errors:i.errors})})(r,a),t=e=>{clearTimeout(b),b=window.setTimeout(l,e)},t(e.delayError)):(clearTimeout(b),t=null,a?H(i.errors,r,a):xe(i.errors,r)),(a?!Se(o,a):o)||!j(n)||u){const e={...n,...u?{isValid:s}:{},errors:i.errors,name:r};i={...i,...e},F.state.next(e)}x[r]--,A.isValidating&&!Object.values(x).some(e=>e)&&(F.state.next({isValidating:!1}),x={})},U=async e=>n.resolver?await n.resolver({...h},n.context,((e,t,r,s)=>{const a={};for(const r of e){const e=d(t,r);e&&H(a,r,e._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:s}})(e||_.mount,y,n.criteriaMode,n.shouldUseNativeValidation)):{},B=async(e,t,r={valid:!0})=>{for(const s in e){const a=e[s];if(a){const{_f:e,...s}=a;if(e){const s=_.array.has(e.name),o=await le(a,d(h,e.name),w,n.shouldUseNativeValidation,s);if(o[e.name]&&(r.valid=!1,t))break;!t&&(d(o,e.name)?s?Q(i.errors,o,e.name):H(i.errors,e.name,o[e.name]):xe(i.errors,e.name))}s&&await B(s,t,r)}}return r.valid},T=(e,t)=>(e&&t&&H(h,e,t),!Se(G(),g)),R=(e,t,r)=>{const s={...p.mount?h:c(t)?g:M(e)?{[e]:t}:t};return N(e,_,s,r)},q=(e,t,s={})=>{const n=d(y,e);let i=t;if(n){const s=n._f;s&&(!s.disabled&&H(h,e,Ee(t,s)),i=de&&we(s.ref)&&a(t)?"":t,ke(s.ref)?[...s.ref.options].forEach(e=>e.selected=i.includes(e.value)):s.refs?r(s.ref)?s.refs.length>1?s.refs.forEach(e=>!e.disabled&&(e.checked=Array.isArray(i)?!!i.find(t=>t===e.value):i===e.value)):s.refs[0]&&(s.refs[0].checked=!!i):s.refs.forEach(e=>e.checked=e.value===i):Y(s.ref)?s.ref.value="":(s.ref.value=i,s.ref.type||F.watch.next({name:e})))}(s.shouldDirty||s.shouldTouch)&&C(e,i,s.shouldTouch,s.shouldDirty,!0),s.shouldValidate&&I(e)},W=(e,t,r)=>{for(const a in t){const n=t[a],i=`${e}.${a}`,o=d(y,i);!_.array.has(e)&&Ve(n)&&(!o||o._f)||s(n)?q(i,n,r):W(i,n,r)}},P=(e,t,r={})=>{const s=d(y,e),n=_.array.has(e),o=fe(t);H(h,e,o),n?(F.array.next({name:e,values:h}),(A.isDirty||A.dirtyFields)&&r.shouldDirty&&(i.dirtyFields=je(g,h),F.state.next({name:e,dirtyFields:i.dirtyFields,isDirty:T(e,o)}))):!s||s._f||a(o)?q(e,o,r):W(e,o,r),K(e,_)&&F.state.next({}),F.watch.next({name:e})},$=async e=>{const r=e.target;let s=r.name;const a=d(y,s);if(a){let l,c;const g=r.type?Oe(a._f):o(e),p=e.type===f||e.type===m,v=!((u=a._f).mount&&(u.required||u.min||u.max||u.maxLength||u.minLength||u.pattern||u.validate)||n.resolver||d(i.errors,s)||a._f.deps)||((e,t,r,s,a)=>!a.isOnAll&&(!r&&a.isOnTouch?!(t||e):(r?s.isOnBlur:a.isOnBlur)?!e:!(r?s.isOnChange:a.isOnChange)||e))(p,d(i.touchedFields,s),i.isSubmitted,S,V),b=K(s,_,p);H(h,s,g),p?(a._f.onBlur&&a._f.onBlur(e),t&&t(0)):a._f.onChange&&a._f.onChange(e);const A=C(s,g,p,!1),D=!j(A)||b;if(!p&&F.watch.next({name:s,type:e.type}),v)return D&&F.state.next({name:s,...b?{}:A});if(!p&&b&&F.state.next({}),x[s]=(x[s],1),F.state.next({isValidating:!0}),n.resolver){const{errors:e}=await U([s]),t=Be(i.errors,y,s),r=Be(e,y,t.name||s);l=r.error,s=r.name,c=j(e)}else l=(await le(a,d(h,s),w,n.shouldUseNativeValidation))[s],c=await k(!0);a._f.deps&&I(a._f.deps),E(s,c,l,A)}var u},I=async(e,t={})=>{let r,s;const a=O(e);if(F.state.next({isValidating:!0}),n.resolver){const t=await(async e=>{const{errors:t}=await U();if(e)for(const r of e){const e=d(t,r);e?H(i.errors,r,e):xe(i.errors,r)}else i.errors=t;return t})(c(e)?e:a);r=j(t),s=e?!a.some(e=>d(t,e)):r}else e?(s=(await Promise.all(a.map(async e=>{const t=d(y,e);return await B(t&&t._f?{[e]:t}:t)}))).every(Boolean),(s||i.isValid)&&k()):s=r=await B(y);return F.state.next({...!M(e)||A.isValid&&r!==i.isValid?{}:{name:e},...n.resolver?{isValid:r}:{},errors:i.errors,isValidating:!1}),t.shouldFocus&&!s&&z(y,e=>d(i.errors,e),e?a:_.mount),s},G=e=>{const t={...g,...p.mount?h:{}};return c(e)?t:M(e)?d(t,e):e.map(e=>d(t,e))},J=(e,t)=>({invalid:!!d((t||i).errors,e),isDirty:!!d((t||i).dirtyFields,e),isTouched:!!d((t||i).touchedFields,e),error:d((t||i).errors,e)}),Z=(e,t={})=>{for(const r of e?O(e):_.mount)_.mount.delete(r),_.array.delete(r),d(y,r)&&(t.keepValue||(xe(y,r),xe(h,r)),!t.keepError&&xe(i.errors,r),!t.keepDirty&&xe(i.dirtyFields,r),!t.keepTouched&&xe(i.touchedFields,r),!n.shouldUnregister&&!t.keepDefaultValue&&xe(g,r));F.watch.next({}),F.state.next({...i,...t.keepDirty?{isDirty:T()}:{}}),!t.keepIsValid&&k()},te=(e,t={})=>{let s=d(y,e);const a=X(t.disabled);return H(y,e,{_f:{...s&&s._f?s._f:{ref:{name:e}},name:e,mount:!0,...t}}),_.mount.add(e),s?a&&H(h,e,t.disabled?void 0:d(h,e,Oe(s._f))):D(e,!0,t.value),{...a?{disabled:t.disabled}:{},...n.shouldUseNativeValidation?{required:!!t.required,min:Ue(t.min),max:Ue(t.max),minLength:Ue(t.minLength),maxLength:Ue(t.maxLength),pattern:Ue(t.pattern)}:{},name:e,onChange:$,onBlur:$,ref:a=>{if(a){te(e,t),s=d(y,e);const n=c(a.value)&&a.querySelectorAll&&a.querySelectorAll("input,select,textarea")[0]||a,i=(e=>ee(e)||r(e))(n),o=s._f.refs||[];if(i?o.find(e=>e===n):n===s._f.ref)return;H(y,e,{_f:{...s._f,...i?{refs:[...o.filter(De),n,...Array.isArray(d(g,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),D(e,!1,void 0,n)}else s=d(y,e,{}),s._f&&(s._f.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!u(_.array,e)||!p.action)&&_.unMount.add(e)}}};return{control:{register:te,unregister:Z,getFieldState:J,_executeSchema:U,_getWatch:R,_getDirty:T,_updateValid:k,_removeUnmounted:()=>{for(const e of _.unMount){const t=d(y,e);t&&(t._f.refs?t._f.refs.every(e=>!De(e)):!De(t._f.ref))&&Z(e)}_.unMount=new Set},_updateFieldArray:(e,t=[],r,s,a=!0,n=!0)=>{if(s&&r){if(p.action=!0,n&&Array.isArray(d(y,e))){const t=r(d(y,e),s.argA,s.argB);a&&H(y,e,t)}if(A.errors&&n&&Array.isArray(d(i.errors,e))){const t=r(d(i.errors,e),s.argA,s.argB);a&&H(i.errors,e,t),((e,t)=>{!l(d(e,t)).length&&xe(e,t)})(i.errors,e)}if(A.touchedFields&&n&&Array.isArray(d(i.touchedFields,e))){const t=r(d(i.touchedFields,e),s.argA,s.argB);a&&H(i.touchedFields,e,t)}A.dirtyFields&&(i.dirtyFields=je(g,h)),F.state.next({isDirty:T(e,t),dirtyFields:i.dirtyFields,errors:i.errors,isValid:i.isValid})}else H(h,e,t)},_getFieldArray:t=>l(d(p.mount?h:g,t,e.shouldUnregister?d(g,t,[]):[])),_subjects:F,_proxyFormState:A,get _fields(){return y},get _formValues(){return h},get _stateFlags(){return p},set _stateFlags(e){p=e},get _defaultValues(){return g},get _names(){return _},set _names(e){_=e},get _formState(){return i},set _formState(e){i=e},get _options(){return n},set _options(e){n={...n,...e}}},trigger:I,register:te,handleSubmit:(e,t)=>async r=>{r&&(r.preventDefault&&r.preventDefault(),r.persist&&r.persist());let s=!0,a=fe(h);try{if(n.resolver){const{errors:e,values:t}=await U();i.errors=e,a=t}else await B(y);j(i.errors)?(F.state.next({errors:{},isSubmitting:!0}),await e(a,r)):(t&&await t({...i.errors},r),n.shouldFocusError&&z(y,e=>d(i.errors,e),_.mount)),F.state.next({isSubmitting:!0})}catch(e){throw s=!1,e}finally{i.isSubmitted=!0,F.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:j(i.errors)&&s,submitCount:i.submitCount+1,errors:i.errors})}},watch:(e,t)=>L(e)?F.watch.subscribe({next:r=>e(R(void 0,t),r)}):R(e,t,!0),setValue:P,getValues:G,reset:(t,r={})=>{const s=t||g,a=fe(s),n=t&&!j(t)?a:g;if(r.keepDefaultValues||(g=s),!r.keepValues){if(r.keepDirtyValues)for(const e of _.mount)d(i.dirtyFields,e)?H(n,e,d(h,e)):P(e,d(n,e));else{if(de&&c(t))for(const e of _.mount){const t=d(y,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;try{if(we(e)){e.closest("form").reset();break}}catch(e){}}}y={}}h=e.shouldUnregister?r.keepDefaultValues?fe(g):{}:a,F.array.next({values:n}),F.watch.next({values:n})}_={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},p.mount=!A.isValid||!!r.keepIsValid,p.watch=!!e.shouldUnregister,F.state.next({submitCount:r.keepSubmitCount?i.submitCount:0,isDirty:r.keepDirty||r.keepDirtyValues?i.isDirty:!(!r.keepDefaultValues||Se(t,g)),isSubmitted:!!r.keepIsSubmitted&&i.isSubmitted,dirtyFields:r.keepDirty||r.keepDirtyValues?i.dirtyFields:r.keepDefaultValues&&t?je(g,t):{},touchedFields:r.keepTouched?i.touchedFields:{},errors:r.keepErrors?i.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},resetField:(e,t={})=>{d(y,e)&&(c(t.defaultValue)?P(e,d(g,e)):(P(e,t.defaultValue),H(g,e,t.defaultValue)),t.keepTouched||xe(i.touchedFields,e),t.keepDirty||(xe(i.dirtyFields,e),i.isDirty=t.defaultValue?T(e,d(g,e)):T()),t.keepError||(xe(i.errors,e),A.isValid&&k()),F.state.next({...i}))},clearErrors:e=>{e?O(e).forEach(e=>xe(i.errors,e)):i.errors={},F.state.next({errors:i.errors})},unregister:Z,setError:(e,t,r)=>{const s=(d(y,e,{_f:{}})._f||{}).ref;H(i.errors,e,{...t,ref:s}),F.state.next({name:e,errors:i.errors,isValid:!1}),r&&r.shouldFocus&&s&&s.focus&&s.focus()},setFocus:(e,t={})=>{const r=d(y,e)._f,s=r.refs?r.refs[0]:r.ref;s.focus(),t.shouldSelect&&s.select()},getFieldState:J}}exports.Controller=e=>e.render(W(e)),exports.FormProvider=e=>{const{children:r,...s}=e;return t.default.createElement(k.Provider,{value:s},r)},exports.appendErrors=P,exports.get=d,exports.set=H,exports.useController=W,exports.useFieldArray=function(e){const r=D(),{control:s=r.control,name:a,keyName:n="id",shouldUnregister:i}=e,[o,u]=t.default.useState(s._getFieldArray(a)),l=t.default.useRef(s._getFieldArray(a).map(G)),c=t.default.useRef(o),f=t.default.useRef(a),m=t.default.useRef(!1);f.current=a,c.current=o,s._names.array.add(a),e.rules&&s.register(a,e.rules),B({callback:t.default.useCallback(({values:e,name:t})=>{if(t===f.current||!t){const t=d(e,f.current,[]);u(t),l.current=t.map(G)}},[]),subject:s._subjects.array});const y=t.default.useCallback(e=>{m.current=!0,s._updateFieldArray(a,e)},[s,a]);return t.default.useEffect(()=>{if(s._stateFlags.action=!1,K(a,s._names)&&s._subjects.state.next({}),m.current)if(s._options.resolver)s._executeSchema([a]).then(e=>{const t=d(e.errors,a),r=d(s._formState.errors,a);(r?!t&&r.type:t&&t.type)&&(t?H(s._formState.errors,a,t):xe(s._formState.errors,a),s._subjects.state.next({errors:s._formState.errors}))});else{const e=d(s._fields,a);(!ye(s._options.mode).isOnSubmit||s._formState.isSubmitted)&&e&&e._f&&le(e,d(s._formValues,a),s._options.criteriaMode===v,s._options.shouldUseNativeValidation,!0).then(e=>!j(e)&&s._subjects.state.next({errors:Q(s._formState.errors,e,a)}))}s._subjects.watch.next({name:a,values:s._formValues}),s._names.focus&&z(s._fields,e=>e.startsWith(s._names.focus)),s._names.focus="",s._proxyFormState.isValid&&s._updateValid()},[o,a,s]),t.default.useEffect(()=>(!d(s._formValues,a)&&s._updateFieldArray(a),()=>{(s._options.shouldUnregister||i)&&s.unregister(a)}),[a,s,n,i]),{swap:t.default.useCallback((e,t)=>{const r=s._getFieldArray(a);ve(r,e,t),ve(l.current,e,t),y(r),u(r),s._updateFieldArray(a,r,ve,{argA:e,argB:t},!1)},[y,a,s]),move:t.default.useCallback((e,t)=>{const r=s._getFieldArray(a);he(r,e,t),he(l.current,e,t),y(r),u(r),s._updateFieldArray(a,r,he,{argA:e,argB:t},!1)},[y,a,s]),prepend:t.default.useCallback((e,t)=>{const r=O(fe(e)),n=pe(s._getFieldArray(a),r);s._names.focus=J(a,0,t),l.current=pe(l.current,r.map(G)),y(n),u(n),s._updateFieldArray(a,n,pe,{argA:me(e)})},[y,a,s]),append:t.default.useCallback((e,t)=>{const r=O(fe(e)),n=ce(s._getFieldArray(a),r);s._names.focus=J(a,n.length-1,t),l.current=ce(l.current,r.map(G)),y(n),u(n),s._updateFieldArray(a,n,ce,{argA:me(e)})},[y,a,s]),remove:t.default.useCallback(e=>{const t=_e(s._getFieldArray(a),e);l.current=_e(l.current,e),y(t),u(t),s._updateFieldArray(a,t,_e,{argA:e})},[y,a,s]),insert:t.default.useCallback((e,t,r)=>{const n=O(fe(t)),i=ge(s._getFieldArray(a),e,n);s._names.focus=J(a,e,r),l.current=ge(l.current,e,n.map(G)),y(i),u(i),s._updateFieldArray(a,i,ge,{argA:e,argB:me(t)})},[y,a,s]),update:t.default.useCallback((e,t)=>{const r=fe(t),n=Ae(s._getFieldArray(a),e,r);l.current=[...n].map((t,r)=>t&&r!==e?l.current[r]:G()),y(n),u([...n]),s._updateFieldArray(a,n,Ae,{argA:e,argB:r},!0,!1)},[y,a,s]),replace:t.default.useCallback(e=>{const t=O(fe(e));l.current=t.map(G),y([...t]),u([...t]),s._updateFieldArray(a,[...t],e=>e,{},!0,!1)},[y,a,s]),fields:t.default.useMemo(()=>o.map((e,t)=>({...e,[n]:l.current[t]||G()})),[o,n])}},exports.useForm=function(e={}){const r=t.default.useRef(),[s,a]=t.default.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touchedFields:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,errors:{}});r.current?r.current.control._options=e:r.current={...Me(e),formState:s};const n=r.current.control,i=t.default.useCallback(e=>{E(e,n._proxyFormState,!0)&&(n._formState={...n._formState,...e},a({...n._formState}))},[n]);return B({subject:n._subjects.state,callback:i}),t.default.useEffect(()=>{n._stateFlags.mount||(n._proxyFormState.isValid&&n._updateValid(),n._stateFlags.mount=!0),n._stateFlags.watch&&(n._stateFlags.watch=!1,n._subjects.state.next({})),n._removeUnmounted()}),r.current.formState=C(s,n._proxyFormState),r.current},exports.useFormContext=D,exports.useFormState=T,exports.useWatch=q; +//# sourceMappingURL=index.cjs.js.map + + +/***/ }), + +/***/ 1607: +/***/ (function(module, exports, __webpack_require__) { + +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ +/* eslint-disable node/no-deprecated-api */ +var buffer = __webpack_require__(7861) +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.prototype = Object.create(Buffer.prototype) + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} + + +/***/ }), + +/***/ 3457: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +/**/ + +var Buffer = (__webpack_require__(1607).Buffer); +/**/ + +var isEncoding = Buffer.isEncoding || function (encoding) { + encoding = '' + encoding; + switch (encoding && encoding.toLowerCase()) { + case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': + return true; + default: + return false; + } +}; + +function _normalizeEncoding(enc) { + if (!enc) return 'utf8'; + var retried; + while (true) { + switch (enc) { + 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 enc; + default: + if (retried) return; // undefined + enc = ('' + enc).toLowerCase(); + retried = true; + } + } +}; + +// Do not cache `Buffer.isEncoding` when checking encoding names as some +// modules monkey-patch it to support additional encodings +function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); + return nenc || enc; +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. +exports.StringDecoder = StringDecoder; +function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case 'utf16le': + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case 'utf8': + this.fillLast = utf8FillLast; + nb = 4; + break; + case 'base64': + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer.allocUnsafe(nb); +} + +StringDecoder.prototype.write = function (buf) { + if (buf.length === 0) return ''; + var r; + var i; + if (this.lastNeed) { + r = this.fillLast(buf); + if (r === undefined) return ''; + i = this.lastNeed; + this.lastNeed = 0; + } else { + i = 0; + } + if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); + return r || ''; +}; + +StringDecoder.prototype.end = utf8End; + +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; + +// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer +StringDecoder.prototype.fillLast = function (buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; +}; + +// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a +// continuation byte. If an invalid byte is detected, -2 is returned. +function utf8CheckByte(byte) { + if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; + return byte >> 6 === 0x02 ? -1 : -2; +} + +// Checks at most 3 bytes at the end of a Buffer in order to detect an +// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) +// needed to complete the UTF-8 character (if applicable) are returned. +function utf8CheckIncomplete(self, buf, i) { + var j = buf.length - 1; + if (j < i) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 1; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 2; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0;else self.lastNeed = nb - 3; + } + return nb; + } + return 0; +} + +// Validates as many continuation bytes for a multi-byte UTF-8 character as +// needed or are available. If we see a non-continuation byte where we expect +// one, we "replace" the validated continuation bytes we've seen so far with +// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding +// behavior. The continuation byte check is included three times in the case +// where all of the continuation bytes for a character exist in the same buffer. +// It is also done this way as a slight performance increase instead of using a +// loop. +function utf8CheckExtraBytes(self, buf, p) { + if ((buf[0] & 0xC0) !== 0x80) { + self.lastNeed = 0; + return '\ufffd'; + } + if (self.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 0xC0) !== 0x80) { + self.lastNeed = 1; + return '\ufffd'; + } + if (self.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 0xC0) !== 0x80) { + self.lastNeed = 2; + return '\ufffd'; + } + } + } +} + +// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. +function utf8FillLast(buf) { + var p = this.lastTotal - this.lastNeed; + var r = utf8CheckExtraBytes(this, buf, p); + if (r !== undefined) return r; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p, 0, buf.length); + this.lastNeed -= buf.length; +} + +// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a +// partial character, the character's bytes are buffered until the required +// number of bytes are available. +function utf8Text(buf, i) { + var total = utf8CheckIncomplete(this, buf, i); + if (!this.lastNeed) return buf.toString('utf8', i); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString('utf8', i, end); +} + +// For UTF-8, a replacement character is added when ending on a partial +// character. +function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + '\ufffd'; + return r; +} + +// UTF-16LE typically needs two bytes per character, but even if we have an even +// number of bytes available, we need to check if we end on a leading/high +// surrogate. In that case, we need to wait for the next two bytes in order to +// decode the last character properly. +function utf16Text(buf, i) { + if ((buf.length - i) % 2 === 0) { + var r = buf.toString('utf16le', i); + if (r) { + var c = r.charCodeAt(r.length - 1); + if (c >= 0xD800 && c <= 0xDBFF) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r.slice(0, -1); + } + } + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString('utf16le', i, buf.length - 1); +} + +// For UTF-16LE we do not explicitly append special replacement characters if we +// end on a partial character, we simply let v8 handle that. +function utf16End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r + this.lastChar.toString('utf16le', 0, end); + } + return r; +} + +function base64Text(buf, i) { + var n = (buf.length - i) % 3; + if (n === 0) return buf.toString('base64', i); + this.lastNeed = 3 - n; + this.lastTotal = 3; + if (n === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString('base64', i, buf.length - n); +} + +function base64End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); + return r; +} + +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} + +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; +} + +/***/ }), + +/***/ 8946: +/***/ (function(module) { + +module.exports = function isBuffer(arg) { + return arg && typeof arg === 'object' + && typeof arg.copy === 'function' + && typeof arg.fill === 'function' + && typeof arg.readUInt8 === 'function'; +} + +/***/ }), + +/***/ 6096: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; +// Currently in sync with Node.js lib/internal/util/types.js +// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9 + + + +var isArgumentsObject = __webpack_require__(9462); +var isGeneratorFunction = __webpack_require__(7136); +var whichTypedArray = __webpack_require__(5472); +var isTypedArray = __webpack_require__(1407); + +function uncurryThis(f) { + return f.call.bind(f); +} + +var BigIntSupported = typeof BigInt !== 'undefined'; +var SymbolSupported = typeof Symbol !== 'undefined'; + +var ObjectToString = uncurryThis(Object.prototype.toString); + +var numberValue = uncurryThis(Number.prototype.valueOf); +var stringValue = uncurryThis(String.prototype.valueOf); +var booleanValue = uncurryThis(Boolean.prototype.valueOf); + +if (BigIntSupported) { + var bigIntValue = uncurryThis(BigInt.prototype.valueOf); +} + +if (SymbolSupported) { + var symbolValue = uncurryThis(Symbol.prototype.valueOf); +} + +function checkBoxedPrimitive(value, prototypeValueOf) { + if (typeof value !== 'object') { + return false; + } + try { + prototypeValueOf(value); + return true; + } catch(e) { + return false; + } +} + +exports.isArgumentsObject = isArgumentsObject; +exports.isGeneratorFunction = isGeneratorFunction; +exports.isTypedArray = isTypedArray; + +// Taken from here and modified for better browser support +// https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js +function isPromise(input) { + return ( + ( + typeof Promise !== 'undefined' && + input instanceof Promise + ) || + ( + input !== null && + typeof input === 'object' && + typeof input.then === 'function' && + typeof input.catch === 'function' + ) + ); +} +exports.isPromise = isPromise; + +function isArrayBufferView(value) { + if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) { + return ArrayBuffer.isView(value); + } + + return ( + isTypedArray(value) || + isDataView(value) + ); +} +exports.isArrayBufferView = isArrayBufferView; + + +function isUint8Array(value) { + return whichTypedArray(value) === 'Uint8Array'; +} +exports.isUint8Array = isUint8Array; + +function isUint8ClampedArray(value) { + return whichTypedArray(value) === 'Uint8ClampedArray'; +} +exports.isUint8ClampedArray = isUint8ClampedArray; + +function isUint16Array(value) { + return whichTypedArray(value) === 'Uint16Array'; +} +exports.isUint16Array = isUint16Array; + +function isUint32Array(value) { + return whichTypedArray(value) === 'Uint32Array'; +} +exports.isUint32Array = isUint32Array; + +function isInt8Array(value) { + return whichTypedArray(value) === 'Int8Array'; +} +exports.isInt8Array = isInt8Array; + +function isInt16Array(value) { + return whichTypedArray(value) === 'Int16Array'; +} +exports.isInt16Array = isInt16Array; + +function isInt32Array(value) { + return whichTypedArray(value) === 'Int32Array'; +} +exports.isInt32Array = isInt32Array; + +function isFloat32Array(value) { + return whichTypedArray(value) === 'Float32Array'; +} +exports.isFloat32Array = isFloat32Array; + +function isFloat64Array(value) { + return whichTypedArray(value) === 'Float64Array'; +} +exports.isFloat64Array = isFloat64Array; + +function isBigInt64Array(value) { + return whichTypedArray(value) === 'BigInt64Array'; +} +exports.isBigInt64Array = isBigInt64Array; + +function isBigUint64Array(value) { + return whichTypedArray(value) === 'BigUint64Array'; +} +exports.isBigUint64Array = isBigUint64Array; + +function isMapToString(value) { + return ObjectToString(value) === '[object Map]'; +} +isMapToString.working = ( + typeof Map !== 'undefined' && + isMapToString(new Map()) +); + +function isMap(value) { + if (typeof Map === 'undefined') { + return false; + } + + return isMapToString.working + ? isMapToString(value) + : value instanceof Map; +} +exports.isMap = isMap; + +function isSetToString(value) { + return ObjectToString(value) === '[object Set]'; +} +isSetToString.working = ( + typeof Set !== 'undefined' && + isSetToString(new Set()) +); +function isSet(value) { + if (typeof Set === 'undefined') { + return false; + } + + return isSetToString.working + ? isSetToString(value) + : value instanceof Set; +} +exports.isSet = isSet; + +function isWeakMapToString(value) { + return ObjectToString(value) === '[object WeakMap]'; +} +isWeakMapToString.working = ( + typeof WeakMap !== 'undefined' && + isWeakMapToString(new WeakMap()) +); +function isWeakMap(value) { + if (typeof WeakMap === 'undefined') { + return false; + } + + return isWeakMapToString.working + ? isWeakMapToString(value) + : value instanceof WeakMap; +} +exports.isWeakMap = isWeakMap; + +function isWeakSetToString(value) { + return ObjectToString(value) === '[object WeakSet]'; +} +isWeakSetToString.working = ( + typeof WeakSet !== 'undefined' && + isWeakSetToString(new WeakSet()) +); +function isWeakSet(value) { + return isWeakSetToString(value); +} +exports.isWeakSet = isWeakSet; + +function isArrayBufferToString(value) { + return ObjectToString(value) === '[object ArrayBuffer]'; +} +isArrayBufferToString.working = ( + typeof ArrayBuffer !== 'undefined' && + isArrayBufferToString(new ArrayBuffer()) +); +function isArrayBuffer(value) { + if (typeof ArrayBuffer === 'undefined') { + return false; + } + + return isArrayBufferToString.working + ? isArrayBufferToString(value) + : value instanceof ArrayBuffer; +} +exports.isArrayBuffer = isArrayBuffer; + +function isDataViewToString(value) { + return ObjectToString(value) === '[object DataView]'; +} +isDataViewToString.working = ( + typeof ArrayBuffer !== 'undefined' && + typeof DataView !== 'undefined' && + isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1)) +); +function isDataView(value) { + if (typeof DataView === 'undefined') { + return false; + } + + return isDataViewToString.working + ? isDataViewToString(value) + : value instanceof DataView; +} +exports.isDataView = isDataView; + +// Store a copy of SharedArrayBuffer in case it's deleted elsewhere +var SharedArrayBufferCopy = typeof SharedArrayBuffer !== 'undefined' ? SharedArrayBuffer : undefined; +function isSharedArrayBufferToString(value) { + return ObjectToString(value) === '[object SharedArrayBuffer]'; +} +function isSharedArrayBuffer(value) { + if (typeof SharedArrayBufferCopy === 'undefined') { + return false; + } + + if (typeof isSharedArrayBufferToString.working === 'undefined') { + isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy()); + } + + return isSharedArrayBufferToString.working + ? isSharedArrayBufferToString(value) + : value instanceof SharedArrayBufferCopy; +} +exports.isSharedArrayBuffer = isSharedArrayBuffer; + +function isAsyncFunction(value) { + return ObjectToString(value) === '[object AsyncFunction]'; +} +exports.isAsyncFunction = isAsyncFunction; + +function isMapIterator(value) { + return ObjectToString(value) === '[object Map Iterator]'; +} +exports.isMapIterator = isMapIterator; + +function isSetIterator(value) { + return ObjectToString(value) === '[object Set Iterator]'; +} +exports.isSetIterator = isSetIterator; + +function isGeneratorObject(value) { + return ObjectToString(value) === '[object Generator]'; +} +exports.isGeneratorObject = isGeneratorObject; + +function isWebAssemblyCompiledModule(value) { + return ObjectToString(value) === '[object WebAssembly.Module]'; +} +exports.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule; + +function isNumberObject(value) { + return checkBoxedPrimitive(value, numberValue); +} +exports.isNumberObject = isNumberObject; + +function isStringObject(value) { + return checkBoxedPrimitive(value, stringValue); +} +exports.isStringObject = isStringObject; + +function isBooleanObject(value) { + return checkBoxedPrimitive(value, booleanValue); +} +exports.isBooleanObject = isBooleanObject; + +function isBigIntObject(value) { + return BigIntSupported && checkBoxedPrimitive(value, bigIntValue); +} +exports.isBigIntObject = isBigIntObject; + +function isSymbolObject(value) { + return SymbolSupported && checkBoxedPrimitive(value, symbolValue); +} +exports.isSymbolObject = isSymbolObject; + +function isBoxedPrimitive(value) { + return ( + isNumberObject(value) || + isStringObject(value) || + isBooleanObject(value) || + isBigIntObject(value) || + isSymbolObject(value) + ); +} +exports.isBoxedPrimitive = isBoxedPrimitive; + +function isAnyArrayBuffer(value) { + return typeof Uint8Array !== 'undefined' && ( + isArrayBuffer(value) || + isSharedArrayBuffer(value) + ); +} +exports.isAnyArrayBuffer = isAnyArrayBuffer; + +['isProxy', 'isExternal', 'isModuleNamespaceObject'].forEach(function(method) { + Object.defineProperty(exports, method, { + enumerable: false, + value: function() { + throw new Error(method + ' is not supported in userland'); + } + }); +}); + + +/***/ }), + +/***/ 911: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +/* provided dependency */ var process = __webpack_require__(8448); +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || + function getOwnPropertyDescriptors(obj) { + var keys = Object.keys(obj); + var descriptors = {}; + for (var i = 0; i < keys.length; i++) { + descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]); + } + return descriptors; + }; + +var formatRegExp = /%[sdj%]/g; +exports.format = function(f) { + if (!isString(f)) { + var objects = []; + for (var i = 0; i < arguments.length; i++) { + objects.push(inspect(arguments[i])); + } + return objects.join(' '); + } + + var i = 1; + var args = arguments; + var len = args.length; + var str = String(f).replace(formatRegExp, function(x) { + if (x === '%%') return '%'; + if (i >= len) return x; + switch (x) { + case '%s': return String(args[i++]); + case '%d': return Number(args[i++]); + case '%j': + try { + return JSON.stringify(args[i++]); + } catch (_) { + return '[Circular]'; + } + default: + return x; + } + }); + for (var x = args[i]; i < len; x = args[++i]) { + if (isNull(x) || !isObject(x)) { + str += ' ' + x; + } else { + str += ' ' + inspect(x); + } + } + return str; +}; + + +// Mark that a method should not be used. +// Returns a modified function which warns once by default. +// If --no-deprecation is set, then it is a no-op. +exports.deprecate = function(fn, msg) { + if (typeof process !== 'undefined' && process.noDeprecation === true) { + return fn; + } + + // Allow for deprecating things in the process of starting up. + if (typeof process === 'undefined') { + return function() { + return exports.deprecate(fn, msg).apply(this, arguments); + }; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (process.throwDeprecation) { + throw new Error(msg); + } else if (process.traceDeprecation) { + console.trace(msg); + } else { + console.error(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +}; + + +var debugs = {}; +var debugEnvRegex = /^$/; + +if (process.env.NODE_DEBUG) { + var debugEnv = process.env.NODE_DEBUG; + debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, '\\$&') + .replace(/\*/g, '.*') + .replace(/,/g, '$|^') + .toUpperCase(); + debugEnvRegex = new RegExp('^' + debugEnv + '$', 'i'); +} +exports.debuglog = function(set) { + set = set.toUpperCase(); + if (!debugs[set]) { + if (debugEnvRegex.test(set)) { + var pid = process.pid; + debugs[set] = function() { + var msg = exports.format.apply(exports, arguments); + console.error('%s %d: %s', set, pid, msg); + }; + } else { + debugs[set] = function() {}; + } + } + return debugs[set]; +}; + + +/** + * Echos the value of a value. Trys to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Object} opts Optional options object that alters the output. + */ +/* legacy: obj, showHidden, depth, colors*/ +function inspect(obj, opts) { + // default options + var ctx = { + seen: [], + stylize: stylizeNoColor + }; + // legacy... + if (arguments.length >= 3) ctx.depth = arguments[2]; + if (arguments.length >= 4) ctx.colors = arguments[3]; + if (isBoolean(opts)) { + // legacy... + ctx.showHidden = opts; + } else if (opts) { + // got an "options" object + exports._extend(ctx, opts); + } + // set default options + if (isUndefined(ctx.showHidden)) ctx.showHidden = false; + if (isUndefined(ctx.depth)) ctx.depth = 2; + if (isUndefined(ctx.colors)) ctx.colors = false; + if (isUndefined(ctx.customInspect)) ctx.customInspect = true; + if (ctx.colors) ctx.stylize = stylizeWithColor; + return formatValue(ctx, obj, ctx.depth); +} +exports.inspect = inspect; + + +// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +inspect.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] +}; + +// Don't use 'blue' not visible on cmd.exe +inspect.styles = { + 'special': 'cyan', + 'number': 'yellow', + 'boolean': 'yellow', + 'undefined': 'grey', + 'null': 'bold', + 'string': 'green', + 'date': 'magenta', + // "name": intentionally not styling + 'regexp': 'red' +}; + + +function stylizeWithColor(str, styleType) { + var style = inspect.styles[styleType]; + + if (style) { + return '\u001b[' + inspect.colors[style][0] + 'm' + str + + '\u001b[' + inspect.colors[style][1] + 'm'; + } else { + return str; + } +} + + +function stylizeNoColor(str, styleType) { + return str; +} + + +function arrayToHash(array) { + var hash = {}; + + array.forEach(function(val, idx) { + hash[val] = true; + }); + + return hash; +} + + +function formatValue(ctx, value, recurseTimes) { + // Provide a hook for user-specified inspect functions. + // Check that value is an object with an inspect function on it + if (ctx.customInspect && + value && + isFunction(value.inspect) && + // Filter out the util module, it's inspect function is special + value.inspect !== exports.inspect && + // Also filter out any prototype objects using the circular check. + !(value.constructor && value.constructor.prototype === value)) { + var ret = value.inspect(recurseTimes, ctx); + if (!isString(ret)) { + ret = formatValue(ctx, ret, recurseTimes); + } + return ret; + } + + // Primitive types cannot have properties + var primitive = formatPrimitive(ctx, value); + if (primitive) { + return primitive; + } + + // Look up the keys of the object. + var keys = Object.keys(value); + var visibleKeys = arrayToHash(keys); + + if (ctx.showHidden) { + keys = Object.getOwnPropertyNames(value); + } + + // IE doesn't make error fields non-enumerable + // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx + if (isError(value) + && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { + return formatError(value); + } + + // Some type of object without properties can be shortcutted. + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ': ' + value.name : ''; + return ctx.stylize('[Function' + name + ']', 'special'); + } + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), 'date'); + } + if (isError(value)) { + return formatError(value); + } + } + + var base = '', array = false, braces = ['{', '}']; + + // Make Array say that they are Array + if (isArray(value)) { + array = true; + braces = ['[', ']']; + } + + // Make functions say that they are functions + if (isFunction(value)) { + var n = value.name ? ': ' + value.name : ''; + base = ' [Function' + n + ']'; + } + + // Make RegExps say that they are RegExps + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value); + } + + // Make dates with properties first say the date + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value); + } + + // Make error with message first say the error + if (isError(value)) { + base = ' ' + formatError(value); + } + + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } else { + return ctx.stylize('[Object]', 'special'); + } + } + + ctx.seen.push(value); + + var output; + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function(key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + + ctx.seen.pop(); + + return reduceToSingleString(output, base, braces); +} + + +function formatPrimitive(ctx, value) { + if (isUndefined(value)) + return ctx.stylize('undefined', 'undefined'); + if (isString(value)) { + var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + '\''; + return ctx.stylize(simple, 'string'); + } + if (isNumber(value)) + return ctx.stylize('' + value, 'number'); + if (isBoolean(value)) + return ctx.stylize('' + value, 'boolean'); + // For some reason typeof null is "object", so special case here. + if (isNull(value)) + return ctx.stylize('null', 'null'); +} + + +function formatError(value) { + return '[' + Error.prototype.toString.call(value) + ']'; +} + + +function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + String(i), true)); + } else { + output.push(''); + } + } + keys.forEach(function(key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + key, true)); + } + }); + return output; +} + + +function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; + if (desc.get) { + if (desc.set) { + str = ctx.stylize('[Getter/Setter]', 'special'); + } else { + str = ctx.stylize('[Getter]', 'special'); + } + } else { + if (desc.set) { + str = ctx.stylize('[Setter]', 'special'); + } + } + if (!hasOwnProperty(visibleKeys, key)) { + name = '[' + key + ']'; + } + if (!str) { + if (ctx.seen.indexOf(desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n').slice(2); + } else { + str = '\n' + str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = ctx.stylize('[Circular]', 'special'); + } + } + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + name = JSON.stringify('' + key); + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.slice(1, -1); + name = ctx.stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'") + .replace(/\\"/g, '"') + .replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, 'string'); + } + } + + return name + ': ' + str; +} + + +function reduceToSingleString(output, base, braces) { + var numLinesEst = 0; + var length = output.reduce(function(prev, cur) { + numLinesEst++; + if (cur.indexOf('\n') >= 0) numLinesEst++; + return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; + }, 0); + + if (length > 60) { + return braces[0] + + (base === '' ? '' : base + '\n ') + + ' ' + + output.join(',\n ') + + ' ' + + braces[1]; + } + + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +} + + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. +exports.types = __webpack_require__(6096); + +function isArray(ar) { + return Array.isArray(ar); +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; +exports.types.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; +exports.types.isDate = isDate; + +function isError(e) { + return isObject(e) && + (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; +exports.types.isNativeError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = __webpack_require__(8946); + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + + +function pad(n) { + return n < 10 ? '0' + n.toString(10) : n.toString(10); +} + + +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', + 'Oct', 'Nov', 'Dec']; + +// 26 Feb 16:19:34 +function timestamp() { + var d = new Date(); + var time = [pad(d.getHours()), + pad(d.getMinutes()), + pad(d.getSeconds())].join(':'); + return [d.getDate(), months[d.getMonth()], time].join(' '); +} + + +// log is just a thin wrapper to console.log that prepends a timestamp +exports.log = function() { + console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); +}; + + +/** + * Inherit the prototype methods from one constructor into another. + * + * The Function.prototype.inherits from lang.js rewritten as a standalone + * function (not on Function.prototype). NOTE: If this file is to be loaded + * during bootstrapping this function needs to be rewritten using some native + * functions as prototype setup using normal JavaScript does not work as + * expected during bootstrapping (see mirror.js in r114903). + * + * @param {function} ctor Constructor function which needs to inherit the + * prototype. + * @param {function} superCtor Constructor function to inherit prototype from. + */ +exports.inherits = __webpack_require__(7483); + +exports._extend = function(origin, add) { + // Don't do anything if add isn't an object + if (!add || !isObject(add)) return origin; + + var keys = Object.keys(add); + var i = keys.length; + while (i--) { + origin[keys[i]] = add[keys[i]]; + } + return origin; +}; + +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +var kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined; + +exports.promisify = function promisify(original) { + if (typeof original !== 'function') + throw new TypeError('The "original" argument must be of type Function'); + + if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) { + var fn = original[kCustomPromisifiedSymbol]; + if (typeof fn !== 'function') { + throw new TypeError('The "util.promisify.custom" argument must be of type Function'); + } + Object.defineProperty(fn, kCustomPromisifiedSymbol, { + value: fn, enumerable: false, writable: false, configurable: true + }); + return fn; + } + + function fn() { + var promiseResolve, promiseReject; + var promise = new Promise(function (resolve, reject) { + promiseResolve = resolve; + promiseReject = reject; + }); + + var args = []; + for (var i = 0; i < arguments.length; i++) { + args.push(arguments[i]); + } + args.push(function (err, value) { + if (err) { + promiseReject(err); + } else { + promiseResolve(value); + } + }); + + try { + original.apply(this, args); + } catch (err) { + promiseReject(err); + } + + return promise; + } + + Object.setPrototypeOf(fn, Object.getPrototypeOf(original)); + + if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, { + value: fn, enumerable: false, writable: false, configurable: true + }); + return Object.defineProperties( + fn, + getOwnPropertyDescriptors(original) + ); +} + +exports.promisify.custom = kCustomPromisifiedSymbol + +function callbackifyOnRejected(reason, cb) { + // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M). + // Because `null` is a special error value in callbacks which means "no error + // occurred", we error-wrap so the callback consumer can distinguish between + // "the promise rejected with null" or "the promise fulfilled with undefined". + if (!reason) { + var newReason = new Error('Promise was rejected with a falsy value'); + newReason.reason = reason; + reason = newReason; + } + return cb(reason); +} + +function callbackify(original) { + if (typeof original !== 'function') { + throw new TypeError('The "original" argument must be of type Function'); + } + + // We DO NOT return the promise as it gives the user a false sense that + // the promise is actually somehow related to the callback's execution + // and that the callback throwing will reject the promise. + function callbackified() { + var args = []; + for (var i = 0; i < arguments.length; i++) { + args.push(arguments[i]); + } + + var maybeCb = args.pop(); + if (typeof maybeCb !== 'function') { + throw new TypeError('The last argument must be of type Function'); + } + var self = this; + var cb = function() { + return maybeCb.apply(self, arguments); + }; + // In true node style we process the callback on `nextTick` with all the + // implications (stack, `uncaughtException`, `async_hooks`) + original.apply(this, args) + .then(function(ret) { process.nextTick(cb.bind(null, null, ret)) }, + function(rej) { process.nextTick(callbackifyOnRejected.bind(null, rej, cb)) }); + } + + Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)); + Object.defineProperties(callbackified, + getOwnPropertyDescriptors(original)); + return callbackified; +} +exports.callbackify = callbackify; + + +/***/ }), + +/***/ 5472: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var forEach = __webpack_require__(98); +var availableTypedArrays = __webpack_require__(3719); +var callBound = __webpack_require__(2864); +var gOPD = __webpack_require__(8158); + +var $toString = callBound('Object.prototype.toString'); +var hasToStringTag = __webpack_require__(3342)(); + +var g = typeof globalThis === 'undefined' ? __webpack_require__.g : globalThis; +var typedArrays = availableTypedArrays(); + +var $slice = callBound('String.prototype.slice'); +var toStrTags = {}; +var getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof'); +if (hasToStringTag && gOPD && getPrototypeOf) { + forEach(typedArrays, function (typedArray) { + if (typeof g[typedArray] === 'function') { + var arr = new g[typedArray](); + if (Symbol.toStringTag in arr) { + var proto = getPrototypeOf(arr); + var descriptor = gOPD(proto, Symbol.toStringTag); + if (!descriptor) { + var superProto = getPrototypeOf(proto); + descriptor = gOPD(superProto, Symbol.toStringTag); + } + toStrTags[typedArray] = descriptor.get; + } + } + }); +} + +var tryTypedArrays = function tryAllTypedArrays(value) { + var foundName = false; + forEach(toStrTags, function (getter, typedArray) { + if (!foundName) { + try { + var name = getter.call(value); + if (name === typedArray) { + foundName = name; + } + } catch (e) {} + } + }); + return foundName; +}; + +var isTypedArray = __webpack_require__(1407); + +module.exports = function whichTypedArray(value) { + if (!isTypedArray(value)) { return false; } + if (!hasToStringTag || !(Symbol.toStringTag in value)) { return $slice($toString(value), 8, -1); } + return tryTypedArrays(value); +}; + + +/***/ }), + +/***/ 3719: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var possibleNames = [ + 'BigInt64Array', + 'BigUint64Array', + 'Float32Array', + 'Float64Array', + 'Int16Array', + 'Int32Array', + 'Int8Array', + 'Uint16Array', + 'Uint32Array', + 'Uint8Array', + 'Uint8ClampedArray' +]; + +var g = typeof globalThis === 'undefined' ? __webpack_require__.g : globalThis; + +module.exports = function availableTypedArrays() { + var out = []; + for (var i = 0; i < possibleNames.length; i++) { + if (typeof g[possibleNames[i]] === 'function') { + out[out.length] = possibleNames[i]; + } + } + return out; +}; + + +/***/ }) + +}]); \ No newline at end of file diff --git a/crates/swc_ecma_minifier/tests/fixture/next/raw/static/chunks/framework-529c7d20608a3f1b/input.js b/crates/swc_ecma_minifier/tests/fixture/next/raw/static/chunks/framework-529c7d20608a3f1b/input.js new file mode 100644 index 000000000000..ba04e416009a --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/next/raw/static/chunks/framework-529c7d20608a3f1b/input.js @@ -0,0 +1,495 @@ +"use strict"; +(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[774],{ + +/***/ 5565: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/* + Modernizr 3.0.0pre (Custom Build) | MIT +*/ +var aa=__webpack_require__(2983),ca=__webpack_require__(5655);function p(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;cb}return!1}function v(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var z={}; +"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){z[a]=new v(a,0,!1,a,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];z[b]=new v(b,1,!1,a[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){z[a]=new v(a,2,!1,a.toLowerCase(),null,!1,!1)}); +["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){z[a]=new v(a,2,!1,a,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){z[a]=new v(a,3,!1,a.toLowerCase(),null,!1,!1)}); +["checked","multiple","muted","selected"].forEach(function(a){z[a]=new v(a,3,!0,a,null,!1,!1)});["capture","download"].forEach(function(a){z[a]=new v(a,4,!1,a,null,!1,!1)});["cols","rows","size","span"].forEach(function(a){z[a]=new v(a,6,!1,a,null,!1,!1)});["rowSpan","start"].forEach(function(a){z[a]=new v(a,5,!1,a.toLowerCase(),null,!1,!1)});var ra=/[\-:]([a-z])/g;function sa(a){return a[1].toUpperCase()} +"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var b=a.replace(ra, +sa);z[b]=new v(b,1,!1,a,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!1,!1)}); +z.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!0,!0)}); +function ta(a,b,c,d){var e=z.hasOwnProperty(b)?z[b]:null;if(null!==e?0!==e.type:d||!(2h||e[g]!==f[h]){var k="\n"+e[g].replace(" at new "," at ");a.displayName&&k.includes("")&&(k=k.replace("",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{Na=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:"")?Ma(a):""} +function Pa(a){switch(a.tag){case 5:return Ma(a.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return a=Oa(a.type,!1),a;case 11:return a=Oa(a.type.render,!1),a;case 1:return a=Oa(a.type,!0),a;default:return""}} +function Qa(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case ya:return"Fragment";case wa:return"Portal";case Aa:return"Profiler";case za:return"StrictMode";case Ea:return"Suspense";case Fa:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case Ca:return(a.displayName||"Context")+".Consumer";case Ba:return(a._context.displayName||"Context")+".Provider";case Da:var b=a.render;a=a.displayName;a||(a=b.displayName|| +b.name||"",a=""!==a?"ForwardRef("+a+")":"ForwardRef");return a;case Ga:return b=a.displayName||null,null!==b?b:Qa(a.type)||"Memo";case Ha:b=a._payload;a=a._init;try{return Qa(a(b))}catch(c){}}return null} +function Ra(a){var b=a.type;switch(a.tag){case 24:return"Cache";case 9:return(b.displayName||"Context")+".Consumer";case 10:return(b._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=b.render,a=a.displayName||a.name||"",b.displayName||(""!==a?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return b;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa(b);case 8:return b===za?"StrictMode":"Mode";case 22:return"Offscreen"; +case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof b)return b.displayName||b.name||null;if("string"===typeof b)return b}return null}function Sa(a){switch(typeof a){case "boolean":case "number":case "string":case "undefined":return a;case "object":return a;default:return""}} +function Ta(a){var b=a.type;return(a=a.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===b||"radio"===b)} +function Ua(a){var b=Ta(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=""+a[b];if(!a.hasOwnProperty(b)&&"undefined"!==typeof c&&"function"===typeof c.get&&"function"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=""+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=""+a},stopTracking:function(){a._valueTracker= +null;delete a[b]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d="";a&&(d=Ta(a)?a.checked?"true":"false":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}} +function Ya(a,b){var c=b.checked;return A({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?"":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:"checkbox"===b.type||"radio"===b.type?null!=b.checked:null!=b.value}}function ab(a,b){b=b.checked;null!=b&&ta(a,"checked",b,!1)} +function bb(a,b){ab(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if("number"===d){if(0===c&&""===a.value||a.value!=c)a.value=""+c}else a.value!==""+c&&(a.value=""+c);else if("submit"===d||"reset"===d){a.removeAttribute("value");return}b.hasOwnProperty("value")?cb(a,b.type,c):b.hasOwnProperty("defaultValue")&&cb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)} +function db(a,b,c){if(b.hasOwnProperty("value")||b.hasOwnProperty("defaultValue")){var d=b.type;if(!("submit"!==d&&"reset"!==d||void 0!==b.value&&null!==b.value))return;b=""+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;""!==c&&(a.name="");a.defaultChecked=!!a._wrapperState.initialChecked;""!==c&&(a.name=c)} +function cb(a,b,c){if("number"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+c&&(a.defaultValue=""+c)}var eb=Array.isArray; +function fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e"+b.valueOf().toString()+"";for(b=mb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}}); +function ob(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b} +var pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0, +zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=["Webkit","ms","Moz","O"];Object.keys(pb).forEach(function(a){qb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);pb[b]=pb[a]})});function rb(a,b,c){return null==b||"boolean"===typeof b||""===b?"":c||"number"!==typeof b||0===b||pb.hasOwnProperty(a)&&pb[a]?(""+b).trim():b+"px"} +function sb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--"),e=rb(c,b[c],d);"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e}}var tb=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}); +function ub(a,b){if(b){if(tb[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(p(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(p(60));if("object"!==typeof b.dangerouslySetInnerHTML||!("__html"in b.dangerouslySetInnerHTML))throw Error(p(61));}if(null!=b.style&&"object"!==typeof b.style)throw Error(p(62));}} +function vb(a,b){if(-1===a.indexOf("-"))return"string"===typeof b.is;switch(a){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return!1;default:return!0}}var wb=null;function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null; +function Bb(a){if(a=Cb(a)){if("function"!==typeof yb)throw Error(p(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;a>>=0;return 0===a?32:31-(pc(a)/qc|0)|0}var rc=64,sc=4194304; +function tc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824; +default:return a}}function uc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=tc(h):(f&=g,0!==f&&(d=tc(f)))}else g=c&~e,0!==g?d=tc(g):0!==f&&(d=tc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&&(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0c;c++)b.push(a);return b} +function Ac(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-oc(b);a[b]=c}function Bc(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0=be),ee=String.fromCharCode(32),fe=!1; +function ge(a,b){switch(a){case "keyup":return-1!==$d.indexOf(b.keyCode);case "keydown":return 229!==b.keyCode;case "keypress":case "mousedown":case "focusout":return!0;default:return!1}}function he(a){a=a.detail;return"object"===typeof a&&"data"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case "compositionend":return he(b);case "keypress":if(32!==b.which)return null;fe=!0;return ee;case "textInput":return a=b.data,a===ee&&fe?null:a;default:return null}} +function ke(a,b){if(ie)return"compositionend"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case "paste":return null;case "keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Je(c)}}function Le(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Le(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1} +function Me(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c="string"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Xa(a.document)}return b}function Ne(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)} +function Oe(a){var b=Me(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Le(c.ownerDocument.documentElement,c)){if(null!==d&&Ne(c))if(b=d.start,a=d.end,void 0===a&&(a=b),"selectionStart"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Ke(c,f);var g=Ke(c, +d);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});"function"===typeof c.focus&&c.focus();for(c=0;c=document.documentMode,Qe=null,Re=null,Se=null,Te=!1; +function Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,"selectionStart"in d&&Ne(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Ie(Se,d)||(Se=d,d=oe(Re,"onSelect"),0Tf||(a.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(a,b){Tf++;Sf[Tf]=a.current;a.current=b}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(a,b){var c=a.type.contextTypes;if(!c)return Vf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e} +function Zf(a){a=a.childContextTypes;return null!==a&&void 0!==a}function $f(){E(Wf);E(H)}function ag(a,b,c){if(H.current!==Vf)throw Error(p(168));G(H,b);G(Wf,c)}function bg(a,b,c){var d=a.stateNode;b=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(p(108,Ra(a)||"Unknown",e));return A({},c,d)} +function cg(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Vf;Xf=H.current;G(H,a);G(Wf,Wf.current);return!0}function dg(a,b,c){var d=a.stateNode;if(!d)throw Error(p(169));c?(a=bg(a,b,Xf),d.__reactInternalMemoizedMergedChildContext=a,E(Wf),E(H),G(H,a)):E(Wf);G(Wf,c)}var eg=null,fg=!1,gg=!1;function hg(a){null===eg?eg=[a]:eg.push(a)}function ig(a){fg=!0;hg(a)} +function jg(){if(!gg&&null!==eg){gg=!0;var a=0,b=C;try{var c=eg;for(C=1;a>=g;e-=g;rg=1<<32-oc(b)+e|c<w?(x=u,u=null):x=u.sibling;var n=r(e,u,h[w],k);if(null===n){null===u&&(u=x);break}a&&u&&null===n.alternate&&b(e,u);g=f(n,g,w);null===m?l=n:m.sibling=n;m=n;u=x}if(w===h.length)return c(e,u),I&&tg(e,w),l;if(null===u){for(;ww?(x=m,m=null):x=m.sibling;var t=r(e,m,n.value,k);if(null===t){null===m&&(m=x);break}a&&m&&null===t.alternate&&b(e,m);g=f(t,g,w);null===u?l=t:u.sibling=t;u=t;m=x}if(n.done)return c(e, +m),I&&tg(e,w),l;if(null===m){for(;!n.done;w++,n=h.next())n=q(e,n.value,k),null!==n&&(g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);I&&tg(e,w);return l}for(m=d(e,m);!n.done;w++,n=h.next())n=y(m,e,w,n.value,k),null!==n&&(a&&null!==n.alternate&&m.delete(null===n.key?w:n.key),g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);a&&m.forEach(function(a){return b(e,a)});I&&tg(e,w);return l}function J(a,d,f,h){"object"===typeof f&&null!==f&&f.type===ya&&null===f.key&&(f=f.props.children);if("object"===typeof f&&null!==f){switch(f.$$typeof){case va:a:{for(var k= +f.key,l=d;null!==l;){if(l.key===k){k=f.type;if(k===ya){if(7===l.tag){c(a,l.sibling);d=e(l,f.props.children);d.return=a;a=d;break a}}else if(l.elementType===k||"object"===typeof k&&null!==k&&k.$$typeof===Ha&&uh(k)===l.type){c(a,l.sibling);d=e(l,f.props);d.ref=sh(a,l,f);d.return=a;a=d;break a}c(a,l);break}else b(a,l);l=l.sibling}f.type===ya?(d=Ah(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=yh(f.type,f.key,f.props,null,a.mode,h),h.ref=sh(a,d,f),h.return=a,a=h)}return g(a);case wa:a:{for(l=f.key;null!== +d;){if(d.key===l)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=zh(f,a.mode,h);d.return=a;a=d}return g(a);case Ha:return l=f._init,J(a,d,l(f._payload),h)}if(eb(f))return n(a,d,f,h);if(Ka(f))return t(a,d,f,h);th(a,f)}return"string"===typeof f&&""!==f||"number"===typeof f?(f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d): +(c(a,d),d=xh(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return J}var Bh=vh(!0),Ch=vh(!1),Dh={},Eh=Uf(Dh),Fh=Uf(Dh),Gh=Uf(Dh);function Hh(a){if(a===Dh)throw Error(p(174));return a}function Ih(a,b){G(Gh,b);G(Fh,a);G(Eh,Dh);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:lb(null,"");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=lb(b,a)}E(Eh);G(Eh,b)}function Jh(){E(Eh);E(Fh);E(Gh)} +function Kh(a){Hh(Gh.current);var b=Hh(Eh.current);var c=lb(b,a.type);b!==c&&(G(Fh,a),G(Eh,c))}function Lh(a){Fh.current===a&&(E(Eh),E(Fh))}var M=Uf(0); +function Mh(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||"$?"===c.data||"$!"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&128))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}var Nh=[]; +function Oh(){for(var a=0;ac?c:4;a(!0);var d=Qh.transition;Qh.transition={};try{a(!1),b()}finally{C=c,Qh.transition=d}}function Fi(){return di().memoizedState} +function Gi(a,b,c){var d=lh(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,c);else if(c=Yg(a,b,c,d),null!==c){var e=L();mh(c,a,d,e);Ji(c,b,d)}} +function ri(a,b,c){var d=lh(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(He(h,g)){var k=b.interleaved;null===k?(e.next=e,Xg(b)):(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(l){}finally{}c=Yg(a,b,e,d);null!==c&&(e=L(),mh(c,a,d,e),Ji(c,b,d))}} +function Hi(a){var b=a.alternate;return a===N||null!==b&&b===N}function Ii(a,b){Th=Sh=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function Ji(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}} +var ai={readContext:Vg,useCallback:Q,useContext:Q,useEffect:Q,useImperativeHandle:Q,useInsertionEffect:Q,useLayoutEffect:Q,useMemo:Q,useReducer:Q,useRef:Q,useState:Q,useDebugValue:Q,useDeferredValue:Q,useTransition:Q,useMutableSource:Q,useSyncExternalStore:Q,useId:Q,unstable_isNewReconciler:!1},Yh={readContext:Vg,useCallback:function(a,b){ci().memoizedState=[a,void 0===b?null:b];return a},useContext:Vg,useEffect:vi,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ti(4194308, +4,yi.bind(null,b,a),c)},useLayoutEffect:function(a,b){return ti(4194308,4,a,b)},useInsertionEffect:function(a,b){return ti(4,2,a,b)},useMemo:function(a,b){var c=ci();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=ci();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};d.queue=a;a=a.dispatch=Gi.bind(null,N,a);return[d.memoizedState,a]},useRef:function(a){var b= +ci();a={current:a};return b.memoizedState=a},useState:qi,useDebugValue:Ai,useDeferredValue:function(a){return ci().memoizedState=a},useTransition:function(){var a=qi(!1),b=a[0];a=Ei.bind(null,a[1]);ci().memoizedState=a;return[b,a]},useMutableSource:function(){},useSyncExternalStore:function(a,b,c){var d=N,e=ci();if(I){if(void 0===c)throw Error(p(407));c=c()}else{c=b();if(null===R)throw Error(p(349));0!==(Rh&30)||ni(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};e.queue=f;vi(ki.bind(null,d, +f,a),[a]);d.flags|=2048;li(9,mi.bind(null,d,f,c,b),void 0,null);return c},useId:function(){var a=ci(),b=R.identifierPrefix;if(I){var c=sg;var d=rg;c=(d&~(1<<32-oc(d)-1)).toString(32)+c;b=":"+b+"R"+c;c=Uh++;0\x3c/script>",a=a.removeChild(a.firstChild)): +"string"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),"select"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Of]=b;a[Pf]=d;Aj(a,b,!1,!1);b.stateNode=a;a:{g=vb(c,d);switch(c){case "dialog":D("cancel",a);D("close",a);e=d;break;case "iframe":case "object":case "embed":D("load",a);e=d;break;case "video":case "audio":for(e=0;eHj&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304)}else{if(!d)if(a=Mh(g),null!==a){if(b.flags|=128,d=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Ej(f,!0),null===f.tail&&"hidden"===f.tailMode&&!g.alternate&&!I)return S(b),null}else 2*B()-f.renderingStartTime>Hj&&1073741824!==c&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304);f.isBackwards?(g.sibling=b.child,b.child=g):(c=f.last,null!==c?c.sibling=g:b.child=g,f.last=g)}if(null!==f.tail)return b=f.tail,f.rendering= +b,f.tail=b.sibling,f.renderingStartTime=B(),b.sibling=null,c=M.current,G(M,d?c&1|2:c&1),b;S(b);return null;case 22:case 23:return Ij(),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!==(b.mode&1)?0!==(gj&1073741824)&&(S(b),b.subtreeFlags&6&&(b.flags|=8192)):S(b),null;case 24:return null;case 25:return null}throw Error(p(156,b.tag));} +function Jj(a,b){wg(b);switch(b.tag){case 1:return Zf(b.type)&&$f(),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return Jh(),E(Wf),E(H),Oh(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return Lh(b),null;case 13:E(M);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(p(340));Ig()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return E(M),null;case 4:return Jh(),null;case 10:return Rg(b.type._context),null;case 22:case 23:return Ij(), +null;case 24:return null;default:return null}}var Kj=!1,U=!1,Lj="function"===typeof WeakSet?WeakSet:Set,V=null;function Mj(a,b){var c=a.ref;if(null!==c)if("function"===typeof c)try{c(null)}catch(d){W(a,b,d)}else c.current=null}function Nj(a,b,c){try{c()}catch(d){W(a,b,d)}}var Oj=!1; +function Pj(a,b){Cf=dd;a=Me();if(Ne(a)){if("selectionStart"in a)var c={start:a.selectionStart,end:a.selectionEnd};else a:{c=(c=a.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();if(d&&0!==d.rangeCount){c=d.anchorNode;var e=d.anchorOffset,f=d.focusNode;d=d.focusOffset;try{c.nodeType,f.nodeType}catch(F){c=null;break a}var g=0,h=-1,k=-1,l=0,m=0,q=a,r=null;b:for(;;){for(var y;;){q!==c||0!==e&&3!==q.nodeType||(h=g+e);q!==f||0!==d&&3!==q.nodeType||(k=g+d);3===q.nodeType&&(g+= +q.nodeValue.length);if(null===(y=q.firstChild))break;r=q;q=y}for(;;){if(q===a)break b;r===c&&++l===e&&(h=g);r===f&&++m===d&&(k=g);if(null!==(y=q.nextSibling))break;q=r;r=q.parentNode}q=y}c=-1===h||-1===k?null:{start:h,end:k}}else c=null}c=c||{start:0,end:0}}else c=null;Df={focusedElem:a,selectionRange:c};dd=!1;for(V=b;null!==V;)if(b=V,a=b.child,0!==(b.subtreeFlags&1028)&&null!==a)a.return=b,V=a;else for(;null!==V;){b=V;try{var n=b.alternate;if(0!==(b.flags&1024))switch(b.tag){case 0:case 11:case 15:break; +case 1:if(null!==n){var t=n.memoizedProps,J=n.memoizedState,x=b.stateNode,w=x.getSnapshotBeforeUpdate(b.elementType===b.type?t:Lg(b.type,t),J);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var u=b.stateNode.containerInfo;1===u.nodeType?u.textContent="":9===u.nodeType&&u.documentElement&&u.removeChild(u.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163));}}catch(F){W(b,b.return,F)}a=b.sibling;if(null!==a){a.return=b.return;V=a;break}V=b.return}n=Oj;Oj=!1;return n} +function Qj(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&Nj(b,c,f)}e=e.next}while(e!==d)}}function Rj(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Sj(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=c;break;default:a=c}"function"===typeof b?b(a):b.current=a}} +function Tj(a){var b=a.alternate;null!==b&&(a.alternate=null,Tj(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&(delete b[Of],delete b[Pf],delete b[of],delete b[Qf],delete b[Rf]));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}function Uj(a){return 5===a.tag||3===a.tag||4===a.tag} +function Vj(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Uj(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}} +function Wj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=Bf));else if(4!==d&&(a=a.child,null!==a))for(Wj(a,b,c),a=a.sibling;null!==a;)Wj(a,b,c),a=a.sibling} +function Xj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(Xj(a,b,c),a=a.sibling;null!==a;)Xj(a,b,c),a=a.sibling}var X=null,Yj=!1;function Zj(a,b,c){for(c=c.child;null!==c;)ak(a,b,c),c=c.sibling} +function ak(a,b,c){if(lc&&"function"===typeof lc.onCommitFiberUnmount)try{lc.onCommitFiberUnmount(kc,c)}catch(h){}switch(c.tag){case 5:U||Mj(c,b);case 6:var d=X,e=Yj;X=null;Zj(a,b,c);X=d;Yj=e;null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?a.parentNode.removeChild(c):a.removeChild(c)):X.removeChild(c.stateNode));break;case 18:null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?Kf(a.parentNode,c):1===a.nodeType&&Kf(a,c),bd(a)):Kf(X,c.stateNode));break;case 4:d=X;e=Yj;X=c.stateNode.containerInfo;Yj=!0; +Zj(a,b,c);X=d;Yj=e;break;case 0:case 11:case 14:case 15:if(!U&&(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?Nj(c,b,g):0!==(f&4)&&Nj(c,b,g));e=e.next}while(e!==d)}Zj(a,b,c);break;case 1:if(!U&&(Mj(c,b),d=c.stateNode,"function"===typeof d.componentWillUnmount))try{d.props=c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){W(c,b,h)}Zj(a,b,c);break;case 21:Zj(a,b,c);break;case 22:c.mode&1?(U=(d=U)||null!== +c.memoizedState,Zj(a,b,c),U=d):Zj(a,b,c);break;default:Zj(a,b,c)}}function bk(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Lj);b.forEach(function(b){var d=ck.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}} +function dk(a,b){var c=b.deletions;if(null!==c)for(var d=0;de&&(e=g);d&=~f}d=e;d=B()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*mk(d/1960))-d;if(10a?16:a;if(null===xk)var d=!1;else{a=xk;xk=null;yk=0;if(0!==(K&6))throw Error(p(331));var e=K;K|=4;for(V=a.current;null!==V;){var f=V,g=f.child;if(0!==(V.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;kB()-gk?Lk(a,0):sk|=c);Ek(a,b)}function Zk(a,b){0===b&&(0===(a.mode&1)?b=1:(b=sc,sc<<=1,0===(sc&130023424)&&(sc=4194304)));var c=L();a=Zg(a,b);null!==a&&(Ac(a,b,c),Ek(a,c))}function vj(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);Zk(a,c)} +function ck(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane);break;case 19:d=a.stateNode;break;default:throw Error(p(314));}null!==d&&d.delete(b);Zk(a,c)}var Wk; +Wk=function(a,b,c){if(null!==a)if(a.memoizedProps!==b.pendingProps||Wf.current)Ug=!0;else{if(0===(a.lanes&c)&&0===(b.flags&128))return Ug=!1,zj(a,b,c);Ug=0!==(a.flags&131072)?!0:!1}else Ug=!1,I&&0!==(b.flags&1048576)&&ug(b,ng,b.index);b.lanes=0;switch(b.tag){case 2:var d=b.type;jj(a,b);a=b.pendingProps;var e=Yf(b,H.current);Tg(b,c);e=Xh(null,b,d,a,e,c);var f=bi();b.flags|=1;"object"===typeof e&&null!==e&&"function"===typeof e.render&&void 0===e.$$typeof?(b.tag=1,b.memoizedState=null,b.updateQueue= +null,Zf(d)?(f=!0,cg(b)):f=!1,b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,ah(b),e.updater=nh,b.stateNode=e,e._reactInternals=b,rh(b,d,a,c),b=kj(null,b,d,!0,f,c)):(b.tag=0,I&&f&&vg(b),Yi(null,b,e,c),b=b.child);return b;case 16:d=b.elementType;a:{jj(a,b);a=b.pendingProps;e=d._init;d=e(d._payload);b.type=d;e=b.tag=$k(d);a=Lg(d,a);switch(e){case 0:b=dj(null,b,d,a,c);break a;case 1:b=ij(null,b,d,a,c);break a;case 11:b=Zi(null,b,d,a,c);break a;case 14:b=aj(null,b,d,Lg(d.type,a),c);break a}throw Error(p(306, +d,""));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),dj(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),ij(a,b,d,e,c);case 3:a:{lj(b);if(null===a)throw Error(p(387));d=b.pendingProps;f=b.memoizedState;e=f.element;bh(a,b);gh(b,d,null,c);var g=b.memoizedState;d=g.element;if(f.isDehydrated)if(f={element:d,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},b.updateQueue.baseState= +f,b.memoizedState=f,b.flags&256){e=Ki(Error(p(423)),b);b=mj(a,b,d,c,e);break a}else if(d!==e){e=Ki(Error(p(424)),b);b=mj(a,b,d,c,e);break a}else for(yg=Lf(b.stateNode.containerInfo.firstChild),xg=b,I=!0,zg=null,c=Ch(b,null,d,c),b.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{Ig();if(d===e){b=$i(a,b,c);break a}Yi(a,b,d,c)}b=b.child}return b;case 5:return Kh(b),null===a&&Eg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Ef(d,e)?g=null:null!==f&&Ef(d,f)&&(b.flags|=32), +hj(a,b),Yi(a,b,g,c),b.child;case 6:return null===a&&Eg(b),null;case 13:return pj(a,b,c);case 4:return Ih(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Bh(b,null,d,c):Yi(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),Zi(a,b,d,e,c);case 7:return Yi(a,b,b.pendingProps,c),b.child;case 8:return Yi(a,b,b.pendingProps.children,c),b.child;case 12:return Yi(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;f=b.memoizedProps; +g=e.value;G(Mg,d._currentValue);d._currentValue=g;if(null!==f)if(He(f.value,g)){if(f.children===e.children&&!Wf.current){b=$i(a,b,c);break a}}else for(f=b.child,null!==f&&(f.return=b);null!==f;){var h=f.dependencies;if(null!==h){g=f.child;for(var k=h.firstContext;null!==k;){if(k.context===d){if(1===f.tag){k=ch(-1,c&-c);k.tag=2;var l=f.updateQueue;if(null!==l){l=l.shared;var m=l.pending;null===m?k.next=k:(k.next=m.next,m.next=k);l.pending=k}}f.lanes|=c;k=f.alternate;null!==k&&(k.lanes|=c);Sg(f.return, +c,b);h.lanes|=c;break}k=k.next}}else if(10===f.tag)g=f.type===b.type?null:f.child;else if(18===f.tag){g=f.return;if(null===g)throw Error(p(341));g.lanes|=c;h=g.alternate;null!==h&&(h.lanes|=c);Sg(g,c,b);g=f.sibling}else g=f.child;if(null!==g)g.return=f;else for(g=f;null!==g;){if(g===b){g=null;break}f=g.sibling;if(null!==f){f.return=g.return;g=f;break}g=g.return}f=g}Yi(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,d=b.pendingProps.children,Tg(b,c),e=Vg(e),d=d(e),b.flags|=1,Yi(a,b,d,c), +b.child;case 14:return d=b.type,e=Lg(d,b.pendingProps),e=Lg(d.type,e),aj(a,b,d,e,c);case 15:return cj(a,b,b.type,b.pendingProps,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),jj(a,b),b.tag=1,Zf(d)?(a=!0,cg(b)):a=!1,Tg(b,c),ph(b,d,e),rh(b,d,e,c),kj(null,b,d,!0,a,c);case 19:return yj(a,b,c);case 22:return ej(a,b,c)}throw Error(p(156,b.tag));};function Gk(a,b){return ac(a,b)} +function al(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function Bg(a,b,c,d){return new al(a,b,c,d)}function bj(a){a=a.prototype;return!(!a||!a.isReactComponent)} +function $k(a){if("function"===typeof a)return bj(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Da)return 11;if(a===Ga)return 14}return 2} +function wh(a,b){var c=a.alternate;null===c?(c=Bg(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext}; +c.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c} +function yh(a,b,c,d,e,f){var g=2;d=a;if("function"===typeof a)bj(a)&&(g=1);else if("string"===typeof a)g=5;else a:switch(a){case ya:return Ah(c.children,e,f,b);case za:g=8;e|=8;break;case Aa:return a=Bg(12,c,b,e|2),a.elementType=Aa,a.lanes=f,a;case Ea:return a=Bg(13,c,b,e),a.elementType=Ea,a.lanes=f,a;case Fa:return a=Bg(19,c,b,e),a.elementType=Fa,a.lanes=f,a;case Ia:return qj(c,e,f,b);default:if("object"===typeof a&&null!==a)switch(a.$$typeof){case Ba:g=10;break a;case Ca:g=9;break a;case Da:g=11; +break a;case Ga:g=14;break a;case Ha:g=16;d=null;break a}throw Error(p(130,null==a?a:typeof a,""));}b=Bg(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function Ah(a,b,c,d){a=Bg(7,a,d,b);a.lanes=c;return a}function qj(a,b,c,d){a=Bg(22,a,d,b);a.elementType=Ia;a.lanes=c;a.stateNode={isHidden:!1};return a}function xh(a,b,c){a=Bg(6,a,null,b);a.lanes=c;return a} +function zh(a,b,c){b=Bg(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b} +function bl(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=0;this.eventTimes=zc(0);this.expirationTimes=zc(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=zc(0);this.identifierPrefix=d;this.onRecoverableError=e;this.mutableSourceEagerHydrationData= +null}function cl(a,b,c,d,e,f,g,h,k){a=new bl(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=Bg(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null};ah(f);return a}function dl(a,b,c){var d=3>>1,e=a[d];if(0>>1;dg(C,c))ng(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(ng(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b} +function g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if("object"===typeof performance&&"function"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D="function"===typeof setTimeout?setTimeout:null,E="function"===typeof clearTimeout?clearTimeout:null,F="undefined"!==typeof setImmediate?setImmediate:null; +"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}} +function J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if("function"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();"function"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1; +function M(){return exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a}; +exports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}}; + + +/***/ }), + +/***/ 5655: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +if (true) { + module.exports = __webpack_require__(2197); +} else {} + + +/***/ }) + +}]); \ No newline at end of file diff --git a/crates/swc_ecma_minifier/tests/fixture/next/raw/static/chunks/main-6dc4d57ec5ea64ec/input.js b/crates/swc_ecma_minifier/tests/fixture/next/raw/static/chunks/main-6dc4d57ec5ea64ec/input.js new file mode 100644 index 000000000000..1b96537bda2d --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/next/raw/static/chunks/main-6dc4d57ec5ea64ec/input.js @@ -0,0 +1,6783 @@ +(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[179],{ + +/***/ 7637: +/***/ (function() { + +"trimStart"in String.prototype||(String.prototype.trimStart=String.prototype.trimLeft),"trimEnd"in String.prototype||(String.prototype.trimEnd=String.prototype.trimRight),"description"in Symbol.prototype||Object.defineProperty(Symbol.prototype,"description",{configurable:!0,get:function(){var t=/\((.*)\)/.exec(this.toString());return t?t[1]:void 0}}),Array.prototype.flat||(Array.prototype.flat=function(t,r){return r=this.concat.apply([],this),t>1&&r.some(Array.isArray)?r.flat(t-1):r},Array.prototype.flatMap=function(t,r){return this.map(t,r).flat()}),Promise.prototype.finally||(Promise.prototype.finally=function(t){if("function"!=typeof t)return this.then(t,t);var r=this.constructor||Promise;return this.then(function(o){return r.resolve(t()).then(function(){return o})},function(o){return r.resolve(t()).then(function(){throw o})})}),Object.fromEntries||(Object.fromEntries=function(t){return Array.from(t).reduce(function(t,r){return t[r[0]]=r[1],t},{})}); + + +/***/ }), + +/***/ 5642: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "addBasePath", ({ + enumerable: true, + get: function() { + return addBasePath; + } +})); +const _addpathprefix = __webpack_require__(1706); +const _normalizetrailingslash = __webpack_require__(1989); +const basePath = false || ""; +function addBasePath(path, required) { + return (0, _normalizetrailingslash.normalizePathTrailingSlash)( false ? 0 : (0, _addpathprefix.addPathPrefix)(path, basePath)); +} +if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { + Object.defineProperty(exports.default, "__esModule", { + value: true + }); + Object.assign(exports.default, exports); + module.exports = exports.default; +} //# sourceMappingURL=add-base-path.js.map + + +/***/ }), + +/***/ 5467: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "addLocale", ({ + enumerable: true, + get: function() { + return addLocale; + } +})); +const _normalizetrailingslash = __webpack_require__(1989); +const addLocale = function(path) { + for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){ + args[_key - 1] = arguments[_key]; + } + if (false) {} + return path; +}; +if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { + Object.defineProperty(exports.default, "__esModule", { + value: true + }); + Object.assign(exports.default, exports); + module.exports = exports.default; +} //# sourceMappingURL=add-locale.js.map + + +/***/ }), + +/***/ 8671: +/***/ (function(module, exports) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "detectDomainLocale", ({ + enumerable: true, + get: function() { + return detectDomainLocale; + } +})); +const detectDomainLocale = function() { + for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ + args[_key] = arguments[_key]; + } + if (false) {} +}; +if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { + Object.defineProperty(exports.default, "__esModule", { + value: true + }); + Object.assign(exports.default, exports); + module.exports = exports.default; +} //# sourceMappingURL=detect-domain-locale.js.map + + +/***/ }), + +/***/ 9374: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "hasBasePath", ({ + enumerable: true, + get: function() { + return hasBasePath; + } +})); +const _pathhasprefix = __webpack_require__(1679); +const basePath = false || ""; +function hasBasePath(path) { + return (0, _pathhasprefix.pathHasPrefix)(path, basePath); +} +if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { + Object.defineProperty(exports.default, "__esModule", { + value: true + }); + Object.assign(exports.default, exports); + module.exports = exports.default; +} //# sourceMappingURL=has-base-path.js.map + + +/***/ }), + +/***/ 5867: +/***/ (function(module, exports) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +0 && (0); +function _export(target, all) { + for(var name in all)Object.defineProperty(target, name, { + enumerable: true, + get: all[name] + }); +} +_export(exports, { + DOMAttributeNames: function() { + return DOMAttributeNames; + }, + isEqualNode: function() { + return isEqualNode; + }, + default: function() { + return initHeadManager; + } +}); +const DOMAttributeNames = { + acceptCharset: "accept-charset", + className: "class", + htmlFor: "for", + httpEquiv: "http-equiv", + noModule: "noModule" +}; +function reactElementToDOM(param) { + let { type, props } = param; + const el = document.createElement(type); + for(const p in props){ + if (!props.hasOwnProperty(p)) continue; + if (p === "children" || p === "dangerouslySetInnerHTML") continue; + // we don't render undefined props to the DOM + if (props[p] === undefined) continue; + const attr = DOMAttributeNames[p] || p.toLowerCase(); + if (type === "script" && (attr === "async" || attr === "defer" || attr === "noModule")) { + el[attr] = !!props[p]; + } else { + el.setAttribute(attr, props[p]); + } + } + const { children, dangerouslySetInnerHTML } = props; + if (dangerouslySetInnerHTML) { + el.innerHTML = dangerouslySetInnerHTML.__html || ""; + } else if (children) { + el.textContent = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : ""; + } + return el; +} +function isEqualNode(oldTag, newTag) { + if (oldTag instanceof HTMLElement && newTag instanceof HTMLElement) { + const nonce = newTag.getAttribute("nonce"); + // Only strip the nonce if `oldTag` has had it stripped. An element's nonce attribute will not + // be stripped if there is no content security policy response header that includes a nonce. + if (nonce && !oldTag.getAttribute("nonce")) { + const cloneTag = newTag.cloneNode(true); + cloneTag.setAttribute("nonce", ""); + cloneTag.nonce = nonce; + return nonce === oldTag.nonce && oldTag.isEqualNode(cloneTag); + } + } + return oldTag.isEqualNode(newTag); +} +let updateElements; +if (false) {} else { + updateElements = (type, components)=>{ + const headEl = document.getElementsByTagName("head")[0]; + const headCountEl = headEl.querySelector("meta[name=next-head-count]"); + if (false) {} + const headCount = Number(headCountEl.content); + const oldTags = []; + for(let i = 0, j = headCountEl.previousElementSibling; i < headCount; i++, j = (j == null ? void 0 : j.previousElementSibling) || null){ + var _j_tagName; + if ((j == null ? void 0 : (_j_tagName = j.tagName) == null ? void 0 : _j_tagName.toLowerCase()) === type) { + oldTags.push(j); + } + } + const newTags = components.map(reactElementToDOM).filter((newTag)=>{ + for(let k = 0, len = oldTags.length; k < len; k++){ + const oldTag = oldTags[k]; + if (isEqualNode(oldTag, newTag)) { + oldTags.splice(k, 1); + return false; + } + } + return true; + }); + oldTags.forEach((t)=>{ + var _t_parentNode; + return (_t_parentNode = t.parentNode) == null ? void 0 : _t_parentNode.removeChild(t); + }); + newTags.forEach((t)=>headEl.insertBefore(t, headCountEl)); + headCountEl.content = (headCount - oldTags.length + newTags.length).toString(); + }; +} +function initHeadManager() { + return { + mountedInstances: new Set(), + updateHead: (head)=>{ + const tags = {}; + head.forEach((h)=>{ + if (// it won't be inlined. In this case revert to the original behavior + h.type === "link" && h.props["data-optimized-fonts"]) { + if (document.querySelector('style[data-href="' + h.props["data-href"] + '"]')) { + return; + } else { + h.props.href = h.props["data-href"]; + h.props["data-href"] = undefined; + } + } + const components = tags[h.type] || []; + components.push(h); + tags[h.type] = components; + }); + const titleComponent = tags.title ? tags.title[0] : null; + let title = ""; + if (titleComponent) { + const { children } = titleComponent.props; + title = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : ""; + } + if (title !== document.title) document.title = title; + [ + "meta", + "base", + "link", + "style", + "script" + ].forEach((type)=>{ + updateElements(type, tags[type] || []); + }); + } + }; +} +if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { + Object.defineProperty(exports.default, "__esModule", { + value: true + }); + Object.assign(exports.default, exports); + module.exports = exports.default; +} //# sourceMappingURL=head-manager.js.map + + +/***/ }), + +/***/ 3558: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* global location */ +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +const _interop_require_wildcard = __webpack_require__(9805); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +0 && (0); +function _export(target, all) { + for(var name in all)Object.defineProperty(target, name, { + enumerable: true, + get: all[name] + }); +} +_export(exports, { + version: function() { + return version; + }, + router: function() { + return router; + }, + emitter: function() { + return emitter; + }, + initialize: function() { + return initialize; + }, + hydrate: function() { + return hydrate; + } +}); +const _interop_require_default = __webpack_require__(5); +__webpack_require__(7637); +const _react = /*#__PURE__*/ _interop_require_default._(__webpack_require__(2983)); +const _client = /*#__PURE__*/ _interop_require_default._(__webpack_require__(8520)); +const _headmanagercontext = __webpack_require__(7504); +const _mitt = /*#__PURE__*/ _interop_require_default._(__webpack_require__(8861)); +const _routercontext = __webpack_require__(8597); +const _handlesmoothscroll = __webpack_require__(2343); +const _isdynamic = __webpack_require__(7421); +const _querystring = __webpack_require__(2457); +const _runtimeconfig = __webpack_require__(4120); +const _utils = __webpack_require__(987); +const _portal = __webpack_require__(7820); +const _headmanager = /*#__PURE__*/ _interop_require_default._(__webpack_require__(5867)); +const _pageloader = /*#__PURE__*/ _interop_require_default._(__webpack_require__(8237)); +const _performancerelayer = /*#__PURE__*/ _interop_require_default._(__webpack_require__(5883)); +const _routeannouncer = __webpack_require__(8768); +const _router = __webpack_require__(7229); +const _iserror = __webpack_require__(1742); +const _imageconfigcontext = __webpack_require__(3805); +const _removebasepath = __webpack_require__(6493); +const _hasbasepath = __webpack_require__(9374); +const _approutercontext = __webpack_require__(9797); +const _adapters = __webpack_require__(5002); +const _hooksclientcontext = __webpack_require__(8749); +const _onrecoverableerror = /*#__PURE__*/ _interop_require_default._(__webpack_require__(4951)); +const addChunkSuffix = (getOriginalChunk)=>(chunkId)=>{ + return getOriginalChunk(chunkId) + ("" + ( false ? 0 : "")); + }; +// ensure dynamic imports have deployment id added if enabled +const getChunkScriptFilename = __webpack_require__.u; +// eslint-disable-next-line no-undef +__webpack_require__.u = addChunkSuffix(getChunkScriptFilename); +// eslint-disable-next-line no-undef +const getChunkCssFilename = __webpack_require__.k; +// eslint-disable-next-line no-undef +__webpack_require__.k = addChunkSuffix(getChunkCssFilename); +// eslint-disable-next-line no-undef +const getMiniCssFilename = __webpack_require__.miniCssF; +// eslint-disable-next-line no-undef +__webpack_require__.miniCssF = addChunkSuffix(getMiniCssFilename); +const version = "13.4.8-canary.14"; +let router; +const emitter = (0, _mitt.default)(); +const looseToArray = (input)=>[].slice.call(input); +let initialData; +let defaultLocale = undefined; +let asPath; +let pageLoader; +let appElement; +let headManager; +let initialMatchesMiddleware = false; +let lastAppProps; +let lastRenderReject; +let webpackHMR; +let CachedApp, onPerfEntry; +let CachedComponent; +self.__next_require__ = __webpack_require__; +class Container extends _react.default.Component { + componentDidCatch(componentErr, info) { + this.props.fn(componentErr, info); + } + componentDidMount() { + this.scrollToHash(); + // We need to replace the router state if: + // - the page was (auto) exported and has a query string or search (hash) + // - it was auto exported and is a dynamic route (to provide params) + // - if it is a client-side skeleton (fallback render) + // - if middleware matches the current page (may have rewrite params) + // - if rewrites in next.config.js match (may have rewrite params) + if (router.isSsr && (initialData.isFallback || initialData.nextExport && ((0, _isdynamic.isDynamicRoute)(router.pathname) || location.search || false || initialMatchesMiddleware) || initialData.props && initialData.props.__N_SSG && (location.search || false || initialMatchesMiddleware))) { + // update query on mount for exported pages + router.replace(router.pathname + "?" + String((0, _querystring.assign)((0, _querystring.urlQueryToSearchParams)(router.query), new URLSearchParams(location.search))), asPath, { + // @ts-ignore + // WARNING: `_h` is an internal option for handing Next.js + // client-side hydration. Your app should _never_ use this property. + // It may change at any time without notice. + _h: 1, + // Fallback pages must trigger the data fetch, so the transition is + // not shallow. + // Other pages (strictly updating query) happens shallowly, as data + // requirements would already be present. + shallow: !initialData.isFallback && !initialMatchesMiddleware + }).catch((err)=>{ + if (!err.cancelled) throw err; + }); + } + } + componentDidUpdate() { + this.scrollToHash(); + } + scrollToHash() { + let { hash } = location; + hash = hash && hash.substring(1); + if (!hash) return; + const el = document.getElementById(hash); + if (!el) return; + // If we call scrollIntoView() in here without a setTimeout + // it won't scroll properly. + setTimeout(()=>el.scrollIntoView(), 0); + } + render() { + if (true) { + return this.props.children; + } else {} + } +} +async function initialize(opts) { + if (opts === void 0) opts = {}; + // This makes sure this specific lines are removed in production + if (false) {} + initialData = JSON.parse(document.getElementById("__NEXT_DATA__").textContent); + window.__NEXT_DATA__ = initialData; + defaultLocale = initialData.defaultLocale; + const prefix = initialData.assetPrefix || ""; + // With dynamic assetPrefix it's no longer possible to set assetPrefix at the build time + // So, this is how we do it in the client side at runtime + __webpack_require__.p = "" + prefix + "/_next/" //eslint-disable-line + ; + // Initialize next/config with the environment configuration + (0, _runtimeconfig.setConfig)({ + serverRuntimeConfig: {}, + publicRuntimeConfig: initialData.runtimeConfig || {} + }); + asPath = (0, _utils.getURL)(); + // make sure not to attempt stripping basePath for 404s + if ((0, _hasbasepath.hasBasePath)(asPath)) { + asPath = (0, _removebasepath.removeBasePath)(asPath); + } + if (false) {} + if (initialData.scriptLoader) { + const { initScriptLoader } = __webpack_require__(5178); + initScriptLoader(initialData.scriptLoader); + } + pageLoader = new _pageloader.default(initialData.buildId, prefix); + const register = (param)=>{ + let [r, f] = param; + return pageLoader.routeLoader.onEntrypoint(r, f); + }; + if (window.__NEXT_P) { + // Defer page registration for another tick. This will increase the overall + // latency in hydrating the page, but reduce the total blocking time. + window.__NEXT_P.map((p)=>setTimeout(()=>register(p), 0)); + } + window.__NEXT_P = []; + window.__NEXT_P.push = register; + headManager = (0, _headmanager.default)(); + headManager.getIsSsr = ()=>{ + return router.isSsr; + }; + appElement = document.getElementById("__next"); + return { + assetPrefix: prefix + }; +} +function renderApp(App, appProps) { + return /*#__PURE__*/ _react.default.createElement(App, appProps); +} +function AppContainer(param) { + let { children } = param; + var _self___NEXT_DATA___autoExport; + return /*#__PURE__*/ _react.default.createElement(Container, { + fn: (error)=>// eslint-disable-next-line @typescript-eslint/no-use-before-define + renderError({ + App: CachedApp, + err: error + }).catch((err)=>console.error("Error rendering page: ", err)) + }, /*#__PURE__*/ _react.default.createElement(_approutercontext.AppRouterContext.Provider, { + value: (0, _adapters.adaptForAppRouterInstance)(router) + }, /*#__PURE__*/ _react.default.createElement(_hooksclientcontext.SearchParamsContext.Provider, { + value: (0, _adapters.adaptForSearchParams)(router) + }, /*#__PURE__*/ _react.default.createElement(_adapters.PathnameContextProviderAdapter, { + router: router, + isAutoExport: (_self___NEXT_DATA___autoExport = self.__NEXT_DATA__.autoExport) != null ? _self___NEXT_DATA___autoExport : false + }, /*#__PURE__*/ _react.default.createElement(_routercontext.RouterContext.Provider, { + value: (0, _router.makePublicRouterInstance)(router) + }, /*#__PURE__*/ _react.default.createElement(_headmanagercontext.HeadManagerContext.Provider, { + value: headManager + }, /*#__PURE__*/ _react.default.createElement(_imageconfigcontext.ImageConfigContext.Provider, { + value: {"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[16,32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","dangerouslyAllowSVG":false,"unoptimized":false} + }, children))))))); +} +const wrapApp = (App)=>(wrappedAppProps)=>{ + const appProps = { + ...wrappedAppProps, + Component: CachedComponent, + err: initialData.err, + router + }; + return /*#__PURE__*/ _react.default.createElement(AppContainer, null, renderApp(App, appProps)); + }; +// This method handles all runtime and debug errors. +// 404 and 500 errors are special kind of errors +// and they are still handle via the main render method. +function renderError(renderErrorProps) { + let { App, err } = renderErrorProps; + // In development runtime errors are caught by our overlay + // In production we catch runtime errors using componentDidCatch which will trigger renderError + if (false) {} + // Make sure we log the error to the console, otherwise users can't track down issues. + console.error(err); + console.error("A client-side exception has occurred, see here for more info: https://nextjs.org/docs/messages/client-side-exception-occurred"); + return pageLoader.loadPage("/_error").then((param)=>{ + let { page: ErrorComponent, styleSheets } = param; + return (lastAppProps == null ? void 0 : lastAppProps.Component) === ErrorComponent ? Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard._(__webpack_require__(100))).then((errorModule)=>{ + return Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard._(__webpack_require__(1002))).then((appModule)=>{ + App = appModule.default; + renderErrorProps.App = App; + return errorModule; + }); + }).then((m)=>({ + ErrorComponent: m.default, + styleSheets: [] + })) : { + ErrorComponent, + styleSheets + }; + }).then((param)=>{ + let { ErrorComponent, styleSheets } = param; + var _renderErrorProps_props; + // In production we do a normal render with the `ErrorComponent` as component. + // If we've gotten here upon initial render, we can use the props from the server. + // Otherwise, we need to call `getInitialProps` on `App` before mounting. + const AppTree = wrapApp(App); + const appCtx = { + Component: ErrorComponent, + AppTree, + router, + ctx: { + err, + pathname: initialData.page, + query: initialData.query, + asPath, + AppTree + } + }; + return Promise.resolve(((_renderErrorProps_props = renderErrorProps.props) == null ? void 0 : _renderErrorProps_props.err) ? renderErrorProps.props : (0, _utils.loadGetInitialProps)(App, appCtx)).then((initProps)=>// eslint-disable-next-line @typescript-eslint/no-use-before-define + doRender({ + ...renderErrorProps, + err, + Component: ErrorComponent, + styleSheets, + props: initProps + })); + }); +} +// Dummy component that we render as a child of Root so that we can +// toggle the correct styles before the page is rendered. +function Head(param) { + let { callback } = param; + // We use `useLayoutEffect` to guarantee the callback is executed + // as soon as React flushes the update. + _react.default.useLayoutEffect(()=>callback(), [ + callback + ]); + return null; +} +let reactRoot = null; +// On initial render a hydrate should always happen +let shouldHydrate = true; +function clearMarks() { + [ + "beforeRender", + "afterHydrate", + "afterRender", + "routeChange" + ].forEach((mark)=>performance.clearMarks(mark)); +} +function markHydrateComplete() { + if (!_utils.ST) return; + performance.mark("afterHydrate") // mark end of hydration + ; + performance.measure("Next.js-before-hydration", "navigationStart", "beforeRender"); + performance.measure("Next.js-hydration", "beforeRender", "afterHydrate"); + if (onPerfEntry) { + performance.getEntriesByName("Next.js-hydration").forEach(onPerfEntry); + } + clearMarks(); +} +function markRenderComplete() { + if (!_utils.ST) return; + performance.mark("afterRender") // mark end of render + ; + const navStartEntries = performance.getEntriesByName("routeChange", "mark"); + if (!navStartEntries.length) return; + performance.measure("Next.js-route-change-to-render", navStartEntries[0].name, "beforeRender"); + performance.measure("Next.js-render", "beforeRender", "afterRender"); + if (onPerfEntry) { + performance.getEntriesByName("Next.js-render").forEach(onPerfEntry); + performance.getEntriesByName("Next.js-route-change-to-render").forEach(onPerfEntry); + } + clearMarks(); + [ + "Next.js-route-change-to-render", + "Next.js-render" + ].forEach((measure)=>performance.clearMeasures(measure)); +} +function renderReactElement(domEl, fn) { + // mark start of hydrate/render + if (_utils.ST) { + performance.mark("beforeRender"); + } + const reactEl = fn(shouldHydrate ? markHydrateComplete : markRenderComplete); + if (!reactRoot) { + // Unlike with createRoot, you don't need a separate root.render() call here + reactRoot = _client.default.hydrateRoot(domEl, reactEl, { + onRecoverableError: _onrecoverableerror.default + }); + // TODO: Remove shouldHydrate variable when React 18 is stable as it can depend on `reactRoot` existing + shouldHydrate = false; + } else { + const startTransition = _react.default.startTransition; + startTransition(()=>{ + reactRoot.render(reactEl); + }); + } +} +function Root(param) { + let { callbacks, children } = param; + // We use `useLayoutEffect` to guarantee the callbacks are executed + // as soon as React flushes the update + _react.default.useLayoutEffect(()=>callbacks.forEach((callback)=>callback()), [ + callbacks + ]); + // We should ask to measure the Web Vitals after rendering completes so we + // don't cause any hydration delay: + _react.default.useEffect(()=>{ + (0, _performancerelayer.default)(onPerfEntry); + }, []); + if (false) {} + return children; +} +function doRender(input) { + let { App, Component, props, err } = input; + let styleSheets = "initial" in input ? undefined : input.styleSheets; + Component = Component || lastAppProps.Component; + props = props || lastAppProps.props; + const appProps = { + ...props, + Component, + err, + router + }; + // lastAppProps has to be set before ReactDom.render to account for ReactDom throwing an error. + lastAppProps = appProps; + let canceled = false; + let resolvePromise; + const renderPromise = new Promise((resolve, reject)=>{ + if (lastRenderReject) { + lastRenderReject(); + } + resolvePromise = ()=>{ + lastRenderReject = null; + resolve(); + }; + lastRenderReject = ()=>{ + canceled = true; + lastRenderReject = null; + const error = new Error("Cancel rendering route"); + error.cancelled = true; + reject(error); + }; + }); + // This function has a return type to ensure it doesn't start returning a + // Promise. It should remain synchronous. + function onStart() { + if (!styleSheets || // We use `style-loader` in development, so we don't need to do anything + // unless we're in production: + "production" !== "production") { + return false; + } + const currentStyleTags = looseToArray(document.querySelectorAll("style[data-n-href]")); + const currentHrefs = new Set(currentStyleTags.map((tag)=>tag.getAttribute("data-n-href"))); + const noscript = document.querySelector("noscript[data-n-css]"); + const nonce = noscript == null ? void 0 : noscript.getAttribute("data-n-css"); + styleSheets.forEach((param)=>{ + let { href, text } = param; + if (!currentHrefs.has(href)) { + const styleTag = document.createElement("style"); + styleTag.setAttribute("data-n-href", href); + styleTag.setAttribute("media", "x"); + if (nonce) { + styleTag.setAttribute("nonce", nonce); + } + document.head.appendChild(styleTag); + styleTag.appendChild(document.createTextNode(text)); + } + }); + return true; + } + function onHeadCommit() { + if (// unless we're in production: + true && // We can skip this during hydration. Running it wont cause any harm, but + // we may as well save the CPU cycles: + styleSheets && // Ensure this render was not canceled + !canceled) { + const desiredHrefs = new Set(styleSheets.map((s)=>s.href)); + const currentStyleTags = looseToArray(document.querySelectorAll("style[data-n-href]")); + const currentHrefs = currentStyleTags.map((tag)=>tag.getAttribute("data-n-href")); + // Toggle `