/
verifier.js
1 lines (1 loc) · 421 KB
/
verifier.js
1
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var commonjsGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var _global=createCommonjsModule(function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)}),hasOwnProperty={}.hasOwnProperty,_has=function(e,t){return hasOwnProperty.call(e,t)},_fails=function(e){try{return!!e()}catch(e){return!0}},_descriptors=!_fails(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),_core=createCommonjsModule(function(e){var t=e.exports={version:"2.5.3"};"number"==typeof __e&&(__e=t)}),_core_1=_core.version,_isObject=function(e){return"object"==typeof e?null!==e:"function"==typeof e},_anObject=function(e){if(!_isObject(e))throw TypeError(e+" is not an object!");return e},document$1=_global.document,is=_isObject(document$1)&&_isObject(document$1.createElement),_domCreate=function(e){return is?document$1.createElement(e):{}},_ie8DomDefine=!_descriptors&&!_fails(function(){return 7!=Object.defineProperty(_domCreate("div"),"a",{get:function(){return 7}}).a}),_toPrimitive=function(e,t){if(!_isObject(e))return e;var r,n;if(t&&"function"==typeof(r=e.toString)&&!_isObject(n=r.call(e)))return n;if("function"==typeof(r=e.valueOf)&&!_isObject(n=r.call(e)))return n;if(!t&&"function"==typeof(r=e.toString)&&!_isObject(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")},dP=Object.defineProperty,f=_descriptors?Object.defineProperty:function(e,t,r){if(_anObject(e),t=_toPrimitive(t,!0),_anObject(r),_ie8DomDefine)try{return dP(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e},_objectDp={f:f},_propertyDesc=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},_hide=_descriptors?function(e,t,r){return _objectDp.f(e,t,_propertyDesc(1,r))}:function(e,t,r){return e[t]=r,e},id=0,px=Math.random(),_uid=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++id+px).toString(36))},_redefine=createCommonjsModule(function(e){var t=_uid("src"),r=Function.toString,n=(""+r).split("toString");_core.inspectSource=function(e){return r.call(e)},(e.exports=function(e,r,i,o){var a="function"==typeof i;a&&(_has(i,"name")||_hide(i,"name",r)),e[r]!==i&&(a&&(_has(i,t)||_hide(i,t,e[r]?""+e[r]:n.join(String(r)))),e===_global?e[r]=i:o?e[r]?e[r]=i:_hide(e,r,i):(delete e[r],_hide(e,r,i)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[t]||r.call(this)})}),_aFunction=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},_ctx=function(e,t,r){if(_aFunction(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}},PROTOTYPE="prototype",$export=function(e,t,r){var n,i,o,a,s=e&$export.F,u=e&$export.G,c=e&$export.S,f=e&$export.P,l=e&$export.B,h=u?_global:c?_global[t]||(_global[t]={}):(_global[t]||{})[PROTOTYPE],p=u?_core:_core[t]||(_core[t]={}),d=p[PROTOTYPE]||(p[PROTOTYPE]={});for(n in u&&(r=t),r)o=((i=!s&&h&&void 0!==h[n])?h:r)[n],a=l&&i?_ctx(o,_global):f&&"function"==typeof o?_ctx(Function.call,o):o,h&&_redefine(h,n,o,e&$export.U),p[n]!=o&&_hide(p,n,a),f&&d[n]!=o&&(d[n]=o)};_global.core=_core,$export.F=1,$export.G=2,$export.S=4,$export.P=8,$export.B=16,$export.W=32,$export.U=64,$export.R=128;var _export=$export,_meta=createCommonjsModule(function(e){var t=_uid("meta"),r=_objectDp.f,n=0,i=Object.isExtensible||function(){return!0},o=!_fails(function(){return i(Object.preventExtensions({}))}),a=function(e){r(e,t,{value:{i:"O"+ ++n,w:{}}})},s=e.exports={KEY:t,NEED:!1,fastKey:function(e,r){if(!_isObject(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!_has(e,t)){if(!i(e))return"F";if(!r)return"E";a(e)}return e[t].i},getWeak:function(e,r){if(!_has(e,t)){if(!i(e))return!0;if(!r)return!1;a(e)}return e[t].w},onFreeze:function(e){return o&&s.NEED&&i(e)&&!_has(e,t)&&a(e),e}}}),_meta_1=_meta.KEY,_meta_2=_meta.NEED,_meta_3=_meta.fastKey,_meta_4=_meta.getWeak,_meta_5=_meta.onFreeze,SHARED="__core-js_shared__",store=_global[SHARED]||(_global[SHARED]={}),_shared=function(e){return store[e]||(store[e]={})},_wks=createCommonjsModule(function(e){var t=_shared("wks"),r=_global.Symbol,n="function"==typeof r;(e.exports=function(e){return t[e]||(t[e]=n&&r[e]||(n?r:_uid)("Symbol."+e))}).store=t}),def=_objectDp.f,TAG=_wks("toStringTag"),_setToStringTag=function(e,t,r){e&&!_has(e=r?e:e.prototype,TAG)&&def(e,TAG,{configurable:!0,value:t})},f$1=_wks,_wksExt={f:f$1},_library=!1,defineProperty=_objectDp.f,_wksDefine=function(e){var t=_core.Symbol||(_core.Symbol=_library?{}:_global.Symbol||{});"_"==e.charAt(0)||e in t||defineProperty(t,e,{value:_wksExt.f(e)})},toString={}.toString,_cof=function(e){return toString.call(e).slice(8,-1)},_iobject=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==_cof(e)?e.split(""):Object(e)},_defined=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},_toIobject=function(e){return _iobject(_defined(e))},ceil=Math.ceil,floor=Math.floor,_toInteger=function(e){return isNaN(e=+e)?0:(e>0?floor:ceil)(e)},min=Math.min,_toLength=function(e){return e>0?min(_toInteger(e),9007199254740991):0},max=Math.max,min$1=Math.min,_toAbsoluteIndex=function(e,t){return(e=_toInteger(e))<0?max(e+t,0):min$1(e,t)},_arrayIncludes=function(e){return function(t,r,n){var i,o=_toIobject(t),a=_toLength(o.length),s=_toAbsoluteIndex(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},shared=_shared("keys"),_sharedKey=function(e){return shared[e]||(shared[e]=_uid(e))},arrayIndexOf=_arrayIncludes(!1),IE_PROTO=_sharedKey("IE_PROTO"),_objectKeysInternal=function(e,t){var r,n=_toIobject(e),i=0,o=[];for(r in n)r!=IE_PROTO&&_has(n,r)&&o.push(r);for(;t.length>i;)_has(n,r=t[i++])&&(~arrayIndexOf(o,r)||o.push(r));return o},_enumBugKeys="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),_objectKeys=Object.keys||function(e){return _objectKeysInternal(e,_enumBugKeys)},f$2=Object.getOwnPropertySymbols,_objectGops={f:f$2},f$3={}.propertyIsEnumerable,_objectPie={f:f$3},_enumKeys=function(e){var t=_objectKeys(e),r=_objectGops.f;if(r)for(var n,i=r(e),o=_objectPie.f,a=0;i.length>a;)o.call(e,n=i[a++])&&t.push(n);return t},_isArray=Array.isArray||function(e){return"Array"==_cof(e)},_objectDps=_descriptors?Object.defineProperties:function(e,t){_anObject(e);for(var r,n=_objectKeys(t),i=n.length,o=0;i>o;)_objectDp.f(e,r=n[o++],t[r]);return e},document$2=_global.document,_html=document$2&&document$2.documentElement,IE_PROTO$1=_sharedKey("IE_PROTO"),Empty=function(){},PROTOTYPE$1="prototype",createDict=function(){var e,t=_domCreate("iframe"),r=_enumBugKeys.length;for(t.style.display="none",_html.appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),createDict=e.F;r--;)delete createDict[PROTOTYPE$1][_enumBugKeys[r]];return createDict()},_objectCreate=Object.create||function(e,t){var r;return null!==e?(Empty[PROTOTYPE$1]=_anObject(e),r=new Empty,Empty[PROTOTYPE$1]=null,r[IE_PROTO$1]=e):r=createDict(),void 0===t?r:_objectDps(r,t)},hiddenKeys=_enumBugKeys.concat("length","prototype"),f$4=Object.getOwnPropertyNames||function(e){return _objectKeysInternal(e,hiddenKeys)},_objectGopn={f:f$4},gOPN=_objectGopn.f,toString$1={}.toString,windowNames="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],getWindowNames=function(e){try{return gOPN(e)}catch(e){return windowNames.slice()}},f$5=function(e){return windowNames&&"[object Window]"==toString$1.call(e)?getWindowNames(e):gOPN(_toIobject(e))},_objectGopnExt={f:f$5},gOPD=Object.getOwnPropertyDescriptor,f$6=_descriptors?gOPD:function(e,t){if(e=_toIobject(e),t=_toPrimitive(t,!0),_ie8DomDefine)try{return gOPD(e,t)}catch(e){}if(_has(e,t))return _propertyDesc(!_objectPie.f.call(e,t),e[t])},_objectGopd={f:f$6},META=_meta.KEY,gOPD$1=_objectGopd.f,dP$1=_objectDp.f,gOPN$1=_objectGopnExt.f,$Symbol=_global.Symbol,$JSON=_global.JSON,_stringify=$JSON&&$JSON.stringify,PROTOTYPE$2="prototype",HIDDEN=_wks("_hidden"),TO_PRIMITIVE=_wks("toPrimitive"),isEnum={}.propertyIsEnumerable,SymbolRegistry=_shared("symbol-registry"),AllSymbols=_shared("symbols"),OPSymbols=_shared("op-symbols"),ObjectProto=Object[PROTOTYPE$2],USE_NATIVE="function"==typeof $Symbol,QObject=_global.QObject,setter=!QObject||!QObject[PROTOTYPE$2]||!QObject[PROTOTYPE$2].findChild,setSymbolDesc=_descriptors&&_fails(function(){return 7!=_objectCreate(dP$1({},"a",{get:function(){return dP$1(this,"a",{value:7}).a}})).a})?function(e,t,r){var n=gOPD$1(ObjectProto,t);n&&delete ObjectProto[t],dP$1(e,t,r),n&&e!==ObjectProto&&dP$1(ObjectProto,t,n)}:dP$1,wrap=function(e){var t=AllSymbols[e]=_objectCreate($Symbol[PROTOTYPE$2]);return t._k=e,t},isSymbol=USE_NATIVE&&"symbol"==typeof $Symbol.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof $Symbol},$defineProperty=function(e,t,r){return e===ObjectProto&&$defineProperty(OPSymbols,t,r),_anObject(e),t=_toPrimitive(t,!0),_anObject(r),_has(AllSymbols,t)?(r.enumerable?(_has(e,HIDDEN)&&e[HIDDEN][t]&&(e[HIDDEN][t]=!1),r=_objectCreate(r,{enumerable:_propertyDesc(0,!1)})):(_has(e,HIDDEN)||dP$1(e,HIDDEN,_propertyDesc(1,{})),e[HIDDEN][t]=!0),setSymbolDesc(e,t,r)):dP$1(e,t,r)},$defineProperties=function(e,t){_anObject(e);for(var r,n=_enumKeys(t=_toIobject(t)),i=0,o=n.length;o>i;)$defineProperty(e,r=n[i++],t[r]);return e},$create=function(e,t){return void 0===t?_objectCreate(e):$defineProperties(_objectCreate(e),t)},$propertyIsEnumerable=function(e){var t=isEnum.call(this,e=_toPrimitive(e,!0));return!(this===ObjectProto&&_has(AllSymbols,e)&&!_has(OPSymbols,e))&&(!(t||!_has(this,e)||!_has(AllSymbols,e)||_has(this,HIDDEN)&&this[HIDDEN][e])||t)},$getOwnPropertyDescriptor=function(e,t){if(e=_toIobject(e),t=_toPrimitive(t,!0),e!==ObjectProto||!_has(AllSymbols,t)||_has(OPSymbols,t)){var r=gOPD$1(e,t);return!r||!_has(AllSymbols,t)||_has(e,HIDDEN)&&e[HIDDEN][t]||(r.enumerable=!0),r}},$getOwnPropertyNames=function(e){for(var t,r=gOPN$1(_toIobject(e)),n=[],i=0;r.length>i;)_has(AllSymbols,t=r[i++])||t==HIDDEN||t==META||n.push(t);return n},$getOwnPropertySymbols=function(e){for(var t,r=e===ObjectProto,n=gOPN$1(r?OPSymbols:_toIobject(e)),i=[],o=0;n.length>o;)!_has(AllSymbols,t=n[o++])||r&&!_has(ObjectProto,t)||i.push(AllSymbols[t]);return i};USE_NATIVE||(_redefine(($Symbol=function(){if(this instanceof $Symbol)throw TypeError("Symbol is not a constructor!");var e=_uid(arguments.length>0?arguments[0]:void 0),t=function(r){this===ObjectProto&&t.call(OPSymbols,r),_has(this,HIDDEN)&&_has(this[HIDDEN],e)&&(this[HIDDEN][e]=!1),setSymbolDesc(this,e,_propertyDesc(1,r))};return _descriptors&&setter&&setSymbolDesc(ObjectProto,e,{configurable:!0,set:t}),wrap(e)})[PROTOTYPE$2],"toString",function(){return this._k}),_objectGopd.f=$getOwnPropertyDescriptor,_objectDp.f=$defineProperty,_objectGopn.f=_objectGopnExt.f=$getOwnPropertyNames,_objectPie.f=$propertyIsEnumerable,_objectGops.f=$getOwnPropertySymbols,_descriptors&&!_library&&_redefine(ObjectProto,"propertyIsEnumerable",$propertyIsEnumerable,!0),_wksExt.f=function(e){return wrap(_wks(e))}),_export(_export.G+_export.W+_export.F*!USE_NATIVE,{Symbol:$Symbol});for(var es6Symbols="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),j=0;es6Symbols.length>j;)_wks(es6Symbols[j++]);for(var wellKnownSymbols=_objectKeys(_wks.store),k=0;wellKnownSymbols.length>k;)_wksDefine(wellKnownSymbols[k++]);_export(_export.S+_export.F*!USE_NATIVE,"Symbol",{for:function(e){return _has(SymbolRegistry,e+="")?SymbolRegistry[e]:SymbolRegistry[e]=$Symbol(e)},keyFor:function(e){if(!isSymbol(e))throw TypeError(e+" is not a symbol!");for(var t in SymbolRegistry)if(SymbolRegistry[t]===e)return t},useSetter:function(){setter=!0},useSimple:function(){setter=!1}}),_export(_export.S+_export.F*!USE_NATIVE,"Object",{create:$create,defineProperty:$defineProperty,defineProperties:$defineProperties,getOwnPropertyDescriptor:$getOwnPropertyDescriptor,getOwnPropertyNames:$getOwnPropertyNames,getOwnPropertySymbols:$getOwnPropertySymbols}),$JSON&&_export(_export.S+_export.F*(!USE_NATIVE||_fails(function(){var e=$Symbol();return"[null]"!=_stringify([e])||"{}"!=_stringify({a:e})||"{}"!=_stringify(Object(e))})),"JSON",{stringify:function(e){for(var t,r,n=[e],i=1;arguments.length>i;)n.push(arguments[i++]);if(r=t=n[1],(_isObject(t)||void 0!==e)&&!isSymbol(e))return _isArray(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!isSymbol(t))return t}),n[1]=t,_stringify.apply($JSON,n)}}),$Symbol[PROTOTYPE$2][TO_PRIMITIVE]||_hide($Symbol[PROTOTYPE$2],TO_PRIMITIVE,$Symbol[PROTOTYPE$2].valueOf),_setToStringTag($Symbol,"Symbol"),_setToStringTag(Math,"Math",!0),_setToStringTag(_global.JSON,"JSON",!0),_export(_export.S,"Object",{create:_objectCreate}),_export(_export.S+_export.F*!_descriptors,"Object",{defineProperty:_objectDp.f}),_export(_export.S+_export.F*!_descriptors,"Object",{defineProperties:_objectDps});var _objectSap=function(e,t){var r=(_core.Object||{})[e]||Object[e],n={};n[e]=t(r),_export(_export.S+_export.F*_fails(function(){r(1)}),"Object",n)},$getOwnPropertyDescriptor$1=_objectGopd.f;_objectSap("getOwnPropertyDescriptor",function(){return function(e,t){return $getOwnPropertyDescriptor$1(_toIobject(e),t)}});var _toObject=function(e){return Object(_defined(e))},IE_PROTO$2=_sharedKey("IE_PROTO"),ObjectProto$1=Object.prototype,_objectGpo=Object.getPrototypeOf||function(e){return e=_toObject(e),_has(e,IE_PROTO$2)?e[IE_PROTO$2]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?ObjectProto$1:null};_objectSap("getPrototypeOf",function(){return function(e){return _objectGpo(_toObject(e))}}),_objectSap("keys",function(){return function(e){return _objectKeys(_toObject(e))}}),_objectSap("getOwnPropertyNames",function(){return _objectGopnExt.f});var meta=_meta.onFreeze;_objectSap("freeze",function(e){return function(t){return e&&_isObject(t)?e(meta(t)):t}});var meta$1=_meta.onFreeze;_objectSap("seal",function(e){return function(t){return e&&_isObject(t)?e(meta$1(t)):t}});var meta$2=_meta.onFreeze;_objectSap("preventExtensions",function(e){return function(t){return e&&_isObject(t)?e(meta$2(t)):t}}),_objectSap("isFrozen",function(e){return function(t){return!_isObject(t)||!!e&&e(t)}}),_objectSap("isSealed",function(e){return function(t){return!_isObject(t)||!!e&&e(t)}}),_objectSap("isExtensible",function(e){return function(t){return!!_isObject(t)&&(!e||e(t))}});var $assign=Object.assign,_objectAssign=!$assign||_fails(function(){var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(e){t[e]=e}),7!=$assign({},e)[r]||Object.keys($assign({},t)).join("")!=n})?function(e,t){for(var r=_toObject(e),n=arguments.length,i=1,o=_objectGops.f,a=_objectPie.f;n>i;)for(var s,u=_iobject(arguments[i++]),c=o?_objectKeys(u).concat(o(u)):_objectKeys(u),f=c.length,l=0;f>l;)a.call(u,s=c[l++])&&(r[s]=u[s]);return r}:$assign;_export(_export.S+_export.F,"Object",{assign:_objectAssign});var _sameValue=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};_export(_export.S,"Object",{is:_sameValue});var check=function(e,t){if(_anObject(e),!_isObject(t)&&null!==t)throw TypeError(t+": can't set as prototype!")},_setProto={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=_ctx(Function.call,_objectGopd.f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return check(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:check};_export(_export.S,"Object",{setPrototypeOf:_setProto.set});var TAG$1=_wks("toStringTag"),ARG="Arguments"==_cof(function(){return arguments}()),tryGet=function(e,t){try{return e[t]}catch(e){}},_classof=function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=tryGet(t=Object(e),TAG$1))?r:ARG?_cof(t):"Object"==(n=_cof(t))&&"function"==typeof t.callee?"Arguments":n},test={};test[_wks("toStringTag")]="z",test+""!="[object z]"&&_redefine(Object.prototype,"toString",function(){return"[object "+_classof(this)+"]"},!0);var _invoke=function(e,t,r){var n=void 0===r;switch(t.length){case 0:return n?e():e.call(r);case 1:return n?e(t[0]):e.call(r,t[0]);case 2:return n?e(t[0],t[1]):e.call(r,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(r,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(r,t[0],t[1],t[2],t[3])}return e.apply(r,t)},arraySlice=[].slice,factories={},construct=function(e,t,r){if(!(t in factories)){for(var n=[],i=0;i<t;i++)n[i]="a["+i+"]";factories[t]=Function("F,a","return new F("+n.join(",")+")")}return factories[t](e,r)},_bind=Function.bind||function(e){var t=_aFunction(this),r=arraySlice.call(arguments,1),n=function(){var i=r.concat(arraySlice.call(arguments));return this instanceof n?construct(t,i.length,i):_invoke(t,i,e)};return _isObject(t.prototype)&&(n.prototype=t.prototype),n};_export(_export.P,"Function",{bind:_bind});var dP$2=_objectDp.f,FProto=Function.prototype,nameRE=/^\s*function ([^ (]*)/,NAME="name";NAME in FProto||_descriptors&&dP$2(FProto,NAME,{configurable:!0,get:function(){try{return(""+this).match(nameRE)[1]}catch(e){return""}}});var HAS_INSTANCE=_wks("hasInstance"),FunctionProto=Function.prototype;HAS_INSTANCE in FunctionProto||_objectDp.f(FunctionProto,HAS_INSTANCE,{value:function(e){if("function"!=typeof this||!_isObject(e))return!1;if(!_isObject(this.prototype))return e instanceof this;for(;e=_objectGpo(e);)if(this.prototype===e)return!0;return!1}});var _stringWs="\t\n\v\f\r \u2028\u2029\ufeff",space="["+_stringWs+"]",non="
",ltrim=RegExp("^"+space+space+"*"),rtrim=RegExp(space+space+"*$"),exporter=function(e,t,r){var n={},i=_fails(function(){return!!_stringWs[e]()||non[e]()!=non}),o=n[e]=i?t(trim):_stringWs[e];r&&(n[r]=o),_export(_export.P+_export.F*i,"String",n)},trim=exporter.trim=function(e,t){return e=String(_defined(e)),1&t&&(e=e.replace(ltrim,"")),2&t&&(e=e.replace(rtrim,"")),e},_stringTrim=exporter,$parseInt=_global.parseInt,$trim=_stringTrim.trim,hex=/^[-+]?0[xX]/,_parseInt=8!==$parseInt(_stringWs+"08")||22!==$parseInt(_stringWs+"0x16")?function(e,t){var r=$trim(String(e),3);return $parseInt(r,t>>>0||(hex.test(r)?16:10))}:$parseInt;_export(_export.G+_export.F*(parseInt!=_parseInt),{parseInt:_parseInt});var $parseFloat=_global.parseFloat,$trim$1=_stringTrim.trim,_parseFloat=1/$parseFloat(_stringWs+"-0")!=-1/0?function(e){var t=$trim$1(String(e),3),r=$parseFloat(t);return 0===r&&"-"==t.charAt(0)?-0:r}:$parseFloat;_export(_export.G+_export.F*(parseFloat!=_parseFloat),{parseFloat:_parseFloat});var setPrototypeOf=_setProto.set,_inheritIfRequired=function(e,t,r){var n,i=t.constructor;return i!==r&&"function"==typeof i&&(n=i.prototype)!==r.prototype&&_isObject(n)&&setPrototypeOf&&setPrototypeOf(e,n),e},gOPN$2=_objectGopn.f,gOPD$2=_objectGopd.f,dP$3=_objectDp.f,$trim$2=_stringTrim.trim,NUMBER="Number",$Number=_global[NUMBER],Base=$Number,proto=$Number.prototype,BROKEN_COF=_cof(_objectCreate(proto))==NUMBER,TRIM="trim"in String.prototype,toNumber=function(e){var t=_toPrimitive(e,!1);if("string"==typeof t&&t.length>2){var r,n,i,o=(t=TRIM?t.trim():$trim$2(t,3)).charCodeAt(0);if(43===o||45===o){if(88===(r=t.charCodeAt(2))||120===r)return NaN}else if(48===o){switch(t.charCodeAt(1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+t}for(var a,s=t.slice(2),u=0,c=s.length;u<c;u++)if((a=s.charCodeAt(u))<48||a>i)return NaN;return parseInt(s,n)}}return+t};if(!$Number(" 0o1")||!$Number("0b1")||$Number("+0x1")){$Number=function(e){var t=arguments.length<1?0:e,r=this;return r instanceof $Number&&(BROKEN_COF?_fails(function(){proto.valueOf.call(r)}):_cof(r)!=NUMBER)?_inheritIfRequired(new Base(toNumber(t)),r,$Number):toNumber(t)};for(var key,keys=_descriptors?gOPN$2(Base):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),j$1=0;keys.length>j$1;j$1++)_has(Base,key=keys[j$1])&&!_has($Number,key)&&dP$3($Number,key,gOPD$2(Base,key));$Number.prototype=proto,proto.constructor=$Number,_redefine(_global,NUMBER,$Number)}var _aNumberValue=function(e,t){if("number"!=typeof e&&"Number"!=_cof(e))throw TypeError(t);return+e},_stringRepeat=function(e){var t=String(_defined(this)),r="",n=_toInteger(e);if(n<0||n==1/0)throw RangeError("Count can't be negative");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r},$toFixed=1..toFixed,floor$1=Math.floor,data=[0,0,0,0,0,0],ERROR="Number.toFixed: incorrect invocation!",ZERO="0",multiply=function(e,t){for(var r=-1,n=t;++r<6;)n+=e*data[r],data[r]=n%1e7,n=floor$1(n/1e7)},divide=function(e){for(var t=6,r=0;--t>=0;)r+=data[t],data[t]=floor$1(r/e),r=r%e*1e7},numToString=function(){for(var e=6,t="";--e>=0;)if(""!==t||0===e||0!==data[e]){var r=String(data[e]);t=""===t?r:t+_stringRepeat.call(ZERO,7-r.length)+r}return t},pow=function(e,t,r){return 0===t?r:t%2==1?pow(e,t-1,r*e):pow(e*e,t/2,r)},log=function(e){for(var t=0,r=e;r>=4096;)t+=12,r/=4096;for(;r>=2;)t+=1,r/=2;return t};_export(_export.P+_export.F*(!!$toFixed&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!_fails(function(){$toFixed.call({})})),"Number",{toFixed:function(e){var t,r,n,i,o=_aNumberValue(this,ERROR),a=_toInteger(e),s="",u=ZERO;if(a<0||a>20)throw RangeError(ERROR);if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return String(o);if(o<0&&(s="-",o=-o),o>1e-21)if(r=(t=log(o*pow(2,69,1))-69)<0?o*pow(2,-t,1):o/pow(2,t,1),r*=4503599627370496,(t=52-t)>0){for(multiply(0,r),n=a;n>=7;)multiply(1e7,0),n-=7;for(multiply(pow(10,n,1),0),n=t-1;n>=23;)divide(1<<23),n-=23;divide(1<<n),multiply(1,1),divide(2),u=numToString()}else multiply(0,r),multiply(1<<-t,0),u=numToString()+_stringRepeat.call(ZERO,a);return u=a>0?s+((i=u.length)<=a?"0."+_stringRepeat.call(ZERO,a-i)+u:u.slice(0,i-a)+"."+u.slice(i-a)):s+u}});var $toPrecision=1..toPrecision;_export(_export.P+_export.F*(_fails(function(){return"1"!==$toPrecision.call(1,void 0)})||!_fails(function(){$toPrecision.call({})})),"Number",{toPrecision:function(e){var t=_aNumberValue(this,"Number#toPrecision: incorrect invocation!");return void 0===e?$toPrecision.call(t):$toPrecision.call(t,e)}}),_export(_export.S,"Number",{EPSILON:Math.pow(2,-52)});var _isFinite=_global.isFinite;_export(_export.S,"Number",{isFinite:function(e){return"number"==typeof e&&_isFinite(e)}});var floor$2=Math.floor,_isInteger=function(e){return!_isObject(e)&&isFinite(e)&&floor$2(e)===e};_export(_export.S,"Number",{isInteger:_isInteger}),_export(_export.S,"Number",{isNaN:function(e){return e!=e}});var abs=Math.abs;_export(_export.S,"Number",{isSafeInteger:function(e){return _isInteger(e)&&abs(e)<=9007199254740991}}),_export(_export.S,"Number",{MAX_SAFE_INTEGER:9007199254740991}),_export(_export.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991}),_export(_export.S+_export.F*(Number.parseFloat!=_parseFloat),"Number",{parseFloat:_parseFloat}),_export(_export.S+_export.F*(Number.parseInt!=_parseInt),"Number",{parseInt:_parseInt});var _mathLog1p=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:Math.log(1+e)},sqrt=Math.sqrt,$acosh=Math.acosh;_export(_export.S+_export.F*!($acosh&&710==Math.floor($acosh(Number.MAX_VALUE))&&$acosh(1/0)==1/0),"Math",{acosh:function(e){return(e=+e)<1?NaN:e>94906265.62425156?Math.log(e)+Math.LN2:_mathLog1p(e-1+sqrt(e-1)*sqrt(e+1))}});var $asinh=Math.asinh;function asinh(e){return isFinite(e=+e)&&0!=e?e<0?-asinh(-e):Math.log(e+Math.sqrt(e*e+1)):e}_export(_export.S+_export.F*!($asinh&&1/$asinh(0)>0),"Math",{asinh:asinh});var $atanh=Math.atanh;_export(_export.S+_export.F*!($atanh&&1/$atanh(-0)<0),"Math",{atanh:function(e){return 0==(e=+e)?e:Math.log((1+e)/(1-e))/2}});var _mathSign=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1};_export(_export.S,"Math",{cbrt:function(e){return _mathSign(e=+e)*Math.pow(Math.abs(e),1/3)}}),_export(_export.S,"Math",{clz32:function(e){return(e>>>=0)?31-Math.floor(Math.log(e+.5)*Math.LOG2E):32}});var exp=Math.exp;_export(_export.S,"Math",{cosh:function(e){return(exp(e=+e)+exp(-e))/2}});var $expm1=Math.expm1,_mathExpm1=!$expm1||$expm1(10)>22025.465794806718||$expm1(10)<22025.465794806718||-2e-17!=$expm1(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Math.exp(e)-1}:$expm1;_export(_export.S+_export.F*(_mathExpm1!=Math.expm1),"Math",{expm1:_mathExpm1});var pow$1=Math.pow,EPSILON=pow$1(2,-52),EPSILON32=pow$1(2,-23),MAX32=pow$1(2,127)*(2-EPSILON32),MIN32=pow$1(2,-126),roundTiesToEven=function(e){return e+1/EPSILON-1/EPSILON},_mathFround=Math.fround||function(e){var t,r,n=Math.abs(e),i=_mathSign(e);return n<MIN32?i*roundTiesToEven(n/MIN32/EPSILON32)*MIN32*EPSILON32:(r=(t=(1+EPSILON32/EPSILON)*n)-(t-n))>MAX32||r!=r?i*(1/0):i*r};_export(_export.S,"Math",{fround:_mathFround});var abs$1=Math.abs;_export(_export.S,"Math",{hypot:function(e,t){for(var r,n,i=0,o=0,a=arguments.length,s=0;o<a;)s<(r=abs$1(arguments[o++]))?(i=i*(n=s/r)*n+1,s=r):i+=r>0?(n=r/s)*n:r;return s===1/0?1/0:s*Math.sqrt(i)}});var $imul=Math.imul;_export(_export.S+_export.F*_fails(function(){return-5!=$imul(4294967295,5)||2!=$imul.length}),"Math",{imul:function(e,t){var r=+e,n=+t,i=65535&r,o=65535&n;return 0|i*o+((65535&r>>>16)*o+i*(65535&n>>>16)<<16>>>0)}}),_export(_export.S,"Math",{log10:function(e){return Math.log(e)*Math.LOG10E}}),_export(_export.S,"Math",{log1p:_mathLog1p}),_export(_export.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}}),_export(_export.S,"Math",{sign:_mathSign});var exp$1=Math.exp;_export(_export.S+_export.F*_fails(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function(e){return Math.abs(e=+e)<1?(_mathExpm1(e)-_mathExpm1(-e))/2:(exp$1(e-1)-exp$1(-e-1))*(Math.E/2)}});var exp$2=Math.exp;_export(_export.S,"Math",{tanh:function(e){var t=_mathExpm1(e=+e),r=_mathExpm1(-e);return t==1/0?1:r==1/0?-1:(t-r)/(exp$2(e)+exp$2(-e))}}),_export(_export.S,"Math",{trunc:function(e){return(e>0?Math.floor:Math.ceil)(e)}});var fromCharCode=String.fromCharCode,$fromCodePoint=String.fromCodePoint;_export(_export.S+_export.F*(!!$fromCodePoint&&1!=$fromCodePoint.length),"String",{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,i=0;n>i;){if(t=+arguments[i++],_toAbsoluteIndex(t,1114111)!==t)throw RangeError(t+" is not a valid code point");r.push(t<65536?fromCharCode(t):fromCharCode(55296+((t-=65536)>>10),t%1024+56320))}return r.join("")}}),_export(_export.S,"String",{raw:function(e){for(var t=_toIobject(e.raw),r=_toLength(t.length),n=arguments.length,i=[],o=0;r>o;)i.push(String(t[o++])),o<n&&i.push(String(arguments[o]));return i.join("")}}),_stringTrim("trim",function(e){return function(){return e(this,3)}});var _stringAt=function(e){return function(t,r){var n,i,o=String(_defined(t)),a=_toInteger(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=o.charCodeAt(a))<55296||n>56319||a+1===s||(i=o.charCodeAt(a+1))<56320||i>57343?e?o.charAt(a):n:e?o.slice(a,a+2):i-56320+(n-55296<<10)+65536}},_iterators={},IteratorPrototype={};_hide(IteratorPrototype,_wks("iterator"),function(){return this});var _iterCreate=function(e,t,r){e.prototype=_objectCreate(IteratorPrototype,{next:_propertyDesc(1,r)}),_setToStringTag(e,t+" Iterator")},ITERATOR=_wks("iterator"),BUGGY=!([].keys&&"next"in[].keys()),FF_ITERATOR="@@iterator",KEYS="keys",VALUES="values",returnThis=function(){return this},_iterDefine=function(e,t,r,n,i,o,a){_iterCreate(r,t,n);var s,u,c,f=function(e){if(!BUGGY&&e in d)return d[e];switch(e){case KEYS:case VALUES:return function(){return new r(this,e)}}return function(){return new r(this,e)}},l=t+" Iterator",h=i==VALUES,p=!1,d=e.prototype,g=d[ITERATOR]||d[FF_ITERATOR]||i&&d[i],_=!BUGGY&&g||f(i),m=i?h?f("entries"):_:void 0,y="Array"==t&&d.entries||g;if(y&&(c=_objectGpo(y.call(new e)))!==Object.prototype&&c.next&&(_setToStringTag(c,l,!0),_has(c,ITERATOR)||_hide(c,ITERATOR,returnThis)),h&&g&&g.name!==VALUES&&(p=!0,_=function(){return g.call(this)}),(BUGGY||p||!d[ITERATOR])&&_hide(d,ITERATOR,_),_iterators[t]=_,_iterators[l]=returnThis,i)if(s={values:h?_:f(VALUES),keys:o?_:f(KEYS),entries:m},a)for(u in s)u in d||_redefine(d,u,s[u]);else _export(_export.P+_export.F*(BUGGY||p),t,s);return s},$at=_stringAt(!0);_iterDefine(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,r=this._i;return r>=t.length?{value:void 0,done:!0}:(e=$at(t,r),this._i+=e.length,{value:e,done:!1})});var $at$1=_stringAt(!1);_export(_export.P,"String",{codePointAt:function(e){return $at$1(this,e)}});var MATCH=_wks("match"),_isRegexp=function(e){var t;return _isObject(e)&&(void 0!==(t=e[MATCH])?!!t:"RegExp"==_cof(e))},_stringContext=function(e,t,r){if(_isRegexp(t))throw TypeError("String#"+r+" doesn't accept regex!");return String(_defined(e))},MATCH$1=_wks("match"),_failsIsRegexp=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[MATCH$1]=!1,!"/./"[e](t)}catch(e){}}return!0},ENDS_WITH="endsWith",$endsWith=""[ENDS_WITH];_export(_export.P+_export.F*_failsIsRegexp(ENDS_WITH),"String",{endsWith:function(e){var t=_stringContext(this,e,ENDS_WITH),r=arguments.length>1?arguments[1]:void 0,n=_toLength(t.length),i=void 0===r?n:Math.min(_toLength(r),n),o=String(e);return $endsWith?$endsWith.call(t,o,i):t.slice(i-o.length,i)===o}});var INCLUDES="includes";_export(_export.P+_export.F*_failsIsRegexp(INCLUDES),"String",{includes:function(e){return!!~_stringContext(this,e,INCLUDES).indexOf(e,arguments.length>1?arguments[1]:void 0)}}),_export(_export.P,"String",{repeat:_stringRepeat});var STARTS_WITH="startsWith",$startsWith=""[STARTS_WITH];_export(_export.P+_export.F*_failsIsRegexp(STARTS_WITH),"String",{startsWith:function(e){var t=_stringContext(this,e,STARTS_WITH),r=_toLength(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),n=String(e);return $startsWith?$startsWith.call(t,n,r):t.slice(r,r+n.length)===n}});var quot=/"/g,createHTML=function(e,t,r,n){var i=String(_defined(e)),o="<"+t;return""!==r&&(o+=" "+r+'="'+String(n).replace(quot,""")+'"'),o+">"+i+"</"+t+">"},_stringHtml=function(e,t){var r={};r[e]=t(createHTML),_export(_export.P+_export.F*_fails(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",r)};_stringHtml("anchor",function(e){return function(t){return e(this,"a","name",t)}}),_stringHtml("big",function(e){return function(){return e(this,"big","","")}}),_stringHtml("blink",function(e){return function(){return e(this,"blink","","")}}),_stringHtml("bold",function(e){return function(){return e(this,"b","","")}}),_stringHtml("fixed",function(e){return function(){return e(this,"tt","","")}}),_stringHtml("fontcolor",function(e){return function(t){return e(this,"font","color",t)}}),_stringHtml("fontsize",function(e){return function(t){return e(this,"font","size",t)}}),_stringHtml("italics",function(e){return function(){return e(this,"i","","")}}),_stringHtml("link",function(e){return function(t){return e(this,"a","href",t)}}),_stringHtml("small",function(e){return function(){return e(this,"small","","")}}),_stringHtml("strike",function(e){return function(){return e(this,"strike","","")}}),_stringHtml("sub",function(e){return function(){return e(this,"sub","","")}}),_stringHtml("sup",function(e){return function(){return e(this,"sup","","")}}),_export(_export.S,"Date",{now:function(){return(new Date).getTime()}}),_export(_export.P+_export.F*_fails(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function(e){var t=_toObject(this),r=_toPrimitive(t);return"number"!=typeof r||isFinite(r)?t.toISOString():null}});var getTime=Date.prototype.getTime,$toISOString=Date.prototype.toISOString,lz=function(e){return e>9?e:"0"+e},_dateToIsoString=_fails(function(){return"0385-07-25T07:06:39.999Z"!=$toISOString.call(new Date(-5e13-1))})||!_fails(function(){$toISOString.call(new Date(NaN))})?function(){if(!isFinite(getTime.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),r=e.getUTCMilliseconds(),n=t<0?"-":t>9999?"+":"";return n+("00000"+Math.abs(t)).slice(n?-6:-4)+"-"+lz(e.getUTCMonth()+1)+"-"+lz(e.getUTCDate())+"T"+lz(e.getUTCHours())+":"+lz(e.getUTCMinutes())+":"+lz(e.getUTCSeconds())+"."+(r>99?r:"0"+lz(r))+"Z"}:$toISOString;_export(_export.P+_export.F*(Date.prototype.toISOString!==_dateToIsoString),"Date",{toISOString:_dateToIsoString});var DateProto=Date.prototype,INVALID_DATE="Invalid Date",TO_STRING="toString",$toString=DateProto[TO_STRING],getTime$1=DateProto.getTime;new Date(NaN)+""!=INVALID_DATE&&_redefine(DateProto,TO_STRING,function(){var e=getTime$1.call(this);return e==e?$toString.call(this):INVALID_DATE});var NUMBER$1="number",_dateToPrimitive=function(e){if("string"!==e&&e!==NUMBER$1&&"default"!==e)throw TypeError("Incorrect hint");return _toPrimitive(_anObject(this),e!=NUMBER$1)},TO_PRIMITIVE$1=_wks("toPrimitive"),proto$1=Date.prototype;TO_PRIMITIVE$1 in proto$1||_hide(proto$1,TO_PRIMITIVE$1,_dateToPrimitive),_export(_export.S,"Array",{isArray:_isArray});var _iterCall=function(e,t,r,n){try{return n?t(_anObject(r)[0],r[1]):t(r)}catch(t){var i=e.return;throw void 0!==i&&_anObject(i.call(e)),t}},ITERATOR$1=_wks("iterator"),ArrayProto=Array.prototype,_isArrayIter=function(e){return void 0!==e&&(_iterators.Array===e||ArrayProto[ITERATOR$1]===e)},_createProperty=function(e,t,r){t in e?_objectDp.f(e,t,_propertyDesc(0,r)):e[t]=r},ITERATOR$2=_wks("iterator"),core_getIteratorMethod=_core.getIteratorMethod=function(e){if(null!=e)return e[ITERATOR$2]||e["@@iterator"]||_iterators[_classof(e)]},ITERATOR$3=_wks("iterator"),SAFE_CLOSING=!1;try{var riter=[7][ITERATOR$3]();riter.return=function(){SAFE_CLOSING=!0}}catch(e){}var _iterDetect=function(e,t){if(!t&&!SAFE_CLOSING)return!1;var r=!1;try{var n=[7],i=n[ITERATOR$3]();i.next=function(){return{done:r=!0}},n[ITERATOR$3]=function(){return i},e(n)}catch(e){}return r};_export(_export.S+_export.F*!_iterDetect(function(e){}),"Array",{from:function(e){var t,r,n,i,o=_toObject(e),a="function"==typeof this?this:Array,s=arguments.length,u=s>1?arguments[1]:void 0,c=void 0!==u,f=0,l=core_getIteratorMethod(o);if(c&&(u=_ctx(u,s>2?arguments[2]:void 0,2)),null==l||a==Array&&_isArrayIter(l))for(r=new a(t=_toLength(o.length));t>f;f++)_createProperty(r,f,c?u(o[f],f):o[f]);else for(i=l.call(o),r=new a;!(n=i.next()).done;f++)_createProperty(r,f,c?_iterCall(i,u,[n.value,f],!0):n.value);return r.length=f,r}}),_export(_export.S+_export.F*_fails(function(){function e(){}return!(Array.of.call(e)instanceof e)}),"Array",{of:function(){for(var e=0,t=arguments.length,r=new("function"==typeof this?this:Array)(t);t>e;)_createProperty(r,e,arguments[e++]);return r.length=t,r}});var _strictMethod=function(e,t){return!!e&&_fails(function(){t?e.call(null,function(){},1):e.call(null)})},arrayJoin=[].join;_export(_export.P+_export.F*(_iobject!=Object||!_strictMethod(arrayJoin)),"Array",{join:function(e){return arrayJoin.call(_toIobject(this),void 0===e?",":e)}});var arraySlice$1=[].slice;_export(_export.P+_export.F*_fails(function(){_html&&arraySlice$1.call(_html)}),"Array",{slice:function(e,t){var r=_toLength(this.length),n=_cof(this);if(t=void 0===t?r:t,"Array"==n)return arraySlice$1.call(this,e,t);for(var i=_toAbsoluteIndex(e,r),o=_toAbsoluteIndex(t,r),a=_toLength(o-i),s=new Array(a),u=0;u<a;u++)s[u]="String"==n?this.charAt(i+u):this[i+u];return s}});var $sort=[].sort,test$1=[1,2,3];_export(_export.P+_export.F*(_fails(function(){test$1.sort(void 0)})||!_fails(function(){test$1.sort(null)})||!_strictMethod($sort)),"Array",{sort:function(e){return void 0===e?$sort.call(_toObject(this)):$sort.call(_toObject(this),_aFunction(e))}});var SPECIES=_wks("species"),_arraySpeciesConstructor=function(e){var t;return _isArray(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!_isArray(t.prototype)||(t=void 0),_isObject(t)&&null===(t=t[SPECIES])&&(t=void 0)),void 0===t?Array:t},_arraySpeciesCreate=function(e,t){return new(_arraySpeciesConstructor(e))(t)},_arrayMethods=function(e,t){var r=1==e,n=2==e,i=3==e,o=4==e,a=6==e,s=5==e||a,u=t||_arraySpeciesCreate;return function(t,c,f){for(var l,h,p=_toObject(t),d=_iobject(p),g=_ctx(c,f,3),_=_toLength(d.length),m=0,y=r?u(t,_):n?u(t,0):void 0;_>m;m++)if((s||m in d)&&(h=g(l=d[m],m,p),e))if(r)y[m]=h;else if(h)switch(e){case 3:return!0;case 5:return l;case 6:return m;case 2:y.push(l)}else if(o)return!1;return a?-1:i||o?o:y}},$forEach=_arrayMethods(0),STRICT=_strictMethod([].forEach,!0);_export(_export.P+_export.F*!STRICT,"Array",{forEach:function(e){return $forEach(this,e,arguments[1])}});var $map=_arrayMethods(1);_export(_export.P+_export.F*!_strictMethod([].map,!0),"Array",{map:function(e){return $map(this,e,arguments[1])}});var $filter=_arrayMethods(2);_export(_export.P+_export.F*!_strictMethod([].filter,!0),"Array",{filter:function(e){return $filter(this,e,arguments[1])}});var $some=_arrayMethods(3);_export(_export.P+_export.F*!_strictMethod([].some,!0),"Array",{some:function(e){return $some(this,e,arguments[1])}});var $every=_arrayMethods(4);_export(_export.P+_export.F*!_strictMethod([].every,!0),"Array",{every:function(e){return $every(this,e,arguments[1])}});var _arrayReduce=function(e,t,r,n,i){_aFunction(t);var o=_toObject(e),a=_iobject(o),s=_toLength(o.length),u=i?s-1:0,c=i?-1:1;if(r<2)for(;;){if(u in a){n=a[u],u+=c;break}if(u+=c,i?u<0:s<=u)throw TypeError("Reduce of empty array with no initial value")}for(;i?u>=0:s>u;u+=c)u in a&&(n=t(n,a[u],u,o));return n};_export(_export.P+_export.F*!_strictMethod([].reduce,!0),"Array",{reduce:function(e){return _arrayReduce(this,e,arguments.length,arguments[1],!1)}}),_export(_export.P+_export.F*!_strictMethod([].reduceRight,!0),"Array",{reduceRight:function(e){return _arrayReduce(this,e,arguments.length,arguments[1],!0)}});var $indexOf=_arrayIncludes(!1),$native=[].indexOf,NEGATIVE_ZERO=!!$native&&1/[1].indexOf(1,-0)<0;_export(_export.P+_export.F*(NEGATIVE_ZERO||!_strictMethod($native)),"Array",{indexOf:function(e){return NEGATIVE_ZERO?$native.apply(this,arguments)||0:$indexOf(this,e,arguments[1])}});var $native$1=[].lastIndexOf,NEGATIVE_ZERO$1=!!$native$1&&1/[1].lastIndexOf(1,-0)<0;_export(_export.P+_export.F*(NEGATIVE_ZERO$1||!_strictMethod($native$1)),"Array",{lastIndexOf:function(e){if(NEGATIVE_ZERO$1)return $native$1.apply(this,arguments)||0;var t=_toIobject(this),r=_toLength(t.length),n=r-1;for(arguments.length>1&&(n=Math.min(n,_toInteger(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return-1}});var _arrayCopyWithin=[].copyWithin||function(e,t){var r=_toObject(this),n=_toLength(r.length),i=_toAbsoluteIndex(e,n),o=_toAbsoluteIndex(t,n),a=arguments.length>2?arguments[2]:void 0,s=Math.min((void 0===a?n:_toAbsoluteIndex(a,n))-o,n-i),u=1;for(o<i&&i<o+s&&(u=-1,o+=s-1,i+=s-1);s-- >0;)o in r?r[i]=r[o]:delete r[i],i+=u,o+=u;return r},UNSCOPABLES=_wks("unscopables"),ArrayProto$1=Array.prototype;null==ArrayProto$1[UNSCOPABLES]&&_hide(ArrayProto$1,UNSCOPABLES,{});var _addToUnscopables=function(e){ArrayProto$1[UNSCOPABLES][e]=!0};_export(_export.P,"Array",{copyWithin:_arrayCopyWithin}),_addToUnscopables("copyWithin");var _arrayFill=function(e){for(var t=_toObject(this),r=_toLength(t.length),n=arguments.length,i=_toAbsoluteIndex(n>1?arguments[1]:void 0,r),o=n>2?arguments[2]:void 0,a=void 0===o?r:_toAbsoluteIndex(o,r);a>i;)t[i++]=e;return t};_export(_export.P,"Array",{fill:_arrayFill}),_addToUnscopables("fill");var $find=_arrayMethods(5),KEY="find",forced=!0;KEY in[]&&Array(1)[KEY](function(){forced=!1}),_export(_export.P+_export.F*forced,"Array",{find:function(e){return $find(this,e,arguments.length>1?arguments[1]:void 0)}}),_addToUnscopables(KEY);var $find$1=_arrayMethods(6),KEY$1="findIndex",forced$1=!0;KEY$1 in[]&&Array(1)[KEY$1](function(){forced$1=!1}),_export(_export.P+_export.F*forced$1,"Array",{findIndex:function(e){return $find$1(this,e,arguments.length>1?arguments[1]:void 0)}}),_addToUnscopables(KEY$1);var SPECIES$1=_wks("species"),_setSpecies=function(e){var t=_global[e];_descriptors&&t&&!t[SPECIES$1]&&_objectDp.f(t,SPECIES$1,{configurable:!0,get:function(){return this}})};_setSpecies("Array");var _iterStep=function(e,t){return{value:t,done:!!e}},es6_array_iterator=_iterDefine(Array,"Array",function(e,t){this._t=_toIobject(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,r=this._i++;return!e||r>=e.length?(this._t=void 0,_iterStep(1)):_iterStep(0,"keys"==t?r:"values"==t?e[r]:[r,e[r]])},"values");_iterators.Arguments=_iterators.Array,_addToUnscopables("keys"),_addToUnscopables("values"),_addToUnscopables("entries");var _flags=function(){var e=_anObject(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},dP$4=_objectDp.f,gOPN$3=_objectGopn.f,$RegExp=_global.RegExp,Base$1=$RegExp,proto$2=$RegExp.prototype,re1=/a/g,re2=/a/g,CORRECT_NEW=new $RegExp(re1)!==re1;if(_descriptors&&(!CORRECT_NEW||_fails(function(){return re2[_wks("match")]=!1,$RegExp(re1)!=re1||$RegExp(re2)==re2||"/a/i"!=$RegExp(re1,"i")}))){$RegExp=function(e,t){var r=this instanceof $RegExp,n=_isRegexp(e),i=void 0===t;return!r&&n&&e.constructor===$RegExp&&i?e:_inheritIfRequired(CORRECT_NEW?new Base$1(n&&!i?e.source:e,t):Base$1((n=e instanceof $RegExp)?e.source:e,n&&i?_flags.call(e):t),r?this:proto$2,$RegExp)};for(var proxy=function(e){e in $RegExp||dP$4($RegExp,e,{configurable:!0,get:function(){return Base$1[e]},set:function(t){Base$1[e]=t}})},keys$1=gOPN$3(Base$1),i=0;keys$1.length>i;)proxy(keys$1[i++]);proto$2.constructor=$RegExp,$RegExp.prototype=proto$2,_redefine(_global,"RegExp",$RegExp)}_setSpecies("RegExp"),_descriptors&&"g"!=/./g.flags&&_objectDp.f(RegExp.prototype,"flags",{configurable:!0,get:_flags});var TO_STRING$1="toString",$toString$1=/./[TO_STRING$1],define=function(e){_redefine(RegExp.prototype,TO_STRING$1,e,!0)};_fails(function(){return"/a/b"!=$toString$1.call({source:"a",flags:"b"})})?define(function(){var e=_anObject(this);return"/".concat(e.source,"/","flags"in e?e.flags:!_descriptors&&e instanceof RegExp?_flags.call(e):void 0)}):$toString$1.name!=TO_STRING$1&&define(function(){return $toString$1.call(this)});var _fixReWks=function(e,t,r){var n=_wks(e),i=r(_defined,n,""[e]),o=i[0],a=i[1];_fails(function(){var t={};return t[n]=function(){return 7},7!=""[e](t)})&&(_redefine(String.prototype,e,o),_hide(RegExp.prototype,n,2==t?function(e,t){return a.call(e,this,t)}:function(e){return a.call(e,this)}))};_fixReWks("match",1,function(e,t,r){return[function(r){var n=e(this),i=null==r?void 0:r[t];return void 0!==i?i.call(r,n):new RegExp(r)[t](String(n))},r]}),_fixReWks("replace",2,function(e,t,r){return[function(n,i){var o=e(this),a=null==n?void 0:n[t];return void 0!==a?a.call(n,o,i):r.call(String(o),n,i)},r]}),_fixReWks("search",1,function(e,t,r){return[function(r){var n=e(this),i=null==r?void 0:r[t];return void 0!==i?i.call(r,n):new RegExp(r)[t](String(n))},r]}),_fixReWks("split",2,function(e,t,r){var n=_isRegexp,i=r,o=[].push;if("c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length){var a=void 0===/()??/.exec("")[1];r=function(e,t){var r=String(this);if(void 0===e&&0===t)return[];if(!n(e))return i.call(r,e,t);var s,u,c,f,l,h=[],p=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),d=0,g=void 0===t?4294967295:t>>>0,_=new RegExp(e.source,p+"g");for(a||(s=new RegExp("^"+_.source+"$(?!\\s)",p));(u=_.exec(r))&&!((c=u.index+u[0].length)>d&&(h.push(r.slice(d,u.index)),!a&&u.length>1&&u[0].replace(s,function(){for(l=1;l<arguments.length-2;l++)void 0===arguments[l]&&(u[l]=void 0)}),u.length>1&&u.index<r.length&&o.apply(h,u.slice(1)),f=u[0].length,d=c,h.length>=g));)_.lastIndex===u.index&&_.lastIndex++;return d===r.length?!f&&_.test("")||h.push(""):h.push(r.slice(d)),h.length>g?h.slice(0,g):h}}else"0".split(void 0,0).length&&(r=function(e,t){return void 0===e&&0===t?[]:i.call(this,e,t)});return[function(n,i){var o=e(this),a=null==n?void 0:n[t];return void 0!==a?a.call(n,o,i):r.call(String(o),n,i)},r]});var defer,channel,port,_anInstance=function(e,t,r,n){if(!(e instanceof t)||void 0!==n&&n in e)throw TypeError(r+": incorrect invocation!");return e},_forOf=createCommonjsModule(function(e){var t={},r={},n=e.exports=function(e,n,i,o,a){var s,u,c,f,l=a?function(){return e}:core_getIteratorMethod(e),h=_ctx(i,o,n?2:1),p=0;if("function"!=typeof l)throw TypeError(e+" is not iterable!");if(_isArrayIter(l)){for(s=_toLength(e.length);s>p;p++)if((f=n?h(_anObject(u=e[p])[0],u[1]):h(e[p]))===t||f===r)return f}else for(c=l.call(e);!(u=c.next()).done;)if((f=_iterCall(c,h,u.value,n))===t||f===r)return f};n.BREAK=t,n.RETURN=r}),SPECIES$2=_wks("species"),_speciesConstructor=function(e,t){var r,n=_anObject(e).constructor;return void 0===n||null==(r=_anObject(n)[SPECIES$2])?t:_aFunction(r)},process=_global.process,setTask=_global.setImmediate,clearTask=_global.clearImmediate,MessageChannel$1=_global.MessageChannel,Dispatch=_global.Dispatch,counter=0,queue={},ONREADYSTATECHANGE="onreadystatechange",run=function(){var e=+this;if(queue.hasOwnProperty(e)){var t=queue[e];delete queue[e],t()}},listener=function(e){run.call(e.data)};setTask&&clearTask||(setTask=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return queue[++counter]=function(){_invoke("function"==typeof e?e:Function(e),t)},defer(counter),counter},clearTask=function(e){delete queue[e]},"process"==_cof(process)?defer=function(e){process.nextTick(_ctx(run,e,1))}:Dispatch&&Dispatch.now?defer=function(e){Dispatch.now(_ctx(run,e,1))}:MessageChannel$1?(port=(channel=new MessageChannel$1).port2,channel.port1.onmessage=listener,defer=_ctx(port.postMessage,port,1)):_global.addEventListener&&"function"==typeof postMessage&&!_global.importScripts?(defer=function(e){_global.postMessage(e+"","*")},_global.addEventListener("message",listener,!1)):defer=ONREADYSTATECHANGE in _domCreate("script")?function(e){_html.appendChild(_domCreate("script"))[ONREADYSTATECHANGE]=function(){_html.removeChild(this),run.call(e)}}:function(e){setTimeout(_ctx(run,e,1),0)});var _task={set:setTask,clear:clearTask},macrotask=_task.set,Observer=_global.MutationObserver||_global.WebKitMutationObserver,process$1=_global.process,Promise$1=_global.Promise,isNode="process"==_cof(process$1),_microtask=function(){var e,t,r,n=function(){var n,i;for(isNode&&(n=process$1.domain)&&n.exit();e;){i=e.fn,e=e.next;try{i()}catch(n){throw e?r():t=void 0,n}}t=void 0,n&&n.enter()};if(isNode)r=function(){process$1.nextTick(n)};else if(!Observer||_global.navigator&&_global.navigator.standalone)if(Promise$1&&Promise$1.resolve){var i=Promise$1.resolve();r=function(){i.then(n)}}else r=function(){macrotask.call(_global,n)};else{var o=!0,a=document.createTextNode("");new Observer(n).observe(a,{characterData:!0}),r=function(){a.data=o=!o}}return function(n){var i={fn:n,next:void 0};t&&(t.next=i),e||(e=i,r()),t=i}};function PromiseCapability(e){var t,r;this.promise=new e(function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n}),this.resolve=_aFunction(t),this.reject=_aFunction(r)}var Internal,newGenericPromiseCapability,OwnPromiseCapability,Wrapper,f$7=function(e){return new PromiseCapability(e)},_newPromiseCapability={f:f$7},_perform=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}},_promiseResolve=function(e,t){if(_anObject(e),_isObject(t)&&t.constructor===e)return t;var r=_newPromiseCapability.f(e);return(0,r.resolve)(t),r.promise},_redefineAll=function(e,t,r){for(var n in t)_redefine(e,n,t[n],r);return e},task=_task.set,microtask=_microtask(),PROMISE="Promise",TypeError$1=_global.TypeError,process$2=_global.process,$Promise=_global[PROMISE],isNode$1="process"==_classof(process$2),empty=function(){},newPromiseCapability=newGenericPromiseCapability=_newPromiseCapability.f,USE_NATIVE$1=!!function(){try{var e=$Promise.resolve(1),t=(e.constructor={})[_wks("species")]=function(e){e(empty,empty)};return(isNode$1||"function"==typeof PromiseRejectionEvent)&&e.then(empty)instanceof t}catch(e){}}(),isThenable=function(e){var t;return!(!_isObject(e)||"function"!=typeof(t=e.then))&&t},notify=function(e,t){if(!e._n){e._n=!0;var r=e._c;microtask(function(){for(var n=e._v,i=1==e._s,o=0,a=function(t){var r,o,a=i?t.ok:t.fail,s=t.resolve,u=t.reject,c=t.domain;try{a?(i||(2==e._h&&onHandleUnhandled(e),e._h=1),!0===a?r=n:(c&&c.enter(),r=a(n),c&&c.exit()),r===t.promise?u(TypeError$1("Promise-chain cycle")):(o=isThenable(r))?o.call(r,s,u):s(r)):u(n)}catch(e){u(e)}};r.length>o;)a(r[o++]);e._c=[],e._n=!1,t&&!e._h&&onUnhandled(e)})}},onUnhandled=function(e){task.call(_global,function(){var t,r,n,i=e._v,o=isUnhandled(e);if(o&&(t=_perform(function(){isNode$1?process$2.emit("unhandledRejection",i,e):(r=_global.onunhandledrejection)?r({promise:e,reason:i}):(n=_global.console)&&n.error&&n.error("Unhandled promise rejection",i)}),e._h=isNode$1||isUnhandled(e)?2:1),e._a=void 0,o&&t.e)throw t.v})},isUnhandled=function(e){return 1!==e._h&&0===(e._a||e._c).length},onHandleUnhandled=function(e){task.call(_global,function(){var t;isNode$1?process$2.emit("rejectionHandled",e):(t=_global.onrejectionhandled)&&t({promise:e,reason:e._v})})},$reject=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),notify(t,!0))},$resolve=function(e){var t,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===e)throw TypeError$1("Promise can't be resolved itself");(t=isThenable(e))?microtask(function(){var n={_w:r,_d:!1};try{t.call(e,_ctx($resolve,n,1),_ctx($reject,n,1))}catch(e){$reject.call(n,e)}}):(r._v=e,r._s=1,notify(r,!1))}catch(e){$reject.call({_w:r,_d:!1},e)}}};USE_NATIVE$1||($Promise=function(e){_anInstance(this,$Promise,PROMISE,"_h"),_aFunction(e),Internal.call(this);try{e(_ctx($resolve,this,1),_ctx($reject,this,1))}catch(e){$reject.call(this,e)}},(Internal=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=_redefineAll($Promise.prototype,{then:function(e,t){var r=newPromiseCapability(_speciesConstructor(this,$Promise));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=isNode$1?process$2.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&¬ify(this,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),OwnPromiseCapability=function(){var e=new Internal;this.promise=e,this.resolve=_ctx($resolve,e,1),this.reject=_ctx($reject,e,1)},_newPromiseCapability.f=newPromiseCapability=function(e){return e===$Promise||e===Wrapper?new OwnPromiseCapability(e):newGenericPromiseCapability(e)}),_export(_export.G+_export.W+_export.F*!USE_NATIVE$1,{Promise:$Promise}),_setToStringTag($Promise,PROMISE),_setSpecies(PROMISE),Wrapper=_core[PROMISE],_export(_export.S+_export.F*!USE_NATIVE$1,PROMISE,{reject:function(e){var t=newPromiseCapability(this);return(0,t.reject)(e),t.promise}}),_export(_export.S+_export.F*!USE_NATIVE$1,PROMISE,{resolve:function(e){return _promiseResolve(_library&&this===Wrapper?$Promise:this,e)}}),_export(_export.S+_export.F*!(USE_NATIVE$1&&_iterDetect(function(e){$Promise.all(e).catch(empty)})),PROMISE,{all:function(e){var t=this,r=newPromiseCapability(t),n=r.resolve,i=r.reject,o=_perform(function(){var r=[],o=0,a=1;_forOf(e,!1,function(e){var s=o++,u=!1;r.push(void 0),a++,t.resolve(e).then(function(e){u||(u=!0,r[s]=e,--a||n(r))},i)}),--a||n(r)});return o.e&&i(o.v),r.promise},race:function(e){var t=this,r=newPromiseCapability(t),n=r.reject,i=_perform(function(){_forOf(e,!1,function(e){t.resolve(e).then(r.resolve,n)})});return i.e&&n(i.v),r.promise}});var _validateCollection=function(e,t){if(!_isObject(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e},dP$5=_objectDp.f,fastKey=_meta.fastKey,SIZE=_descriptors?"_s":"size",getEntry=function(e,t){var r,n=fastKey(t);if("F"!==n)return e._i[n];for(r=e._f;r;r=r.n)if(r.k==t)return r},_collectionStrong={getConstructor:function(e,t,r,n){var i=e(function(e,o){_anInstance(e,i,t,"_i"),e._t=t,e._i=_objectCreate(null),e._f=void 0,e._l=void 0,e[SIZE]=0,null!=o&&_forOf(o,r,e[n],e)});return _redefineAll(i.prototype,{clear:function(){for(var e=_validateCollection(this,t),r=e._i,n=e._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete r[n.i];e._f=e._l=void 0,e[SIZE]=0},delete:function(e){var r=_validateCollection(this,t),n=getEntry(r,e);if(n){var i=n.n,o=n.p;delete r._i[n.i],n.r=!0,o&&(o.n=i),i&&(i.p=o),r._f==n&&(r._f=i),r._l==n&&(r._l=o),r[SIZE]--}return!!n},forEach:function(e){_validateCollection(this,t);for(var r,n=_ctx(e,arguments.length>1?arguments[1]:void 0,3);r=r?r.n:this._f;)for(n(r.v,r.k,this);r&&r.r;)r=r.p},has:function(e){return!!getEntry(_validateCollection(this,t),e)}}),_descriptors&&dP$5(i.prototype,"size",{get:function(){return _validateCollection(this,t)[SIZE]}}),i},def:function(e,t,r){var n,i,o=getEntry(e,t);return o?o.v=r:(e._l=o={i:i=fastKey(t,!0),k:t,v:r,p:n=e._l,n:void 0,r:!1},e._f||(e._f=o),n&&(n.n=o),e[SIZE]++,"F"!==i&&(e._i[i]=o)),e},getEntry:getEntry,setStrong:function(e,t,r){_iterDefine(e,t,function(e,r){this._t=_validateCollection(e,t),this._k=r,this._l=void 0},function(){for(var e=this._k,t=this._l;t&&t.r;)t=t.p;return this._t&&(this._l=t=t?t.n:this._t._f)?_iterStep(0,"keys"==e?t.k:"values"==e?t.v:[t.k,t.v]):(this._t=void 0,_iterStep(1))},r?"entries":"values",!r,!0),_setSpecies(t)}},_collection=function(e,t,r,n,i,o){var a=_global[e],s=a,u=i?"set":"add",c=s&&s.prototype,f={},l=function(e){var t=c[e];_redefine(c,e,"delete"==e?function(e){return!(o&&!_isObject(e))&&t.call(this,0===e?0:e)}:"has"==e?function(e){return!(o&&!_isObject(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return o&&!_isObject(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,r){return t.call(this,0===e?0:e,r),this})};if("function"==typeof s&&(o||c.forEach&&!_fails(function(){(new s).entries().next()}))){var h=new s,p=h[u](o?{}:-0,1)!=h,d=_fails(function(){h.has(1)}),g=_iterDetect(function(e){new s(e)}),_=!o&&_fails(function(){for(var e=new s,t=5;t--;)e[u](t,t);return!e.has(-0)});g||((s=t(function(t,r){_anInstance(t,s,e);var n=_inheritIfRequired(new a,t,s);return null!=r&&_forOf(r,i,n[u],n),n})).prototype=c,c.constructor=s),(d||_)&&(l("delete"),l("has"),i&&l("get")),(_||p)&&l(u),o&&c.clear&&delete c.clear}else s=n.getConstructor(t,e,i,u),_redefineAll(s.prototype,r),_meta.NEED=!0;return _setToStringTag(s,e),f[e]=s,_export(_export.G+_export.W+_export.F*(s!=a),f),o||n.setStrong(s,e,i),s},MAP="Map",es6_map=_collection(MAP,function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var t=_collectionStrong.getEntry(_validateCollection(this,MAP),e);return t&&t.v},set:function(e,t){return _collectionStrong.def(_validateCollection(this,MAP),0===e?0:e,t)}},_collectionStrong,!0),SET="Set",es6_set=_collection(SET,function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return _collectionStrong.def(_validateCollection(this,SET),e=0===e?0:e,e)}},_collectionStrong),getWeak=_meta.getWeak,arrayFind=_arrayMethods(5),arrayFindIndex=_arrayMethods(6),id$1=0,uncaughtFrozenStore=function(e){return e._l||(e._l=new UncaughtFrozenStore)},UncaughtFrozenStore=function(){this.a=[]},findUncaughtFrozen=function(e,t){return arrayFind(e.a,function(e){return e[0]===t})};UncaughtFrozenStore.prototype={get:function(e){var t=findUncaughtFrozen(this,e);if(t)return t[1]},has:function(e){return!!findUncaughtFrozen(this,e)},set:function(e,t){var r=findUncaughtFrozen(this,e);r?r[1]=t:this.a.push([e,t])},delete:function(e){var t=arrayFindIndex(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}};var _collectionWeak={getConstructor:function(e,t,r,n){var i=e(function(e,o){_anInstance(e,i,t,"_i"),e._t=t,e._i=id$1++,e._l=void 0,null!=o&&_forOf(o,r,e[n],e)});return _redefineAll(i.prototype,{delete:function(e){if(!_isObject(e))return!1;var r=getWeak(e);return!0===r?uncaughtFrozenStore(_validateCollection(this,t)).delete(e):r&&_has(r,this._i)&&delete r[this._i]},has:function(e){if(!_isObject(e))return!1;var r=getWeak(e);return!0===r?uncaughtFrozenStore(_validateCollection(this,t)).has(e):r&&_has(r,this._i)}}),i},def:function(e,t,r){var n=getWeak(_anObject(t),!0);return!0===n?uncaughtFrozenStore(e).set(t,r):n[e._i]=r,e},ufstore:uncaughtFrozenStore},es6_weakMap=createCommonjsModule(function(e){var t,r=_arrayMethods(0),n=_meta.getWeak,i=Object.isExtensible,o=_collectionWeak.ufstore,a={},s=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},u={get:function(e){if(_isObject(e)){var t=n(e);return!0===t?o(_validateCollection(this,"WeakMap")).get(e):t?t[this._i]:void 0}},set:function(e,t){return _collectionWeak.def(_validateCollection(this,"WeakMap"),e,t)}},c=e.exports=_collection("WeakMap",s,u,_collectionWeak,!0,!0);_fails(function(){return 7!=(new c).set((Object.freeze||Object)(a),7).get(a)})&&(t=_collectionWeak.getConstructor(s,"WeakMap"),_objectAssign(t.prototype,u),_meta.NEED=!0,r(["delete","has","get","set"],function(e){var r=c.prototype,n=r[e];_redefine(r,e,function(r,o){if(_isObject(r)&&!i(r)){this._f||(this._f=new t);var a=this._f[e](r,o);return"set"==e?this:a}return n.call(this,r,o)})}))}),WEAK_SET="WeakSet";_collection(WEAK_SET,function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return _collectionWeak.def(_validateCollection(this,WEAK_SET),e,!0)}},_collectionWeak,!1,!0);for(var Typed,TYPED=_uid("typed_array"),VIEW=_uid("view"),ABV=!(!_global.ArrayBuffer||!_global.DataView),CONSTR=ABV,i$1=0,l=9,TypedArrayConstructors="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");i$1<l;)(Typed=_global[TypedArrayConstructors[i$1++]])?(_hide(Typed.prototype,TYPED,!0),_hide(Typed.prototype,VIEW,!0)):CONSTR=!1;var _typed={ABV:ABV,CONSTR:CONSTR,TYPED:TYPED,VIEW:VIEW},_toIndex=function(e){if(void 0===e)return 0;var t=_toInteger(e),r=_toLength(t);if(t!==r)throw RangeError("Wrong length!");return r},_typedBuffer=createCommonjsModule(function(e,t){var r=_objectGopn.f,n=_objectDp.f,i="prototype",o="Wrong index!",a=_global.ArrayBuffer,s=_global.DataView,u=_global.Math,c=_global.RangeError,f=_global.Infinity,l=a,h=u.abs,p=u.pow,d=u.floor,g=u.log,_=u.LN2,m=_descriptors?"_b":"buffer",y=_descriptors?"_l":"byteLength",v=_descriptors?"_o":"byteOffset";function b(e,t,r){var n,i,o,a=new Array(r),s=8*r-t-1,u=(1<<s)-1,c=u>>1,l=23===t?p(2,-24)-p(2,-77):0,m=0,y=e<0||0===e&&1/e<0?1:0;for((e=h(e))!=e||e===f?(i=e!=e?1:0,n=u):(n=d(g(e)/_),e*(o=p(2,-n))<1&&(n--,o*=2),(e+=n+c>=1?l/o:l*p(2,1-c))*o>=2&&(n++,o/=2),n+c>=u?(i=0,n=u):n+c>=1?(i=(e*o-1)*p(2,t),n+=c):(i=e*p(2,c-1)*p(2,t),n=0));t>=8;a[m++]=255&i,i/=256,t-=8);for(n=n<<t|i,s+=t;s>0;a[m++]=255&n,n/=256,s-=8);return a[--m]|=128*y,a}function w(e,t,r){var n,i=8*r-t-1,o=(1<<i)-1,a=o>>1,s=i-7,u=r-1,c=e[u--],l=127&c;for(c>>=7;s>0;l=256*l+e[u],u--,s-=8);for(n=l&(1<<-s)-1,l>>=-s,s+=t;s>0;n=256*n+e[u],u--,s-=8);if(0===l)l=1-a;else{if(l===o)return n?NaN:c?-f:f;n+=p(2,t),l-=a}return(c?-1:1)*n*p(2,l-t)}function E(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function O(e){return[255&e]}function S(e){return[255&e,e>>8&255]}function P(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function T(e){return b(e,52,8)}function x(e){return b(e,23,4)}function I(e,t,r){n(e[i],t,{get:function(){return this[r]}})}function R(e,t,r,n){var i=_toIndex(+r);if(i+t>e[y])throw c(o);var a=e[m]._b,s=i+e[v],u=a.slice(s,s+t);return n?u:u.reverse()}function C(e,t,r,n,i,a){var s=_toIndex(+r);if(s+t>e[y])throw c(o);for(var u=e[m]._b,f=s+e[v],l=n(+i),h=0;h<t;h++)u[f+h]=l[a?h:t-h-1]}if(_typed.ABV){if(!_fails(function(){a(1)})||!_fails(function(){new a(-1)})||_fails(function(){return new a,new a(1.5),new a(NaN),"ArrayBuffer"!=a.name})){for(var A,$=(a=function(e){return _anInstance(this,a),new l(_toIndex(e))})[i]=l[i],k=r(l),N=0;k.length>N;)(A=k[N++])in a||_hide(a,A,l[A]);$.constructor=a}var B=new s(new a(2)),j=s[i].setInt8;B.setInt8(0,2147483648),B.setInt8(1,2147483649),!B.getInt8(0)&&B.getInt8(1)||_redefineAll(s[i],{setInt8:function(e,t){j.call(this,e,t<<24>>24)},setUint8:function(e,t){j.call(this,e,t<<24>>24)}},!0)}else a=function(e){_anInstance(this,a,"ArrayBuffer");var t=_toIndex(e);this._b=_arrayFill.call(new Array(t),0),this[y]=t},s=function(e,t,r){_anInstance(this,s,"DataView"),_anInstance(e,a,"DataView");var n=e[y],i=_toInteger(t);if(i<0||i>n)throw c("Wrong offset!");if(i+(r=void 0===r?n-i:_toLength(r))>n)throw c("Wrong length!");this[m]=e,this[v]=i,this[y]=r},_descriptors&&(I(a,"byteLength","_l"),I(s,"buffer","_b"),I(s,"byteLength","_l"),I(s,"byteOffset","_o")),_redefineAll(s[i],{getInt8:function(e){return R(this,1,e)[0]<<24>>24},getUint8:function(e){return R(this,1,e)[0]},getInt16:function(e){var t=R(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=R(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return E(R(this,4,e,arguments[1]))},getUint32:function(e){return E(R(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return w(R(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return w(R(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){C(this,1,e,O,t)},setUint8:function(e,t){C(this,1,e,O,t)},setInt16:function(e,t){C(this,2,e,S,t,arguments[2])},setUint16:function(e,t){C(this,2,e,S,t,arguments[2])},setInt32:function(e,t){C(this,4,e,P,t,arguments[2])},setUint32:function(e,t){C(this,4,e,P,t,arguments[2])},setFloat32:function(e,t){C(this,4,e,x,t,arguments[2])},setFloat64:function(e,t){C(this,8,e,T,t,arguments[2])}});_setToStringTag(a,"ArrayBuffer"),_setToStringTag(s,"DataView"),_hide(s[i],_typed.VIEW,!0),t.ArrayBuffer=a,t.DataView=s}),ArrayBuffer$1=_global.ArrayBuffer,$ArrayBuffer=_typedBuffer.ArrayBuffer,$DataView=_typedBuffer.DataView,$isView=_typed.ABV&&ArrayBuffer$1.isView,$slice=$ArrayBuffer.prototype.slice,VIEW$1=_typed.VIEW,ARRAY_BUFFER="ArrayBuffer";_export(_export.G+_export.W+_export.F*(ArrayBuffer$1!==$ArrayBuffer),{ArrayBuffer:$ArrayBuffer}),_export(_export.S+_export.F*!_typed.CONSTR,ARRAY_BUFFER,{isView:function(e){return $isView&&$isView(e)||_isObject(e)&&VIEW$1 in e}}),_export(_export.P+_export.U+_export.F*_fails(function(){return!new $ArrayBuffer(2).slice(1,void 0).byteLength}),ARRAY_BUFFER,{slice:function(e,t){if(void 0!==$slice&&void 0===t)return $slice.call(_anObject(this),e);for(var r=_anObject(this).byteLength,n=_toAbsoluteIndex(e,r),i=_toAbsoluteIndex(void 0===t?r:t,r),o=new(_speciesConstructor(this,$ArrayBuffer))(_toLength(i-n)),a=new $DataView(this),s=new $DataView(o),u=0;n<i;)s.setUint8(u++,a.getUint8(n++));return o}}),_setSpecies(ARRAY_BUFFER),_export(_export.G+_export.W+_export.F*!_typed.ABV,{DataView:_typedBuffer.DataView});var _typedArray=createCommonjsModule(function(e){if(_descriptors){var t=_global,r=_fails,n=_export,i=_typed,o=_typedBuffer,a=_ctx,s=_anInstance,u=_propertyDesc,c=_hide,f=_redefineAll,l=_toInteger,h=_toLength,p=_toIndex,d=_toAbsoluteIndex,g=_toPrimitive,_=_has,m=_classof,y=_isObject,v=_toObject,b=_isArrayIter,w=_objectCreate,E=_objectGpo,O=_objectGopn.f,S=core_getIteratorMethod,P=_uid,T=_wks,x=_arrayMethods,I=_arrayIncludes,R=_speciesConstructor,C=es6_array_iterator,A=_iterators,$=_iterDetect,k=_setSpecies,N=_arrayFill,B=_arrayCopyWithin,j=_objectDp,D=_objectGopd,L=j.f,M=D.f,U=t.RangeError,F=t.TypeError,H=t.Uint8Array,V=Array.prototype,q=o.ArrayBuffer,K=o.DataView,G=x(0),W=x(2),z=x(3),Y=x(4),J=x(5),X=x(6),Q=I(!0),Z=I(!1),ee=C.values,te=C.keys,re=C.entries,ne=V.lastIndexOf,ie=V.reduce,oe=V.reduceRight,ae=V.join,se=V.sort,ue=V.slice,ce=V.toString,fe=V.toLocaleString,le=T("iterator"),he=T("toStringTag"),pe=P("typed_constructor"),de=P("def_constructor"),ge=i.CONSTR,_e=i.TYPED,me=i.VIEW,ye=x(1,function(e,t){return Oe(R(e,e[de]),t)}),ve=r(function(){return 1===new H(new Uint16Array([1]).buffer)[0]}),be=!!H&&!!H.prototype.set&&r(function(){new H(1).set({})}),we=function(e,t){var r=l(e);if(r<0||r%t)throw U("Wrong offset!");return r},Ee=function(e){if(y(e)&&_e in e)return e;throw F(e+" is not a typed array!")},Oe=function(e,t){if(!(y(e)&&pe in e))throw F("It is not a typed array constructor!");return new e(t)},Se=function(e,t){return Pe(R(e,e[de]),t)},Pe=function(e,t){for(var r=0,n=t.length,i=Oe(e,n);n>r;)i[r]=t[r++];return i},Te=function(e,t,r){L(e,t,{get:function(){return this._d[r]}})},xe=function(e){var t,r,n,i,o,s,u=v(e),c=arguments.length,f=c>1?arguments[1]:void 0,l=void 0!==f,p=S(u);if(null!=p&&!b(p)){for(s=p.call(u),n=[],t=0;!(o=s.next()).done;t++)n.push(o.value);u=n}for(l&&c>2&&(f=a(f,arguments[2],2)),t=0,r=h(u.length),i=Oe(this,r);r>t;t++)i[t]=l?f(u[t],t):u[t];return i},Ie=function(){for(var e=0,t=arguments.length,r=Oe(this,t);t>e;)r[e]=arguments[e++];return r},Re=!!H&&r(function(){fe.call(new H(1))}),Ce=function(){return fe.apply(Re?ue.call(Ee(this)):Ee(this),arguments)},Ae={copyWithin:function(e,t){return B.call(Ee(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return Y(Ee(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return N.apply(Ee(this),arguments)},filter:function(e){return Se(this,W(Ee(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return J(Ee(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return X(Ee(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){G(Ee(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return Z(Ee(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return Q(Ee(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return ae.apply(Ee(this),arguments)},lastIndexOf:function(e){return ne.apply(Ee(this),arguments)},map:function(e){return ye(Ee(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return ie.apply(Ee(this),arguments)},reduceRight:function(e){return oe.apply(Ee(this),arguments)},reverse:function(){for(var e,t=Ee(this).length,r=Math.floor(t/2),n=0;n<r;)e=this[n],this[n++]=this[--t],this[t]=e;return this},some:function(e){return z(Ee(this),e,arguments.length>1?arguments[1]:void 0)},sort:function(e){return se.call(Ee(this),e)},subarray:function(e,t){var r=Ee(this),n=r.length,i=d(e,n);return new(R(r,r[de]))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,h((void 0===t?n:d(t,n))-i))}},$e=function(e,t){return Se(this,ue.call(Ee(this),e,t))},ke=function(e){Ee(this);var t=we(arguments[1],1),r=this.length,n=v(e),i=h(n.length),o=0;if(i+t>r)throw U("Wrong length!");for(;o<i;)this[t+o]=n[o++]},Ne={entries:function(){return re.call(Ee(this))},keys:function(){return te.call(Ee(this))},values:function(){return ee.call(Ee(this))}},Be=function(e,t){return y(e)&&e[_e]&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},je=function(e,t){return Be(e,t=g(t,!0))?u(2,e[t]):M(e,t)},De=function(e,t,r){return!(Be(e,t=g(t,!0))&&y(r)&&_(r,"value"))||_(r,"get")||_(r,"set")||r.configurable||_(r,"writable")&&!r.writable||_(r,"enumerable")&&!r.enumerable?L(e,t,r):(e[t]=r.value,e)};ge||(D.f=je,j.f=De),n(n.S+n.F*!ge,"Object",{getOwnPropertyDescriptor:je,defineProperty:De}),r(function(){ce.call({})})&&(ce=fe=function(){return ae.call(this)});var Le=f({},Ae);f(Le,Ne),c(Le,le,Ne.values),f(Le,{slice:$e,set:ke,constructor:function(){},toString:ce,toLocaleString:Ce}),Te(Le,"buffer","b"),Te(Le,"byteOffset","o"),Te(Le,"byteLength","l"),Te(Le,"length","e"),L(Le,he,{get:function(){return this[_e]}}),e.exports=function(e,o,a,u){var f=e+((u=!!u)?"Clamped":"")+"Array",l="get"+e,d="set"+e,g=t[f],_=g||{},v=g&&E(g),b=!g||!i.ABV,S={},P=g&&g.prototype,T=function(e,t){L(e,t,{get:function(){return function(e,t){var r=e._d;return r.v[l](t*o+r.o,ve)}(this,t)},set:function(e){return function(e,t,r){var n=e._d;u&&(r=(r=Math.round(r))<0?0:r>255?255:255&r),n.v[d](t*o+n.o,r,ve)}(this,t,e)},enumerable:!0})};b?(g=a(function(e,t,r,n){s(e,g,f,"_d");var i,a,u,l,d=0,_=0;if(y(t)){if(!(t instanceof q||"ArrayBuffer"==(l=m(t))||"SharedArrayBuffer"==l))return _e in t?Pe(g,t):xe.call(g,t);i=t,_=we(r,o);var v=t.byteLength;if(void 0===n){if(v%o)throw U("Wrong length!");if((a=v-_)<0)throw U("Wrong length!")}else if((a=h(n)*o)+_>v)throw U("Wrong length!");u=a/o}else u=p(t),i=new q(a=u*o);for(c(e,"_d",{b:i,o:_,l:a,e:u,v:new K(i)});d<u;)T(e,d++)}),P=g.prototype=w(Le),c(P,"constructor",g)):r(function(){g(1)})&&r(function(){new g(-1)})&&$(function(e){new g,new g(null),new g(1.5),new g(e)},!0)||(g=a(function(e,t,r,n){var i;return s(e,g,f),y(t)?t instanceof q||"ArrayBuffer"==(i=m(t))||"SharedArrayBuffer"==i?void 0!==n?new _(t,we(r,o),n):void 0!==r?new _(t,we(r,o)):new _(t):_e in t?Pe(g,t):xe.call(g,t):new _(p(t))}),G(v!==Function.prototype?O(_).concat(O(v)):O(_),function(e){e in g||c(g,e,_[e])}),g.prototype=P,P.constructor=g);var x=P[le],I=!!x&&("values"==x.name||null==x.name),R=Ne.values;c(g,pe,!0),c(P,_e,f),c(P,me,!0),c(P,de,g),(u?new g(1)[he]==f:he in P)||L(P,he,{get:function(){return f}}),S[f]=g,n(n.G+n.W+n.F*(g!=_),S),n(n.S,f,{BYTES_PER_ELEMENT:o}),n(n.S+n.F*r(function(){_.of.call(g,1)}),f,{from:xe,of:Ie}),"BYTES_PER_ELEMENT"in P||c(P,"BYTES_PER_ELEMENT",o),n(n.P,f,Ae),k(f),n(n.P+n.F*be,f,{set:ke}),n(n.P+n.F*!I,f,Ne),P.toString!=ce&&(P.toString=ce),n(n.P+n.F*r(function(){new g(1).slice()}),f,{slice:$e}),n(n.P+n.F*(r(function(){return[1,2].toLocaleString()!=new g([1,2]).toLocaleString()})||!r(function(){P.toLocaleString.call([1,2])})),f,{toLocaleString:Ce}),A[f]=I?x:R,I||c(P,le,R)}}else e.exports=function(){}});_typedArray("Int8",1,function(e){return function(t,r,n){return e(this,t,r,n)}}),_typedArray("Uint8",1,function(e){return function(t,r,n){return e(this,t,r,n)}}),_typedArray("Uint8",1,function(e){return function(t,r,n){return e(this,t,r,n)}},!0),_typedArray("Int16",2,function(e){return function(t,r,n){return e(this,t,r,n)}}),_typedArray("Uint16",2,function(e){return function(t,r,n){return e(this,t,r,n)}}),_typedArray("Int32",4,function(e){return function(t,r,n){return e(this,t,r,n)}}),_typedArray("Uint32",4,function(e){return function(t,r,n){return e(this,t,r,n)}}),_typedArray("Float32",4,function(e){return function(t,r,n){return e(this,t,r,n)}}),_typedArray("Float64",8,function(e){return function(t,r,n){return e(this,t,r,n)}});var rApply=(_global.Reflect||{}).apply,fApply=Function.apply;_export(_export.S+_export.F*!_fails(function(){rApply(function(){})}),"Reflect",{apply:function(e,t,r){var n=_aFunction(e),i=_anObject(r);return rApply?rApply(n,t,i):fApply.call(n,t,i)}});var rConstruct=(_global.Reflect||{}).construct,NEW_TARGET_BUG=_fails(function(){function e(){}return!(rConstruct(function(){},[],e)instanceof e)}),ARGS_BUG=!_fails(function(){rConstruct(function(){})});_export(_export.S+_export.F*(NEW_TARGET_BUG||ARGS_BUG),"Reflect",{construct:function(e,t){_aFunction(e),_anObject(t);var r=arguments.length<3?e:_aFunction(arguments[2]);if(ARGS_BUG&&!NEW_TARGET_BUG)return rConstruct(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return n.push.apply(n,t),new(_bind.apply(e,n))}var i=r.prototype,o=_objectCreate(_isObject(i)?i:Object.prototype),a=Function.apply.call(e,o,t);return _isObject(a)?a:o}}),_export(_export.S+_export.F*_fails(function(){Reflect.defineProperty(_objectDp.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(e,t,r){_anObject(e),t=_toPrimitive(t,!0),_anObject(r);try{return _objectDp.f(e,t,r),!0}catch(e){return!1}}});var gOPD$3=_objectGopd.f;_export(_export.S,"Reflect",{deleteProperty:function(e,t){var r=gOPD$3(_anObject(e),t);return!(r&&!r.configurable)&&delete e[t]}});var Enumerate=function(e){this._t=_anObject(e),this._i=0;var t,r=this._k=[];for(t in e)r.push(t)};function get(e,t){var r,n,i=arguments.length<3?e:arguments[2];return _anObject(e)===i?e[t]:(r=_objectGopd.f(e,t))?_has(r,"value")?r.value:void 0!==r.get?r.get.call(i):void 0:_isObject(n=_objectGpo(e))?get(n,t,i):void 0}_iterCreate(Enumerate,"Object",function(){var e,t=this._k;do{if(this._i>=t.length)return{value:void 0,done:!0}}while(!((e=t[this._i++])in this._t));return{value:e,done:!1}}),_export(_export.S,"Reflect",{enumerate:function(e){return new Enumerate(e)}}),_export(_export.S,"Reflect",{get:get}),_export(_export.S,"Reflect",{getOwnPropertyDescriptor:function(e,t){return _objectGopd.f(_anObject(e),t)}}),_export(_export.S,"Reflect",{getPrototypeOf:function(e){return _objectGpo(_anObject(e))}}),_export(_export.S,"Reflect",{has:function(e,t){return t in e}});var $isExtensible=Object.isExtensible;_export(_export.S,"Reflect",{isExtensible:function(e){return _anObject(e),!$isExtensible||$isExtensible(e)}});var Reflect$1=_global.Reflect,_ownKeys=Reflect$1&&Reflect$1.ownKeys||function(e){var t=_objectGopn.f(_anObject(e)),r=_objectGops.f;return r?t.concat(r(e)):t};_export(_export.S,"Reflect",{ownKeys:_ownKeys});var $preventExtensions=Object.preventExtensions;function set(e,t,r){var n,i,o=arguments.length<4?e:arguments[3],a=_objectGopd.f(_anObject(e),t);if(!a){if(_isObject(i=_objectGpo(e)))return set(i,t,r,o);a=_propertyDesc(0)}return _has(a,"value")?!(!1===a.writable||!_isObject(o))&&((n=_objectGopd.f(o,t)||_propertyDesc(0)).value=r,_objectDp.f(o,t,n),!0):void 0!==a.set&&(a.set.call(o,r),!0)}_export(_export.S,"Reflect",{preventExtensions:function(e){_anObject(e);try{return $preventExtensions&&$preventExtensions(e),!0}catch(e){return!1}}}),_export(_export.S,"Reflect",{set:set}),_setProto&&_export(_export.S,"Reflect",{setPrototypeOf:function(e,t){_setProto.check(e,t);try{return _setProto.set(e,t),!0}catch(e){return!1}}});var $includes=_arrayIncludes(!0);_export(_export.P,"Array",{includes:function(e){return $includes(this,e,arguments.length>1?arguments[1]:void 0)}}),_addToUnscopables("includes");var IS_CONCAT_SPREADABLE=_wks("isConcatSpreadable");function flattenIntoArray(e,t,r,n,i,o,a,s){for(var u,c,f=i,l=0,h=!!a&&_ctx(a,s,3);l<n;){if(l in r){if(u=h?h(r[l],l,t):r[l],c=!1,_isObject(u)&&(c=void 0!==(c=u[IS_CONCAT_SPREADABLE])?!!c:_isArray(u)),c&&o>0)f=flattenIntoArray(e,t,u,_toLength(u.length),f,o-1)-1;else{if(f>=9007199254740991)throw TypeError();e[f]=u}f++}l++}return f}var _flattenIntoArray=flattenIntoArray;_export(_export.P,"Array",{flatMap:function(e){var t,r,n=_toObject(this);return _aFunction(e),t=_toLength(n.length),r=_arraySpeciesCreate(n,0),_flattenIntoArray(r,n,n,t,0,1,e,arguments[1]),r}}),_addToUnscopables("flatMap"),_export(_export.P,"Array",{flatten:function(){var e=arguments[0],t=_toObject(this),r=_toLength(t.length),n=_arraySpeciesCreate(t,0);return _flattenIntoArray(n,t,t,r,0,void 0===e?1:_toInteger(e)),n}}),_addToUnscopables("flatten");var $at$2=_stringAt(!0);_export(_export.P,"String",{at:function(e){return $at$2(this,e)}});var _stringPad=function(e,t,r,n){var i=String(_defined(e)),o=i.length,a=void 0===r?" ":String(r),s=_toLength(t);if(s<=o||""==a)return i;var u=s-o,c=_stringRepeat.call(a,Math.ceil(u/a.length));return c.length>u&&(c=c.slice(0,u)),n?c+i:i+c},navigator$1=_global.navigator,_userAgent=navigator$1&&navigator$1.userAgent||"";_export(_export.P+_export.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(_userAgent),"String",{padStart:function(e){return _stringPad(this,e,arguments.length>1?arguments[1]:void 0,!0)}}),_export(_export.P+_export.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(_userAgent),"String",{padEnd:function(e){return _stringPad(this,e,arguments.length>1?arguments[1]:void 0,!1)}}),_stringTrim("trimLeft",function(e){return function(){return e(this,1)}},"trimStart"),_stringTrim("trimRight",function(e){return function(){return e(this,2)}},"trimEnd");var RegExpProto=RegExp.prototype,$RegExpStringIterator=function(e,t){this._r=e,this._s=t};_iterCreate($RegExpStringIterator,"RegExp String",function(){var e=this._r.exec(this._s);return{value:e,done:null===e}}),_export(_export.P,"String",{matchAll:function(e){if(_defined(this),!_isRegexp(e))throw TypeError(e+" is not a regexp!");var t=String(this),r="flags"in RegExpProto?String(e.flags):_flags.call(e),n=new RegExp(e.source,~r.indexOf("g")?r:"g"+r);return n.lastIndex=_toLength(e.lastIndex),new $RegExpStringIterator(n,t)}}),_wksDefine("asyncIterator"),_wksDefine("observable"),_export(_export.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,r,n=_toIobject(e),i=_objectGopd.f,o=_ownKeys(n),a={},s=0;o.length>s;)void 0!==(r=i(n,t=o[s++]))&&_createProperty(a,t,r);return a}});var isEnum$1=_objectPie.f,_objectToArray=function(e){return function(t){for(var r,n=_toIobject(t),i=_objectKeys(n),o=i.length,a=0,s=[];o>a;)isEnum$1.call(n,r=i[a++])&&s.push(e?[r,n[r]]:n[r]);return s}},$values=_objectToArray(!1);_export(_export.S,"Object",{values:function(e){return $values(e)}});var $entries=_objectToArray(!0);_export(_export.S,"Object",{entries:function(e){return $entries(e)}});var _objectForcedPam=!_fails(function(){var e=Math.random();__defineSetter__.call(null,e,function(){}),delete _global[e]});_descriptors&&_export(_export.P+_objectForcedPam,"Object",{__defineGetter__:function(e,t){_objectDp.f(_toObject(this),e,{get:_aFunction(t),enumerable:!0,configurable:!0})}}),_descriptors&&_export(_export.P+_objectForcedPam,"Object",{__defineSetter__:function(e,t){_objectDp.f(_toObject(this),e,{set:_aFunction(t),enumerable:!0,configurable:!0})}});var getOwnPropertyDescriptor=_objectGopd.f;_descriptors&&_export(_export.P+_objectForcedPam,"Object",{__lookupGetter__:function(e){var t,r=_toObject(this),n=_toPrimitive(e,!0);do{if(t=getOwnPropertyDescriptor(r,n))return t.get}while(r=_objectGpo(r))}});var getOwnPropertyDescriptor$1=_objectGopd.f;_descriptors&&_export(_export.P+_objectForcedPam,"Object",{__lookupSetter__:function(e){var t,r=_toObject(this),n=_toPrimitive(e,!0);do{if(t=getOwnPropertyDescriptor$1(r,n))return t.set}while(r=_objectGpo(r))}});var _arrayFromIterable=function(e,t){var r=[];return _forOf(e,!1,r.push,r,t),r},_collectionToJson=function(e){return function(){if(_classof(this)!=e)throw TypeError(e+"#toJSON isn't generic");return _arrayFromIterable(this)}};_export(_export.P+_export.R,"Map",{toJSON:_collectionToJson("Map")}),_export(_export.P+_export.R,"Set",{toJSON:_collectionToJson("Set")});var _setCollectionOf=function(e){_export(_export.S,e,{of:function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];return new this(t)}})};_setCollectionOf("Map"),_setCollectionOf("Set"),_setCollectionOf("WeakMap"),_setCollectionOf("WeakSet");var _setCollectionFrom=function(e){_export(_export.S,e,{from:function(e){var t,r,n,i,o=arguments[1];return _aFunction(this),(t=void 0!==o)&&_aFunction(o),null==e?new this:(r=[],t?(n=0,i=_ctx(o,arguments[2],2),_forOf(e,!1,function(e){r.push(i(e,n++))})):_forOf(e,!1,r.push,r),new this(r))}})};_setCollectionFrom("Map"),_setCollectionFrom("Set"),_setCollectionFrom("WeakMap"),_setCollectionFrom("WeakSet"),_export(_export.G,{global:_global}),_export(_export.S,"System",{global:_global}),_export(_export.S,"Error",{isError:function(e){return"Error"===_cof(e)}}),_export(_export.S,"Math",{clamp:function(e,t,r){return Math.min(r,Math.max(t,e))}}),_export(_export.S,"Math",{DEG_PER_RAD:Math.PI/180});var RAD_PER_DEG=180/Math.PI;_export(_export.S,"Math",{degrees:function(e){return e*RAD_PER_DEG}});var _mathScale=Math.scale||function(e,t,r,n,i){return 0===arguments.length||e!=e||t!=t||r!=r||n!=n||i!=i?NaN:e===1/0||e===-1/0?e:(e-t)*(i-n)/(r-t)+n};_export(_export.S,"Math",{fscale:function(e,t,r,n,i){return _mathFround(_mathScale(e,t,r,n,i))}}),_export(_export.S,"Math",{iaddh:function(e,t,r,n){var i=e>>>0,o=r>>>0;return(t>>>0)+(n>>>0)+((i&o|(i|o)&~(i+o>>>0))>>>31)|0}}),_export(_export.S,"Math",{isubh:function(e,t,r,n){var i=e>>>0,o=r>>>0;return(t>>>0)-(n>>>0)-((~i&o|~(i^o)&i-o>>>0)>>>31)|0}}),_export(_export.S,"Math",{imulh:function(e,t){var r=+e,n=+t,i=65535&r,o=65535&n,a=r>>16,s=n>>16,u=(a*o>>>0)+(i*o>>>16);return a*s+(u>>16)+((i*s>>>0)+(65535&u)>>16)}}),_export(_export.S,"Math",{RAD_PER_DEG:180/Math.PI});var DEG_PER_RAD=Math.PI/180;_export(_export.S,"Math",{radians:function(e){return e*DEG_PER_RAD}}),_export(_export.S,"Math",{scale:_mathScale}),_export(_export.S,"Math",{umulh:function(e,t){var r=+e,n=+t,i=65535&r,o=65535&n,a=r>>>16,s=n>>>16,u=(a*o>>>0)+(i*o>>>16);return a*s+(u>>>16)+((i*s>>>0)+(65535&u)>>>16)}}),_export(_export.S,"Math",{signbit:function(e){return(e=+e)!=e?e:0==e?1/e==1/0:e>0}}),_export(_export.P+_export.R,"Promise",{finally:function(e){var t=_speciesConstructor(this,_core.Promise||_global.Promise),r="function"==typeof e;return this.then(r?function(r){return _promiseResolve(t,e()).then(function(){return r})}:e,r?function(r){return _promiseResolve(t,e()).then(function(){throw r})}:e)}}),_export(_export.S,"Promise",{try:function(e){var t=_newPromiseCapability.f(this),r=_perform(e);return(r.e?t.reject:t.resolve)(r.v),t.promise}});var shared$1=_shared("metadata"),store$1=shared$1.store||(shared$1.store=new es6_weakMap),getOrCreateMetadataMap=function(e,t,r){var n=store$1.get(e);if(!n){if(!r)return;store$1.set(e,n=new es6_map)}var i=n.get(t);if(!i){if(!r)return;n.set(t,i=new es6_map)}return i},ordinaryHasOwnMetadata=function(e,t,r){var n=getOrCreateMetadataMap(t,r,!1);return void 0!==n&&n.has(e)},ordinaryGetOwnMetadata=function(e,t,r){var n=getOrCreateMetadataMap(t,r,!1);return void 0===n?void 0:n.get(e)},ordinaryDefineOwnMetadata=function(e,t,r,n){getOrCreateMetadataMap(r,n,!0).set(e,t)},ordinaryOwnMetadataKeys=function(e,t){var r=getOrCreateMetadataMap(e,t,!1),n=[];return r&&r.forEach(function(e,t){n.push(t)}),n},toMetaKey=function(e){return void 0===e||"symbol"==typeof e?e:String(e)},exp$3=function(e){_export(_export.S,"Reflect",e)},_metadata={store:store$1,map:getOrCreateMetadataMap,has:ordinaryHasOwnMetadata,get:ordinaryGetOwnMetadata,set:ordinaryDefineOwnMetadata,keys:ordinaryOwnMetadataKeys,key:toMetaKey,exp:exp$3},toMetaKey$1=_metadata.key,ordinaryDefineOwnMetadata$1=_metadata.set;_metadata.exp({defineMetadata:function(e,t,r,n){ordinaryDefineOwnMetadata$1(e,t,_anObject(r),toMetaKey$1(n))}});var toMetaKey$2=_metadata.key,getOrCreateMetadataMap$1=_metadata.map,store$2=_metadata.store;_metadata.exp({deleteMetadata:function(e,t){var r=arguments.length<3?void 0:toMetaKey$2(arguments[2]),n=getOrCreateMetadataMap$1(_anObject(t),r,!1);if(void 0===n||!n.delete(e))return!1;if(n.size)return!0;var i=store$2.get(t);return i.delete(r),!!i.size||store$2.delete(t)}});var ordinaryHasOwnMetadata$1=_metadata.has,ordinaryGetOwnMetadata$1=_metadata.get,toMetaKey$3=_metadata.key,ordinaryGetMetadata=function(e,t,r){if(ordinaryHasOwnMetadata$1(e,t,r))return ordinaryGetOwnMetadata$1(e,t,r);var n=_objectGpo(t);return null!==n?ordinaryGetMetadata(e,n,r):void 0};_metadata.exp({getMetadata:function(e,t){return ordinaryGetMetadata(e,_anObject(t),arguments.length<3?void 0:toMetaKey$3(arguments[2]))}});var ordinaryOwnMetadataKeys$1=_metadata.keys,toMetaKey$4=_metadata.key,ordinaryMetadataKeys=function(e,t){var r=ordinaryOwnMetadataKeys$1(e,t),n=_objectGpo(e);if(null===n)return r;var i=ordinaryMetadataKeys(n,t);return i.length?r.length?_arrayFromIterable(new es6_set(r.concat(i))):i:r};_metadata.exp({getMetadataKeys:function(e){return ordinaryMetadataKeys(_anObject(e),arguments.length<2?void 0:toMetaKey$4(arguments[1]))}});var ordinaryGetOwnMetadata$2=_metadata.get,toMetaKey$5=_metadata.key;_metadata.exp({getOwnMetadata:function(e,t){return ordinaryGetOwnMetadata$2(e,_anObject(t),arguments.length<3?void 0:toMetaKey$5(arguments[2]))}});var ordinaryOwnMetadataKeys$2=_metadata.keys,toMetaKey$6=_metadata.key;_metadata.exp({getOwnMetadataKeys:function(e){return ordinaryOwnMetadataKeys$2(_anObject(e),arguments.length<2?void 0:toMetaKey$6(arguments[1]))}});var ordinaryHasOwnMetadata$2=_metadata.has,toMetaKey$7=_metadata.key,ordinaryHasMetadata=function(e,t,r){if(ordinaryHasOwnMetadata$2(e,t,r))return!0;var n=_objectGpo(t);return null!==n&&ordinaryHasMetadata(e,n,r)};_metadata.exp({hasMetadata:function(e,t){return ordinaryHasMetadata(e,_anObject(t),arguments.length<3?void 0:toMetaKey$7(arguments[2]))}});var ordinaryHasOwnMetadata$3=_metadata.has,toMetaKey$8=_metadata.key;_metadata.exp({hasOwnMetadata:function(e,t){return ordinaryHasOwnMetadata$3(e,_anObject(t),arguments.length<3?void 0:toMetaKey$8(arguments[2]))}});var toMetaKey$9=_metadata.key,ordinaryDefineOwnMetadata$2=_metadata.set;_metadata.exp({metadata:function(e,t){return function(r,n){ordinaryDefineOwnMetadata$2(e,t,(void 0!==n?_anObject:_aFunction)(r),toMetaKey$9(n))}}});var microtask$1=_microtask(),process$3=_global.process,isNode$2="process"==_cof(process$3);_export(_export.G,{asap:function(e){var t=isNode$2&&process$3.domain;microtask$1(t?t.bind(e):e)}});var microtask$2=_microtask(),OBSERVABLE=_wks("observable"),RETURN=_forOf.RETURN,getMethod=function(e){return null==e?void 0:_aFunction(e)},cleanupSubscription=function(e){var t=e._c;t&&(e._c=void 0,t())},subscriptionClosed=function(e){return void 0===e._o},closeSubscription=function(e){subscriptionClosed(e)||(e._o=void 0,cleanupSubscription(e))},Subscription=function(e,t){_anObject(e),this._c=void 0,this._o=e,e=new SubscriptionObserver(this);try{var r=t(e),n=r;null!=r&&("function"==typeof r.unsubscribe?r=function(){n.unsubscribe()}:_aFunction(r),this._c=r)}catch(t){return void e.error(t)}subscriptionClosed(this)&&cleanupSubscription(this)};Subscription.prototype=_redefineAll({},{unsubscribe:function(){closeSubscription(this)}});var SubscriptionObserver=function(e){this._s=e};SubscriptionObserver.prototype=_redefineAll({},{next:function(e){var t=this._s;if(!subscriptionClosed(t)){var r=t._o;try{var n=getMethod(r.next);if(n)return n.call(r,e)}catch(e){try{closeSubscription(t)}finally{throw e}}}},error:function(e){var t=this._s;if(subscriptionClosed(t))throw e;var r=t._o;t._o=void 0;try{var n=getMethod(r.error);if(!n)throw e;e=n.call(r,e)}catch(e){try{cleanupSubscription(t)}finally{throw e}}return cleanupSubscription(t),e},complete:function(e){var t=this._s;if(!subscriptionClosed(t)){var r=t._o;t._o=void 0;try{var n=getMethod(r.complete);e=n?n.call(r,e):void 0}catch(e){try{cleanupSubscription(t)}finally{throw e}}return cleanupSubscription(t),e}}});var $Observable=function(e){_anInstance(this,$Observable,"Observable","_f")._f=_aFunction(e)};_redefineAll($Observable.prototype,{subscribe:function(e){return new Subscription(e,this._f)},forEach:function(e){var t=this;return new(_core.Promise||_global.Promise)(function(r,n){_aFunction(e);var i=t.subscribe({next:function(t){try{return e(t)}catch(e){n(e),i.unsubscribe()}},error:n,complete:r})})}}),_redefineAll($Observable,{from:function(e){var t="function"==typeof this?this:$Observable,r=getMethod(_anObject(e)[OBSERVABLE]);if(r){var n=_anObject(r.call(e));return n.constructor===t?n:new t(function(e){return n.subscribe(e)})}return new t(function(t){var r=!1;return microtask$2(function(){if(!r){try{if(_forOf(e,!1,function(e){if(t.next(e),r)return RETURN})===RETURN)return}catch(e){if(r)throw e;return void t.error(e)}t.complete()}}),function(){r=!0}})},of:function(){for(var e=0,t=arguments.length,r=new Array(t);e<t;)r[e]=arguments[e++];return new("function"==typeof this?this:$Observable)(function(e){var t=!1;return microtask$2(function(){if(!t){for(var n=0;n<r.length;++n)if(e.next(r[n]),t)return;e.complete()}}),function(){t=!0}})}}),_hide($Observable.prototype,OBSERVABLE,function(){return this}),_export(_export.G,{Observable:$Observable}),_setSpecies("Observable");var slice=[].slice,MSIE=/MSIE .\./.test(_userAgent),wrap$1=function(e){return function(t,r){var n=arguments.length>2,i=!!n&&slice.call(arguments,2);return e(n?function(){("function"==typeof t?t:Function(t)).apply(this,i)}:t,r)}};_export(_export.G+_export.B+_export.F*MSIE,{setTimeout:wrap$1(_global.setTimeout),setInterval:wrap$1(_global.setInterval)}),_export(_export.G+_export.B,{setImmediate:_task.set,clearImmediate:_task.clear});for(var ITERATOR$4=_wks("iterator"),TO_STRING_TAG=_wks("toStringTag"),ArrayValues=_iterators.Array,DOMIterables={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},collections=_objectKeys(DOMIterables),i$2=0;i$2<collections.length;i$2++){var key$1,NAME$1=collections[i$2],explicit=DOMIterables[NAME$1],Collection=_global[NAME$1],proto$3=Collection&&Collection.prototype;if(proto$3&&(proto$3[ITERATOR$4]||_hide(proto$3,ITERATOR$4,ArrayValues),proto$3[TO_STRING_TAG]||_hide(proto$3,TO_STRING_TAG,NAME$1),_iterators[NAME$1]=ArrayValues,explicit))for(key$1 in es6_array_iterator)proto$3[key$1]||_redefine(proto$3,key$1,es6_array_iterator[key$1],!0)}var runtime=createCommonjsModule(function(e){!function(t){var r,n=Object.prototype,i=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag",c=t.regeneratorRuntime;if(c)e.exports=c;else{(c=t.regeneratorRuntime=e.exports).wrap=v;var f="suspendedStart",l="suspendedYield",h="executing",p="completed",d={},g={};g[a]=function(){return this};var _=Object.getPrototypeOf,m=_&&_(_(C([])));m&&m!==n&&i.call(m,a)&&(g=m);var y=O.prototype=w.prototype=Object.create(g);E.prototype=y.constructor=O,O.constructor=E,O[u]=E.displayName="GeneratorFunction",c.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===E||"GeneratorFunction"===(t.displayName||t.name))},c.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,O):(e.__proto__=O,u in e||(e[u]="GeneratorFunction")),e.prototype=Object.create(y),e},c.awrap=function(e){return{__await:e}},S(P.prototype),P.prototype[s]=function(){return this},c.AsyncIterator=P,c.async=function(e,t,r,n){var i=new P(v(e,t,r,n));return c.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},S(y),y[u]="Generator",y[a]=function(){return this},y.toString=function(){return"[object Generator]"},c.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},c.values=C,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(I),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=r)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,i){return s.type="throw",s.arg=e,t.next=n,i&&(t.method="next",t.arg=r),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;I(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),d}}}function v(e,t,r,n){var i=t&&t.prototype instanceof w?t:w,o=Object.create(i.prototype),a=new R(n||[]);return o._invoke=function(e,t,r){var n=f;return function(i,o){if(n===h)throw new Error("Generator is already running");if(n===p){if("throw"===i)throw o;return A()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=T(a,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var u=b(e,t,r);if("normal"===u.type){if(n=r.done?p:l,u.arg===d)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=p,r.method="throw",r.arg=u.arg)}}}(e,r,a),o}function b(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}function w(){}function E(){}function O(){}function S(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function P(e){function r(t,n,o,a){var s=b(e[t],e,n);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&i.call(c,"__await")?Promise.resolve(c.__await).then(function(e){r("next",e,o,a)},function(e){r("throw",e,o,a)}):Promise.resolve(c).then(function(e){u.value=e,o(u)},a)}a(s.arg)}var n;"object"==typeof t.process&&t.process.domain&&(r=t.process.domain.bind(r)),this._invoke=function(e,t){function i(){return new Promise(function(n,i){r(e,t,n,i)})}return n=n?n.then(i,i):i()}}function T(e,t){var n=e.iterator[t.method];if(n===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=r,T(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var i=b(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,d;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function C(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(i.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=r,t.done=!0,t};return o.next=o}}return{next:A}}function A(){return{value:r,done:!0}}}("object"==typeof commonjsGlobal?commonjsGlobal:"object"==typeof window?window:"object"==typeof self?self:commonjsGlobal)}),_replacer=function(e,t){var r=t===Object(t)?function(e){return t[e]}:t;return function(t){return String(t).replace(e,r)}},$re=_replacer(/[\\^$*+?.()|[\]{}]/g,"\\$&");_export(_export.S,"RegExp",{escape:function(e){return $re(e)}});var _escape=_core.RegExp.escape;if(commonjsGlobal._babelPolyfill)throw new Error("only one instance of babel-polyfill is allowed");commonjsGlobal._babelPolyfill=!0;var DEFINE_PROPERTY="defineProperty";function define$1(e,t,r){e[t]||Object[DEFINE_PROPERTY](e,t,{writable:!0,configurable:!0,value:r})}function startsWith(e,t){return"string"!=typeof e?(console.warn("Trying to test a non string variable"),!1):0===e.indexOf(t)}define$1(String.prototype,"padLeft","".padStart),define$1(String.prototype,"padRight","".padEnd),"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function(e){[][e]&&define$1(Array,e,Function.call.bind([][e]))});const blockCypherUrl="https://api.blockcypher.com/v1/btc/main/txs/",blockCypherTestUrl="https://api.blockcypher.com/v1/btc/test3/txs/",chainSoUrl="https://chain.so/api/v2/get_tx/BTC/",chainSoTestUrl="https://chain.so/api/v2/get_tx/BTCTEST/",etherScanMainUrl="https://api.etherscan.io/api?module=proxy",etherScanRopstenUrl="https://api-ropsten.etherscan.io/api?module=proxy";var API_URLS={blockCypherUrl:blockCypherUrl,blockCypherTestUrl:blockCypherTestUrl,chainSoUrl:chainSoUrl,chainSoTestUrl:chainSoTestUrl,etherScanMainUrl:etherScanMainUrl,etherScanRopstenUrl:etherScanRopstenUrl};const V1_1="1.1",V1_2="1.2",V2_0="2.0";var CERTIFICATE_VERSIONS={V1_1:V1_1,V1_2:V1_2,V2_0:V2_0};const formatValidation="formatValidation",hashComparison="hashComparison",statusCheck="statusCheck",final="final",language={[formatValidation]:{label:"Format validation",labelPending:"Validating format",subSteps:[]},[hashComparison]:{label:"Hash comparison",labelPending:"Comparing hash",subSteps:[]},[statusCheck]:{label:"Status check",labelPending:"Checking record status",subSteps:[]}};var verificationSteps=Object.freeze({final:final,formatValidation:formatValidation,hashComparison:hashComparison,statusCheck:statusCheck,language:language});const getTransactionId="getTransactionId",computeLocalHash="computeLocalHash",fetchRemoteHash="fetchRemoteHash",getIssuerProfile="getIssuerProfile",parseIssuerKeys="parseIssuerKeys",compareHashes="compareHashes",checkMerkleRoot="checkMerkleRoot",checkReceipt="checkReceipt",checkIssuerSignature="checkIssuerSignature",checkAuthenticity="checkAuthenticity",checkRevokedStatus="checkRevokedStatus",checkExpiresDate="checkExpiresDate",language$1={[getTransactionId]:{code:getTransactionId,label:"Get transaction ID",labelPending:"Getting transaction ID",parentStep:formatValidation},[computeLocalHash]:{code:computeLocalHash,label:"Compute local hash",labelPending:"Computing local hash",parentStep:formatValidation},[fetchRemoteHash]:{code:fetchRemoteHash,label:"Fetch remote hash",labelPending:"Fetching remote hash",parentStep:formatValidation},[getIssuerProfile]:{code:getIssuerProfile,label:"Get issuer profile",labelPending:"Getting issuer profile",parentStep:formatValidation},[parseIssuerKeys]:{code:parseIssuerKeys,label:"Parse issuer keys",labelPending:"Parsing issuer keys",parentStep:formatValidation},[compareHashes]:{code:compareHashes,label:"Compare hashes",labelPending:"Comparing hashes",parentStep:hashComparison},[checkMerkleRoot]:{code:checkMerkleRoot,label:"Check Merkle Root",labelPending:"Checking Merkle Root",parentStep:hashComparison},[checkReceipt]:{code:checkReceipt,label:"Check Receipt",labelPending:"Checking Receipt",parentStep:hashComparison},[checkIssuerSignature]:{code:checkIssuerSignature,label:"Check Issuer Signature",labelPending:"Checking Issuer Signature",parentStep:statusCheck},[checkAuthenticity]:{code:checkAuthenticity,label:"Check Authenticity",labelPending:"Checking Authenticity",parentStep:statusCheck},[checkRevokedStatus]:{code:checkRevokedStatus,label:"Check Revoked Status",labelPending:"Checking Revoked Status",parentStep:statusCheck},[checkExpiresDate]:{code:checkExpiresDate,label:"Check Expires Date",labelPending:"Checking Expires Date",parentStep:statusCheck}};var verificationSubSteps=Object.freeze({getTransactionId:getTransactionId,computeLocalHash:computeLocalHash,fetchRemoteHash:fetchRemoteHash,getIssuerProfile:getIssuerProfile,parseIssuerKeys:parseIssuerKeys,compareHashes:compareHashes,checkMerkleRoot:checkMerkleRoot,checkReceipt:checkReceipt,checkIssuerSignature:checkIssuerSignature,checkAuthenticity:checkAuthenticity,checkRevokedStatus:checkRevokedStatus,checkExpiresDate:checkExpiresDate,language:language$1});const FAILURE="failure",STARTING="starting",SUCCESS="success";var verificationStatuses=Object.freeze({FAILURE:FAILURE,STARTING:STARTING,SUCCESS:SUCCESS});const TRANSACTION_TEMPLATE_ID_PLACEHOLDER="{TRANSACTION_ID}",BLOCKCHAINS={bitcoin:{code:"bitcoin",name:"Bitcoin",prefixes:["6a20","OP_RETURN "],signatureValue:"bitcoinMainnet",transactionTemplates:{full:`https://blockchain.info/tx/${TRANSACTION_TEMPLATE_ID_PLACEHOLDER}`,raw:`https://blockchain.info/rawtx/${TRANSACTION_TEMPLATE_ID_PLACEHOLDER}`}},ethmain:{code:"ethmain",name:"Ethereum",prefixes:["0x"],signatureValue:"ethereumMainnet",transactionTemplates:{full:`https://etherscan.io/tx/${TRANSACTION_TEMPLATE_ID_PLACEHOLDER}`,raw:`https://etherscan.io/tx/${TRANSACTION_TEMPLATE_ID_PLACEHOLDER}`}},ethropst:{code:"ethropst",name:"Ethereum",signatureValue:"ethereumRopsten",transactionTemplates:{full:`https://ropsten.etherscan.io/tx/${TRANSACTION_TEMPLATE_ID_PLACEHOLDER}`,raw:`https://ropsten.etherscan.io/getRawTx?tx=${TRANSACTION_TEMPLATE_ID_PLACEHOLDER}`}},mocknet:{code:"mocknet",name:"Mocknet",signatureValue:"mockchain",transactionTemplates:{full:"",raw:""}},regtest:{code:"regtest",name:"Mocknet",signatureValue:"bitcoinRegtest",transactionTemplates:{full:"",raw:""}},testnet:{code:"testnet",name:"Mocknet",signatureValue:"bitcoinTestnet",transactionTemplates:{full:`https://testnet.blockchain.info/tx/${TRANSACTION_TEMPLATE_ID_PLACEHOLDER}`,raw:`https://testnet.blockchain.info/rawtx/${TRANSACTION_TEMPLATE_ID_PLACEHOLDER}`}}},NETWORKS={mainnet:"mainnet",testnet:"testnet"},SecurityContextUrl="https://w3id.org/security/v1",MininumConfirmations=1,MinimumBlockchainExplorers=1,Race=!1,CheckForUnmappedFields=!0,PublicKey="ecdsa-koblitz-pubkey:1";var CONFIG={SecurityContextUrl:SecurityContextUrl,MininumConfirmations:1,MinimumBlockchainExplorers:1,Race:!1,CheckForUnmappedFields:!0,PublicKey:PublicKey},ContextsMap={obi:{"@context":{id:"@id",type:"@type",extensions:"https://w3id.org/openbadges/extensions#",obi:"https://w3id.org/openbadges#",validation:"obi:validation",cred:"https://w3id.org/credentials#",dc:"http://purl.org/dc/terms/",schema:"http://schema.org/",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",AlignmentObject:"schema:AlignmentObject",CryptographicKey:"sec:Key",Endorsement:"cred:Credential",Assertion:"obi:Assertion",BadgeClass:"obi:BadgeClass",Criteria:"obi:Criteria",Evidence:"obi:Evidence",Extension:"obi:Extension",FrameValidation:"obi:FrameValidation",IdentityObject:"obi:IdentityObject",Image:"obi:Image",HostedBadge:"obi:HostedBadge",hosted:"obi:HostedBadge",Issuer:"obi:Issuer",Profile:"obi:Profile",RevocationList:"obi:RevocationList",SignedBadge:"obi:SignedBadge",signed:"obi:SignedBadge",TypeValidation:"obi:TypeValidation",VerificationObject:"obi:VerificationObject",author:{"@id":"schema:author","@type":"@id"},caption:{"@id":"schema:caption"},claim:{"@id":"cred:claim","@type":"@id"},created:{"@id":"dc:created","@type":"xsd:dateTime"},creator:{"@id":"dc:creator","@type":"@id"},description:{"@id":"schema:description"},email:{"@id":"schema:email"},endorsement:{"@id":"cred:credential","@type":"@id"},expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},genre:{"@id":"schema:genre"},image:{"@id":"schema:image","@type":"@id"},name:{"@id":"schema:name"},owner:{"@id":"sec:owner","@type":"@id"},publicKey:{"@id":"sec:publicKey","@type":"@id"},publicKeyPem:{"@id":"sec:publicKeyPem"},related:{"@id":"dc:relation","@type":"@id"},startsWith:{"@id":"http://purl.org/dqm-vocabulary/v1/dqm#startsWith"},tags:{"@id":"schema:keywords"},targetDescription:{"@id":"schema:targetDescription"},targetFramework:{"@id":"schema:targetFramework"},targetName:{"@id":"schema:targetName"},targetUrl:{"@id":"schema:targetUrl"},telephone:{"@id":"schema:telephone"},url:{"@id":"schema:url","@type":"@id"},version:{"@id":"schema:version"},alignment:{"@id":"obi:alignment","@type":"@id"},allowedOrigins:{"@id":"obi:allowedOrigins"},audience:{"@id":"obi:audience"},badge:{"@id":"obi:badge","@type":"@id"},criteria:{"@id":"obi:criteria","@type":"@id"},endorsementComment:{"@id":"obi:endorsementComment"},evidence:{"@id":"obi:evidence","@type":"@id"},hashed:{"@id":"obi:hashed","@type":"xsd:boolean"},identity:{"@id":"obi:identityHash"},issuedOn:{"@id":"obi:issueDate","@type":"xsd:dateTime"},issuer:{"@id":"obi:issuer","@type":"@id"},narrative:{"@id":"obi:narrative"},recipient:{"@id":"obi:recipient","@type":"@id"},revocationList:{"@id":"obi:revocationList","@type":"@id"},revocationReason:{"@id":"obi:revocationReason"},revoked:{"@id":"obi:revoked","@type":"xsd:boolean"},revokedAssertions:{"@id":"obi:revoked"},salt:{"@id":"obi:salt"},targetCode:{"@id":"obi:targetCode"},uid:{"@id":"obi:uid"},validatesType:"obi:validatesType",validationFrame:"obi:validationFrame",validationSchema:"obi:validationSchema",verification:{"@id":"obi:verify","@type":"@id"},verificationProperty:{"@id":"obi:verificationProperty"},verify:"verification"}},blockcerts:{"@context":{id:"@id",type:"@type",bc:"https://w3id.org/blockcerts#",obi:"https://w3id.org/openbadges#",cp:"https://w3id.org/chainpoint#",schema:"http://schema.org/",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",MerkleProof2017:"sec:MerkleProof2017",RecipientProfile:"bc:RecipientProfile",SignatureLine:"bc:SignatureLine",MerkleProofVerification2017:"bc:MerkleProofVerification2017",recipientProfile:"bc:recipientProfile",signatureLines:"bc:signatureLines",introductionUrl:{"@id":"bc:introductionUrl","@type":"@id"},subtitle:"bc:subtitle",jobTitle:"schema:jobTitle",creator:{"@id":"dc:creator","@type":"@id"},expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},revoked:{"@id":"sec:expiration","@type":"xsd:dateTime"},CryptographicKey:"sec:Key",signature:"sec:signature",verification:"bc:verification",publicKeys:"bc:publicKeys",ChainpointSHA256v2:"cp:ChainpointSHA256v2",BTCOpReturn:"cp:BTCOpReturn",targetHash:"cp:targetHash",merkleRoot:"cp:merkleRoot",proof:"cp:proof",anchors:"cp:anchors",sourceId:"cp:sourceId",right:"cp:right",left:"cp:left"},"obi:validation":[{"obi:validatesType":"RecipientProfile","obi:validationSchema":"https://w3id.org/blockcerts/schema/2.0-alpha/recipientSchema.json"},{"obi:validatesType":"SignatureLine","obi:validationSchema":"https://w3id.org/blockcerts/schema/2.0-alpha/signatureLineSchema.json"},{"obi:validatesType":"MerkleProof2017","obi:validationSchema":"https://w3id.org/blockcerts/schema/2.0-alpha/merkleProof2017Schema.json"}]},blockcertsv1_2:{"@context":[{id:"@id",type:"@type",bc:"https://w3id.org/blockcerts#",obi:"https://w3id.org/openbadges#",cp:"https://w3id.org/chainpoint#",extensions:"https://w3id.org/openbadges/extensions#",validation:"obi:validation",xsd:"http://www.w3.org/2001/XMLSchema#",schema:"http://schema.org/",sec:"https://w3id.org/security#",Assertion:"bc:Assertion",Certificate:"bc:Certificate",Issuer:"bc:Issuer",BlockchainCertificate:"bc:BlockchainCertificate",CertificateDocument:"bc:CertificateDocument",issuer:{"@id":"bc:issuer","@type":"@id"},blockchaincertificate:{"@id":"bc:blockchaincertificate","@type":"@id"},certificate:{"@id":"bc:certificate","@type":"@id"},document:{"@id":"bc:document","@type":"@id"},assertion:{"@id":"bc:assertion","@type":"@id"},verify:{"@id":"bc:verify","@type":"@id"},recipient:{"@id":"bc:recipient","@type":"@id"},receipt:{"@id":"bc:receipt","@type":"@id"},publicKey:{"@id":"bc:publicKey"},revocationKey:{"@id":"bc:revocationKey"},"image:signature":{"@id":"bc:image:signature"},signature:{"@id":"bc:signature"},familyName:{"@id":"schema:familyName"},givenName:{"@id":"schema:givenName"},jobTitle:{"@id":"schema:jobTitle"},signer:{"@id":"bc:signer","@type":"@id"},"attribute-signed":{"@id":"bc:attribute-signed"},"ECDSA(secp256k1)":"bc:SignedBadge",subtitle:{"@id":"bc:subtitle"},email:"schema:email",hashed:{"@id":"obi:hashed","@type":"xsd:boolean"},image:{"@id":"schema:image","@type":"@id"},salt:{"@id":"obi:salt"},identity:{"@id":"obi:identityHash"},issuedOn:{"@id":"obi:issueDate","@type":"xsd:dateTime"},expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},evidence:{"@id":"obi:evidence","@type":"@id"},criteria:{"@id":"obi:criteria","@type":"@id"},tags:{"@id":"schema:keywords"},alignment:{"@id":"obi:alignment","@type":"@id"},revocationList:{"@id":"obi:revocationList","@type":"@id"},name:{"@id":"schema:name"},description:{"@id":"schema:description"},url:{"@id":"schema:url","@type":"@id"},uid:{"@id":"obi:uid"},TypeValidation:"obi:TypeValidation",FrameValidation:"obi:FrameValidation",validatesType:"obi:validatesType",validationSchema:"obi:validationSchema",validationFrame:"obi:validationFrame",ChainpointSHA224v2:"cp:ChainpointSHA224v2",ChainpointSHA256v2:"cp:ChainpointSHA256v2",ChainpointSHA384v2:"cp:ChainpointSHA384v2",ChainpointSHA512v2:"cp:ChainpointSHA512v2","ChainpointSHA3-224v2":"cp:ChainpointSHA3-224v2","ChainpointSHA3-256v2":"cp:ChainpointSHA3-256v2","ChainpointSHA3-384v2":"cp:ChainpointSHA3-384v2","ChainpointSHA3-512v2":"cp:ChainpointSHA3-512v2",BTCOpReturn:"cp:BTCOpReturn",targetHash:"cp:targetHash",merkleRoot:"cp:merkleRoot",proof:"cp:proof",anchors:"cp:anchors",sourceId:"cp:sourceId",right:"cp:right",left:"cp:left"}],validation:[{type:"TypeValidation",validatesType:"Assertion",validationSchema:"https://w3id.org/blockcerts/schema/1.2/assertion-1.2.json"},{type:"TypeValidation",validatesType:"Certificate",validationSchema:"https://w3id.org/blockcerts/schema/1.2/certificate-1.2.json"},{type:"TypeValidation",validatesType:"Issuer",validationSchema:"https://w3id.org/blockcerts/schema/1.2/issuer-1.2.json"},{type:"TypeValidation",validatesType:"CertificateDocument",validationSchema:"https://w3id.org/blockcerts/schema/1.2/certificate-document-1.2.json"},{type:"TypeValidation",validatesType:"BlockchainCertificate",validationSchema:"https://w3id.org/blockcerts/schema/1.2/blockchain-certificate-1.2.json"},{type:"TypeValidation",validatesType:"BlockchainReceipt",validationSchema:"https://w3id.org/blockcerts/schema/1.2/blockchain-receipt-1.2.json"}]},blockcertsv2:{"@context":{id:"@id",type:"@type",bc:"https://w3id.org/blockcerts#",obi:"https://w3id.org/openbadges#",cp:"https://w3id.org/chainpoint#",schema:"http://schema.org/",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",MerkleProof2017:"sec:MerkleProof2017",RecipientProfile:"bc:RecipientProfile",SignatureLine:"bc:SignatureLine",MerkleProofVerification2017:"bc:MerkleProofVerification2017",recipientProfile:"bc:recipientProfile",signatureLines:"bc:signatureLines",introductionUrl:{"@id":"bc:introductionUrl","@type":"@id"},subtitle:"bc:subtitle",jobTitle:"schema:jobTitle",expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},revoked:{"@id":"obi:revoked","@type":"xsd:boolean"},CryptographicKey:"sec:Key",signature:"sec:signature",verification:{"@id":"obi:verify","@type":"@id"},publicKey:{"@id":"sec:publicKey","@type":"@id"},ChainpointSHA256v2:"cp:ChainpointSHA256v2",BTCOpReturn:"cp:BTCOpReturn",targetHash:"cp:targetHash",merkleRoot:"cp:merkleRoot",proof:"cp:proof",anchors:"cp:anchors",sourceId:"cp:sourceId",right:"cp:right",left:"cp:left"},"obi:validation":[{"obi:validatesType":"RecipientProfile","obi:validationSchema":"https://w3id.org/blockcerts/schema/2.0/recipientSchema.json"},{"obi:validatesType":"SignatureLine","obi:validationSchema":"https://w3id.org/blockcerts/schema/2.0/signatureLineSchema.json"},{"obi:validatesType":"MerkleProof2017","obi:validationSchema":"https://w3id.org/blockcerts/schema/2.0/merkleProof2017Schema.json"}]}};function isMainnet(e){return startsWith(e,"1")||startsWith(e,CONFIG.PublicKey)}var addresses=Object.freeze({isMainnet:isMainnet});function getChain(e,t=null){let r=t||{};if(r.anchors){let e=r.anchors[0];if(e.chain){let t=e.chain,r=Object.entries(BLOCKCHAINS).find(e=>e[1].signatureValue===t);if(void 0===r)throw new Error("Didn't recognize chain value");return r[1]}}return addresses.isMainnet(e)?BLOCKCHAINS.bitcoin:BLOCKCHAINS.testnet}const REVOCATION_LANGUAGE={PRE_REASON:"Reason given:",REVOCATION:"This certificate has been revoked by the issuer."};function generateRevocationReason(e){return e=(e=e.trim()).length>0?` ${REVOCATION_LANGUAGE.PRE_REASON} ${e}${"."!==e.slice(-1)?".":""}`:"",`${REVOCATION_LANGUAGE.REVOCATION}${e}`}class Key{constructor(e,t,r,n){this.publicKey=e,this.created=t,this.revoked=r,this.expires=n}}class SignatureImage{constructor(e,t,r){this.image=e,this.jobTitle=t,this.name=r}}class TransactionData{constructor(e,t,r,n){this.remoteHash=e,this.issuingAddress=t,this.time=r,this.revokedAddresses=n}}class VerifierError extends Error{constructor(e,t){super(t),this.stepCode=e}}function getTransactionId$1(e){try{return e.anchors[0].sourceId}catch(e){throw new VerifierError("","Cannot verify this certificate without a transaction ID to compare against.")}}function getTransactionLink(e,t,r=!1){if(!e||!t)return"";return t.transactionTemplates[r?"raw":"full"].replace(TRANSACTION_TEMPLATE_ID_PLACEHOLDER,e)}function isMockChain(e){if(e){const t="string"==typeof e?e:e.code;return Object.keys(BLOCKCHAINS).find(e=>e===t)?t===BLOCKCHAINS.mocknet.code||t===BLOCKCHAINS.regtest.code:null}return null}var chainsService=Object.freeze({isMockChain:isMockChain});const versionVerificationMap={[NETWORKS.mainnet]:[getTransactionId,computeLocalHash,fetchRemoteHash,getIssuerProfile,parseIssuerKeys,compareHashes,checkMerkleRoot,checkReceipt,checkRevokedStatus,checkAuthenticity,checkExpiresDate],[NETWORKS.testnet]:[computeLocalHash,compareHashes,checkReceipt,checkExpiresDate]};function stepsObjectToArray(e){return Object.keys(e).map(t=>({...e[t],code:t}))}function setSubStepsToSteps(e){const t=JSON.parse(JSON.stringify(language));return e.forEach(e=>t[e.parentStep].subSteps.push(e)),t}function getFullStepsFromSubSteps(e){return stepsObjectToArray(setSubStepsToSteps(e.map(e=>Object.assign({},language$1[e]))))}function getVerificationMap(e){if(!e)return[];let t=chainsService.isMockChain(e)?NETWORKS.testnet:NETWORKS.mainnet;return getFullStepsFromSubSteps(Object.assign(versionVerificationMap)[t])}var certificates=Object.freeze({getChain:getChain,generateRevocationReason:generateRevocationReason,getTransactionId:getTransactionId$1,getTransactionLink:getTransactionLink,getVerificationMap:getVerificationMap}),global$1="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,inited=!1;function init(){inited=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t<r;++t)lookup[t]=e[t],revLookup[e.charCodeAt(t)]=t;revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63}function toByteArray(e){var t,r,n,i,o,a;inited||init();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[s-2]?2:"="===e[s-1]?1:0,a=new Arr(3*s/4-o),n=o>0?s-4:s;var u=0;for(t=0,r=0;t<n;t+=4,r+=3)i=revLookup[e.charCodeAt(t)]<<18|revLookup[e.charCodeAt(t+1)]<<12|revLookup[e.charCodeAt(t+2)]<<6|revLookup[e.charCodeAt(t+3)],a[u++]=i>>16&255,a[u++]=i>>8&255,a[u++]=255&i;return 2===o?(i=revLookup[e.charCodeAt(t)]<<2|revLookup[e.charCodeAt(t+1)]>>4,a[u++]=255&i):1===o&&(i=revLookup[e.charCodeAt(t)]<<10|revLookup[e.charCodeAt(t+1)]<<4|revLookup[e.charCodeAt(t+2)]>>2,a[u++]=i>>8&255,a[u++]=255&i),a}function tripletToBase64(e){return lookup[e>>18&63]+lookup[e>>12&63]+lookup[e>>6&63]+lookup[63&e]}function encodeChunk(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16)+(e[o+1]<<8)+e[o+2],i.push(tripletToBase64(n));return i.join("")}function fromByteArray(e){var t;inited||init();for(var r=e.length,n=r%3,i="",o=[],a=0,s=r-n;a<s;a+=16383)o.push(encodeChunk(e,a,a+16383>s?s:a+16383));return 1===n?(t=e[r-1],i+=lookup[t>>2],i+=lookup[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=lookup[t>>10],i+=lookup[t>>4&63],i+=lookup[t<<2&63],i+="="),o.push(i),o.join("")}function read(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,c=u>>1,f=-7,l=r?i-1:0,h=r?-1:1,p=e[t+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=s;f>0;o=256*o+e[t+l],l+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=c}return(p?-1:1)*a*Math.pow(2,o-n)}function write(e,t,r,n,i,o){var a,s,u,c=8*o-i-1,f=(1<<c)-1,l=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(t*u-1)*Math.pow(2,i),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;e[r+p]=255&s,p+=d,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[r+p]=255&a,p+=d,a/=256,c-=8);e[r+p-d]|=128*g}var toString$2={}.toString,isArray=Array.isArray||function(e){return"[object Array]"==toString$2.call(e)},INSPECT_MAX_BYTES=50;Buffer.TYPED_ARRAY_SUPPORT=void 0===global$1.TYPED_ARRAY_SUPPORT||global$1.TYPED_ARRAY_SUPPORT;var _kMaxLength=kMaxLength();function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(e,t){if(kMaxLength()<t)throw new RangeError("Invalid typed array length");return Buffer.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Buffer.prototype:(null===e&&(e=new Buffer(t)),e.length=t),e}function Buffer(e,t,r){if(!(Buffer.TYPED_ARRAY_SUPPORT||this instanceof Buffer))return new Buffer(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe(this,e)}return from(this,e,t,r)}function from(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?fromArrayBuffer(e,t,r,n):"string"==typeof t?fromString(e,t,r):fromObject(e,t)}function assertSize(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function alloc(e,t,r,n){return assertSize(t),t<=0?createBuffer(e,t):void 0!==r?"string"==typeof n?createBuffer(e,t).fill(r,n):createBuffer(e,t).fill(r):createBuffer(e,t)}function allocUnsafe(e,t){if(assertSize(t),e=createBuffer(e,t<0?0:0|checked(t)),!Buffer.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function fromString(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!Buffer.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|byteLength(t,r),i=(e=createBuffer(e,n)).write(t,r);return i!==n&&(e=e.slice(0,i)),e}function fromArrayLike(e,t){var r=t.length<0?0:0|checked(t.length);e=createBuffer(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function fromArrayBuffer(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),Buffer.TYPED_ARRAY_SUPPORT?(e=t).__proto__=Buffer.prototype:e=fromArrayLike(e,t),e}function fromObject(e,t){if(internalIsBuffer(t)){var r=0|checked(t.length);return 0===(e=createBuffer(e,r)).length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||isnan(t.length)?createBuffer(e,0):fromArrayLike(e,t);if("Buffer"===t.type&&isArray(t.data))return fromArrayLike(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(e){if(e>=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|e}function SlowBuffer(e){return+e!=e&&(e=0),Buffer.alloc(+e)}function internalIsBuffer(e){return!(null==e||!e._isBuffer)}function byteLength(e,t){if(internalIsBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return base64ToBytes(e).length;default:if(n)return utf8ToBytes(e).length;t=(""+t).toLowerCase(),n=!0}}function slowToString(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return hexSlice(this,t,r);case"utf8":case"utf-8":return utf8Slice(this,t,r);case"ascii":return asciiSlice(this,t,r);case"latin1":case"binary":return latin1Slice(this,t,r);case"base64":return base64Slice(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function swap(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function bidirectionalIndexOf(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=Buffer.from(t,n)),internalIsBuffer(t))return 0===t.length?-1:arrayIndexOf$1(e,t,r,n,i);if("number"==typeof t)return t&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):arrayIndexOf$1(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf$1(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=r;o<s;o++)if(c(e,o)===c(t,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*a}else-1!==f&&(o-=o-f),f=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){for(var l=!0,h=0;h<u;h++)if(c(e,o+h)!==c(t,h)){l=!1;break}if(l)return o}return-1}function hexWrite(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[r+a]=s}return a}function utf8Write(e,t,r,n){return blitBuffer(utf8ToBytes(t,e.length-r),e,r,n)}function asciiWrite(e,t,r,n){return blitBuffer(asciiToBytes(t),e,r,n)}function latin1Write(e,t,r,n){return asciiWrite(e,t,r,n)}function base64Write(e,t,r,n){return blitBuffer(base64ToBytes(t),e,r,n)}function ucs2Write(e,t,r,n){return blitBuffer(utf16leToBytes(t,e.length-r),e,r,n)}function base64Slice(e,t,r){return 0===t&&r===e.length?fromByteArray(e):fromByteArray(e.slice(t,r))}function utf8Slice(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,s,u,c=e[i],f=null,l=c>239?4:c>223?3:c>191?2:1;if(i+l<=r)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(f=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}return decodeCodePointsArray(n)}Buffer.poolSize=8192,Buffer._augment=function(e){return e.__proto__=Buffer.prototype,e},Buffer.from=function(e,t,r){return from(null,e,t,r)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array),Buffer.alloc=function(e,t,r){return alloc(null,e,t,r)},Buffer.allocUnsafe=function(e){return allocUnsafe(null,e)},Buffer.allocUnsafeSlow=function(e){return allocUnsafe(null,e)},Buffer.isBuffer=isBuffer,Buffer.compare=function(e,t){if(!internalIsBuffer(e)||!internalIsBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},Buffer.isEncoding=function(e){switch(String(e).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!0;default:return!1}},Buffer.concat=function(e,t){if(!isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Buffer.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=Buffer.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(!internalIsBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)swap(this,t,t+1);return this},Buffer.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)swap(this,t,t+3),swap(this,t+1,t+2);return this},Buffer.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)swap(this,t,t+7),swap(this,t+1,t+6),swap(this,t+2,t+5),swap(this,t+3,t+4);return this},Buffer.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?utf8Slice(this,0,e):slowToString.apply(this,arguments)},Buffer.prototype.equals=function(e){if(!internalIsBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Buffer.compare(this,e)},Buffer.prototype.inspect=function(){var e="",t=INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},Buffer.prototype.compare=function(e,t,r,n,i){if(!internalIsBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(n,i),c=e.slice(t,r),f=0;f<s;++f)if(u[f]!==c[f]){o=u[f],a=c[f];break}return o<a?-1:a<o?1:0},Buffer.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},Buffer.prototype.indexOf=function(e,t,r){return bidirectionalIndexOf(this,e,t,r,!0)},Buffer.prototype.lastIndexOf=function(e,t,r){return bidirectionalIndexOf(this,e,t,r,!1)},Buffer.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return hexWrite(this,e,t,r);case"utf8":case"utf-8":return utf8Write(this,e,t,r);case"ascii":return asciiWrite(this,e,t,r);case"latin1":case"binary":return latin1Write(this,e,t,r);case"base64":return base64Write(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(e){var t=e.length;if(t<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=MAX_ARGUMENTS_LENGTH));return r}function asciiSlice(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function latin1Slice(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function hexSlice(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=toHex(e[o]);return i}function utf16leSlice(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function checkOffset(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function checkInt(e,t,r,n,i,o){if(!internalIsBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function objectWriteUInt16(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function objectWriteUInt32(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function checkIEEE754(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function writeFloat(e,t,r,n,i){return i||checkIEEE754(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),write(e,t,r,n,23,4),r+4}function writeDouble(e,t,r,n,i){return i||checkIEEE754(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),write(e,t,r,n,52,8),r+8}Buffer.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),Buffer.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=Buffer.prototype;else{var i=t-e;r=new Buffer(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},Buffer.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||checkOffset(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},Buffer.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||checkOffset(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},Buffer.prototype.readUInt8=function(e,t){return t||checkOffset(e,1,this.length),this[e]},Buffer.prototype.readUInt16LE=function(e,t){return t||checkOffset(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUInt16BE=function(e,t){return t||checkOffset(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUInt32LE=function(e,t){return t||checkOffset(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUInt32BE=function(e,t){return t||checkOffset(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||checkOffset(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},Buffer.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||checkOffset(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},Buffer.prototype.readInt8=function(e,t){return t||checkOffset(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function(e,t){t||checkOffset(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(e,t){t||checkOffset(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(e,t){return t||checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function(e,t){return t||checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readFloatLE=function(e,t){return t||checkOffset(e,4,this.length),read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function(e,t){return t||checkOffset(e,4,this.length),read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function(e,t){return t||checkOffset(e,8,this.length),read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function(e,t){return t||checkOffset(e,8,this.length),read(this,e,!1,52,8)},Buffer.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},Buffer.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},Buffer.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Buffer.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):objectWriteUInt16(this,e,t,!0),t+2},Buffer.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):objectWriteUInt16(this,e,t,!1),t+2},Buffer.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):objectWriteUInt32(this,e,t,!0),t+4},Buffer.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):objectWriteUInt32(this,e,t,!1),t+4},Buffer.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);checkInt(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},Buffer.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);checkInt(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},Buffer.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):objectWriteUInt16(this,e,t,!0),t+2},Buffer.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):objectWriteUInt16(this,e,t,!1),t+2},Buffer.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):objectWriteUInt32(this,e,t,!0),t+4},Buffer.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):objectWriteUInt32(this,e,t,!1),t+4},Buffer.prototype.writeFloatLE=function(e,t,r){return writeFloat(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function(e,t,r){return writeFloat(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function(e,t,r){return writeDouble(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function(e,t,r){return writeDouble(this,e,t,!1,r)},Buffer.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},Buffer.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Buffer.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var a=internalIsBuffer(e)?e:utf8ToBytes(new Buffer(e,n).toString()),s=a.length;for(o=0;o<r-t;++o)this[o+t]=a[o%s]}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g;function base64clean(e){if((e=stringtrim(e).replace(INVALID_BASE64_RE,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function stringtrim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function toHex(e){return e<16?"0"+e.toString(16):e.toString(16)}function utf8ToBytes(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function asciiToBytes(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function utf16leToBytes(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,i=r%256,o.push(i),o.push(n);return o}function base64ToBytes(e){return toByteArray(base64clean(e))}function blitBuffer(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function isnan(e){return e!=e}function isBuffer(e){return null!=e&&(!!e._isBuffer||isFastBuffer(e)||isSlowBuffer(e))}function isFastBuffer(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function isSlowBuffer(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&isFastBuffer(e.slice(0,0))}var bufferEs6=Object.freeze({INSPECT_MAX_BYTES:INSPECT_MAX_BYTES,kMaxLength:_kMaxLength,Buffer:Buffer,SlowBuffer:SlowBuffer,isBuffer:isBuffer});function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}var cachedSetTimeout=defaultSetTimout,cachedClearTimeout=defaultClearTimeout;function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch(t){try{return cachedSetTimeout.call(null,e,0)}catch(t){return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch(t){try{return cachedClearTimeout.call(null,e)}catch(t){return cachedClearTimeout.call(this,e)}}}"function"==typeof global$1.setTimeout&&(cachedSetTimeout=setTimeout),"function"==typeof global$1.clearTimeout&&(cachedClearTimeout=clearTimeout);var currentQueue,queue$1=[],draining=!1,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue$1=currentQueue.concat(queue$1):queueIndex=-1,queue$1.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue$1.length;t;){for(currentQueue=queue$1,queue$1=[];++queueIndex<t;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,t=queue$1.length}currentQueue=null,draining=!1,runClearTimeout(e)}}function nextTick(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];queue$1.push(new Item(e,t)),1!==queue$1.length||draining||runTimeout(drainQueue)}function Item(e,t){this.fun=e,this.array=t}Item.prototype.run=function(){this.fun.apply(null,this.array)};var title="browser",platform="browser",browser=!0,env={},argv=[],version="",versions={},release={},config={};function noop(){}var on=noop,addListener=noop,once=noop,off=noop,removeListener=noop,removeAllListeners=noop,emit=noop;function binding(e){throw new Error("process.binding is not supported")}function cwd(){return"/"}function chdir(e){throw new Error("process.chdir is not supported")}function umask(){return 0}var performance=global$1.performance||{},performanceNow=performance.now||performance.mozNow||performance.msNow||performance.oNow||performance.webkitNow||function(){return(new Date).getTime()};function hrtime(e){var t=.001*performanceNow.call(performance),r=Math.floor(t),n=Math.floor(t%1*1e9);return e&&(r-=e[0],(n-=e[1])<0&&(r--,n+=1e9)),[r,n]}var startTime=new Date;function uptime(){return(new Date-startTime)/1e3}var inherits,process$4={nextTick:nextTick,title:title,browser:browser,env:env,argv:argv,version:version,versions:versions,on:on,addListener:addListener,once:once,off:off,removeListener:removeListener,removeAllListeners:removeAllListeners,emit:emit,binding:binding,cwd:cwd,chdir:chdir,umask:umask,hrtime:hrtime,platform:platform,release:release,config:config,uptime:uptime},maxInt=2147483647,base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,delimiter="-",regexNonASCII=/[^\x20-\x7E]/,regexSeparators=/[\x2E\u3002\uFF0E\uFF61]/g,errors={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},baseMinusTMin=base-tMin,floor$3=Math.floor,stringFromCharCode=String.fromCharCode;function error(e){throw new RangeError(errors[e])}function map(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function mapDomain(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+map((e=e.replace(regexSeparators,".")).split("."),t).join(".")}function ucs2decode(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function digitToBasic(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function adapt(e,t,r){var n=0;for(e=r?floor$3(e/damp):e>>1,e+=floor$3(e/t);e>baseMinusTMin*tMax>>1;n+=base)e=floor$3(e/baseMinusTMin);return floor$3(n+(baseMinusTMin+1)*e/(e+skew))}function encode(e){var t,r,n,i,o,a,s,u,c,f,l,h,p,d,g,_=[];for(h=(e=ucs2decode(e)).length,t=initialN,r=0,o=initialBias,a=0;a<h;++a)(l=e[a])<128&&_.push(stringFromCharCode(l));for(n=i=_.length,i&&_.push(delimiter);n<h;){for(s=maxInt,a=0;a<h;++a)(l=e[a])>=t&&l<s&&(s=l);for(s-t>floor$3((maxInt-r)/(p=n+1))&&error("overflow"),r+=(s-t)*p,t=s,a=0;a<h;++a)if((l=e[a])<t&&++r>maxInt&&error("overflow"),l==t){for(u=r,c=base;!(u<(f=c<=o?tMin:c>=o+tMax?tMax:c-o));c+=base)g=u-f,d=base-f,_.push(stringFromCharCode(digitToBasic(f+g%d,0))),u=floor$3(g/d);_.push(stringFromCharCode(digitToBasic(u,0))),o=adapt(r,p,n==i),r=0,++n}++r,++t}return _.join("")}function toASCII(e){return mapDomain(e,function(e){return regexNonASCII.test(e)?"xn--"+encode(e):e})}var inherits$1=inherits="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e},formatRegExp=/%[sdj%]/g;function format(e){if(!isString(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(inspect(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,o=String(e).replace(formatRegExp,function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),a=n[r];r<i;a=n[++r])isNull(a)||!isObject(a)?o+=" "+a:o+=" "+inspect(a);return o}function deprecate(e,t){if(isUndefined(global$1.process))return function(){return deprecate(e,t).apply(this,arguments)};if(!0===process$4.noDeprecation)return e;var r=!1;return function(){if(!r){if(process$4.throwDeprecation)throw new Error(t);process$4.traceDeprecation?console.trace(t):console.error(t),r=!0}return e.apply(this,arguments)}}var debugEnviron,debugs={};function debuglog(e){if(isUndefined(debugEnviron)&&(debugEnviron=process$4.env.NODE_DEBUG||""),e=e.toUpperCase(),!debugs[e])if(new RegExp("\\b"+e+"\\b","i").test(debugEnviron)){debugs[e]=function(){var t=format.apply(null,arguments);console.error("%s %d: %s",e,0,t)}}else debugs[e]=function(){};return debugs[e]}function inspect(e,t){var r={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),isBoolean(t)?r.showHidden=t:t&&_extend(r,t),isUndefined(r.showHidden)&&(r.showHidden=!1),isUndefined(r.depth)&&(r.depth=2),isUndefined(r.colors)&&(r.colors=!1),isUndefined(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=stylizeWithColor),formatValue(r,e,r.depth)}function stylizeWithColor(e,t){var r=inspect.styles[t];return r?"["+inspect.colors[r][0]+"m"+e+"["+inspect.colors[r][1]+"m":e}function stylizeNoColor(e,t){return e}function arrayToHash(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function formatValue(e,t,r){if(e.customInspect&&t&&isFunction(t.inspect)&&t.inspect!==inspect&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r,e);return isString(n)||(n=formatValue(e,n,r)),n}var i=formatPrimitive(e,t);if(i)return i;var o=Object.keys(t),a=arrayToHash(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),isError(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return formatError(t);if(0===o.length){if(isFunction(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(isRegExp(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(isDate(t))return e.stylize(Date.prototype.toString.call(t),"date");if(isError(t))return formatError(t)}var u,c="",f=!1,l=["{","}"];(isArray$1(t)&&(f=!0,l=["[","]"]),isFunction(t))&&(c=" [Function"+(t.name?": "+t.name:"")+"]");return isRegExp(t)&&(c=" "+RegExp.prototype.toString.call(t)),isDate(t)&&(c=" "+Date.prototype.toUTCString.call(t)),isError(t)&&(c=" "+formatError(t)),0!==o.length||f&&0!=t.length?r<0?isRegExp(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),u=f?formatArray(e,t,r,a,o):o.map(function(n){return formatProperty(e,t,r,a,n,f)}),e.seen.pop(),reduceToSingleString(u,c,l)):l[0]+c+l[1]}function formatPrimitive(e,t){if(isUndefined(t))return e.stylize("undefined","undefined");if(isString(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return isNumber(t)?e.stylize(""+t,"number"):isBoolean(t)?e.stylize(""+t,"boolean"):isNull(t)?e.stylize("null","null"):void 0}function formatError(e){return"["+Error.prototype.toString.call(e)+"]"}function formatArray(e,t,r,n,i){for(var o=[],a=0,s=t.length;a<s;++a)hasOwnProperty$1(t,String(a))?o.push(formatProperty(e,t,r,n,String(a),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(formatProperty(e,t,r,n,i,!0))}),o}function formatProperty(e,t,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),hasOwnProperty$1(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=isNull(r)?formatValue(e,u.value,null):formatValue(e,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),isUndefined(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function reduceToSingleString(e,t,r){return e.reduce(function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function isArray$1(e){return Array.isArray(e)}function isBoolean(e){return"boolean"==typeof e}function isNull(e){return null===e}function isNullOrUndefined(e){return null==e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function isUndefined(e){return void 0===e}function isRegExp(e){return isObject(e)&&"[object RegExp]"===objectToString(e)}function isObject(e){return"object"==typeof e&&null!==e}function isDate(e){return isObject(e)&&"[object Date]"===objectToString(e)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(e){return"function"==typeof e}function isPrimitive(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function objectToString(e){return Object.prototype.toString.call(e)}function _extend(e,t){if(!t||!isObject(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}function hasOwnProperty$1(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function hasOwnProperty$2(e,t){return Object.prototype.hasOwnProperty.call(e,t)}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]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var isArray$2=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function stringifyPrimitive(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}}function stringify(e,t,r,n){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?map$1(objectKeys(e),function(n){var i=encodeURIComponent(stringifyPrimitive(n))+r;return isArray$2(e[n])?map$1(e[n],function(e){return i+encodeURIComponent(stringifyPrimitive(e))}).join(t):i+encodeURIComponent(stringifyPrimitive(e[n]))}).join(t):n?encodeURIComponent(stringifyPrimitive(n))+r+encodeURIComponent(stringifyPrimitive(e)):""}function map$1(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var objectKeys=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t};function parse(e,t,r,n){t=t||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var o=/\+/g;e=e.split(t);var a=1e3;n&&"number"==typeof n.maxKeys&&(a=n.maxKeys);var s=e.length;a>0&&s>a&&(s=a);for(var u=0;u<s;++u){var c,f,l,h,p=e[u].replace(o,"%20"),d=p.indexOf(r);d>=0?(c=p.substr(0,d),f=p.substr(d+1)):(c=p,f=""),l=decodeURIComponent(c),h=decodeURIComponent(f),hasOwnProperty$2(i,l)?isArray$2(i[l])?i[l].push(h):i[l]=[i[l],h]:i[l]=h}return i}var url={parse:urlParse,resolve:urlResolve,resolveObject:urlResolveObject,format:urlFormat,Url:Url};function Url(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,delims=["<",">",'"',"`"," ","\r","\n","\t"],unwise=["{","}","|","\\","^","`"].concat(delims),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],hostnameMaxLen=255,hostnamePartPattern=/^[+a-z0-9A-Z_-]{0,63}$/,hostnamePartStart=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,unsafeProtocol={javascript:!0,"javascript:":!0},hostlessProtocol={javascript:!0,"javascript:":!0},slashedProtocol={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function urlParse(e,t,r){if(e&&isObject(e)&&e instanceof Url)return e;var n=new Url;return n.parse(e,t,r),n}function parse$1(e,t,r,n){if(!isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),o=-1!==i&&i<t.indexOf("#")?"?":"#",a=t.split(o);a[0]=a[0].replace(/\\/g,"/");var s=t=a.join(o);if(s=s.trim(),!n&&1===t.split("#").length){var u=simplePathPattern.exec(s);if(u)return e.path=s,e.href=s,e.pathname=u[1],u[2]?(e.search=u[2],e.query=r?parse(e.search.substr(1)):e.search.substr(1)):r&&(e.search="",e.query={}),e}var c,f,l,h,p=protocolPattern.exec(s);if(p){var d=(p=p[0]).toLowerCase();e.protocol=d,s=s.substr(p.length)}if(n||p||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var g="//"===s.substr(0,2);!g||p&&hostlessProtocol[p]||(s=s.substr(2),e.slashes=!0)}if(!hostlessProtocol[p]&&(g||p&&!slashedProtocol[p])){var _,m,y=-1;for(c=0;c<hostEndingChars.length;c++)-1!==(f=s.indexOf(hostEndingChars[c]))&&(-1===y||f<y)&&(y=f);for(-1!==(m=-1===y?s.lastIndexOf("@"):s.lastIndexOf("@",y))&&(_=s.slice(0,m),s=s.slice(m+1),e.auth=decodeURIComponent(_)),y=-1,c=0;c<nonHostChars.length;c++)-1!==(f=s.indexOf(nonHostChars[c]))&&(-1===y||f<y)&&(y=f);-1===y&&(y=s.length),e.host=s.slice(0,y),s=s.slice(y),parseHost(e),e.hostname=e.hostname||"";var v="["===e.hostname[0]&&"]"===e.hostname[e.hostname.length-1];if(!v){var b=e.hostname.split(/\./);for(c=0,l=b.length;c<l;c++){var w=b[c];if(w&&!w.match(hostnamePartPattern)){for(var E="",O=0,S=w.length;O<S;O++)w.charCodeAt(O)>127?E+="x":E+=w[O];if(!E.match(hostnamePartPattern)){var P=b.slice(0,c),T=b.slice(c+1),x=w.match(hostnamePartStart);x&&(P.push(x[1]),T.unshift(x[2])),T.length&&(s="/"+T.join(".")+s),e.hostname=P.join(".");break}}}}e.hostname.length>hostnameMaxLen?e.hostname="":e.hostname=e.hostname.toLowerCase(),v||(e.hostname=toASCII(e.hostname)),h=e.port?":"+e.port:"";var I=e.hostname||"";e.host=I+h,e.href+=e.host,v&&(e.hostname=e.hostname.substr(1,e.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!unsafeProtocol[d])for(c=0,l=autoEscape.length;c<l;c++){var R=autoEscape[c];if(-1!==s.indexOf(R)){var C=encodeURIComponent(R);C===R&&(C=escape(R)),s=s.split(R).join(C)}}var A=s.indexOf("#");-1!==A&&(e.hash=s.substr(A),s=s.slice(0,A));var $=s.indexOf("?");if(-1!==$?(e.search=s.substr($),e.query=s.substr($+1),r&&(e.query=parse(e.query)),s=s.slice(0,$)):r&&(e.search="",e.query={}),s&&(e.pathname=s),slashedProtocol[d]&&e.hostname&&!e.pathname&&(e.pathname="/"),e.pathname||e.search){h=e.pathname||"";var k=e.search||"";e.path=h+k}return e.href=format$1(e),e}function urlFormat(e){return isString(e)&&(e=parse$1({},e)),format$1(e)}function format$1(e){var t=e.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var r=e.protocol||"",n=e.pathname||"",i=e.hash||"",o=!1,a="";e.host?o=t+e.host:e.hostname&&(o=t+(-1===e.hostname.indexOf(":")?e.hostname:"["+this.hostname+"]"),e.port&&(o+=":"+e.port)),e.query&&isObject(e.query)&&Object.keys(e.query).length&&(a=stringify(e.query));var s=e.search||a&&"?"+a||"";return r&&":"!==r.substr(-1)&&(r+=":"),e.slashes||(!r||slashedProtocol[r])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),i&&"#"!==i.charAt(0)&&(i="#"+i),s&&"?"!==s.charAt(0)&&(s="?"+s),r+o+(n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+i}function urlResolve(e,t){return urlParse(e,!1,!0).resolve(t)}function urlResolveObject(e,t){return e?urlParse(e,!1,!0).resolveObject(t):t}function parseHost(e){var t=e.host,r=portPattern.exec(t);r&&(":"!==(r=r[0])&&(e.port=r.substr(1)),t=t.substr(0,t.length-r.length)),t&&(e.hostname=t)}Url.prototype.parse=function(e,t,r){return parse$1(this,e,t,r)},Url.prototype.format=function(){return format$1(this)},Url.prototype.resolve=function(e){return this.resolveObject(urlParse(e,!1,!0)).format()},Url.prototype.resolveObject=function(e){if(isString(e)){var t=new Url;t.parse(e,!1,!0),e=t}for(var r,n=new Url,i=Object.keys(this),o=0;o<i.length;o++){var a=i[o];n[a]=this[a]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),u=0;u<s.length;u++){var c=s[u];"protocol"!==c&&(n[c]=e[c])}return slashedProtocol[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!slashedProtocol[e.protocol]){for(var f=Object.keys(e),l=0;l<f.length;l++){var h=f[l];n[h]=e[h]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||hostlessProtocol[e.protocol])n.pathname=e.pathname;else{for(r=(e.pathname||"").split("/");r.length&&!(e.host=r.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==r[0]&&r.unshift(""),r.length<2&&r.unshift(""),n.pathname=r.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var p=n.pathname||"",d=n.search||"";n.path=p+d}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var g,_=n.pathname&&"/"===n.pathname.charAt(0),m=e.host||e.pathname&&"/"===e.pathname.charAt(0),y=m||_||n.host&&e.pathname,v=y,b=n.pathname&&n.pathname.split("/")||[],w=n.protocol&&!slashedProtocol[n.protocol];if(r=e.pathname&&e.pathname.split("/")||[],w&&(n.hostname="",n.port=null,n.host&&(""===b[0]?b[0]=n.host:b.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===r[0]?r[0]=e.host:r.unshift(e.host)),e.host=null),y=y&&(""===r[0]||""===b[0])),m)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,b=r;else if(r.length)b||(b=[]),b.pop(),b=b.concat(r),n.search=e.search,n.query=e.query;else if(!isNullOrUndefined(e.search))return w&&(n.hostname=n.host=b.shift(),(g=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=g.shift(),n.host=n.hostname=g.shift())),n.search=e.search,n.query=e.query,isNull(n.pathname)&&isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!b.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var E=b.slice(-1)[0],O=(n.host||e.host||b.length>1)&&("."===E||".."===E)||""===E,S=0,P=b.length;P>=0;P--)"."===(E=b[P])?b.splice(P,1):".."===E?(b.splice(P,1),S++):S&&(b.splice(P,1),S--);if(!y&&!v)for(;S--;S)b.unshift("..");!y||""===b[0]||b[0]&&"/"===b[0].charAt(0)||b.unshift(""),O&&"/"!==b.join("/").substr(-1)&&b.push("");var T=""===b[0]||b[0]&&"/"===b[0].charAt(0);return w&&(n.hostname=n.host=T?"":b.length?b.shift():"",(g=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=g.shift(),n.host=n.hostname=g.shift())),(y=y||n.host&&b.length)&&!T&&b.unshift(""),b.length?n.pathname=b.join("/"):(n.pathname=null,n.path=null),isNull(n.pathname)&&isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},Url.prototype.parseHost=function(){return parseHost(this)};var _blobConstructor,xhr,url$1=Object.freeze({parse:urlParse,resolve:urlResolve,resolveObject:urlResolveObject,format:urlFormat,default:url,Url:Url}),empty$1={},empty$2=Object.freeze({default:empty$1}),hasFetch=isFunction$1(global$1.fetch)&&isFunction$1(global$1.ReadableStream);function blobConstructor(){if(void 0!==_blobConstructor)return _blobConstructor;try{new global$1.Blob([new ArrayBuffer(1)]),_blobConstructor=!0}catch(e){_blobConstructor=!1}return _blobConstructor}function checkTypeSupport(e){xhr||(xhr=new global$1.XMLHttpRequest).open("GET",global$1.location.host?"/":"https://example.com");try{return xhr.responseType=e,xhr.responseType===e}catch(e){return!1}}var domain,haveArrayBuffer=void 0!==global$1.ArrayBuffer,haveSlice=haveArrayBuffer&&isFunction$1(global$1.ArrayBuffer.prototype.slice),arraybuffer=haveArrayBuffer&&checkTypeSupport("arraybuffer"),msstream=!hasFetch&&haveSlice&&checkTypeSupport("ms-stream"),mozchunkedarraybuffer=!hasFetch&&haveArrayBuffer&&checkTypeSupport("moz-chunked-arraybuffer"),overrideMimeType=isFunction$1(xhr.overrideMimeType),vbArray=isFunction$1(global$1.VBArray);function isFunction$1(e){return"function"==typeof e}function EventHandlers(){}function EventEmitter(){EventEmitter.init.call(this)}function $getMaxListeners(e){return void 0===e._maxListeners?EventEmitter.defaultMaxListeners:e._maxListeners}function emitNone(e,t,r){if(t)e.call(r);else for(var n=e.length,i=arrayClone(e,n),o=0;o<n;++o)i[o].call(r)}function emitOne(e,t,r,n){if(t)e.call(r,n);else for(var i=e.length,o=arrayClone(e,i),a=0;a<i;++a)o[a].call(r,n)}function emitTwo(e,t,r,n,i){if(t)e.call(r,n,i);else for(var o=e.length,a=arrayClone(e,o),s=0;s<o;++s)a[s].call(r,n,i)}function emitThree(e,t,r,n,i,o){if(t)e.call(r,n,i,o);else for(var a=e.length,s=arrayClone(e,a),u=0;u<a;++u)s[u].call(r,n,i,o)}function emitMany(e,t,r,n){if(t)e.apply(r,n);else for(var i=e.length,o=arrayClone(e,i),a=0;a<i;++a)o[a].apply(r,n)}function _addListener(e,t,r,n){var i,o,a;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((o=e._events)?(o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]):(o=e._events=new EventHandlers,e._eventsCount=0),a){if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),!a.warned&&(i=$getMaxListeners(e))&&i>0&&a.length>i){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=a.length,emitWarning(s)}}else a=o[t]=r,++e._eventsCount;return e}function emitWarning(e){"function"==typeof console.warn?console.warn(e):console.log(e)}function _onceWrap(e,t,r){var n=!1;function i(){e.removeListener(t,i),n||(n=!0,r.apply(e,arguments))}return i.listener=r,i}function listenerCount(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function spliceOne(e,t){for(var r=t,n=r+1,i=e.length;n<i;r+=1,n+=1)e[r]=e[n];e.pop()}function arrayClone(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}function unwrapListeners(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}function BufferList(){this.head=null,this.tail=null,this.length=0}xhr=null,EventHandlers.prototype=Object.create(null),EventEmitter.EventEmitter=EventEmitter,EventEmitter.usingDomains=!1,EventEmitter.prototype.domain=void 0,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.init=function(){this.domain=null,EventEmitter.usingDomains&&(!domain.active||this instanceof domain.Domain||(this.domain=domain.active)),this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new EventHandlers,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},EventEmitter.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},EventEmitter.prototype.getMaxListeners=function(){return $getMaxListeners(this)},EventEmitter.prototype.emit=function(e){var t,r,n,i,o,a,s,u="error"===e;if(a=this._events)u=u&&null==a.error;else if(!u)return!1;if(s=this.domain,u){if(t=arguments[1],!s){if(t instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(r=a[e]))return!1;var f="function"==typeof r;switch(n=arguments.length){case 1:emitNone(r,f,this);break;case 2:emitOne(r,f,this,arguments[1]);break;case 3:emitTwo(r,f,this,arguments[1],arguments[2]);break;case 4:emitThree(r,f,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),o=1;o<n;o++)i[o-1]=arguments[o];emitMany(r,f,this,i)}return!0},EventEmitter.prototype.addListener=function(e,t){return _addListener(this,e,t,!1)},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.prependListener=function(e,t){return _addListener(this,e,t,!0)},EventEmitter.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,_onceWrap(this,e,t)),this},EventEmitter.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,_onceWrap(this,e,t)),this},EventEmitter.prototype.removeListener=function(e,t){var r,n,i,o,a;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(n=this._events))return this;if(!(r=n[e]))return this;if(r===t||r.listener&&r.listener===t)0==--this._eventsCount?this._events=new EventHandlers:(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length;o-- >0;)if(r[o]===t||r[o].listener&&r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new EventHandlers,this;delete n[e]}else spliceOne(r,i);n.removeListener&&this.emit("removeListener",e,a||t)}return this},EventEmitter.prototype.removeAllListeners=function(e){var t,r;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=new EventHandlers,this._eventsCount=0):r[e]&&(0==--this._eventsCount?this._events=new EventHandlers:delete r[e]),this;if(0===arguments.length){for(var n,i=Object.keys(r),o=0;o<i.length;++o)"removeListener"!==(n=i[o])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=new EventHandlers,this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},EventEmitter.prototype.listeners=function(e){var t,r=this._events;return r&&(t=r[e])?"function"==typeof t?[t.listener||t]:unwrapListeners(t):[]},EventEmitter.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):listenerCount.call(e,t)},EventEmitter.prototype.listenerCount=listenerCount,EventEmitter.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]},BufferList.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},BufferList.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},BufferList.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},BufferList.prototype.concat=function(e){if(0===this.length)return Buffer.alloc(0);if(1===this.length)return this.head.data;for(var t=Buffer.allocUnsafe(e>>>0),r=this.head,n=0;r;)r.data.copy(t,n),n+=r.data.length,r=r.next;return t};var isBufferEncoding=Buffer.isEncoding||function(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!0;default:return!1}};function assertEncoding(e){if(e&&!isBufferEncoding(e))throw new Error("Unknown encoding: "+e)}function StringDecoder(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),assertEncoding(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=utf16DetectIncompleteChar;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=base64DetectIncompleteChar;break;default:return void(this.write=passThroughWrite)}this.charBuffer=new Buffer(6),this.charReceived=0,this.charLength=0}function passThroughWrite(e){return e.toString(this.encoding)}function utf16DetectIncompleteChar(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function base64DetectIncompleteChar(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}StringDecoder.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived<this.charLength)return"";if(e=e.slice(r,e.length),!((i=(t=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(t.length-1))>=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var n=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,n),n-=this.charReceived);var i;n=(t+=e.toString(this.encoding,0,n)).length-1;if((i=t.charCodeAt(n))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,n)}return t},StringDecoder.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},StringDecoder.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t};var stringDecoder=Object.freeze({StringDecoder:StringDecoder});Readable.ReadableState=ReadableState;var debug=debuglog("stream");function prependListener(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}function listenerCount$1(e,t){return e.listeners(t).length}function ReadableState(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof Duplex&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n,this.highWaterMark=~~this.highWaterMark,this.buffer=new BufferList,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new StringDecoder(e.encoding),this.encoding=e.encoding)}function Readable(e){if(!(this instanceof Readable))return new Readable(e);this._readableState=new ReadableState(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),EventEmitter.call(this)}function readableAddChunk(e,t,r,n,i){var o=chunkInvalid(t,r);if(o)e.emit("error",o);else if(null===r)t.reading=!1,onEofChunk(e,t);else if(t.objectMode||r&&r.length>0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{var u;!t.decoder||i||n||(r=t.decoder.write(r),u=!t.objectMode&&0===r.length),i||(t.reading=!1),u||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&emitReadable(e))),maybeReadMore(e,t)}else i||(t.reading=!1);return needMoreData(t)}function needMoreData(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}inherits$1(Readable,EventEmitter),Readable.prototype.push=function(e,t){var r=this._readableState;return r.objectMode||"string"!=typeof e||(t=t||r.defaultEncoding)!==r.encoding&&(e=Buffer.from(e,t),t=""),readableAddChunk(this,r,e,t,!1)},Readable.prototype.unshift=function(e){return readableAddChunk(this,this._readableState,e,"",!0)},Readable.prototype.isPaused=function(){return!1===this._readableState.flowing},Readable.prototype.setEncoding=function(e){return this._readableState.decoder=new StringDecoder(e),this._readableState.encoding=e,this};var MAX_HWM=8388608;function computeNewHighWaterMark(e){return e>=MAX_HWM?e=MAX_HWM:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function howMuchToRead(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=computeNewHighWaterMark(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function chunkInvalid(e,t){var r=null;return isBuffer(t)||"string"==typeof t||null==t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function onEofChunk(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,emitReadable(e)}}function emitReadable(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(debug("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?nextTick(emitReadable_,e):emitReadable_(e))}function emitReadable_(e){debug("emit readable"),e.emit("readable"),flow(e)}function maybeReadMore(e,t){t.readingMore||(t.readingMore=!0,nextTick(maybeReadMore_,e,t))}function maybeReadMore_(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(debug("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function pipeOnDrain(e){return function(){var t=e._readableState;debug("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&e.listeners("data").length&&(t.flowing=!0,flow(e))}}function nReadingNextTick(e){debug("readable nexttick read 0"),e.read(0)}function resume(e,t){t.resumeScheduled||(t.resumeScheduled=!0,nextTick(resume_,e,t))}function resume_(e,t){t.reading||(debug("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),flow(e),t.flowing&&!t.reading&&e.read(0)}function flow(e){var t=e._readableState;for(debug("flow",t.flowing);t.flowing&&null!==e.read(););}function fromList(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=fromListPartial(e,t.buffer,t.decoder),r);var r}function fromListPartial(e,t,r){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?copyFromBufferString(e,t):copyFromBuffer(e,t),n}function copyFromBufferString(e,t){var r=t.head,n=1,i=r.data;for(e-=i.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}function copyFromBuffer(e,t){var r=Buffer.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}function endReadable(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,nextTick(endReadableNT,t,e))}function endReadableNT(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function forEach(e,t){for(var r=0,n=e.length;r<n;r++)t(e[r],r)}function indexOf(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function nop(){}function WriteReq(e,t,r){this.chunk=e,this.encoding=t,this.callback=r,this.next=null}function WritableState(e,t){Object.defineProperty(this,"buffer",{get:deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),e=e||{},this.objectMode=!!e.objectMode,t instanceof Duplex&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=!1===e.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){onwrite(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}function Writable(e){if(!(this instanceof Writable||this instanceof Duplex))return new Writable(e);this._writableState=new WritableState(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev)),EventEmitter.call(this)}function writeAfterEnd(e,t){var r=new Error("write after end");e.emit("error",r),nextTick(t,r)}function validChunk(e,t,r,n){var i=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):Buffer.isBuffer(r)||"string"==typeof r||void 0===r||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),nextTick(n,o),i=!1),i}function decodeChunk(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=Buffer.from(t,r)),t}function writeOrBuffer(e,t,r,n,i){r=decodeChunk(t,r,n),Buffer.isBuffer(r)&&(n="buffer");var o=t.objectMode?1:r.length;t.length+=o;var a=t.length<t.highWaterMark;if(a||(t.needDrain=!0),t.writing||t.corked){var s=t.lastBufferedRequest;t.lastBufferedRequest=new WriteReq(r,n,i),s?s.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else doWrite(e,t,!1,o,r,n,i);return a}function doWrite(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function onwriteError(e,t,r,n,i){--t.pendingcb,r?nextTick(i,n):i(n),e._writableState.errorEmitted=!0,e.emit("error",n)}function onwriteStateUpdate(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function onwrite(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(onwriteStateUpdate(r),t)onwriteError(e,r,n,t,i);else{var o=needFinish(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||clearBuffer(e,r),n?nextTick(afterWrite,e,r,o,i):afterWrite(e,r,o,i)}}function afterWrite(e,t,r,n){r||onwriteDrain(e,t),t.pendingcb--,n(),finishMaybe(e,t)}function onwriteDrain(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function clearBuffer(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var a=0;r;)i[a]=r,r=r.next,a+=1;doWrite(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new CorkedRequest(t)}else{for(;r;){var s=r.chunk,u=r.encoding,c=r.callback;if(doWrite(e,t,!1,t.objectMode?1:s.length,s,u,c),r=r.next,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=r,t.bufferProcessing=!1}function needFinish(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function prefinish(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function finishMaybe(e,t){var r=needFinish(t);return r&&(0===t.pendingcb?(prefinish(e,t),t.finished=!0,e.emit("finish")):prefinish(e,t)),r}function endWritable(e,t,r){t.ending=!0,finishMaybe(e,t),r&&(t.finished?nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function CorkedRequest(e){var t=this;this.next=null,this.entry=null,this.finish=function(r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}}Readable.prototype.read=function(e){debug("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return debug("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?endReadable(this):emitReadable(this),null;if(0===(e=howMuchToRead(e,t))&&t.ended)return 0===t.length&&endReadable(this),null;var n,i=t.needReadable;return debug("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&debug("length less than watermark",i=!0),t.ended||t.reading?debug("reading or ended",i=!1):i&&(debug("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=howMuchToRead(r,t))),null===(n=e>0?fromList(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&endReadable(this)),null!==n&&this.emit("data",n),n},Readable.prototype._read=function(e){this.emit("error",new Error("not implemented"))},Readable.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,debug("pipe count=%d opts=%j",n.pipesCount,t);var i=!t||!1!==t.end?a:c;function o(e){debug("onunpipe"),e===r&&c()}function a(){debug("onend"),e.end()}n.endEmitted?nextTick(i):r.once("end",i),e.on("unpipe",o);var s=pipeOnDrain(r);e.on("drain",s);var u=!1;function c(){debug("cleanup"),e.removeListener("close",p),e.removeListener("finish",d),e.removeListener("drain",s),e.removeListener("error",h),e.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",c),r.removeListener("data",l),u=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||s()}var f=!1;function l(t){debug("ondata"),f=!1,!1!==e.write(t)||f||((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==indexOf(n.pipes,e))&&!u&&(debug("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,f=!0),r.pause())}function h(t){debug("onerror",t),g(),e.removeListener("error",h),0===listenerCount$1(e,"error")&&e.emit("error",t)}function p(){e.removeListener("finish",d),g()}function d(){debug("onfinish"),e.removeListener("close",p),g()}function g(){debug("unpipe"),r.unpipe(e)}return r.on("data",l),prependListener(e,"error",h),e.once("close",p),e.once("finish",d),e.emit("pipe",r),n.flowing||(debug("pipe resume"),r.resume()),e},Readable.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<n;i++)r[i].emit("unpipe",this);return this}var o=indexOf(t.pipes,e);return-1===o?this:(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},Readable.prototype.on=function(e,t){var r=EventEmitter.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&emitReadable(this,n):nextTick(nReadingNextTick,this))}return r},Readable.prototype.addListener=Readable.prototype.on,Readable.prototype.resume=function(){var e=this._readableState;return e.flowing||(debug("resume"),e.flowing=!0,resume(this,e)),this},Readable.prototype.pause=function(){return debug("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(debug("pause"),this._readableState.flowing=!1,this.emit("pause")),this},Readable.prototype.wrap=function(e){var t=this._readableState,r=!1,n=this;for(var i in e.on("end",function(){if(debug("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&n.push(e)}n.push(null)}),e.on("data",function(i){(debug("wrapped data"),t.decoder&&(i=t.decoder.write(i)),t.objectMode&&null==i)||(t.objectMode||i&&i.length)&&(n.push(i)||(r=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));return forEach(["error","close","destroy","pause","resume"],function(t){e.on(t,n.emit.bind(n,t))}),n._read=function(t){debug("wrapped _read",t),r&&(r=!1,e.resume())},n},Readable._fromList=fromList,Writable.WritableState=WritableState,inherits$1(Writable,EventEmitter),WritableState.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(e,t,r){var n=this._writableState,i=!1;return"function"==typeof t&&(r=t,t=null),Buffer.isBuffer(e)?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=nop),n.ended?writeAfterEnd(this,r):validChunk(this,n,e,r)&&(n.pendingcb++,i=writeOrBuffer(this,n,e,t,r)),i},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||clearBuffer(this,e))},Writable.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Writable.prototype._write=function(e,t,r){r(new Error("not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||endWritable(this,n,r)},inherits$1(Duplex,Readable);for(var keys$2=Object.keys(Writable.prototype),v=0;v<keys$2.length;v++){var method=keys$2[v];Duplex.prototype[method]||(Duplex.prototype[method]=Writable.prototype[method])}function Duplex(e){if(!(this instanceof Duplex))return new Duplex(e);Readable.call(this,e),Writable.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",onend)}function onend(){this.allowHalfOpen||this._writableState.ended||nextTick(onEndNT,this)}function onEndNT(e){e.end()}function TransformState(e){this.afterTransform=function(t,r){return afterTransform(e,t,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function afterTransform(e,t,r){var n=e._transformState;n.transforming=!1;var i=n.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));n.writechunk=null,n.writecb=null,null!=r&&e.push(r),i(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&e._read(o.highWaterMark)}function Transform(e){if(!(this instanceof Transform))return new Transform(e);Duplex.call(this,e),this._transformState=new TransformState(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.once("prefinish",function(){"function"==typeof this._flush?this._flush(function(e){done(t,e)}):done(t)})}function done(e,t){if(t)return e.emit("error",t);var r=e._writableState,n=e._transformState;if(r.length)throw new Error("Calling transform done when ws.length != 0");if(n.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}function PassThrough(e){if(!(this instanceof PassThrough))return new PassThrough(e);Transform.call(this,e)}function Stream(){EventEmitter.call(this)}inherits$1(Transform,Duplex),Transform.prototype.push=function(e,t){return this._transformState.needTransform=!1,Duplex.prototype.push.call(this,e,t)},Transform.prototype._transform=function(e,t,r){throw new Error("Not implemented")},Transform.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},Transform.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},inherits$1(PassThrough,Transform),PassThrough.prototype._transform=function(e,t,r){r(null,e)},inherits$1(Stream,EventEmitter),Stream.Readable=Readable,Stream.Writable=Writable,Stream.Duplex=Duplex,Stream.Transform=Transform,Stream.PassThrough=PassThrough,Stream.Stream=Stream,Stream.prototype.pipe=function(e,t){var r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",s));var o=!1;function a(){o||(o=!0,e.end())}function s(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(c(),0===EventEmitter.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",a),r.removeListener("close",s),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",u),e.on("error",u),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e};var stream=Object.freeze({default:Stream,Readable:Readable,Writable:Writable,Duplex:Duplex,Transform:Transform,PassThrough:PassThrough,Stream:Stream}),rStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4};function IncomingMessage(e,t,r){var n,i=this;if(Readable.call(i),i._mode=r,i.headers={},i.rawHeaders=[],i.trailers={},i.rawTrailers=[],i.on("end",function(){nextTick(function(){i.emit("close")})}),"fetch"===r){i._fetchResponse=t,i.url=t.url,i.statusCode=t.status,i.statusMessage=t.statusText;for(var o,a,s=t.headers[Symbol.iterator]();o=(a=s.next()).value,!a.done;)i.headers[o[0].toLowerCase()]=o[1],i.rawHeaders.push(o[0],o[1]);var u=t.body.getReader();(n=function(){u.read().then(function(e){i._destroyed||(e.done?i.push(null):(i.push(new Buffer(e.value)),n()))})})()}else{if(i._xhr=e,i._pos=0,i.url=e.responseURL,i.statusCode=e.status,i.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach(function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var r=t[1].toLowerCase();"set-cookie"===r?(void 0===i.headers[r]&&(i.headers[r]=[]),i.headers[r].push(t[2])):void 0!==i.headers[r]?i.headers[r]+=", "+t[2]:i.headers[r]=t[2],i.rawHeaders.push(t[1],t[2])}}),i._charset="x-user-defined",!overrideMimeType){var c=i.rawHeaders["mime-type"];if(c){var f=c.match(/;\s*charset=([^;])(;|$)/);f&&(i._charset=f[1].toLowerCase())}i._charset||(i._charset="utf-8")}}}function toArrayBuffer(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(isBuffer(e)){for(var t=new Uint8Array(e.length),r=e.length,n=0;n<r;n++)t[n]=e[n];return t.buffer}throw new Error("Argument must be a Buffer")}function decideMode(e,t){return hasFetch&&t?"fetch":mozchunkedarraybuffer?"moz-chunked-arraybuffer":msstream?"ms-stream":arraybuffer&&e?"arraybuffer":vbArray&&e?"text:vbarray":"text"}function ClientRequest(e){var t,r=this;Writable.call(r),r._opts=e,r._body=[],r._headers={},e.auth&&r.setHeader("Authorization","Basic "+new Buffer(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(t){r.setHeader(t,e.headers[t])});var n=!0;if("disable-fetch"===e.mode)n=!1,t=!0;else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");t=!0}r._mode=decideMode(t,n),r.on("finish",function(){r._onFinish()})}inherits$1(IncomingMessage,Readable),IncomingMessage.prototype._read=function(){},IncomingMessage.prototype._onXHRProgress=function(){var e=this,t=e._xhr,r=null;switch(e._mode){case"text:vbarray":if(t.readyState!==rStates.DONE)break;try{r=new global$1.VBArray(t.responseBody).toArray()}catch(e){}if(null!==r){e.push(new Buffer(r));break}case"text":try{r=t.responseText}catch(t){e._mode="text:vbarray";break}if(r.length>e._pos){var n=r.substr(e._pos);if("x-user-defined"===e._charset){for(var i=new Buffer(n.length),o=0;o<n.length;o++)i[o]=255&n.charCodeAt(o);e.push(i)}else e.push(n,e._charset);e._pos=r.length}break;case"arraybuffer":if(t.readyState!==rStates.DONE||!t.response)break;r=t.response,e.push(new Buffer(new Uint8Array(r)));break;case"moz-chunked-arraybuffer":if(r=t.response,t.readyState!==rStates.LOADING||!r)break;e.push(new Buffer(new Uint8Array(r)));break;case"ms-stream":if(r=t.response,t.readyState!==rStates.LOADING)break;var a=new global$1.MSStreamReader;a.onprogress=function(){a.result.byteLength>e._pos&&(e.push(new Buffer(new Uint8Array(a.result.slice(e._pos)))),e._pos=a.result.byteLength)},a.onload=function(){e.push(null)},a.readAsArrayBuffer(r)}e._xhr.readyState===rStates.DONE&&"ms-stream"!==e._mode&&e.push(null)},inherits$1(ClientRequest,Writable);var unsafeHeaders=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];function statusValid(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}}function request(e,t){"string"==typeof e&&(e=urlParse(e));var r=-1===global$1.location.protocol.search(/^https?:$/)?"http:":"",n=e.protocol||r,i=e.hostname||e.host,o=e.port,a=e.path||"/";i&&-1!==i.indexOf(":")&&(i="["+i+"]"),e.url=(i?n+"//"+i:"")+(o?":"+o:"")+a,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var s=new ClientRequest(e);return t&&s.on("response",t),s}function get$1(e,t){var r=request(e,t);return r.end(),r}function Agent(){}ClientRequest.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===unsafeHeaders.indexOf(r)&&(this._headers[r]={name:e,value:t})},ClientRequest.prototype.getHeader=function(e){return this._headers[e.toLowerCase()].value},ClientRequest.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},ClientRequest.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t,r=e._opts,n=e._headers;if("POST"!==r.method&&"PUT"!==r.method&&"PATCH"!==r.method||(t=blobConstructor()?new global$1.Blob(e._body.map(function(e){return toArrayBuffer(e)}),{type:(n["content-type"]||{}).value||""}):Buffer.concat(e._body).toString()),"fetch"===e._mode){var i=Object.keys(n).map(function(e){return[n[e].name,n[e].value]});global$1.fetch(e._opts.url,{method:e._opts.method,headers:i,body:t,mode:"cors",credentials:r.withCredentials?"include":"same-origin"}).then(function(t){e._fetchResponse=t,e._connect()},function(t){e.emit("error",t)})}else{var o=e._xhr=new global$1.XMLHttpRequest;try{o.open(e._opts.method,e._opts.url,!0)}catch(t){return void nextTick(function(){e.emit("error",t)})}"responseType"in o&&(o.responseType=e._mode.split(":")[0]),"withCredentials"in o&&(o.withCredentials=!!r.withCredentials),"text"===e._mode&&"overrideMimeType"in o&&o.overrideMimeType("text/plain; charset=x-user-defined"),Object.keys(n).forEach(function(e){o.setRequestHeader(n[e].name,n[e].value)}),e._response=null,o.onreadystatechange=function(){switch(o.readyState){case rStates.LOADING:case rStates.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(o.onprogress=function(){e._onXHRProgress()}),o.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{o.send(t)}catch(t){return void nextTick(function(){e.emit("error",t)})}}}},ClientRequest.prototype._onXHRProgress=function(){statusValid(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())},ClientRequest.prototype._connect=function(){this._destroyed||(this._response=new IncomingMessage(this._xhr,this._fetchResponse,this._mode),this.emit("response",this._response))},ClientRequest.prototype._write=function(e,t,r){this._body.push(e),r()},ClientRequest.prototype.abort=ClientRequest.prototype.destroy=function(){this._destroyed=!0,this._response&&(this._response._destroyed=!0),this._xhr&&this._xhr.abort()},ClientRequest.prototype.end=function(e,t,r){"function"==typeof e&&(r=e,e=void 0),Writable.prototype.end.call(this,e,t,r)},ClientRequest.prototype.flushHeaders=function(){},ClientRequest.prototype.setTimeout=function(){},ClientRequest.prototype.setNoDelay=function(){},ClientRequest.prototype.setSocketKeepAlive=function(){},Agent.defaultMaxSockets=4;var METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],STATUS_CODES={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:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"},http={request:request,get:get$1,Agent:Agent,METHODS:METHODS,STATUS_CODES:STATUS_CODES},http$1=Object.freeze({request:request,get:get$1,Agent:Agent,METHODS:METHODS,STATUS_CODES:STATUS_CODES,default:http}),Url$1=url$1&&url||url$1,fs=empty$2&&empty$1||empty$2,require$$2=http$1&&http||http$1,spawn=fs.spawn,XMLHttpRequest_1=function(){var e,t,r=this,n=require$$2,i=require$$2,o={},a=!1,s={"User-Agent":"node-XMLHttpRequest",Accept:"*/*"},u={},c={},f=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","content-transfer-encoding","cookie","cookie2","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],l=["TRACE","TRACK","CONNECT"],h=!1,p=!1,d={};this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this.readyState=this.UNSENT,this.onreadystatechange=null,this.responseText="",this.responseXML="",this.status=null,this.statusText=null,this.withCredentials=!1;this.open=function(e,t,r,n,i){if(this.abort(),p=!1,!function(e){return e&&-1===l.indexOf(e)}(e))throw new Error("SecurityError: Request method not allowed");o={method:e,url:t.toString(),async:"boolean"!=typeof r||r,user:n||null,password:i||null},g(this.OPENED)},this.setDisableHeaderCheck=function(e){a=e},this.setRequestHeader=function(e,t){if(this.readyState!==this.OPENED)throw new Error("INVALID_STATE_ERR: setRequestHeader can only be called when state is OPEN");if(function(e){return a||e&&-1===f.indexOf(e.toLowerCase())}(e)){if(h)throw new Error("INVALID_STATE_ERR: send flag is true");e=c[e.toLowerCase()]||e,c[e.toLowerCase()]=e,u[e]=u[e]?u[e]+", "+t:t}else console.warn('Refused to set unsafe header "'+e+'"')},this.getResponseHeader=function(e){return"string"==typeof e&&this.readyState>this.OPENED&&t&&t.headers&&t.headers[e.toLowerCase()]&&!p?t.headers[e.toLowerCase()]:null},this.getAllResponseHeaders=function(){if(this.readyState<this.HEADERS_RECEIVED||p)return"";var e="";for(var r in t.headers)"set-cookie"!==r&&"set-cookie2"!==r&&(e+=r+": "+t.headers[r]+"\r\n");return e.substr(0,e.length-2)},this.getRequestHeader=function(e){return"string"==typeof e&&c[e.toLowerCase()]?u[c[e.toLowerCase()]]:""},this.send=function(a){if(this.readyState!==this.OPENED)throw new Error("INVALID_STATE_ERR: connection must be opened before send() is called");if(h)throw new Error("INVALID_STATE_ERR: send has already been called");var f,l=!1,d=!1,_=Url$1.parse(o.url);switch(_.protocol){case"https:":l=!0;case"http:":f=_.hostname;break;case"file:":d=!0;break;case void 0:case null:case"":f="localhost";break;default:throw new Error("Protocol not supported.")}if(d){if("GET"!==o.method)throw new Error("XMLHttpRequest: Only GET method is supported");if(o.async)fs.readFile(_.pathname,"utf8",function(e,t){e?r.handleError(e):(r.status=200,r.responseText=t,g(r.DONE))});else try{this.responseText=fs.readFileSync(_.pathname,"utf8"),this.status=200,g(r.DONE)}catch(e){this.handleError(e)}}else{var m=_.port||(l?443:80),y=_.pathname+(_.search?_.search:"");for(var v in s)c[v.toLowerCase()]||(u[v]=s[v]);if(u.Host=f,l&&443===m||80===m||(u.Host+=":"+_.port),o.user){void 0===o.password&&(o.password="");var b=new Buffer(o.user+":"+o.password);u.Authorization="Basic "+b.toString("base64")}"GET"===o.method||"HEAD"===o.method?a=null:a?(u["Content-Length"]=isBuffer(a)?a.length:Buffer.byteLength(a),u["Content-Type"]||(u["Content-Type"]="text/plain;charset=UTF-8")):"POST"===o.method&&(u["Content-Length"]=0);var w={host:f,port:m,path:y,method:o.method,headers:u,agent:!1,withCredentials:r.withCredentials};if(p=!1,o.async){var E=l?i.request:n.request;h=!0,r.dispatchEvent("readystatechange");var O=function(e){r.handleError(e)};e=E(w,function n(i){if(301!==(t=i).statusCode&&302!==t.statusCode&&303!==t.statusCode&&307!==t.statusCode)t.setEncoding("utf8"),g(r.HEADERS_RECEIVED),r.status=t.statusCode,t.on("data",function(e){e&&(r.responseText+=e),h&&g(r.LOADING)}),t.on("end",function(){h&&(g(r.DONE),h=!1)}),t.on("error",function(e){r.handleError(e)});else{o.url=t.headers.location;var a=Url$1.parse(o.url);f=a.hostname;var s={hostname:a.hostname,port:a.port,path:a.path,method:303===t.statusCode?"GET":o.method,headers:u,withCredentials:r.withCredentials};(e=E(s,n).on("error",O)).end()}}).on("error",O),a&&e.write(a),e.end(),r.dispatchEvent("loadstart")}else{var S=".node-xmlhttprequest-content-"+process$4.pid,P=".node-xmlhttprequest-sync-"+process$4.pid;fs.writeFileSync(P,"","utf8");for(var T="var http = require('http'), https = require('https'), fs = require('fs');var doRequest = http"+(l?"s":"")+".request;var options = "+JSON.stringify(w)+";var responseText = '';var req = doRequest(options, function(response) {response.setEncoding('utf8');response.on('data', function(chunk) { responseText += chunk;});response.on('end', function() {fs.writeFileSync('"+S+"', JSON.stringify({err: null, data: {statusCode: response.statusCode, headers: response.headers, text: responseText}}), 'utf8');fs.unlinkSync('"+P+"');});response.on('error', function(error) {fs.writeFileSync('"+S+"', JSON.stringify({err: error}), 'utf8');fs.unlinkSync('"+P+"');});}).on('error', function(error) {fs.writeFileSync('"+S+"', JSON.stringify({err: error}), 'utf8');fs.unlinkSync('"+P+"');});"+(a?"req.write('"+JSON.stringify(a).slice(1,-1).replace(/'/g,"\\'")+"');":"")+"req.end();",x=spawn(process$4.argv[0],["-e",T]);fs.existsSync(P););var I=JSON.parse(fs.readFileSync(S,"utf8"));x.stdin.end(),fs.unlinkSync(S),I.err?r.handleError(I.err):(t=I.data,r.status=I.data.statusCode,r.responseText=I.data.text,g(r.DONE))}}},this.handleError=function(e){this.status=0,this.statusText=e,this.responseText=e.stack,p=!0,g(this.DONE),this.dispatchEvent("error")},this.abort=function(){e&&(e.abort(),e=null),u=s,this.status=0,this.responseText="",this.responseXML="",p=!0,this.readyState===this.UNSENT||this.readyState===this.OPENED&&!h||this.readyState===this.DONE||(h=!1,g(this.DONE)),this.readyState=this.UNSENT,this.dispatchEvent("abort")},this.addEventListener=function(e,t){e in d||(d[e]=[]),d[e].push(t)},this.removeEventListener=function(e,t){e in d&&(d[e]=d[e].filter(function(e){return e!==t}))},this.dispatchEvent=function(e){if("function"==typeof r["on"+e]&&r["on"+e](),e in d)for(var t=0,n=d[e].length;t<n;t++)d[e][t].call(r)};var g=function(e){e!=r.LOADING&&r.readyState===e||(r.readyState=e,(o.async||r.readyState<r.OPENED||r.readyState===r.DONE)&&r.dispatchEvent("readystatechange"),r.readyState!==r.DONE||p||(r.dispatchEvent("load"),r.dispatchEvent("loadend")))}},s=1e3,m=60*s,h=60*m,d=24*h,y=365.25*d,ms=function(e,t){t=t||{};var r=typeof e;if("string"===r&&e.length>0)return parse$2(e);if("number"===r&&!1===isNaN(e))return t.long?fmtLong(e):fmtShort(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse$2(e){if(!((e=String(e)).length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*y;case"days":case"day":case"d":return r*d;case"hours":case"hour":case"hrs":case"hr":case"h":return r*h;case"minutes":case"minute":case"mins":case"min":case"m":return r*m;case"seconds":case"second":case"secs":case"sec":case"s":return r*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function fmtShort(e){return e>=d?Math.round(e/d)+"d":e>=h?Math.round(e/h)+"h":e>=m?Math.round(e/m)+"m":e>=s?Math.round(e/s)+"s":e+"ms"}function fmtLong(e){return plural(e,d,"day")||plural(e,h,"hour")||plural(e,m,"minute")||plural(e,s,"second")||e+" ms"}function plural(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}var debug$1=createCommonjsModule(function(e,t){function r(e){var r;function i(){if(i.enabled){var e=i,n=+new Date,o=n-(r||n);e.diff=o,e.prev=r,e.curr=n,r=n;for(var a=new Array(arguments.length),s=0;s<a.length;s++)a[s]=arguments[s];a[0]=t.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");var u=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,function(r,n){if("%%"===r)return r;u++;var i=t.formatters[n];if("function"==typeof i){var o=a[u];r=i.call(e,o),a.splice(u,1),u--}return r}),t.formatArgs.call(e,a),(i.log||t.log||console.log.bind(console)).apply(e,a)}}return i.namespace=e,i.enabled=t.enabled(e),i.useColors=t.useColors(),i.color=function(e){var r,n=0;for(r in e)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]}(e),i.destroy=n,"function"==typeof t.init&&t.init(i),t.instances.push(i),i}function n(){var e=t.instances.indexOf(this);return-1!==e&&(t.instances.splice(e,1),!0)}(t=e.exports=r.debug=r.default=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){var r;t.save(e),t.names=[],t.skips=[];var n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")));for(r=0;r<t.instances.length;r++){var o=t.instances[r];o.enabled=t.enabled(o.namespace)}},t.enabled=function(e){if("*"===e[e.length-1])return!0;var r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=ms,t.instances=[],t.names=[],t.skips=[],t.formatters={}}),debug_1=debug$1.coerce,debug_2=debug$1.disable,debug_3=debug$1.enable,debug_4=debug$1.enabled,debug_5=debug$1.humanize,debug_6=debug$1.instances,debug_7=debug$1.names,debug_8=debug$1.skips,debug_9=debug$1.formatters,browser$1=createCommonjsModule(function(e,t){function r(){var e;try{e=t.storage.debug}catch(e){}return!e&&void 0!==process$4&&"env"in process$4&&(e=process$4.env.DEBUG),e}(t=e.exports=debug$1).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),!r)return;var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var i=0,o=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(i++,"%c"===e&&(o=i))}),e.splice(o,0,n)},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=r,t.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(r())}),browser_1=browser$1.log,browser_2=browser$1.formatArgs,browser_3=browser$1.save,browser_4=browser$1.load,browser_5=browser$1.useColors,browser_6=browser$1.storage,browser_7=browser$1.colors;const log$2=browser$1("request");function request$1(e){return new Promise((t,r)=>{let n=e.url;n||r(new Error("URL is missing"));let i=new("undefined"==typeof XMLHttpRequest?XMLHttpRequest_1:XMLHttpRequest);i.onload=(()=>{if(i.status>=200&&i.status<300)t(i.responseText);else{let e=`Error fetching url:${n}; status code:${i.status}`;r(new Error(e))}}),i.ontimeout=(e=>{console.log("ontimeout",e)}),i.onreadystatechange=(()=>{404===i.status&&r(new Error(`Error fetching url:${n}; status code:${i.status}`))}),i.onerror=(()=>{log$2(`Request failed with error ${i.responseText}`),r(new Error(i.responseText))}),i.open(e.method||"GET",n),e.body?i.send(JSON.stringify(e.body)):i.send()})}async function getIssuerProfile$1(e){if(!e)throw new VerifierError(getIssuerProfile,"Unable to get issuer profile");const t=await request$1({url:e}).catch(()=>{throw new VerifierError(getIssuerProfile,"Unable to get issuer profile")});return JSON.parse(t)}async function getRevokedAssertions(e){if(!e)return Promise.resolve([]);const t=await request$1({url:e}).catch(()=>{throw new VerifierError(parseIssuerKeys,"Unable to get revocation assertions")});let r=JSON.parse(t);return r.revokedAssertions?r.revokedAssertions:[]}function stripHashPrefix(e,t){for(let r=0;r<t.length;r++){let n=t[r];if(startsWith(e,n))return e.slice(n.length)}return e}function getEtherScanFetcher(e,t){const r="&action=eth_getTransactionByHash&txhash=";let n;return n=t===BLOCKCHAINS.ethmain.code?API_URLS.etherScanMainUrl+r+e:API_URLS.etherScanRopstenUrl+r+e,new Promise((e,r)=>request$1({url:n}).then(function(n){const i=JSON.parse(n);try{getEtherScanBlock(i,t).then(function(t){const r=parseEtherScanResponse(i,t);e(r)}).catch(function(){r(new VerifierError(fetchRemoteHash,"Unable to get remote hash"))})}catch(e){r(new VerifierError(fetchRemoteHash,"Unable to get remote hash"))}}).catch(function(){r(new VerifierError(fetchRemoteHash,"Unable to get remote hash"))}))}function parseEtherScanResponse(e,t){const r=e.result,n=new Date(1e3*parseInt(t.timestamp,16)),i=r.from,o=stripHashPrefix(r.input,BLOCKCHAINS.ethmain.prefixes);return new TransactionData(o,i,n,void 0)}function getEtherScanBlock(e,t){const r=e.result.blockNumber,n="&action=eth_getBlockByNumber&boolean=true&tag=";let i;return i=t===BLOCKCHAINS.ethmain.code?API_URLS.etherScanMainUrl+n+r:API_URLS.etherScanRopstenUrl+n+r,new Promise((e,n)=>request$1({url:i}).then(function(i){const o=JSON.parse(i).result;try{checkEtherScanConfirmations(t,r).then(function(){e(o)}).catch(function(){n(new VerifierError(fetchRemoteHash,"Unable to get remote hash"))})}catch(e){n(new VerifierError(fetchRemoteHash,"Unable to get remote hash"))}}).catch(function(){n(new VerifierError(fetchRemoteHash,"Unable to get remote hash"))}))}function checkEtherScanConfirmations(e,t){const r="&action=eth_blockNumber";let n;return n=e===BLOCKCHAINS.ethmain.code?API_URLS.etherScanMainUrl+r:API_URLS.etherScanRopstenUrl+r,new Promise((e,r)=>request$1({url:n}).then(function(n){const i=JSON.parse(n).result;try{i-t<CONFIG.MininumConfirmations&&r(new VerifierError(fetchRemoteHash,"Number of transaction confirmations were less than the minimum required, according to EtherScan API")),e(i)}catch(e){r(new VerifierError(fetchRemoteHash,"Unable to get remote hash"))}}).catch(function(){r(new VerifierError(fetchRemoteHash,"Unable to get remote hash"))}))}function noOffset(e){let t=e.slice(0,-5).split(/\D/).map(function(e){return parseInt(e,10)||0});t[1]-=1,t=new Date(Date.UTC.apply(Date,t));let r=e.slice(-5),n=parseInt(r,10)/100;return"+"===r.slice(0,1)&&(n*=-1),t.setHours(t.getHours()+n),t.getTime()}function dateFromRegex(e){let t,r,n=/^(\d{4}\-\d\d\-\d\d([tT][\d:\.]*)?)([zZ]|([+\-])(\d\d):?(\d\d))?$/.exec(e)||[];return n[1]?((t=n[1].split(/\D/).map(function(e){return parseInt(e,10)||0}))[1]-=1,(t=new Date(Date.UTC.apply(Date,t))).getDate()?(n[5]&&(r=parseInt(n[5],10)/100*60,n[6]&&(r+=parseInt(n[6],10)),"+"===n[4]&&(r*=-1),r&&t.setUTCMinutes(t.getUTCMinutes()+r)),t):NaN):NaN}function dateFromIso(e){let t=Date.parse(e);if(t)return new Date(t);let r=noOffset(e);return r||dateFromRegex(e)}function dateToUnixTimestamp(e){return""===e?"":dateFromIso(e)}function getBlockcypherFetcher(e,t){let r;return r=t===BLOCKCHAINS.bitcoin.code?API_URLS.blockCypherUrl+e+"?limit=500":API_URLS.blockCypherTestUrl+e+"?limit=500",new Promise((e,t)=>request$1({url:r}).then(function(r){const n=JSON.parse(r);try{const r=parseBlockCypherResponse(n);e(r)}catch(e){t(e.message)}}).catch(function(){t(new VerifierError(fetchRemoteHash,"Unable to get remote hash"))}))}function getChainSoFetcher(e,t){let r;return r=t===BLOCKCHAINS.bitcoin.code?API_URLS.chainSoUrl+e:API_URLS.chainSoTestUrl+e,new Promise((e,t)=>request$1({url:r}).then(function(r){const n=JSON.parse(r);try{const r=parseChainSoResponse(n);e(r)}catch(e){t(new VerifierError(fetchRemoteHash,"Unable to get remote hash"))}}).catch(function(){t(new VerifierError(fetchRemoteHash,"Unable to get remote hash"))}))}function parseBlockCypherResponse(e){if(e.confirmations<CONFIG.MininumConfirmations)throw new VerifierError("Number of transaction confirmations were less than the minimum required, according to Blockcypher API");const t=dateToUnixTimestamp(e.received),r=e.outputs,n=r[r.length-1],i=e.inputs[0].addresses[0],o=stripHashPrefix(n.script,BLOCKCHAINS.bitcoin.prefixes),a=r.filter(e=>!!e.spent_by).map(e=>e.addresses[0]);return new TransactionData(o,i,t,a)}function parseChainSoResponse(e){if(e.data.confirmations<CONFIG.MininumConfirmations)throw new VerifierError("Number of transaction confirmations were less than the minimum required, according to Chain.so API");const t=new Date(1e3*e.data.time),r=e.data.outputs,n=r[r.length-1],i=e.data.inputs[0].address,o=stripHashPrefix(n.script,BLOCKCHAINS.bitcoin.prefixes);return new TransactionData(o,i,t,void 0)}const BitcoinExplorers=[(e,t)=>getChainSoFetcher(e,t),(e,t)=>getBlockcypherFetcher(e,t)],EthereumExplorers=[(e,t)=>getEtherScanFetcher(e,t)],BlockchainExplorersWithSpentOutputInfo=[(e,t)=>getBlockcypherFetcher(e,t)],log$3=browser$1("blockchainConnectors");function PromiseProperRace(e,t,r=[]){if((e=Array.from(e)).length<t)return Promise.reject(new VerifierError(fetchRemoteHash,"Could not confirm the transaction"));let n=e.map((e,t)=>e.then(()=>t).catch(e=>{throw log$3(e),t}));return Promise.race(n).then(n=>{return e.splice(n,1)[0].then(e=>r.push(e)),1===t?r:PromiseProperRace(e,t-1,r)}).catch(n=>(e.splice(n,1),PromiseProperRace(e,t,r)))}function lookForTx(e,t,r){let n;switch(t){case BLOCKCHAINS.bitcoin.code:case BLOCKCHAINS.regtest.code:case BLOCKCHAINS.testnet.code:case BLOCKCHAINS.mocknet.code:n=BitcoinExplorers;break;case BLOCKCHAINS.ethmain.code:case BLOCKCHAINS.ethropst.code:n=EthereumExplorers;break;default:return Promise.reject(new VerifierError(fetchRemoteHash,"Invalid chain; does not map to known BlockchainExplorers."))}if(CONFIG.MinimumBlockchainExplorers>n.length)return Promise.reject(new VerifierError(fetchRemoteHash,"Invalid application configuration; check the CONFIG.MinimumBlockchainExplorers configuration value"));if(CONFIG.MinimumBlockchainExplorers>BlockchainExplorersWithSpentOutputInfo.length&&(r===CERTIFICATE_VERSIONS.V1_1||r===CERTIFICATE_VERSIONS.V1_2))return Promise.reject(new VerifierError(fetchRemoteHash,"Invalid application configuration; check the CONFIG.MinimumBlockchainExplorers configuration value"));let i,o=[];if(r===CERTIFICATE_VERSIONS.V1_1||r===CERTIFICATE_VERSIONS.V1_2){i=CONFIG.MinimumBlockchainExplorers;for(let r=0;r<i;r++)o.push(BlockchainExplorersWithSpentOutputInfo[r](e,t))}else{i=CONFIG.MinimumBlockchainExplorers;for(let r=0;r<i;r++)o.push(n[r](e,t))}return new Promise((e,t)=>PromiseProperRace(o,CONFIG.MinimumBlockchainExplorers).then(t=>{if(!t||0===t.length)return Promise.reject(new VerifierError(fetchRemoteHash,"Could not confirm the transaction. No blockchain apis returned a response. This could be because of rate limiting."));const r=t[0];for(let e=1;e<t.length;e++){const n=t[e];if(r.issuingAddress!==n.issuingAddress)throw new VerifierError(fetchRemoteHash,"Issuing addresses returned by the blockchain APIs were different");if(r.remoteHash!==n.remoteHash)throw new VerifierError(fetchRemoteHash,"Remote hashes returned by the blockchain APIs were different")}e(r)}).catch(e=>{t(new VerifierError(fetchRemoteHash,e.message))}))}function createKeyObject(e,t=null){const r=e.created?dateToUnixTimestamp(e.created):null,n=e.revoked?dateToUnixTimestamp(e.revoked):null,i=e.expires?dateToUnixTimestamp(e.expires):null;let o=t;if(!t){o=(e.id||e.publicKey).replace("ecdsa-koblitz-pubkey:","")}return new Key(o,r,n,i)}function parseIssuerKeys$1(e){try{let t={};if("@context"in e){const r=e.publicKey||e.publicKeys;for(let e=0;e<r.length;e++){const n=createKeyObject(r[e]);t[n.publicKey]=n}}else{const r=createKeyObject({},(e.issuerKeys||[])[0].key);t[r.publicKey]=r}return t}catch(e){throw new VerifierError(parseIssuerKeys,"Unable to parse JSON out of issuer identification data.")}}function parseRevocationKey(e){return e&&e.hasOwnProperty("revocationKeys")&&e.revocationKeys.length>0?e.revocationKeys[0].key:null}var verifier=Object.freeze({getIssuerProfile:getIssuerProfile$1,getRevokedAssertions:getRevokedAssertions,lookForTx:lookForTx,parseIssuerKeys:parseIssuerKeys$1,parseRevocationKey:parseRevocationKey}),domain$1={addresses:addresses,certificates:certificates,chains:chainsService,verifier:verifier};function getSignatureImages(e,t){let r=[];switch(t){case CERTIFICATE_VERSIONS.V1_1:case CERTIFICATE_VERSIONS.V1_2:if(e.constructor===Array)for(let t in e){let n=e[t],i="jobTitle"in n?n.jobTitle:null,o="name"in n?n.name:null,a=new SignatureImage(n.image,i,o);r.push(a)}else{let t=new SignatureImage(e,null,null);r.push(t)}break;case CERTIFICATE_VERSIONS.V2_0:for(let t in e){let n=e[t],i=new SignatureImage(n.image,n.jobTitle,n.name);r.push(i)}}return r}function parseV1(e){const t=e.certificate||e.document.certificate,r=e.recipient||e.document.recipient,n=e.document.assertion,i=e.receipt,o=void 0===i?CERTIFICATE_VERSIONS.V1_1:CERTIFICATE_VERSIONS.V1_2;let{image:a,description:s,issuer:u,subtitle:c}=t;const f=r.publicKey,l=domain$1.certificates.getChain(f),h=n.expires,p=n.uid,d=n.issuedOn,g=n.metadataJson,_=`${r.givenName} ${r.familyName}`,m=n.id,y=r.revocationKey||null,v=u.image,b=e.document.signature,w=getSignatureImages(e.document&&e.document.assertion&&e.document.assertion["image:signature"],o);return"object"==typeof c&&(c=c.display?c.content:""),{certificateImage:a,chain:l,description:s,expires:h,id:p,issuedOn:d,issuer:u,metadataJson:g,name:t.title||t.name,publicKey:f,receipt:i,recipientFullName:_,recordLink:m,revocationKey:y,sealImage:v,signature:b,signatureImage:w,subtitle:c,version:o}}function parseV2(e){const{id:t,expires:r,signature:n,badge:i}=e,{image:o,name:a,description:s,subtitle:u,issuer:c}=i,f=e.verification.publicKey||e.verification.creator,l=e.recipientProfile||e.recipient.recipientProfile,h=CERTIFICATE_VERSIONS.V2_0;return{certificateImage:o,chain:domain$1.certificates.getChain(f,e.signature),description:s,expires:r,id:t,issuedOn:e.issuedOn,issuer:c,metadataJson:e.metadataJson,name:a,publicKey:l.publicKey,receipt:n,recipientFullName:l.name,recordLink:e.id,revocationKey:null,sealImage:c.image,signature:null,signatureImage:getSignatureImages(i.signatureLines,h),subtitle:u,version:h}}function parseJSON(e){let t;try{return(t=e["@context"]instanceof Array?parseV2(e):parseV1(e)).isFormatValid=!0,t}catch(e){return{isFormatValid:!1}}}var __dirname="/Users/raiseandfall/Projects/learningmachine/cert-verifier-js/code/node_modules/jsonld/js",es6Promise=createCommonjsModule(function(e){(function(){function t(e){return"function"==typeof e}var r,n,i=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},o=0,a=function(e,t){b[o]=e,b[o+1]=t,2===(o+=2)&&(n?n(w):p())};var s="undefined"!=typeof window?window:void 0,u=s||{},c=u.MutationObserver||u.WebKitMutationObserver,f=void 0!==process$4&&"[object process]"==={}.toString.call(process$4),l="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){return function(){setTimeout(w,1)}}var p,d,g,_,m,y,v,b=new Array(1e3);function w(){for(var e=0;e<o;e+=2){(0,b[e])(b[e+1]),b[e]=void 0,b[e+1]=void 0}o=0}function E(){}f?(y=nextTick,v=process$4.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/),Array.isArray(v)&&"0"===v[1]&&"10"===v[2]&&(y=setImmediate),p=function(){y(w)}):c?(g=0,_=new c(w),m=document.createTextNode(""),_.observe(m,{characterData:!0}),p=function(){m.data=g=++g%2}):l?((d=new MessageChannel).port1.onmessage=w,p=function(){d.port2.postMessage(0)}):p=void 0===s&&"function"==typeof commonjsRequire?function(){try{var e=commonjsRequire("vertx");return r=e.runOnLoop||e.runOnContext,function(){r(w)}}catch(e){return h()}}():h();var O=void 0,S=1,P=2,T=new N;function x(e,r){if(r.constructor===e.constructor)!function(e,t){t._state===S?C(e,t._result):t._state===P?A(e,t._result):$(t,void 0,function(t){I(e,t)},function(t){A(e,t)})}(e,r);else{var n=function(e){try{return e.then}catch(e){return T.error=e,T}}(r);n===T?A(e,T.error):void 0===n?C(e,r):t(n)?function(e,t,r){a(function(e){var n=!1,i=function(e,t,r,n){try{e.call(t,r,n)}catch(e){return e}}(r,t,function(r){n||(n=!0,t!==r?I(e,r):C(e,r))},function(t){n||(n=!0,A(e,t))},e._label);!n&&i&&(n=!0,A(e,i))},e)}(e,r,n):C(e,r)}}function I(e,t){var r;e===t?A(e,new TypeError("You cannot resolve a promise with itself")):"function"==typeof(r=t)||"object"==typeof r&&null!==r?x(e,t):C(e,t)}function R(e){e._onerror&&e._onerror(e._result),k(e)}function C(e,t){e._state===O&&(e._result=t,e._state=S,0!==e._subscribers.length&&a(k,e))}function A(e,t){e._state===O&&(e._state=P,e._result=t,a(R,e))}function $(e,t,r,n){var i=e._subscribers,o=i.length;e._onerror=null,i[o]=t,i[o+S]=r,i[o+P]=n,0===o&&e._state&&a(k,e)}function k(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n,i,o=e._result,a=0;a<t.length;a+=3)n=t[a],i=t[a+r],n?j(r,n,i,o):i(o);e._subscribers.length=0}}function N(){this.error=null}var B=new N;function j(e,r,n,i){var o,a,s,u,c=t(n);if(c){if((o=function(e,t){try{return e(t)}catch(e){return B.error=e,B}}(n,i))===B?(u=!0,a=o.error,o=null):s=!0,r===o)return void A(r,new TypeError("A promises callback cannot return that same promise."))}else o=i,s=!0;r._state!==O||(c&&s?I(r,o):u?A(r,a):e===S?C(r,o):e===P&&A(r,o))}function D(e,t){this._instanceConstructor=e,this.promise=new e(E),this._validateInput(t)?(this._input=t,this.length=t.length,this._remaining=t.length,this._init(),0===this.length?C(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&C(this.promise,this._result))):A(this.promise,this._validationError())}D.prototype._validateInput=function(e){return i(e)},D.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},D.prototype._init=function(){this._result=new Array(this.length)};var L=D;D.prototype._enumerate=function(){for(var e=this.length,t=this.promise,r=this._input,n=0;t._state===O&&n<e;n++)this._eachEntry(r[n],n)},D.prototype._eachEntry=function(e,t){var r,n=this._instanceConstructor;"object"==typeof(r=e)&&null!==r?e.constructor===n&&e._state!==O?(e._onerror=null,this._settledAt(e._state,t,e._result)):this._willSettleAt(n.resolve(e),t):(this._remaining--,this._result[t]=e)},D.prototype._settledAt=function(e,t,r){var n=this.promise;n._state===O&&(this._remaining--,e===P?A(n,r):this._result[t]=r),0===this._remaining&&C(n,this._result)},D.prototype._willSettleAt=function(e,t){var r=this;$(e,void 0,function(e){r._settledAt(S,t,e)},function(e){r._settledAt(P,t,e)})};var M=function(e){return new L(this,e).promise};var U=function(e){var t=new this(E);if(!i(e))return A(t,new TypeError("You must pass an array to race.")),t;var r=e.length;function n(e){I(t,e)}function o(e){A(t,e)}for(var a=0;t._state===O&&a<r;a++)$(this.resolve(e[a]),void 0,n,o);return t};var F=function(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(E);return I(t,e),t};var H=function(e){var t=new this(E);return A(t,e),t},V=0;var q=K;function K(e){this._id=V++,this._state=void 0,this._result=void 0,this._subscribers=[],E!==e&&(t(e)||function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof K||function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}(),function(e,t){try{t(function(t){I(e,t)},function(t){A(e,t)})}catch(t){A(e,t)}}(this,e))}K.all=M,K.race=U,K.resolve=F,K.reject=H,K._setScheduler=function(e){n=e},K._setAsap=function(e){a=e},K._asap=a,K.prototype={constructor:K,then:function(e,t){var r=this._state;if(r===S&&!e||r===P&&!t)return this;var n=new this.constructor(E),i=this._result;if(r){var o=arguments[r-1];a(function(){j(r,n,o,i)})}else $(this,n,e,t);return n},catch:function(e){return this.then(null,e)}};var G=function(){var e;if(void 0!==commonjsGlobal)e=commonjsGlobal;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;t&&"[object Promise]"===Object.prototype.toString.call(t.resolve())&&!t.cast||(e.Promise=q)},W={Promise:q,polyfill:G};e.exports?e.exports=W:void 0!==this&&(this.ES6Promise=W),G()}).call(commonjsGlobal)}),ignore=Object.freeze({}),jsonld=createCommonjsModule(function(e){var t,r,n,i;t=void 0!==process$4&&process$4.versions&&process$4.versions.node,r=!t&&("undefined"!=typeof window||"undefined"!=typeof self),i=function(){return n(function(){return i()})},(n=function(e){function n(){}e.compact=function(t,r,n,i){if(arguments.length<2)return e.nextTick(function(){i(new TypeError("Could not compact, too few arguments."))});if("function"==typeof n&&(i=n,n={}),n=n||{},null===r)return e.nextTick(function(){i(new P("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"}))});if(null===t)return e.nextTick(function(){i(null,null)});"base"in n||(n.base="string"==typeof t?t:""),"compactArrays"in n||(n.compactArrays=!0),"graph"in n||(n.graph=!1),"skipExpansion"in n||(n.skipExpansion=!1),"documentLoader"in n||(n.documentLoader=e.loadDocument),"link"in n||(n.link=!1),n.link&&(n.skipExpansion=!0);!function(t,r,n){if(r.skipExpansion)return e.nextTick(function(){n(null,t)});e.expand(t,r,n)}(t,n,function(t,o){if(t)return i(new P("Could not expand input before compaction.","jsonld.CompactError",{cause:t}));var a=Y(n);e.processContext(a,r,n,function(e,t){if(e)return i(new P("Could not process context before compaction.","jsonld.CompactError",{cause:e}));var a;try{a=(new T).compact(t,null,o,n)}catch(e){return i(e)}!function(e,t,n,o){if(e)return i(e);o.compactArrays&&!o.graph&&Q(t)?1===t.length?t=t[0]:0===t.length&&(t={}):o.graph&&X(t)&&(t=[t]);X(r)&&"@context"in r&&(r=r["@context"]);Q(r=fe(r))||(r=[r]);var a=r;r=[];for(var s=0;s<a.length;++s)(!X(a[s])||Object.keys(a[s]).length>0)&&r.push(a[s]);var u=r.length>0;1===r.length&&(r=r[0]);if(Q(t)){var c=G(n,"@graph"),f=t;t={},u&&(t["@context"]=r),t[c]=f}else if(X(t)&&u){var f=t;for(var l in t={"@context":r},f)t[l]=f[l]}i(null,t,n)}(null,a,t,n)})})},e.expand=function(t,r,n){if(arguments.length<1)return e.nextTick(function(){n(new TypeError("Could not expand, too few arguments."))});function i(e){"base"in r||(r.base=e.documentUrl||"");var t={document:fe(e.document),remoteContext:{"@context":e.contextUrl}};if("expandContext"in r){var i=fe(r.expandContext);t.expandContext="object"==typeof i&&"@context"in i?i:{"@context":i}}he(t,r,function(e,t){if(e)return n(e);var i;try{var o=new T,a=Y(r),s=t.document,u=t.remoteContext["@context"];t.expandContext&&(a=o.processContext(a,t.expandContext["@context"],r)),u&&(a=o.processContext(a,u,r)),X(i=o.expand(a,null,s,r,!1))&&"@graph"in i&&1===Object.keys(i).length?i=i["@graph"]:null===i&&(i=[]),Q(i)||(i=[i])}catch(e){return n(e)}n(null,i)})}"function"==typeof r&&(n=r,r={}),"documentLoader"in(r=r||{})||(r.documentLoader=e.loadDocument),"keepFreeFloatingNodes"in r||(r.keepFreeFloatingNodes=!1),e.nextTick(function(){if("string"!=typeof t)i({contextUrl:null,documentUrl:null,document:t});else{var e=function(e,t){if(e)return n(e);try{if(!t.document)throw new P("No remote document found at the given URL.","jsonld.NullRemoteDocument");"string"==typeof t.document&&(t.document=JSON.parse(t.document))}catch(e){return n(new P("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",cause:e,remoteDoc:t}))}i(t)},o=r.documentLoader(t,e);o&&"then"in o&&o.then(e.bind(null,null),e)}})},e.flatten=function(t,r,n,i){if(arguments.length<1)return e.nextTick(function(){i(new TypeError("Could not flatten, too few arguments."))});"function"==typeof n?(i=n,n={}):"function"==typeof r&&(i=r,r=null,n={}),"base"in(n=n||{})||(n.base="string"==typeof t?t:""),"documentLoader"in n||(n.documentLoader=e.loadDocument),e.expand(t,n,function(t,o){if(t)return i(new P("Could not expand input before flattening.","jsonld.FlattenError",{cause:t}));var a;try{a=(new T).flatten(o)}catch(e){return i(e)}if(null===r)return i(null,a);n.graph=!0,n.skipExpansion=!0,e.compact(a,r,n,function(e,t){if(e)return i(new P("Could not compact flattened output.","jsonld.FlattenError",{cause:e}));i(null,t)})})},e.frame=function(t,r,n,i){if(arguments.length<2)return e.nextTick(function(){i(new TypeError("Could not frame, too few arguments."))});function o(r){var o,a=r.document;a?(o=a["@context"],r.contextUrl?(o?Q(o)?o.push(r.contextUrl):o=[o,r.contextUrl]:o=r.contextUrl,a["@context"]=o):o=o||{}):o={},e.expand(t,n,function(t,r){if(t)return i(new P("Could not expand input before framing.","jsonld.FrameError",{cause:t}));var s=fe(n);s.isFrame=!0,s.keepFreeFloatingNodes=!0,e.expand(a,s,function(t,n){if(t)return i(new P("Could not expand frame before framing.","jsonld.FrameError",{cause:t}));var a;try{a=(new T).frame(r,n,s)}catch(e){return i(e)}s.graph=!0,s.skipExpansion=!0,s.link={},e.compact(a,o,s,function(t,r,n){if(t)return i(new P("Could not compact framed output.","jsonld.FrameError",{cause:t}));var o=G(n,"@graph");s.link={},r[o]=function t(r,n,i){if(Q(n)){for(var o=[],a=0;a<n.length;++a){var s=t(r,n[a],i);null!==s&&o.push(s)}n=o}else if(X(n)){if("@preserve"in n)return"@null"===n["@preserve"]?null:n["@preserve"];if(ae(n))return n;if(se(n))return n["@list"]=t(r,n["@list"],i),n;var u=G(r,"@id");if(u in n){var c=n[u];if(c in i.link){var f=i.link[c].indexOf(n);if(-1!==f)return i.link[c][f];i.link[c].push(n)}else i.link[c]=[n]}for(var l in n){var s=t(r,n[l],i),h=e.getContextValue(r,l,"@container");i.compactArrays&&Q(s)&&1===s.length&&null===h&&(s=s[0]),n[l]=s}}return n}(n,r[o],s),i(null,r)})})})}"function"==typeof n&&(i=n,n={}),"base"in(n=n||{})||(n.base="string"==typeof t?t:""),"documentLoader"in n||(n.documentLoader=e.loadDocument),"embed"in n||(n.embed="@last"),n.explicit=n.explicit||!1,"requireAll"in n||(n.requireAll=!0),n.omitDefault=n.omitDefault||!1,e.nextTick(function(){if("string"!=typeof r)o({contextUrl:null,documentUrl:null,document:r});else{var e=function(e,t){if(e)return i(e);try{if(!t.document)throw new P("No remote document found at the given URL.","jsonld.NullRemoteDocument");"string"==typeof t.document&&(t.document=JSON.parse(t.document))}catch(e){return i(new P("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",cause:e,remoteDoc:t}))}o(t)},t=n.documentLoader(r,e);t&&"then"in t&&t.then(e.bind(null,null),e)}})},e.link=function(t,r,n,i){var o={};r&&(o["@context"]=r),o["@embed"]="@link",e.frame(t,o,n,i)},e.objectify=function(t,r,n,i){"function"==typeof n&&(i=n,n={}),"base"in(n=n||{})||(n.base="string"==typeof t?t:""),"documentLoader"in n||(n.documentLoader=e.loadDocument),e.expand(t,n,function(t,o){if(t)return i(new P("Could not expand input before linking.","jsonld.LinkError",{cause:t}));var a;try{a=(new T).flatten(o)}catch(e){return i(e)}n.graph=!0,n.skipExpansion=!0,e.compact(a,r,n,function(t,r,n){if(t)return i(new P("Could not compact flattened output before linking.","jsonld.LinkError",{cause:t}));var o=r[G(n,"@graph")][0],a=function(t){if(X(t)||Q(t)){if(X(t)){if(a.visited[t["@id"]])return;a.visited[t["@id"]]=!0}for(var r in t){var i=t[r],s="@id"===e.getContextValue(n,r,"@type");if(Q(i)||X(i)||s)if(ee(i)&&s)t[r]=i=o[i],a(i);else if(Q(i))for(var u=0;u<i.length;++u)ee(i[u])&&s?i[u]=o[i[u]]:X(i[u])&&"@id"in i[u]&&(i[u]=o[i[u]["@id"]]),a(i[u]);else if(X(i)){var c=i["@id"];t[r]=i=o[c],a(i)}}}};for(var s in a.visited={},a(o),r.of_type={},o)if("@type"in o[s]){var u=o[s]["@type"];Q(u)||(u=[u]);for(var c=0;c<u.length;++c)u[c]in r.of_type||(r.of_type[u[c]]=[]),r.of_type[u[c]].push(o[s])}i(null,r)})})},e.normalize=function(t,r,n){if(arguments.length<1)return e.nextTick(function(){n(new TypeError("Could not normalize, too few arguments."))});if("function"==typeof r&&(n=r,r={}),"algorithm"in(r=r||{})||(r.algorithm="URGNA2012"),"base"in r||(r.base="string"==typeof t?t:""),"documentLoader"in r||(r.documentLoader=e.loadDocument),"inputFormat"in r){if("application/nquads"!==r.inputFormat)return n(new P("Unknown normalization input format.","jsonld.NormalizeError"));var i=pe(t);(new T).normalize(i,r,n)}else{var o=fe(r);delete o.format,o.produceGeneralizedRdf=!1,e.toRDF(t,o,function(e,t){if(e)return n(new P("Could not convert input to RDF dataset before normalization.","jsonld.NormalizeError",{cause:e}));(new T).normalize(t,r,n)})}},e.fromRDF=function(t,r,n){if(arguments.length<1)return e.nextTick(function(){n(new TypeError("Could not convert from RDF, too few arguments."))});"function"==typeof r&&(n=r,r={}),"useRdfType"in(r=r||{})||(r.useRdfType=!1),"useNativeTypes"in r||(r.useNativeTypes=!1),"format"in r||!ee(t)||"format"in r||(r.format="application/nquads"),e.nextTick(function(){var e;if(r.format){if(!(e=r.rdfParser||s[r.format]))return n(new P("Unknown input format.","jsonld.UnknownFormat",{format:r.format}))}else e=function(){return t};var i=!1;try{t=e(t,function(e,t){if(i=!0,e)return n(e);o(t,r,n)})}catch(e){if(!i)return n(e);throw e}if(t){if("then"in t)return t.then(function(e){o(e,r,n)},n);o(t,r,n)}function o(e,t,r){(new T).fromRDF(e,t,r)}})},e.toRDF=function(t,r,n){if(arguments.length<1)return e.nextTick(function(){n(new TypeError("Could not convert to RDF, too few arguments."))});"function"==typeof r&&(n=r,r={}),"base"in(r=r||{})||(r.base="string"==typeof t?t:""),"documentLoader"in r||(r.documentLoader=e.loadDocument),e.expand(t,r,function(e,t){if(e)return n(new P("Could not expand input before serialization to RDF.","jsonld.RdfError",{cause:e}));var i;try{if(i=T.prototype.toRDF(t,r),r.format){if("application/nquads"===r.format)return n(null,function(e){var t=[];for(var r in e)for(var n=e[r],i=0;i<n.length;++i){var o=n[i];"@default"===r&&(r=null),t.push(de(o,r))}return t.sort().join("")}(i));throw new P("Unknown output format.","jsonld.UnknownFormat",{format:r.format})}}catch(e){return n(e)}n(null,i)})},e.createNodeMap=function(t,r,n){if(arguments.length<1)return e.nextTick(function(){n(new TypeError("Could not create node map, too few arguments."))});"function"==typeof r&&(n=r,r={}),"base"in(r=r||{})||(r.base="string"==typeof t?t:""),"documentLoader"in r||(r.documentLoader=e.loadDocument),e.expand(t,r,function(e,t){if(e)return n(new P("Could not expand input before creating node map.","jsonld.CreateNodeMapError",{cause:e}));var i;try{i=(new T).createNodeMap(t,r)}catch(e){return n(e)}n(null,i)})},e.merge=function(t,r,n,i){if(arguments.length<1)return e.nextTick(function(){i(new TypeError("Could not merge, too few arguments."))});if(!Q(t))return e.nextTick(function(){i(new TypeError('Could not merge, "docs" must be an array.'))});"function"==typeof n?(i=n,n={}):"function"==typeof r&&(i=r,r=null,n={}),n=n||{};for(var o=[],a=null,s=t.length,u=0;u<t.length;++u){var c={};for(var f in n)c[f]=n[f];e.expand(t[u],c,l)}function l(t,u){if(!a){if(t)return a=t,i(new P("Could not expand input before flattening.","jsonld.FlattenError",{cause:t}));o.push(u),0==--s&&function(t){var o=!0;"mergeNodes"in n&&(o=n.mergeNodes);var a,s=n.namer||n.issuer||new ge("_:b"),u={"@default":{}};try{for(var c=0;c<t.length;++c){var f=t[c];f=e.relabelBlankNodes(f,{issuer:new ge("_:b"+c+"-")});var l=o||0===c?u:{"@default":{}};if(D(f,l,"@default",s),l!==u)for(var h in l){var p=l[h];if(h in u){var d=u[h];for(var g in p)g in d||(d[g]=p[g])}else u[h]=p}}a=L(u)}catch(e){return i(e)}for(var _=[],m=Object.keys(a).sort(),y=0;y<m.length;++y){var v=a[m[y]];oe(v)||_.push(v)}if(null===r)return i(null,_);n.graph=!0,n.skipExpansion=!0,e.compact(_,r,n,function(e,t){if(e)return i(new P("Could not compact merged output.","jsonld.MergeError",{cause:e}));i(null,t)})}(o)}}},e.relabelBlankNodes=function(e,t){return function e(t,r){if(Q(r))for(var n=0;n<r.length;++n)r[n]=e(t,r[n]);else if(se(r))r["@list"]=e(t,r["@list"]);else if(X(r)){ue(r)&&(r["@id"]=t.getId(r["@id"]));for(var i=Object.keys(r).sort(),o=0;o<i.length;++o){var a=i[o];"@id"!==a&&(r[a]=e(t,r[a]))}}return r}((t=t||{}).namer||t.issuer||new ge("_:b"),e)},e.prependBase=function(t,r){return function(t,r){if(null===t)return r;if(-1!==r.indexOf(":"))return r;ee(t)&&(t=e.url.parse(t||""));var n=e.url.parse(r),i={protocol:t.protocol||""};if(null!==n.authority)i.authority=n.authority,i.path=n.path,i.query=n.query;else if(i.authority=t.authority,""===n.path)i.path=t.path,null!==n.query?i.query=n.query:i.query=t.query;else{if(0===n.path.indexOf("/"))i.path=n.path;else{var o=t.path;""!==n.path&&((o=o.substr(0,o.lastIndexOf("/")+1)).length>0&&"/"!==o.substr(-1)&&(o+="/"),o+=n.path),i.path=o}i.query=n.query}i.path=ve(i.path,!!i.authority);var a=i.protocol;null!==i.authority&&(a+="//"+i.authority);a+=i.path,null!==i.query&&(a+="?"+i.query);null!==n.fragment&&(a+="#"+n.fragment);""===a&&(a="./");return a}(t,r)},e.documentLoader=function(r,n){var i=new P("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed"});return t?n(i,{contextUrl:null,documentUrl:r,document:null}):e.promisify(function(e){e(i)})},e.loadDocument=function(t,r){var n=e.documentLoader(t,r);n&&"then"in n&&n.then(r.bind(null,null),r)},e.promises=function(t){t=t||{};var r=Array.prototype.slice,n=e.promisify,i=t.api||{},o=t.version||"jsonld.js";"string"==typeof t.api&&(t.version||(o=t.api),i={}),i.expand=function(t){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");return n.apply(null,[e.expand].concat(r.call(arguments)))},i.compact=function(t,i){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");return n.apply(null,[function(t,r,n,i){"function"==typeof n&&(i=n,n={}),n=n||{},e.compact(t,r,n,function(e,t){i(e,t)})}].concat(r.call(arguments)))},i.flatten=function(t){if(arguments.length<1)throw new TypeError("Could not flatten, too few arguments.");return n.apply(null,[e.flatten].concat(r.call(arguments)))},i.frame=function(t,i){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");return n.apply(null,[e.frame].concat(r.call(arguments)))},i.fromRDF=function(t){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");return n.apply(null,[e.fromRDF].concat(r.call(arguments)))},i.toRDF=function(t){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");return n.apply(null,[e.toRDF].concat(r.call(arguments)))},i.normalize=function(t){if(arguments.length<1)throw new TypeError("Could not normalize, too few arguments.");return n.apply(null,[e.normalize].concat(r.call(arguments)))},"jsonld.js"===o&&(i.link=function(t,i){if(arguments.length<2)throw new TypeError("Could not link, too few arguments.");return n.apply(null,[e.link].concat(r.call(arguments)))},i.objectify=function(t){return n.apply(null,[e.objectify].concat(r.call(arguments)))},i.createNodeMap=function(t){return n.apply(null,[e.createNodeMap].concat(r.call(arguments)))},i.merge=function(t){return n.apply(null,[e.merge].concat(r.call(arguments)))});try{e.Promise=commonjsGlobal.Promise||es6Promise.Promise}catch(e){var a=function(){throw new Error("Unable to find a Promise implementation.")};for(var s in i)i[s]=a}return i},e.promisify=function(t){if(!e.Promise)try{e.Promise=commonjsGlobal.Promise||es6Promise.Promise}catch(e){throw new Error("Unable to find a Promise implementation.")}var r=Array.prototype.slice.call(arguments,1);return new e.Promise(function(e,n){t.apply(null,r.concat(function(t,r){t?n(t):e(r)}))})},e.promises({api:e.promises}),n.prototype=e.promises({version:"json-ld-1.0"}),n.prototype.toString=function(){return this instanceof n?"[object JsonLdProcessor]":"[object JsonLdProcessorPrototype]"},e.JsonLdProcessor=n;var i=!!Object.defineProperty;if(i)try{Object.defineProperty({},"x",{})}catch(e){i=!1}i&&(Object.defineProperty(n,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(n.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:n})),r&&void 0===commonjsGlobal.JsonLdProcessor&&(i?Object.defineProperty(commonjsGlobal,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:n}):commonjsGlobal.JsonLdProcessor=n);var o="function"==typeof setImmediate&&setImmediate,a=o?function(e){o(e)}:function(e){setTimeout(e,0)};e.nextTick="object"==typeof process$4&&"function"==typeof nextTick?nextTick:a,e.setImmediate=o?a:e.nextTick,e.parseLinkHeader=function(e){for(var t={},r=e.match(/(?:<[^>]*?>|"[^"]*?"|[^,])+/g),n=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,i=0;i<r.length;++i){var o=r[i].match(n);if(o){for(var a={target:o[1]},s=o[2],u=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g;o=u.exec(s);)a[o[1]]=void 0===o[2]?o[3]:o[2];var c=a.rel||"";Q(t[c])?t[c].push(a):t[c]=c in t?[t[c],a]:a}}return t},e.RequestQueue=function(){this._requests={}},e.RequestQueue.prototype.wrapLoader=function(e){return this._loader=e,this._usePromise=1===e.length,this.add.bind(this)},e.RequestQueue.prototype.add=function(t,r){var n=this;if(!r&&!n._usePromise)throw new Error("callback must be specified.");if(n._usePromise)return new e.Promise(function(e,r){var i=n._requests[t];i||(i=n._requests[t]=n._loader(t).then(function(e){return delete n._requests[t],e}).catch(function(e){throw delete n._requests[t],e})),i.then(function(t){e(t)}).catch(function(e){r(e)})});t in n._requests?n._requests[t].push(r):(n._requests[t]=[r],n._loader(t,function(e,r){var i=n._requests[t];delete n._requests[t];for(var o=0;o<i.length;++o)i[o](e,r)}))},e.DocumentCache=function(e){this.order=[],this.cache={},this.size=e||50,this.expires=3e4},e.DocumentCache.prototype.get=function(e){if(e in this.cache){var t=this.cache[e];if(t.expires>=+new Date)return t.ctx;delete this.cache[e],this.order.splice(this.order.indexOf(e),1)}return null},e.DocumentCache.prototype.set=function(e,t){this.order.length===this.size&&delete this.cache[this.order.shift()],this.order.push(e),this.cache[e]={ctx:t,expires:+new Date+this.expires}},e.ActiveContextCache=function(e){this.order=[],this.cache={},this.size=e||100},e.ActiveContextCache.prototype.get=function(e,t){var r=JSON.stringify(e),n=JSON.stringify(t),i=this.cache[r];return i&&n in i?i[n]:null},e.ActiveContextCache.prototype.set=function(e,t,r){if(this.order.length===this.size){var n=this.order.shift();delete this.cache[n.activeCtx][n.localCtx]}var i=JSON.stringify(e),o=JSON.stringify(t);this.order.push({activeCtx:i,localCtx:o}),i in this.cache||(this.cache[i]={}),this.cache[i][o]=fe(r)},e.cache={activeCtx:new e.ActiveContextCache},e.documentLoaders={},e.documentLoaders.jquery=function(t,r){r=r||{};var n=new e.RequestQueue;return("usePromise"in r?r.usePromise:"undefined"!=typeof Promise)?n.wrapLoader(function(t){return e.promisify(i,t)}):n.wrapLoader(i);function i(n,i){return 0!==n.indexOf("http:")&&0!==n.indexOf("https:")?i(new P('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:n}),{contextUrl:null,documentUrl:n,document:null}):r.secure&&0!==n.indexOf("https")?i(new P('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:n}),{contextUrl:null,documentUrl:n,document:null}):void t.ajax({url:n,accepts:{json:"application/ld+json, application/json"},headers:{Accept:"application/ld+json, application/json"},dataType:"json",crossDomain:!0,success:function(t,r,o){var a={contextUrl:null,documentUrl:n,document:t},s=o.getResponseHeader("Content-Type"),u=o.getResponseHeader("Link");if(u&&"application/ld+json"!==s){if(Q(u=e.parseLinkHeader(u)[O]))return i(new P("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:n}),a);u&&(a.contextUrl=u.target)}i(null,a)},error:function(e,t,r){i(new P("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:n,cause:r}),{contextUrl:null,documentUrl:n,document:null})}})}},e.documentLoaders.node=function(t){var r=!("strictSSL"in(t=t||{}))||t.strictSSL,n="maxRedirects"in t?t.maxRedirects:-1,i="request"in t?t.request:ignore,o="application/ld+json, application/json",a=ignore,s=new e.RequestQueue;if(t.usePromise)return s.wrapLoader(function(t){return e.promisify(c,t,[])});var u=t.headers||{};if("Accept"in u||"accept"in u)throw new RangeError('Accept header may not be specified as an option; only "'+o+'" is supported.');return s.wrapLoader(function(e,t){c(e,[],t)});function c(s,u,f){if(0!==s.indexOf("http:")&&0!==s.indexOf("https:"))return f(new P('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:s}),{contextUrl:null,documentUrl:s,document:null});if(t.secure&&0!==s.indexOf("https"))return f(new P('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:s}),{contextUrl:null,documentUrl:s,document:null});var l=null;if(null!==l)return f(null,l);var h={Accept:o};for(var p in t.headers)h[p]=t.headers[p];i({url:s,headers:h,strictSSL:r,followRedirect:!1},function(t,r,i){if(l={contextUrl:null,documentUrl:s,document:i||null},t)return f(new P("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:s,cause:t}),l);var o=a.STATUS_CODES[r.statusCode];if(r.statusCode>=400)return f(new P("URL could not be dereferenced: "+o,"jsonld.InvalidUrl",{code:"loading document failed",url:s,httpStatusCode:r.statusCode}),l);if(r.headers.link&&"application/ld+json"!==r.headers["content-type"]){var h=e.parseLinkHeader(r.headers.link)[O];if(Q(h))return f(new P("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:s}),l);h&&(l.contextUrl=h.target)}if(r.statusCode>=300&&r.statusCode<400&&r.headers.location)return u.length===n?f(new P("URL could not be dereferenced; there were too many redirects.","jsonld.TooManyRedirects",{code:"loading document failed",url:s,httpStatusCode:r.statusCode,redirects:u}),l):-1!==u.indexOf(s)?f(new P("URL could not be dereferenced; infinite redirection was detected.","jsonld.InfiniteRedirectDetected",{code:"recursive context inclusion",url:s,httpStatusCode:r.statusCode,redirects:u}),l):(u.push(s),c(r.headers.location,u,f));u.push(s),f(t,l)})}},e.documentLoaders.xhr=function(t){t=t||{};var r=/(^|(\r\n))link:/i,n=new e.RequestQueue;return("usePromise"in t?t.usePromise:"undefined"!=typeof Promise)?n.wrapLoader(function(t){return e.promisify(i,t)}):n.wrapLoader(i);function i(n,i){if(0!==n.indexOf("http:")&&0!==n.indexOf("https:"))return i(new P('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:n}),{contextUrl:null,documentUrl:n,document:null});if(t.secure&&0!==n.indexOf("https"))return i(new P('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:n}),{contextUrl:null,documentUrl:n,document:null});var o=new(t.xhr||XMLHttpRequest);o.onload=function(){if(o.status>=400)return i(new P("URL could not be dereferenced: "+o.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:n,httpStatusCode:o.status}),{contextUrl:null,documentUrl:n,document:null});var t,a={contextUrl:null,documentUrl:n,document:o.response},s=o.getResponseHeader("Content-Type");if(r.test(o.getAllResponseHeaders())&&(t=o.getResponseHeader("Link")),t&&"application/ld+json"!==s){if(Q(t=e.parseLinkHeader(t)[O]))return i(new P("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:n}),a);t&&(a.contextUrl=t.target)}i(null,a)},o.onerror=function(){i(new P("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:n}),{contextUrl:null,documentUrl:n,document:null})},o.open("GET",n,!0),o.setRequestHeader("Accept","application/ld+json, application/json"),o.send()}},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new P('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.processContext=function(t,r){var n={},i=2;arguments.length>3&&(n=arguments[2]||{},i+=1);var o=arguments[i];if("base"in n||(n.base=""),"documentLoader"in n||(n.documentLoader=e.loadDocument),null===r)return o(null,Y(n));X(r=fe(r))&&"@context"in r||(r={"@context":r}),he(r,n,function(e,r){if(e)return o(e);try{r=(new T).processContext(t,r,n)}catch(e){return o(e)}o(null,r)})},e.hasProperty=function(e,t){var r=!1;if(t in e){var n=e[t];r=!Q(n)||n.length>0}return r},e.hasValue=function(t,r,n){var i=!1;if(e.hasProperty(t,r)){var o=t[r],a=se(o);if(Q(o)||a){a&&(o=o["@list"]);for(var s=0;s<o.length;++s)if(e.compareValues(n,o[s])){i=!0;break}}else Q(n)||(i=e.compareValues(n,o))}return i},e.addValue=function(t,r,n,i){if("propertyIsArray"in(i=i||{})||(i.propertyIsArray=!1),"allowDuplicate"in i||(i.allowDuplicate=!0),Q(n)){0!==n.length||!i.propertyIsArray||r in t||(t[r]=[]);for(var o=0;o<n.length;++o)e.addValue(t,r,n[o],i)}else if(r in t){var a=!i.allowDuplicate&&e.hasValue(t,r,n);Q(t[r])||a&&!i.propertyIsArray||(t[r]=[t[r]]),a||t[r].push(n)}else t[r]=i.propertyIsArray?[n]:n},e.getValues=function(e,t){var r=e[t]||[];return Q(r)||(r=[r]),r},e.removeProperty=function(e,t){delete e[t]},e.removeValue=function(t,r,n,i){"propertyIsArray"in(i=i||{})||(i.propertyIsArray=!1);var o=e.getValues(t,r).filter(function(t){return!e.compareValues(t,n)});0===o.length?e.removeProperty(t,r):1!==o.length||i.propertyIsArray?t[r]=o:t[r]=o[0]},e.compareValues=function(e,t){return e===t||(!(!ae(e)||!ae(t)||e["@value"]!==t["@value"]||e["@type"]!==t["@type"]||e["@language"]!==t["@language"]||e["@index"]!==t["@index"])||!!(X(e)&&"@id"in e&&X(t)&&"@id"in t)&&e["@id"]===t["@id"])},e.getContextValue=function(e,t,r){var n=null;if(null===t)return n;if("@language"===r&&r in e&&(n=e[r]),e.mappings[t]){var i=e.mappings[t];ne(r)?n=i:r in i&&(n=i[r])}return n};var s={};if(e.registerRDFParser=function(e,t){s[e]=t},e.unregisterRDFParser=function(e){delete s[e]},t){if(void 0===u)var u=null;if(void 0===c)var c={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12}}var f="http://www.w3.org/2001/XMLSchema#boolean",l="http://www.w3.org/2001/XMLSchema#double",h="http://www.w3.org/2001/XMLSchema#integer",p="http://www.w3.org/2001/XMLSchema#string",d="http://www.w3.org/1999/02/22-rdf-syntax-ns#",g=d+"first",_=d+"rest",m=d+"nil",y=d+"type",v=d+"PlainLiteral",b=d+"XMLLiteral",w=d+"object",E=d+"langString",O="http://www.w3.org/ns/json-ld#context",S=10,P=function(e,r,n){t?(Error.call(this),Error.captureStackTrace(this,this.constructor)):"undefined"!=typeof Error&&(this.stack=(new Error).stack),this.name=r||"jsonld.Error",this.message=e||"An unspecified JSON-LD error occurred.",this.details=n||{}};t?ignore.inherits(P,Error):"undefined"!=typeof Error&&(P.prototype=new Error);var T=function(){};function x(e){for(var t=[],r=Object.keys(e).sort(),n=0;n<r.length;++n){var i=r[n],o=e[i];Q(o)||(o=[o]);for(var a=0;a<o.length;++a){var s=o[a];if(null!==s){if(!ee(s))throw new P("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:e});t.push({"@value":s,"@language":i.toLowerCase()})}}}return t}function I(e,t,r){for(var n=[],i=Object.keys(e).sort(),o=0;o<i.length;++o)for(var a=i[o],s=e[a],u=Object.keys(s).sort(),c=0;c<u.length;++c){var f=u[c],l=s[f];if("@type"===f)f=y;else if(J(f))continue;for(var h=0;h<l.length;++h){var p=l[h],d={};if(d.type=0===a.indexOf("_:")?"blank node":"IRI",d.value=a,ce(a)){var g={};if(g.type=0===f.indexOf("_:")?"blank node":"IRI",g.value=f,ce(f)&&("blank node"!==g.type||r.produceGeneralizedRdf))if(se(p))R(p["@list"],t,d,g,n);else{var _=C(p);_&&n.push({subject:d,predicate:g,object:_})}}}}return n}function R(e,t,r,n,i){for(var o={type:"IRI",value:g},a={type:"IRI",value:_},s={type:"IRI",value:m},u=0;u<e.length;++u){var c=e[u],f={type:"blank node",value:t.getId()};i.push({subject:r,predicate:n,object:f}),r=f,n=o;var l=C(c);l&&i.push({subject:r,predicate:n,object:l}),n=a}i.push({subject:r,predicate:n,object:s})}function C(e){var t,r={};if(ae(e)){r.type="literal";var n=e["@value"],i=e["@type"]||null;"boolean"==typeof(t=n)||"[object Boolean]"===Object.prototype.toString.call(t)?(r.value=n.toString(),r.datatype=i||f):re(n)||i===l?(re(n)||(n=parseFloat(n)),r.value=n.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),r.datatype=i||l):te(n)?(r.value=n.toFixed(0),r.datatype=i||h):"@language"in e?(r.value=n,r.datatype=i||E,r.language=e["@language"]):(r.value=n,r.datatype=i||p)}else{var o=X(e)?e["@id"]:e;r.type=0===o.indexOf("_:")?"blank node":"IRI",r.value=o}return"IRI"!==r.type||ce(r.value)?r:null}function A(e,t){if("IRI"===e.type||"blank node"===e.type)return{"@id":e.value};var r,n={"@value":e.value};if(e.language)n["@language"]=e.language;else{var i=e.datatype;if(i||(i=p),t){if(i===f)"true"===n["@value"]?n["@value"]=!0:"false"===n["@value"]&&(n["@value"]=!1);else if(r=n["@value"],!isNaN(parseFloat(r))&&isFinite(r))if(i===h){var o=parseInt(n["@value"],10);o.toFixed(0)===n["@value"]&&(n["@value"]=o)}else i===l&&(n["@value"]=parseFloat(n["@value"]));-1===[f,h,l,p].indexOf(i)&&(n["@type"]=i)}else i!==p&&(n["@type"]=i)}return n}function $(e,t){for(var r=["subject","predicate","object"],n=0;n<r.length;++n){var i=r[n];if(e[i].type!==t[i].type||e[i].value!==t[i].value)return!1}return e.object.language===t.object.language&&e.object.datatype===t.object.datatype}T.prototype.compact=function(t,r,n,i){if(Q(n)){for(var o=[],a=0;a<n.length;++a){var s=this.compact(t,r,n[a],i);null!==s&&o.push(s)}if(i.compactArrays&&1===o.length)null===(E=e.getContextValue(t,r,"@container"))&&(o=o[0]);return o}if(X(n)){if(i.link&&"@id"in n&&n["@id"]in i.link){var u=i.link[n["@id"]];for(a=0;a<u.length;++a)if(u[a].expanded===n)return u[a].compacted}if(ae(n)||oe(n)){o=function(t,r,n){if(ae(n)){var i=e.getContextValue(t,r,"@type"),o=e.getContextValue(t,r,"@language"),a=e.getContextValue(t,r,"@container"),s="@index"in n&&"@index"!==a;if(!s&&(n["@type"]===i||n["@language"]===o))return n["@value"];var u=Object.keys(n).length,c=1===u||2===u&&"@index"in n&&!s,f="@language"in t,l=ee(n["@value"]),h=t.mappings[r]&&null===t.mappings[r]["@language"];if(c&&(!f||!l||h))return n["@value"];var p={};return s&&(p[G(t,"@index")]=n["@index"]),"@type"in n?p[G(t,"@type")]=G(t,n["@type"],null,{vocab:!0}):"@language"in n&&(p[G(t,"@language")]=n["@language"]),p[G(t,"@value")]=n["@value"],p}var d=z(t,r,{vocab:!0}),i=e.getContextValue(t,r,"@type"),g=G(t,n["@id"],null,{vocab:"@vocab"===i});if("@id"===i||"@vocab"===i||"@graph"===d)return g;return(p={})[G(t,"@id")]=g,p}(t,r,n);return i.link&&oe(n)&&(n["@id"]in i.link||(i.link[n["@id"]]=[]),i.link[n["@id"]].push({expanded:n,compacted:o})),o}var c="@reverse"===r;o={};i.link&&"@id"in n&&(n["@id"]in i.link||(i.link[n["@id"]]=[]),i.link[n["@id"]].push({expanded:n,compacted:o}));for(var f=Object.keys(n).sort(),l=0;l<f.length;++l){var h=f[l],p=n[h];if("@id"!==h&&"@type"!==h)if("@reverse"!==h)if("@index"!==h)if("@graph"!==h&&"@list"!==h&&J(h)){T=G(t,h);e.addValue(o,T,p)}else{if(0===p.length){var d=G(t,h,p,{vocab:!0},c);e.addValue(o,d,p,{propertyIsArray:!0})}for(I=0;I<p.length;++I){var g=p[I],_=(d=G(t,h,g,{vocab:!0},c),E=e.getContextValue(t,d,"@container"),se(g)),m=null;_&&(m=g["@list"]);var y=this.compact(t,d,_?m:g,i);if(_)if(Q(y)||(y=[y]),"@list"!==E){var v={};v[G(t,"@list")]=y,y=v,"@index"in g&&(y[G(t,"@index")]=g["@index"])}else if(d in o)throw new P('JSON-LD compact error; property has a "@list" @container rule but there is more than a single @list that matches the compacted term in the document. Compaction might mix unwanted items into the list.',"jsonld.SyntaxError",{code:"compaction to list of lists"});if("@language"===E||"@index"===E){var b;d in o?b=o[d]:o[d]=b={},"@language"===E&&ae(y)&&(y=y["@value"]),e.addValue(b,g[E],y)}else{R=!i.compactArrays||"@set"===E||"@list"===E||Q(y)&&0===y.length||"@list"===h||"@graph"===h;e.addValue(o,d,y,{propertyIsArray:R})}}}else{if("@index"===(E=e.getContextValue(t,r,"@container")))continue;T=G(t,h);e.addValue(o,T,p)}else{x=this.compact(t,"@reverse",p,i);for(var w in x)if(t.mappings[w]&&t.mappings[w].reverse){var E,O=x[w],S="@set"===(E=e.getContextValue(t,w,"@container"))||!i.compactArrays;e.addValue(o,w,O,{propertyIsArray:S}),delete x[w]}if(Object.keys(x).length>0){var T=G(t,h);e.addValue(o,T,x)}}else{var x;if(ee(p))x=G(t,p,null,{vocab:"@type"===h});else{x=[];for(var I=0;I<p.length;++I)x.push(G(t,p[I],null,{vocab:!0}))}var T=G(t,h),R=Q(x)&&0===p.length;e.addValue(o,T,x,{propertyIsArray:R})}}return o}return n},T.prototype.expand=function(t,r,n,i,o){var a=this;if(null==n)return null;if(!Q(n)&&!X(n))return o||null!==r&&"@graph"!==z(t,r,{vocab:!0})?function(t,r,n){if(null==n)return null;var i=z(t,r,{vocab:!0});if("@id"===i)return z(t,n,{base:!0});if("@type"===i)return z(t,n,{vocab:!0,base:!0});var o=e.getContextValue(t,r,"@type");if("@id"===o||"@graph"===i&&ee(n))return{"@id":z(t,n,{base:!0})};if("@vocab"===o)return{"@id":z(t,n,{vocab:!0,base:!0})};if(J(i))return n;var a={};if(null!==o)a["@type"]=o;else if(ee(n)){var s=e.getContextValue(t,r,"@language");null!==s&&(a["@language"]=s)}-1===["boolean","number","string"].indexOf(typeof n)&&(n=n.toString());return a["@value"]=n,a}(t,r,n):null;if(Q(n)){var s=[],u=e.getContextValue(t,r,"@container");o=o||"@list"===u;for(var c=0;c<n.length;++c){var f=a.expand(t,r,n[c],i);if(o&&(Q(f)||se(f)))throw new P("Invalid JSON-LD syntax; lists of lists are not permitted.","jsonld.SyntaxError",{code:"list of lists"});null!==f&&(Q(f)?s=s.concat(f):s.push(f))}return s}"@context"in n&&(t=a.processContext(t,n["@context"],i));for(var l=z(t,r,{vocab:!0}),h=(s={},Object.keys(n).sort()),p=0;p<h.length;++p){var d,g=h[p],_=n[g];if("@context"!==g){var m=z(t,g,{vocab:!0});if(null!==m&&(ce(m)||J(m))){if(J(m)){if("@reverse"===l)throw new P("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:_});if(m in s)throw new P("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:m})}if("@id"===m&&!ee(_)){if(!i.isFrame)throw new P('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:_});if(!X(_))throw new P('Invalid JSON-LD syntax; "@id" value must be a string or an object.',"jsonld.SyntaxError",{code:"invalid @id value",value:_})}if("@type"===m&&Z(_),"@graph"===m&&!X(_)&&!Q(_))throw new P('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:_});if("@value"===m&&(X(_)||Q(_)))throw new P('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:_});if("@language"===m){if(null===_)continue;if(!ee(_))throw new P('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:_});_=_.toLowerCase()}if("@index"===m&&!ee(_))throw new P('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:_});if("@reverse"!==m){if("@language"===(u=e.getContextValue(t,g,"@container"))&&X(_))d=x(_);else if("@index"===u&&X(_))d=function(e){for(var r=[],n=Object.keys(_).sort(),o=0;o<n.length;++o){var s=n[o],u=_[s];Q(u)||(u=[u]),u=a.expand(t,e,u,i,!1);for(var c=0;c<u.length;++c){var f=u[c];"@index"in f||(f["@index"]=s),r.push(f)}}return r}(g);else{var y="@list"===m;if(y||"@set"===m){var v=r;if(y&&"@graph"===l&&(v=null),d=a.expand(t,v,_,i,y),y&&se(d))throw new P("Invalid JSON-LD syntax; lists of lists are not permitted.","jsonld.SyntaxError",{code:"list of lists"})}else d=a.expand(t,g,_,i,!1)}if(null!==d||"@value"===m)if("@list"===m||se(d)||"@list"!==u||(d={"@list":d=Q(d)?d:[d]}),t.mappings[g]&&t.mappings[g].reverse){E=s["@reverse"]=s["@reverse"]||{};Q(d)||(d=[d]);for(S=0;S<d.length;++S){if(ae(T=d[S])||se(T))throw new P('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:d});e.addValue(E,m,T,{propertyIsArray:!0})}}else{var b=-1===["@index","@id","@type","@value","@language"].indexOf(m);e.addValue(s,m,d,{propertyIsArray:b})}}else{if(!X(_))throw new P('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:_});if("@reverse"in(d=a.expand(t,"@reverse",_,i)))for(var w in d["@reverse"])e.addValue(s,w,d["@reverse"][w],{propertyIsArray:!0});var E=s["@reverse"]||null;for(var w in d)if("@reverse"!==w){null===E&&(E=s["@reverse"]={}),e.addValue(E,w,[],{propertyIsArray:!0});for(var O=d[w],S=0;S<O.length;++S){var T;if(ae(T=O[S])||se(T))throw new P('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:d});e.addValue(E,w,T,{propertyIsArray:!0})}}}}}}var I=(h=Object.keys(s)).length;if("@value"in s){if("@type"in s&&"@language"in s)throw new P('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and "@language".',"jsonld.SyntaxError",{code:"invalid value object",element:s});var R=I-1;if("@type"in s&&(R-=1),"@index"in s&&(R-=1),"@language"in s&&(R-=1),0!==R)throw new P('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and at most one other property which can be "@type" or "@language".',"jsonld.SyntaxError",{code:"invalid value object",element:s});if(null===s["@value"])s=null;else{if("@language"in s&&!ee(s["@value"]))throw new P("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:s});if("@type"in s&&(!ce(s["@type"])||0===s["@type"].indexOf("_:")))throw new P('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:s})}}else if("@type"in s&&!Q(s["@type"]))s["@type"]=[s["@type"]];else if("@set"in s||"@list"in s){if(I>1&&!(2===I&&"@index"in s))throw new P('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:s});"@set"in s&&(s=s["@set"],I=(h=Object.keys(s)).length)}else 1===I&&"@language"in s&&(s=null);return!X(s)||i.keepFreeFloatingNodes||o||null!==r&&"@graph"!==l||(0===I||"@value"in s||"@list"in s||1===I&&"@id"in s)&&(s=null),s},T.prototype.createNodeMap=function(e,t){var r={"@default":{}};return D(e,r,"@default",(t=t||{}).namer||t.issuer||new ge("_:b")),L(r)},T.prototype.flatten=function(e){for(var t=this.createNodeMap(e),r=[],n=Object.keys(t).sort(),i=0;i<n.length;++i){var o=t[n[i]];oe(o)||r.push(o)}return r},T.prototype.frame=function(e,t,r){var n={options:r,graphs:{"@default":{},"@merged":{}},subjectStack:[],link:{}},i=new ge("_:b");D(e,n.graphs,"@merged",i),n.subjects=n.graphs["@merged"];var o=[];return function e(t,r,n,i,o){!function(e){if(!Q(e)||1!==e.length||!X(e[0]))throw new P("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e})}(n);n=n[0];var a=t.options;var s={embed:F(n,a,"embed"),explicit:F(n,a,"explicit"),requireAll:F(n,a,"requireAll")};var u=function(e,t,r,n){for(var i={},o=0;o<t.length;++o){var a=t[o],s=e.subjects[a];H(s,r,n)&&(i[a]=s)}return i}(t,r,n,s);var c=Object.keys(u).sort();for(var f=0;f<c.length;++f){var l=c[f],h=u[l];if("@link"===s.embed&&l in t.link)q(i,o,t.link[l]);else{null===o&&(t.uniqueEmbeds={});var p={};if(p["@id"]=l,t.link[l]=p,"@never"===s.embed||U(h,t.subjectStack))q(i,o,p);else{"@last"===s.embed&&(l in t.uniqueEmbeds&&V(t,l),t.uniqueEmbeds[l]={parent:i,property:o}),t.subjectStack.push(h);for(var d=Object.keys(h).sort(),g=0;g<d.length;g++){var _=d[g];if(J(_))p[_]=fe(h[_]);else if(!s.explicit||_ in n)for(var m=h[_],y=0;y<m.length;++y){var v=m[y];if(se(v)){var b={"@list":[]};q(p,_,b);var w=v["@list"];for(var E in w)if(oe(v=w[E])){var O=_ in n?n[_][0]["@list"]:M(s);e(t,[v["@id"]],O,b,"@list")}else q(b,"@list",fe(v))}else if(oe(v)){var O=_ in n?n[_]:M(s);e(t,[v["@id"]],O,p,_)}else q(p,_,fe(v))}}for(var d=Object.keys(n).sort(),g=0;g<d.length;++g){var _=d[g];if(!J(_)){var S=n[_][0],T=F(S,a,"omitDefault");if(!(T||_ in p)){var x="@null";"@default"in S&&(x=fe(S["@default"])),Q(x)||(x=[x]),p[_]=[{"@preserve":x}]}}}q(i,o,p),t.subjectStack.pop()}}}}(n,Object.keys(n.subjects).sort(),t,o,null),o},T.prototype.normalize=function(e,t,r){return"URDNA2015"===t.algorithm?new B(t).main(e,r):"URGNA2012"===t.algorithm?new j(t).main(e,r):void r(new Error("Invalid RDF Dataset Normalization algorithm: "+t.algorithm))},T.prototype.fromRDF=function(t,r,n){var i={},o={"@default":i},a={};for(var s in t){var u=t[s];s in o||(o[s]={}),"@default"===s||s in i||(i[s]={"@id":s});for(var c=o[s],f=0;f<u.length;++f){var l=u[f],h=l.subject.value,p=l.predicate.value,d=l.object;h in c||(c[h]={"@id":h});var v=c[h],b="IRI"===d.type||"blank node"===d.type;if(!b||d.value in c||(c[d.value]={"@id":d.value}),p!==y||r.useRdfType||!b){var w=A(d,r.useNativeTypes);if(e.addValue(v,p,w,{propertyIsArray:!0}),b)if(d.value===m){var E=c[d.value];"usages"in E||(E.usages=[]),E.usages.push({node:v,property:p,value:w})}else d.value in a?a[d.value]=!1:a[d.value]={node:v,property:p,value:w}}else e.addValue(v,"@type",d.value,{propertyIsArray:!0})}}for(var s in o){var O=o[s];if(m in O){for(var S=O[m],P=0;P<S.usages.length;++P){for(var T=S.usages[P],x=(v=T.node,T.property),I=T.value,R=[],C=[],$=Object.keys(v).length;x===_&&X(a[v["@id"]])&&Q(v[g])&&1===v[g].length&&Q(v[_])&&1===v[_].length&&(3===$||4===$&&Q(v["@type"])&&1===v["@type"].length&&"http://www.w3.org/1999/02/22-rdf-syntax-ns#List"===v["@type"][0])&&(R.push(v[g][0]),C.push(v["@id"]),v=(T=a[v["@id"]]).node,x=T.property,I=T.value,$=Object.keys(v).length,0===v["@id"].indexOf("_:")););if(x===g){if(v["@id"]===m)continue;I=O[I["@id"]][_][0],R.pop(),C.pop()}delete I["@id"],I["@list"]=R.reverse();for(var k=0;k<C.length;++k)delete O[C[k]]}delete S.usages}}var N=[],B=Object.keys(i).sort();for(P=0;P<B.length;++P){var j=B[P];v=i[j];if(j in o){u=v["@graph"]=[],O=o[j];for(var D=Object.keys(O).sort(),L=0;L<D.length;++L){var M=O[D[L]];oe(M)||u.push(M)}}oe(v)||N.push(v)}n(null,N)},T.prototype.toRDF=function(e,t){var r=new ge("_:b"),n={"@default":{}};D(e,n,"@default",r);for(var i={},o=Object.keys(n).sort(),a=0;a<o.length;++a){var s=o[a];("@default"===s||ce(s))&&(i[s]=I(n[s],r,t))}return i},T.prototype.processContext=function(t,r,n){X(r)&&"@context"in r&&Q(r["@context"])&&(r=r["@context"]);var i=Q(r)?r:[r];if(0===i.length)return t.clone();for(var o=t,a=0;a<i.length;++a){var s=i[a];if(null!==s){if(X(s)&&"@context"in s&&(s=s["@context"]),!X(s))throw new P("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:s});if(e.cache.activeCtx){var u=e.cache.activeCtx.get(t,s);if(u){o=t=u;continue}}t=o,o=o.clone();var c={};if("@base"in s){var f=s["@base"];if(null===f)f=null;else{if(!ee(f))throw new P('Invalid JSON-LD syntax; the value of "@base" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:s});if(""!==f&&!ce(f))throw new P('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI or the empty string.',"jsonld.SyntaxError",{code:"invalid base IRI",context:s})}null!==f&&(f=e.url.parse(f||"")),o["@base"]=f,c["@base"]=!0}if("@vocab"in s){if(null===(l=s["@vocab"]))delete o["@vocab"];else{if(!ee(l))throw new P('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:s});if(!ce(l))throw new P('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:s});o["@vocab"]=l}c["@vocab"]=!0}if("@language"in s){var l;if(null===(l=s["@language"]))delete o["@language"];else{if(!ee(l))throw new P('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:s});o["@language"]=l.toLowerCase()}c["@language"]=!0}for(var h in s)W(o,s,h,c);e.cache.activeCtx&&e.cache.activeCtx.set(t,s,o)}else o=t=Y(n)}return o};var k,N,B=(k={subject:"s",object:"o",name:"g"},(N=function(e){e=e||{},this.name="URDNA2015",this.options=e,this.blankNodeInfo={},this.hashToBlankNodes={},this.canonicalIssuer=new ge("_:c14n"),this.quads=[],this.schedule={},this.schedule.MAX_DEPTH="maxCallStackDepth"in e?e.maxCallStackDepth:500,this.schedule.MAX_TOTAL_DEPTH="maxTotalCallStackDepth"in e?e.maxCallStackDepth:4294967295,this.schedule.depth=0,this.schedule.totalDepth=0,this.schedule.timeSlice="timeSlice"in e?e.timeSlice:10}).prototype.doWork=function(t,r){var n=this.schedule;if(n.totalDepth>=n.MAX_TOTAL_DEPTH)return r(new Error("Maximum total call stack depth exceeded; normalization aborting."));!function i(){if(n.depth===n.MAX_DEPTH)return n.depth=0,n.running=!1,e.nextTick(i);var o=(new Date).getTime();if(n.running||(n.start=(new Date).getTime(),n.deadline=n.start+n.timeSlice),o<n.deadline)return n.running=!0,n.depth++,n.totalDepth++,t(function(e,t){n.depth--,n.totalDepth--,r(e,t)});n.depth=0,n.running=!1,e.setImmediate(i)}()},N.prototype.forEach=function(e,t,r){var n,i,o=this,a=0;if(Q(e))i=e.length,n=function(){return a!==i&&(n.value=e[a++],n.key=a,!0)};else{var s=Object.keys(e);i=s.length,n=function(){return a!==i&&(n.key=s[a++],n.value=e[n.key],!0)}}!function e(i,a){return i?r(i):n()?o.doWork(function(){t(n.value,n.key,e)}):void r()}()},N.prototype.waterfall=function(e,t){var r=this;r.forEach(e,function(e,t,n){r.doWork(e,n)},t)},N.prototype.whilst=function(e,t,r){var n=this;!function i(o){return o?r(o):e()?void n.doWork(t,i):r()}()},N.prototype.main=function(e,t){var r,n=this;if(n.schedule.start=(new Date).getTime(),n.options.format&&"application/nquads"!==n.options.format)return t(new P("Unknown output format.","jsonld.UnknownFormat",{format:n.options.format}));var i={};n.waterfall([function(t){n.forEach(e,function(e,t,r){"@default"===t&&(t=null),n.forEach(e,function(e,r,o){null!==t&&(0===t.indexOf("_:")?e.name={type:"blank node",value:t}:e.name={type:"IRI",value:t}),n.quads.push(e),n.forEachComponent(e,function(t){if("blank node"===t.type){var r=t.value;r in n.blankNodeInfo?n.blankNodeInfo[r].quads.push(e):(i[r]=!0,n.blankNodeInfo[r]={quads:[e]})}}),o()},r)},t)},function(e){var t=!0;n.whilst(function(){return t},function(e){t=!1,n.hashToBlankNodes={},n.waterfall([function(e){n.forEach(i,function(e,t,r){n.hashFirstDegreeQuads(t,function(e,i){if(e)return r(e);i in n.hashToBlankNodes?n.hashToBlankNodes[i].push(t):n.hashToBlankNodes[i]=[t],r()})},e)},function(e){var r=Object.keys(n.hashToBlankNodes).sort();n.forEach(r,function(e,r,o){var a=n.hashToBlankNodes[e];if(a.length>1)return o();var s=a[0];n.canonicalIssuer.getId(s),delete i[s],delete n.hashToBlankNodes[e],t=!0,o()},e)}],e)},e)},function(e){var t=Object.keys(n.hashToBlankNodes).sort();n.forEach(t,function(e,t,r){var i=[],o=n.hashToBlankNodes[e];n.waterfall([function(e){n.forEach(o,function(e,t,r){if(n.canonicalIssuer.hasId(e))return r();var o=new ge("_:b");o.getId(e),n.hashNDegreeQuads(e,o,function(e,t){if(e)return r(e);i.push(t),r()})},e)},function(e){i.sort(function(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}),n.forEach(i,function(e,t,r){for(var i in e.issuer.existing)n.canonicalIssuer.getId(i);r()},e)}],r)},e)},function(e){var t=[];n.waterfall([function(e){n.forEach(n.quads,function(e,r,i){n.forEachComponent(e,function(e){"blank node"===e.type&&0!==e.value.indexOf(n.canonicalIssuer.prefix)&&(e.value=n.canonicalIssuer.getId(e.value))}),t.push(de(e)),i()},e)},function(e){if(t.sort(),"application/nquads"===n.options.format)return r=t.join(""),e();r=pe(t.join("")),e()}],e)}],function(e){t(e,r)})},N.prototype.hashFirstDegreeQuads=function(e,t){var r=this,n=r.blankNodeInfo[e];if("hash"in n)return t(null,n.hash);var i=[],o=n.quads;r.forEach(o,function(t,n,o){var a={predicate:t.predicate};r.forEachComponent(t,function(t,n){a[n]=r.modifyFirstDegreeComponent(e,t,n)}),i.push(de(a)),o()},function(e){if(e)return t(e);i.sort(),n.hash=me.hashNQuads(r.name,i),t(null,n.hash)})},N.prototype.modifyFirstDegreeComponent=function(e,t){return"blank node"!==t.type?t:((t=fe(t)).value=t.value===e?"_:a":"_:z",t)},N.prototype.hashRelatedBlankNode=function(e,t,r,n,i){var o,a=this;a.waterfall([function(t){return a.canonicalIssuer.hasId(e)?(o=a.canonicalIssuer.getId(e),t()):r.hasId(e)?(o=r.getId(e),t()):void a.hashFirstDegreeQuads(e,function(e,r){if(e)return t(e);o=r,t()})}],function(e){if(e)return i(e);var r=new me(a.name);return r.update(n),"g"!==n&&r.update(a.getRelatedPredicate(t)),r.update(o),i(null,r.digest())})},N.prototype.getRelatedPredicate=function(e){return"<"+e.predicate.value+">"},N.prototype.hashNDegreeQuads=function(e,t,r){var n,i=this,o=new me(i.name);i.waterfall([function(r){i.createHashToRelated(e,t,function(e,t){if(e)return r(e);n=t,r()})},function(e){var r=Object.keys(n).sort();i.forEach(r,function(e,r,a){o.update(e);var s,u="",c=new _e(n[e]);i.whilst(function(){return c.hasNext()},function(e){var r=c.next(),n=t.clone(),o="",a=[];i.waterfall([function(t){i.forEach(r,function(t,r,s){if(i.canonicalIssuer.hasId(t)?o+=i.canonicalIssuer.getId(t):(n.hasId(t)||a.push(t),o+=n.getId(t)),0!==u.length&&o.length>=u.length&&o>u)return e();s()},t)},function(t){i.forEach(a,function(t,r,a){i.hashNDegreeQuads(t,n,function(r,i){return r?a(r):(o+=n.getId(t),o+="<"+i.hash+">",n=i.issuer,0!==u.length&&o.length>=u.length&&o>u?e():void a())})},t)},function(e){(0===u.length||o<u)&&(u=o,s=n),e()}],e)},function(e){if(e)return a(e);o.update(u),t=s,a()})},e)}],function(e){r(e,{hash:o.digest(),issuer:t})})},N.prototype.createHashToRelated=function(e,t,r){var n=this,i={},o=n.blankNodeInfo[e].quads;n.forEach(o,function(r,o,a){n.forEach(r,function(o,a,s){if("predicate"===a||"blank node"!==o.type||o.value===e)return s();var u=o.value,c=k[a];n.hashRelatedBlankNode(u,r,t,c,function(e,t){if(e)return s(e);t in i?i[t].push(u):i[t]=[u],s()})},a)},function(e){r(e,i)})},N.prototype.forEachComponent=function(e,t){for(var r in e)"predicate"!==r&&t(e[r],r,e)},N),j=function(){var e=function(e){B.call(this,e),this.name="URGNA2012"};return(e.prototype=new B).modifyFirstDegreeComponent=function(e,t,r){return"blank node"!==t.type?t:((t=fe(t)).value="name"===r?"_:g":t.value===e?"_:a":"_:z",t)},e.prototype.getRelatedPredicate=function(e){return e.predicate.value},e.prototype.createHashToRelated=function(e,t,r){var n=this,i={},o=n.blankNodeInfo[e].quads;n.forEach(o,function(r,o,a){var s,u;if("blank node"===r.subject.type&&r.subject.value!==e)u=r.subject.value,s="p";else{if("blank node"!==r.object.type||r.object.value===e)return a();u=r.object.value,s="r"}n.hashRelatedBlankNode(u,r,t,s,function(e,t){t in i?i[t].push(u):i[t]=[u],a()})},function(e){r(e,i)})},e}();function D(t,r,n,i,o,a){if(Q(t))for(var s=0;s<t.length;++s)D(t[s],r,n,i,void 0,a);else if(X(t))if(ae(t)){"@type"in t&&0===(c=t["@type"]).indexOf("_:")&&(t["@type"]=c=i.getId(c)),a&&a.push(t)}else{if("@type"in t){var u=t["@type"];for(s=0;s<u.length;++s){var c;0===(c=u[s]).indexOf("_:")&&i.getId(c)}}ne(o)&&(o=ue(t)?i.getId(t["@id"]):t["@id"]),a&&a.push({"@id":o});var f=r[n],l=f[o]=f[o]||{};l["@id"]=o;for(var h=Object.keys(t).sort(),p=0;p<h.length;++p){var d=h[p];if("@id"!==d)if("@reverse"!==d)if("@graph"!==d)if("@type"!==d&&J(d)){if("@index"===d&&d in l&&(t[d]!==l[d]||t[d]["@id"]!==l[d]["@id"]))throw new P("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:l});l[d]=t[d]}else{var g=t[d];if(0===d.indexOf("_:")&&(d=i.getId(d)),0!==g.length)for(var _=0;_<g.length;++_){var m=g[_];if("@type"===d&&(m=0===m.indexOf("_:")?i.getId(m):m),ie(m)||oe(m)){var y=ue(m)?i.getId(m["@id"]):m["@id"];e.addValue(l,d,{"@id":y},{propertyIsArray:!0,allowDuplicate:!1}),D(m,r,n,i,y)}else if(se(m)){var v=[];D(m["@list"],r,n,i,o,v),m={"@list":v},e.addValue(l,d,m,{propertyIsArray:!0,allowDuplicate:!1})}else D(m,r,n,i,o),e.addValue(l,d,m,{propertyIsArray:!0,allowDuplicate:!1})}else e.addValue(l,d,[],{propertyIsArray:!0})}else{o in r||(r[o]={});var b="@merged"===n?n:o;D(t[d],r,b,i)}else{var w={"@id":o},E=t["@reverse"];for(var O in E)for(var S=E[O],T=0;T<S.length;++T){var x=S[T],I=x["@id"];ue(x)&&(I=i.getId(I)),D(x,r,n,i,I),e.addValue(f[I],O,w,{propertyIsArray:!0,allowDuplicate:!1})}}}}else a&&a.push(t)}function L(e){for(var t=e["@default"],r=Object.keys(e).sort(),n=0;n<r.length;++n){var i=r[n];if("@default"!==i){var o=e[i],a=t[i];a?"@graph"in a||(a["@graph"]=[]):t[i]=a={"@id":i,"@graph":[]};for(var s=a["@graph"],u=Object.keys(o).sort(),c=0;c<u.length;++c){var f=o[u[c]];oe(f)||s.push(f)}}}return t}function M(e){var t={};for(var r in e)void 0!==e[r]&&(t["@"+r]=[e[r]]);return[t]}function U(e,t){for(var r=t.length-1;r>=0;--r)if(t[r]["@id"]===e["@id"])return!0;return!1}function F(e,t,r){var n="@"+r,i=n in e?e[n][0]:t[r];return"embed"===r&&(!0===i?i="@last":!1===i?i="@never":"@always"!==i&&"@never"!==i&&"@link"!==i&&(i="@last")),i}function H(t,r,n){if("@type"in r&&(1!==r["@type"].length||!X(r["@type"][0]))){for(var i=r["@type"],o=0;o<i.length;++o)if(e.hasValue(t,"@type",i[o]))return!0;return!1}var a=!0,s=!1;for(var u in r){if(J(u)){if("@id"!==u&&"@type"!==u)continue;if(a=!1,"@id"===u&&ee(r[u])){if(t[u]!==r[u])return!1;s=!0;continue}}if(a=!1,u in t){if(Q(r[u])&&0===r[u].length&&void 0!==t[u])return!1;s=!0}else{var c=Q(r[u])&&X(r[u][0])&&"@default"in r[u][0];if(n.requireAll&&!c)return!1}}return a||s}function V(t,r){var n=t.uniqueEmbeds,i=n[r],o=i.parent,a=i.property,s={"@id":r};if(Q(o)){for(var u=0;u<o.length;++u)if(e.compareValues(o[u],s)){o[u]=s;break}}else{var c=Q(o[a]);e.removeValue(o,a,s,{propertyIsArray:c}),e.addValue(o,a,s,{propertyIsArray:c})}var f=function(e){for(var t=Object.keys(n),r=0;r<t.length;++r){var i=t[r];i in n&&X(n[i].parent)&&n[i].parent["@id"]===e&&(delete n[i],f(i))}};f(r)}function q(t,r,n){X(t)?e.addValue(t,r,n,{propertyIsArray:!0}):t.push(n)}function K(e,t){return e.length<t.length?-1:t.length<e.length?1:e===t?0:e<t?-1:1}function G(t,r,n,i,o){if(null===r)return r;ne(n)&&(n=null),ne(o)&&(o=!1),i=i||{};var a=t.getInverse();if(J(r))return r in a?a[r]["@none"]["@type"]["@none"]:r;if(i.vocab&&r in a){var s=t["@language"]||"@none",u=[];X(n)&&"@index"in n&&u.push("@index");var c="@language",f="@null";if(o)c="@type",f="@reverse",u.push("@set");else if(se(n)){"@index"in n||u.push("@list");for(var l=n["@list"],h=0===l.length?s:null,p=null,d=0;d<l.length;++d){var g=l[d],_="@none",m="@none";if(ae(g)?"@language"in g?_=g["@language"]:"@type"in g?m=g["@type"]:_="@null":m="@id",null===h?h=_:_!==h&&ae(g)&&(h="@none"),null===p?p=m:m!==p&&(p="@none"),"@none"===h&&"@none"===p)break}h=h||"@none","@none"!==(p=p||"@none")?(c="@type",f=p):f=h}else ae(n)?"@language"in n&&!("@index"in n)?(u.push("@language"),f=n["@language"]):"@type"in n&&(c="@type",f=n["@type"]):(c="@type",f="@id"),u.push("@set");u.push("@none");var y=function(e,t,r,n,i,o){null===o&&(o="@null");var a=[];if("@id"!==o&&"@reverse"!==o||!oe(r))a.push(o);else{"@reverse"===o&&a.push("@reverse");var s=G(e,r["@id"],null,{vocab:!0});s in e.mappings&&e.mappings[s]&&e.mappings[s]["@id"]===r["@id"]?a.push.apply(a,["@vocab","@id"]):a.push.apply(a,["@id","@vocab"])}a.push("@none");for(var u=e.inverse[t],c=0;c<n.length;++c){var f=n[c];if(f in u)for(var l=u[f][i],h=0;h<a.length;++h){var p=a[h];if(p in l)return l[p]}}return null}(t,r,n,u,c,f);if(null!==y)return y}if(i.vocab&&"@vocab"in t){var v=t["@vocab"];if(0===r.indexOf(v)&&r!==v){var b=r.substr(v.length);if(!(b in t.mappings))return b}}for(var w=null,E=0,O=[],S=t.fastCurieMap,P=r.length-1;E<P&&r[E]in S;++E)""in(S=S[r[E]])&&O.push(S[""][0]);for(d=O.length-1;d>=0;--d)for(var T=O[d],x=T.terms,I=0;I<x.length;++I){var R=x[I]+":"+r.substr(T.iri.length);(!(R in t.mappings)||null===n&&t.mappings[R]["@id"]===r)&&(null===w||K(R,w)<0)&&(w=R)}return null!==w?w:i.vocab?r:function(t,r){if(null===t)return r;ee(t)&&(t=e.url.parse(t||""));var n="";""!==t.href?n+=(t.protocol||"")+"//"+(t.authority||""):r.indexOf("//")&&(n+="//");if(0!==r.indexOf(n))return r;var i=e.url.parse(r.substr(n.length)),o=t.normalizedPath.split("/"),a=i.normalizedPath.split("/"),s=i.fragment||i.query?0:1;for(;o.length>0&&a.length>s&&o[0]===a[0];)o.shift(),a.shift();var u="";if(o.length>0){o.pop();for(var c=0;c<o.length;++c)u+="../"}u+=a.join("/"),null!==i.query&&(u+="?"+i.query);null!==i.fragment&&(u+="#"+i.fragment);""===u&&(u="./");return u}(t["@base"],r)}function W(e,t,r,n){if(r in n){if(n[r])return;throw new P("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:r})}if(n[r]=!1,J(r))throw new P("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:r});if(""===r)throw new P("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t});e.mappings[r]&&delete e.mappings[r];var i=t[r];if(null===i||X(i)&&null===i["@id"])return e.mappings[r]=null,void(n[r]=!0);if(ee(i)&&(i={"@id":i}),!X(i))throw new P("Invalid JSON-LD syntax; @context property values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});var o=e.mappings[r]={};if(o.reverse=!1,"@reverse"in i){if("@id"in i)throw new P("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});var a=i["@reverse"];if(!ee(a))throw new P("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(!ce(s=z(e,a,{vocab:!0,base:!1},t,n)))throw new P("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});o["@id"]=s,o.reverse=!0}else if("@id"in i){if(!ee(s=i["@id"]))throw new P("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(s!==r){if(!ce(s=z(e,s,{vocab:!0,base:!1},t,n))&&!J(s))throw new P("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});o["@id"]=s}}var s,u=r.indexOf(":");if(o._termHasColon=-1!==u,!("@id"in o))if(o._termHasColon){var c=r.substr(0,u);if(c in t&&W(e,t,c,n),e.mappings[c]){var f=r.substr(u+1);o["@id"]=e.mappings[c]["@id"]+f}else o["@id"]=r}else{if(!("@vocab"in e))throw new P("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:r});o["@id"]=e["@vocab"]+r}if(n[r]=!0,"@type"in i){var l=i["@type"];if(!ee(l))throw new P("Invalid JSON-LD syntax; an @context @type values must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if("@id"!==l&&"@vocab"!==l){if(!ce(l=z(e,l,{vocab:!0,base:!1},t,n)))throw new P("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(0===l.indexOf("_:"))throw new P("Invalid JSON-LD syntax; an @context @type values must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}o["@type"]=l}if("@container"in i){var h=i["@container"];if("@list"!==h&&"@set"!==h&&"@index"!==h&&"@language"!==h)throw new P("Invalid JSON-LD syntax; @context @container value must be one of the following: @list, @set, @index, or @language.","jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(o.reverse&&"@index"!==h&&"@set"!==h&&null!==h)throw new P("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});o["@container"]=h}if("@language"in i&&!("@type"in i)){var p=i["@language"];if(null!==p&&!ee(p))throw new P("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:t});null!==p&&(p=p.toLowerCase()),o["@language"]=p}if("@context"===(s=o["@id"])||"@preserve"===s)throw new P("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t})}function z(t,r,n,i,o){if(null===r||J(r))return r;if(r=String(r),i&&r in i&&!0!==o[r]&&W(t,i,r,o),(n=n||{}).vocab){if(null===(s=t.mappings[r]))return null;if(s)return s["@id"]}var a=r.indexOf(":");if(-1!==a){var s,u=r.substr(0,a),c=r.substr(a+1);return"_"===u||0===c.indexOf("//")?r:(i&&u in i&&W(t,i,u,o),(s=t.mappings[u])?s["@id"]+c:r)}if(n.vocab&&"@vocab"in t)return t["@vocab"]+r;var f=r;return n.base&&(f=e.prependBase(t["@base"],f)),f}function Y(t){return{"@base":e.url.parse(t.base||""),mappings:{},inverse:null,getInverse:function(){if(this.inverse)return this.inverse;for(var e=this.inverse={},t=this.fastCurieMap={},i={},o=this["@language"]||"@none",a=this.mappings,s=Object.keys(a).sort(K),u=0;u<s.length;++u){var c=s[u],f=a[c];if(null!==f){var l=f["@container"]||"@none",h=f["@id"];Q(h)||(h=[h]);for(var p=0;p<h.length;++p){var d=h[p],g=e[d],_=J(d);if(g)_||f._termHasColon||i[d].push(c);else if(e[d]=g={},!_&&!f._termHasColon){i[d]=[c];var m={iri:d,terms:i[d]};d[0]in t?t[d[0]].push(m):t[d[0]]=[m]}if(g[l]||(g[l]={"@language":{},"@type":{}}),g=g[l],f.reverse)n(f,c,g["@type"],"@reverse");else if("@type"in f)n(f,c,g["@type"],f["@type"]);else if("@language"in f){var y=f["@language"]||"@null";n(f,c,g["@language"],y)}else n(f,c,g["@language"],o),n(f,c,g["@type"],"@none"),n(f,c,g["@language"],"@none")}}}for(var v in t)r(t,v,1);return e},clone:function(){var e={};e["@base"]=this["@base"],e.mappings=fe(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,"@language"in this&&(e["@language"]=this["@language"]);"@vocab"in this&&(e["@vocab"]=this["@vocab"]);return e}};function r(e,t,n){for(var i,o,a=e[t],s=e[t]={},u=0;u<a.length;++u)(o=n>=(i=a[u].iri).length?"":i[n])in s?s[o].push(a[u]):s[o]=[a[u]];for(var t in s)""!==t&&r(s,t,n+1)}function n(e,t,r,n){n in r||(r[n]=t)}}function J(e){if(!ee(e))return!1;switch(e){case"@base":case"@context":case"@container":case"@default":case"@embed":case"@explicit":case"@graph":case"@id":case"@index":case"@language":case"@list":case"@omitDefault":case"@preserve":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@vocab":return!0}return!1}function X(e){return"[object Object]"===Object.prototype.toString.call(e)}function Q(e){return Array.isArray(e)}function Z(e){if(!ee(e)&&!function(e){return X(e)&&0===Object.keys(e).length}(e)){var t=!1;if(Q(e)){t=!0;for(var r=0;r<e.length;++r)if(!ee(e[r])){t=!1;break}}if(!t)throw new P('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, or an empty object.',"jsonld.SyntaxError",{code:"invalid type value",value:e})}}function ee(e){return"string"==typeof e||"[object String]"===Object.prototype.toString.call(e)}function te(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function re(e){return te(e)&&-1!==String(e).indexOf(".")}function ne(e){return void 0===e}function ie(e){var t=!1;X(e)&&!("@value"in e||"@set"in e||"@list"in e)&&(t=Object.keys(e).length>1||!("@id"in e));return t}function oe(e){return X(e)&&1===Object.keys(e).length&&"@id"in e}function ae(e){return X(e)&&"@value"in e}function se(e){return X(e)&&"@list"in e}function ue(e){var t=!1;return X(e)&&(t="@id"in e?0===e["@id"].indexOf("_:"):0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e)),t}function ce(e){return ee(e)&&-1!==e.indexOf(":")}function fe(e){if(e&&"object"==typeof e){var t;if(Q(e)){t=[];for(var r=0;r<e.length;++r)t[r]=fe(e[r])}else if(X(e))for(var n in t={},e)t[n]=fe(e[n]);else t=e.toString();return t}return e}function le(t,r,n,i){var o=Object.keys(r).length;if(Q(t)){for(var a=0;a<t.length;++a)le(t[a],r,n,i);return o<Object.keys(r).length}if(X(t)){for(var s in t)if("@context"===s){var u=t[s];if(Q(u)){var c=u.length;for(a=0;a<c;++a){var f=u[a];ee(f)&&(f=e.prependBase(i,f),n?Q(f=r[f])?(Array.prototype.splice.apply(u,[a,1].concat(f)),a+=f.length-1,c=u.length):u[a]=f:f in r||(r[f]=!1))}}else ee(u)&&(u=e.prependBase(i,u),n?t[s]=r[u]:u in r||(r[u]=!1))}else le(t[s],r,n,i);return o<Object.keys(r).length}return!1}function he(e,t,r){var n=null,i=t.documentLoader,o=function(e,t,r,i,a){if(Object.keys(t).length>S)return n=new P("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"loading remote context failed",max:S}),a(n);var s={},u=function(){le(e,s,!0,i),a(null,e)};if(!le(e,s,!1,i))return u();var c=[];for(var f in s)!1===s[f]&&c.push(f);for(var l=c.length,h=0;h<c.length;++h)!function(e){if(e in t)return n=new P("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"recursive context inclusion",url:e}),a(n);var i=fe(t);i[e]=!0;var c=function(t,c){if(!n){var f=c?c.document:null;if(!t&&ee(f))try{f=JSON.parse(f)}catch(e){t=e}if(t?t=new P("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:e,cause:t}):X(f)||(t=new P("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:e,cause:t})),t)return a(n=t);f="@context"in f?{"@context":f["@context"]}:{"@context":{}},c.contextUrl&&(Q(f["@context"])||(f["@context"]=[f["@context"]]),f["@context"].push(c.contextUrl)),o(f,i,r,e,function(t,r){if(t)return a(t);s[e]=r["@context"],0===(l-=1)&&u()})}},f=r(e,c);f&&"then"in f&&f.then(c.bind(null,null),c)}(c[h])};o(e,{},i,t.base,r)}function pe(e){for(var t=new RegExp("^[ \\t]*(?:#.*)?$"),r=new RegExp('^[ \\t]*(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-z0-9]+)))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-z0-9]+))|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-z]+(?:-[a-z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-z0-9]+)))[ \\t]*\\.))[ \\t]*(?:#.*)?$'),n={},i=e.split(/(?:\r\n)|(?:\n)|(?:\r)/g),o=0,a=0;a<i.length;++a){var s=i[a];if(o++,!t.test(s)){var u=s.match(r);if(null===u)throw new P("Error while parsing N-Quads; invalid quad.","jsonld.ParseError",{line:o});var c={};if(ne(u[1])?c.subject={type:"blank node",value:u[2]}:c.subject={type:"IRI",value:u[1]},c.predicate={type:"IRI",value:u[3]},ne(u[4]))if(ne(u[5])){c.object={type:"literal"},ne(u[7])?ne(u[8])?c.object.datatype=p:(c.object.datatype=E,c.object.language=u[8]):c.object.datatype=u[7];var f=u[6].replace(/\\"/g,'"').replace(/\\t/g,"\t").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\\\/g,"\\");c.object.value=f}else c.object={type:"blank node",value:u[5]};else c.object={type:"IRI",value:u[4]};var l="@default";if(ne(u[9])?ne(u[10])||(l=u[10]):l=u[9],l in n){for(var h=!0,d=n[l],g=0;h&&g<d.length;++g)$(d[g],c)&&(h=!1);h&&d.push(c)}else n[l]=[c]}}return n}function de(e,t){var r=e.subject,n=e.predicate,i=e.object,o=t||null;"name"in e&&e.name&&(o=e.name.value);var a="";if("IRI"===r.type?a+="<"+r.value+">":a+=r.value,a+=" ","IRI"===n.type?a+="<"+n.value+">":a+=n.value,a+=" ","IRI"===i.type)a+="<"+i.value+">";else if("blank node"===i.type)a+=i.value;else{a+='"'+i.value.replace(/\\/g,"\\\\").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\"/g,'\\"')+'"',i.datatype===E?i.language&&(a+="@"+i.language):i.datatype!==p&&(a+="^^<"+i.datatype+">")}return null!=o&&(0!==o.indexOf("_:")?a+=" <"+o+">":a+=" "+o),a+=" .\n"}function ge(e){this.prefix=e,this.counter=0,this.existing={}}Object.keys||(Object.keys=function(e){if(e!==Object(e))throw new TypeError("Object.keys called on non-object");var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}),e.registerRDFParser("application/nquads",pe),e.registerRDFParser("rdfa-api",function(e){for(var t={"@default":[]},r=e.getSubjects(),n=0;n<r.length;++n){var i=r[n];if(null!==i){var o=e.getSubjectTriples(i);if(null!==o){var a=o.predicates;for(var s in a)for(var f=a[s].objects,l=0;l<f.length;++l){var h=f[l],d={};0===i.indexOf("_:")?d.subject={type:"blank node",value:i}:d.subject={type:"IRI",value:i},0===s.indexOf("_:")?d.predicate={type:"blank node",value:s}:d.predicate={type:"IRI",value:s};var g=h.value;if(h.type===b){u||ye();var _=new u;g="";for(var m=0;m<h.value.length;m++)h.value[m].nodeType===c.ELEMENT_NODE?g+=_.serializeToString(h.value[m]):h.value[m].nodeType===c.TEXT_NODE&&(g+=h.value[m].nodeValue)}d.object={},h.type===w?0===h.value.indexOf("_:")?d.object.type="blank node":d.object.type="IRI":(d.object.type="literal",h.type===v?h.language?(d.object.datatype=E,d.object.language=h.language):d.object.datatype=p:d.object.datatype=h.type),d.object.value=g,t["@default"].push(d)}}}}return t}),e.IdentifierIssuer=ge,e.UniqueNamer=ge,ge.prototype.clone=function(){var e=new ge(this.prefix);return e.counter=this.counter,e.existing=fe(this.existing),e},ge.prototype.getId=function(e){if(e&&e in this.existing)return this.existing[e];var t=this.prefix+this.counter;return this.counter+=1,e&&(this.existing[e]=t),t},ge.prototype.getName=ge.prototype.getName,ge.prototype.hasId=function(e){return e in this.existing},ge.prototype.isNamed=ge.prototype.hasId;var _e=function(e){this.list=e.sort(),this.done=!1,this.left={};for(var t=0;t<e.length;++t)this.left[e[t]]=!0};_e.prototype.hasNext=function(){return!this.done},_e.prototype.next=function(){for(var e=this.list.slice(),t=null,r=0,n=this.list.length,i=0;i<n;++i){var o=this.list[i],a=this.left[o];(null===t||o>t)&&(a&&i>0&&o>this.list[i-1]||!a&&i<n-1&&o>this.list[i+1])&&(t=o,r=i)}if(null===t)this.done=!0;else{var s=this.left[t]?r-1:r+1;this.list[r]=this.list[s],this.list[s]=t;for(i=0;i<n;++i)this.list[i]>t&&(this.left[this.list[i]]=!this.left[this.list[i]])}return e};var me=function(e){if(!(this instanceof me))return new me(e);if(-1===["URDNA2015","URGNA2012"].indexOf(e))throw new Error("Invalid RDF Dataset Normalization algorithm: "+e);me._init.call(this,e)};if(me.hashNQuads=function(e,t){for(var r=new me(e),n=0;n<t.length;++n)r.update(t[n]);return r.digest()},function(e){if(e){var t=ignore;return me._init=function(e){e="URDNA2015"===e?"sha256":"sha1",this.md=t.createHash(e)},me.prototype.update=function(e){return this.md.update(e,"utf8")},void(me.prototype.digest=function(){return this.md.digest("hex")})}me._init=function(e){e="URDNA2015"===e?new i.Algorithm:new n.Algorithm,this.md=new r(e)},me.prototype.update=function(e){return this.md.update(e)},me.prototype.digest=function(){return this.md.digest().toHex()};var r=function(e){if(!(this instanceof r))return new r(e);if(this._algorithm=e,!r._padding||r._padding.length<this._algorithm.blockSize){r._padding=String.fromCharCode(128);for(var t=String.fromCharCode(0),n=64;n>0;)1&n&&(r._padding+=t),(n>>>=1)>0&&(t+=t)}this.start()};r.prototype.start=function(){this.messageLength=0,this.fullMessageLength=[];for(var e=this._algorithm.messageLengthSize/4,t=0;t<e;++t)this.fullMessageLength.push(0);return this._input=new r.ByteBuffer,this.state=this._algorithm.start(),this},r.prototype.update=function(e){e=new r.ByteBuffer(unescape(encodeURIComponent(e))),this.messageLength+=e.length();var t=e.length();t=[t/4294967296>>>0,t>>>0];for(var n=this.fullMessageLength.length-1;n>=0;--n)this.fullMessageLength[n]+=t[1],t[1]=t[0]+(this.fullMessageLength[n]/4294967296>>>0),this.fullMessageLength[n]=this.fullMessageLength[n]>>>0,t[0]=t[1]/4294967296>>>0;for(this._input.putBytes(e.bytes());this._input.length()>=this._algorithm.blockSize;)this.state=this._algorithm.digest(this.state,this._input);return(this._input.read>2048||0===this._input.length())&&this._input.compact(),this},r.prototype.digest=function(){var e=new r.ByteBuffer;e.putBytes(this._input.bytes());var t=this.fullMessageLength[this.fullMessageLength.length-1]+this._algorithm.messageLengthSize&this._algorithm.blockSize-1;e.putBytes(r._padding.substr(0,this._algorithm.blockSize-t));for(var n=new r.ByteBuffer,i=0;i<this.fullMessageLength.length;++i)n.putInt32(this.fullMessageLength[i]<<3|this.fullMessageLength[i+1]>>>28);this._algorithm.writeMessageLength(e,n);var o=this._algorithm.digest(this.state.copy(),e),a=new r.ByteBuffer;return o.write(a),a},r.ByteBuffer=function(e){this.data="string"==typeof e?e:"",this.read=0},r.ByteBuffer.prototype.putInt32=function(e){this.data+=String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)},r.ByteBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},r.ByteBuffer.prototype.putBytes=function(e){this.data+=e},r.ByteBuffer.prototype.bytes=function(){return this.data.slice(this.read)},r.ByteBuffer.prototype.length=function(){return this.data.length-this.read},r.ByteBuffer.prototype.compact=function(){this.data=this.data.slice(this.read),this.read=0},r.ByteBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+="0"),e+=r.toString(16)}return e};var n={_w:null,Algorithm:function(){this.name="sha1",this.blockSize=64,this.digestLength=20,this.messageLengthSize=8}};n.Algorithm.prototype.start=function(){return n._w||(n._w=new Array(80)),n._createState()},n.Algorithm.prototype.writeMessageLength=function(e,t){e.putBytes(t.bytes())},n.Algorithm.prototype.digest=function(e,t){for(var r,i,o,a,s,u,c,f=t.length(),l=n._w;f>=64;){for(i=e.h0,o=e.h1,a=e.h2,s=e.h3,u=e.h4,c=0;c<16;++c)r=t.getInt32(),l[c]=r,r=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+r,u=s,s=a,a=o<<30|o>>>2,o=i,i=r;for(;c<20;++c)r=(r=l[c-3]^l[c-8]^l[c-14]^l[c-16])<<1|r>>>31,l[c]=r,r=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+r,u=s,s=a,a=o<<30|o>>>2,o=i,i=r;for(;c<32;++c)r=(r=l[c-3]^l[c-8]^l[c-14]^l[c-16])<<1|r>>>31,l[c]=r,r=(i<<5|i>>>27)+(o^a^s)+u+1859775393+r,u=s,s=a,a=o<<30|o>>>2,o=i,i=r;for(;c<40;++c)r=(r=l[c-6]^l[c-16]^l[c-28]^l[c-32])<<2|r>>>30,l[c]=r,r=(i<<5|i>>>27)+(o^a^s)+u+1859775393+r,u=s,s=a,a=o<<30|o>>>2,o=i,i=r;for(;c<60;++c)r=(r=l[c-6]^l[c-16]^l[c-28]^l[c-32])<<2|r>>>30,l[c]=r,r=(i<<5|i>>>27)+(o&a|s&(o^a))+u+2400959708+r,u=s,s=a,a=o<<30|o>>>2,o=i,i=r;for(;c<80;++c)r=(r=l[c-6]^l[c-16]^l[c-28]^l[c-32])<<2|r>>>30,l[c]=r,r=(i<<5|i>>>27)+(o^a^s)+u+3395469782+r,u=s,s=a,a=o<<30|o>>>2,o=i,i=r;e.h0=e.h0+i|0,e.h1=e.h1+o|0,e.h2=e.h2+a|0,e.h3=e.h3+s|0,e.h4=e.h4+u|0,f-=64}return e},n._createState=function(){var e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520,copy:function(){var t=n._createState();return t.h0=e.h0,t.h1=e.h1,t.h2=e.h2,t.h3=e.h3,t.h4=e.h4,t},write:function(t){t.putInt32(e.h0),t.putInt32(e.h1),t.putInt32(e.h2),t.putInt32(e.h3),t.putInt32(e.h4)}};return e};var i={_k:null,_w:null,Algorithm:function(){this.name="sha256",this.blockSize=64,this.digestLength=32,this.messageLengthSize=8}};i.Algorithm.prototype.start=function(){return i._k||i._init(),i._createState()},i.Algorithm.prototype.writeMessageLength=function(e,t){e.putBytes(t.bytes())},i.Algorithm.prototype.digest=function(e,t){for(var r,n,o,a,s,u,c,f,l,h,p,d,g,_=t.length(),m=i._k,y=i._w;_>=64;){for(s=0;s<16;++s)y[s]=t.getInt32();for(;s<64;++s)r=((r=y[s-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10,n=((n=y[s-15])>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,y[s]=r+y[s-7]+n+y[s-16]|0;for(u=e.h0,c=e.h1,f=e.h2,l=e.h3,h=e.h4,p=e.h5,d=e.h6,g=e.h7,s=0;s<64;++s)o=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),a=u&c|f&(u^c),r=g+((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(d^h&(p^d))+m[s]+y[s],g=d,d=p,p=h,h=l+r|0,l=f,f=c,c=u,u=r+(n=o+a)|0;e.h0=e.h0+u|0,e.h1=e.h1+c|0,e.h2=e.h2+f|0,e.h3=e.h3+l|0,e.h4=e.h4+h|0,e.h5=e.h5+p|0,e.h6=e.h6+d|0,e.h7=e.h7+g|0,_-=64}return e},i._createState=function(){var e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225,copy:function(){var t=i._createState();return t.h0=e.h0,t.h1=e.h1,t.h2=e.h2,t.h3=e.h3,t.h4=e.h4,t.h5=e.h5,t.h6=e.h6,t.h7=e.h7,t},write:function(t){t.putInt32(e.h0),t.putInt32(e.h1),t.putInt32(e.h2),t.putInt32(e.h3),t.putInt32(e.h4),t.putInt32(e.h5),t.putInt32(e.h6),t.putInt32(e.h7)}};return e},i._init=function(){i._k=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],i._w=new Array(64)}}(t),!u)var ye=function(){u=ignore.XMLSerializer};function ve(e,t){var r="";0===e.indexOf("/")&&(r="/");for(var n=e.split("/"),i=[];n.length>0;)"."===n[0]||""===n[0]&&n.length>1?n.shift():".."!==n[0]?i.push(n.shift()):(n.shift(),t||i.length>0&&".."!==i[i.length-1]?i.pop():i.push(".."));return r+i.join("/")}if(e.url={},e.url.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},e.url.parse=function(t,r){for(var n={},i=e.url.parsers[r||"full"],o=i.regex.exec(t),a=i.keys.length;a--;)n[i.keys[a]]=void 0===o[a]?null:o[a];return n.normalizedPath=ve(n.path,!!n.authority),n},t?e.useDocumentLoader("node"):"undefined"!=typeof XMLHttpRequest&&e.useDocumentLoader("xhr"),t){e.use=function(t){switch(t){case"request":e.request=ignore;break;default:throw new P("Unknown extension.","jsonld.UnknownExtension",{extension:t})}};var be={exports:{},filename:__dirname};ignore(be,"version"),e.version=be.exports.version}return e})(i),"function"==typeof commonjsRequire&&e.exports&&(e.exports=i),r&&(void 0===window.jsonld?window.jsonld=window.jsonldjs=i:jsonldjs=i)}),jsonld_1=jsonld.jsonld,convertHex=createCommonjsModule(function(e){!function(t){var r={bytesToHex:function(e){return function(e){return e.map(function(e){return t=e.toString(16),r=2,t.length>r?t:Array(r-t.length+1).join("0")+t;var t,r}).join("")}(e)},hexToBytes:function(e){if(e.length%2==1)throw new Error("hexToBytes can't have a string with an odd number of characters.");return 0===e.indexOf("0x")&&(e=e.slice(2)),e.match(/../g).map(function(e){return parseInt(e,16)})}};e.exports?e.exports=r:t.convertHex=r}(commonjsGlobal)}),convertString=createCommonjsModule(function(e){var t,r;t=commonjsGlobal,(r={bytesToString:function(e){return e.map(function(e){return String.fromCharCode(e)}).join("")},stringToBytes:function(e){return e.split("").map(function(e){return e.charCodeAt(0)})}}).UTF8={bytesToString:function(e){return decodeURIComponent(escape(r.bytesToString(e)))},stringToBytes:function(e){return r.stringToBytes(unescape(encodeURIComponent(e)))}},e.exports?e.exports=r:t.convertString=r}),sha256=createCommonjsModule(function(e){!function(t){var r={};e.exports?(r.bytesToHex=convertHex.bytesToHex,r.convertString=convertString,e.exports=u):(r.bytesToHex=t.convertHex.bytesToHex,r.convertString=t.convertString,t.sha256=u);var n=[];!function(){function e(e){for(var t=Math.sqrt(e),r=2;r<=t;r++)if(!(e%r))return!1;return!0}function t(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(n[i]=t(Math.pow(r,1/3)),i++),r++}();var i=function(e){for(var t=[],r=0,n=0;r<e.length;r++,n+=8)t[n>>>5]|=e[r]<<24-n%32;return t},o=function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},a=[],s=function(e,t,r){for(var i=e[0],o=e[1],s=e[2],u=e[3],c=e[4],f=e[5],l=e[6],h=e[7],p=0;p<64;p++){if(p<16)a[p]=0|t[r+p];else{var d=a[p-15],g=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,_=a[p-2],m=(_<<15|_>>>17)^(_<<13|_>>>19)^_>>>10;a[p]=g+a[p-7]+m+a[p-16]}var y=i&o^i&s^o&s,v=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),b=h+((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+(c&f^~c&l)+n[p]+a[p];h=l,l=f,f=c,c=u+b|0,u=s,s=o,o=i,i=b+(v+y)|0}e[0]=e[0]+i|0,e[1]=e[1]+o|0,e[2]=e[2]+s|0,e[3]=e[3]+u|0,e[4]=e[4]+c|0,e[5]=e[5]+f|0,e[6]=e[6]+l|0,e[7]=e[7]+h|0};function u(e,t){e.constructor===String&&(e=r.convertString.UTF8.stringToBytes(e));var n=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],a=i(e),u=8*e.length;a[u>>5]|=128<<24-u%32,a[15+(u+64>>9<<4)]=u;for(var c=0;c<a.length;c+=16)s(n,a,c);var f=o(n);return t&&t.asBytes?f:t&&t.asString?r.convertString.bytesToString(f):r.bytesToHex(f)}u.x2=function(e,t){return u(u(e,{asBytes:!0}),t)}}(commonjsGlobal)});function toByteArray$1(e){const t=[];for(let r=0;r<e.length;r+=2)t.push(parseInt(e.substring(r,r+2),16));return t}function toUTF8Data(e){const t=[];for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);n<128?t.push(n):n<2048?t.push(192|n>>6,128|63&n):n<55296||n>=57344?t.push(224|n>>12,128|n>>6&63,128|63&n):(r++,n=65536+((1023&n)<<10|1023&e.charCodeAt(r)),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return t}const{obi:OBI_CONTEXT,blockcerts:BLOCKCERTS_CONTEXT,blockcertsv1_2:BLOCKCERTSV1_2_CONTEXT,blockcertsv2:BLOCKCERTSV2_CONTEXT}=ContextsMap,CONTEXTS$$1={};function getUnmappedFields(e){const t=/<http:\/\/fallback\.org\/(.*)>/.exec(e);if(t){const e=[];for(let r=0;r<t.length;r++)e.push(t[r]);return e}return null}function computeLocalHash$1(e,t){let r=e["@context"];const n=e;t===CERTIFICATE_VERSIONS.V2_0&&CONFIG.CheckForUnmappedFields&&(r.find(e=>e===Object(e)&&"@vocab"in e)?r=null:r.push({"@vocab":"http://fallback.org/"}));const i=jsonld.documentLoaders.node();jsonld.documentLoader=function(e,t){return e in CONTEXTS$$1?t(null,{contextUrl:null,document:CONTEXTS$$1[e],documentUrl:e}):i(e,t)};let o={algorithm:"URDNA2015",format:"application/nquads"};return r&&(o.expandContext=r),new Promise((e,t)=>{jsonld.normalize(n,o,(r,n)=>{if(!!r)t(new VerifierError(computeLocalHash,"Failed JSON-LD normalization"));else{getUnmappedFields(n)?t(new VerifierError(computeLocalHash,"Found unmapped fields during JSON-LD normalization")):e(sha256(toUTF8Data(n)))}})})}function ensureHashesEqual(e,t){if(e!==t)throw new VerifierError(compareHashes,"Computed hash does not match remote hash")}CONTEXTS$$1["https://w3id.org/blockcerts/schema/2.0-alpha/context.json"]=BLOCKCERTS_CONTEXT,CONTEXTS$$1["https://www.blockcerts.org/schema/2.0-alpha/context.json"]=BLOCKCERTS_CONTEXT,CONTEXTS$$1["https://w3id.org/openbadges/v2"]=OBI_CONTEXT,CONTEXTS$$1["https://openbadgespec.org/v2/context.json"]=OBI_CONTEXT,CONTEXTS$$1["https://w3id.org/blockcerts/v2"]=BLOCKCERTSV2_CONTEXT,CONTEXTS$$1["https://www.w3id.org/blockcerts/schema/2.0/context.json"]=BLOCKCERTSV2_CONTEXT,CONTEXTS$$1["https://w3id.org/blockcerts/v1"]=BLOCKCERTSV1_2_CONTEXT;var inherits_browser=createCommonjsModule(function(e){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),intSize=4,zeroBuffer=new Buffer(intSize);zeroBuffer.fill(0);var charSize=8,hashSize=16;function toArray(e){if(e.length%intSize!=0){var t=e.length+(intSize-e.length%intSize);e=Buffer.concat([e,zeroBuffer],t)}for(var r=new Array(e.length>>>2),n=0,i=0;n<e.length;n+=intSize,i++)r[i]=e.readInt32LE(n);return r}var makeHash=function(e,t){var r=t(toArray(e),e.length*charSize);e=new Buffer(hashSize);for(var n=0;n<r.length;n++)e.writeInt32LE(r[n],n<<2,!0);return e};function core_md5(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var r=1732584193,n=-271733879,i=-1732584194,o=271733878,a=0;a<e.length;a+=16){var s=r,u=n,c=i,f=o;r=md5_ff(r,n,i,o,e[a+0],7,-680876936),o=md5_ff(o,r,n,i,e[a+1],12,-389564586),i=md5_ff(i,o,r,n,e[a+2],17,606105819),n=md5_ff(n,i,o,r,e[a+3],22,-1044525330),r=md5_ff(r,n,i,o,e[a+4],7,-176418897),o=md5_ff(o,r,n,i,e[a+5],12,1200080426),i=md5_ff(i,o,r,n,e[a+6],17,-1473231341),n=md5_ff(n,i,o,r,e[a+7],22,-45705983),r=md5_ff(r,n,i,o,e[a+8],7,1770035416),o=md5_ff(o,r,n,i,e[a+9],12,-1958414417),i=md5_ff(i,o,r,n,e[a+10],17,-42063),n=md5_ff(n,i,o,r,e[a+11],22,-1990404162),r=md5_ff(r,n,i,o,e[a+12],7,1804603682),o=md5_ff(o,r,n,i,e[a+13],12,-40341101),i=md5_ff(i,o,r,n,e[a+14],17,-1502002290),r=md5_gg(r,n=md5_ff(n,i,o,r,e[a+15],22,1236535329),i,o,e[a+1],5,-165796510),o=md5_gg(o,r,n,i,e[a+6],9,-1069501632),i=md5_gg(i,o,r,n,e[a+11],14,643717713),n=md5_gg(n,i,o,r,e[a+0],20,-373897302),r=md5_gg(r,n,i,o,e[a+5],5,-701558691),o=md5_gg(o,r,n,i,e[a+10],9,38016083),i=md5_gg(i,o,r,n,e[a+15],14,-660478335),n=md5_gg(n,i,o,r,e[a+4],20,-405537848),r=md5_gg(r,n,i,o,e[a+9],5,568446438),o=md5_gg(o,r,n,i,e[a+14],9,-1019803690),i=md5_gg(i,o,r,n,e[a+3],14,-187363961),n=md5_gg(n,i,o,r,e[a+8],20,1163531501),r=md5_gg(r,n,i,o,e[a+13],5,-1444681467),o=md5_gg(o,r,n,i,e[a+2],9,-51403784),i=md5_gg(i,o,r,n,e[a+7],14,1735328473),r=md5_hh(r,n=md5_gg(n,i,o,r,e[a+12],20,-1926607734),i,o,e[a+5],4,-378558),o=md5_hh(o,r,n,i,e[a+8],11,-2022574463),i=md5_hh(i,o,r,n,e[a+11],16,1839030562),n=md5_hh(n,i,o,r,e[a+14],23,-35309556),r=md5_hh(r,n,i,o,e[a+1],4,-1530992060),o=md5_hh(o,r,n,i,e[a+4],11,1272893353),i=md5_hh(i,o,r,n,e[a+7],16,-155497632),n=md5_hh(n,i,o,r,e[a+10],23,-1094730640),r=md5_hh(r,n,i,o,e[a+13],4,681279174),o=md5_hh(o,r,n,i,e[a+0],11,-358537222),i=md5_hh(i,o,r,n,e[a+3],16,-722521979),n=md5_hh(n,i,o,r,e[a+6],23,76029189),r=md5_hh(r,n,i,o,e[a+9],4,-640364487),o=md5_hh(o,r,n,i,e[a+12],11,-421815835),i=md5_hh(i,o,r,n,e[a+15],16,530742520),r=md5_ii(r,n=md5_hh(n,i,o,r,e[a+2],23,-995338651),i,o,e[a+0],6,-198630844),o=md5_ii(o,r,n,i,e[a+7],10,1126891415),i=md5_ii(i,o,r,n,e[a+14],15,-1416354905),n=md5_ii(n,i,o,r,e[a+5],21,-57434055),r=md5_ii(r,n,i,o,e[a+12],6,1700485571),o=md5_ii(o,r,n,i,e[a+3],10,-1894986606),i=md5_ii(i,o,r,n,e[a+10],15,-1051523),n=md5_ii(n,i,o,r,e[a+1],21,-2054922799),r=md5_ii(r,n,i,o,e[a+8],6,1873313359),o=md5_ii(o,r,n,i,e[a+15],10,-30611744),i=md5_ii(i,o,r,n,e[a+6],15,-1560198380),n=md5_ii(n,i,o,r,e[a+13],21,1309151649),r=md5_ii(r,n,i,o,e[a+4],6,-145523070),o=md5_ii(o,r,n,i,e[a+11],10,-1120210379),i=md5_ii(i,o,r,n,e[a+2],15,718787259),n=md5_ii(n,i,o,r,e[a+9],21,-343485551),r=safe_add(r,s),n=safe_add(n,u),i=safe_add(i,c),o=safe_add(o,f)}return[r,n,i,o]}function md5_cmn(e,t,r,n,i,o){return safe_add(bit_rol(safe_add(safe_add(t,e),safe_add(n,o)),i),r)}function md5_ff(e,t,r,n,i,o,a){return md5_cmn(t&r|~t&n,e,t,i,o,a)}function md5_gg(e,t,r,n,i,o,a){return md5_cmn(t&n|r&~n,e,t,i,o,a)}function md5_hh(e,t,r,n,i,o,a){return md5_cmn(t^r^n,e,t,i,o,a)}function md5_ii(e,t,r,n,i,o,a){return md5_cmn(r^(t|~n),e,t,i,o,a)}function safe_add(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function bit_rol(e,t){return e<<t|e>>>32-t}var md5=function(e){return makeHash(e,core_md5)},require$$0=stream&&Stream||stream,Transform$1=require$$0.Transform;function HashBase(e){Transform$1.call(this),this._block=new Buffer(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}inherits_browser(HashBase,Transform$1),HashBase.prototype._transform=function(e,t,r){var n=null;try{"buffer"!==t&&(e=new Buffer(e,t)),this.update(e)}catch(e){n=e}r(n)},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){if(!isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");isBuffer(e)||(e=new Buffer(e,t||"binary"));for(var r=this._block,n=0;this._blockOffset+e.length-n>=this._blockSize;){for(var i=this._blockOffset;i<this._blockSize;)r[i++]=e[n++];this._update(),this._blockOffset=0}for(;n<e.length;)r[this._blockOffset++]=e[n++];for(var o=0,a=8*e.length;a>0;++o)this._length[o]+=a,(a=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*a);return this},HashBase.prototype._update=function(e){throw new Error("_update is not implemented")},HashBase.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();return void 0!==e&&(t=t.toString(e)),t},HashBase.prototype._digest=function(){throw new Error("_digest is not implemented")};var hashBase=HashBase;function RIPEMD160(){hashBase.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function rotl(e,t){return e<<t|e>>>32-t}function fn1(e,t,r,n,i,o,a,s){return rotl(e+(t^r^n)+o+a|0,s)+i|0}function fn2(e,t,r,n,i,o,a,s){return rotl(e+(t&r|~t&n)+o+a|0,s)+i|0}function fn3(e,t,r,n,i,o,a,s){return rotl(e+((t|~r)^n)+o+a|0,s)+i|0}function fn4(e,t,r,n,i,o,a,s){return rotl(e+(t&n|r&~n)+o+a|0,s)+i|0}function fn5(e,t,r,n,i,o,a,s){return rotl(e+(t^(r|~n))+o+a|0,s)+i|0}inherits_browser(RIPEMD160,hashBase),RIPEMD160.prototype._update=function(){for(var e=new Array(16),t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d,a=this._e;r=fn1(r,n,i,o,a,e[0],0,11),a=fn1(a,r,n,i=rotl(i,10),o,e[1],0,14),o=fn1(o,a,r,n=rotl(n,10),i,e[2],0,15),i=fn1(i,o,a,r=rotl(r,10),n,e[3],0,12),n=fn1(n,i,o,a=rotl(a,10),r,e[4],0,5),r=fn1(r,n,i,o=rotl(o,10),a,e[5],0,8),a=fn1(a,r,n,i=rotl(i,10),o,e[6],0,7),o=fn1(o,a,r,n=rotl(n,10),i,e[7],0,9),i=fn1(i,o,a,r=rotl(r,10),n,e[8],0,11),n=fn1(n,i,o,a=rotl(a,10),r,e[9],0,13),r=fn1(r,n,i,o=rotl(o,10),a,e[10],0,14),a=fn1(a,r,n,i=rotl(i,10),o,e[11],0,15),o=fn1(o,a,r,n=rotl(n,10),i,e[12],0,6),i=fn1(i,o,a,r=rotl(r,10),n,e[13],0,7),n=fn1(n,i,o,a=rotl(a,10),r,e[14],0,9),a=fn2(a,r=fn1(r,n,i,o=rotl(o,10),a,e[15],0,8),n,i=rotl(i,10),o,e[7],1518500249,7),o=fn2(o,a,r,n=rotl(n,10),i,e[4],1518500249,6),i=fn2(i,o,a,r=rotl(r,10),n,e[13],1518500249,8),n=fn2(n,i,o,a=rotl(a,10),r,e[1],1518500249,13),r=fn2(r,n,i,o=rotl(o,10),a,e[10],1518500249,11),a=fn2(a,r,n,i=rotl(i,10),o,e[6],1518500249,9),o=fn2(o,a,r,n=rotl(n,10),i,e[15],1518500249,7),i=fn2(i,o,a,r=rotl(r,10),n,e[3],1518500249,15),n=fn2(n,i,o,a=rotl(a,10),r,e[12],1518500249,7),r=fn2(r,n,i,o=rotl(o,10),a,e[0],1518500249,12),a=fn2(a,r,n,i=rotl(i,10),o,e[9],1518500249,15),o=fn2(o,a,r,n=rotl(n,10),i,e[5],1518500249,9),i=fn2(i,o,a,r=rotl(r,10),n,e[2],1518500249,11),n=fn2(n,i,o,a=rotl(a,10),r,e[14],1518500249,7),r=fn2(r,n,i,o=rotl(o,10),a,e[11],1518500249,13),o=fn3(o,a=fn2(a,r,n,i=rotl(i,10),o,e[8],1518500249,12),r,n=rotl(n,10),i,e[3],1859775393,11),i=fn3(i,o,a,r=rotl(r,10),n,e[10],1859775393,13),n=fn3(n,i,o,a=rotl(a,10),r,e[14],1859775393,6),r=fn3(r,n,i,o=rotl(o,10),a,e[4],1859775393,7),a=fn3(a,r,n,i=rotl(i,10),o,e[9],1859775393,14),o=fn3(o,a,r,n=rotl(n,10),i,e[15],1859775393,9),i=fn3(i,o,a,r=rotl(r,10),n,e[8],1859775393,13),n=fn3(n,i,o,a=rotl(a,10),r,e[1],1859775393,15),r=fn3(r,n,i,o=rotl(o,10),a,e[2],1859775393,14),a=fn3(a,r,n,i=rotl(i,10),o,e[7],1859775393,8),o=fn3(o,a,r,n=rotl(n,10),i,e[0],1859775393,13),i=fn3(i,o,a,r=rotl(r,10),n,e[6],1859775393,6),n=fn3(n,i,o,a=rotl(a,10),r,e[13],1859775393,5),r=fn3(r,n,i,o=rotl(o,10),a,e[11],1859775393,12),a=fn3(a,r,n,i=rotl(i,10),o,e[5],1859775393,7),i=fn4(i,o=fn3(o,a,r,n=rotl(n,10),i,e[12],1859775393,5),a,r=rotl(r,10),n,e[1],2400959708,11),n=fn4(n,i,o,a=rotl(a,10),r,e[9],2400959708,12),r=fn4(r,n,i,o=rotl(o,10),a,e[11],2400959708,14),a=fn4(a,r,n,i=rotl(i,10),o,e[10],2400959708,15),o=fn4(o,a,r,n=rotl(n,10),i,e[0],2400959708,14),i=fn4(i,o,a,r=rotl(r,10),n,e[8],2400959708,15),n=fn4(n,i,o,a=rotl(a,10),r,e[12],2400959708,9),r=fn4(r,n,i,o=rotl(o,10),a,e[4],2400959708,8),a=fn4(a,r,n,i=rotl(i,10),o,e[13],2400959708,9),o=fn4(o,a,r,n=rotl(n,10),i,e[3],2400959708,14),i=fn4(i,o,a,r=rotl(r,10),n,e[7],2400959708,5),n=fn4(n,i,o,a=rotl(a,10),r,e[15],2400959708,6),r=fn4(r,n,i,o=rotl(o,10),a,e[14],2400959708,8),a=fn4(a,r,n,i=rotl(i,10),o,e[5],2400959708,6),o=fn4(o,a,r,n=rotl(n,10),i,e[6],2400959708,5),n=fn5(n,i=fn4(i,o,a,r=rotl(r,10),n,e[2],2400959708,12),o,a=rotl(a,10),r,e[4],2840853838,9),r=fn5(r,n,i,o=rotl(o,10),a,e[0],2840853838,15),a=fn5(a,r,n,i=rotl(i,10),o,e[5],2840853838,5),o=fn5(o,a,r,n=rotl(n,10),i,e[9],2840853838,11),i=fn5(i,o,a,r=rotl(r,10),n,e[7],2840853838,6),n=fn5(n,i,o,a=rotl(a,10),r,e[12],2840853838,8),r=fn5(r,n,i,o=rotl(o,10),a,e[2],2840853838,13),a=fn5(a,r,n,i=rotl(i,10),o,e[10],2840853838,12),o=fn5(o,a,r,n=rotl(n,10),i,e[14],2840853838,5),i=fn5(i,o,a,r=rotl(r,10),n,e[1],2840853838,12),n=fn5(n,i,o,a=rotl(a,10),r,e[3],2840853838,13),r=fn5(r,n,i,o=rotl(o,10),a,e[8],2840853838,14),a=fn5(a,r,n,i=rotl(i,10),o,e[11],2840853838,11),o=fn5(o,a,r,n=rotl(n,10),i,e[6],2840853838,8),i=fn5(i,o,a,r=rotl(r,10),n,e[15],2840853838,5),n=fn5(n,i,o,a=rotl(a,10),r,e[13],2840853838,6),o=rotl(o,10);var s=this._a,u=this._b,c=this._c,f=this._d,l=this._e;s=fn5(s,u,c,f,l,e[5],1352829926,8),l=fn5(l,s,u,c=rotl(c,10),f,e[14],1352829926,9),f=fn5(f,l,s,u=rotl(u,10),c,e[7],1352829926,9),c=fn5(c,f,l,s=rotl(s,10),u,e[0],1352829926,11),u=fn5(u,c,f,l=rotl(l,10),s,e[9],1352829926,13),s=fn5(s,u,c,f=rotl(f,10),l,e[2],1352829926,15),l=fn5(l,s,u,c=rotl(c,10),f,e[11],1352829926,15),f=fn5(f,l,s,u=rotl(u,10),c,e[4],1352829926,5),c=fn5(c,f,l,s=rotl(s,10),u,e[13],1352829926,7),u=fn5(u,c,f,l=rotl(l,10),s,e[6],1352829926,7),s=fn5(s,u,c,f=rotl(f,10),l,e[15],1352829926,8),l=fn5(l,s,u,c=rotl(c,10),f,e[8],1352829926,11),f=fn5(f,l,s,u=rotl(u,10),c,e[1],1352829926,14),c=fn5(c,f,l,s=rotl(s,10),u,e[10],1352829926,14),u=fn5(u,c,f,l=rotl(l,10),s,e[3],1352829926,12),l=fn4(l,s=fn5(s,u,c,f=rotl(f,10),l,e[12],1352829926,6),u,c=rotl(c,10),f,e[6],1548603684,9),f=fn4(f,l,s,u=rotl(u,10),c,e[11],1548603684,13),c=fn4(c,f,l,s=rotl(s,10),u,e[3],1548603684,15),u=fn4(u,c,f,l=rotl(l,10),s,e[7],1548603684,7),s=fn4(s,u,c,f=rotl(f,10),l,e[0],1548603684,12),l=fn4(l,s,u,c=rotl(c,10),f,e[13],1548603684,8),f=fn4(f,l,s,u=rotl(u,10),c,e[5],1548603684,9),c=fn4(c,f,l,s=rotl(s,10),u,e[10],1548603684,11),u=fn4(u,c,f,l=rotl(l,10),s,e[14],1548603684,7),s=fn4(s,u,c,f=rotl(f,10),l,e[15],1548603684,7),l=fn4(l,s,u,c=rotl(c,10),f,e[8],1548603684,12),f=fn4(f,l,s,u=rotl(u,10),c,e[12],1548603684,7),c=fn4(c,f,l,s=rotl(s,10),u,e[4],1548603684,6),u=fn4(u,c,f,l=rotl(l,10),s,e[9],1548603684,15),s=fn4(s,u,c,f=rotl(f,10),l,e[1],1548603684,13),f=fn3(f,l=fn4(l,s,u,c=rotl(c,10),f,e[2],1548603684,11),s,u=rotl(u,10),c,e[15],1836072691,9),c=fn3(c,f,l,s=rotl(s,10),u,e[5],1836072691,7),u=fn3(u,c,f,l=rotl(l,10),s,e[1],1836072691,15),s=fn3(s,u,c,f=rotl(f,10),l,e[3],1836072691,11),l=fn3(l,s,u,c=rotl(c,10),f,e[7],1836072691,8),f=fn3(f,l,s,u=rotl(u,10),c,e[14],1836072691,6),c=fn3(c,f,l,s=rotl(s,10),u,e[6],1836072691,6),u=fn3(u,c,f,l=rotl(l,10),s,e[9],1836072691,14),s=fn3(s,u,c,f=rotl(f,10),l,e[11],1836072691,12),l=fn3(l,s,u,c=rotl(c,10),f,e[8],1836072691,13),f=fn3(f,l,s,u=rotl(u,10),c,e[12],1836072691,5),c=fn3(c,f,l,s=rotl(s,10),u,e[2],1836072691,14),u=fn3(u,c,f,l=rotl(l,10),s,e[10],1836072691,13),s=fn3(s,u,c,f=rotl(f,10),l,e[0],1836072691,13),l=fn3(l,s,u,c=rotl(c,10),f,e[4],1836072691,7),c=fn2(c,f=fn3(f,l,s,u=rotl(u,10),c,e[13],1836072691,5),l,s=rotl(s,10),u,e[8],2053994217,15),u=fn2(u,c,f,l=rotl(l,10),s,e[6],2053994217,5),s=fn2(s,u,c,f=rotl(f,10),l,e[4],2053994217,8),l=fn2(l,s,u,c=rotl(c,10),f,e[1],2053994217,11),f=fn2(f,l,s,u=rotl(u,10),c,e[3],2053994217,14),c=fn2(c,f,l,s=rotl(s,10),u,e[11],2053994217,14),u=fn2(u,c,f,l=rotl(l,10),s,e[15],2053994217,6),s=fn2(s,u,c,f=rotl(f,10),l,e[0],2053994217,14),l=fn2(l,s,u,c=rotl(c,10),f,e[5],2053994217,6),f=fn2(f,l,s,u=rotl(u,10),c,e[12],2053994217,9),c=fn2(c,f,l,s=rotl(s,10),u,e[2],2053994217,12),u=fn2(u,c,f,l=rotl(l,10),s,e[13],2053994217,9),s=fn2(s,u,c,f=rotl(f,10),l,e[9],2053994217,12),l=fn2(l,s,u,c=rotl(c,10),f,e[7],2053994217,5),f=fn2(f,l,s,u=rotl(u,10),c,e[10],2053994217,15),u=fn1(u,c=fn2(c,f,l,s=rotl(s,10),u,e[14],2053994217,8),f,l=rotl(l,10),s,e[12],0,8),s=fn1(s,u,c,f=rotl(f,10),l,e[15],0,5),l=fn1(l,s,u,c=rotl(c,10),f,e[10],0,12),f=fn1(f,l,s,u=rotl(u,10),c,e[4],0,9),c=fn1(c,f,l,s=rotl(s,10),u,e[1],0,12),u=fn1(u,c,f,l=rotl(l,10),s,e[5],0,5),s=fn1(s,u,c,f=rotl(f,10),l,e[8],0,14),l=fn1(l,s,u,c=rotl(c,10),f,e[7],0,6),f=fn1(f,l,s,u=rotl(u,10),c,e[6],0,8),c=fn1(c,f,l,s=rotl(s,10),u,e[2],0,13),u=fn1(u,c,f,l=rotl(l,10),s,e[13],0,6),s=fn1(s,u,c,f=rotl(f,10),l,e[14],0,5),l=fn1(l,s,u,c=rotl(c,10),f,e[0],0,15),f=fn1(f,l,s,u=rotl(u,10),c,e[3],0,13),c=fn1(c,f,l,s=rotl(s,10),u,e[9],0,11),u=fn1(u,c,f,l=rotl(l,10),s,e[11],0,11),f=rotl(f,10);var h=this._b+i+f|0;this._b=this._c+o+l|0,this._c=this._d+a+s|0,this._d=this._e+r+u|0,this._e=this._a+n+c|0,this._a=h},RIPEMD160.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=new Buffer(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e};var ripemd160=RIPEMD160,safeBuffer=createCommonjsModule(function(e,t){var r=bufferEs6.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function i(e,t,n){return r(e,t,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=bufferEs6:(n(bufferEs6,t),t.Buffer=i),n(r,i),i.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,n)},i.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=r(e);return void 0!==t?"string"==typeof n?i.fill(t,n):i.fill(t):i.fill(0),i},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return bufferEs6.SlowBuffer(e)}}),safeBuffer_1=safeBuffer.Buffer,Buffer$1=safeBuffer.Buffer;function Hash(e,t){this._block=Buffer$1.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Hash.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=Buffer$1.from(e,t));for(var r=this._block,n=this._blockSize,i=e.length,o=this._len,a=0;a<i;){for(var s=o%n,u=Math.min(i-a,n-s),c=0;c<u;c++)r[s+c]=e[a+c];a+=u,(o+=u)%n==0&&this._update(r)}return this._len+=i,this},Hash.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var hash=Hash,Buffer$2=safeBuffer.Buffer,K=[1518500249,1859775393,-1894007588,-899497514],W=new Array(80);function Sha(){this.init(),this._w=W,hash.call(this,64,56)}function rotl5(e){return e<<5|e>>>27}function rotl30(e){return e<<30|e>>>2}function ft(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}inherits_browser(Sha,hash),Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,a=0|this._e,s=0;s<16;++s)t[s]=e.readInt32BE(4*s);for(;s<80;++s)t[s]=t[s-3]^t[s-8]^t[s-14]^t[s-16];for(var u=0;u<80;++u){var c=~~(u/20),f=rotl5(r)+ft(c,n,i,o)+a+t[u]+K[c]|0;a=o,o=i,i=rotl30(n),n=r,r=f}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0},Sha.prototype._hash=function(){var e=Buffer$2.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var sha=Sha,Buffer$3=safeBuffer.Buffer,K$1=[1518500249,1859775393,-1894007588,-899497514],W$1=new Array(80);function Sha1(){this.init(),this._w=W$1,hash.call(this,64,56)}function rotl1(e){return e<<1|e>>>31}function rotl5$1(e){return e<<5|e>>>27}function rotl30$1(e){return e<<30|e>>>2}function ft$1(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}inherits_browser(Sha1,hash),Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha1.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,a=0|this._e,s=0;s<16;++s)t[s]=e.readInt32BE(4*s);for(;s<80;++s)t[s]=rotl1(t[s-3]^t[s-8]^t[s-14]^t[s-16]);for(var u=0;u<80;++u){var c=~~(u/20),f=rotl5$1(r)+ft$1(c,n,i,o)+a+t[u]+K$1[c]|0;a=o,o=i,i=rotl30$1(n),n=r,r=f}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0},Sha1.prototype._hash=function(){var e=Buffer$3.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var sha1=Sha1,Buffer$4=safeBuffer.Buffer,K$2=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],W$2=new Array(64);function Sha256(){this.init(),this._w=W$2,hash.call(this,64,56)}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}inherits_browser(Sha256,hash),Sha256.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},Sha256.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,a=0|this._e,s=0|this._f,u=0|this._g,c=0|this._h,f=0;f<16;++f)t[f]=e.readInt32BE(4*f);for(;f<64;++f)t[f]=gamma1(t[f-2])+t[f-7]+gamma0(t[f-15])+t[f-16]|0;for(var l=0;l<64;++l){var h=c+sigma1(a)+ch(a,s,u)+K$2[l]+t[l]|0,p=sigma0(r)+maj(r,n,i)|0;c=u,u=s,s=a,a=o+h|0,o=i,i=n,n=r,r=h+p|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0,this._f=s+this._f|0,this._g=u+this._g|0,this._h=c+this._h|0},Sha256.prototype._hash=function(){var e=Buffer$4.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var sha256$1=Sha256,Buffer$5=safeBuffer.Buffer,W$3=new Array(64);function Sha224(){this.init(),this._w=W$3,hash.call(this,64,56)}inherits_browser(Sha224,sha256$1),Sha224.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},Sha224.prototype._hash=function(){var e=Buffer$5.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var sha224=Sha224,Buffer$6=safeBuffer.Buffer,K$3=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],W$4=new Array(160);function Sha512(){this.init(),this._w=W$4,hash.call(this,128,112)}function Ch(e,t,r){return r^e&(t^r)}function maj$1(e,t,r){return e&t|r&(e|t)}function sigma0$1(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function sigma1$1(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<t>>>0?1:0}inherits_browser(Sha512,hash),Sha512.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},Sha512.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,a=0|this._eh,s=0|this._fh,u=0|this._gh,c=0|this._hh,f=0|this._al,l=0|this._bl,h=0|this._cl,p=0|this._dl,d=0|this._el,g=0|this._fl,_=0|this._gl,m=0|this._hl,y=0;y<32;y+=2)t[y]=e.readInt32BE(4*y),t[y+1]=e.readInt32BE(4*y+4);for(;y<160;y+=2){var v=t[y-30],b=t[y-30+1],w=Gamma0(v,b),E=Gamma0l(b,v),O=Gamma1(v=t[y-4],b=t[y-4+1]),S=Gamma1l(b,v),P=t[y-14],T=t[y-14+1],x=t[y-32],I=t[y-32+1],R=E+T|0,C=w+P+getCarry(R,E)|0;C=(C=C+O+getCarry(R=R+S|0,S)|0)+x+getCarry(R=R+I|0,I)|0,t[y]=C,t[y+1]=R}for(var A=0;A<160;A+=2){C=t[A],R=t[A+1];var $=maj$1(r,n,i),k=maj$1(f,l,h),N=sigma0$1(r,f),B=sigma0$1(f,r),j=sigma1$1(a,d),D=sigma1$1(d,a),L=K$3[A],M=K$3[A+1],U=Ch(a,s,u),F=Ch(d,g,_),H=m+D|0,V=c+j+getCarry(H,m)|0;V=(V=(V=V+U+getCarry(H=H+F|0,F)|0)+L+getCarry(H=H+M|0,M)|0)+C+getCarry(H=H+R|0,R)|0;var q=B+k|0,K=N+$+getCarry(q,B)|0;c=u,m=_,u=s,_=g,s=a,g=d,a=o+V+getCarry(d=p+H|0,p)|0,o=i,p=h,i=n,h=l,n=r,l=f,r=V+K+getCarry(f=H+q|0,H)|0}this._al=this._al+f|0,this._bl=this._bl+l|0,this._cl=this._cl+h|0,this._dl=this._dl+p|0,this._el=this._el+d|0,this._fl=this._fl+g|0,this._gl=this._gl+_|0,this._hl=this._hl+m|0,this._ah=this._ah+r+getCarry(this._al,f)|0,this._bh=this._bh+n+getCarry(this._bl,l)|0,this._ch=this._ch+i+getCarry(this._cl,h)|0,this._dh=this._dh+o+getCarry(this._dl,p)|0,this._eh=this._eh+a+getCarry(this._el,d)|0,this._fh=this._fh+s+getCarry(this._fl,g)|0,this._gh=this._gh+u+getCarry(this._gl,_)|0,this._hh=this._hh+c+getCarry(this._hl,m)|0},Sha512.prototype._hash=function(){var e=Buffer$6.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var sha512=Sha512,Buffer$7=safeBuffer.Buffer,W$5=new Array(160);function Sha384(){this.init(),this._w=W$5,hash.call(this,128,112)}inherits_browser(Sha384,sha512),Sha384.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},Sha384.prototype._hash=function(){var e=Buffer$7.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var sha384=Sha384,sha_js=createCommonjsModule(function(e){var t=e.exports=function(e){e=e.toLowerCase();var r=t[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};t.sha=sha,t.sha1=sha1,t.sha224=sha224,t.sha256=sha256$1,t.sha384=sha384,t.sha512=sha512}),Buffer$8=safeBuffer.Buffer,Transform$2=require$$0.Transform,StringDecoder$1=stringDecoder.StringDecoder;function CipherBase(e){Transform$2.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}inherits_browser(CipherBase,Transform$2),CipherBase.prototype.update=function(e,t,r){"string"==typeof e&&(e=Buffer$8.from(e,t));var n=this._update(e);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},CipherBase.prototype.setAutoPadding=function(){},CipherBase.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},CipherBase.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},CipherBase.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},CipherBase.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},CipherBase.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},CipherBase.prototype._finalOrDigest=function(e){var t=this.__final()||Buffer$8.alloc(0);return e&&(t=this._toString(t,e,!0)),t},CipherBase.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new StringDecoder$1(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n};var cipherBase=CipherBase;function HashNoConstructor(e){cipherBase.call(this,"digest"),this._hash=e,this.buffers=[]}function Hash$1(e){cipherBase.call(this,"digest"),this._hash=e}inherits_browser(HashNoConstructor,cipherBase),HashNoConstructor.prototype._update=function(e){this.buffers.push(e)},HashNoConstructor.prototype._final=function(){var e=Buffer.concat(this.buffers),t=this._hash(e);return this.buffers=null,t},inherits_browser(Hash$1,cipherBase),Hash$1.prototype._update=function(e){this._hash.update(e)},Hash$1.prototype._final=function(){return this._hash.digest()};var browser$2=function(e){return"md5"===(e=e.toLowerCase())?new HashNoConstructor(md5):new Hash$1("rmd160"===e||"ripemd160"===e?new ripemd160:sha_js(e))},OP_FALSE=0,OP_0=0,OP_PUSHDATA1=76,OP_PUSHDATA2=77,OP_PUSHDATA4=78,OP_1NEGATE=79,OP_RESERVED=80,OP_1=81,OP_TRUE=81,OP_2=82,OP_3=83,OP_4=84,OP_5=85,OP_6=86,OP_7=87,OP_8=88,OP_9=89,OP_10=90,OP_11=91,OP_12=92,OP_13=93,OP_14=94,OP_15=95,OP_16=96,OP_NOP=97,OP_VER=98,OP_IF=99,OP_NOTIF=100,OP_VERIF=101,OP_VERNOTIF=102,OP_ELSE=103,OP_ENDIF=104,OP_VERIFY=105,OP_RETURN=106,OP_TOALTSTACK=107,OP_FROMALTSTACK=108,OP_2DROP=109,OP_2DUP=110,OP_3DUP=111,OP_2OVER=112,OP_2ROT=113,OP_2SWAP=114,OP_IFDUP=115,OP_DEPTH=116,OP_DROP=117,OP_DUP=118,OP_NIP=119,OP_OVER=120,OP_PICK=121,OP_ROLL=122,OP_ROT=123,OP_SWAP=124,OP_TUCK=125,OP_CAT=126,OP_SUBSTR=127,OP_LEFT=128,OP_RIGHT=129,OP_SIZE=130,OP_INVERT=131,OP_AND=132,OP_OR=133,OP_XOR=134,OP_EQUAL=135,OP_EQUALVERIFY=136,OP_RESERVED1=137,OP_RESERVED2=138,OP_1ADD=139,OP_1SUB=140,OP_2MUL=141,OP_2DIV=142,OP_NEGATE=143,OP_ABS=144,OP_NOT=145,OP_0NOTEQUAL=146,OP_ADD=147,OP_SUB=148,OP_MUL=149,OP_DIV=150,OP_MOD=151,OP_LSHIFT=152,OP_RSHIFT=153,OP_BOOLAND=154,OP_BOOLOR=155,OP_NUMEQUAL=156,OP_NUMEQUALVERIFY=157,OP_NUMNOTEQUAL=158,OP_LESSTHAN=159,OP_GREATERTHAN=160,OP_LESSTHANOREQUAL=161,OP_GREATERTHANOREQUAL=162,OP_MIN=163,OP_MAX=164,OP_WITHIN=165,OP_RIPEMD160=166,OP_SHA1=167,OP_SHA256=168,OP_HASH160=169,OP_HASH256=170,OP_CODESEPARATOR=171,OP_CHECKSIG=172,OP_CHECKSIGVERIFY=173,OP_CHECKMULTISIG=174,OP_CHECKMULTISIGVERIFY=175,OP_NOP1=176,OP_NOP2=177,OP_CHECKLOCKTIMEVERIFY=177,OP_NOP3=178,OP_NOP4=179,OP_NOP5=180,OP_NOP6=181,OP_NOP7=182,OP_NOP8=183,OP_NOP9=184,OP_NOP10=185,OP_PUBKEYHASH=253,OP_PUBKEY=254,OP_INVALIDOPCODE=255,opcodes={OP_FALSE:OP_FALSE,OP_0:OP_0,OP_PUSHDATA1:OP_PUSHDATA1,OP_PUSHDATA2:OP_PUSHDATA2,OP_PUSHDATA4:OP_PUSHDATA4,OP_1NEGATE:OP_1NEGATE,OP_RESERVED:OP_RESERVED,OP_1:OP_1,OP_TRUE:OP_TRUE,OP_2:OP_2,OP_3:OP_3,OP_4:OP_4,OP_5:OP_5,OP_6:OP_6,OP_7:OP_7,OP_8:OP_8,OP_9:OP_9,OP_10:OP_10,OP_11:OP_11,OP_12:OP_12,OP_13:OP_13,OP_14:OP_14,OP_15:OP_15,OP_16:OP_16,OP_NOP:OP_NOP,OP_VER:OP_VER,OP_IF:OP_IF,OP_NOTIF:OP_NOTIF,OP_VERIF:OP_VERIF,OP_VERNOTIF:OP_VERNOTIF,OP_ELSE:OP_ELSE,OP_ENDIF:OP_ENDIF,OP_VERIFY:OP_VERIFY,OP_RETURN:OP_RETURN,OP_TOALTSTACK:OP_TOALTSTACK,OP_FROMALTSTACK:OP_FROMALTSTACK,OP_2DROP:OP_2DROP,OP_2DUP:OP_2DUP,OP_3DUP:OP_3DUP,OP_2OVER:OP_2OVER,OP_2ROT:OP_2ROT,OP_2SWAP:OP_2SWAP,OP_IFDUP:OP_IFDUP,OP_DEPTH:OP_DEPTH,OP_DROP:OP_DROP,OP_DUP:OP_DUP,OP_NIP:OP_NIP,OP_OVER:OP_OVER,OP_PICK:OP_PICK,OP_ROLL:OP_ROLL,OP_ROT:OP_ROT,OP_SWAP:OP_SWAP,OP_TUCK:OP_TUCK,OP_CAT:OP_CAT,OP_SUBSTR:OP_SUBSTR,OP_LEFT:OP_LEFT,OP_RIGHT:OP_RIGHT,OP_SIZE:OP_SIZE,OP_INVERT:OP_INVERT,OP_AND:OP_AND,OP_OR:OP_OR,OP_XOR:OP_XOR,OP_EQUAL:OP_EQUAL,OP_EQUALVERIFY:OP_EQUALVERIFY,OP_RESERVED1:OP_RESERVED1,OP_RESERVED2:OP_RESERVED2,OP_1ADD:OP_1ADD,OP_1SUB:OP_1SUB,OP_2MUL:OP_2MUL,OP_2DIV:OP_2DIV,OP_NEGATE:OP_NEGATE,OP_ABS:OP_ABS,OP_NOT:OP_NOT,OP_0NOTEQUAL:OP_0NOTEQUAL,OP_ADD:OP_ADD,OP_SUB:OP_SUB,OP_MUL:OP_MUL,OP_DIV:OP_DIV,OP_MOD:OP_MOD,OP_LSHIFT:OP_LSHIFT,OP_RSHIFT:OP_RSHIFT,OP_BOOLAND:OP_BOOLAND,OP_BOOLOR:OP_BOOLOR,OP_NUMEQUAL:OP_NUMEQUAL,OP_NUMEQUALVERIFY:OP_NUMEQUALVERIFY,OP_NUMNOTEQUAL:OP_NUMNOTEQUAL,OP_LESSTHAN:OP_LESSTHAN,OP_GREATERTHAN:OP_GREATERTHAN,OP_LESSTHANOREQUAL:OP_LESSTHANOREQUAL,OP_GREATERTHANOREQUAL:OP_GREATERTHANOREQUAL,OP_MIN:OP_MIN,OP_MAX:OP_MAX,OP_WITHIN:OP_WITHIN,OP_RIPEMD160:OP_RIPEMD160,OP_SHA1:OP_SHA1,OP_SHA256:OP_SHA256,OP_HASH160:OP_HASH160,OP_HASH256:OP_HASH256,OP_CODESEPARATOR:OP_CODESEPARATOR,OP_CHECKSIG:OP_CHECKSIG,OP_CHECKSIGVERIFY:OP_CHECKSIGVERIFY,OP_CHECKMULTISIG:OP_CHECKMULTISIG,OP_CHECKMULTISIGVERIFY:OP_CHECKMULTISIGVERIFY,OP_NOP1:OP_NOP1,OP_NOP2:OP_NOP2,OP_CHECKLOCKTIMEVERIFY:OP_CHECKLOCKTIMEVERIFY,OP_NOP3:OP_NOP3,OP_NOP4:OP_NOP4,OP_NOP5:OP_NOP5,OP_NOP6:OP_NOP6,OP_NOP7:OP_NOP7,OP_NOP8:OP_NOP8,OP_NOP9:OP_NOP9,OP_NOP10:OP_NOP10,OP_PUBKEYHASH:OP_PUBKEYHASH,OP_PUBKEY:OP_PUBKEY,OP_INVALIDOPCODE:OP_INVALIDOPCODE},opcodes$1=Object.freeze({OP_FALSE:OP_FALSE,OP_0:OP_0,OP_PUSHDATA1:OP_PUSHDATA1,OP_PUSHDATA2:OP_PUSHDATA2,OP_PUSHDATA4:OP_PUSHDATA4,OP_1NEGATE:OP_1NEGATE,OP_RESERVED:OP_RESERVED,OP_1:OP_1,OP_TRUE:OP_TRUE,OP_2:OP_2,OP_3:OP_3,OP_4:OP_4,OP_5:OP_5,OP_6:OP_6,OP_7:OP_7,OP_8:OP_8,OP_9:OP_9,OP_10:OP_10,OP_11:OP_11,OP_12:OP_12,OP_13:OP_13,OP_14:OP_14,OP_15:OP_15,OP_16:OP_16,OP_NOP:OP_NOP,OP_VER:OP_VER,OP_IF:OP_IF,OP_NOTIF:OP_NOTIF,OP_VERIF:OP_VERIF,OP_VERNOTIF:OP_VERNOTIF,OP_ELSE:OP_ELSE,OP_ENDIF:OP_ENDIF,OP_VERIFY:OP_VERIFY,OP_RETURN:OP_RETURN,OP_TOALTSTACK:OP_TOALTSTACK,OP_FROMALTSTACK:OP_FROMALTSTACK,OP_2DROP:OP_2DROP,OP_2DUP:OP_2DUP,OP_3DUP:OP_3DUP,OP_2OVER:OP_2OVER,OP_2ROT:OP_2ROT,OP_2SWAP:OP_2SWAP,OP_IFDUP:OP_IFDUP,OP_DEPTH:OP_DEPTH,OP_DROP:OP_DROP,OP_DUP:OP_DUP,OP_NIP:OP_NIP,OP_OVER:OP_OVER,OP_PICK:OP_PICK,OP_ROLL:OP_ROLL,OP_ROT:OP_ROT,OP_SWAP:OP_SWAP,OP_TUCK:OP_TUCK,OP_CAT:OP_CAT,OP_SUBSTR:OP_SUBSTR,OP_LEFT:OP_LEFT,OP_RIGHT:OP_RIGHT,OP_SIZE:OP_SIZE,OP_INVERT:OP_INVERT,OP_AND:OP_AND,OP_OR:OP_OR,OP_XOR:OP_XOR,OP_EQUAL:OP_EQUAL,OP_EQUALVERIFY:OP_EQUALVERIFY,OP_RESERVED1:OP_RESERVED1,OP_RESERVED2:OP_RESERVED2,OP_1ADD:OP_1ADD,OP_1SUB:OP_1SUB,OP_2MUL:OP_2MUL,OP_2DIV:OP_2DIV,OP_NEGATE:OP_NEGATE,OP_ABS:OP_ABS,OP_NOT:OP_NOT,OP_0NOTEQUAL:OP_0NOTEQUAL,OP_ADD:OP_ADD,OP_SUB:OP_SUB,OP_MUL:OP_MUL,OP_DIV:OP_DIV,OP_MOD:OP_MOD,OP_LSHIFT:OP_LSHIFT,OP_RSHIFT:OP_RSHIFT,OP_BOOLAND:OP_BOOLAND,OP_BOOLOR:OP_BOOLOR,OP_NUMEQUAL:OP_NUMEQUAL,OP_NUMEQUALVERIFY:OP_NUMEQUALVERIFY,OP_NUMNOTEQUAL:OP_NUMNOTEQUAL,OP_LESSTHAN:OP_LESSTHAN,OP_GREATERTHAN:OP_GREATERTHAN,OP_LESSTHANOREQUAL:OP_LESSTHANOREQUAL,OP_GREATERTHANOREQUAL:OP_GREATERTHANOREQUAL,OP_MIN:OP_MIN,OP_MAX:OP_MAX,OP_WITHIN:OP_WITHIN,OP_RIPEMD160:OP_RIPEMD160,OP_SHA1:OP_SHA1,OP_SHA256:OP_SHA256,OP_HASH160:OP_HASH160,OP_HASH256:OP_HASH256,OP_CODESEPARATOR:OP_CODESEPARATOR,OP_CHECKSIG:OP_CHECKSIG,OP_CHECKSIGVERIFY:OP_CHECKSIGVERIFY,OP_CHECKMULTISIG:OP_CHECKMULTISIG,OP_CHECKMULTISIGVERIFY:OP_CHECKMULTISIGVERIFY,OP_NOP1:OP_NOP1,OP_NOP2:OP_NOP2,OP_CHECKLOCKTIMEVERIFY:OP_CHECKLOCKTIMEVERIFY,OP_NOP3:OP_NOP3,OP_NOP4:OP_NOP4,OP_NOP5:OP_NOP5,OP_NOP6:OP_NOP6,OP_NOP7:OP_NOP7,OP_NOP8:OP_NOP8,OP_NOP9:OP_NOP9,OP_NOP10:OP_NOP10,OP_PUBKEYHASH:OP_PUBKEYHASH,OP_PUBKEY:OP_PUBKEY,OP_INVALIDOPCODE:OP_INVALIDOPCODE,default:opcodes}),bufferEquals=function(e,t){if(!isBuffer(e)||!isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return!0;if("function"==typeof e.equals)return e.equals(t);if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0},bufferReverse=function(e){for(var t=new Buffer(e.length),r=0,n=e.length-1;r<=n;++r,--n)t[r]=e[n],t[n]=e[r];return t},OPS=opcodes$1&&opcodes||opcodes$1;function verifuint(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("value is larger than maximum value for type");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}function pushDataSize(e){return e<OPS.OP_PUSHDATA1?1:e<=255?2:e<=65535?3:5}function readPushDataInt(e,t){var r,n,i=e.readUInt8(t);if(i<OPS.OP_PUSHDATA1)r=i,n=1;else if(i===OPS.OP_PUSHDATA1){if(t+2>e.length)return null;r=e.readUInt8(t+1),n=2}else if(i===OPS.OP_PUSHDATA2){if(t+3>e.length)return null;r=e.readUInt16LE(t+1),n=3}else{if(t+5>e.length)return null;if(i!==OPS.OP_PUSHDATA4)throw new Error("Unexpected opcode");r=e.readUInt32LE(t+1),n=5}return{opcode:i,number:r,size:n}}function readUInt64LE(e,t){var r=e.readUInt32LE(t),n=e.readUInt32LE(t+4);return verifuint((n*=4294967296)+r,9007199254740991),n+r}function readVarInt(e,t){var r,n,i=e.readUInt8(t);return i<253?(r=i,n=1):i<254?(r=e.readUInt16LE(t+1),n=3):i<255?(r=e.readUInt32LE(t+1),n=5):(r=readUInt64LE(e,t+1),n=9),{number:r,size:n}}function writePushDataInt(e,t,r){var n=pushDataSize(t);return 1===n?e.writeUInt8(t,r):2===n?(e.writeUInt8(OPS.OP_PUSHDATA1,r),e.writeUInt8(t,r+1)):3===n?(e.writeUInt8(OPS.OP_PUSHDATA2,r),e.writeUInt16LE(t,r+1)):(e.writeUInt8(OPS.OP_PUSHDATA4,r),e.writeUInt32LE(t,r+1)),n}function writeUInt64LE(e,t,r){verifuint(t,9007199254740991),e.writeInt32LE(-1&t,r),e.writeUInt32LE(Math.floor(t/4294967296),r+4)}function varIntSize(e){return e<253?1:e<65536?3:e<4294967296?5:9}function writeVarInt(e,t,r){var n=varIntSize(t);return 1===n?e.writeUInt8(t,r):3===n?(e.writeUInt8(253,r),e.writeUInt16LE(t,r+1)):5===n?(e.writeUInt8(254,r),e.writeUInt32LE(t,r+1)):(e.writeUInt8(255,r),writeUInt64LE(e,t,r+1)),n}function varIntBuffer(e){var t=new Buffer(varIntSize(e));return writeVarInt(t,e,0),t}var bufferutils={equal:bufferEquals,pushDataSize:pushDataSize,readPushDataInt:readPushDataInt,readUInt64LE:readUInt64LE,readVarInt:readVarInt,reverse:bufferReverse,varIntBuffer:varIntBuffer,varIntSize:varIntSize,writePushDataInt:writePushDataInt,writeUInt64LE:writeUInt64LE,writeVarInt:writeVarInt};function hash160(e){return ripemd160$1(sha256$2(e))}function hash256(e){return sha256$2(sha256$2(e))}function ripemd160$1(e){return browser$2("rmd160").update(e).digest()}function sha1$1(e){return browser$2("sha1").update(e).digest()}function sha256$2(e){return browser$2("sha256").update(e).digest()}var crypto={hash160:hash160,hash256:hash256,ripemd160:ripemd160$1,sha1:sha1$1,sha256:sha256$2},Buffer$9=safeBuffer.Buffer;function check$1(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;var t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;var r=e[5+t];return 0!==r&&(6+t+r===e.length&&(!(128&e[4])&&(!(t>1&&0===e[4]&&!(128&e[5]))&&(!(128&e[t+6])&&!(r>1&&0===e[t+6]&&!(128&e[t+7]))))))}function decode$1(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");var t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");var r=e[5+t];if(0===r)throw new Error("S length is zero");if(6+t+r!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(r>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}}function encode$1(e,t){var r=e.length,n=t.length;if(0===r)throw new Error("R length is zero");if(0===n)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(n>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&t[0])throw new Error("S value is negative");if(r>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(n>1&&0===t[0]&&!(128&t[1]))throw new Error("S value excessively padded");var i=Buffer$9.allocUnsafe(6+r+n);return i[0]=48,i[1]=i.length-2,i[2]=2,i[3]=e.length,e.copy(i,4),i[4+r]=2,i[5+r]=t.length,t.copy(i,6+r),i}var bip66={check:check$1,decode:decode$1,encode:encode$1},types={Array:function(e){return null!=e&&e.constructor===Array},Boolean:function(e){return"boolean"==typeof e},Function:function(e){return"function"==typeof e},Nil:function(e){return null==e},Number:function(e){return"number"==typeof e},Object:function(e){return"object"==typeof e},String:function(e){return"string"==typeof e},"":function(){return!0}};for(var typeName in types.Null=types.Nil,types)types[typeName].toJSON=function(e){return e}.bind(null,typeName);var native_1=types;function getTypeName(e){return e.name||e.toString().match(/function (.*?)\s*\(/)[1]}function getValueTypeName(e){return native_1.Nil(e)?"":getTypeName(e.constructor)}function getValue(e){return native_1.Function(e)?"":native_1.String(e)?JSON.stringify(e):e&&native_1.Object(e)?"":e}function tfJSON(e){return native_1.Function(e)?e.toJSON?e.toJSON():getTypeName(e):native_1.Array(e)?"Array":e&&native_1.Object(e)?"Object":void 0!==e?e:""}function tfErrorString(e,t,r){var n=getValue(t);return"Expected "+tfJSON(e)+", got"+(""!==r?" "+r:"")+(""!==n?" "+n:"")}function TfTypeError(e,t,r){r=r||getValueTypeName(t),this.message=tfErrorString(e,t,r),Error.captureStackTrace(this,TfTypeError),this.__type=e,this.__value=t,this.__valueTypeName=r}function tfPropertyErrorString(e,t,r,n,i){var o='" of type ';return"key"===t&&(o='" with key type '),tfErrorString('property "'+tfJSON(r)+o+tfJSON(e),n,i)}function TfPropertyTypeError(e,t,r,n,i){e?(i=i||getValueTypeName(n),this.message=tfPropertyErrorString(e,r,t,n,i)):this.message='Unexpected property "'+t+'"',Error.captureStackTrace(this,TfTypeError),this.__label=r,this.__property=t,this.__type=e,this.__value=n,this.__valueTypeName=i}function tfCustomError(e,t){return new TfTypeError(e,{},t)}function tfSubError(e,t,r){return e instanceof TfPropertyTypeError?(t=t+"."+e.__property,e=new TfPropertyTypeError(e.__type,t,e.__label,e.__value,e.__valueTypeName)):e instanceof TfTypeError&&(e=new TfPropertyTypeError(e.__type,t,r,e.__value,e.__valueTypeName)),Error.captureStackTrace(e),e}TfTypeError.prototype=Object.create(Error.prototype),TfTypeError.prototype.constructor=TfTypeError,TfPropertyTypeError.prototype=Object.create(Error.prototype),TfPropertyTypeError.prototype.constructor=TfTypeError;var errors$1={TfTypeError:TfTypeError,TfPropertyTypeError:TfPropertyTypeError,tfCustomError:tfCustomError,tfSubError:tfSubError,tfJSON:tfJSON,getValueTypeName:getValueTypeName};function _Buffer(e){return isBuffer(e)}function Hex(e){return"string"==typeof e&&/^([0-9a-f]{2})+$/i.test(e)}function _LengthN(e,t){var r=e.toJSON();function n(n){if(!e(n))return!1;if(n.length===t)return!0;throw errors$1.tfCustomError(r+"(Length: "+t+")",r+"(Length: "+n.length+")")}return n.toJSON=function(){return r},n}var _ArrayN=_LengthN.bind(null,native_1.Array),_BufferN=_LengthN.bind(null,_Buffer),_HexN=_LengthN.bind(null,Hex),_StringN=_LengthN.bind(null,native_1.String),UINT53_MAX=Math.pow(2,53)-1;function Finite(e){return"number"==typeof e&&isFinite(e)}function Int8(e){return e<<24>>24===e}function Int16(e){return e<<16>>16===e}function Int32(e){return(0|e)===e}function UInt8(e){return(255&e)===e}function UInt16(e){return(65535&e)===e}function UInt32(e){return e>>>0===e}function UInt53(e){return"number"==typeof e&&e>=0&&e<=UINT53_MAX&&Math.floor(e)===e}var types$1={ArrayN:_ArrayN,Buffer:_Buffer,BufferN:_BufferN,Finite:Finite,Hex:Hex,HexN:_HexN,Int8:Int8,Int16:Int16,Int32:Int32,StringN:_StringN,UInt8:UInt8,UInt16:UInt16,UInt32:UInt32,UInt53:UInt53};for(var typeName$1 in types$1)types$1[typeName$1].toJSON=function(e){return e}.bind(null,typeName$1);var extra=types$1,tfJSON$1=errors$1.tfJSON,TfTypeError$1=errors$1.TfTypeError,TfPropertyTypeError$1=errors$1.TfPropertyTypeError,tfSubError$1=errors$1.tfSubError,getValueTypeName$1=errors$1.getValueTypeName,TYPES={arrayOf:function(e){function t(t,r){return!!native_1.Array(t)&&(!native_1.Nil(t)&&t.every(function(t,n){try{return typeforce(e,t,r)}catch(e){throw tfSubError$1(e,n)}}))}return e=compile(e),t.toJSON=function(){return"["+tfJSON$1(e)+"]"},t},maybe:function e(t){function r(r,n){return native_1.Nil(r)||t(r,n,e)}return t=compile(t),r.toJSON=function(){return"?"+tfJSON$1(t)},r},map:function(e,t){function r(r,n){if(!native_1.Object(r))return!1;if(native_1.Nil(r))return!1;for(var i in r){try{t&&typeforce(t,i,n)}catch(e){throw tfSubError$1(e,i,"key")}try{var o=r[i];typeforce(e,o,n)}catch(e){throw tfSubError$1(e,i)}}return!0}return e=compile(e),t&&(t=compile(t)),r.toJSON=t?function(){return"{"+tfJSON$1(t)+": "+tfJSON$1(e)+"}"}:function(){return"{"+tfJSON$1(e)+"}"},r},object:function(e){var t={};for(var r in e)t[r]=compile(e[r]);function n(e,r){if(!native_1.Object(e))return!1;if(native_1.Nil(e))return!1;var n;try{for(n in t){typeforce(t[n],e[n],r)}}catch(e){throw tfSubError$1(e,n)}if(r)for(n in e)if(!t[n])throw new TfPropertyTypeError$1(void 0,n);return!0}return n.toJSON=function(){return tfJSON$1(t)},n},oneOf:function(){var e=[].slice.call(arguments).map(compile);function t(t,r){return e.some(function(e){try{return typeforce(e,t,r)}catch(e){return!1}})}return t.toJSON=function(){return e.map(tfJSON$1).join("|")},t},quacksLike:function(e){function t(t){return e===getValueTypeName$1(t)}return t.toJSON=function(){return e},t},tuple:function(){var e=[].slice.call(arguments).map(compile);function t(t,r){return!native_1.Nil(t)&&(!native_1.Nil(t.length)&&((!r||t.length===e.length)&&e.every(function(e,n){try{return typeforce(e,t[n],r)}catch(e){throw tfSubError$1(e,n)}})))}return t.toJSON=function(){return"("+e.map(tfJSON$1).join(", ")+")"},t},value:function(e){function t(t){return t===e}return t.toJSON=function(){return e},t}};function compile(e){return native_1.String(e)?"?"===e[0]?TYPES.maybe(e.slice(1)):native_1[e]||TYPES.quacksLike(e):e&&native_1.Object(e)?native_1.Array(e)?TYPES.arrayOf(e[0]):TYPES.object(e):native_1.Function(e)?e:TYPES.value(e)}function typeforce(e,t,r,n){if(native_1.Function(e)){if(e(t,r))return!0;throw new TfTypeError$1(n||e,t)}return typeforce(compile(e),t,r)}for(var typeName$2 in native_1)typeforce[typeName$2]=native_1[typeName$2];for(typeName$2 in TYPES)typeforce[typeName$2]=TYPES[typeName$2];for(typeName$2 in extra)typeforce[typeName$2]=extra[typeName$2];function __async(e,t,r,n){if("function"==typeof r)return __async(e,t,!1,r);try{typeforce(e,t,r)}catch(e){return n(e)}n()}typeforce.async=__async,typeforce.compile=compile,typeforce.TfTypeError=TfTypeError$1,typeforce.TfPropertyTypeError=TfPropertyTypeError$1;var typeforce_1=typeforce;function nBuffer(e,t){if(typeforce_1(types$2.Buffer,e),e.length!==t)throw new typeforce_1.TfTypeError("Expected "+8*t+"-bit Buffer, got "+8*e.length+"-bit Buffer");return!0}function Hash160bit(e){return nBuffer(e,20)}function Hash256bit(e){return nBuffer(e,32)}function Buffer256bit(e){return nBuffer(e,32)}var UINT53_MAX$1=Math.pow(2,53)-1,UINT31_MAX=Math.pow(2,31)-1;function UInt2(e){return(3&e)===e}function UInt8$1(e){return(255&e)===e}function UInt32$1(e){return e>>>0===e}function UInt31(e){return UInt32$1(e)&&e<=UINT31_MAX}function UInt53$1(e){return typeforce_1.Number(e)&&e>=0&&e<=UINT53_MAX$1&&Math.floor(e)===e}function Bip32Path(e){return typeforce_1.String(e)&&e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}var BigInt=typeforce_1.quacksLike("BigInteger"),ECPoint=typeforce_1.quacksLike("Point"),ECSignature=typeforce_1.compile({r:BigInt,s:BigInt}),Network=typeforce_1.compile({messagePrefix:typeforce_1.oneOf(typeforce_1.Buffer,typeforce_1.String),bip32:{public:UInt32$1,private:UInt32$1},pubKeyHash:UInt8$1,scriptHash:UInt8$1,wif:UInt8$1,dustThreshold:UInt53$1}),types$2={BigInt:BigInt,Buffer256bit:Buffer256bit,ECPoint:ECPoint,ECSignature:ECSignature,Hash160bit:Hash160bit,Hash256bit:Hash256bit,Network:Network,UInt2:UInt2,UInt8:UInt8$1,UInt31:UInt31,UInt32:UInt32$1,UInt53:UInt53$1,Bip32Path:Bip32Path};for(var typeName$3 in typeforce_1)types$2[typeName$3]=typeforce_1[typeName$3];var types_1=types$2;function decode$2(e,t,r){t=t||4,r=void 0===r||r;var n=e.length;if(0===n)return 0;if(n>t)throw new TypeError("Script number overflow");if(r&&0==(127&e[n-1])&&(n<=1||0==(128&e[n-2])))throw new Error("Non-minimally encoded script number");if(5===n){var i=e.readUInt32LE(0),o=e.readUInt8(4);return 128&o?-(4294967296*(-129&o)+i):4294967296*o+i}for(var a=0,s=0;s<n;++s)a|=e[s]<<8*s;return 128&e[n-1]?-(a&~(128<<8*(n-1))):a}function scriptNumSize(e){return e>2147483647?5:e>8388607?4:e>32767?3:e>127?2:e>0?1:0}function encode$2(e){for(var t=Math.abs(e),r=scriptNumSize(t),n=new Buffer(r),i=e<0,o=0;o<r;++o)n.writeUInt8(255&t,o),t>>=8;return 128&n[r-1]?n.writeUInt8(i?128:0,r-1):i&&(n[r-1]|=128),n}var script_number={decode:decode$2,encode:encode$2},REVERSE_OPS=function(){var e={};for(var t in OPS){e[OPS[t]]=t}return e}(),OP_INT_BASE=OPS.OP_RESERVED;function toASM(e){return isBuffer(e)&&(e=decompile(e)),e.map(function(e){return isBuffer(e)?e.toString("hex"):REVERSE_OPS[e]}).join(" ")}function fromASM(e){return typeforce_1(types_1.String,e),compile$1(e.split(" ").map(function(e){return void 0!==OPS[e]?OPS[e]:new Buffer(e,"hex")}))}function compile$1(e){if(isBuffer(e))return e;typeforce_1(types_1.Array,e);var t=new Buffer(e.reduce(function(e,t){return isBuffer(t)?e+bufferutils.pushDataSize(t.length)+t.length:e+1},0)),r=0;if(e.forEach(function(e){isBuffer(e)?(r+=bufferutils.writePushDataInt(t,e.length,r),e.copy(t,r),r+=e.length):(t.writeUInt8(e,r),r+=1)}),r!==t.length)throw new Error("Could not decode chunks");return t}function decompile(e){if(types_1.Array(e))return e;typeforce_1(types_1.Buffer,e);for(var t=[],r=0;r<e.length;){var n=e[r];if(n>OPS.OP_0&&n<=OPS.OP_PUSHDATA4){var i=bufferutils.readPushDataInt(e,r);if(null===i)return[];if((r+=i.size)+i.number>e.length)return[];var o=e.slice(r,r+i.number);r+=i.number,t.push(o)}else t.push(n),r+=1}return t}function isCanonicalPubKey(e){if(!isBuffer(e))return!1;if(e.length<33)return!1;switch(e[0]){case 2:case 3:return 33===e.length;case 4:return 65===e.length}return!1}function isCanonicalSignature(e){return!!isBuffer(e)&&(!!isDefinedHashType(e[e.length-1])&&bip66.check(e.slice(0,-1)))}function isDefinedHashType(e){var t=-129&e;return t>0&&t<4}function isPubKeyHashInput(e){var t=decompile(e);return 2===t.length&&isCanonicalSignature(t[0])&&isCanonicalPubKey(t[1])}function isPubKeyHashOutput(e){var t=compile$1(e);return 25===t.length&&t[0]===OPS.OP_DUP&&t[1]===OPS.OP_HASH160&&20===t[2]&&t[23]===OPS.OP_EQUALVERIFY&&t[24]===OPS.OP_CHECKSIG}function isPubKeyInput(e){var t=decompile(e);return 1===t.length&&isCanonicalSignature(t[0])}function isPubKeyOutput(e){var t=decompile(e);return 2===t.length&&isCanonicalPubKey(t[0])&&t[1]===OPS.OP_CHECKSIG}function isScriptHashInput(e,t){var r=decompile(e);if(r.length<2)return!1;var n=r[r.length-1];if(!isBuffer(n))return!1;var i=r.slice(0,-1),o=decompile(n);return 0!==o.length&&classifyInput(i,t)===classifyOutput(o)}function isScriptHashOutput(e){var t=compile$1(e);return 23===t.length&&t[0]===OPS.OP_HASH160&&20===t[1]&&t[22]===OPS.OP_EQUAL}function isWitnessPubKeyHashOutput(e){var t=compile$1(e);return 22===t.length&&t[0]===OPS.OP_0&&20===t[1]}function isWitnessScriptHashOutput(e){var t=compile$1(e);return 34===t.length&&t[0]===OPS.OP_0&&32===t[1]}function isMultisigInput(e,t){var r=decompile(e);return!(r.length<2)&&(r[0]===OPS.OP_0&&(t?r.slice(1).every(function(e){return e===OPS.OP_0||isCanonicalSignature(e)}):r.slice(1).every(isCanonicalSignature)))}function isMultisigOutput(e){var t=decompile(e);if(t.length<4)return!1;if(t[t.length-1]!==OPS.OP_CHECKMULTISIG)return!1;var r=t[0],n=t[t.length-2];if(!types_1.Number(r))return!1;if(!types_1.Number(n))return!1;var i=r-OP_INT_BASE,o=n-OP_INT_BASE;return!(i<=0)&&(!(i>o)&&(!(o>16)&&(o===t.length-3&&t.slice(1,-2).every(isCanonicalPubKey))))}function isNullDataOutput(e){return decompile(e)[0]===OPS.OP_RETURN}function classifyOutput(e){var t=decompile(e);return isWitnessPubKeyHashOutput(t)?"witnesspubkeyhash":isWitnessScriptHashOutput(t)?"witnessscripthash":isPubKeyHashOutput(t)?"pubkeyhash":isScriptHashOutput(t)?"scripthash":isMultisigOutput(t)?"multisig":isPubKeyOutput(t)?"pubkey":isNullDataOutput(t)?"nulldata":"nonstandard"}function classifyInput(e,t){var r=decompile(e);return isPubKeyHashInput(r)?"pubkeyhash":isMultisigInput(r,t)?"multisig":isScriptHashInput(r,t)?"scripthash":isPubKeyInput(r)?"pubkey":"nonstandard"}function pubKeyOutput(e){return compile$1([e,OPS.OP_CHECKSIG])}function pubKeyHashOutput(e){return typeforce_1(types_1.Hash160bit,e),compile$1([OPS.OP_DUP,OPS.OP_HASH160,e,OPS.OP_EQUALVERIFY,OPS.OP_CHECKSIG])}function scriptHashOutput(e){return typeforce_1(types_1.Hash160bit,e),compile$1([OPS.OP_HASH160,e,OPS.OP_EQUAL])}function multisigOutput(e,t){typeforce_1(types_1.tuple(types_1.Number,[types_1.Buffer]),arguments);var r=t.length;if(r<e)throw new Error("Not enough pubKeys provided");return compile$1([].concat(OP_INT_BASE+e,t,OP_INT_BASE+r,OPS.OP_CHECKMULTISIG))}function witnessPubKeyHashOutput(e){return typeforce_1(types_1.Hash160bit,e),compile$1([OPS.OP_0,e])}function witnessScriptHashOutput(e){return typeforce_1(types_1.Hash256bit,e),compile$1([OPS.OP_0,e])}function pubKeyInput(e){return typeforce_1(types_1.Buffer,e),compile$1([e])}function pubKeyHashInput(e,t){return typeforce_1(types_1.tuple(types_1.Buffer,types_1.Buffer),arguments),compile$1([e,t])}function scriptHashInput(e,t){var r=decompile(e),n=compile$1(t);return compile$1([].concat(r,n))}function witnessScriptHashInput(e,t){return scriptHashInput(e,t)}function multisigInput(e,t){if(t){var r=decompile(t);if(!isMultisigOutput(r))throw new Error("Expected multisig scriptPubKey");var n=r[0],i=r[r.length-2],o=n-OP_INT_BASE,a=i-OP_INT_BASE;if(e.length<o)throw new Error("Not enough signatures provided");if(e.length>a)throw new Error("Too many signatures provided")}return compile$1([].concat(OPS.OP_0,e))}function nullDataOutput(e){return compile$1([OPS.OP_RETURN,e])}var script={compile:compile$1,decompile:decompile,fromASM:fromASM,toASM:toASM,number:script_number,isCanonicalPubKey:isCanonicalPubKey,isCanonicalSignature:isCanonicalSignature,isDefinedHashType:isDefinedHashType,isPubKeyHashInput:isPubKeyHashInput,isPubKeyHashOutput:isPubKeyHashOutput,isPubKeyInput:isPubKeyInput,isPubKeyOutput:isPubKeyOutput,isScriptHashInput:isScriptHashInput,isScriptHashOutput:isScriptHashOutput,isWitnessPubKeyHashOutput:isWitnessPubKeyHashOutput,isWitnessScriptHashOutput:isWitnessScriptHashOutput,isMultisigInput:isMultisigInput,isMultisigOutput:isMultisigOutput,isNullDataOutput:isNullDataOutput,classifyOutput:classifyOutput,classifyInput:classifyInput,pubKeyOutput:pubKeyOutput,pubKeyHashOutput:pubKeyHashOutput,scriptHashOutput:scriptHashOutput,witnessPubKeyHashOutput:witnessPubKeyHashOutput,witnessScriptHashInput:witnessScriptHashInput,witnessScriptHashOutput:witnessScriptHashOutput,multisigOutput:multisigOutput,pubKeyInput:pubKeyInput,pubKeyHashInput:pubKeyHashInput,scriptHashInput:scriptHashInput,multisigInput:multisigInput,nullDataOutput:nullDataOutput},EMPTY_SCRIPT=new Buffer(0),ONE=new Buffer("0000000000000000000000000000000000000000000000000000000000000001","hex"),VALUE_UINT64_MAX=new Buffer("ffffffffffffffff","hex"),baseX=function(e){for(var t={},r=e.length,n=e.charAt(0),i=0;i<e.length;i++)t[e.charAt(i)]=i;function o(e){if(0===e.length)return[];for(var i=[0],o=0;o<e.length;o++){var a=t[e[o]];if(void 0===a)return;for(var s=0,u=a;s<i.length;++s)u+=i[s]*r,i[s]=255&u,u>>=8;for(;u>0;)i.push(255&u),u>>=8}for(var c=0;e[c]===n&&c<e.length-1;++c)i.push(0);return i.reverse()}return{encode:function(t){if(0===t.length)return"";for(var n=[0],i=0;i<t.length;++i){for(var o=0,a=t[i];o<n.length;++o)a+=n[o]<<8,n[o]=a%r,a=a/r|0;for(;a>0;)n.push(a%r),a=a/r|0}for(var s="",u=0;0===t[u]&&u<t.length-1;++u)s+=e[0];for(var c=n.length-1;c>=0;--c)s+=e[n[c]];return s},decodeUnsafe:o,decode:function(e){var t=o(e);if(t)return t;throw new Error("Non-base"+r+" character")}}},ALPHABET="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",bs58=baseX(ALPHABET);function sha256x2(e){var t=browser$2("sha256").update(e).digest();return browser$2("sha256").update(t).digest()}function encode$3(e){var t=sha256x2(e);return bs58.encode(Buffer.concat([e,t],e.length+4))}function decodeRaw(e){var t=e.slice(0,-4),r=e.slice(-4),n=sha256x2(t);if(!(r[0]^n[0]|r[1]^n[1]|r[2]^n[2]|r[3]^n[3]))return t}function decodeUnsafe(e){var t=bs58.decodeUnsafe(e);if(t)return decodeRaw(new Buffer(t))}function decode$3(e){var t=decodeRaw(new Buffer(bs58.decode(e)));if(!t)throw new Error("Invalid checksum");return t}var bs58check={encode:encode$3,decode:decode$3,decodeUnsafe:decodeUnsafe,decodeRaw:decodeUnsafe},networks={bitcoin:{messagePrefix:"Bitcoin Signed Message:\n",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128,dustThreshold:546},testnet:{messagePrefix:"Bitcoin Signed Message:\n",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239,dustThreshold:546},litecoin:{messagePrefix:"Litecoin Signed Message:\n",bip32:{public:27108450,private:27106558},pubKeyHash:48,scriptHash:5,wif:176,dustThreshold:0},dogecoin:{messagePrefix:"Dogecoin Signed Message:\n",bip32:{public:49990397,private:49988504},pubKeyHash:30,scriptHash:22,wif:158,dustThreshold:0}};function fromBase58Check(e){var t=bs58check.decode(e);if(t.length<21)throw new TypeError(e+" is too short");if(t.length>21)throw new TypeError(e+" is too long");var r=t[0];return{hash:t.slice(1),version:r}}function fromOutputScript(e,t){if(t=t||networks.bitcoin,script.isPubKeyHashOutput(e))return toBase58Check(script.compile(e).slice(3,23),t.pubKeyHash);if(script.isScriptHashOutput(e))return toBase58Check(script.compile(e).slice(2,22),t.scriptHash);throw new Error(script.toASM(e)+" has no matching Address")}function toBase58Check(e,t){typeforce_1(types_1.tuple(types_1.Hash160bit,types_1.UInt8),arguments);var r=new Buffer(21);return r.writeUInt8(t,0),e.copy(r,1),bs58check.encode(r)}function toOutputScript(e,t){t=t||networks.bitcoin;var r=fromBase58Check(e);if(r.version===t.pubKeyHash)return script.pubKeyHashOutput(r.hash);if(r.version===t.scriptHash)return script.scriptHashOutput(r.hash);throw new Error(e+" has no matching Script")}var address={fromBase58Check:fromBase58Check,fromOutputScript:fromOutputScript,toBase58Check:toBase58Check,toOutputScript:toOutputScript},Buffer$a=safeBuffer.Buffer,ZEROS=Buffer$a.alloc(128),blocksize=64;function Hmac(e,t){cipherBase.call(this,"digest"),"string"==typeof t&&(t=Buffer$a.from(t)),this._alg=e,this._key=t,t.length>blocksize?t=e(t):t.length<blocksize&&(t=Buffer$a.concat([t,ZEROS],blocksize));for(var r=this._ipad=Buffer$a.allocUnsafe(blocksize),n=this._opad=Buffer$a.allocUnsafe(blocksize),i=0;i<blocksize;i++)r[i]=54^t[i],n[i]=92^t[i];this._hash=[r]}inherits_browser(Hmac,cipherBase),Hmac.prototype._update=function(e){this._hash.push(e)},Hmac.prototype._final=function(){var e=this._alg(Buffer$a.concat(this._hash));return this._alg(Buffer$a.concat([this._opad,e]))};var legacy=Hmac,Buffer$b=safeBuffer.Buffer,ZEROS$1=Buffer$b.alloc(128);function Hmac$1(e,t){cipherBase.call(this,"digest"),"string"==typeof t&&(t=Buffer$b.from(t));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=t,t.length>r)?t=("rmd160"===e?new ripemd160:sha_js(e)).update(t).digest():t.length<r&&(t=Buffer$b.concat([t,ZEROS$1],r));for(var n=this._ipad=Buffer$b.allocUnsafe(r),i=this._opad=Buffer$b.allocUnsafe(r),o=0;o<r;o++)n[o]=54^t[o],i[o]=92^t[o];this._hash="rmd160"===e?new ripemd160:sha_js(e),this._hash.update(n)}inherits_browser(Hmac$1,cipherBase),Hmac$1.prototype._update=function(e){this._hash.update(e)},Hmac$1.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new ripemd160:sha_js(this._alg)).update(this._opad).update(e).digest()};var browser$3=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new Hmac$1("rmd160",t):"md5"===e?new legacy(md5,t):new Hmac$1(e,t)},_args=[["bigi@1.4.2","/Users/raiseandfall/Projects/learningmachine/cert-verifier-js/code"]],_from="bigi@1.4.2",_id="bigi@1.4.2",_inBundle=!1,_integrity="sha1-nGZalfiLiwj8Bc/XMfVhhZ1yWCU=",_location="/bigi",_phantomChildren={},_requested={type:"version",registry:!0,raw:"bigi@1.4.2",name:"bigi",escapedName:"bigi",rawSpec:"1.4.2",saveSpec:null,fetchSpec:"1.4.2"},_requiredBy=["/","/bitcoinjs-lib","/ecurve"],_resolved="https://registry.npmjs.org/bigi/-/bigi-1.4.2.tgz",_spec="1.4.2",_where="/Users/raiseandfall/Projects/learningmachine/cert-verifier-js/code",bugs={url:"https://github.com/cryptocoinjs/bigi/issues"},dependencies={},description="Big integers.",devDependencies={coveralls:"^2.11.2",istanbul:"^0.3.5",jshint:"^2.5.1",mocha:"^2.1.0",mochify:"^2.1.0"},homepage="https://github.com/cryptocoinjs/bigi#readme",keywords=["cryptography","math","bitcoin","arbitrary","precision","arithmetic","big","integer","int","number","biginteger","bigint","bignumber","decimal","float"],main="./lib/index.js",name="bigi",repository={url:"git+https://github.com/cryptocoinjs/bigi.git",type:"git"},scripts={"browser-test":"mochify --wd -R spec",coverage:"istanbul cover ./node_modules/.bin/_mocha -- --reporter list test/*.js",coveralls:"npm run-script coverage && node ./node_modules/.bin/coveralls < coverage/lcov.info",jshint:"jshint --config jshint.json lib/*.js ; true",test:"_mocha -- test/*.js",unit:"mocha"},testling={files:"test/*.js",harness:"mocha",browsers:["ie/9..latest","firefox/latest","chrome/latest","safari/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},version$2="1.4.2",_package={_args:_args,_from:_from,_id:_id,_inBundle:_inBundle,_integrity:_integrity,_location:_location,_phantomChildren:_phantomChildren,_requested:_requested,_requiredBy:_requiredBy,_resolved:_resolved,_spec:_spec,_where:_where,bugs:bugs,dependencies:dependencies,description:description,devDependencies:devDependencies,homepage:homepage,keywords:keywords,main:main,name:name,repository:repository,scripts:scripts,testling:testling,version:version$2},_package$1=Object.freeze({_args:_args,_from:_from,_id:_id,_inBundle:_inBundle,_integrity:_integrity,_location:_location,_phantomChildren:_phantomChildren,_requested:_requested,_requiredBy:_requiredBy,_resolved:_resolved,_spec:_spec,_where:_where,bugs:bugs,dependencies:dependencies,description:description,devDependencies:devDependencies,homepage:homepage,keywords:keywords,main:main,name:name,repository:repository,scripts:scripts,testling:testling,version:version$2,default:_package}),require$$0$1=_package$1&&_package||_package$1;function BigInteger(e,t,r){if(!(this instanceof BigInteger))return new BigInteger(e,t,r);null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}var dbits,proto$4=BigInteger.prototype;function am1(e,t,r,n,i,o){for(;--o>=0;){var a=t*this[e++]+r[n]+i;i=Math.floor(a/67108864),r[n++]=67108863&a}return i}proto$4.__bigi=require$$0$1.version,BigInteger.isBigInteger=function(e,t){return e&&e.__bigi&&(!t||e.__bigi===proto$4.__bigi)},BigInteger.prototype.am=am1,dbits=26,BigInteger.prototype.DB=dbits,BigInteger.prototype.DM=(1<<dbits)-1;var DV=BigInteger.prototype.DV=1<<dbits,BI_FP=52;BigInteger.prototype.FV=Math.pow(2,BI_FP),BigInteger.prototype.F1=BI_FP-dbits,BigInteger.prototype.F2=2*dbits-BI_FP;var rr,vv,BI_RM="0123456789abcdefghijklmnopqrstuvwxyz",BI_RC=new Array;for(rr="0".charCodeAt(0),vv=0;vv<=9;++vv)BI_RC[rr++]=vv;for(rr="a".charCodeAt(0),vv=10;vv<36;++vv)BI_RC[rr++]=vv;for(rr="A".charCodeAt(0),vv=10;vv<36;++vv)BI_RC[rr++]=vv;function int2char(e){return BI_RM.charAt(e)}function intAt(e,t){var r=BI_RC[e.charCodeAt(t)];return null==r?-1:r}function bnpCopyTo(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}function bnpFromInt(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+DV:this.t=0}function nbv(e){var t=new BigInteger;return t.fromInt(e),t}function bnpFromString(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,o=0;--n>=0;){var a=8==r?255&e[n]:intAt(e,n);a<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==o?this[this.t++]=a:o+r>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,(o+=r)>=this.DB&&(o-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),i&&BigInteger.ZERO.subTo(this,this)}function bnpClamp(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}function bnToString(e){var t;if(this.s<0)return"-"+this.negate().toString(e);if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,i=!1,o="",a=this.t,s=this.DB-a*this.DB%t;if(a-- >0)for(s<this.DB&&(r=this[a]>>s)>0&&(i=!0,o=int2char(r));a>=0;)s<t?(r=(this[a]&(1<<s)-1)<<t-s,r|=this[--a]>>(s+=this.DB-t)):(r=this[a]>>(s-=t)&n,s<=0&&(s+=this.DB,--a)),r>0&&(i=!0),i&&(o+=int2char(r));return i?o:"0"}function bnNegate(){var e=new BigInteger;return BigInteger.ZERO.subTo(this,e),e}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this[r]-e[r]))return t;return 0}function nbits(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnByteLength(){return this.bitLength()>>3}function bnpDLShiftTo(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s}function bnpDRShiftTo(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s}function bnpLShiftTo(e,t){var r,n=e%this.DB,i=this.DB-n,o=(1<<i)-1,a=Math.floor(e/this.DB),s=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t[r+a+1]=this[r]>>i|s,s=(this[r]&o)<<n;for(r=a-1;r>=0;--r)t[r]=0;t[a]=s,t.t=this.t+a+1,t.s=this.s,t.clamp()}function bnpRShiftTo(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,o=(1<<n)-1;t[0]=this[r]>>n;for(var a=r+1;a<this.t;++a)t[a-r-1]|=(this[a]&o)<<i,t[a-r]=this[a]>>n;n>0&&(t[this.t-r-1]|=(this.s&o)<<i),t.t=this.t-r,t.clamp()}}function bnpSubTo(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()}function bnpMultiplyTo(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t[i]=0;for(i=0;i<n.t;++i)t[i+r.t]=r.am(0,n[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&BigInteger.ZERO.subTo(t,t)}function bnpSquareTo(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()}function bnpDivRemTo(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=new BigInteger);var o=new BigInteger,a=this.s,s=e.s,u=this.DB-nbits(n[n.t-1]);u>0?(n.lShiftTo(u,o),i.lShiftTo(u,r)):(n.copyTo(o),i.copyTo(r));var c=o.t,f=o[c-1];if(0!=f){var l=f*(1<<this.F1)+(c>1?o[c-2]>>this.F2:0),h=this.FV/l,p=(1<<this.F1)/l,d=1<<this.F2,g=r.t,_=g-c,m=null==t?new BigInteger:t;for(o.dlShiftTo(_,m),r.compareTo(m)>=0&&(r[r.t++]=1,r.subTo(m,r)),BigInteger.ONE.dlShiftTo(c,m),m.subTo(o,o);o.t<c;)o[o.t++]=0;for(;--_>=0;){var y=r[--g]==f?this.DM:Math.floor(r[g]*h+(r[g-1]+d)*p);if((r[g]+=o.am(0,y,r,_,0,c))<y)for(o.dlShiftTo(_,m),r.subTo(m,r);r[g]<--y;)r.subTo(m,r)}null!=t&&(r.drShiftTo(c,t),a!=s&&BigInteger.ZERO.subTo(t,t)),r.t=c,r.clamp(),u>0&&r.rShiftTo(u,r),a<0&&BigInteger.ZERO.subTo(r,r)}}}function bnMod(e){var t=new BigInteger;return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(BigInteger.ZERO)>0&&e.subTo(t,t),t}function Classic(e){this.m=e}function cConvert(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function cRevert(e){return e}function cReduce(e){e.divRemTo(this.m,null,e)}function cMulTo(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function cSqrTo(e,t){e.squareTo(t),this.reduce(t)}function bnpInvDigit(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t}function Montgomery(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function montConvert(e){var t=new BigInteger;return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(BigInteger.ZERO)>0&&this.m.subTo(t,t),t}function montRevert(e){var t=new BigInteger;return e.copyTo(t),this.reduce(t),t}function montReduce(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e[t],n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[r=t+this.m.t]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function montSqrTo(e,t){e.squareTo(t),this.reduce(t)}function montMulTo(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function bnpIsEven(){return 0==(this.t>0?1&this[0]:this.s)}function bnpExp(e,t){if(e>4294967295||e<1)return BigInteger.ONE;var r=new BigInteger,n=new BigInteger,i=t.convert(this),o=nbits(e)-1;for(i.copyTo(r);--o>=0;)if(t.sqrTo(r,n),(e&1<<o)>0)t.mulTo(n,i,r);else{var a=r;r=n,n=a}return t.revert(r)}function bnModPowInt(e,t){var r;return r=e<256||t.isEven()?new Classic(t):new Montgomery(t),this.exp(e,r)}function bnClone(){var e=new BigInteger;return this.copyTo(e),e}function bnIntValue(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function bnByteValue(){return 0==this.t?this.s:this[0]<<24>>24}function bnShortValue(){return 0==this.t?this.s:this[0]<<16>>16}function bnpChunkSize(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function bnSigNum(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function bnpToRadix(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=nbv(r),i=new BigInteger,o=new BigInteger,a="";for(this.divRemTo(n,i,o);i.signum()>0;)a=(r+o.intValue()).toString(e).substr(1)+a,i.divRemTo(n,i,o);return o.intValue().toString(e)+a}function bnpFromRadix(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,o=0,a=0,s=0;s<e.length;++s){var u=intAt(e,s);u<0?"-"==e.charAt(s)&&0==this.signum()&&(i=!0):(a=t*a+u,++o>=r&&(this.dMultiply(n),this.dAddOffset(a,0),o=0,a=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(a,0)),i&&BigInteger.ZERO.subTo(this,this)}function bnpFromNumber(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(BigInteger.ONE.shiftLeft(e-1),op_or,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(BigInteger.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}}function bnToByteArray(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n<this.DB&&(r=this[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this[e]&(1<<n)-1)<<8-n,r|=this[--e]>>(n+=this.DB-8)):(r=this[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0===i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t}function bnEquals(e){return 0==this.compareTo(e)}function bnMin(e){return this.compareTo(e)<0?this:e}function bnMax(e){return this.compareTo(e)>0?this:e}function bnpBitwiseTo(e,t,r){var n,i,o=Math.min(e.t,this.t);for(n=0;n<o;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(i=e.s&this.DM,n=o;n<this.t;++n)r[n]=t(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=o;n<e.t;++n)r[n]=t(i,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()}function op_and(e,t){return e&t}function bnAnd(e){var t=new BigInteger;return this.bitwiseTo(e,op_and,t),t}function op_or(e,t){return e|t}function bnOr(e){var t=new BigInteger;return this.bitwiseTo(e,op_or,t),t}function op_xor(e,t){return e^t}function bnXor(e){var t=new BigInteger;return this.bitwiseTo(e,op_xor,t),t}function op_andnot(e,t){return e&~t}function bnAndNot(e){var t=new BigInteger;return this.bitwiseTo(e,op_andnot,t),t}function bnNot(){for(var e=new BigInteger,t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e}function bnShiftLeft(e){var t=new BigInteger;return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function bnShiftRight(e){var t=new BigInteger;return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function lbit(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function bnGetLowestSetBit(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+lbit(this[e]);return this.s<0?this.t*this.DB:-1}function cbit(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function bnBitCount(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=cbit(this[r]^t);return e}function bnTestBit(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)}function bnpChangeBit(e,t){var r=BigInteger.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}function bnSetBit(e){return this.changeBit(e,op_or)}function bnClearBit(e){return this.changeBit(e,op_andnot)}function bnFlipBit(e){return this.changeBit(e,op_xor)}function bnpAddTo(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()}function bnAdd(e){var t=new BigInteger;return this.addTo(e,t),t}function bnSubtract(e){var t=new BigInteger;return this.subTo(e,t),t}function bnMultiply(e){var t=new BigInteger;return this.multiplyTo(e,t),t}function bnSquare(){var e=new BigInteger;return this.squareTo(e),e}function bnDivide(e){var t=new BigInteger;return this.divRemTo(e,t,null),t}function bnRemainder(e){var t=new BigInteger;return this.divRemTo(e,null,t),t}function bnDivideAndRemainder(e){var t=new BigInteger,r=new BigInteger;return this.divRemTo(e,t,r),new Array(t,r)}function bnpDMultiply(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function bnpDAddOffset(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}function NullExp(){}function nNop(e){return e}function nMulTo(e,t,r){e.multiplyTo(t,r)}function nSqrTo(e,t){e.squareTo(t)}function bnPow(e){return this.exp(e,new NullExp)}function bnpMultiplyLowerTo(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(n=r.t-this.t;i<n;++i)r[i+this.t]=this.am(0,e[i],r,i,0,this.t);for(n=Math.min(e.t,t);i<n;++i)this.am(0,e[i],r,i,0,t-i);r.clamp()}function bnpMultiplyUpperTo(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)}function Barrett(e){this.r2=new BigInteger,this.q3=new BigInteger,BigInteger.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function barrettConvert(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=new BigInteger;return e.copyTo(t),this.reduce(t),t}function barrettRevert(e){return e}function barrettReduce(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}function barrettSqrTo(e,t){e.squareTo(t),this.reduce(t)}function barrettMulTo(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function bnModPow(e,t){var r,n,i=e.bitLength(),o=nbv(1);if(i<=0)return o;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new Classic(t):t.isEven()?new Barrett(t):new Montgomery(t);var a=new Array,s=3,u=r-1,c=(1<<r)-1;if(a[1]=n.convert(this),r>1){var f=new BigInteger;for(n.sqrTo(a[1],f);s<=c;)a[s]=new BigInteger,n.mulTo(f,a[s-2],a[s]),s+=2}var l,h,p=e.t-1,d=!0,g=new BigInteger;for(i=nbits(e[p])-1;p>=0;){for(i>=u?l=e[p]>>i-u&c:(l=(e[p]&(1<<i+1)-1)<<u-i,p>0&&(l|=e[p-1]>>this.DB+i-u)),s=r;0==(1&l);)l>>=1,--s;if((i-=s)<0&&(i+=this.DB,--p),d)a[l].copyTo(o),d=!1;else{for(;s>1;)n.sqrTo(o,g),n.sqrTo(g,o),s-=2;s>0?n.sqrTo(o,g):(h=o,o=g,g=h),n.mulTo(g,a[l],o)}for(;p>=0&&0==(e[p]&1<<i);)n.sqrTo(o,g),h=o,o=g,g=h,--i<0&&(i=this.DB-1,--p)}return n.revert(o)}function bnGCD(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return t;for(i<o&&(o=i),o>0&&(t.rShiftTo(o,t),r.rShiftTo(o,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r}function bnpModInt(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r}function bnModInverse(e){var t=e.isEven();if(0===this.signum())throw new Error("division by zero");if(this.isEven()&&t||0==e.signum())return BigInteger.ZERO;for(var r=e.clone(),n=this.clone(),i=nbv(1),o=nbv(0),a=nbv(0),s=nbv(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(i.isEven()&&o.isEven()||(i.addTo(this,i),o.subTo(e,o)),i.rShiftTo(1,i)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),t?(a.isEven()&&s.isEven()||(a.addTo(this,a),s.subTo(e,s)),a.rShiftTo(1,a)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(a,i),o.subTo(s,o)):(n.subTo(r,n),t&&a.subTo(i,a),s.subTo(o,s))}if(0!=n.compareTo(BigInteger.ONE))return BigInteger.ZERO;for(;s.compareTo(e)>=0;)s.subTo(e,s);for(;s.signum()<0;)s.addTo(e,s);return s}Classic.prototype.convert=cConvert,Classic.prototype.revert=cRevert,Classic.prototype.reduce=cReduce,Classic.prototype.mulTo=cMulTo,Classic.prototype.sqrTo=cSqrTo,Montgomery.prototype.convert=montConvert,Montgomery.prototype.revert=montRevert,Montgomery.prototype.reduce=montReduce,Montgomery.prototype.mulTo=montMulTo,Montgomery.prototype.sqrTo=montSqrTo,proto$4.copyTo=bnpCopyTo,proto$4.fromInt=bnpFromInt,proto$4.fromString=bnpFromString,proto$4.clamp=bnpClamp,proto$4.dlShiftTo=bnpDLShiftTo,proto$4.drShiftTo=bnpDRShiftTo,proto$4.lShiftTo=bnpLShiftTo,proto$4.rShiftTo=bnpRShiftTo,proto$4.subTo=bnpSubTo,proto$4.multiplyTo=bnpMultiplyTo,proto$4.squareTo=bnpSquareTo,proto$4.divRemTo=bnpDivRemTo,proto$4.invDigit=bnpInvDigit,proto$4.isEven=bnpIsEven,proto$4.exp=bnpExp,proto$4.toString=bnToString,proto$4.negate=bnNegate,proto$4.abs=bnAbs,proto$4.compareTo=bnCompareTo,proto$4.bitLength=bnBitLength,proto$4.byteLength=bnByteLength,proto$4.mod=bnMod,proto$4.modPowInt=bnModPowInt,NullExp.prototype.convert=nNop,NullExp.prototype.revert=nNop,NullExp.prototype.mulTo=nMulTo,NullExp.prototype.sqrTo=nSqrTo,Barrett.prototype.convert=barrettConvert,Barrett.prototype.revert=barrettRevert,Barrett.prototype.reduce=barrettReduce,Barrett.prototype.mulTo=barrettMulTo,Barrett.prototype.sqrTo=barrettSqrTo;var lowprimes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],lplim=(1<<26)/lowprimes[lowprimes.length-1];function bnIsProbablePrime(e){var t,r=this.abs();if(1==r.t&&r[0]<=lowprimes[lowprimes.length-1]){for(t=0;t<lowprimes.length;++t)if(r[0]==lowprimes[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<lowprimes.length;){for(var n=lowprimes[t],i=t+1;i<lowprimes.length&&n<lplim;)n*=lowprimes[i++];for(n=r.modInt(n);t<i;)if(n%lowprimes[t++]==0)return!1}return r.millerRabin(e)}function bnpMillerRabin(e){var t=this.subtract(BigInteger.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);(e=e+1>>1)>lowprimes.length&&(e=lowprimes.length);for(var i=new BigInteger(null),o=[],a=0;a<e;++a){for(;u=lowprimes[Math.floor(Math.random()*lowprimes.length)],-1!=o.indexOf(u););o.push(u),i.fromInt(u);var s=i.modPow(n,this);if(0!=s.compareTo(BigInteger.ONE)&&0!=s.compareTo(t)){for(var u=1;u++<r&&0!=s.compareTo(t);)if(0==(s=s.modPowInt(2,this)).compareTo(BigInteger.ONE))return!1;if(0!=s.compareTo(t))return!1}}return!0}proto$4.chunkSize=bnpChunkSize,proto$4.toRadix=bnpToRadix,proto$4.fromRadix=bnpFromRadix,proto$4.fromNumber=bnpFromNumber,proto$4.bitwiseTo=bnpBitwiseTo,proto$4.changeBit=bnpChangeBit,proto$4.addTo=bnpAddTo,proto$4.dMultiply=bnpDMultiply,proto$4.dAddOffset=bnpDAddOffset,proto$4.multiplyLowerTo=bnpMultiplyLowerTo,proto$4.multiplyUpperTo=bnpMultiplyUpperTo,proto$4.modInt=bnpModInt,proto$4.millerRabin=bnpMillerRabin,proto$4.clone=bnClone,proto$4.intValue=bnIntValue,proto$4.byteValue=bnByteValue,proto$4.shortValue=bnShortValue,proto$4.signum=bnSigNum,proto$4.toByteArray=bnToByteArray,proto$4.equals=bnEquals,proto$4.min=bnMin,proto$4.max=bnMax,proto$4.and=bnAnd,proto$4.or=bnOr,proto$4.xor=bnXor,proto$4.andNot=bnAndNot,proto$4.not=bnNot,proto$4.shiftLeft=bnShiftLeft,proto$4.shiftRight=bnShiftRight,proto$4.getLowestSetBit=bnGetLowestSetBit,proto$4.bitCount=bnBitCount,proto$4.testBit=bnTestBit,proto$4.setBit=bnSetBit,proto$4.clearBit=bnClearBit,proto$4.flipBit=bnFlipBit,proto$4.add=bnAdd,proto$4.subtract=bnSubtract,proto$4.multiply=bnMultiply,proto$4.divide=bnDivide,proto$4.remainder=bnRemainder,proto$4.divideAndRemainder=bnDivideAndRemainder,proto$4.modPow=bnModPow,proto$4.modInverse=bnModInverse,proto$4.pow=bnPow,proto$4.gcd=bnGCD,proto$4.isProbablePrime=bnIsProbablePrime,proto$4.square=bnSquare,BigInteger.ZERO=nbv(0),BigInteger.ONE=nbv(1),BigInteger.valueOf=nbv;var bigi=BigInteger;function compare(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}var _functionsHaveNames,hasOwn=Object.prototype.hasOwnProperty,objectKeys$1=Object.keys||function(e){var t=[];for(var r in e)hasOwn.call(e,r)&&t.push(r);return t},pSlice=Array.prototype.slice;function functionsHaveNames(){return void 0!==_functionsHaveNames?_functionsHaveNames:_functionsHaveNames="foo"===function(){}.name}function pToString(e){return Object.prototype.toString.call(e)}function isView(e){return!isBuffer(e)&&("function"==typeof global$1.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}function assert(e,t){e||fail(e,!0,t,"==",ok)}var regex=/\s*function\s+([^\(\s]*)\s*/;function getName(e){if(isFunction(e)){if(functionsHaveNames())return e.name;var t=e.toString().match(regex);return t&&t[1]}}function AssertionError(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=getMessage(this),this.generatedMessage=!0);var t=e.stackStartFunction||fail;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=getName(t),o=n.indexOf("\n"+i);if(o>=0){var a=n.indexOf("\n",o+1);n=n.substring(a+1)}this.stack=n}}}function truncate(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function inspect$1(e){if(functionsHaveNames()||!isFunction(e))return inspect(e);var t=getName(e);return"[Function"+(t?": "+t:"")+"]"}function getMessage(e){return truncate(inspect$1(e.actual),128)+" "+e.operator+" "+truncate(inspect$1(e.expected),128)}function fail(e,t,r,n,i){throw new AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function ok(e,t){e||fail(e,!0,t,"==",ok)}function equal(e,t,r){e!=t&&fail(e,t,r,"==",equal)}function notEqual(e,t,r){e==t&&fail(e,t,r,"!=",notEqual)}function deepEqual(e,t,r){_deepEqual(e,t,!1)||fail(e,t,r,"deepEqual",deepEqual)}function deepStrictEqual(e,t,r){_deepEqual(e,t,!0)||fail(e,t,r,"deepStrictEqual",deepStrictEqual)}function _deepEqual(e,t,r,n){if(e===t)return!0;if(isBuffer(e)&&isBuffer(t))return 0===compare(e,t);if(isDate(e)&&isDate(t))return e.getTime()===t.getTime();if(isRegExp(e)&&isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(isView(e)&&isView(t)&&pToString(e)===pToString(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===compare(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(isBuffer(e)!==isBuffer(t))return!1;var i=(n=n||{actual:[],expected:[]}).actual.indexOf(e);return-1!==i&&i===n.expected.indexOf(t)||(n.actual.push(e),n.expected.push(t),objEquiv(e,t,r,n))}return r?e===t:e==t}function isArguments(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function objEquiv(e,t,r,n){if(null==e||null==t)return!1;if(isPrimitive(e)||isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=isArguments(e),o=isArguments(t);if(i&&!o||!i&&o)return!1;if(i)return _deepEqual(e=pSlice.call(e),t=pSlice.call(t),r);var a,s,u=objectKeys$1(e),c=objectKeys$1(t);if(u.length!==c.length)return!1;for(u.sort(),c.sort(),s=u.length-1;s>=0;s--)if(u[s]!==c[s])return!1;for(s=u.length-1;s>=0;s--)if(!_deepEqual(e[a=u[s]],t[a],r,n))return!1;return!0}function notDeepEqual(e,t,r){_deepEqual(e,t,!1)&&fail(e,t,r,"notDeepEqual",notDeepEqual)}function notDeepStrictEqual(e,t,r){_deepEqual(e,t,!0)&&fail(e,t,r,"notDeepStrictEqual",notDeepStrictEqual)}function strictEqual(e,t,r){e!==t&&fail(e,t,r,"===",strictEqual)}function notStrictEqual(e,t,r){e===t&&fail(e,t,r,"!==",notStrictEqual)}function expectedException(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function _tryBlock(e){var t;try{e()}catch(e){t=e}return t}function _throws(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=_tryBlock(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&fail(i,r,"Missing expected exception"+n);var o="string"==typeof n,a=!e&&i&&!r;if((!e&&isError(i)&&o&&expectedException(i,r)||a)&&fail(i,r,"Got unwanted exception"+n),e&&i&&r&&!expectedException(i,r)||!e&&i)throw i}function throws(e,t,r){_throws(!0,e,t,r)}function doesNotThrow(e,t,r){_throws(!1,e,t,r)}function ifError(e){if(e)throw e}assert.AssertionError=AssertionError,inherits$1(AssertionError,Error),assert.fail=fail,assert.ok=ok,assert.equal=equal,assert.notEqual=notEqual,assert.deepEqual=deepEqual,assert.deepStrictEqual=deepStrictEqual,assert.notDeepEqual=notDeepEqual,assert.notDeepStrictEqual=notDeepStrictEqual,assert.strictEqual=strictEqual,assert.notStrictEqual=notStrictEqual,assert.throws=throws,assert.doesNotThrow=doesNotThrow,assert.ifError=ifError;var assert$1=Object.freeze({default:assert,AssertionError:AssertionError,fail:fail,ok:ok,assert:ok,equal:equal,notEqual:notEqual,deepEqual:deepEqual,deepStrictEqual:deepStrictEqual,notDeepEqual:notDeepEqual,notDeepStrictEqual:notDeepStrictEqual,strictEqual:strictEqual,notStrictEqual:notStrictEqual,throws:throws,doesNotThrow:doesNotThrow,ifError:ifError}),assert$2=assert$1&&assert||assert$1;bigi.fromByteArrayUnsigned=function(e){return 128&e[0]?new bigi([0].concat(e)):new bigi(e)},bigi.prototype.toByteArrayUnsigned=function(){var e=this.toByteArray();return 0===e[0]?e.slice(1):e},bigi.fromDERInteger=function(e){return new bigi(e)},bigi.prototype.toDERInteger=bigi.prototype.toByteArray,bigi.fromBuffer=function(e){if(128&e[0]){var t=Array.prototype.slice.call(e);return new bigi([0].concat(t))}return new bigi(e)},bigi.fromHex=function(e){return""===e?bigi.ZERO:(assert$2.equal(e,e.match(/^[A-Fa-f0-9]+/),"Invalid hex string"),assert$2.equal(e.length%2,0,"Incomplete hex"),new bigi(e,16))},bigi.prototype.toBuffer=function(e){for(var t=this.toByteArrayUnsigned(),r=[],n=e-t.length;r.length<n;)r.push(0);return new Buffer(r.concat(t))},bigi.prototype.toHex=function(e){return this.toBuffer(e).toString("hex")};var lib$1=bigi;function ECSignature$1(e,t){typeforce_1(types_1.tuple(types_1.BigInt,types_1.BigInt),arguments),this.r=e,this.s=t}ECSignature$1.parseCompact=function(e){if(65!==e.length)throw new Error("Invalid signature length");var t=e.readUInt8(0)-27;if(t!==(7&t))throw new Error("Invalid signature parameter");return{compressed:!!(4&t),i:3&t,signature:new ECSignature$1(lib$1.fromBuffer(e.slice(1,33)),lib$1.fromBuffer(e.slice(33)))}},ECSignature$1.fromDER=function(e){var t=bip66.decode(e);return new ECSignature$1(lib$1.fromDERInteger(t.r),lib$1.fromDERInteger(t.s))},ECSignature$1.parseScriptSignature=function(e){var t=e.readUInt8(e.length-1),r=-129&t;if(r<=0||r>=4)throw new Error("Invalid hashType "+t);return{signature:ECSignature$1.fromDER(e.slice(0,-1)),hashType:t}},ECSignature$1.prototype.toCompact=function(e,t){t&&(e+=4),e+=27;var r=new Buffer(65);return r.writeUInt8(e,0),this.r.toBuffer(32).copy(r,1),this.s.toBuffer(32).copy(r,33),r},ECSignature$1.prototype.toDER=function(){var e=new Buffer(this.r.toDERInteger()),t=new Buffer(this.s.toDERInteger());return bip66.encode(e,t)},ECSignature$1.prototype.toScriptSignature=function(e){var t=-129&e;if(t<=0||t>=4)throw new Error("Invalid hashType "+e);var r=new Buffer(1);return r.writeUInt8(e,0),Buffer.concat([this.toDER(),r])};var ecsignature=ECSignature$1,Buffer$c=safeBuffer.Buffer,THREE=lib$1.valueOf(3);function Point(e,t,r,n){assert$2.notStrictEqual(n,void 0,"Missing Z coordinate"),this.curve=e,this.x=t,this.y=r,this.z=n,this._zInv=null,this.compressed=!0}Object.defineProperty(Point.prototype,"zInv",{get:function(){return null===this._zInv&&(this._zInv=this.z.modInverse(this.curve.p)),this._zInv}}),Object.defineProperty(Point.prototype,"affineX",{get:function(){return this.x.multiply(this.zInv).mod(this.curve.p)}}),Object.defineProperty(Point.prototype,"affineY",{get:function(){return this.y.multiply(this.zInv).mod(this.curve.p)}}),Point.fromAffine=function(e,t,r){return new Point(e,t,r,lib$1.ONE)},Point.prototype.equals=function(e){return e===this||(this.curve.isInfinity(this)?this.curve.isInfinity(e):this.curve.isInfinity(e)?this.curve.isInfinity(this):0===e.y.multiply(this.z).subtract(this.y.multiply(e.z)).mod(this.curve.p).signum()&&0===e.x.multiply(this.z).subtract(this.x.multiply(e.z)).mod(this.curve.p).signum())},Point.prototype.negate=function(){var e=this.curve.p.subtract(this.y);return new Point(this.curve,this.x,e,this.z)},Point.prototype.add=function(e){if(this.curve.isInfinity(this))return e;if(this.curve.isInfinity(e))return this;var t=this.x,r=this.y,n=e.x,i=e.y.multiply(this.z).subtract(r.multiply(e.z)).mod(this.curve.p),o=n.multiply(this.z).subtract(t.multiply(e.z)).mod(this.curve.p);if(0===o.signum())return 0===i.signum()?this.twice():this.curve.infinity;var a=o.square(),s=a.multiply(o),u=t.multiply(a),c=i.square().multiply(this.z),f=c.subtract(u.shiftLeft(1)).multiply(e.z).subtract(s).multiply(o).mod(this.curve.p),l=u.multiply(THREE).multiply(i).subtract(r.multiply(s)).subtract(c.multiply(i)).multiply(e.z).add(i.multiply(s)).mod(this.curve.p),h=s.multiply(this.z).multiply(e.z).mod(this.curve.p);return new Point(this.curve,f,l,h)},Point.prototype.twice=function(){if(this.curve.isInfinity(this))return this;if(0===this.y.signum())return this.curve.infinity;var e=this.x,t=this.y,r=t.multiply(this.z).mod(this.curve.p),n=r.multiply(t).mod(this.curve.p),i=this.curve.a,o=e.square().multiply(THREE);0!==i.signum()&&(o=o.add(this.z.square().multiply(i)));var a=(o=o.mod(this.curve.p)).square().subtract(e.shiftLeft(3).multiply(n)).shiftLeft(1).multiply(r).mod(this.curve.p),s=o.multiply(THREE).multiply(e).subtract(n.shiftLeft(1)).shiftLeft(2).multiply(n).subtract(o.pow(3)).mod(this.curve.p),u=r.pow(3).shiftLeft(3).mod(this.curve.p);return new Point(this.curve,a,s,u)},Point.prototype.multiply=function(e){if(this.curve.isInfinity(this))return this;if(0===e.signum())return this.curve.infinity;for(var t=e,r=t.multiply(THREE),n=this.negate(),i=this,o=r.bitLength()-2;o>0;--o){var a=r.testBit(o),s=t.testBit(o);i=i.twice(),a!==s&&(i=i.add(a?this:n))}return i},Point.prototype.multiplyTwo=function(e,t,r){for(var n=Math.max(e.bitLength(),r.bitLength())-1,i=this.curve.infinity,o=this.add(t);n>=0;){var a=e.testBit(n),s=r.testBit(n);i=i.twice(),a?i=s?i.add(o):i.add(this):s&&(i=i.add(t)),--n}return i},Point.prototype.getEncoded=function(e){if(null==e&&(e=this.compressed),this.curve.isInfinity(this))return Buffer$c.alloc(1,0);var t,r=this.affineX,n=this.affineY,i=this.curve.pLength;return e?(t=Buffer$c.allocUnsafe(1+i)).writeUInt8(n.isEven()?2:3,0):((t=Buffer$c.allocUnsafe(1+i+i)).writeUInt8(4,0),n.toBuffer(i).copy(t,1+i)),r.toBuffer(i).copy(t,1),t},Point.decodeFrom=function(e,t){var r,n=t.readUInt8(0),i=4!==n,o=Math.floor((e.p.bitLength()+7)/8),a=lib$1.fromBuffer(t.slice(1,1+o));if(i){assert$2.equal(t.length,o+1,"Invalid sequence length"),assert$2(2===n||3===n,"Invalid sequence tag");var s=3===n;r=e.pointFromX(s,a)}else{assert$2.equal(t.length,1+o+o,"Invalid sequence length");var u=lib$1.fromBuffer(t.slice(1+o));r=Point.fromAffine(e,a,u)}return r.compressed=i,r},Point.prototype.toString=function(){return this.curve.isInfinity(this)?"(INFINITY)":"("+this.affineX.toString()+","+this.affineY.toString()+")"};var point=Point;function Curve(e,t,r,n,i,o,a){this.p=e,this.a=t,this.b=r,this.G=point.fromAffine(this,n,i),this.n=o,this.h=a,this.infinity=new point(this,null,null,lib$1.ZERO),this.pOverFour=e.add(lib$1.ONE).shiftRight(2),this.pLength=Math.floor((this.p.bitLength()+7)/8)}Curve.prototype.pointFromX=function(e,t){var r=t.pow(3).add(this.a.multiply(t)).add(this.b).mod(this.p).modPow(this.pOverFour,this.p),n=r;return r.isEven()^!e&&(n=this.p.subtract(n)),point.fromAffine(this,t,n)},Curve.prototype.isInfinity=function(e){return e===this.infinity||0===e.z.signum()&&0!==e.y.signum()},Curve.prototype.isOnCurve=function(e){if(this.isInfinity(e))return!0;var t=e.affineX,r=e.affineY,n=this.a,i=this.b,o=this.p;if(t.signum()<0||t.compareTo(o)>=0)return!1;if(r.signum()<0||r.compareTo(o)>=0)return!1;var a=r.square().mod(o),s=t.pow(3).add(n.multiply(t)).add(i).mod(o);return a.equals(s)},Curve.prototype.validate=function(e){assert$2(!this.isInfinity(e),"Point is at infinity"),assert$2(this.isOnCurve(e),"Point is not on the curve");var t=e.multiply(this.n);return assert$2(this.isInfinity(t),"Point is not a scalar multiple of G"),!0};var curve=Curve,secp128r1={p:"fffffffdffffffffffffffffffffffff",a:"fffffffdfffffffffffffffffffffffc",b:"e87579c11079f43dd824993c2cee5ed3",n:"fffffffe0000000075a30d1b9038a115",h:"01",Gx:"161ff7528b899b2d0c28607ca52c5b86",Gy:"cf5ac8395bafeb13c02da292dded7a83"},secp160k1={p:"fffffffffffffffffffffffffffffffeffffac73",a:"00",b:"07",n:"0100000000000000000001b8fa16dfab9aca16b6b3",h:"01",Gx:"3b4c382ce37aa192a4019e763036f4f5dd4d7ebb",Gy:"938cf935318fdced6bc28286531733c3f03c4fee"},secp160r1={p:"ffffffffffffffffffffffffffffffff7fffffff",a:"ffffffffffffffffffffffffffffffff7ffffffc",b:"1c97befc54bd7a8b65acf89f81d4d4adc565fa45",n:"0100000000000000000001f4c8f927aed3ca752257",h:"01",Gx:"4a96b5688ef573284664698968c38bb913cbfc82",Gy:"23a628553168947d59dcc912042351377ac5fb32"},secp192k1={p:"fffffffffffffffffffffffffffffffffffffffeffffee37",a:"00",b:"03",n:"fffffffffffffffffffffffe26f2fc170f69466a74defd8d",h:"01",Gx:"db4ff10ec057e9ae26b07d0280b7f4341da5d1b1eae06c7d",Gy:"9b2f2f6d9c5628a7844163d015be86344082aa88d95e2f9d"},secp192r1={p:"fffffffffffffffffffffffffffffffeffffffffffffffff",a:"fffffffffffffffffffffffffffffffefffffffffffffffc",b:"64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1",n:"ffffffffffffffffffffffff99def836146bc9b1b4d22831",h:"01",Gx:"188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012",Gy:"07192b95ffc8da78631011ed6b24cdd573f977a11e794811"},secp256k1={p:"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f",a:"00",b:"07",n:"fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",h:"01",Gx:"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",Gy:"483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"},secp256r1={p:"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff",a:"ffffffff00000001000000000000000000000000fffffffffffffffffffffffc",b:"5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b",n:"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551",h:"01",Gx:"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296",Gy:"4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"},curves={secp128r1:secp128r1,secp160k1:secp160k1,secp160r1:secp160r1,secp192k1:secp192k1,secp192r1:secp192r1,secp256k1:secp256k1,secp256r1:secp256r1},curves$1=Object.freeze({secp128r1:secp128r1,secp160k1:secp160k1,secp160r1:secp160r1,secp192k1:secp192k1,secp192r1:secp192r1,secp256k1:secp256k1,secp256r1:secp256r1,default:curves}),curves$2=curves$1&&curves||curves$1;function getCurveByName(e){var t=curves$2[e];if(!t)return null;var r=new lib$1(t.p,16),n=new lib$1(t.a,16),i=new lib$1(t.b,16),o=new lib$1(t.n,16),a=new lib$1(t.h,16),s=new lib$1(t.Gx,16),u=new lib$1(t.Gy,16);return new curve(r,n,i,s,u,o,a)}var names=getCurveByName,lib$2={Curve:curve,Point:point,getCurveByName:names},ZERO$1=new Buffer([0]),ONE$1=new Buffer([1]),secp256k1$1=lib$2.getCurveByName("secp256k1");function deterministicGenerateK(e,t,r){typeforce_1(types_1.tuple(types_1.Hash256bit,types_1.Buffer256bit,types_1.Function),arguments);var n=new Buffer(32),i=new Buffer(32);i.fill(1),n.fill(0),n=browser$3("sha256",n).update(i).update(ZERO$1).update(t).update(e).digest(),i=browser$3("sha256",n).update(i).digest(),n=browser$3("sha256",n).update(i).update(ONE$1).update(t).update(e).digest(),i=browser$3("sha256",n).update(i).digest(),i=browser$3("sha256",n).update(i).digest();for(var o=lib$1.fromBuffer(i);o.signum()<=0||o.compareTo(secp256k1$1.n)>=0||!r(o);)n=browser$3("sha256",n).update(i).update(ZERO$1).digest(),i=browser$3("sha256",n).update(i).digest(),i=browser$3("sha256",n).update(i).digest(),o=lib$1.fromBuffer(i);return o}var N_OVER_TWO=secp256k1$1.n.shiftRight(1);function sign(e,t){typeforce_1(types_1.tuple(types_1.Hash256bit,types_1.BigInt),arguments);var r,n,i=t.toBuffer(32),o=lib$1.fromBuffer(e),a=secp256k1$1.n,s=secp256k1$1.G;return deterministicGenerateK(e,i,function(e){var i=s.multiply(e);return!secp256k1$1.isInfinity(i)&&(0!==(r=i.affineX.mod(a)).signum()&&0!==(n=e.modInverse(a).multiply(o.add(t.multiply(r))).mod(a)).signum())}),n.compareTo(N_OVER_TWO)>0&&(n=a.subtract(n)),new ecsignature(r,n)}function verify(e,t,r){typeforce_1(types_1.tuple(types_1.Hash256bit,types_1.ECSignature,types_1.ECPoint),arguments);var n=secp256k1$1.n,i=secp256k1$1.G,o=t.r,a=t.s;if(o.signum()<=0||o.compareTo(n)>=0)return!1;if(a.signum()<=0||a.compareTo(n)>=0)return!1;var s=lib$1.fromBuffer(e),u=a.modInverse(n),c=s.multiply(u).mod(n),f=o.multiply(u).mod(n),l=i.multiplyTwo(c,r,f);return!secp256k1$1.isInfinity(l)&&l.affineX.mod(n).equals(o)}function recoverPubKey(e,t,r){typeforce_1(types_1.tuple(types_1.BigInt,types_1.ECSignature,types_1.UInt2),arguments);var n=secp256k1$1.n,i=secp256k1$1.G,o=t.r,a=t.s;if(o.signum()<=0||o.compareTo(n)>=0)throw new Error("Invalid r value");if(a.signum()<=0||a.compareTo(n)>=0)throw new Error("Invalid s value");var s=1&r,u=r>>1?o.add(n):o,c=secp256k1$1.pointFromX(s,u),f=c.multiply(n);if(!secp256k1$1.isInfinity(f))throw new Error("nR is not a valid curve point");var l=o.modInverse(n),h=e.negate().mod(n),p=c.multiplyTwo(a,i,h).multiply(l);return secp256k1$1.validate(p),p}function calcPubKeyRecoveryParam(e,t,r){typeforce_1(types_1.tuple(types_1.BigInt,types_1.ECSignature,types_1.ECPoint),arguments);for(var n=0;n<4;n++){if(recoverPubKey(e,t,n).equals(r))return n}throw new Error("Unable to find valid recovery factor")}var ecdsa={calcPubKeyRecoveryParam:calcPubKeyRecoveryParam,deterministicGenerateK:deterministicGenerateK,recoverPubKey:recoverPubKey,sign:sign,verify:verify,__curve:secp256k1$1},browser$4=createCommonjsModule(function(e){var t=safeBuffer.Buffer,r=commonjsGlobal.crypto||commonjsGlobal.msCrypto;r&&r.getRandomValues?e.exports=function(e,n){if(e>65536)throw new Error("requested too many random bytes");var i=new commonjsGlobal.Uint8Array(e);e>0&&r.getRandomValues(i);var o=t.from(i.buffer);if("function"==typeof n)return nextTick(function(){n(null,o)});return o}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}});function decodeRaw$1(e,t){if(void 0!==t&&e[0]!==t)throw new Error("Invalid network version");if(33===e.length)return{version:e[0],privateKey:e.slice(1,33),compressed:!1};if(34!==e.length)throw new Error("Invalid WIF length");if(1!==e[33])throw new Error("Invalid compression flag");return{version:e[0],privateKey:e.slice(1,33),compressed:!0}}function encodeRaw(e,t,r){var n=new Buffer(r?34:33);return n.writeUInt8(e,0),t.copy(n,1),r&&(n[33]=1),n}function decode$4(e,t){return decodeRaw$1(bs58check.decode(e),t)}function encode$4(e,t,r){return"number"==typeof e?bs58check.encode(encodeRaw(e,t,r)):bs58check.encode(encodeRaw(e.version,e.privateKey,e.compressed))}var wif={decode:decode$4,decodeRaw:decodeRaw$1,encode:encode$4,encodeRaw:encodeRaw},secp256k1$2=ecdsa.__curve;function ECPair(e,t,r){if(r&&typeforce_1({compressed:types_1.maybe(types_1.Boolean),network:types_1.maybe(types_1.Network)},r),r=r||{},e){if(e.signum()<=0)throw new Error("Private key must be greater than 0");if(e.compareTo(secp256k1$2.n)>=0)throw new Error("Private key must be less than the curve order");if(t)throw new TypeError("Unexpected publicKey parameter");this.d=e}else typeforce_1(types_1.ECPoint,t),this.__Q=t;this.compressed=void 0===r.compressed||r.compressed,this.network=r.network||networks.bitcoin}Object.defineProperty(ECPair.prototype,"Q",{get:function(){return!this.__Q&&this.d&&(this.__Q=secp256k1$2.G.multiply(this.d)),this.__Q}}),ECPair.fromPublicKeyBuffer=function(e,t){var r=lib$2.Point.decodeFrom(secp256k1$2,e);return new ECPair(null,r,{compressed:r.compressed,network:t})},ECPair.fromWIF=function(e,t){var r=wif.decode(e),n=r.version;if(types_1.Array(t)){if(!(t=t.filter(function(e){return n===e.wif}).pop()))throw new Error("Unknown network version")}else if(t=t||networks.bitcoin,n!==t.wif)throw new Error("Invalid network version");return new ECPair(lib$1.fromBuffer(r.privateKey),null,{compressed:r.compressed,network:t})},ECPair.makeRandom=function(e){var t,r=(e=e||{}).rng||browser$4;do{var n=r(32);typeforce_1(types_1.Buffer256bit,n),t=lib$1.fromBuffer(n)}while(t.signum()<=0||t.compareTo(secp256k1$2.n)>=0);return new ECPair(t,null,e)},ECPair.prototype.getAddress=function(){return address.toBase58Check(crypto.hash160(this.getPublicKeyBuffer()),this.getNetwork().pubKeyHash)},ECPair.prototype.getNetwork=function(){return this.network},ECPair.prototype.getPublicKeyBuffer=function(){return this.Q.getEncoded(this.compressed)},ECPair.prototype.sign=function(e){if(!this.d)throw new Error("Missing private key");return ecdsa.sign(e,this.d)},ECPair.prototype.toWIF=function(){if(!this.d)throw new Error("Missing private key");return wif.encode(this.network.wif,this.d.toBuffer(32),this.compressed)},ECPair.prototype.verify=function(e,t){return ecdsa.verify(e,t,this.Q)};var ecpair=ECPair,curve$1=lib$2.getCurveByName("secp256k1");function HDNode(e,t){if(typeforce_1(types_1.tuple("ECPair",types_1.Buffer256bit),arguments),!e.compressed)throw new TypeError("BIP32 only allows compressed keyPairs");this.keyPair=e,this.chainCode=t,this.depth=0,this.index=0,this.parentFingerprint=0}function ensureMerkleRootEqual(e,t){if(e!==t)throw new VerifierError(checkMerkleRoot,"Merkle root does not match remote hash.")}function ensureNotExpired(e=null){if(!e)return;const t=dateToUnixTimestamp(e);if(new Date>=t)throw new VerifierError(checkExpiresDate,"This certificate has expired.")}function intersect(e=[],t=[]){return e.filter(e=>-1!==t.indexOf(e)).filter((e,t,r)=>r.indexOf(e)===t)}function ensureNotRevoked(e,t){if(!e||!t)return;Array.isArray(t)||(t=[t]);const r=intersect(t=t.filter(e=>null!=e),e.map(e=>e.id));if(r.length>0){const t=e.findIndex(e=>e.id===r[0]);if(t>-1)throw new VerifierError(checkRevokedStatus,domain$1.certificates.generateRevocationReason(e[t].revocationReason))}}function getCaseInsensitiveKey(e,t){let r=null;for(let n in e)e.hasOwnProperty(n)&&n.toLowerCase()===t.toLowerCase()&&(r=n);return e[r]}function ensureValidIssuingKey(e,t,r){let n=!1;const i=getCaseInsensitiveKey(e,t);if(r=dateToUnixTimestamp(r),i&&(n=!0,i.created&&(n&=r>=i.created),i.revoked&&(n&=r<=i.revoked),i.expires&&(n&=r<=i.expires)),!n)throw new VerifierError(checkAuthenticity,"Transaction occurred at time when issuing address was not considered valid.")}function ensureValidReceipt(e){let t=e.targetHash;const r=e.merkleRoot;try{const r=e.proof;if(!!r)for(let e in r){const n=r[e];let i;if(void 0!==n.left)i=toByteArray$1(`${n.left}${t}`),t=sha256(i);else{if(void 0===n.right)throw new VerifierError(checkReceipt,"We should never get here.");i=toByteArray$1(`${t}${n.right}`),t=sha256(i)}}}catch(e){throw new VerifierError(checkReceipt,"The receipt is malformed. There was a problem navigating the merkle tree in the receipt.")}if(t!==r)throw new VerifierError(checkReceipt,"Invalid Merkle Receipt. Proof hash did not match Merkle root")}function isTransactionIdValid(e){if("string"==typeof e&&e.length>0)return e;throw new VerifierError(getTransactionId,"Cannot verify this certificate without a transaction ID to compare against.")}HDNode.HIGHEST_BIT=2147483648,HDNode.LENGTH=78,HDNode.MASTER_SECRET=new Buffer("Bitcoin seed"),HDNode.fromSeedBuffer=function(e,t){if(typeforce_1(types_1.tuple(types_1.Buffer,types_1.maybe(types_1.Network)),arguments),e.length<16)throw new TypeError("Seed should be at least 128 bits");if(e.length>64)throw new TypeError("Seed should be at most 512 bits");var r=browser$3("sha512",HDNode.MASTER_SECRET).update(e).digest(),n=r.slice(0,32),i=r.slice(32),o=lib$1.fromBuffer(n);return new HDNode(new ecpair(o,null,{network:t}),i)},HDNode.fromSeedHex=function(e,t){return HDNode.fromSeedBuffer(new Buffer(e,"hex"),t)},HDNode.fromBase58=function(e,t){var r=bs58check.decode(e);if(78!==r.length)throw new Error("Invalid buffer length");var n,i=r.readUInt32BE(0);if(Array.isArray(t)){if(!(n=t.filter(function(e){return i===e.bip32.private||i===e.bip32.public}).pop()))throw new Error("Unknown network version")}else n=t||networks.bitcoin;if(i!==n.bip32.private&&i!==n.bip32.public)throw new Error("Invalid network version");var o=r[4],a=r.readUInt32BE(5);if(0===o&&0!==a)throw new Error("Invalid parent fingerprint");var s=r.readUInt32BE(9);if(0===o&&0!==s)throw new Error("Invalid index");var u,c=r.slice(13,45);if(i===n.bip32.private){if(0!==r.readUInt8(45))throw new Error("Invalid private key");var f=lib$1.fromBuffer(r.slice(46,78));u=new ecpair(f,null,{network:n})}else{var l=lib$2.Point.decodeFrom(curve$1,r.slice(45,78));if(!l.compressed)throw new Error("Invalid public key");curve$1.validate(l),u=new ecpair(null,l,{network:n})}var h=new HDNode(u,c);return h.depth=o,h.index=s,h.parentFingerprint=a,h},HDNode.prototype.getAddress=function(){return this.keyPair.getAddress()},HDNode.prototype.getIdentifier=function(){return crypto.hash160(this.keyPair.getPublicKeyBuffer())},HDNode.prototype.getFingerprint=function(){return this.getIdentifier().slice(0,4)},HDNode.prototype.getNetwork=function(){return this.keyPair.getNetwork()},HDNode.prototype.getPublicKeyBuffer=function(){return this.keyPair.getPublicKeyBuffer()},HDNode.prototype.neutered=function(){var e=new HDNode(new ecpair(null,this.keyPair.Q,{network:this.keyPair.network}),this.chainCode);return e.depth=this.depth,e.index=this.index,e.parentFingerprint=this.parentFingerprint,e},HDNode.prototype.sign=function(e){return this.keyPair.sign(e)},HDNode.prototype.verify=function(e,t){return this.keyPair.verify(e,t)},HDNode.prototype.toBase58=function(e){if(void 0!==e)throw new TypeError("Unsupported argument in 2.0.0");var t=this.keyPair.network,r=this.isNeutered()?t.bip32.public:t.bip32.private,n=new Buffer(78);return n.writeUInt32BE(r,0),n.writeUInt8(this.depth,4),n.writeUInt32BE(this.parentFingerprint,5),n.writeUInt32BE(this.index,9),this.chainCode.copy(n,13),this.isNeutered()?this.keyPair.getPublicKeyBuffer().copy(n,45):(n.writeUInt8(0,45),this.keyPair.d.toBuffer(32).copy(n,46)),bs58check.encode(n)},HDNode.prototype.derive=function(e){typeforce_1(types_1.UInt32,e);var t=e>=HDNode.HIGHEST_BIT,r=new Buffer(37);if(t){if(this.isNeutered())throw new TypeError("Could not derive hardened child key");r[0]=0,this.keyPair.d.toBuffer(32).copy(r,1),r.writeUInt32BE(e,33)}else this.keyPair.getPublicKeyBuffer().copy(r,0),r.writeUInt32BE(e,33);var n,i=browser$3("sha512",this.chainCode).update(r).digest(),o=i.slice(0,32),a=i.slice(32),s=lib$1.fromBuffer(o);if(s.compareTo(curve$1.n)>=0)return this.derive(e+1);if(this.isNeutered()){var u=curve$1.G.multiply(s).add(this.keyPair.Q);if(curve$1.isInfinity(u))return this.derive(e+1);n=new ecpair(null,u,{network:this.keyPair.network})}else{var c=s.add(this.keyPair.d).mod(curve$1.n);if(0===c.signum())return this.derive(e+1);n=new ecpair(c,null,{network:this.keyPair.network})}var f=new HDNode(n,a);return f.depth=this.depth+1,f.index=e,f.parentFingerprint=this.getFingerprint().readUInt32BE(0),f},HDNode.prototype.deriveHardened=function(e){return typeforce_1(types_1.UInt31,e),this.derive(e+HDNode.HIGHEST_BIT)},HDNode.prototype.isNeutered=function(){return!this.keyPair.d},HDNode.prototype.derivePath=function(e){typeforce_1(types_1.Bip32Path,e);var t=e.split("/");if("m"===t[0]){if(this.parentFingerprint)throw new Error("Not a master node");t=t.slice(1)}return t.reduce(function(e,t){var r;return"'"===t.slice(-1)?(r=parseInt(t.slice(0,-1),10),e.deriveHardened(r)):(r=parseInt(t,10),e.derive(r))},this)},HDNode.prototype.toString=HDNode.prototype.toBase58;const log$4=browser$1("Verifier");class Verifier{constructor({certificateJson:e,chain:t,expires:r,id:n,issuer:i,receipt:o,revocationKey:a,transactionId:s,version:u}){this.chain=t,this.expires=r,this.id=n,this.issuer=i,this.receipt=o,this.revocationKey=a,this.version=u,this.transactionId=s;let c=e.document;if(!c){const t=Object.assign({},e);delete t.signature,c=t}this.documentToVerify=Object.assign({},c),this._stepsStatuses=[]}async verify(e=(()=>{})){if(this._stepCallback=e,this.version===CERTIFICATE_VERSIONS.V1_1)throw new VerifierError("","Verification of 1.1 certificates is not supported by this component. See the python cert-verifier for legacy verification");domain$1.chains.isMockChain(this.chain)?await this._verifyV2Mock():await this._verifyMain();const t=this._stepsStatuses.find(e=>e.status===FAILURE);return t?this._failed(t.message):this._succeed()}_doAction(e,t){if(this._isFailing())return;let r;e&&(r=language$1[e].labelPending,log$4(r),this._updateStatusCallback(e,r,STARTING));try{let n=t();return e&&(this._updateStatusCallback(e,r,SUCCESS),this._stepsStatuses.push({step:e,label:r,status:SUCCESS})),n}catch(t){e&&(this._updateStatusCallback(e,r,FAILURE,t.message),this._stepsStatuses.push({code:e,label:r,status:FAILURE,errorMessage:t.message}))}}async _doAsyncAction(e,t){if(this._isFailing())return;let r;e&&(r=language$1[e].labelPending,log$4(r),this._updateStatusCallback(e,r,STARTING));try{let n=await t();return e&&(this._updateStatusCallback(e,r,SUCCESS),this._stepsStatuses.push({step:e,label:r,status:SUCCESS})),n}catch(t){e&&(this._updateStatusCallback(e,r,FAILURE,t.message),this._stepsStatuses.push({code:e,label:r,status:FAILURE,errorMessage:t.message}))}}async _verifyMain(){this._doAction(getTransactionId,()=>isTransactionIdValid(this.transactionId));let e,t,r=await this._doAsyncAction(computeLocalHash,async()=>computeLocalHash$1(this.documentToVerify,this.version)),n=await this._doAsyncAction(fetchRemoteHash,async()=>domain$1.verifier.lookForTx(this.transactionId,this.chain.code,this.version)),i=await this._doAsyncAction(getIssuerProfile,async()=>domain$1.verifier.getIssuerProfile(this.issuer.id)),o=await this._doAsyncAction(parseIssuerKeys,()=>domain$1.verifier.parseIssuerKeys(i));this._doAction(compareHashes,()=>{ensureHashesEqual(r,this.receipt.targetHash)}),this._doAction(checkMerkleRoot,()=>ensureMerkleRootEqual(this.receipt.merkleRoot,n.remoteHash)),this._doAction(checkReceipt,()=>ensureValidReceipt(this.receipt)),this.version===CERTIFICATE_VERSIONS.V1_2?(t=n.revokedAddresses,e=[domain$1.verifier.parseRevocationKey(i),this.revocationKey]):(t=await this._doAsyncAction(null,async()=>domain$1.verifier.getRevokedAssertions(this.issuer.revocationList)),e=this.id),this._doAction(checkRevokedStatus,()=>ensureNotRevoked(t,e)),this._doAction(checkAuthenticity,()=>ensureValidIssuingKey(o,n.issuingAddress,n.time)),this._doAction(checkExpiresDate,()=>ensureNotExpired(this.expires))}async _verifyV2Mock(){let e=await this._doAsyncAction(computeLocalHash,async()=>computeLocalHash$1(this.documentToVerify,this.version));this._doAction(compareHashes,()=>ensureHashesEqual(e,this.receipt.targetHash)),this._doAction(checkReceipt,()=>ensureValidReceipt(this.receipt)),this._doAction(checkExpiresDate,()=>ensureNotExpired(this.expires))}_failed(e){return log$4(`failure:${e}`),{code:final,status:FAILURE,errorMessage:e}}_isFailing(){return this._stepsStatuses.some(e=>e.status===FAILURE)}_succeed(){const e=domain$1.chains.isMockChain(this.chain)?"This mock Blockcert passed all checks. Mocknet mode is only used for issuers to test their workflow locally. This Blockcert was not recorded on a blockchain, and it should not be considered a verified Blockcert.":"Success";return log$4(e),{code:final,status:SUCCESS}}_updateStatusCallback(e,t,r,n=""){if(null!=e){let i={code:e,label:t,status:r};n&&(i.errorMessage=n),this._stepCallback(i)}}}class Certificate{constructor(e){if("object"!=typeof e)try{e=JSON.parse(e)}catch(e){throw new Error("This is not a valid certificate")}this.certificateJson=JSON.parse(JSON.stringify(e)),this.parseJson(e)}parseJson(e){const t=parseJSON(e);this._setProperties(t)}async verify(e=(()=>{})){return new Verifier({certificateJson:this.certificateJson,chain:this.chain,expires:this.expires,id:this.id,issuer:this.issuer,receipt:this.receipt,revocationKey:this.revocationKey,transactionId:this.transactionId,version:this.version}).verify(e)}_setProperties({certificateImage:e,chain:t,description:r,expires:n,id:i,isFormatValid:o,issuedOn:a,issuer:s,metadataJson:u,name:c,publicKey:f,receipt:l,recipientFullName:h,recordLink:p,revocationKey:d,sealImage:g,signature:_,signatureImage:m,subtitle:y,version:v}){this.isFormatValid=o,this.certificateImage=e,this.chain=t,this.description=r,this.expires=n,this.id=i,this.issuedOn=a,this.issuer=s,this.metadataJson=u,this.name=c,this.publicKey=f,this.receipt=l,this.recipientFullName=h,this.recordLink=p,this.revocationKey=d,this.sealImage=g,this.signature=_,this.signatureImage=m,this.subtitle=y,this.verificationSteps=domain$1.certificates.getVerificationMap(t),this.version=v,this._setTransactionDetails()}_setTransactionDetails(){this.transactionId=domain$1.certificates.getTransactionId(this.receipt),this.rawTransactionLink=domain$1.certificates.getTransactionLink(this.transactionId,this.chain,!0),this.transactionLink=domain$1.certificates.getTransactionLink(this.transactionId,this.chain)}}exports.Certificate=Certificate,exports.BLOCKCHAINS=BLOCKCHAINS,exports.STEPS=verificationSteps,exports.SUB_STEPS=verificationSubSteps,exports.CERTIFICATE_VERSIONS=CERTIFICATE_VERSIONS,exports.VERIFICATION_STATUSES=verificationStatuses,exports.SignatureImage=SignatureImage;