mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-03-28 06:58:42 +00:00
3 lines
No EOL
1.1 MiB
3 lines
No EOL
1.1 MiB
/*! For license information please see bundle.js.LICENSE.txt */
|
||
(()=>{var t={2884:t=>{const e=/^\[?([^\]]+)]?:(\d+)$/;let i=new Map;t.exports=function(t){if(1e5===i.size&&i.clear(),!i.has(t)){const r=e.exec(t);if(!r)throw new Error(`invalid addr: ${t}`);i.set(t,[r[1],Number(r[2])])}return i.get(t)}},9809:(t,e,i)=>{"use strict";const r=e;r.bignum=i(4590),r.define=i(2500).define,r.base=i(1979),r.constants=i(6826),r.decoders=i(8307),r.encoders=i(6579)},2500:(t,e,i)=>{"use strict";const r=i(6579),n=i(8307),s=i(5717);function o(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}e.define=function(t,e){return new o(t,e)},o.prototype._createNamed=function(t){const e=this.name;function i(t){this._initNamed(t,e)}return s(i,t),i.prototype._initNamed=function(e,i){t.call(this,e,i)},new i(this)},o.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(n[t])),this.decoders[t]},o.prototype.decode=function(t,e,i){return this._getDecoder(e).decode(t,i)},o.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(r[t])),this.encoders[t]},o.prototype.encode=function(t,e,i){return this._getEncoder(e).encode(t,i)}},6625:(t,e,i)=>{"use strict";const r=i(5717),n=i(8465).b,s=i(2399).Buffer;function o(t,e){n.call(this,e),s.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function a(t,e){if(Array.isArray(t))this.length=0,this.value=t.map((function(t){return a.isEncoderBuffer(t)||(t=new a(t,e)),this.length+=t.length,t}),this);else if("number"==typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=s.byteLength(t);else{if(!s.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}r(o,n),e.C=o,o.isDecoderBuffer=function(t){return t instanceof o||"object"==typeof t&&s.isBuffer(t.base)&&"DecoderBuffer"===t.constructor.name&&"number"==typeof t.offset&&"number"==typeof t.length&&"function"==typeof t.save&&"function"==typeof t.restore&&"function"==typeof t.isEmpty&&"function"==typeof t.readUInt8&&"function"==typeof t.skip&&"function"==typeof t.raw},o.prototype.save=function(){return{offset:this.offset,reporter:n.prototype.save.call(this)}},o.prototype.restore=function(t){const e=new o(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,n.prototype.restore.call(this,t.reporter),e},o.prototype.isEmpty=function(){return this.offset===this.length},o.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},o.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");const i=new o(this.base);return i._reporterState=this._reporterState,i.offset=this.offset,i.length=this.offset+t,this.offset+=t,i},o.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},e.R=a,a.isEncoderBuffer=function(t){return t instanceof a||"object"==typeof t&&"EncoderBuffer"===t.constructor.name&&"number"==typeof t.length&&"function"==typeof t.join},a.prototype.join=function(t,e){return t||(t=s.alloc(this.length)),e||(e=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(i){i.join(t,e),e+=i.length})):("number"==typeof this.value?t[e]=this.value:"string"==typeof this.value?t.write(this.value,e):s.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length)),t}},1979:(t,e,i)=>{"use strict";const r=e;r.Reporter=i(8465).b,r.DecoderBuffer=i(6625).C,r.EncoderBuffer=i(6625).R,r.Node=i(1949)},1949:(t,e,i)=>{"use strict";const r=i(8465).b,n=i(6625).R,s=i(6625).C,o=i(9746),a=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],h=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);function u(t,e,i){const r={};this._baseState=r,r.name=i,r.enc=t,r.parent=e||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}t.exports=u;const l=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];u.prototype.clone=function(){const t=this._baseState,e={};l.forEach((function(i){e[i]=t[i]}));const i=new this.constructor(e.parent);return i._baseState=e,i},u.prototype._wrap=function(){const t=this._baseState;h.forEach((function(e){this[e]=function(){const i=new this.constructor(this);return t.children.push(i),i[e].apply(i,arguments)}}),this)},u.prototype._init=function(t){const e=this._baseState;o(null===e.parent),t.call(this),e.children=e.children.filter((function(t){return t._baseState.parent===this}),this),o.equal(e.children.length,1,"Root node can have only one child")},u.prototype._useArgs=function(t){const e=this._baseState,i=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==i.length&&(o(null===e.children),e.children=i,i.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(o(null===e.args),e.args=t,e.reverseArgs=t.map((function(t){if("object"!=typeof t||t.constructor!==Object)return t;const e={};return Object.keys(t).forEach((function(i){i==(0|i)&&(i|=0);const r=t[i];e[r]=i})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){u.prototype[t]=function(){const e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}})),a.forEach((function(t){u.prototype[t]=function(){const e=this._baseState,i=Array.prototype.slice.call(arguments);return o(null===e.tag),e.tag=t,this._useArgs(i),this}})),u.prototype.use=function(t){o(t);const e=this._baseState;return o(null===e.use),e.use=t,this},u.prototype.optional=function(){return this._baseState.optional=!0,this},u.prototype.def=function(t){const e=this._baseState;return o(null===e.default),e.default=t,e.optional=!0,this},u.prototype.explicit=function(t){const e=this._baseState;return o(null===e.explicit&&null===e.implicit),e.explicit=t,this},u.prototype.implicit=function(t){const e=this._baseState;return o(null===e.explicit&&null===e.implicit),e.implicit=t,this},u.prototype.obj=function(){const t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},u.prototype.key=function(t){const e=this._baseState;return o(null===e.key),e.key=t,this},u.prototype.any=function(){return this._baseState.any=!0,this},u.prototype.choice=function(t){const e=this._baseState;return o(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map((function(e){return t[e]}))),this},u.prototype.contains=function(t){const e=this._baseState;return o(null===e.use),e.contains=t,this},u.prototype._decode=function(t,e){const i=this._baseState;if(null===i.parent)return t.wrapResult(i.children[0]._decode(t,e));let r,n=i.default,o=!0,a=null;if(null!==i.key&&(a=t.enterKey(i.key)),i.optional){let r=null;if(null!==i.explicit?r=i.explicit:null!==i.implicit?r=i.implicit:null!==i.tag&&(r=i.tag),null!==r||i.any){if(o=this._peekTag(t,r,i.any),t.isError(o))return o}else{const r=t.save();try{null===i.choice?this._decodeGeneric(i.tag,t,e):this._decodeChoice(t,e),o=!0}catch(t){o=!1}t.restore(r)}}if(i.obj&&o&&(r=t.enterObject()),o){if(null!==i.explicit){const e=this._decodeTag(t,i.explicit);if(t.isError(e))return e;t=e}const r=t.offset;if(null===i.use&&null===i.choice){let e;i.any&&(e=t.save());const r=this._decodeTag(t,null!==i.implicit?i.implicit:i.tag,i.any);if(t.isError(r))return r;i.any?n=t.raw(e):t=r}if(e&&e.track&&null!==i.tag&&e.track(t.path(),r,t.length,"tagged"),e&&e.track&&null!==i.tag&&e.track(t.path(),t.offset,t.length,"content"),i.any||(n=null===i.choice?this._decodeGeneric(i.tag,t,e):this._decodeChoice(t,e)),t.isError(n))return n;if(i.any||null!==i.choice||null===i.children||i.children.forEach((function(i){i._decode(t,e)})),i.contains&&("octstr"===i.tag||"bitstr"===i.tag)){const r=new s(n);n=this._getUse(i.contains,t._reporterState.obj)._decode(r,e)}}return i.obj&&o&&(n=t.leaveObject(r)),null===i.key||null===n&&!0!==o?null!==a&&t.exitKey(a):t.leaveKey(a,i.key,n),n},u.prototype._decodeGeneric=function(t,e,i){const r=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,r.args[0],i):/str$/.test(t)?this._decodeStr(e,t,i):"objid"===t&&r.args?this._decodeObjid(e,r.args[0],r.args[1],i):"objid"===t?this._decodeObjid(e,null,null,i):"gentime"===t||"utctime"===t?this._decodeTime(e,t,i):"null_"===t?this._decodeNull(e,i):"bool"===t?this._decodeBool(e,i):"objDesc"===t?this._decodeStr(e,t,i):"int"===t||"enum"===t?this._decodeInt(e,r.args&&r.args[0],i):null!==r.use?this._getUse(r.use,e._reporterState.obj)._decode(e,i):e.error("unknown tag: "+t)},u.prototype._getUse=function(t,e){const i=this._baseState;return i.useDecoder=this._use(t,e),o(null===i.useDecoder._baseState.parent),i.useDecoder=i.useDecoder._baseState.children[0],i.implicit!==i.useDecoder._baseState.implicit&&(i.useDecoder=i.useDecoder.clone(),i.useDecoder._baseState.implicit=i.implicit),i.useDecoder},u.prototype._decodeChoice=function(t,e){const i=this._baseState;let r=null,n=!1;return Object.keys(i.choice).some((function(s){const o=t.save(),a=i.choice[s];try{const i=a._decode(t,e);if(t.isError(i))return!1;r={type:s,value:i},n=!0}catch(e){return t.restore(o),!1}return!0}),this),n?r:t.error("Choice not matched")},u.prototype._createEncoderBuffer=function(t){return new n(t,this.reporter)},u.prototype._encode=function(t,e,i){const r=this._baseState;if(null!==r.default&&r.default===t)return;const n=this._encodeValue(t,e,i);return void 0===n||this._skipDefault(n,e,i)?void 0:n},u.prototype._encodeValue=function(t,e,i){const n=this._baseState;if(null===n.parent)return n.children[0]._encode(t,e||new r);let s=null;if(this.reporter=e,n.optional&&void 0===t){if(null===n.default)return;t=n.default}let o=null,a=!1;if(n.any)s=this._createEncoderBuffer(t);else if(n.choice)s=this._encodeChoice(t,e);else if(n.contains)o=this._getUse(n.contains,i)._encode(t,e),a=!0;else if(n.children)o=n.children.map((function(i){if("null_"===i._baseState.tag)return i._encode(null,e,t);if(null===i._baseState.key)return e.error("Child should have a key");const r=e.enterKey(i._baseState.key);if("object"!=typeof t)return e.error("Child expected, but input is not object");const n=i._encode(t[i._baseState.key],e,t);return e.leaveKey(r),n}),this).filter((function(t){return t})),o=this._createEncoderBuffer(o);else if("seqof"===n.tag||"setof"===n.tag){if(!n.args||1!==n.args.length)return e.error("Too many args for : "+n.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");const i=this.clone();i._baseState.implicit=null,o=this._createEncoderBuffer(t.map((function(i){const r=this._baseState;return this._getUse(r.args[0],t)._encode(i,e)}),i))}else null!==n.use?s=this._getUse(n.use,i)._encode(t,e):(o=this._encodePrimitive(n.tag,t),a=!0);if(!n.any&&null===n.choice){const t=null!==n.implicit?n.implicit:n.tag,i=null===n.implicit?"universal":"context";null===t?null===n.use&&e.error("Tag could be omitted only for .use()"):null===n.use&&(s=this._encodeComposite(t,a,i,o))}return null!==n.explicit&&(s=this._encodeComposite(n.explicit,!1,"context",s)),s},u.prototype._encodeChoice=function(t,e){const i=this._baseState,r=i.choice[t.type];return r||o(!1,t.type+" not found in "+JSON.stringify(Object.keys(i.choice))),r._encode(t.value,e)},u.prototype._encodePrimitive=function(t,e){const i=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&i.args)return this._encodeObjid(e,i.reverseArgs[0],i.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,i.args&&i.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},u.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},u.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(t)}},8465:(t,e,i)=>{"use strict";const r=i(5717);function n(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function s(t,e){this.path=t,this.rethrow(e)}e.b=n,n.prototype.isError=function(t){return t instanceof s},n.prototype.save=function(){const t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},n.prototype.restore=function(t){const e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},n.prototype.enterKey=function(t){return this._reporterState.path.push(t)},n.prototype.exitKey=function(t){const e=this._reporterState;e.path=e.path.slice(0,t-1)},n.prototype.leaveKey=function(t,e,i){const r=this._reporterState;this.exitKey(t),null!==r.obj&&(r.obj[e]=i)},n.prototype.path=function(){return this._reporterState.path.join("/")},n.prototype.enterObject=function(){const t=this._reporterState,e=t.obj;return t.obj={},e},n.prototype.leaveObject=function(t){const e=this._reporterState,i=e.obj;return e.obj=t,i},n.prototype.error=function(t){let e;const i=this._reporterState,r=t instanceof s;if(e=r?t:new s(i.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),t.message||t,t.stack),!i.options.partial)throw e;return r||i.errors.push(e),e},n.prototype.wrapResult=function(t){const e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},r(s,Error),s.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,s),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},160:(t,e)=>{"use strict";function i(t){const e={};return Object.keys(t).forEach((function(i){(0|i)==i&&(i|=0);const r=t[i];e[r]=i})),e}e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=i(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=i(e.tag)},6826:(t,e,i)=>{"use strict";const r=e;r._reverse=function(t){const e={};return Object.keys(t).forEach((function(i){(0|i)==i&&(i|=0);const r=t[i];e[r]=i})),e},r.der=i(160)},1671:(t,e,i)=>{"use strict";const r=i(5717),n=i(4590),s=i(6625).C,o=i(1949),a=i(160);function h(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new u,this.tree._init(t.body)}function u(t){o.call(this,"der",t)}function l(t,e){let i=t.readUInt8(e);if(t.isError(i))return i;const r=a.tagClass[i>>6],n=0==(32&i);if(31==(31&i)){let r=i;for(i=0;128==(128&r);){if(r=t.readUInt8(e),t.isError(r))return r;i<<=7,i|=127&r}}else i&=31;return{cls:r,primitive:n,tag:i,tagStr:a.tag[i]}}function c(t,e,i){let r=t.readUInt8(i);if(t.isError(r))return r;if(!e&&128===r)return null;if(0==(128&r))return r;const n=127&r;if(n>4)return t.error("length octect is too long");r=0;for(let e=0;e<n;e++){r<<=8;const e=t.readUInt8(i);if(t.isError(e))return e;r|=e}return r}t.exports=h,h.prototype.decode=function(t,e){return s.isDecoderBuffer(t)||(t=new s(t,e)),this.tree._decode(t,e)},r(u,o),u.prototype._peekTag=function(t,e,i){if(t.isEmpty())return!1;const r=t.save(),n=l(t,'Failed to peek tag: "'+e+'"');return t.isError(n)?n:(t.restore(r),n.tag===e||n.tagStr===e||n.tagStr+"of"===e||i)},u.prototype._decodeTag=function(t,e,i){const r=l(t,'Failed to decode tag of "'+e+'"');if(t.isError(r))return r;let n=c(t,r.primitive,'Failed to get length of "'+e+'"');if(t.isError(n))return n;if(!i&&r.tag!==e&&r.tagStr!==e&&r.tagStr+"of"!==e)return t.error('Failed to match tag: "'+e+'"');if(r.primitive||null!==n)return t.skip(n,'Failed to match body of: "'+e+'"');const s=t.save(),o=this._skipUntilEnd(t,'Failed to skip indefinite length body: "'+this.tag+'"');return t.isError(o)?o:(n=t.offset-s.offset,t.restore(s),t.skip(n,'Failed to match body of: "'+e+'"'))},u.prototype._skipUntilEnd=function(t,e){for(;;){const i=l(t,e);if(t.isError(i))return i;const r=c(t,i.primitive,e);if(t.isError(r))return r;let n;if(n=i.primitive||null!==r?t.skip(r):this._skipUntilEnd(t,e),t.isError(n))return n;if("end"===i.tagStr)break}},u.prototype._decodeList=function(t,e,i,r){const n=[];for(;!t.isEmpty();){const e=this._peekTag(t,"end");if(t.isError(e))return e;const s=i.decode(t,"der",r);if(t.isError(s)&&e)break;n.push(s)}return n},u.prototype._decodeStr=function(t,e){if("bitstr"===e){const e=t.readUInt8();return t.isError(e)?e:{unused:e,data:t.raw()}}if("bmpstr"===e){const e=t.raw();if(e.length%2==1)return t.error("Decoding of string type: bmpstr length mismatch");let i="";for(let t=0;t<e.length/2;t++)i+=String.fromCharCode(e.readUInt16BE(2*t));return i}if("numstr"===e){const e=t.raw().toString("ascii");return this._isNumstr(e)?e:t.error("Decoding of string type: numstr unsupported characters")}if("octstr"===e)return t.raw();if("objDesc"===e)return t.raw();if("printstr"===e){const e=t.raw().toString("ascii");return this._isPrintstr(e)?e:t.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(e)?t.raw().toString():t.error("Decoding of string type: "+e+" unsupported")},u.prototype._decodeObjid=function(t,e,i){let r;const n=[];let s=0,o=0;for(;!t.isEmpty();)o=t.readUInt8(),s<<=7,s|=127&o,0==(128&o)&&(n.push(s),s=0);128&o&&n.push(s);const a=n[0]/40|0,h=n[0]%40;if(r=i?n:[a,h].concat(n.slice(1)),e){let t=e[r.join(" ")];void 0===t&&(t=e[r.join(".")]),void 0!==t&&(r=t)}return r},u.prototype._decodeTime=function(t,e){const i=t.raw().toString();let r,n,s,o,a,h;if("gentime"===e)r=0|i.slice(0,4),n=0|i.slice(4,6),s=0|i.slice(6,8),o=0|i.slice(8,10),a=0|i.slice(10,12),h=0|i.slice(12,14);else{if("utctime"!==e)return t.error("Decoding "+e+" time is not supported yet");r=0|i.slice(0,2),n=0|i.slice(2,4),s=0|i.slice(4,6),o=0|i.slice(6,8),a=0|i.slice(8,10),h=0|i.slice(10,12),r=r<70?2e3+r:1900+r}return Date.UTC(r,n-1,s,o,a,h,0)},u.prototype._decodeNull=function(){return null},u.prototype._decodeBool=function(t){const e=t.readUInt8();return t.isError(e)?e:0!==e},u.prototype._decodeInt=function(t,e){const i=t.raw();let r=new n(i);return e&&(r=e[r.toString(10)]||r),r},u.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getDecoder("der").tree}},8307:(t,e,i)=>{"use strict";const r=e;r.der=i(1671),r.pem=i(9631)},9631:(t,e,i)=>{"use strict";const r=i(5717),n=i(2399).Buffer,s=i(1671);function o(t){s.call(this,t),this.enc="pem"}r(o,s),t.exports=o,o.prototype.decode=function(t,e){const i=t.toString().split(/[\r\n]+/g),r=e.label.toUpperCase(),o=/^-----(BEGIN|END) ([^-]+)-----$/;let a=-1,h=-1;for(let t=0;t<i.length;t++){const e=i[t].match(o);if(null!==e&&e[2]===r){if(-1!==a){if("END"!==e[1])break;h=t;break}if("BEGIN"!==e[1])break;a=t}}if(-1===a||-1===h)throw new Error("PEM section not found for: "+r);const u=i.slice(a+1,h).join("");u.replace(/[^a-z0-9+/=]+/gi,"");const l=n.from(u,"base64");return s.prototype.decode.call(this,l,e)}},6984:(t,e,i)=>{"use strict";const r=i(5717),n=i(2399).Buffer,s=i(1949),o=i(160);function a(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new h,this.tree._init(t.body)}function h(t){s.call(this,"der",t)}function u(t){return t<10?"0"+t:t}t.exports=a,a.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},r(h,s),h.prototype._encodeComposite=function(t,e,i,r){const s=function(t,e,i,r){let n;if("seqof"===t?t="seq":"setof"===t&&(t="set"),o.tagByName.hasOwnProperty(t))n=o.tagByName[t];else{if("number"!=typeof t||(0|t)!==t)return r.error("Unknown tag: "+t);n=t}return n>=31?r.error("Multi-octet tag encoding unsupported"):(e||(n|=32),n|=o.tagClassByName[i||"universal"]<<6,n)}(t,e,i,this.reporter);if(r.length<128){const t=n.alloc(2);return t[0]=s,t[1]=r.length,this._createEncoderBuffer([t,r])}let a=1;for(let t=r.length;t>=256;t>>=8)a++;const h=n.alloc(2+a);h[0]=s,h[1]=128|a;for(let t=1+a,e=r.length;e>0;t--,e>>=8)h[t]=255&e;return this._createEncoderBuffer([h,r])},h.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){const e=n.alloc(2*t.length);for(let i=0;i<t.length;i++)e.writeUInt16BE(t.charCodeAt(i),2*i);return this._createEncoderBuffer(e)}return"numstr"===e?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===e?this._isPrintstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(e)||"objDesc"===e?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: "+e+" unsupported")},h.prototype._encodeObjid=function(t,e,i){if("string"==typeof t){if(!e)return this.reporter.error("string objid given, but no values map found");if(!e.hasOwnProperty(t))return this.reporter.error("objid not found in values map");t=e[t].split(/[\s.]+/g);for(let e=0;e<t.length;e++)t[e]|=0}else if(Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]|=0}if(!Array.isArray(t))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(t));if(!i){if(t[1]>=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}let r=0;for(let e=0;e<t.length;e++){let i=t[e];for(r++;i>=128;i>>=7)r++}const s=n.alloc(r);let o=s.length-1;for(let e=t.length-1;e>=0;e--){let i=t[e];for(s[o--]=127&i;(i>>=7)>0;)s[o--]=128|127&i}return this._createEncoderBuffer(s)},h.prototype._encodeTime=function(t,e){let i;const r=new Date(t);return"gentime"===e?i=[u(r.getUTCFullYear()),u(r.getUTCMonth()+1),u(r.getUTCDate()),u(r.getUTCHours()),u(r.getUTCMinutes()),u(r.getUTCSeconds()),"Z"].join(""):"utctime"===e?i=[u(r.getUTCFullYear()%100),u(r.getUTCMonth()+1),u(r.getUTCDate()),u(r.getUTCHours()),u(r.getUTCMinutes()),u(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(i,"octstr")},h.prototype._encodeNull=function(){return this._createEncoderBuffer("")},h.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!n.isBuffer(t)){const e=t.toArray();!t.sign&&128&e[0]&&e.unshift(0),t=n.from(e)}if(n.isBuffer(t)){let e=t.length;0===t.length&&e++;const i=n.alloc(e);return t.copy(i),0===t.length&&(i[0]=0),this._createEncoderBuffer(i)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);let i=1;for(let e=t;e>=256;e>>=8)i++;const r=new Array(i);for(let e=r.length-1;e>=0;e--)r[e]=255&t,t>>=8;return 128&r[0]&&r.unshift(0),this._createEncoderBuffer(n.from(r))},h.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},h.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},h.prototype._skipDefault=function(t,e,i){const r=this._baseState;let n;if(null===r.default)return!1;const s=t.join();if(void 0===r.defaultBuffer&&(r.defaultBuffer=this._encodeValue(r.default,e,i).join()),s.length!==r.defaultBuffer.length)return!1;for(n=0;n<s.length;n++)if(s[n]!==r.defaultBuffer[n])return!1;return!0}},6579:(t,e,i)=>{"use strict";const r=e;r.der=i(6984),r.pem=i(2883)},2883:(t,e,i)=>{"use strict";const r=i(5717),n=i(6984);function s(t){n.call(this,t),this.enc="pem"}r(s,n),t.exports=s,s.prototype.encode=function(t,e){const i=n.prototype.encode.call(this,t).toString("base64"),r=["-----BEGIN "+e.label+"-----"];for(let t=0;t<i.length;t+=64)r.push(i.slice(t,t+64));return r.push("-----END "+e.label+"-----"),r.join("\n")}},4590:function(t,e,i){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function s(t,e,i){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var o;"object"==typeof t?t.exports=s:e.BN=s,s.BN=s,s.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:i(950).Buffer}catch(t){}function a(t,e){var i=t.charCodeAt(e);return i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function h(t,e,i){var r=a(t,i);return i-1>=e&&(r|=a(t,i-1)<<4),r}function u(t,e,i,r){for(var n=0,s=Math.min(t.length,i),o=e;o<s;o++){var a=t.charCodeAt(o)-48;n*=r,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}s.isBN=function(t){return t instanceof s||null!==t&&"object"==typeof t&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===e?this._parseHex(t,n,i):(this._parseBase(t,e,n),"le"===i&&this._initArray(this.toArray(),e,i)))},s.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},s.prototype._initArray=function(t,e,i){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var s,o,a=0;if("be"===i)for(n=t.length-1,s=0;n>=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===i)for(n=0,s=0;n<t.length;n+=3)o=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(t,e,i){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,s=0,o=0;if("be"===i)for(r=t.length-1;r>=e;r-=2)n=h(t,e,r)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(r=(t.length-e)%2==0?e+1:e;r<t.length;r+=2)n=h(t,e,r)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this.strip()},s.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var s=t.length-i,o=s%r,a=Math.min(s,s-o)+i,h=0,l=i;l<a;l+=r)h=u(t,l,l+r,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==o){var c=1;for(h=u(t,l,t.length,e),l=0;l<o;l++)c*=e;this.imuln(c),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this.strip()},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],s=0|e.words[0],o=n*s,a=67108863&o,h=o/67108864|0;i.words[0]=a;for(var u=1;u<r;u++){for(var l=h>>>26,c=67108863&h,d=Math.min(u,e.length-1),f=Math.max(0,u-t.length+1);f<=d;f++){var p=u-f|0;l+=(o=(n=0|t.words[p])*(s=0|e.words[f])+c)/67108864|0,c=67108863&o}i.words[u]=0|c,h=0|l}return 0!==h?i.words[u]=0|h:i.length--,i.strip()}s.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var n=0,s=0,o=0;o<this.length;o++){var a=this.words[o],h=(16777215&(a<<n|s)).toString(16);i=0!=(s=a>>>24-n&16777215)||o!==this.length-1?l[6-h.length]+h+i:h+i,(n+=2)>=26&&(n-=26,o--)}for(0!==s&&(i=s.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var u=c[t],f=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(t);i=(p=p.idivn(f)).isZero()?m+i:l[u-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return r(void 0!==o),this.toArrayLike(o,t,e)},s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,i){var n=this.byteLength(),s=i||Math.max(1,n);r(n<=s,"byte array longer than desired length"),r(s>0,"Requested array length <= 0"),this.strip();var o,a,h="le"===e,u=new t(s),l=this.clone();if(h){for(a=0;!l.isZero();a++)o=l.andln(255),l.iushrn(8),u[a]=o;for(;a<s;a++)u[a]=0}else{for(a=0;a<s-n;a++)u[a]=0;for(a=0;!l.isZero();a++)o=l.andln(255),l.iushrn(8),u[s-a-1]=o}return u},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var i=this._zeroBits(this.words[e]);if(t+=i,26!==i)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},s.prototype.ior=function(t){return r(0==(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=e.length,this.strip()},s.prototype.iand=function(t){return r(0==(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;r<i.length;r++)this.words[r]=e.words[r]^i.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},s.prototype.ixor=function(t){return r(0==(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},s.prototype.iadd=function(t){var e,i,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0,s=0;s<r.length;s++)e=(0|i.words[s])+(0|r.words[s])+n,this.words[s]=67108863&e,n=e>>>26;for(;0!==n&&s<i.length;s++)e=(0|i.words[s])+n,this.words[s]=67108863&e,n=e>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var s=0,o=0;o<r.length;o++)s=(e=(0|i.words[o])-(0|r.words[o])+s)>>26,this.words[o]=67108863&e;for(;0!==s&&o<i.length;o++)s=(e=(0|i.words[o])+s)>>26,this.words[o]=67108863&e;if(0===s&&o<i.length&&i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this.length=Math.max(this.length,o),i!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,i){var r,n,s,o=t.words,a=e.words,h=i.words,u=0,l=0|o[0],c=8191&l,d=l>>>13,f=0|o[1],p=8191&f,m=f>>>13,g=0|o[2],b=8191&g,v=g>>>13,y=0|o[3],w=8191&y,_=y>>>13,M=0|o[4],k=8191&M,x=M>>>13,E=0|o[5],S=8191&E,T=E>>>13,A=0|o[6],I=8191&A,C=A>>>13,B=0|o[7],R=8191&B,P=B>>>13,L=0|o[8],O=8191&L,D=L>>>13,N=0|o[9],j=8191&N,U=N>>>13,F=0|a[0],q=8191&F,z=F>>>13,H=0|a[1],W=8191&H,$=H>>>13,Z=0|a[2],V=8191&Z,K=Z>>>13,G=0|a[3],J=8191&G,Y=G>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],it=8191&et,rt=et>>>13,nt=0|a[6],st=8191&nt,ot=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,lt=0|a[8],ct=8191<,dt=lt>>>13,ft=0|a[9],pt=8191&ft,mt=ft>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(u+(r=Math.imul(c,q))|0)+((8191&(n=(n=Math.imul(c,z))+Math.imul(d,q)|0))<<13)|0;u=((s=Math.imul(d,z))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(p,q),n=(n=Math.imul(p,z))+Math.imul(m,q)|0,s=Math.imul(m,z);var bt=(u+(r=r+Math.imul(c,W)|0)|0)+((8191&(n=(n=n+Math.imul(c,$)|0)+Math.imul(d,W)|0))<<13)|0;u=((s=s+Math.imul(d,$)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,q),n=(n=Math.imul(b,z))+Math.imul(v,q)|0,s=Math.imul(v,z),r=r+Math.imul(p,W)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(m,W)|0,s=s+Math.imul(m,$)|0;var vt=(u+(r=r+Math.imul(c,V)|0)|0)+((8191&(n=(n=n+Math.imul(c,K)|0)+Math.imul(d,V)|0))<<13)|0;u=((s=s+Math.imul(d,K)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(w,q),n=(n=Math.imul(w,z))+Math.imul(_,q)|0,s=Math.imul(_,z),r=r+Math.imul(b,W)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(v,W)|0,s=s+Math.imul(v,$)|0,r=r+Math.imul(p,V)|0,n=(n=n+Math.imul(p,K)|0)+Math.imul(m,V)|0,s=s+Math.imul(m,K)|0;var yt=(u+(r=r+Math.imul(c,J)|0)|0)+((8191&(n=(n=n+Math.imul(c,Y)|0)+Math.imul(d,J)|0))<<13)|0;u=((s=s+Math.imul(d,Y)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(k,q),n=(n=Math.imul(k,z))+Math.imul(x,q)|0,s=Math.imul(x,z),r=r+Math.imul(w,W)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(_,W)|0,s=s+Math.imul(_,$)|0,r=r+Math.imul(b,V)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(v,V)|0,s=s+Math.imul(v,K)|0,r=r+Math.imul(p,J)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(m,J)|0,s=s+Math.imul(m,Y)|0;var wt=(u+(r=r+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;u=((s=s+Math.imul(d,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(S,q),n=(n=Math.imul(S,z))+Math.imul(T,q)|0,s=Math.imul(T,z),r=r+Math.imul(k,W)|0,n=(n=n+Math.imul(k,$)|0)+Math.imul(x,W)|0,s=s+Math.imul(x,$)|0,r=r+Math.imul(w,V)|0,n=(n=n+Math.imul(w,K)|0)+Math.imul(_,V)|0,s=s+Math.imul(_,K)|0,r=r+Math.imul(b,J)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(v,J)|0,s=s+Math.imul(v,Y)|0,r=r+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,tt)|0;var _t=(u+(r=r+Math.imul(c,it)|0)|0)+((8191&(n=(n=n+Math.imul(c,rt)|0)+Math.imul(d,it)|0))<<13)|0;u=((s=s+Math.imul(d,rt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(I,q),n=(n=Math.imul(I,z))+Math.imul(C,q)|0,s=Math.imul(C,z),r=r+Math.imul(S,W)|0,n=(n=n+Math.imul(S,$)|0)+Math.imul(T,W)|0,s=s+Math.imul(T,$)|0,r=r+Math.imul(k,V)|0,n=(n=n+Math.imul(k,K)|0)+Math.imul(x,V)|0,s=s+Math.imul(x,K)|0,r=r+Math.imul(w,J)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,J)|0,s=s+Math.imul(_,Y)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,Q)|0,s=s+Math.imul(v,tt)|0,r=r+Math.imul(p,it)|0,n=(n=n+Math.imul(p,rt)|0)+Math.imul(m,it)|0,s=s+Math.imul(m,rt)|0;var Mt=(u+(r=r+Math.imul(c,st)|0)|0)+((8191&(n=(n=n+Math.imul(c,ot)|0)+Math.imul(d,st)|0))<<13)|0;u=((s=s+Math.imul(d,ot)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(R,q),n=(n=Math.imul(R,z))+Math.imul(P,q)|0,s=Math.imul(P,z),r=r+Math.imul(I,W)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(C,W)|0,s=s+Math.imul(C,$)|0,r=r+Math.imul(S,V)|0,n=(n=n+Math.imul(S,K)|0)+Math.imul(T,V)|0,s=s+Math.imul(T,K)|0,r=r+Math.imul(k,J)|0,n=(n=n+Math.imul(k,Y)|0)+Math.imul(x,J)|0,s=s+Math.imul(x,Y)|0,r=r+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,tt)|0,r=r+Math.imul(b,it)|0,n=(n=n+Math.imul(b,rt)|0)+Math.imul(v,it)|0,s=s+Math.imul(v,rt)|0,r=r+Math.imul(p,st)|0,n=(n=n+Math.imul(p,ot)|0)+Math.imul(m,st)|0,s=s+Math.imul(m,ot)|0;var kt=(u+(r=r+Math.imul(c,ht)|0)|0)+((8191&(n=(n=n+Math.imul(c,ut)|0)+Math.imul(d,ht)|0))<<13)|0;u=((s=s+Math.imul(d,ut)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(O,q),n=(n=Math.imul(O,z))+Math.imul(D,q)|0,s=Math.imul(D,z),r=r+Math.imul(R,W)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(P,W)|0,s=s+Math.imul(P,$)|0,r=r+Math.imul(I,V)|0,n=(n=n+Math.imul(I,K)|0)+Math.imul(C,V)|0,s=s+Math.imul(C,K)|0,r=r+Math.imul(S,J)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(T,J)|0,s=s+Math.imul(T,Y)|0,r=r+Math.imul(k,Q)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(x,Q)|0,s=s+Math.imul(x,tt)|0,r=r+Math.imul(w,it)|0,n=(n=n+Math.imul(w,rt)|0)+Math.imul(_,it)|0,s=s+Math.imul(_,rt)|0,r=r+Math.imul(b,st)|0,n=(n=n+Math.imul(b,ot)|0)+Math.imul(v,st)|0,s=s+Math.imul(v,ot)|0,r=r+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,s=s+Math.imul(m,ut)|0;var xt=(u+(r=r+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;u=((s=s+Math.imul(d,dt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(j,q),n=(n=Math.imul(j,z))+Math.imul(U,q)|0,s=Math.imul(U,z),r=r+Math.imul(O,W)|0,n=(n=n+Math.imul(O,$)|0)+Math.imul(D,W)|0,s=s+Math.imul(D,$)|0,r=r+Math.imul(R,V)|0,n=(n=n+Math.imul(R,K)|0)+Math.imul(P,V)|0,s=s+Math.imul(P,K)|0,r=r+Math.imul(I,J)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(C,J)|0,s=s+Math.imul(C,Y)|0,r=r+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(T,Q)|0,s=s+Math.imul(T,tt)|0,r=r+Math.imul(k,it)|0,n=(n=n+Math.imul(k,rt)|0)+Math.imul(x,it)|0,s=s+Math.imul(x,rt)|0,r=r+Math.imul(w,st)|0,n=(n=n+Math.imul(w,ot)|0)+Math.imul(_,st)|0,s=s+Math.imul(_,ot)|0,r=r+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(v,ht)|0,s=s+Math.imul(v,ut)|0,r=r+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,dt)|0)+Math.imul(m,ct)|0,s=s+Math.imul(m,dt)|0;var Et=(u+(r=r+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,mt)|0)+Math.imul(d,pt)|0))<<13)|0;u=((s=s+Math.imul(d,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(j,W),n=(n=Math.imul(j,$))+Math.imul(U,W)|0,s=Math.imul(U,$),r=r+Math.imul(O,V)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(D,V)|0,s=s+Math.imul(D,K)|0,r=r+Math.imul(R,J)|0,n=(n=n+Math.imul(R,Y)|0)+Math.imul(P,J)|0,s=s+Math.imul(P,Y)|0,r=r+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,s=s+Math.imul(C,tt)|0,r=r+Math.imul(S,it)|0,n=(n=n+Math.imul(S,rt)|0)+Math.imul(T,it)|0,s=s+Math.imul(T,rt)|0,r=r+Math.imul(k,st)|0,n=(n=n+Math.imul(k,ot)|0)+Math.imul(x,st)|0,s=s+Math.imul(x,ot)|0,r=r+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(_,ht)|0,s=s+Math.imul(_,ut)|0,r=r+Math.imul(b,ct)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(v,ct)|0,s=s+Math.imul(v,dt)|0;var St=(u+(r=r+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((s=s+Math.imul(m,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(j,V),n=(n=Math.imul(j,K))+Math.imul(U,V)|0,s=Math.imul(U,K),r=r+Math.imul(O,J)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(D,J)|0,s=s+Math.imul(D,Y)|0,r=r+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,tt)|0,r=r+Math.imul(I,it)|0,n=(n=n+Math.imul(I,rt)|0)+Math.imul(C,it)|0,s=s+Math.imul(C,rt)|0,r=r+Math.imul(S,st)|0,n=(n=n+Math.imul(S,ot)|0)+Math.imul(T,st)|0,s=s+Math.imul(T,ot)|0,r=r+Math.imul(k,ht)|0,n=(n=n+Math.imul(k,ut)|0)+Math.imul(x,ht)|0,s=s+Math.imul(x,ut)|0,r=r+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,dt)|0)+Math.imul(_,ct)|0,s=s+Math.imul(_,dt)|0;var Tt=(u+(r=r+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,pt)|0))<<13)|0;u=((s=s+Math.imul(v,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(j,J),n=(n=Math.imul(j,Y))+Math.imul(U,J)|0,s=Math.imul(U,Y),r=r+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(D,Q)|0,s=s+Math.imul(D,tt)|0,r=r+Math.imul(R,it)|0,n=(n=n+Math.imul(R,rt)|0)+Math.imul(P,it)|0,s=s+Math.imul(P,rt)|0,r=r+Math.imul(I,st)|0,n=(n=n+Math.imul(I,ot)|0)+Math.imul(C,st)|0,s=s+Math.imul(C,ot)|0,r=r+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(T,ht)|0,s=s+Math.imul(T,ut)|0,r=r+Math.imul(k,ct)|0,n=(n=n+Math.imul(k,dt)|0)+Math.imul(x,ct)|0,s=s+Math.imul(x,dt)|0;var At=(u+(r=r+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((s=s+Math.imul(_,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(j,Q),n=(n=Math.imul(j,tt))+Math.imul(U,Q)|0,s=Math.imul(U,tt),r=r+Math.imul(O,it)|0,n=(n=n+Math.imul(O,rt)|0)+Math.imul(D,it)|0,s=s+Math.imul(D,rt)|0,r=r+Math.imul(R,st)|0,n=(n=n+Math.imul(R,ot)|0)+Math.imul(P,st)|0,s=s+Math.imul(P,ot)|0,r=r+Math.imul(I,ht)|0,n=(n=n+Math.imul(I,ut)|0)+Math.imul(C,ht)|0,s=s+Math.imul(C,ut)|0,r=r+Math.imul(S,ct)|0,n=(n=n+Math.imul(S,dt)|0)+Math.imul(T,ct)|0,s=s+Math.imul(T,dt)|0;var It=(u+(r=r+Math.imul(k,pt)|0)|0)+((8191&(n=(n=n+Math.imul(k,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((s=s+Math.imul(x,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(j,it),n=(n=Math.imul(j,rt))+Math.imul(U,it)|0,s=Math.imul(U,rt),r=r+Math.imul(O,st)|0,n=(n=n+Math.imul(O,ot)|0)+Math.imul(D,st)|0,s=s+Math.imul(D,ot)|0,r=r+Math.imul(R,ht)|0,n=(n=n+Math.imul(R,ut)|0)+Math.imul(P,ht)|0,s=s+Math.imul(P,ut)|0,r=r+Math.imul(I,ct)|0,n=(n=n+Math.imul(I,dt)|0)+Math.imul(C,ct)|0,s=s+Math.imul(C,dt)|0;var Ct=(u+(r=r+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((s=s+Math.imul(T,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(j,st),n=(n=Math.imul(j,ot))+Math.imul(U,st)|0,s=Math.imul(U,ot),r=r+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(D,ht)|0,s=s+Math.imul(D,ut)|0,r=r+Math.imul(R,ct)|0,n=(n=n+Math.imul(R,dt)|0)+Math.imul(P,ct)|0,s=s+Math.imul(P,dt)|0;var Bt=(u+(r=r+Math.imul(I,pt)|0)|0)+((8191&(n=(n=n+Math.imul(I,mt)|0)+Math.imul(C,pt)|0))<<13)|0;u=((s=s+Math.imul(C,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,r=Math.imul(j,ht),n=(n=Math.imul(j,ut))+Math.imul(U,ht)|0,s=Math.imul(U,ut),r=r+Math.imul(O,ct)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(D,ct)|0,s=s+Math.imul(D,dt)|0;var Rt=(u+(r=r+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((s=s+Math.imul(P,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(j,ct),n=(n=Math.imul(j,dt))+Math.imul(U,ct)|0,s=Math.imul(U,dt);var Pt=(u+(r=r+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(D,pt)|0))<<13)|0;u=((s=s+Math.imul(D,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Lt=(u+(r=Math.imul(j,pt))|0)+((8191&(n=(n=Math.imul(j,mt))+Math.imul(U,pt)|0))<<13)|0;return u=((s=Math.imul(U,mt))+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,h[0]=gt,h[1]=bt,h[2]=vt,h[3]=yt,h[4]=wt,h[5]=_t,h[6]=Mt,h[7]=kt,h[8]=xt,h[9]=Et,h[10]=St,h[11]=Tt,h[12]=At,h[13]=It,h[14]=Ct,h[15]=Bt,h[16]=Rt,h[17]=Pt,h[18]=Lt,0!==u&&(h[19]=u,i.length++),i};function m(t,e,i){return(new g).mulp(t,e,i)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=f),s.prototype.mulTo=function(t,e){var i,r=this.length+t.length;return i=10===this.length&&10===t.length?p(this,t,e):r<63?f(this,t,e):r<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,s=0;s<i.length-1;s++){var o=n;n=0;for(var a=67108863&r,h=Math.min(s,e.length-1),u=Math.max(0,s-t.length+1);u<=h;u++){var l=s-u,c=(0|t.words[l])*(0|e.words[u]),d=67108863&c;a=67108863&(d=d+a|0),n+=(o=(o=o+(c/67108864|0)|0)+(d>>>26)|0)>>>26,o&=67108863}i.words[s]=a,r=o,o=n}return 0!==r?i.words[s]=r:i.length--,i.strip()}(this,t,e):m(this,t,e),i},g.prototype.makeRBT=function(t){for(var e=new Array(t),i=s.prototype._countBits(t)-1,r=0;r<t;r++)e[r]=this.revBin(r,i,t);return e},g.prototype.revBin=function(t,e,i){if(0===t||t===i-1)return t;for(var r=0,n=0;n<e;n++)r|=(1&t)<<e-n-1,t>>=1;return r},g.prototype.permute=function(t,e,i,r,n,s){for(var o=0;o<s;o++)r[o]=e[t[o]],n[o]=i[t[o]]},g.prototype.transform=function(t,e,i,r,n,s){this.permute(s,t,e,i,r,n);for(var o=1;o<n;o<<=1)for(var a=o<<1,h=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),l=0;l<n;l+=a)for(var c=h,d=u,f=0;f<o;f++){var p=i[l+f],m=r[l+f],g=i[l+f+o],b=r[l+f+o],v=c*g-d*b;b=c*b+d*g,g=v,i[l+f]=p+g,r[l+f]=m+b,i[l+f+o]=p-g,r[l+f+o]=m-b,f!==a&&(v=h*c-u*d,d=h*d+u*c,c=v)}},g.prototype.guessLen13b=function(t,e){var i=1|Math.max(e,t),r=1&i,n=0;for(i=i/2|0;i;i>>>=1)n++;return 1<<n+1+r},g.prototype.conjugate=function(t,e,i){if(!(i<=1))for(var r=0;r<i/2;r++){var n=t[r];t[r]=t[i-r-1],t[i-r-1]=n,n=e[r],e[r]=-e[i-r-1],e[i-r-1]=-n}},g.prototype.normalize13b=function(t,e){for(var i=0,r=0;r<e/2;r++){var n=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+i;t[r]=67108863&n,i=n<67108864?0:n/67108864|0}return t},g.prototype.convert13b=function(t,e,i,n){for(var s=0,o=0;o<e;o++)s+=0|t[o],i[2*o]=8191&s,s>>>=13,i[2*o+1]=8191&s,s>>>=13;for(o=2*e;o<n;++o)i[o]=0;r(0===s),r(0==(-8192&s))},g.prototype.stub=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=0;return e},g.prototype.mulp=function(t,e,i){var r=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(r),s=this.stub(r),o=new Array(r),a=new Array(r),h=new Array(r),u=new Array(r),l=new Array(r),c=new Array(r),d=i.words;d.length=r,this.convert13b(t.words,t.length,o,r),this.convert13b(e.words,e.length,u,r),this.transform(o,s,a,h,r,n),this.transform(u,s,l,c,r,n);for(var f=0;f<r;f++){var p=a[f]*l[f]-h[f]*c[f];h[f]=a[f]*c[f]+h[f]*l[f],a[f]=p}return this.conjugate(a,h,r),this.transform(a,h,d,s,r,n),this.conjugate(d,s,r),this.normalize13b(d,r),i.negative=t.negative^e.negative,i.length=t.length+e.length,i.strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),m(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){r("number"==typeof t),r(t<67108864);for(var e=0,i=0;i<this.length;i++){var n=(0|this.words[i])*t,s=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=s>>>26,this.words[i]=67108863&s}return 0!==e&&(this.words[i]=e,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i<e.length;i++){var r=i/26|0,n=i%26;e[i]=(t.words[r]&1<<n)>>>n}return e}(t);if(0===e.length)return new s(1);for(var i=this,r=0;r<e.length&&0===e[r];r++,i=i.sqr());if(++r<e.length)for(var n=i.sqr();r<e.length;r++,n=n.sqr())0!==e[r]&&(i=i.mul(n));return i},s.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,i=t%26,n=(t-i)/26,s=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&s,h=(0|this.words[e])-a<<i;this.words[e]=h|o,o=a>>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},s.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,i){var n;r("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<<s,h=i;if(n-=o,n=Math.max(0,n),h){for(var u=0;u<o;u++)h.words[u]=this.words[u];h.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=n);u--){var c=0|this.words[u];this.words[u]=l<<26-s|c>>>s,l=c&a}return h&&0!==l&&(h.words[h.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26,n=1<<e;return!(this.length<=i||!(this.words[i]&n))},s.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return r("number"==typeof t),r(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,i){var n,s,o=t.length+i;this._expand(o);var a=0;for(n=0;n<t.length;n++){s=(0|this.words[n+i])+a;var h=(0|t.words[n])*e;a=((s-=67108863&h)>>26)-(h/67108864|0),this.words[n+i]=67108863&s}for(;n<this.length-i;n++)a=(s=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&s;if(0===a)return this.strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(s=-(0|this.words[n])+a)>>26,this.words[n]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,e){var i=(this.length,t.length),r=this.clone(),n=t,o=0|n.words[n.length-1];0!=(i=26-this._countBits(o))&&(n=n.ushln(i),r.iushln(i),o=0|n.words[n.length-1]);var a,h=r.length-n.length;if("mod"!==e){(a=new s(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=r.clone()._ishlnsubmul(n,1,h);0===l.negative&&(r=l,a&&(a.words[h]=1));for(var c=h-1;c>=0;c--){var d=67108864*(0|r.words[n.length+c])+(0|r.words[n.length+c-1]);for(d=Math.min(d/o|0,67108863),r._ishlnsubmul(n,d,c);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(n,1,c),r.isZero()||(r.negative^=1);a&&(a.words[c]=d)}return a&&a.strip(),r.strip(),"div"!==e&&0!==i&&r.iushrn(i),{div:a||null,mod:r}},s.prototype.divmod=function(t,e,i){return r(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),s=i.cmp(r);return s<0||1===n&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,i=0,n=this.length-1;n>=0;n--)i=(e*i+(0|this.words[n]))%t;return i},s.prototype.idivn=function(t){r(t<=67108863);for(var e=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*e;this.words[i]=n/t|0,e=n%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new s(1),o=new s(0),a=new s(0),h=new s(1),u=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++u;for(var l=i.clone(),c=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(l),h.isub(c)),a.iushrn(1),h.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(a),o.isub(h)):(i.isub(e),a.isub(n),h.isub(o))}return{a,b:h,gcd:i.iushln(u)}},s.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new s(1),a=new s(0),h=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var u=0,l=1;0==(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(h),o.iushrn(1);for(var c=0,d=1;0==(i.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(i.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(a)):(i.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var s=e;e=i,i=s}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var s=n,o=i;0!==s&&o<this.length;o++){var a=0|this.words[o];s=(a+=s)>>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){r<n?e=-1:r>n&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new k(t)},s.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},n(y,v),y.prototype.split=function(t,e){for(var i=4194303,r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var s=t.words[9];for(e.words[e.length++]=s&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(o&i)<<4|s>>>22,s=o}s>>>=22,t.words[n-10]=s,0===s&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i<t.length;i++){var r=0|t.words[i];e+=977*r,t.words[i]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(w,v),n(_,v),n(M,v),M.prototype.imulK=function(t){for(var e=0,i=0;i<t.length;i++){var r=19*(0|t.words[i])+e,n=67108863&r;r>>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return b[t]=e,e},k.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},k.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new s(1)).iushrn(2);return this.pow(t,i)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);r(!n.isZero());var a=new s(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);0!==this.pow(l,u).cmp(h);)l.redIAdd(h);for(var c=this.pow(l,n),d=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),p=o;0!==f.cmp(a);){for(var m=f,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var b=this.pow(c,new s(1).iushln(p-g-1));d=d.redMul(b),c=b.redSqr(),f=f.redMul(c),p=g}return d},k.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},k.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var i=new Array(16);i[0]=new s(1).toRed(this),i[1]=t;for(var r=2;r<i.length;r++)i[r]=this.mul(i[r-1],t);var n=i[0],o=0,a=0,h=e.bitLength()%26;for(0===h&&(h=26),r=e.length-1;r>=0;r--){for(var u=e.words[r],l=h-1;l>=0;l--){var c=u>>l&1;n!==i[0]&&(n=this.sqr(n)),0!==c||0!==o?(o<<=1,o|=c,(4==++a||0===r&&0===l)&&(n=this.mul(n,i[o]),a=0,o=0)):a=0}h=26}return n},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new x(t)},n(x,k),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var i=t.mul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=i.nmd(t),this)},9282:(t,e,i)=>{"use strict";var r=i(9590),n=i(5108);function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}var o,a,h=i(2136).codes,u=h.ERR_AMBIGUOUS_ARGUMENT,l=h.ERR_INVALID_ARG_TYPE,c=h.ERR_INVALID_ARG_VALUE,d=h.ERR_INVALID_RETURN_VALUE,f=h.ERR_MISSING_ARGS,p=i(5961),m=i(9539).inspect,g=i(9539).types,b=g.isPromise,v=g.isRegExp,y=Object.assign?Object.assign:i(8091).assign,w=Object.is?Object.is:i(609);function _(){var t=i(9158);o=t.isDeepEqual,a=t.isDeepStrictEqual}new Map;var M=!1,k=t.exports=T,x={};function E(t){if(t.message instanceof Error)throw t.message;throw new p(t)}function S(t,e,i,r){if(!i){var n=!1;if(0===e)n=!0,r="No value argument passed to `assert.ok()`";else if(r instanceof Error)throw r;var s=new p({actual:i,expected:!0,message:r,operator:"==",stackStartFn:t});throw s.generatedMessage=n,s}}function T(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];S.apply(void 0,[T,e.length].concat(e))}k.fail=function t(e,i,s,o,a){var h,u=arguments.length;if(0===u)h="Failed";else if(1===u)s=e,e=void 0;else{if(!1===M){M=!0;var l=r.emitWarning?r.emitWarning:n.warn.bind(n);l("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}2===u&&(o="!=")}if(s instanceof Error)throw s;var c={actual:e,expected:i,operator:void 0===o?"fail":o,stackStartFn:a||t};void 0!==s&&(c.message=s);var d=new p(c);throw h&&(d.message=h,d.generatedMessage=!0),d},k.AssertionError=p,k.ok=T,k.equal=function t(e,i,r){if(arguments.length<2)throw new f("actual","expected");e!=i&&E({actual:e,expected:i,message:r,operator:"==",stackStartFn:t})},k.notEqual=function t(e,i,r){if(arguments.length<2)throw new f("actual","expected");e==i&&E({actual:e,expected:i,message:r,operator:"!=",stackStartFn:t})},k.deepEqual=function t(e,i,r){if(arguments.length<2)throw new f("actual","expected");void 0===o&&_(),o(e,i)||E({actual:e,expected:i,message:r,operator:"deepEqual",stackStartFn:t})},k.notDeepEqual=function t(e,i,r){if(arguments.length<2)throw new f("actual","expected");void 0===o&&_(),o(e,i)&&E({actual:e,expected:i,message:r,operator:"notDeepEqual",stackStartFn:t})},k.deepStrictEqual=function t(e,i,r){if(arguments.length<2)throw new f("actual","expected");void 0===o&&_(),a(e,i)||E({actual:e,expected:i,message:r,operator:"deepStrictEqual",stackStartFn:t})},k.notDeepStrictEqual=function t(e,i,r){if(arguments.length<2)throw new f("actual","expected");void 0===o&&_(),a(e,i)&&E({actual:e,expected:i,message:r,operator:"notDeepStrictEqual",stackStartFn:t})},k.strictEqual=function t(e,i,r){if(arguments.length<2)throw new f("actual","expected");w(e,i)||E({actual:e,expected:i,message:r,operator:"strictEqual",stackStartFn:t})},k.notStrictEqual=function t(e,i,r){if(arguments.length<2)throw new f("actual","expected");w(e,i)&&E({actual:e,expected:i,message:r,operator:"notStrictEqual",stackStartFn:t})};var A=function t(e,i,r){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),i.forEach((function(t){t in e&&(void 0!==r&&"string"==typeof r[t]&&v(e[t])&&e[t].test(r[t])?n[t]=r[t]:n[t]=e[t])}))};function I(t,e,i,r,n,s){if(!(i in t)||!a(t[i],e[i])){if(!r){var o=new A(t,n),h=new A(e,n,t),u=new p({actual:o,expected:h,operator:"deepStrictEqual",stackStartFn:s});throw u.actual=t,u.expected=e,u.operator=s.name,u}E({actual:t,expected:e,message:r,operator:s.name,stackStartFn:s})}}function C(t,e,i,r){if("function"!=typeof e){if(v(e))return e.test(t);if(2===arguments.length)throw new l("expected",["Function","RegExp"],e);if("object"!==s(t)||null===t){var n=new p({actual:t,expected:e,message:i,operator:"deepStrictEqual",stackStartFn:r});throw n.operator=r.name,n}var a=Object.keys(e);if(e instanceof Error)a.push("name","message");else if(0===a.length)throw new c("error",e,"may not be an empty object");return void 0===o&&_(),a.forEach((function(n){"string"==typeof t[n]&&v(e[n])&&e[n].test(t[n])||I(t,e,n,i,a,r)})),!0}return void 0!==e.prototype&&t instanceof e||!Error.isPrototypeOf(e)&&!0===e.call({},t)}function B(t){if("function"!=typeof t)throw new l("fn","Function",t);try{t()}catch(t){return t}return x}function R(t){return b(t)||null!==t&&"object"===s(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function P(t){return Promise.resolve().then((function(){var e;if("function"==typeof t){if(!R(e=t()))throw new d("instance of Promise","promiseFn",e)}else{if(!R(t))throw new l("promiseFn",["Function","Promise"],t);e=t}return Promise.resolve().then((function(){return e})).then((function(){return x})).catch((function(t){return t}))}))}function L(t,e,i,r){if("string"==typeof i){if(4===arguments.length)throw new l("error",["Object","Error","Function","RegExp"],i);if("object"===s(e)&&null!==e){if(e.message===i)throw new u("error/message",'The error message "'.concat(e.message,'" is identical to the message.'))}else if(e===i)throw new u("error/message",'The error "'.concat(e,'" is identical to the message.'));r=i,i=void 0}else if(null!=i&&"object"!==s(i)&&"function"!=typeof i)throw new l("error",["Object","Error","Function","RegExp"],i);if(e===x){var n="";i&&i.name&&(n+=" (".concat(i.name,")")),n+=r?": ".concat(r):".";var o="rejects"===t.name?"rejection":"exception";E({actual:void 0,expected:i,operator:t.name,message:"Missing expected ".concat(o).concat(n),stackStartFn:t})}if(i&&!C(e,i,r,t))throw e}function O(t,e,i,r){if(e!==x){if("string"==typeof i&&(r=i,i=void 0),!i||C(e,i)){var n=r?": ".concat(r):".",s="doesNotReject"===t.name?"rejection":"exception";E({actual:e,expected:i,operator:t.name,message:"Got unwanted ".concat(s).concat(n,"\n")+'Actual message: "'.concat(e&&e.message,'"'),stackStartFn:t})}throw e}}function D(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];S.apply(void 0,[D,e.length].concat(e))}k.throws=function t(e){for(var i=arguments.length,r=new Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];L.apply(void 0,[t,B(e)].concat(r))},k.rejects=function t(e){for(var i=arguments.length,r=new Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];return P(e).then((function(e){return L.apply(void 0,[t,e].concat(r))}))},k.doesNotThrow=function t(e){for(var i=arguments.length,r=new Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];O.apply(void 0,[t,B(e)].concat(r))},k.doesNotReject=function t(e){for(var i=arguments.length,r=new Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];return P(e).then((function(e){return O.apply(void 0,[t,e].concat(r))}))},k.ifError=function t(e){if(null!=e){var i="ifError got unwanted exception: ";"object"===s(e)&&"string"==typeof e.message?0===e.message.length&&e.constructor?i+=e.constructor.name:i+=e.message:i+=m(e);var r=new p({actual:e,expected:null,operator:"ifError",message:i,stackStartFn:t}),n=e.stack;if("string"==typeof n){var o=n.split("\n");o.shift();for(var a=r.stack.split("\n"),h=0;h<o.length;h++){var u=a.indexOf(o[h]);if(-1!==u){a=a.slice(0,u);break}}r.stack="".concat(a.join("\n"),"\n").concat(o.join("\n"))}throw r}},k.strict=y(D,k,{equal:k.strictEqual,deepEqual:k.deepStrictEqual,notEqual:k.notStrictEqual,notDeepEqual:k.notDeepStrictEqual}),k.strict.strict=k.strict},5961:(t,e,i)=>{"use strict";var r=i(9590);function n(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function s(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e){return!e||"object"!==f(e)&&"function"!=typeof e?a(t):e}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(t){var e="function"==typeof Map?new Map:void 0;return h=function(t){if(null===t||(i=t,-1===Function.toString.call(i).indexOf("[native code]")))return t;var i;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return l(t,arguments,d(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),c(r,t)},h(t)}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function l(t,e,i){return l=u()?Reflect.construct:function(t,e,i){var r=[null];r.push.apply(r,e);var n=new(Function.bind.apply(t,r));return i&&c(n,i.prototype),n},l.apply(null,arguments)}function c(t,e){return c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},c(t,e)}function d(t){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},d(t)}function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}var p=i(9539).inspect,m=i(2136).codes.ERR_INVALID_ARG_TYPE;function g(t,e,i){return(void 0===i||i>t.length)&&(i=t.length),t.substring(i-e.length,i)===e}var b="",v="",y="",w="",_={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function M(t){var e=Object.keys(t),i=Object.create(Object.getPrototypeOf(t));return e.forEach((function(e){i[e]=t[e]})),Object.defineProperty(i,"message",{value:t.message}),i}function k(t){return p(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var x=function(t){function e(t){var i;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),"object"!==f(t)||null===t)throw new m("options","Object",t);var n=t.message,s=t.operator,h=t.stackStartFn,u=t.actual,l=t.expected,c=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=n)i=o(this,d(e).call(this,String(n)));else if(r.stderr&&r.stderr.isTTY&&(r.stderr&&r.stderr.getColorDepth&&1!==r.stderr.getColorDepth()?(b="[34m",v="[32m",w="[39m",y="[31m"):(b="",v="",w="",y="")),"object"===f(u)&&null!==u&&"object"===f(l)&&null!==l&&"stack"in u&&u instanceof Error&&"stack"in l&&l instanceof Error&&(u=M(u),l=M(l)),"deepStrictEqual"===s||"strictEqual"===s)i=o(this,d(e).call(this,function(t,e,i){var n="",s="",o=0,a="",h=!1,u=k(t),l=u.split("\n"),c=k(e).split("\n"),d=0,p="";if("strictEqual"===i&&"object"===f(t)&&"object"===f(e)&&null!==t&&null!==e&&(i="strictEqualObject"),1===l.length&&1===c.length&&l[0]!==c[0]){var m=l[0].length+c[0].length;if(m<=10){if(!("object"===f(t)&&null!==t||"object"===f(e)&&null!==e||0===t&&0===e))return"".concat(_[i],"\n\n")+"".concat(l[0]," !== ").concat(c[0],"\n")}else if("strictEqualObject"!==i&&m<(r.stderr&&r.stderr.isTTY?r.stderr.columns:80)){for(;l[0][d]===c[0][d];)d++;d>2&&(p="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var i=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,i-t.length)}(" ",d),"^"),d=0)}}for(var M=l[l.length-1],x=c[c.length-1];M===x&&(d++<2?a="\n ".concat(M).concat(a):n=M,l.pop(),c.pop(),0!==l.length&&0!==c.length);)M=l[l.length-1],x=c[c.length-1];var E=Math.max(l.length,c.length);if(0===E){var S=u.split("\n");if(S.length>30)for(S[26]="".concat(b,"...").concat(w);S.length>27;)S.pop();return"".concat(_.notIdentical,"\n\n").concat(S.join("\n"),"\n")}d>3&&(a="\n".concat(b,"...").concat(w).concat(a),h=!0),""!==n&&(a="\n ".concat(n).concat(a),n="");var T=0,A=_[i]+"\n".concat(v,"+ actual").concat(w," ").concat(y,"- expected").concat(w),I=" ".concat(b,"...").concat(w," Lines skipped");for(d=0;d<E;d++){var C=d-o;if(l.length<d+1)C>1&&d>2&&(C>4?(s+="\n".concat(b,"...").concat(w),h=!0):C>3&&(s+="\n ".concat(c[d-2]),T++),s+="\n ".concat(c[d-1]),T++),o=d,n+="\n".concat(y,"-").concat(w," ").concat(c[d]),T++;else if(c.length<d+1)C>1&&d>2&&(C>4?(s+="\n".concat(b,"...").concat(w),h=!0):C>3&&(s+="\n ".concat(l[d-2]),T++),s+="\n ".concat(l[d-1]),T++),o=d,s+="\n".concat(v,"+").concat(w," ").concat(l[d]),T++;else{var B=c[d],R=l[d],P=R!==B&&(!g(R,",")||R.slice(0,-1)!==B);P&&g(B,",")&&B.slice(0,-1)===R&&(P=!1,R+=","),P?(C>1&&d>2&&(C>4?(s+="\n".concat(b,"...").concat(w),h=!0):C>3&&(s+="\n ".concat(l[d-2]),T++),s+="\n ".concat(l[d-1]),T++),o=d,s+="\n".concat(v,"+").concat(w," ").concat(R),n+="\n".concat(y,"-").concat(w," ").concat(B),T+=2):(s+=n,n="",1!==C&&0!==d||(s+="\n ".concat(R),T++))}if(T>20&&d<E-2)return"".concat(A).concat(I,"\n").concat(s,"\n").concat(b,"...").concat(w).concat(n,"\n")+"".concat(b,"...").concat(w)}return"".concat(A).concat(h?I:"","\n").concat(s).concat(n).concat(a).concat(p)}(u,l,s)));else if("notDeepStrictEqual"===s||"notStrictEqual"===s){var p=_[s],x=k(u).split("\n");if("notStrictEqual"===s&&"object"===f(u)&&null!==u&&(p=_.notStrictEqualObject),x.length>30)for(x[26]="".concat(b,"...").concat(w);x.length>27;)x.pop();i=1===x.length?o(this,d(e).call(this,"".concat(p," ").concat(x[0]))):o(this,d(e).call(this,"".concat(p,"\n\n").concat(x.join("\n"),"\n")))}else{var E=k(u),S="",T=_[s];"notDeepEqual"===s||"notEqual"===s?(E="".concat(_[s],"\n\n").concat(E)).length>1024&&(E="".concat(E.slice(0,1021),"...")):(S="".concat(k(l)),E.length>512&&(E="".concat(E.slice(0,509),"...")),S.length>512&&(S="".concat(S.slice(0,509),"...")),"deepEqual"===s||"equal"===s?E="".concat(T,"\n\n").concat(E,"\n\nshould equal\n\n"):S=" ".concat(s," ").concat(S)),i=o(this,d(e).call(this,"".concat(E).concat(S)))}return Error.stackTraceLimit=c,i.generatedMessage=!n,Object.defineProperty(a(i),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),i.code="ERR_ASSERTION",i.actual=u,i.expected=l,i.operator=s,Error.captureStackTrace&&Error.captureStackTrace(a(i),h),i.stack,i.name="AssertionError",o(i)}var i,h;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}(e,t),i=e,h=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:p.custom,value:function(t,e){return p(this,function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{},r=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(i).filter((function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable})))),r.forEach((function(e){n(t,e,i[e])}))}return t}({},e,{customInspect:!1,depth:0}))}}],h&&s(i.prototype,h),e}(h(Error));t.exports=x},2136:(t,e,i)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t){return n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(t)}function s(t,e){return s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},s(t,e)}var o,a,h={};function u(t,e,i){i||(i=Error);var o=function(i){function o(i,s,a){var h;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),h=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}(this,n(o).call(this,function(t,i,r){return"string"==typeof e?e:e(t,i,r)}(i,s,a))),h.code=t,h}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(o,i),o}(i);h[t]=o}function l(t,e){if(Array.isArray(t)){var i=t.length;return t=t.map((function(t){return String(t)})),i>2?"one of ".concat(e," ").concat(t.slice(0,i-1).join(", "),", or ")+t[i-1]:2===i?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}u("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),u("ERR_INVALID_ARG_TYPE",(function(t,e,n){var s,a,h,u,c;if(void 0===o&&(o=i(9282)),o("string"==typeof t,"'name' must be a string"),"string"==typeof e&&(a="not ",e.substr(0,a.length)===a)?(s="must not be",e=e.replace(/^not /,"")):s="must be",function(t,e,i){return(void 0===i||i>t.length)&&(i=t.length),t.substring(i-e.length,i)===e}(t," argument"))h="The ".concat(t," ").concat(s," ").concat(l(e,"type"));else{var d=("number"!=typeof c&&(c=0),c+".".length>(u=t).length||-1===u.indexOf(".",c)?"argument":"property");h='The "'.concat(t,'" ').concat(d," ").concat(s," ").concat(l(e,"type"))}return h+". Received type ".concat(r(n))}),TypeError),u("ERR_INVALID_ARG_VALUE",(function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===a&&(a=i(9539));var n=a.inspect(e);return n.length>128&&(n="".concat(n.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(r,". Received ").concat(n)}),TypeError,RangeError),u("ERR_INVALID_RETURN_VALUE",(function(t,e,i){var n;return n=i&&i.constructor&&i.constructor.name?"instance of ".concat(i.constructor.name):"type ".concat(r(i)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(n,".")}),TypeError),u("ERR_MISSING_ARGS",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];void 0===o&&(o=i(9282)),o(e.length>0,"At least one arg needs to be specified");var n="The ",s=e.length;switch(e=e.map((function(t){return'"'.concat(t,'"')})),s){case 1:n+="".concat(e[0]," argument");break;case 2:n+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:n+=e.slice(0,s-1).join(", "),n+=", and ".concat(e[s-1]," arguments")}return"".concat(n," must be specified")}),TypeError),t.exports.codes=h},9158:(t,e,i)=>{"use strict";function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=[],r=!0,n=!1,s=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done)&&(i.push(o.value),!e||i.length!==e);r=!0);}catch(t){n=!0,s=t}finally{try{r||null==a.return||a.return()}finally{if(n)throw s}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var s=void 0!==/a/g.flags,o=function(t){var e=[];return t.forEach((function(t){return e.push(t)})),e},a=function(t){var e=[];return t.forEach((function(t,i){return e.push([i,t])})),e},h=Object.is?Object.is:i(609),u=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},l=Number.isNaN?Number.isNaN:i(360);function c(t){return t.call.bind(t)}var d=c(Object.prototype.hasOwnProperty),f=c(Object.prototype.propertyIsEnumerable),p=c(Object.prototype.toString),m=i(9539).types,g=m.isAnyArrayBuffer,b=m.isArrayBufferView,v=m.isDate,y=m.isMap,w=m.isRegExp,_=m.isSet,M=m.isNativeError,k=m.isBoxedPrimitive,x=m.isNumberObject,E=m.isStringObject,S=m.isBooleanObject,T=m.isBigIntObject,A=m.isSymbolObject,I=m.isFloat32Array,C=m.isFloat64Array;function B(t){if(0===t.length||t.length>10)return!0;for(var e=0;e<t.length;e++){var i=t.charCodeAt(e);if(i<48||i>57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function R(t){return Object.keys(t).filter(B).concat(u(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function P(t,e){if(t===e)return 0;for(var i=t.length,r=e.length,n=0,s=Math.min(i,r);n<s;++n)if(t[n]!==e[n]){i=t[n],r=e[n];break}return i<r?-1:r<i?1:0}function L(t,e,i,r){if(t===e)return 0!==t||!i||h(t,e);if(i){if("object"!==n(t))return"number"==typeof t&&l(t)&&l(e);if("object"!==n(e)||null===t||null===e)return!1;if(Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1}else{if(null===t||"object"!==n(t))return(null===e||"object"!==n(e))&&t==e;if(null===e||"object"!==n(e))return!1}var o,a,u,c,d=p(t);if(d!==p(e))return!1;if(Array.isArray(t)){if(t.length!==e.length)return!1;var f=R(t),m=R(e);return f.length===m.length&&D(t,e,i,r,1,f)}if("[object Object]"===d&&(!y(t)&&y(e)||!_(t)&&_(e)))return!1;if(v(t)){if(!v(e)||Date.prototype.getTime.call(t)!==Date.prototype.getTime.call(e))return!1}else if(w(t)){if(!w(e)||(u=t,c=e,!(s?u.source===c.source&&u.flags===c.flags:RegExp.prototype.toString.call(u)===RegExp.prototype.toString.call(c))))return!1}else if(M(t)||t instanceof Error){if(t.message!==e.message||t.name!==e.name)return!1}else{if(b(t)){if(i||!I(t)&&!C(t)){if(!function(t,e){return t.byteLength===e.byteLength&&0===P(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}(t,e))return!1}else if(!function(t,e){if(t.byteLength!==e.byteLength)return!1;for(var i=0;i<t.byteLength;i++)if(t[i]!==e[i])return!1;return!0}(t,e))return!1;var B=R(t),L=R(e);return B.length===L.length&&D(t,e,i,r,0,B)}if(_(t))return!(!_(e)||t.size!==e.size)&&D(t,e,i,r,2);if(y(t))return!(!y(e)||t.size!==e.size)&&D(t,e,i,r,3);if(g(t)){if(a=e,(o=t).byteLength!==a.byteLength||0!==P(new Uint8Array(o),new Uint8Array(a)))return!1}else if(k(t)&&!function(t,e){return x(t)?x(e)&&h(Number.prototype.valueOf.call(t),Number.prototype.valueOf.call(e)):E(t)?E(e)&&String.prototype.valueOf.call(t)===String.prototype.valueOf.call(e):S(t)?S(e)&&Boolean.prototype.valueOf.call(t)===Boolean.prototype.valueOf.call(e):T(t)?T(e)&&BigInt.prototype.valueOf.call(t)===BigInt.prototype.valueOf.call(e):A(e)&&Symbol.prototype.valueOf.call(t)===Symbol.prototype.valueOf.call(e)}(t,e))return!1}return D(t,e,i,r,0)}function O(t,e){return e.filter((function(e){return f(t,e)}))}function D(t,e,i,r,n,s){if(5===arguments.length){s=Object.keys(t);var o=Object.keys(e);if(s.length!==o.length)return!1}for(var a=0;a<s.length;a++)if(!d(e,s[a]))return!1;if(i&&5===arguments.length){var h=u(t);if(0!==h.length){var l=0;for(a=0;a<h.length;a++){var c=h[a];if(f(t,c)){if(!f(e,c))return!1;s.push(c),l++}else if(f(e,c))return!1}var p=u(e);if(h.length!==p.length&&O(e,p).length!==l)return!1}else{var m=u(e);if(0!==m.length&&0!==O(e,m).length)return!1}}if(0===s.length&&(0===n||1===n&&0===t.length||0===t.size))return!0;if(void 0===r)r={val1:new Map,val2:new Map,position:0};else{var g=r.val1.get(t);if(void 0!==g){var b=r.val2.get(e);if(void 0!==b)return g===b}r.position++}r.val1.set(t,r.position),r.val2.set(e,r.position);var v=z(t,e,i,s,r,n);return r.val1.delete(t),r.val2.delete(e),v}function N(t,e,i,r){for(var n=o(t),s=0;s<n.length;s++){var a=n[s];if(L(e,a,i,r))return t.delete(a),!0}return!1}function j(t){switch(n(t)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":t=+t;case"number":if(l(t))return!1}return!0}function U(t,e,i){var r=j(i);return null!=r?r:e.has(r)&&!t.has(r)}function F(t,e,i,r,n){var s=j(i);if(null!=s)return s;var o=e.get(s);return!(void 0===o&&!e.has(s)||!L(r,o,!1,n))&&!t.has(s)&&L(r,o,!1,n)}function q(t,e,i,r,n,s){for(var a=o(t),h=0;h<a.length;h++){var u=a[h];if(L(i,u,n,s)&&L(r,e.get(u),n,s))return t.delete(u),!0}return!1}function z(t,e,i,s,h,u){var l=0;if(2===u){if(!function(t,e,i,r){for(var s=null,a=o(t),h=0;h<a.length;h++){var u=a[h];if("object"===n(u)&&null!==u)null===s&&(s=new Set),s.add(u);else if(!e.has(u)){if(i)return!1;if(!U(t,e,u))return!1;null===s&&(s=new Set),s.add(u)}}if(null!==s){for(var l=o(e),c=0;c<l.length;c++){var d=l[c];if("object"===n(d)&&null!==d){if(!N(s,d,i,r))return!1}else if(!i&&!t.has(d)&&!N(s,d,i,r))return!1}return 0===s.size}return!0}(t,e,i,h))return!1}else if(3===u){if(!function(t,e,i,s){for(var o=null,h=a(t),u=0;u<h.length;u++){var l=r(h[u],2),c=l[0],d=l[1];if("object"===n(c)&&null!==c)null===o&&(o=new Set),o.add(c);else{var f=e.get(c);if(void 0===f&&!e.has(c)||!L(d,f,i,s)){if(i)return!1;if(!F(t,e,c,d,s))return!1;null===o&&(o=new Set),o.add(c)}}}if(null!==o){for(var p=a(e),m=0;m<p.length;m++){var g=r(p[m],2),b=(c=g[0],g[1]);if("object"===n(c)&&null!==c){if(!q(o,t,c,b,i,s))return!1}else if(!(i||t.has(c)&&L(t.get(c),b,!1,s)||q(o,t,c,b,!1,s)))return!1}return 0===o.size}return!0}(t,e,i,h))return!1}else if(1===u)for(;l<t.length;l++){if(!d(t,l)){if(d(e,l))return!1;for(var c=Object.keys(t);l<c.length;l++){var f=c[l];if(!d(e,f)||!L(t[f],e[f],i,h))return!1}return c.length===Object.keys(e).length}if(!d(e,l)||!L(t[l],e[l],i,h))return!1}for(l=0;l<s.length;l++){var p=s[l];if(!L(t[p],e[p],i,h))return!1}return!0}t.exports={isDeepEqual:function(t,e){return L(t,e,!1)},isDeepStrictEqual:function(t,e){return L(t,e,!0)}}},9742:(t,e)=>{"use strict";e.byteLength=function(t){var e=h(t),i=e[0],r=e[1];return 3*(i+r)/4-r},e.toByteArray=function(t){var e,i,s=h(t),o=s[0],a=s[1],u=new n(function(t,e,i){return 3*(e+i)/4-i}(0,o,a)),l=0,c=a>0?o-4:o;for(i=0;i<c;i+=4)e=r[t.charCodeAt(i)]<<18|r[t.charCodeAt(i+1)]<<12|r[t.charCodeAt(i+2)]<<6|r[t.charCodeAt(i+3)],u[l++]=e>>16&255,u[l++]=e>>8&255,u[l++]=255&e;return 2===a&&(e=r[t.charCodeAt(i)]<<2|r[t.charCodeAt(i+1)]>>4,u[l++]=255&e),1===a&&(e=r[t.charCodeAt(i)]<<10|r[t.charCodeAt(i+1)]<<4|r[t.charCodeAt(i+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e),u},e.fromByteArray=function(t){for(var e,r=t.length,n=r%3,s=[],o=16383,a=0,h=r-n;a<h;a+=o)s.push(u(t,a,a+o>h?h:a+o));return 1===n?(e=t[r-1],s.push(i[e>>2]+i[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],s.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"=")),s.join("")};for(var i=[],r=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=s.length;o<a;++o)i[o]=s[o],r[s.charCodeAt(o)]=o;function h(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");return-1===i&&(i=e),[i,i===e?0:4-i%4]}function u(t,e,r){for(var n,s,o=[],a=e;a<r;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),o.push(i[(s=n)>>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return o.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},6992:(t,e,i)=>{var r=i(8764).Buffer;function n(t,e,i){let r=0,n=1;for(let s=e;s<i;s++){const i=t[s];if(i<58&&i>=48)r=10*r+(i-48);else if(s!==e||43!==i){if(s!==e||45!==i){if(46===i)break;throw new Error("not a number: buffer["+s+"] = "+i)}n=-1}}return r*n}function s(t,e,i,n){return null==t||0===t.length?null:("number"!=typeof e&&null==n&&(n=e,e=void 0),"number"!=typeof i&&null==n&&(n=i,i=void 0),s.position=0,s.encoding=n||null,s.data=r.isBuffer(t)?t.slice(e,i):r.from(t),s.bytes=s.data.length,s.next())}s.bytes=0,s.position=0,s.data=null,s.encoding=null,s.next=function(){switch(s.data[s.position]){case 100:return s.dictionary();case 108:return s.list();case 105:return s.integer();default:return s.buffer()}},s.find=function(t){let e=s.position;const i=s.data.length,r=s.data;for(;e<i;){if(r[e]===t)return e;e++}throw new Error('Invalid data: Missing delimiter "'+String.fromCharCode(t)+'" [0x'+t.toString(16)+"]")},s.dictionary=function(){s.position++;const t={};for(;101!==s.data[s.position];)t[s.buffer()]=s.next();return s.position++,t},s.list=function(){s.position++;const t=[];for(;101!==s.data[s.position];)t.push(s.next());return s.position++,t},s.integer=function(){const t=s.find(101),e=n(s.data,s.position+1,t);return s.position+=t+1-s.position,e},s.buffer=function(){let t=s.find(58);const e=n(s.data,s.position,t),i=++t+e;return s.position=i,s.encoding?s.data.toString(s.encoding,t,i):s.data.slice(t,i)},t.exports=s},2244:(t,e,i)=>{var r=i(8764).Buffer,n=i(5108);const{getType:s}=i(7186);function o(t,e,i){const n=[];let s=null;return o._encode(n,t),s=r.concat(n),o.bytes=s.length,r.isBuffer(e)?(s.copy(e,i),e):s}o.bytes=-1,o._floatConversionDetected=!1,o._encode=function(t,e){if(null!=e)switch(s(e)){case"buffer":o.buffer(t,e);break;case"object":o.dict(t,e);break;case"map":o.dictMap(t,e);break;case"array":o.list(t,e);break;case"set":o.listSet(t,e);break;case"string":o.string(t,e);break;case"number":case"boolean":o.number(t,e);break;case"arraybufferview":o.buffer(t,r.from(e.buffer,e.byteOffset,e.byteLength));break;case"arraybuffer":o.buffer(t,r.from(e))}};const a=r.from("e"),h=r.from("d"),u=r.from("l");o.buffer=function(t,e){t.push(r.from(e.length+":"),e)},o.string=function(t,e){t.push(r.from(r.byteLength(e)+":"+e))},o.number=function(t,e){const i=2147483648,s=(e/i<<0)*i+(e%i<<0);t.push(r.from("i"+s+"e")),s===e||o._floatConversionDetected||(o._floatConversionDetected=!0,n.warn('WARNING: Possible data corruption detected with value "'+e+'":','Bencoding only defines support for integers, value was converted to "'+s+'"'),n.trace())},o.dict=function(t,e){t.push(h);let i,r=0;const n=Object.keys(e).sort(),s=n.length;for(;r<s;r++)i=n[r],null!=e[i]&&(o.string(t,i),o._encode(t,e[i]));t.push(a)},o.dictMap=function(t,e){t.push(h);const i=Array.from(e.keys()).sort();for(const n of i)null!=e.get(n)&&(r.isBuffer(n)?o._encode(t,n):o.string(t,String(n)),o._encode(t,e.get(n)));t.push(a)},o.list=function(t,e){let i=0;const r=e.length;for(t.push(u);i<r;i++)null!=e[i]&&o._encode(t,e[i]);t.push(a)},o.listSet=function(t,e){t.push(u);for(const i of e)null!=i&&o._encode(t,i);t.push(a)},t.exports=o},1722:(t,e,i)=>{var r=i(8764).Buffer;const{digitCount:n,getType:s}=i(7186);t.exports=function t(e){if(null==e)return 0;const i=s(e);switch(i){case"buffer":return n(e.length)+1+e.length;case"arraybufferview":return function(t){const e=t.byteLength-t.byteOffset;return n(e)+1+e}(e);case"string":return function(t){const e=r.byteLength(t);return n(e)+1+e}(e);case"array":case"set":return function(e){let i=2;for(const r of e)i+=t(r);return i}(e);case"number":return 1+n(Math.floor(e))+1;case"bigint":return 1+e.toString().length+1;case"object":return function(e){let i=2;const s=Object.keys(e);for(let o=0;o<s.length;o++){const a=r.byteLength(s[o]);i+=n(a)+1+a,i+=t(e[s[o]])}return i}(e);case"map":return function(e){let i=2;for(const[s,o]of e){const e=r.byteLength(s);i+=n(e)+1+e,i+=t(o)}return i}(e);default:throw new TypeError(`Unsupported value of type "${i}"`)}}},5799:(t,e,i)=>{const r=t.exports;r.encode=i(2244),r.decode=i(6992),r.byteLength=r.encodingLength=i(1722)},7186:(t,e,i)=>{var r=i(8764).Buffer;const n=t.exports;n.digitCount=function(t){const e=t<0?1:0;return t=Math.abs(Number(t||1)),Math.floor(Math.log10(t))+1+e},n.getType=function(t){return r.isBuffer(t)?"buffer":ArrayBuffer.isView(t)?"arraybufferview":Array.isArray(t)?"array":t instanceof Number?"number":t instanceof Boolean?"boolean":t instanceof Set?"set":t instanceof Map?"map":t instanceof String?"string":t instanceof ArrayBuffer?"arraybuffer":typeof t}},7500:t=>{function e(t){return t.reduce(((t,e,i,r)=>{const n=e.split("-").map((t=>parseInt(t)));return t.concat(((t,e=t)=>Array.from({length:e-t+1},((e,i)=>i+t)))(...n))}),[])}t.exports=e,t.exports.parse=e,t.exports.compose=function(t){return t.reduce(((t,e,i,r)=>(0!==i&&e===r[i-1]+1||t.push([]),t[t.length-1].push(e),t)),[]).map((t=>t.length>1?`${t[0]}-${t[t.length-1]}`:`${t[0]}`))}},7513:t=>{t.exports=function(t,e,i,r,n){var s,o;if(void 0===r)r=0;else if((r|=0)<0||r>=t.length)throw new RangeError("invalid lower bound");if(void 0===n)n=t.length-1;else if((n|=0)<r||n>=t.length)throw new RangeError("invalid upper bound");for(;r<=n;)if((o=+i(t[s=r+(n-r>>>1)],e,s,t))<0)r=s+1;else{if(!(o>0))return s;n=s-1}return~r}},8833:(t,e)=>{"use strict";function i(t){var e=t>>3;return t%8!=0&&e++,e}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){void 0===t&&(t=0);var r=null==e?void 0:e.grow;this.grow=r&&isFinite(r)&&i(r)||r||0,this.buffer="number"==typeof t?new Uint8Array(i(t)):t}return t.prototype.get=function(t){var e=t>>3;return e<this.buffer.length&&!!(this.buffer[e]&128>>t%8)},t.prototype.set=function(t,e){void 0===e&&(e=!0);var i=t>>3;if(e){if(this.buffer.length<i+1){var r=Math.max(i+1,Math.min(2*this.buffer.length,this.grow));if(r<=this.grow){var n=new Uint8Array(r);n.set(this.buffer),this.buffer=n}}this.buffer[i]|=128>>t%8}else i<this.buffer.length&&(this.buffer[i]&=~(128>>t%8))},t.prototype.forEach=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=8*this.buffer.length);for(var r=e,n=r>>3,s=128>>r%8,o=this.buffer[n];r<i;r++)t(!!(o&s),r),s=1===s?(o=this.buffer[++n],128):s>>1},t}();e.default=r},5228:(t,e,i)=>{var r=i(8764).Buffer;const n=i(6581),s=i(5799),o=i(8833).default,a=i(5835),h=i(1227)("bittorrent-protocol"),u=i(1798),l=i(4159),c=i(9529),d=i(8473),f=i(7830),p=r.from("BitTorrent protocol"),m=r.from([0,0,0,0]),g=r.from([0,0,0,1,0]),b=r.from([0,0,0,1,1]),v=r.from([0,0,0,1,2]),y=r.from([0,0,0,1,3]),w=[0,0,0,0,0,0,0,0],_=[0,0,0,3,9,0,0],M=r.from([0,0,0,1,14]),k=r.from([0,0,0,1,15]),x=r.from([0,0,0,0,0,0,0,0]),E=r.from([0,0,1,2]),S=r.from([0,0,0,2]);function T(t,e){for(let i=t.length;i--;)t[i]^=e[i];return t}class A{constructor(t,e,i,r){this.piece=t,this.offset=e,this.length=i,this.callback=r}}class I{constructor(){this.buffer=new Uint8Array}get(t){return!0}set(t){}}class C extends d.Duplex{constructor(t=null,e=0,i=!1){super(),this._debugId=u(4).toString("hex"),this._debug("new wire"),this.peerId=null,this.peerIdBuffer=null,this.type=t,this.amChoking=!0,this.amInterested=!1,this.peerChoking=!0,this.peerInterested=!1,this.peerPieces=new o(0,{grow:4e5}),this.extensions={},this.peerExtensions={},this.requests=[],this.peerRequests=[],this.extendedMapping={},this.peerExtendedMapping={},this.extendedHandshake={},this.peerExtendedHandshake={},this.hasFast=!1,this.allowedFastSet=[],this.peerAllowedFastSet=[],this._ext={},this._nextExt=1,this.uploaded=0,this.downloaded=0,this.uploadSpeed=c(),this.downloadSpeed=c(),this._keepAliveInterval=null,this._timeout=null,this._timeoutMs=0,this._timeoutExpiresAt=null,this.destroyed=!1,this._finished=!1,this._parserSize=0,this._parser=null,this._buffer=[],this._bufferSize=0,this._peEnabled=i,i?(this._dh=a.createDiffieHellman("ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a36210000000000090563","hex",2),this._myPubKey=this._dh.generateKeys("hex")):this._myPubKey=null,this._peerPubKey=null,this._sharedSecret=null,this._peerCryptoProvide=[],this._cryptoHandshakeDone=!1,this._cryptoSyncPattern=null,this._waitMaxBytes=null,this._encryptionMethod=null,this._encryptGenerator=null,this._decryptGenerator=null,this._setGenerators=!1,this.once("finish",(()=>this._onFinish())),this.on("finish",this._onFinish),this._debug("type:",this.type),"tcpIncoming"===this.type&&this._peEnabled?this._determineHandshakeType():"tcpOutgoing"===this.type&&this._peEnabled&&0===e?this._parsePe2():this._parseHandshake(null)}setKeepAlive(t){this._debug("setKeepAlive %s",t),clearInterval(this._keepAliveInterval),!1!==t&&(this._keepAliveInterval=setInterval((()=>{this.keepAlive()}),55e3))}setTimeout(t,e){this._debug("setTimeout ms=%d unref=%s",t,e),this._timeoutMs=t,this._timeoutUnref=!!e,this._resetTimeout(!0)}destroy(){if(!this.destroyed)return this.destroyed=!0,this._debug("destroy"),this.emit("close"),this.end(),this}end(...t){return this._debug("end"),this._onUninterested(),this._onChoke(),super.end(...t)}use(t){const e=t.prototype.name;if(!e)throw new Error('Extension class requires a "name" property on the prototype');this._debug("use extension.name=%s",e);const i=this._nextExt,r=new t(this);function n(){}"function"!=typeof r.onHandshake&&(r.onHandshake=n),"function"!=typeof r.onExtendedHandshake&&(r.onExtendedHandshake=n),"function"!=typeof r.onMessage&&(r.onMessage=n),this.extendedMapping[i]=e,this._ext[e]=r,this[e]=r,this._nextExt+=1}keepAlive(){this._debug("keep-alive"),this._push(m)}sendPe1(){if(this._peEnabled){const t=Math.floor(513*Math.random()),e=u(t);this._push(r.concat([r.from(this._myPubKey,"hex"),e]))}}sendPe2(){const t=Math.floor(513*Math.random()),e=u(t);this._push(r.concat([r.from(this._myPubKey,"hex"),e]))}sendPe3(t){this.setEncrypt(this._sharedSecret,t);const e=r.from(l.sync(r.from(this._utfToHex("req1")+this._sharedSecret,"hex")),"hex"),i=T(r.from(l.sync(r.from(this._utfToHex("req2")+t,"hex")),"hex"),r.from(l.sync(r.from(this._utfToHex("req3")+this._sharedSecret,"hex")),"hex")),n=u(2).readUInt16BE(0)%512,s=u(n);let o=r.alloc(14+n+2);x.copy(o),E.copy(o,8),o.writeInt16BE(n,12),s.copy(o,14),o.writeInt16BE(0,14+n),o=this._encryptHandshake(o),this._push(r.concat([e,i,o]))}sendPe4(t){this.setEncrypt(this._sharedSecret,t);const e=u(2).readUInt16BE(0)%512,i=u(e);let n=r.alloc(14+e);x.copy(n),S.copy(n,8),n.writeInt16BE(e,12),i.copy(n,14),n=this._encryptHandshake(n),this._push(n),this._cryptoHandshakeDone=!0,this._debug("completed crypto handshake")}handshake(t,e,i){let n,s;if("string"==typeof t?(t=t.toLowerCase(),n=r.from(t,"hex")):(n=t,t=n.toString("hex")),"string"==typeof e?s=r.from(e,"hex"):(s=e,e=s.toString("hex")),this._infoHash=n,20!==n.length||20!==s.length)throw new Error("infoHash and peerId MUST have length 20");this._debug("handshake i=%s p=%s exts=%o",t,e,i);const o=r.from(w);this.extensions={extended:!0,dht:!(!i||!i.dht),fast:!(!i||!i.fast)},o[5]|=16,this.extensions.dht&&(o[7]|=1),this.extensions.fast&&(o[7]|=4),this.extensions.fast&&this.peerExtensions.fast&&(this._debug("fast extension is enabled"),this.hasFast=!0),this._push(r.concat([p,o,n,s])),this._handshakeSent=!0,this.peerExtensions.extended&&!this._extendedHandshakeSent&&this._sendExtendedHandshake()}_sendExtendedHandshake(){const t=Object.assign({},this.extendedHandshake);t.m={};for(const e in this.extendedMapping){const i=this.extendedMapping[e];t.m[i]=Number(e)}this.extended(0,s.encode(t)),this._extendedHandshakeSent=!0}choke(){if(!this.amChoking)if(this.amChoking=!0,this._debug("choke"),this._push(g),this.hasFast)for(;this.peerRequests.length;){const t=this.peerRequests[0];this.allowedFastSet.includes(t.piece)||this.reject(t.piece,t.offset,t.length)}else for(;this.peerRequests.length;)this.peerRequests.pop()}unchoke(){this.amChoking&&(this.amChoking=!1,this._debug("unchoke"),this._push(b))}interested(){this.amInterested||(this.amInterested=!0,this._debug("interested"),this._push(v))}uninterested(){this.amInterested&&(this.amInterested=!1,this._debug("uninterested"),this._push(y))}have(t){this._debug("have %d",t),this._message(4,[t],null)}bitfield(t){this._debug("bitfield"),r.isBuffer(t)||(t=t.buffer),this._message(5,[],t)}request(t,e,i,r){return r||(r=()=>{}),this._finished?r(new Error("wire is closed")):!this.peerChoking||this.hasFast&&this.peerAllowedFastSet.includes(t)?(this._debug("request index=%d offset=%d length=%d",t,e,i),this.requests.push(new A(t,e,i,r)),this._timeout||this._resetTimeout(!0),void this._message(6,[t,e,i],null)):r(new Error("peer is choking"))}piece(t,e,i){this._debug("piece index=%d offset=%d",t,e),this._message(7,[t,e],i),this.uploaded+=i.length,this.uploadSpeed(i.length),this.emit("upload",i.length)}cancel(t,e,i){this._debug("cancel index=%d offset=%d length=%d",t,e,i),this._callback(this._pull(this.requests,t,e,i),new Error("request was cancelled"),null),this._message(8,[t,e,i],null)}port(t){this._debug("port %d",t);const e=r.from(_);e.writeUInt16BE(t,5),this._push(e)}suggest(t){if(!this.hasFast)throw Error("fast extension is disabled");this._debug("suggest %d",t),this._message(13,[t],null)}haveAll(){if(!this.hasFast)throw Error("fast extension is disabled");this._debug("have-all"),this._push(M)}haveNone(){if(!this.hasFast)throw Error("fast extension is disabled");this._debug("have-none"),this._push(k)}reject(t,e,i){if(!this.hasFast)throw Error("fast extension is disabled");this._debug("reject index=%d offset=%d length=%d",t,e,i),this._pull(this.peerRequests,t,e,i),this._message(16,[t,e,i],null)}allowedFast(t){if(!this.hasFast)throw Error("fast extension is disabled");this._debug("allowed-fast %d",t),this.allowedFastSet.includes(t)||this.allowedFastSet.push(t),this._message(17,[t],null)}extended(t,e){if(this._debug("extended ext=%s",t),"string"==typeof t&&this.peerExtendedMapping[t]&&(t=this.peerExtendedMapping[t]),"number"!=typeof t)throw new Error(`Unrecognized extension: ${t}`);{const i=r.from([t]),n=r.isBuffer(e)?e:s.encode(e);this._message(20,[],r.concat([i,n]))}}setEncrypt(t,e){let i,n,s,o,a,h;switch(this.type){case"tcpIncoming":i=l.sync(r.from(this._utfToHex("keyB")+t+e,"hex")),n=l.sync(r.from(this._utfToHex("keyA")+t+e,"hex")),s=r.from(i,"hex"),o=[];for(const t of s.values())o.push(t);a=r.from(n,"hex"),h=[];for(const t of a.values())h.push(t);this._encryptGenerator=new f(o),this._decryptGenerator=new f(h);break;case"tcpOutgoing":i=l.sync(r.from(this._utfToHex("keyA")+t+e,"hex")),n=l.sync(r.from(this._utfToHex("keyB")+t+e,"hex")),s=r.from(i,"hex"),o=[];for(const t of s.values())o.push(t);a=r.from(n,"hex"),h=[];for(const t of a.values())h.push(t);this._encryptGenerator=new f(o),this._decryptGenerator=new f(h);break;default:return!1}for(let t=0;t<1024;t++)this._encryptGenerator.randomByte(),this._decryptGenerator.randomByte();return this._setGenerators=!0,!0}_read(){}_message(t,e,i){const n=i?i.length:0,s=r.allocUnsafe(5+4*e.length);s.writeUInt32BE(s.length+n-4,0),s[4]=t;for(let t=0;t<e.length;t++)s.writeUInt32BE(e[t],5+4*t);this._push(s),i&&this._push(i)}_push(t){if(!this._finished)return 2===this._encryptionMethod&&this._cryptoHandshakeDone&&(t=this._encrypt(t)),this.push(t)}_onKeepAlive(){this._debug("got keep-alive"),this.emit("keep-alive")}_onPe1(t){this._peerPubKey=t.toString("hex"),this._sharedSecret=this._dh.computeSecret(this._peerPubKey,"hex","hex"),this.emit("pe1")}_onPe2(t){this._peerPubKey=t.toString("hex"),this._sharedSecret=this._dh.computeSecret(this._peerPubKey,"hex","hex"),this.emit("pe2")}_onPe3(t){const e=l.sync(r.from(this._utfToHex("req3")+this._sharedSecret,"hex")),i=T(r.from(e,"hex"),t).toString("hex");this.emit("pe3",i)}_onPe3Encrypted(t,e){if(!t.equals(x))return this._debug("Error: verification constant did not match"),void this.destroy();for(const t of e.values())0!==t&&this._peerCryptoProvide.push(t);this._peerCryptoProvide.includes(2)?this._encryptionMethod=2:(this._debug("Error: RC4 encryption method not provided by peer"),this.destroy())}_onPe4(t){this._encryptionMethod=t.readUInt8(3),E.includes(this._encryptionMethod)||(this._debug("Error: peer selected invalid crypto method"),this.destroy()),this._cryptoHandshakeDone=!0,this._debug("crypto handshake done"),this.emit("pe4")}_onHandshake(t,e,i){const r=t.toString("hex"),n=e.toString("hex");this._debug("got handshake i=%s p=%s exts=%o",r,n,i),this.peerId=n,this.peerIdBuffer=e,this.peerExtensions=i,this.extensions.fast&&this.peerExtensions.fast&&(this._debug("fast extension is enabled"),this.hasFast=!0),this.emit("handshake",r,n,i);for(const t in this._ext)this._ext[t].onHandshake(r,n,i);i.extended&&this._handshakeSent&&!this._extendedHandshakeSent&&this._sendExtendedHandshake()}_onChoke(){if(this.peerChoking=!0,this._debug("got choke"),this.emit("choke"),!this.hasFast)for(;this.requests.length;)this._callback(this.requests.pop(),new Error("peer is choking"),null)}_onUnchoke(){this.peerChoking=!1,this._debug("got unchoke"),this.emit("unchoke")}_onInterested(){this.peerInterested=!0,this._debug("got interested"),this.emit("interested")}_onUninterested(){this.peerInterested=!1,this._debug("got uninterested"),this.emit("uninterested")}_onHave(t){this.peerPieces.get(t)||(this._debug("got have %d",t),this.peerPieces.set(t,!0),this.emit("have",t))}_onBitField(t){this.peerPieces=new o(t),this._debug("got bitfield"),this.emit("bitfield",this.peerPieces)}_onRequest(t,e,i){if(this.amChoking&&(!this.hasFast||!this.allowedFastSet.includes(t)))return void(this.hasFast&&this.reject(t,e,i));this._debug("got request index=%d offset=%d length=%d",t,e,i);const r=(r,s)=>{if(n===this._pull(this.peerRequests,t,e,i))return r?(this._debug("error satisfying request index=%d offset=%d length=%d (%s)",t,e,i,r.message),void(this.hasFast&&this.reject(t,e,i))):void this.piece(t,e,s)},n=new A(t,e,i,r);this.peerRequests.push(n),this.emit("request",t,e,i,r)}_onPiece(t,e,i){this._debug("got piece index=%d offset=%d",t,e),this._callback(this._pull(this.requests,t,e,i.length),null,i),this.downloaded+=i.length,this.downloadSpeed(i.length),this.emit("download",i.length),this.emit("piece",t,e,i)}_onCancel(t,e,i){this._debug("got cancel index=%d offset=%d length=%d",t,e,i),this._pull(this.peerRequests,t,e,i),this.emit("cancel",t,e,i)}_onPort(t){this._debug("got port %d",t),this.emit("port",t)}_onSuggest(t){if(!this.hasFast)return this._debug("Error: got suggest whereas fast extension is disabled"),void this.destroy();this._debug("got suggest %d",t),this.emit("suggest",t)}_onHaveAll(){if(!this.hasFast)return this._debug("Error: got have-all whereas fast extension is disabled"),void this.destroy();this._debug("got have-all"),this.peerPieces=new I,this.emit("have-all")}_onHaveNone(){if(!this.hasFast)return this._debug("Error: got have-none whereas fast extension is disabled"),void this.destroy();this._debug("got have-none"),this.emit("have-none")}_onReject(t,e,i){if(!this.hasFast)return this._debug("Error: got reject whereas fast extension is disabled"),void this.destroy();this._debug("got reject index=%d offset=%d length=%d",t,e,i),this._callback(this._pull(this.requests,t,e,i),new Error("request was rejected"),null),this.emit("reject",t,e,i)}_onAllowedFast(t){if(!this.hasFast)return this._debug("Error: got allowed-fast whereas fast extension is disabled"),void this.destroy();this._debug("got allowed-fast %d",t),this.peerAllowedFastSet.includes(t)||this.peerAllowedFastSet.push(t),this.peerAllowedFastSet.length>100&&this.peerAllowedFastSet.shift(),this.emit("allowed-fast",t)}_onExtended(t,e){if(0===t){let t;try{t=s.decode(e)}catch(t){this._debug("ignoring invalid extended handshake: %s",t.message||t)}if(!t)return;if(this.peerExtendedHandshake=t,"object"==typeof t.m)for(const e in t.m)this.peerExtendedMapping[e]=Number(t.m[e].toString());for(const t in this._ext)this.peerExtendedMapping[t]&&this._ext[t].onExtendedHandshake(this.peerExtendedHandshake);this._debug("got extended handshake"),this.emit("extended","handshake",this.peerExtendedHandshake)}else this.extendedMapping[t]&&(t=this.extendedMapping[t],this._ext[t]&&this._ext[t].onMessage(e)),this._debug("got extended message ext=%s",t),this.emit("extended",t,e)}_onTimeout(){this._debug("request timed out"),this._callback(this.requests.shift(),new Error("request has timed out"),null),this.emit("timeout")}_write(t,e,i){if(2===this._encryptionMethod&&this._cryptoHandshakeDone&&(t=this._decrypt(t)),this._bufferSize+=t.length,this._buffer.push(t),this._buffer.length>1&&(this._buffer=[r.concat(this._buffer,this._bufferSize)]),this._cryptoSyncPattern){const e=this._buffer[0].indexOf(this._cryptoSyncPattern);if(-1!==e)this._buffer[0]=this._buffer[0].slice(e+this._cryptoSyncPattern.length),this._bufferSize-=e+this._cryptoSyncPattern.length,this._cryptoSyncPattern=null;else if(this._bufferSize+t.length>this._waitMaxBytes+this._cryptoSyncPattern.length)return this._debug("Error: could not resynchronize"),void this.destroy()}for(;this._bufferSize>=this._parserSize&&!this._cryptoSyncPattern;)if(0===this._parserSize)this._parser(r.from([]));else{const t=this._buffer[0];this._bufferSize-=this._parserSize,this._buffer=this._bufferSize?[t.slice(this._parserSize)]:[],this._parser(t.slice(0,this._parserSize))}i(null)}_callback(t,e,i){t&&(this._resetTimeout(!this.peerChoking&&!this._finished),t.callback(e,i))}_resetTimeout(t){if(!t||!this._timeoutMs||!this.requests.length)return clearTimeout(this._timeout),this._timeout=null,void(this._timeoutExpiresAt=null);const e=Date.now()+this._timeoutMs;if(this._timeout){if(e-this._timeoutExpiresAt<.05*this._timeoutMs)return;clearTimeout(this._timeout)}this._timeoutExpiresAt=e,this._timeout=setTimeout((()=>this._onTimeout()),this._timeoutMs),this._timeoutUnref&&this._timeout.unref&&this._timeout.unref()}_parse(t,e){this._parserSize=t,this._parser=e}_parseUntil(t,e){this._cryptoSyncPattern=t,this._waitMaxBytes=e}_onMessageLength(t){const e=t.readUInt32BE(0);e>0?this._parse(e,this._onMessage):(this._onKeepAlive(),this._parse(4,this._onMessageLength))}_onMessage(t){switch(this._parse(4,this._onMessageLength),t[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(t.readUInt32BE(1));case 5:return this._onBitField(t.slice(1));case 6:return this._onRequest(t.readUInt32BE(1),t.readUInt32BE(5),t.readUInt32BE(9));case 7:return this._onPiece(t.readUInt32BE(1),t.readUInt32BE(5),t.slice(9));case 8:return this._onCancel(t.readUInt32BE(1),t.readUInt32BE(5),t.readUInt32BE(9));case 9:return this._onPort(t.readUInt16BE(1));case 13:return this._onSuggest(t.readUInt32BE(1));case 14:return this._onHaveAll();case 15:return this._onHaveNone();case 16:return this._onReject(t.readUInt32BE(1),t.readUInt32BE(5),t.readUInt32BE(9));case 17:return this._onAllowedFast(t.readUInt32BE(1));case 20:return this._onExtended(t.readUInt8(1),t.slice(2));default:return this._debug("got unknown message"),this.emit("unknownmessage",t)}}_determineHandshakeType(){this._parse(1,(t=>{const e=t.readUInt8(0);19===e?this._parse(e+48,this._onHandshakeBuffer):this._parsePe1(t)}))}_parsePe1(t){this._parse(95,(e=>{this._onPe1(r.concat([t,e])),this._parsePe3()}))}_parsePe2(){this._parse(96,(t=>{for(this._onPe2(t);!this._setGenerators;);this._parsePe4()}))}_parsePe3(){const t=r.from(l.sync(r.from(this._utfToHex("req1")+this._sharedSecret,"hex")),"hex");this._parseUntil(t,512),this._parse(20,(t=>{for(this._onPe3(t);!this._setGenerators;);this._parsePe3Encrypted()}))}_parsePe3Encrypted(){this._parse(14,(t=>{const e=this._decryptHandshake(t.slice(0,8)),i=this._decryptHandshake(t.slice(8,12)),r=this._decryptHandshake(t.slice(12,14)).readUInt16BE(0);this._parse(r,(t=>{t=this._decryptHandshake(t),this._parse(2,(r=>{const n=this._decryptHandshake(r).readUInt16BE(0);this._parse(n,(r=>{r=this._decryptHandshake(r),this._onPe3Encrypted(e,i,t,r);const s=n?r.readUInt8(0):null,o=n?r.slice(1,20):null;19===s&&"BitTorrent protocol"===o.toString()?this._onHandshakeBuffer(r.slice(1)):this._parseHandshake()}))}))}))}))}_parsePe4(){const t=this._decryptHandshake(x);this._parseUntil(t,512),this._parse(6,(t=>{const e=this._decryptHandshake(t.slice(0,4)),i=this._decryptHandshake(t.slice(4,6)).readUInt16BE(0);this._parse(i,(t=>{this._decryptHandshake(t),this._onPe4(e),this._parseHandshake(null)}))}))}_parseHandshake(){this._parse(1,(t=>{const e=t.readUInt8(0);if(19!==e)return this._debug("Error: wire not speaking BitTorrent protocol (%s)",e.toString()),void this.end();this._parse(e+48,this._onHandshakeBuffer)}))}_onHandshakeBuffer(t){const e=t.slice(0,19);if("BitTorrent protocol"!==e.toString())return this._debug("Error: wire not speaking BitTorrent protocol (%s)",e.toString()),void this.end();t=t.slice(19),this._onHandshake(t.slice(8,28),t.slice(28,48),{dht:!!(1&t[7]),fast:!!(4&t[7]),extended:!!(16&t[5])}),this._parse(4,this._onMessageLength)}_onFinish(){for(this._finished=!0,this.push(null);this.read(););for(clearInterval(this._keepAliveInterval),this._parse(Number.MAX_VALUE,(()=>{}));this.peerRequests.length;)this.peerRequests.pop();for(;this.requests.length;)this._callback(this.requests.pop(),new Error("wire was closed"),null)}_debug(...t){t[0]=`[${this._debugId}] ${t[0]}`,h(...t)}_pull(t,e,i,r){for(let s=0;s<t.length;s++){const o=t[s];if(o.piece===e&&o.offset===i&&o.length===r)return n(t,s),o}return null}_encryptHandshake(t){const e=r.from(t);if(!this._encryptGenerator)return this._debug("Warning: Encrypting without any generator"),e;for(let i=0;i<t.length;i++){const t=this._encryptGenerator.randomByte();e[i]=e[i]^t}return e}_encrypt(t){const e=r.from(t);if(!this._encryptGenerator||2!==this._encryptionMethod)return e;for(let i=0;i<t.length;i++){const t=this._encryptGenerator.randomByte();e[i]=e[i]^t}return e}_decryptHandshake(t){const e=r.from(t);if(!this._decryptGenerator)return this._debug("Warning: Decrypting without any generator"),e;for(let i=0;i<t.length;i++){const t=this._decryptGenerator.randomByte();e[i]=e[i]^t}return e}_decrypt(t){const e=r.from(t);if(!this._decryptGenerator||2!==this._encryptionMethod)return e;for(let i=0;i<t.length;i++){const t=this._decryptGenerator.randomByte();e[i]=e[i]^t}return e}_utfToHex(t){return r.from(t,"utf8").toString("hex")}}t.exports=C},8735:(t,e,i)=>{var r=i(9590),n=i(8764).Buffer;const s=i(1227)("bittorrent-tracker:client"),o=i(7187),a=i(778),h=i(4595),u=i(8853),l=i(4375),c=i(3165),d=i(8333),f=i(59),p=i(1423);class m extends o{constructor(t={}){if(super(),!t.peerId)throw new Error("Option `peerId` is required");if(!t.infoHash)throw new Error("Option `infoHash` is required");if(!t.announce)throw new Error("Option `announce` is required");if(!r.browser&&!t.port)throw new Error("Option `port` is required");this.peerId="string"==typeof t.peerId?t.peerId:t.peerId.toString("hex"),this._peerIdBuffer=n.from(this.peerId,"hex"),this._peerIdBinary=this._peerIdBuffer.toString("binary"),this.infoHash="string"==typeof t.infoHash?t.infoHash.toLowerCase():t.infoHash.toString("hex"),this._infoHashBuffer=n.from(this.infoHash,"hex"),this._infoHashBinary=this._infoHashBuffer.toString("binary"),s("new client %s",this.infoHash),this.destroyed=!1,this._port=t.port,this._getAnnounceOpts=t.getAnnounceOpts,this._rtcConfig=t.rtcConfig,this._userAgent=t.userAgent,this._proxyOpts=t.proxyOpts,this._wrtc="function"==typeof t.wrtc?t.wrtc():t.wrtc;let e="string"==typeof t.announce?[t.announce]:null==t.announce?[]:t.announce;e=e.map((t=>("/"===(t=t.toString())[t.length-1]&&(t=t.substring(0,t.length-1)),t))),e=Array.from(new Set(e));const i=!1!==this._wrtc&&(!!this._wrtc||u.WEBRTC_SUPPORT),o=t=>{l((()=>{this.emit("warning",t)}))};this._trackers=e.map((t=>{let e;try{e=c.parseUrl(t)}catch(e){return o(new Error(`Invalid tracker URL: ${t}`)),null}const r=e.port;if(r<0||r>65535)return o(new Error(`Invalid tracker port: ${t}`)),null;const n=e.protocol;return"http:"!==n&&"https:"!==n||"function"!=typeof d?"udp:"===n&&"function"==typeof f?new f(this,t):"ws:"!==n&&"wss:"!==n||!i||"ws:"===n&&"undefined"!=typeof window&&"https:"===window.location.protocol?(o(new Error(`Unsupported tracker protocol: ${t}`)),null):new p(this,t):new d(this,t)})).filter(Boolean)}start(t){(t=this._defaultAnnounceOpts(t)).event="started",s("send `start` %o",t),this._announce(t),this._trackers.forEach((t=>{t.setInterval()}))}stop(t){(t=this._defaultAnnounceOpts(t)).event="stopped",s("send `stop` %o",t),this._announce(t)}complete(t){t||(t={}),(t=this._defaultAnnounceOpts(t)).event="completed",s("send `complete` %o",t),this._announce(t)}update(t){(t=this._defaultAnnounceOpts(t)).event&&delete t.event,s("send `update` %o",t),this._announce(t)}_announce(t){this._trackers.forEach((e=>{e.announce(t)}))}scrape(t){s("send `scrape`"),t||(t={}),this._trackers.forEach((e=>{e.scrape(t)}))}setInterval(t){s("setInterval %d",t),this._trackers.forEach((e=>{e.setInterval(t)}))}destroy(t){if(this.destroyed)return;this.destroyed=!0,s("destroy");const e=this._trackers.map((t=>e=>{t.destroy(e)}));h(e,t),this._trackers=[],this._getAnnounceOpts=null}_defaultAnnounceOpts(t={}){return null==t.numwant&&(t.numwant=c.DEFAULT_ANNOUNCE_PEERS),null==t.uploaded&&(t.uploaded=0),null==t.downloaded&&(t.downloaded=0),this._getAnnounceOpts&&(t=Object.assign({},t,this._getAnnounceOpts())),t}}m.scrape=(t,e)=>{if(e=a(e),!t.infoHash)throw new Error("Option `infoHash` is required");if(!t.announce)throw new Error("Option `announce` is required");const i=Object.assign({},t,{infoHash:Array.isArray(t.infoHash)?t.infoHash[0]:t.infoHash,peerId:n.from("01234567890123456789"),port:6881}),r=new m(i);r.once("error",e),r.once("warning",e);let s=Array.isArray(t.infoHash)?t.infoHash.length:1;const o={};return r.on("scrape",(t=>{if(s-=1,o[t.infoHash]=t,0===s){r.destroy();const t=Object.keys(o);1===t.length?e(null,o[t[0]]):e(null,o)}})),t.infoHash=Array.isArray(t.infoHash)?t.infoHash.map((t=>n.from(t,"hex"))):n.from(t.infoHash,"hex"),r.scrape({infoHash:t.infoHash}),r},t.exports=m},4394:(t,e,i)=>{const r=i(7187);t.exports=class extends r{constructor(t,e){super(),this.client=t,this.announceUrl=e,this.interval=null,this.destroyed=!1}setInterval(t){null==t&&(t=this.DEFAULT_ANNOUNCE_INTERVAL),clearInterval(this.interval),t&&(this.interval=setInterval((()=>{this.announce(this.client._defaultAnnounceOpts())}),t),this.interval.unref&&this.interval.unref())}}},1423:(t,e,i)=>{const r=i(6313),n=i(1227)("bittorrent-tracker:websocket-tracker"),s=i(8853),o=i(1798),a=i(522),h=i(9354),u=i(3165),l=i(4394),c={};class d extends l{constructor(t,e){super(t,e),n("new websocket tracker %s",e),this.peers={},this.socket=null,this.reconnecting=!1,this.retries=0,this.reconnectTimer=null,this.expectingResponse=!1,this._openSocket()}announce(t){if(this.destroyed||this.reconnecting)return;if(!this.socket.connected)return void this.socket.once("connect",(()=>{this.announce(t)}));const e=Object.assign({},t,{action:"announce",info_hash:this.client._infoHashBinary,peer_id:this.client._peerIdBinary});if(this._trackerId&&(e.trackerid=this._trackerId),"stopped"===t.event||"completed"===t.event)this._send(e);else{const i=Math.min(t.numwant,5);this._generateOffers(i,(t=>{e.numwant=i,e.offers=t,this._send(e)}))}}scrape(t){if(this.destroyed||this.reconnecting)return;if(!this.socket.connected)return void this.socket.once("connect",(()=>{this.scrape(t)}));const e={action:"scrape",info_hash:Array.isArray(t.infoHash)&&t.infoHash.length>0?t.infoHash.map((t=>t.toString("binary"))):t.infoHash&&t.infoHash.toString("binary")||this.client._infoHashBinary};this._send(e)}destroy(t=f){if(this.destroyed)return t(null);this.destroyed=!0,clearInterval(this.interval),clearTimeout(this.reconnectTimer);for(const t in this.peers){const e=this.peers[t];clearTimeout(e.trackerTimeout),e.destroy()}if(this.peers=null,this.socket&&(this.socket.removeListener("connect",this._onSocketConnectBound),this.socket.removeListener("data",this._onSocketDataBound),this.socket.removeListener("close",this._onSocketCloseBound),this.socket.removeListener("error",this._onSocketErrorBound),this.socket=null),this._onSocketConnectBound=null,this._onSocketErrorBound=null,this._onSocketDataBound=null,this._onSocketCloseBound=null,c[this.announceUrl]&&(c[this.announceUrl].consumers-=1),c[this.announceUrl].consumers>0)return t();let e,i=c[this.announceUrl];if(delete c[this.announceUrl],i.on("error",f),i.once("close",t),!this.expectingResponse)return r();function r(){e&&(clearTimeout(e),e=null),i.removeListener("data",r),i.destroy(),i=null}e=setTimeout(r,u.DESTROY_TIMEOUT),i.once("data",r)}_openSocket(){if(this.destroyed=!1,this.peers||(this.peers={}),this._onSocketConnectBound=()=>{this._onSocketConnect()},this._onSocketErrorBound=t=>{this._onSocketError(t)},this._onSocketDataBound=t=>{this._onSocketData(t)},this._onSocketCloseBound=()=>{this._onSocketClose()},this.socket=c[this.announceUrl],this.socket)c[this.announceUrl].consumers+=1,this.socket.connected&&this._onSocketConnectBound();else{const t=new URL(this.announceUrl);let e;this.client._proxyOpts&&(e="wss:"===t.protocol?this.client._proxyOpts.httpsAgent:this.client._proxyOpts.httpAgent,!e&&this.client._proxyOpts.socksProxy&&(e=new h.Agent(r(this.client._proxyOpts.socksProxy),"wss:"===t.protocol))),this.socket=c[this.announceUrl]=new a({url:this.announceUrl,agent:e}),this.socket.consumers=1,this.socket.once("connect",this._onSocketConnectBound)}this.socket.on("data",this._onSocketDataBound),this.socket.once("close",this._onSocketCloseBound),this.socket.once("error",this._onSocketErrorBound)}_onSocketConnect(){this.destroyed||this.reconnecting&&(this.reconnecting=!1,this.retries=0,this.announce(this.client._defaultAnnounceOpts()))}_onSocketData(t){if(!this.destroyed){this.expectingResponse=!1;try{t=JSON.parse(t)}catch(t){return void this.client.emit("warning",new Error("Invalid tracker response"))}"announce"===t.action?this._onAnnounceResponse(t):"scrape"===t.action?this._onScrapeResponse(t):this._onSocketError(new Error(`invalid action in WS response: ${t.action}`))}}_onAnnounceResponse(t){if(t.info_hash!==this.client._infoHashBinary)return void n("ignoring websocket data from %s for %s (looking for %s: reused socket)",this.announceUrl,u.binaryToHex(t.info_hash),this.client.infoHash);if(t.peer_id&&t.peer_id===this.client._peerIdBinary)return;n("received %s from %s for %s",JSON.stringify(t),this.announceUrl,this.client.infoHash);const e=t["failure reason"];if(e)return this.client.emit("warning",new Error(e));const i=t["warning message"];i&&this.client.emit("warning",new Error(i));const r=t.interval||t["min interval"];r&&this.setInterval(1e3*r);const s=t["tracker id"];if(s&&(this._trackerId=s),null!=t.complete){const e=Object.assign({},t,{announce:this.announceUrl,infoHash:u.binaryToHex(t.info_hash)});this.client.emit("update",e)}let o;if(t.offer&&t.peer_id&&(n("creating peer (from remote offer)"),o=this._createPeer(),o.id=u.binaryToHex(t.peer_id),o.once("signal",(e=>{const i={action:"announce",info_hash:this.client._infoHashBinary,peer_id:this.client._peerIdBinary,to_peer_id:t.peer_id,answer:e,offer_id:t.offer_id};this._trackerId&&(i.trackerid=this._trackerId),this._send(i)})),this.client.emit("peer",o),o.signal(t.offer)),t.answer&&t.peer_id){const e=u.binaryToHex(t.offer_id);o=this.peers[e],o?(o.id=u.binaryToHex(t.peer_id),this.client.emit("peer",o),o.signal(t.answer),clearTimeout(o.trackerTimeout),o.trackerTimeout=null,delete this.peers[e]):n(`got unexpected answer: ${JSON.stringify(t.answer)}`)}}_onScrapeResponse(t){t=t.files||{};const e=Object.keys(t);0!==e.length?e.forEach((e=>{const i=Object.assign(t[e],{announce:this.announceUrl,infoHash:u.binaryToHex(e)});this.client.emit("scrape",i)})):this.client.emit("warning",new Error("invalid scrape response"))}_onSocketClose(){this.destroyed||(this.destroy(),this._startReconnectTimer())}_onSocketError(t){this.destroyed||(this.destroy(),this.client.emit("warning",t),this._startReconnectTimer())}_startReconnectTimer(){const t=Math.floor(3e5*Math.random())+Math.min(1e4*Math.pow(2,this.retries),36e5);this.reconnecting=!0,clearTimeout(this.reconnectTimer),this.reconnectTimer=setTimeout((()=>{this.retries++,this._openSocket()}),t),this.reconnectTimer.unref&&this.reconnectTimer.unref(),n("reconnecting socket in %s ms",t)}_send(t){if(this.destroyed)return;this.expectingResponse=!0;const e=JSON.stringify(t);n("send %s",e),this.socket.send(e)}_generateOffers(t,e){const i=this,r=[];n("generating %s offers",t);for(let e=0;e<t;++e)s();function s(){const t=o(20).toString("hex");n("creating peer (from _generateOffers)");const e=i.peers[t]=i._createPeer({initiator:!0});e.once("signal",(e=>{r.push({offer:e,offer_id:u.hexToBinary(t)}),a()})),e.trackerTimeout=setTimeout((()=>{n("tracker timeout: destroying peer"),e.trackerTimeout=null,delete i.peers[t],e.destroy()}),5e4),e.trackerTimeout.unref&&e.trackerTimeout.unref()}function a(){r.length===t&&(n("generated %s offers",t),e(r))}a()}_createPeer(t){const e=this;t=Object.assign({trickle:!1,config:e.client._rtcConfig,wrtc:e.client._wrtc},t);const i=new s(t);return i.once("error",r),i.once("connect",(function t(){i.removeListener("error",r),i.removeListener("connect",t)})),i;function r(t){e.client.emit("warning",new Error(`Connection error: ${t.message}`)),i.destroy()}}}function f(){}d.prototype.DEFAULT_ANNOUNCE_INTERVAL=3e4,d._socketPool=c,t.exports=d},3165:(t,e,i)=>{var r=i(8764).Buffer;e.DEFAULT_ANNOUNCE_PEERS=50,e.MAX_ANNOUNCE_PEERS=82,e.binaryToHex=t=>("string"!=typeof t&&(t=String(t)),r.from(t,"binary").toString("hex")),e.hexToBinary=t=>("string"!=typeof t&&(t=String(t)),r.from(t,"hex").toString("binary")),e.parseUrl=t=>{const e=new URL(t.replace(/^udp:/,"http:"));return t.match(/^udp:/)&&Object.defineProperties(e,{href:{value:e.href.replace(/^http/,"udp")},protocol:{value:e.protocol.replace(/^http/,"udp")},origin:{value:e.origin.replace(/^http/,"udp")}}),e};const n=i(3762);Object.assign(e,n)},7619:(t,e,i)=>{var r=i(8764).Buffer;t.exports=function(t,e){if("undefined"==typeof Blob||!(t instanceof Blob))throw new Error("first argument must be a Blob");if("function"!=typeof e)throw new Error("second argument must be a function");const i=new FileReader;i.addEventListener("loadend",(function t(n){i.removeEventListener("loadend",t,!1),n.error?e(n.error):e(null,r.from(i.result))}),!1),i.readAsArrayBuffer(t)}},9e3:(t,e,i)=>{var r=i(8764).Buffer;const{Transform:n}=i(8473);t.exports=class extends n{constructor(t,e={}){super(e),"object"==typeof t&&(t=(e=t).size),this.size=t||512;const{nopad:i,zeroPadding:r=!0}=e;this._zeroPadding=!i&&!!r,this._buffered=[],this._bufferedBytes=0}_transform(t,e,i){for(this._bufferedBytes+=t.length,this._buffered.push(t);this._bufferedBytes>=this.size;){this._bufferedBytes-=this.size;const t=[];let e=0;for(;e<this.size;){const i=this._buffered.shift();if(e+i.length<=this.size)t.push(i),e+=i.length;else{const r=this.size-e;t.push(i.slice(0,r)),e+=r,this._buffered.unshift(i.slice(r))}}this.push(r.concat(t,this.size))}i()}_flush(){if(this._bufferedBytes&&this._zeroPadding){const t=r.alloc(this.size-this._bufferedBytes);this._buffered.push(t),this.push(r.concat(this._buffered)),this._buffered=null}else this._bufferedBytes&&(this.push(r.concat(this._buffered)),this._buffered=null);this.push(null)}}},3550:function(t,e,i){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function s(t,e,i){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var o;"object"==typeof t?t.exports=s:e.BN=s,s.BN=s,s.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:i(6601).Buffer}catch(t){}function a(t,e){var i=t.charCodeAt(e);return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void r(!1,"Invalid character in "+t)}function h(t,e,i){var r=a(t,i);return i-1>=e&&(r|=a(t,i-1)<<4),r}function u(t,e,i,n){for(var s=0,o=0,a=Math.min(t.length,i),h=e;h<a;h++){var u=t.charCodeAt(h)-48;s*=n,o=u>=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&o<n,"Invalid character"),s+=o}return s}function l(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(s.isBN=function(t){return t instanceof s||null!==t&&"object"==typeof t&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===e?this._parseHex(t,n,i):(this._parseBase(t,e,n),"le"===i&&this._initArray(this.toArray(),e,i)))},s.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},s.prototype._initArray=function(t,e,i){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var s,o,a=0;if("be"===i)for(n=t.length-1,s=0;n>=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===i)for(n=0,s=0;n<t.length;n+=3)o=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this._strip()},s.prototype._parseHex=function(t,e,i){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,s=0,o=0;if("be"===i)for(r=t.length-1;r>=e;r-=2)n=h(t,e,r)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(r=(t.length-e)%2==0?e+1:e;r<t.length;r+=2)n=h(t,e,r)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this._strip()},s.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var s=t.length-i,o=s%r,a=Math.min(s,s-o)+i,h=0,l=i;l<a;l+=r)h=u(t,l,l+r,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==o){var c=1;for(h=u(t,l,t.length,e),l=0;l<o;l++)c*=e;this.imuln(c),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this._strip()},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype._move=function(t){l(t,this)},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(t){s.prototype.inspect=c}else s.prototype.inspect=c;function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function m(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],s=0|e.words[0],o=n*s,a=67108863&o,h=o/67108864|0;i.words[0]=a;for(var u=1;u<r;u++){for(var l=h>>>26,c=67108863&h,d=Math.min(u,e.length-1),f=Math.max(0,u-t.length+1);f<=d;f++){var p=u-f|0;l+=(o=(n=0|t.words[p])*(s=0|e.words[f])+c)/67108864|0,c=67108863&o}i.words[u]=0|c,h=0|l}return 0!==h?i.words[u]=0|h:i.length--,i._strip()}s.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var n=0,s=0,o=0;o<this.length;o++){var a=this.words[o],h=(16777215&(a<<n|s)).toString(16);i=0!=(s=a>>>24-n&16777215)||o!==this.length-1?d[6-h.length]+h+i:h+i,(n+=2)>=26&&(n-=26,o--)}for(0!==s&&(i=s.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var u=f[t],l=p[t];i="";var c=this.clone();for(c.negative=0;!c.isZero();){var m=c.modrn(l).toString(t);i=(c=c.idivn(l)).isZero()?m+i:d[u-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,i){this._strip();var n=this.byteLength(),s=i||Math.max(1,n);r(n<=s,"byte array longer than desired length"),r(s>0,"Requested array length <= 0");var o=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,s);return this["_toArrayLike"+("le"===e?"LE":"BE")](o,n),o},s.prototype._toArrayLikeLE=function(t,e){for(var i=0,r=0,n=0,s=0;n<this.length;n++){var o=this.words[n]<<s|r;t[i++]=255&o,i<t.length&&(t[i++]=o>>8&255),i<t.length&&(t[i++]=o>>16&255),6===s?(i<t.length&&(t[i++]=o>>24&255),r=0,s=0):(r=o>>>24,s+=2)}if(i<t.length)for(t[i++]=r;i<t.length;)t[i++]=0},s.prototype._toArrayLikeBE=function(t,e){for(var i=t.length-1,r=0,n=0,s=0;n<this.length;n++){var o=this.words[n]<<s|r;t[i--]=255&o,i>=0&&(t[i--]=o>>8&255),i>=0&&(t[i--]=o>>16&255),6===s?(i>=0&&(t[i--]=o>>24&255),r=0,s=0):(r=o>>>24,s+=2)}if(i>=0)for(t[i--]=r;i>=0;)t[i--]=0},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var i=this._zeroBits(this.words[e]);if(t+=i,26!==i)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},s.prototype.ior=function(t){return r(0==(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=e.length,this._strip()},s.prototype.iand=function(t){return r(0==(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;r<i.length;r++)this.words[r]=e.words[r]^i.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this._strip()},s.prototype.ixor=function(t){return r(0==(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this._strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<n:this.words[i]&~(1<<n),this._strip()},s.prototype.iadd=function(t){var e,i,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0,s=0;s<r.length;s++)e=(0|i.words[s])+(0|r.words[s])+n,this.words[s]=67108863&e,n=e>>>26;for(;0!==n&&s<i.length;s++)e=(0|i.words[s])+n,this.words[s]=67108863&e,n=e>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var s=0,o=0;o<r.length;o++)s=(e=(0|i.words[o])-(0|r.words[o])+s)>>26,this.words[o]=67108863&e;for(;0!==s&&o<i.length;o++)s=(e=(0|i.words[o])+s)>>26,this.words[o]=67108863&e;if(0===s&&o<i.length&&i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this.length=Math.max(this.length,o),i!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,e,i){var r,n,s,o=t.words,a=e.words,h=i.words,u=0,l=0|o[0],c=8191&l,d=l>>>13,f=0|o[1],p=8191&f,m=f>>>13,g=0|o[2],b=8191&g,v=g>>>13,y=0|o[3],w=8191&y,_=y>>>13,M=0|o[4],k=8191&M,x=M>>>13,E=0|o[5],S=8191&E,T=E>>>13,A=0|o[6],I=8191&A,C=A>>>13,B=0|o[7],R=8191&B,P=B>>>13,L=0|o[8],O=8191&L,D=L>>>13,N=0|o[9],j=8191&N,U=N>>>13,F=0|a[0],q=8191&F,z=F>>>13,H=0|a[1],W=8191&H,$=H>>>13,Z=0|a[2],V=8191&Z,K=Z>>>13,G=0|a[3],J=8191&G,Y=G>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],it=8191&et,rt=et>>>13,nt=0|a[6],st=8191&nt,ot=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,lt=0|a[8],ct=8191<,dt=lt>>>13,ft=0|a[9],pt=8191&ft,mt=ft>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(u+(r=Math.imul(c,q))|0)+((8191&(n=(n=Math.imul(c,z))+Math.imul(d,q)|0))<<13)|0;u=((s=Math.imul(d,z))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(p,q),n=(n=Math.imul(p,z))+Math.imul(m,q)|0,s=Math.imul(m,z);var bt=(u+(r=r+Math.imul(c,W)|0)|0)+((8191&(n=(n=n+Math.imul(c,$)|0)+Math.imul(d,W)|0))<<13)|0;u=((s=s+Math.imul(d,$)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,q),n=(n=Math.imul(b,z))+Math.imul(v,q)|0,s=Math.imul(v,z),r=r+Math.imul(p,W)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(m,W)|0,s=s+Math.imul(m,$)|0;var vt=(u+(r=r+Math.imul(c,V)|0)|0)+((8191&(n=(n=n+Math.imul(c,K)|0)+Math.imul(d,V)|0))<<13)|0;u=((s=s+Math.imul(d,K)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(w,q),n=(n=Math.imul(w,z))+Math.imul(_,q)|0,s=Math.imul(_,z),r=r+Math.imul(b,W)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(v,W)|0,s=s+Math.imul(v,$)|0,r=r+Math.imul(p,V)|0,n=(n=n+Math.imul(p,K)|0)+Math.imul(m,V)|0,s=s+Math.imul(m,K)|0;var yt=(u+(r=r+Math.imul(c,J)|0)|0)+((8191&(n=(n=n+Math.imul(c,Y)|0)+Math.imul(d,J)|0))<<13)|0;u=((s=s+Math.imul(d,Y)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(k,q),n=(n=Math.imul(k,z))+Math.imul(x,q)|0,s=Math.imul(x,z),r=r+Math.imul(w,W)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(_,W)|0,s=s+Math.imul(_,$)|0,r=r+Math.imul(b,V)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(v,V)|0,s=s+Math.imul(v,K)|0,r=r+Math.imul(p,J)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(m,J)|0,s=s+Math.imul(m,Y)|0;var wt=(u+(r=r+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;u=((s=s+Math.imul(d,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(S,q),n=(n=Math.imul(S,z))+Math.imul(T,q)|0,s=Math.imul(T,z),r=r+Math.imul(k,W)|0,n=(n=n+Math.imul(k,$)|0)+Math.imul(x,W)|0,s=s+Math.imul(x,$)|0,r=r+Math.imul(w,V)|0,n=(n=n+Math.imul(w,K)|0)+Math.imul(_,V)|0,s=s+Math.imul(_,K)|0,r=r+Math.imul(b,J)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(v,J)|0,s=s+Math.imul(v,Y)|0,r=r+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,tt)|0;var _t=(u+(r=r+Math.imul(c,it)|0)|0)+((8191&(n=(n=n+Math.imul(c,rt)|0)+Math.imul(d,it)|0))<<13)|0;u=((s=s+Math.imul(d,rt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(I,q),n=(n=Math.imul(I,z))+Math.imul(C,q)|0,s=Math.imul(C,z),r=r+Math.imul(S,W)|0,n=(n=n+Math.imul(S,$)|0)+Math.imul(T,W)|0,s=s+Math.imul(T,$)|0,r=r+Math.imul(k,V)|0,n=(n=n+Math.imul(k,K)|0)+Math.imul(x,V)|0,s=s+Math.imul(x,K)|0,r=r+Math.imul(w,J)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,J)|0,s=s+Math.imul(_,Y)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,Q)|0,s=s+Math.imul(v,tt)|0,r=r+Math.imul(p,it)|0,n=(n=n+Math.imul(p,rt)|0)+Math.imul(m,it)|0,s=s+Math.imul(m,rt)|0;var Mt=(u+(r=r+Math.imul(c,st)|0)|0)+((8191&(n=(n=n+Math.imul(c,ot)|0)+Math.imul(d,st)|0))<<13)|0;u=((s=s+Math.imul(d,ot)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(R,q),n=(n=Math.imul(R,z))+Math.imul(P,q)|0,s=Math.imul(P,z),r=r+Math.imul(I,W)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(C,W)|0,s=s+Math.imul(C,$)|0,r=r+Math.imul(S,V)|0,n=(n=n+Math.imul(S,K)|0)+Math.imul(T,V)|0,s=s+Math.imul(T,K)|0,r=r+Math.imul(k,J)|0,n=(n=n+Math.imul(k,Y)|0)+Math.imul(x,J)|0,s=s+Math.imul(x,Y)|0,r=r+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,tt)|0,r=r+Math.imul(b,it)|0,n=(n=n+Math.imul(b,rt)|0)+Math.imul(v,it)|0,s=s+Math.imul(v,rt)|0,r=r+Math.imul(p,st)|0,n=(n=n+Math.imul(p,ot)|0)+Math.imul(m,st)|0,s=s+Math.imul(m,ot)|0;var kt=(u+(r=r+Math.imul(c,ht)|0)|0)+((8191&(n=(n=n+Math.imul(c,ut)|0)+Math.imul(d,ht)|0))<<13)|0;u=((s=s+Math.imul(d,ut)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(O,q),n=(n=Math.imul(O,z))+Math.imul(D,q)|0,s=Math.imul(D,z),r=r+Math.imul(R,W)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(P,W)|0,s=s+Math.imul(P,$)|0,r=r+Math.imul(I,V)|0,n=(n=n+Math.imul(I,K)|0)+Math.imul(C,V)|0,s=s+Math.imul(C,K)|0,r=r+Math.imul(S,J)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(T,J)|0,s=s+Math.imul(T,Y)|0,r=r+Math.imul(k,Q)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(x,Q)|0,s=s+Math.imul(x,tt)|0,r=r+Math.imul(w,it)|0,n=(n=n+Math.imul(w,rt)|0)+Math.imul(_,it)|0,s=s+Math.imul(_,rt)|0,r=r+Math.imul(b,st)|0,n=(n=n+Math.imul(b,ot)|0)+Math.imul(v,st)|0,s=s+Math.imul(v,ot)|0,r=r+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,s=s+Math.imul(m,ut)|0;var xt=(u+(r=r+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;u=((s=s+Math.imul(d,dt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(j,q),n=(n=Math.imul(j,z))+Math.imul(U,q)|0,s=Math.imul(U,z),r=r+Math.imul(O,W)|0,n=(n=n+Math.imul(O,$)|0)+Math.imul(D,W)|0,s=s+Math.imul(D,$)|0,r=r+Math.imul(R,V)|0,n=(n=n+Math.imul(R,K)|0)+Math.imul(P,V)|0,s=s+Math.imul(P,K)|0,r=r+Math.imul(I,J)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(C,J)|0,s=s+Math.imul(C,Y)|0,r=r+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(T,Q)|0,s=s+Math.imul(T,tt)|0,r=r+Math.imul(k,it)|0,n=(n=n+Math.imul(k,rt)|0)+Math.imul(x,it)|0,s=s+Math.imul(x,rt)|0,r=r+Math.imul(w,st)|0,n=(n=n+Math.imul(w,ot)|0)+Math.imul(_,st)|0,s=s+Math.imul(_,ot)|0,r=r+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(v,ht)|0,s=s+Math.imul(v,ut)|0,r=r+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,dt)|0)+Math.imul(m,ct)|0,s=s+Math.imul(m,dt)|0;var Et=(u+(r=r+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,mt)|0)+Math.imul(d,pt)|0))<<13)|0;u=((s=s+Math.imul(d,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(j,W),n=(n=Math.imul(j,$))+Math.imul(U,W)|0,s=Math.imul(U,$),r=r+Math.imul(O,V)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(D,V)|0,s=s+Math.imul(D,K)|0,r=r+Math.imul(R,J)|0,n=(n=n+Math.imul(R,Y)|0)+Math.imul(P,J)|0,s=s+Math.imul(P,Y)|0,r=r+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,s=s+Math.imul(C,tt)|0,r=r+Math.imul(S,it)|0,n=(n=n+Math.imul(S,rt)|0)+Math.imul(T,it)|0,s=s+Math.imul(T,rt)|0,r=r+Math.imul(k,st)|0,n=(n=n+Math.imul(k,ot)|0)+Math.imul(x,st)|0,s=s+Math.imul(x,ot)|0,r=r+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(_,ht)|0,s=s+Math.imul(_,ut)|0,r=r+Math.imul(b,ct)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(v,ct)|0,s=s+Math.imul(v,dt)|0;var St=(u+(r=r+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((s=s+Math.imul(m,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(j,V),n=(n=Math.imul(j,K))+Math.imul(U,V)|0,s=Math.imul(U,K),r=r+Math.imul(O,J)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(D,J)|0,s=s+Math.imul(D,Y)|0,r=r+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,tt)|0,r=r+Math.imul(I,it)|0,n=(n=n+Math.imul(I,rt)|0)+Math.imul(C,it)|0,s=s+Math.imul(C,rt)|0,r=r+Math.imul(S,st)|0,n=(n=n+Math.imul(S,ot)|0)+Math.imul(T,st)|0,s=s+Math.imul(T,ot)|0,r=r+Math.imul(k,ht)|0,n=(n=n+Math.imul(k,ut)|0)+Math.imul(x,ht)|0,s=s+Math.imul(x,ut)|0,r=r+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,dt)|0)+Math.imul(_,ct)|0,s=s+Math.imul(_,dt)|0;var Tt=(u+(r=r+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,pt)|0))<<13)|0;u=((s=s+Math.imul(v,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(j,J),n=(n=Math.imul(j,Y))+Math.imul(U,J)|0,s=Math.imul(U,Y),r=r+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(D,Q)|0,s=s+Math.imul(D,tt)|0,r=r+Math.imul(R,it)|0,n=(n=n+Math.imul(R,rt)|0)+Math.imul(P,it)|0,s=s+Math.imul(P,rt)|0,r=r+Math.imul(I,st)|0,n=(n=n+Math.imul(I,ot)|0)+Math.imul(C,st)|0,s=s+Math.imul(C,ot)|0,r=r+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(T,ht)|0,s=s+Math.imul(T,ut)|0,r=r+Math.imul(k,ct)|0,n=(n=n+Math.imul(k,dt)|0)+Math.imul(x,ct)|0,s=s+Math.imul(x,dt)|0;var At=(u+(r=r+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((s=s+Math.imul(_,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(j,Q),n=(n=Math.imul(j,tt))+Math.imul(U,Q)|0,s=Math.imul(U,tt),r=r+Math.imul(O,it)|0,n=(n=n+Math.imul(O,rt)|0)+Math.imul(D,it)|0,s=s+Math.imul(D,rt)|0,r=r+Math.imul(R,st)|0,n=(n=n+Math.imul(R,ot)|0)+Math.imul(P,st)|0,s=s+Math.imul(P,ot)|0,r=r+Math.imul(I,ht)|0,n=(n=n+Math.imul(I,ut)|0)+Math.imul(C,ht)|0,s=s+Math.imul(C,ut)|0,r=r+Math.imul(S,ct)|0,n=(n=n+Math.imul(S,dt)|0)+Math.imul(T,ct)|0,s=s+Math.imul(T,dt)|0;var It=(u+(r=r+Math.imul(k,pt)|0)|0)+((8191&(n=(n=n+Math.imul(k,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((s=s+Math.imul(x,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(j,it),n=(n=Math.imul(j,rt))+Math.imul(U,it)|0,s=Math.imul(U,rt),r=r+Math.imul(O,st)|0,n=(n=n+Math.imul(O,ot)|0)+Math.imul(D,st)|0,s=s+Math.imul(D,ot)|0,r=r+Math.imul(R,ht)|0,n=(n=n+Math.imul(R,ut)|0)+Math.imul(P,ht)|0,s=s+Math.imul(P,ut)|0,r=r+Math.imul(I,ct)|0,n=(n=n+Math.imul(I,dt)|0)+Math.imul(C,ct)|0,s=s+Math.imul(C,dt)|0;var Ct=(u+(r=r+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((s=s+Math.imul(T,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(j,st),n=(n=Math.imul(j,ot))+Math.imul(U,st)|0,s=Math.imul(U,ot),r=r+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(D,ht)|0,s=s+Math.imul(D,ut)|0,r=r+Math.imul(R,ct)|0,n=(n=n+Math.imul(R,dt)|0)+Math.imul(P,ct)|0,s=s+Math.imul(P,dt)|0;var Bt=(u+(r=r+Math.imul(I,pt)|0)|0)+((8191&(n=(n=n+Math.imul(I,mt)|0)+Math.imul(C,pt)|0))<<13)|0;u=((s=s+Math.imul(C,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,r=Math.imul(j,ht),n=(n=Math.imul(j,ut))+Math.imul(U,ht)|0,s=Math.imul(U,ut),r=r+Math.imul(O,ct)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(D,ct)|0,s=s+Math.imul(D,dt)|0;var Rt=(u+(r=r+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((s=s+Math.imul(P,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(j,ct),n=(n=Math.imul(j,dt))+Math.imul(U,ct)|0,s=Math.imul(U,dt);var Pt=(u+(r=r+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(D,pt)|0))<<13)|0;u=((s=s+Math.imul(D,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Lt=(u+(r=Math.imul(j,pt))|0)+((8191&(n=(n=Math.imul(j,mt))+Math.imul(U,pt)|0))<<13)|0;return u=((s=Math.imul(U,mt))+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,h[0]=gt,h[1]=bt,h[2]=vt,h[3]=yt,h[4]=wt,h[5]=_t,h[6]=Mt,h[7]=kt,h[8]=xt,h[9]=Et,h[10]=St,h[11]=Tt,h[12]=At,h[13]=It,h[14]=Ct,h[15]=Bt,h[16]=Rt,h[17]=Pt,h[18]=Lt,0!==u&&(h[19]=u,i.length++),i};function b(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,s=0;s<i.length-1;s++){var o=n;n=0;for(var a=67108863&r,h=Math.min(s,e.length-1),u=Math.max(0,s-t.length+1);u<=h;u++){var l=s-u,c=(0|t.words[l])*(0|e.words[u]),d=67108863&c;a=67108863&(d=d+a|0),n+=(o=(o=o+(c/67108864|0)|0)+(d>>>26)|0)>>>26,o&=67108863}i.words[s]=a,r=o,o=n}return 0!==r?i.words[s]=r:i.length--,i._strip()}function v(t,e,i){return b(t,e,i)}function y(t,e){this.x=t,this.y=e}Math.imul||(g=m),s.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):i<63?m(this,t,e):i<1024?b(this,t,e):v(this,t,e)},y.prototype.makeRBT=function(t){for(var e=new Array(t),i=s.prototype._countBits(t)-1,r=0;r<t;r++)e[r]=this.revBin(r,i,t);return e},y.prototype.revBin=function(t,e,i){if(0===t||t===i-1)return t;for(var r=0,n=0;n<e;n++)r|=(1&t)<<e-n-1,t>>=1;return r},y.prototype.permute=function(t,e,i,r,n,s){for(var o=0;o<s;o++)r[o]=e[t[o]],n[o]=i[t[o]]},y.prototype.transform=function(t,e,i,r,n,s){this.permute(s,t,e,i,r,n);for(var o=1;o<n;o<<=1)for(var a=o<<1,h=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),l=0;l<n;l+=a)for(var c=h,d=u,f=0;f<o;f++){var p=i[l+f],m=r[l+f],g=i[l+f+o],b=r[l+f+o],v=c*g-d*b;b=c*b+d*g,g=v,i[l+f]=p+g,r[l+f]=m+b,i[l+f+o]=p-g,r[l+f+o]=m-b,f!==a&&(v=h*c-u*d,d=h*d+u*c,c=v)}},y.prototype.guessLen13b=function(t,e){var i=1|Math.max(e,t),r=1&i,n=0;for(i=i/2|0;i;i>>>=1)n++;return 1<<n+1+r},y.prototype.conjugate=function(t,e,i){if(!(i<=1))for(var r=0;r<i/2;r++){var n=t[r];t[r]=t[i-r-1],t[i-r-1]=n,n=e[r],e[r]=-e[i-r-1],e[i-r-1]=-n}},y.prototype.normalize13b=function(t,e){for(var i=0,r=0;r<e/2;r++){var n=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+i;t[r]=67108863&n,i=n<67108864?0:n/67108864|0}return t},y.prototype.convert13b=function(t,e,i,n){for(var s=0,o=0;o<e;o++)s+=0|t[o],i[2*o]=8191&s,s>>>=13,i[2*o+1]=8191&s,s>>>=13;for(o=2*e;o<n;++o)i[o]=0;r(0===s),r(0==(-8192&s))},y.prototype.stub=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=0;return e},y.prototype.mulp=function(t,e,i){var r=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(r),s=this.stub(r),o=new Array(r),a=new Array(r),h=new Array(r),u=new Array(r),l=new Array(r),c=new Array(r),d=i.words;d.length=r,this.convert13b(t.words,t.length,o,r),this.convert13b(e.words,e.length,u,r),this.transform(o,s,a,h,r,n),this.transform(u,s,l,c,r,n);for(var f=0;f<r;f++){var p=a[f]*l[f]-h[f]*c[f];h[f]=a[f]*c[f]+h[f]*l[f],a[f]=p}return this.conjugate(a,h,r),this.transform(a,h,d,s,r,n),this.conjugate(d,s,r),this.normalize13b(d,r),i.negative=t.negative^e.negative,i.length=t.length+e.length,i._strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),v(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){var e=t<0;e&&(t=-t),r("number"==typeof t),r(t<67108864);for(var i=0,n=0;n<this.length;n++){var s=(0|this.words[n])*t,o=(67108863&s)+(67108863&i);i>>=26,i+=s/67108864|0,i+=o>>>26,this.words[n]=67108863&o}return 0!==i&&(this.words[n]=i,this.length++),e?this.ineg():this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i<e.length;i++){var r=i/26|0,n=i%26;e[i]=t.words[r]>>>n&1}return e}(t);if(0===e.length)return new s(1);for(var i=this,r=0;r<e.length&&0===e[r];r++,i=i.sqr());if(++r<e.length)for(var n=i.sqr();r<e.length;r++,n=n.sqr())0!==e[r]&&(i=i.mul(n));return i},s.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,i=t%26,n=(t-i)/26,s=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&s,h=(0|this.words[e])-a<<i;this.words[e]=h|o,o=a>>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this._strip()},s.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,i){var n;r("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<<s,h=i;if(n-=o,n=Math.max(0,n),h){for(var u=0;u<o;u++)h.words[u]=this.words[u];h.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=n);u--){var c=0|this.words[u];this.words[u]=l<<26-s|c>>>s,l=c&a}return h&&0!==l&&(h.words[h.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26,n=1<<e;return!(this.length<=i||!(this.words[i]&n))},s.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this._strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return r("number"==typeof t),r(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,i){var n,s,o=t.length+i;this._expand(o);var a=0;for(n=0;n<t.length;n++){s=(0|this.words[n+i])+a;var h=(0|t.words[n])*e;a=((s-=67108863&h)>>26)-(h/67108864|0),this.words[n+i]=67108863&s}for(;n<this.length-i;n++)a=(s=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&s;if(0===a)return this._strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(s=-(0|this.words[n])+a)>>26,this.words[n]=67108863&s;return this.negative=1,this._strip()},s.prototype._wordDiv=function(t,e){var i=(this.length,t.length),r=this.clone(),n=t,o=0|n.words[n.length-1];0!=(i=26-this._countBits(o))&&(n=n.ushln(i),r.iushln(i),o=0|n.words[n.length-1]);var a,h=r.length-n.length;if("mod"!==e){(a=new s(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=r.clone()._ishlnsubmul(n,1,h);0===l.negative&&(r=l,a&&(a.words[h]=1));for(var c=h-1;c>=0;c--){var d=67108864*(0|r.words[n.length+c])+(0|r.words[n.length+c-1]);for(d=Math.min(d/o|0,67108863),r._ishlnsubmul(n,d,c);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(n,1,c),r.isZero()||(r.negative^=1);a&&(a.words[c]=d)}return a&&a._strip(),r._strip(),"div"!==e&&0!==i&&r.iushrn(i),{div:a||null,mod:r}},s.prototype.divmod=function(t,e,i){return r(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modrn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),s=i.cmp(r);return s<0||1===n&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modrn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var i=(1<<26)%t,n=0,s=this.length-1;s>=0;s--)n=(i*n+(0|this.words[s]))%t;return e?-n:n},s.prototype.modn=function(t){return this.modrn(t)},s.prototype.idivn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var i=0,n=this.length-1;n>=0;n--){var s=(0|this.words[n])+67108864*i;this.words[n]=s/t|0,i=s%t}return this._strip(),e?this.ineg():this},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new s(1),o=new s(0),a=new s(0),h=new s(1),u=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++u;for(var l=i.clone(),c=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(l),h.isub(c)),a.iushrn(1),h.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(a),o.isub(h)):(i.isub(e),a.isub(n),h.isub(o))}return{a,b:h,gcd:i.iushln(u)}},s.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new s(1),a=new s(0),h=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var u=0,l=1;0==(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(h),o.iushrn(1);for(var c=0,d=1;0==(i.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(i.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(a)):(i.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var s=e;e=i,i=s}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var s=n,o=i;0!==s&&o<this.length;o++){var a=0|this.words[o];s=(a+=s)>>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){r<n?e=-1:r>n&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new S(t)},s.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function _(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function M(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function T(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}_.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},_.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},_.prototype.split=function(t,e){t.iushrn(this.n,0,e)},_.prototype.imulK=function(t){return t.imul(this.k)},n(M,_),M.prototype.split=function(t,e){for(var i=4194303,r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var s=t.words[9];for(e.words[e.length++]=s&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(o&i)<<4|s>>>22,s=o}s>>>=22,t.words[n-10]=s,0===s&&t.length>10?t.length-=10:t.length-=9},M.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i<t.length;i++){var r=0|t.words[i];e+=977*r,t.words[i]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(k,_),n(x,_),n(E,_),E.prototype.imulK=function(t){for(var e=0,i=0;i<t.length;i++){var r=19*(0|t.words[i])+e,n=67108863&r;r>>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new M;else if("p224"===t)e=new k;else if("p192"===t)e=new x;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return w[t]=e,e},S.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},S.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new s(1)).iushrn(2);return this.pow(t,i)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);r(!n.isZero());var a=new s(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);0!==this.pow(l,u).cmp(h);)l.redIAdd(h);for(var c=this.pow(l,n),d=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),p=o;0!==f.cmp(a);){for(var m=f,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var b=this.pow(c,new s(1).iushln(p-g-1));d=d.redMul(b),c=b.redSqr(),f=f.redMul(c),p=g}return d},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var i=new Array(16);i[0]=new s(1).toRed(this),i[1]=t;for(var r=2;r<i.length;r++)i[r]=this.mul(i[r-1],t);var n=i[0],o=0,a=0,h=e.bitLength()%26;for(0===h&&(h=26),r=e.length-1;r>=0;r--){for(var u=e.words[r],l=h-1;l>=0;l--){var c=u>>l&1;n!==i[0]&&(n=this.sqr(n)),0!==c||0!==o?(o<<=1,o|=c,(4==++a||0===r&&0===l)&&(n=this.mul(n,i[o]),a=0,o=0)):a=0}h=26}return n},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new T(t)},n(T,S),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var i=t.mul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},T.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=i.nmd(t),this)},9931:(t,e,i)=>{var r;function n(t){this.rand=t}if(t.exports=function(t){return r||(r=new n(null)),r.generate(t)},t.exports.Rand=n,n.prototype.generate=function(t){return this._rand(t)},n.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),i=0;i<e.length;i++)e[i]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(n.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var s=i(9214);if("function"!=typeof s.randomBytes)throw new Error("Not supported");n.prototype._rand=function(t){return s.randomBytes(t)}}catch(t){}},4497:(t,e,i)=>{var r=i(9509).Buffer;function n(t){r.isBuffer(t)||(t=r.from(t));for(var e=t.length/4|0,i=new Array(e),n=0;n<e;n++)i[n]=t.readUInt32BE(4*n);return i}function s(t){for(;0<t.length;t++)t[0]=0}function o(t,e,i,r,n){for(var s,o,a,h,u=i[0],l=i[1],c=i[2],d=i[3],f=t[0]^e[0],p=t[1]^e[1],m=t[2]^e[2],g=t[3]^e[3],b=4,v=1;v<n;v++)s=u[f>>>24]^l[p>>>16&255]^c[m>>>8&255]^d[255&g]^e[b++],o=u[p>>>24]^l[m>>>16&255]^c[g>>>8&255]^d[255&f]^e[b++],a=u[m>>>24]^l[g>>>16&255]^c[f>>>8&255]^d[255&p]^e[b++],h=u[g>>>24]^l[f>>>16&255]^c[p>>>8&255]^d[255&m]^e[b++],f=s,p=o,m=a,g=h;return s=(r[f>>>24]<<24|r[p>>>16&255]<<16|r[m>>>8&255]<<8|r[255&g])^e[b++],o=(r[p>>>24]<<24|r[m>>>16&255]<<16|r[g>>>8&255]<<8|r[255&f])^e[b++],a=(r[m>>>24]<<24|r[g>>>16&255]<<16|r[f>>>8&255]<<8|r[255&p])^e[b++],h=(r[g>>>24]<<24|r[f>>>16&255]<<16|r[p>>>8&255]<<8|r[255&m])^e[b++],[s>>>=0,o>>>=0,a>>>=0,h>>>=0]}var a=[0,1,2,4,8,16,32,64,128,27,54],h=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var i=[],r=[],n=[[],[],[],[]],s=[[],[],[],[]],o=0,a=0,h=0;h<256;++h){var u=a^a<<1^a<<2^a<<3^a<<4;u=u>>>8^255&u^99,i[o]=u,r[u]=o;var l=t[o],c=t[l],d=t[c],f=257*t[u]^16843008*u;n[0][o]=f<<24|f>>>8,n[1][o]=f<<16|f>>>16,n[2][o]=f<<8|f>>>24,n[3][o]=f,f=16843009*d^65537*c^257*l^16843008*o,s[0][u]=f<<24|f>>>8,s[1][u]=f<<16|f>>>16,s[2][u]=f<<8|f>>>24,s[3][u]=f,0===o?o=a=1:(o=l^t[t[t[d^l]]],a^=t[t[a]])}return{SBOX:i,INV_SBOX:r,SUB_MIX:n,INV_SUB_MIX:s}}();function u(t){this._key=n(t),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var t=this._key,e=t.length,i=e+6,r=4*(i+1),n=[],s=0;s<e;s++)n[s]=t[s];for(s=e;s<r;s++){var o=n[s-1];s%e==0?(o=o<<8|o>>>24,o=h.SBOX[o>>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o],o^=a[s/e|0]<<24):e>6&&s%e==4&&(o=h.SBOX[o>>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o]),n[s]=n[s-e]^o}for(var u=[],l=0;l<r;l++){var c=r-l,d=n[c-(l%4?0:4)];u[l]=l<4||c<=4?d:h.INV_SUB_MIX[0][h.SBOX[d>>>24]]^h.INV_SUB_MIX[1][h.SBOX[d>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[d>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&d]]}this._nRounds=i,this._keySchedule=n,this._invKeySchedule=u},u.prototype.encryptBlockRaw=function(t){return o(t=n(t),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},u.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),i=r.allocUnsafe(16);return i.writeUInt32BE(e[0],0),i.writeUInt32BE(e[1],4),i.writeUInt32BE(e[2],8),i.writeUInt32BE(e[3],12),i},u.prototype.decryptBlock=function(t){var e=(t=n(t))[1];t[1]=t[3],t[3]=e;var i=o(t,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),s=r.allocUnsafe(16);return s.writeUInt32BE(i[0],0),s.writeUInt32BE(i[3],4),s.writeUInt32BE(i[2],8),s.writeUInt32BE(i[1],12),s},u.prototype.scrub=function(){s(this._keySchedule),s(this._invKeySchedule),s(this._key)},t.exports.AES=u},2422:(t,e,i)=>{var r=i(4497),n=i(9509).Buffer,s=i(1027),o=i(5717),a=i(3288),h=i(7295),u=i(685);function l(t,e,i,o){s.call(this);var h=n.alloc(4,0);this._cipher=new r.AES(e);var l=this._cipher.encryptBlock(h);this._ghash=new a(l),i=function(t,e,i){if(12===e.length)return t._finID=n.concat([e,n.from([0,0,0,1])]),n.concat([e,n.from([0,0,0,2])]);var r=new a(i),s=e.length,o=s%16;r.update(e),o&&(o=16-o,r.update(n.alloc(o,0))),r.update(n.alloc(8,0));var h=8*s,l=n.alloc(8);l.writeUIntBE(h,0,8),r.update(l),t._finID=r.state;var c=n.from(t._finID);return u(c),c}(this,i,l),this._prev=n.from(i),this._cache=n.allocUnsafe(0),this._secCache=n.allocUnsafe(0),this._decrypt=o,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}o(l,s),l.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=n.alloc(e,0),this._ghash.update(e))}this._called=!0;var i=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(i),this._len+=t.length,i},l.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=h(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(t,e){var i=0;t.length!==e.length&&i++;for(var r=Math.min(t.length,e.length),n=0;n<r;++n)i+=t[n]^e[n];return i}(t,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=t,this._cipher.scrub()},l.prototype.getAuthTag=function(){if(this._decrypt||!n.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},l.prototype.setAuthTag=function(t){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=t},l.prototype.setAAD=function(t){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length},t.exports=l},4696:(t,e,i)=>{var r=i(1494),n=i(6193),s=i(4946);e.createCipher=e.Cipher=r.createCipher,e.createCipheriv=e.Cipheriv=r.createCipheriv,e.createDecipher=e.Decipher=n.createDecipher,e.createDecipheriv=e.Decipheriv=n.createDecipheriv,e.listCiphers=e.getCiphers=function(){return Object.keys(s)}},6193:(t,e,i)=>{var r=i(2422),n=i(9509).Buffer,s=i(45),o=i(5969),a=i(1027),h=i(4497),u=i(3048);function l(t,e,i){a.call(this),this._cache=new c,this._last=void 0,this._cipher=new h.AES(e),this._prev=n.from(i),this._mode=t,this._autopadding=!0}function c(){this.cache=n.allocUnsafe(0)}function d(t,e,i){var a=s[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof i&&(i=n.from(i)),"GCM"!==a.mode&&i.length!==a.iv)throw new TypeError("invalid iv length "+i.length);if("string"==typeof e&&(e=n.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);return"stream"===a.type?new o(a.module,e,i,!0):"auth"===a.type?new r(a.module,e,i,!0):new l(a.module,e,i)}i(5717)(l,a),l.prototype._update=function(t){var e,i;this._cache.add(t);for(var r=[];e=this._cache.get(this._autopadding);)i=this._mode.decrypt(this,e),r.push(i);return n.concat(r)},l.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");for(var i=-1;++i<e;)if(t[i+(16-e)]!==e)throw new Error("unable to decrypt data");if(16!==e)return t.slice(0,16-e)}(this._mode.decrypt(this,t));if(t)throw new Error("data not multiple of block length")},l.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},c.prototype.add=function(t){this.cache=n.concat([this.cache,t])},c.prototype.get=function(t){var e;if(t){if(this.cache.length>16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},c.prototype.flush=function(){if(this.cache.length)return this.cache},e.createDecipher=function(t,e){var i=s[t.toLowerCase()];if(!i)throw new TypeError("invalid suite type");var r=u(e,!1,i.key,i.iv);return d(t,r.key,r.iv)},e.createDecipheriv=d},1494:(t,e,i)=>{var r=i(45),n=i(2422),s=i(9509).Buffer,o=i(5969),a=i(1027),h=i(4497),u=i(3048);function l(t,e,i){a.call(this),this._cache=new d,this._cipher=new h.AES(e),this._prev=s.from(i),this._mode=t,this._autopadding=!0}i(5717)(l,a),l.prototype._update=function(t){var e,i;this._cache.add(t);for(var r=[];e=this._cache.get();)i=this._mode.encrypt(this,e),r.push(i);return s.concat(r)};var c=s.alloc(16,16);function d(){this.cache=s.allocUnsafe(0)}function f(t,e,i){var a=r[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=s.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);if("string"==typeof i&&(i=s.from(i)),"GCM"!==a.mode&&i.length!==a.iv)throw new TypeError("invalid iv length "+i.length);return"stream"===a.type?new o(a.module,e,i):"auth"===a.type?new n(a.module,e,i):new l(a.module,e,i)}l.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(c))throw this._cipher.scrub(),new Error("data not multiple of block length")},l.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},d.prototype.add=function(t){this.cache=s.concat([this.cache,t])},d.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},d.prototype.flush=function(){for(var t=16-this.cache.length,e=s.allocUnsafe(t),i=-1;++i<t;)e.writeUInt8(t,i);return s.concat([this.cache,e])},e.createCipheriv=f,e.createCipher=function(t,e){var i=r[t.toLowerCase()];if(!i)throw new TypeError("invalid suite type");var n=u(e,!1,i.key,i.iv);return f(t,n.key,n.iv)}},3288:(t,e,i)=>{var r=i(9509).Buffer,n=r.alloc(16,0);function s(t){var e=r.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function o(t){this.h=t,this.state=r.alloc(16,0),this.cache=r.allocUnsafe(0)}o.prototype.ghash=function(t){for(var e=-1;++e<t.length;)this.state[e]^=t[e];this._multiply()},o.prototype._multiply=function(){for(var t,e,i,r=[(t=this.h).readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)],n=[0,0,0,0],o=-1;++o<128;){for(0!=(this.state[~~(o/8)]&1<<7-o%8)&&(n[0]^=r[0],n[1]^=r[1],n[2]^=r[2],n[3]^=r[3]),i=0!=(1&r[3]),e=3;e>0;e--)r[e]=r[e]>>>1|(1&r[e-1])<<31;r[0]=r[0]>>>1,i&&(r[0]=r[0]^225<<24)}this.state=s(n)},o.prototype.update=function(t){var e;for(this.cache=r.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},o.prototype.final=function(t,e){return this.cache.length&&this.ghash(r.concat([this.cache,n],16)),this.ghash(s([0,t,0,e])),this.state},t.exports=o},685:t=>{t.exports=function(t){for(var e,i=t.length;i--;){if(255!==(e=t.readUInt8(i))){e++,t.writeUInt8(e,i);break}t.writeUInt8(0,i)}}},5292:(t,e,i)=>{var r=i(7295);e.encrypt=function(t,e){var i=r(e,t._prev);return t._prev=t._cipher.encryptBlock(i),t._prev},e.decrypt=function(t,e){var i=t._prev;t._prev=e;var n=t._cipher.decryptBlock(e);return r(n,i)}},6311:(t,e,i)=>{var r=i(9509).Buffer,n=i(7295);function s(t,e,i){var s=e.length,o=n(e,t._cache);return t._cache=t._cache.slice(s),t._prev=r.concat([t._prev,i?e:o]),o}e.encrypt=function(t,e,i){for(var n,o=r.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=r.allocUnsafe(0)),!(t._cache.length<=e.length)){o=r.concat([o,s(t,e,i)]);break}n=t._cache.length,o=r.concat([o,s(t,e.slice(0,n),i)]),e=e.slice(n)}return o}},1510:(t,e,i)=>{var r=i(9509).Buffer;function n(t,e,i){for(var r,n,o=-1,a=0;++o<8;)r=e&1<<7-o?128:0,a+=(128&(n=t._cipher.encryptBlock(t._prev)[0]^r))>>o%8,t._prev=s(t._prev,i?r:n);return a}function s(t,e){var i=t.length,n=-1,s=r.allocUnsafe(t.length);for(t=r.concat([t,r.from([e])]);++n<i;)s[n]=t[n]<<1|t[n+1]>>7;return s}e.encrypt=function(t,e,i){for(var s=e.length,o=r.allocUnsafe(s),a=-1;++a<s;)o[a]=n(t,e[a],i);return o}},1964:(t,e,i)=>{var r=i(9509).Buffer;function n(t,e,i){var n=t._cipher.encryptBlock(t._prev)[0]^e;return t._prev=r.concat([t._prev.slice(1),r.from([i?e:n])]),n}e.encrypt=function(t,e,i){for(var s=e.length,o=r.allocUnsafe(s),a=-1;++a<s;)o[a]=n(t,e[a],i);return o}},6009:(t,e,i)=>{var r=i(7295),n=i(9509).Buffer,s=i(685);function o(t){var e=t._cipher.encryptBlockRaw(t._prev);return s(t._prev),e}e.encrypt=function(t,e){var i=Math.ceil(e.length/16),s=t._cache.length;t._cache=n.concat([t._cache,n.allocUnsafe(16*i)]);for(var a=0;a<i;a++){var h=o(t),u=s+16*a;t._cache.writeUInt32BE(h[0],u+0),t._cache.writeUInt32BE(h[1],u+4),t._cache.writeUInt32BE(h[2],u+8),t._cache.writeUInt32BE(h[3],u+12)}var l=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),r(e,l)}},1084:(t,e)=>{e.encrypt=function(t,e){return t._cipher.encryptBlock(e)},e.decrypt=function(t,e){return t._cipher.decryptBlock(e)}},45:(t,e,i)=>{var r={ECB:i(1084),CBC:i(5292),CFB:i(6311),CFB8:i(1964),CFB1:i(1510),OFB:i(8861),CTR:i(6009),GCM:i(6009)},n=i(4946);for(var s in n)n[s].module=r[n[s].mode];t.exports=n},8861:(t,e,i)=>{var r=i(8764).Buffer,n=i(7295);function s(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}e.encrypt=function(t,e){for(;t._cache.length<e.length;)t._cache=r.concat([t._cache,s(t)]);var i=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),n(e,i)}},5969:(t,e,i)=>{var r=i(4497),n=i(9509).Buffer,s=i(1027);function o(t,e,i,o){s.call(this),this._cipher=new r.AES(e),this._prev=n.from(i),this._cache=n.allocUnsafe(0),this._secCache=n.allocUnsafe(0),this._decrypt=o,this._mode=t}i(5717)(o,s),o.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)},o.prototype._final=function(){this._cipher.scrub()},t.exports=o},3614:(t,e,i)=>{var r=i(7667),n=i(4696),s=i(45),o=i(9715),a=i(3048);function h(t,e,i){if(t=t.toLowerCase(),s[t])return n.createCipheriv(t,e,i);if(o[t])return new r({key:e,iv:i,mode:t});throw new TypeError("invalid suite type")}function u(t,e,i){if(t=t.toLowerCase(),s[t])return n.createDecipheriv(t,e,i);if(o[t])return new r({key:e,iv:i,mode:t,decrypt:!0});throw new TypeError("invalid suite type")}e.createCipher=e.Cipher=function(t,e){var i,r;if(t=t.toLowerCase(),s[t])i=s[t].key,r=s[t].iv;else{if(!o[t])throw new TypeError("invalid suite type");i=8*o[t].key,r=o[t].iv}var n=a(e,!1,i,r);return h(t,n.key,n.iv)},e.createCipheriv=e.Cipheriv=h,e.createDecipher=e.Decipher=function(t,e){var i,r;if(t=t.toLowerCase(),s[t])i=s[t].key,r=s[t].iv;else{if(!o[t])throw new TypeError("invalid suite type");i=8*o[t].key,r=o[t].iv}var n=a(e,!1,i,r);return u(t,n.key,n.iv)},e.createDecipheriv=e.Decipheriv=u,e.listCiphers=e.getCiphers=function(){return Object.keys(o).concat(n.getCiphers())}},7667:(t,e,i)=>{var r=i(1027),n=i(5251),s=i(5717),o=i(9509).Buffer,a={"des-ede3-cbc":n.CBC.instantiate(n.EDE),"des-ede3":n.EDE,"des-ede-cbc":n.CBC.instantiate(n.EDE),"des-ede":n.EDE,"des-cbc":n.CBC.instantiate(n.DES),"des-ecb":n.DES};function h(t){r.call(this);var e,i=t.mode.toLowerCase(),n=a[i];e=t.decrypt?"decrypt":"encrypt";var s=t.key;o.isBuffer(s)||(s=o.from(s)),"des-ede"!==i&&"des-ede-cbc"!==i||(s=o.concat([s,s.slice(0,8)]));var h=t.iv;o.isBuffer(h)||(h=o.from(h)),this._des=n.create({key:s,iv:h,type:e})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],t.exports=h,s(h,r),h.prototype._update=function(t){return o.from(this._des.update(t))},h.prototype._final=function(){return o.from(this._des.final())}},9715:(t,e)=>{e["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}},3663:(t,e,i)=>{var r=i(8764).Buffer,n=i(3550),s=i(1798);function o(t){var e,i=t.modulus.byteLength();do{e=new n(s(i))}while(e.cmp(t.modulus)>=0||!e.umod(t.prime1)||!e.umod(t.prime2));return e}function a(t,e){var i=function(t){var e=o(t);return{blinder:e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}(e),s=e.modulus.byteLength(),a=new n(t).mul(i.blinder).umod(e.modulus),h=a.toRed(n.mont(e.prime1)),u=a.toRed(n.mont(e.prime2)),l=e.coefficient,c=e.prime1,d=e.prime2,f=h.redPow(e.exponent1).fromRed(),p=u.redPow(e.exponent2).fromRed(),m=f.isub(p).imul(l).umod(c).imul(d);return p.iadd(m).imul(i.unblinder).umod(e.modulus).toArrayLike(r,"be",s)}a.getr=o,t.exports=a},6042:(t,e,i)=>{t.exports=i(5207)},4743:(t,e,i)=>{var r=i(9509).Buffer,n=i(3482),s=i(8473),o=i(5717),a=i(2957),h=i(7753),u=i(5207);function l(t){s.Writable.call(this);var e=u[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function c(t){s.Writable.call(this);var e=u[t];if(!e)throw new Error("Unknown message digest");this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function d(t){return new l(t)}function f(t){return new c(t)}Object.keys(u).forEach((function(t){u[t].id=r.from(u[t].id,"hex"),u[t.toLowerCase()]=u[t]})),o(l,s.Writable),l.prototype._write=function(t,e,i){this._hash.update(t),i()},l.prototype.update=function(t,e){return"string"==typeof t&&(t=r.from(t,e)),this._hash.update(t),this},l.prototype.sign=function(t,e){this.end();var i=this._hash.digest(),r=a(i,t,this._hashType,this._signType,this._tag);return e?r.toString(e):r},o(c,s.Writable),c.prototype._write=function(t,e,i){this._hash.update(t),i()},c.prototype.update=function(t,e){return"string"==typeof t&&(t=r.from(t,e)),this._hash.update(t),this},c.prototype.verify=function(t,e,i){"string"==typeof e&&(e=r.from(e,i)),this.end();var n=this._hash.digest();return h(e,n,t,this._signType,this._tag)},t.exports={Sign:d,Verify:f,createSign:d,createVerify:f}},2957:(t,e,i)=>{var r=i(9509).Buffer,n=i(8355),s=i(3663),o=i(6266).ec,a=i(3550),h=i(980),u=i(1308);function l(t,e,i,s){if((t=r.from(t.toArray())).length<e.byteLength()){var o=r.alloc(e.byteLength()-t.length);t=r.concat([o,t])}var a=i.length,h=function(t,e){t=(t=c(t,e)).mod(e);var i=r.from(t.toArray());if(i.length<e.byteLength()){var n=r.alloc(e.byteLength()-i.length);i=r.concat([n,i])}return i}(i,e),u=r.alloc(a);u.fill(1);var l=r.alloc(a);return l=n(s,l).update(u).update(r.from([0])).update(t).update(h).digest(),u=n(s,l).update(u).digest(),{k:l=n(s,l).update(u).update(r.from([1])).update(t).update(h).digest(),v:u=n(s,l).update(u).digest()}}function c(t,e){var i=new a(t),r=(t.length<<3)-e.bitLength();return r>0&&i.ishrn(r),i}function d(t,e,i){var s,o;do{for(s=r.alloc(0);8*s.length<t.bitLength();)e.v=n(i,e.k).update(e.v).digest(),s=r.concat([s,e.v]);o=c(s,t),e.k=n(i,e.k).update(e.v).update(r.from([0])).digest(),e.v=n(i,e.k).update(e.v).digest()}while(-1!==o.cmp(t));return o}function f(t,e,i,r){return t.toRed(a.mont(i)).redPow(e).fromRed().mod(r)}t.exports=function(t,e,i,n,p){var m=h(e);if(m.curve){if("ecdsa"!==n&&"ecdsa/rsa"!==n)throw new Error("wrong private key type");return function(t,e){var i=u[e.curve.join(".")];if(!i)throw new Error("unknown curve "+e.curve.join("."));var n=new o(i).keyFromPrivate(e.privateKey).sign(t);return r.from(n.toDER())}(t,m)}if("dsa"===m.type){if("dsa"!==n)throw new Error("wrong private key type");return function(t,e,i){for(var n,s=e.params.priv_key,o=e.params.p,h=e.params.q,u=e.params.g,p=new a(0),m=c(t,h).mod(h),g=!1,b=l(s,h,t,i);!1===g;)p=f(u,n=d(h,b,i),o,h),0===(g=n.invm(h).imul(m.add(s.mul(p))).mod(h)).cmpn(0)&&(g=!1,p=new a(0));return function(t,e){t=t.toArray(),e=e.toArray(),128&t[0]&&(t=[0].concat(t)),128&e[0]&&(e=[0].concat(e));var i=[48,t.length+e.length+4,2,t.length];return i=i.concat(t,[2,e.length],e),r.from(i)}(p,g)}(t,m,i)}if("rsa"!==n&&"ecdsa/rsa"!==n)throw new Error("wrong private key type");t=r.concat([p,t]);for(var g=m.modulus.byteLength(),b=[0,1];t.length+b.length+1<g;)b.push(255);b.push(0);for(var v=-1;++v<t.length;)b.push(t[v]);return s(b,m)},t.exports.getKey=l,t.exports.makeKey=d},7753:(t,e,i)=>{var r=i(9509).Buffer,n=i(3550),s=i(6266).ec,o=i(980),a=i(1308);function h(t,e){if(t.cmpn(0)<=0)throw new Error("invalid sig");if(t.cmp(e)>=e)throw new Error("invalid sig")}t.exports=function(t,e,i,u,l){var c=o(i);if("ec"===c.type){if("ecdsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");return function(t,e,i){var r=a[i.data.algorithm.curve.join(".")];if(!r)throw new Error("unknown curve "+i.data.algorithm.curve.join("."));var n=new s(r),o=i.data.subjectPrivateKey.data;return n.verify(e,t,o)}(t,e,c)}if("dsa"===c.type){if("dsa"!==u)throw new Error("wrong public key type");return function(t,e,i){var r=i.data.p,s=i.data.q,a=i.data.g,u=i.data.pub_key,l=o.signature.decode(t,"der"),c=l.s,d=l.r;h(c,s),h(d,s);var f=n.mont(r),p=c.invm(s);return 0===a.toRed(f).redPow(new n(e).mul(p).mod(s)).fromRed().mul(u.toRed(f).redPow(d.mul(p).mod(s)).fromRed()).mod(r).mod(s).cmp(d)}(t,e,c)}if("rsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");e=r.concat([l,e]);for(var d=c.modulus.byteLength(),f=[1],p=0;e.length+f.length+2<d;)f.push(255),p++;f.push(0);for(var m=-1;++m<e.length;)f.push(e[m]);f=r.from(f);var g=n.mont(c.modulus);t=(t=new n(t).toRed(g)).redPow(new n(c.publicExponent)),t=r.from(t.fromRed().toArray());var b=p<8?1:0;for(d=Math.min(t.length,f.length),t.length!==f.length&&(b=1),m=-1;++m<d;)b|=t[m]^f[m];return 0===b}},4505:(t,e,i)=>{"use strict";var r=i(8764).Buffer,n=i(9590),s=i(9282),o=i(2292),a=i(405),h=i(7948),u=i(1619);for(var l in u)e[l]=u[l];function c(t){if("number"!=typeof t||t<e.DEFLATE||t>e.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=t,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}e.NONE=0,e.DEFLATE=1,e.INFLATE=2,e.GZIP=3,e.GUNZIP=4,e.DEFLATERAW=5,e.INFLATERAW=6,e.UNZIP=7,c.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,s(this.init_done,"close before init"),s(this.mode<=e.UNZIP),this.mode===e.DEFLATE||this.mode===e.GZIP||this.mode===e.DEFLATERAW?a.deflateEnd(this.strm):this.mode!==e.INFLATE&&this.mode!==e.GUNZIP&&this.mode!==e.INFLATERAW&&this.mode!==e.UNZIP||h.inflateEnd(this.strm),this.mode=e.NONE,this.dictionary=null)},c.prototype.write=function(t,e,i,r,n,s,o){return this._write(!0,t,e,i,r,n,s,o)},c.prototype.writeSync=function(t,e,i,r,n,s,o){return this._write(!1,t,e,i,r,n,s,o)},c.prototype._write=function(t,i,o,a,h,u,l,c){if(s.equal(arguments.length,8),s(this.init_done,"write before init"),s(this.mode!==e.NONE,"already finalized"),s.equal(!1,this.write_in_progress,"write already in progress"),s.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,s.equal(!1,void 0===i,"must provide flush value"),this.write_in_progress=!0,i!==e.Z_NO_FLUSH&&i!==e.Z_PARTIAL_FLUSH&&i!==e.Z_SYNC_FLUSH&&i!==e.Z_FULL_FLUSH&&i!==e.Z_FINISH&&i!==e.Z_BLOCK)throw new Error("Invalid flush value");if(null==o&&(o=r.alloc(0),h=0,a=0),this.strm.avail_in=h,this.strm.input=o,this.strm.next_in=a,this.strm.avail_out=c,this.strm.output=u,this.strm.next_out=l,this.flush=i,!t)return this._process(),this._checkError()?this._afterSync():void 0;var d=this;return n.nextTick((function(){d._process(),d._after()})),this},c.prototype._afterSync=function(){var t=this.strm.avail_out,e=this.strm.avail_in;return this.write_in_progress=!1,[e,t]},c.prototype._process=function(){var t=null;switch(this.mode){case e.DEFLATE:case e.GZIP:case e.DEFLATERAW:this.err=a.deflate(this.strm,this.flush);break;case e.UNZIP:switch(this.strm.avail_in>0&&(t=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===t)break;if(31!==this.strm.input[t]){this.mode=e.INFLATE;break}if(this.gzip_id_bytes_read=1,t++,1===this.strm.avail_in)break;case 1:if(null===t)break;139===this.strm.input[t]?(this.gzip_id_bytes_read=2,this.mode=e.GUNZIP):this.mode=e.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case e.INFLATE:case e.GUNZIP:case e.INFLATERAW:for(this.err=h.inflate(this.strm,this.flush),this.err===e.Z_NEED_DICT&&this.dictionary&&(this.err=h.inflateSetDictionary(this.strm,this.dictionary),this.err===e.Z_OK?this.err=h.inflate(this.strm,this.flush):this.err===e.Z_DATA_ERROR&&(this.err=e.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===e.GUNZIP&&this.err===e.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=h.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},c.prototype._checkError=function(){switch(this.err){case e.Z_OK:case e.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===e.Z_FINISH)return this._error("unexpected end of file"),!1;break;case e.Z_STREAM_END:break;case e.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},c.prototype._after=function(){if(this._checkError()){var t=this.strm.avail_out,e=this.strm.avail_in;this.write_in_progress=!1,this.callback(e,t),this.pending_close&&this.close()}},c.prototype._error=function(t){this.strm.msg&&(t=this.strm.msg),this.onerror(t,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},c.prototype.init=function(t,i,r,n,o){s(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),s(t>=8&&t<=15,"invalid windowBits"),s(i>=-1&&i<=9,"invalid compression level"),s(r>=1&&r<=9,"invalid memlevel"),s(n===e.Z_FILTERED||n===e.Z_HUFFMAN_ONLY||n===e.Z_RLE||n===e.Z_FIXED||n===e.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(i,t,r,n,o),this._setDictionary()},c.prototype.params=function(){throw new Error("deflateParams Not supported")},c.prototype.reset=function(){this._reset(),this._setDictionary()},c.prototype._init=function(t,i,r,n,s){switch(this.level=t,this.windowBits=i,this.memLevel=r,this.strategy=n,this.flush=e.Z_NO_FLUSH,this.err=e.Z_OK,this.mode!==e.GZIP&&this.mode!==e.GUNZIP||(this.windowBits+=16),this.mode===e.UNZIP&&(this.windowBits+=32),this.mode!==e.DEFLATERAW&&this.mode!==e.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new o,this.mode){case e.DEFLATE:case e.GZIP:case e.DEFLATERAW:this.err=a.deflateInit2(this.strm,this.level,e.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case e.INFLATE:case e.GUNZIP:case e.INFLATERAW:case e.UNZIP:this.err=h.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==e.Z_OK&&this._error("Init error"),this.dictionary=s,this.write_in_progress=!1,this.init_done=!0},c.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=e.Z_OK,this.mode){case e.DEFLATE:case e.DEFLATERAW:this.err=a.deflateSetDictionary(this.strm,this.dictionary)}this.err!==e.Z_OK&&this._error("Failed to set dictionary")}},c.prototype._reset=function(){switch(this.err=e.Z_OK,this.mode){case e.DEFLATE:case e.DEFLATERAW:case e.GZIP:this.err=a.deflateReset(this.strm);break;case e.INFLATE:case e.INFLATERAW:case e.GUNZIP:this.err=h.inflateReset(this.strm)}this.err!==e.Z_OK&&this._error("Failed to reset stream")},e.Zlib=c},2635:(t,e,i)=>{"use strict";var r=i(9590),n=i(8764).Buffer,s=i(2830).Transform,o=i(4505),a=i(9539),h=i(9282).ok,u=i(8764).kMaxLength,l="Cannot create final Buffer. It would be larger than 0x"+u.toString(16)+" bytes";o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION;for(var c=Object.keys(o),d=0;d<c.length;d++){var f=c[d];f.match(/^Z/)&&Object.defineProperty(e,f,{enumerable:!0,value:o[f],writable:!1})}for(var p={Z_OK:o.Z_OK,Z_STREAM_END:o.Z_STREAM_END,Z_NEED_DICT:o.Z_NEED_DICT,Z_ERRNO:o.Z_ERRNO,Z_STREAM_ERROR:o.Z_STREAM_ERROR,Z_DATA_ERROR:o.Z_DATA_ERROR,Z_MEM_ERROR:o.Z_MEM_ERROR,Z_BUF_ERROR:o.Z_BUF_ERROR,Z_VERSION_ERROR:o.Z_VERSION_ERROR},m=Object.keys(p),g=0;g<m.length;g++){var b=m[g];p[p[b]]=b}function v(t,e,i){var r=[],s=0;function o(){for(var e;null!==(e=t.read());)r.push(e),s+=e.length;t.once("readable",o)}function a(){var e,o=null;s>=u?o=new RangeError(l):e=n.concat(r,s),r=[],t.close(),i(o,e)}t.on("error",(function(e){t.removeListener("end",a),t.removeListener("readable",o),i(e)})),t.on("end",a),t.end(e),o()}function y(t,e){if("string"==typeof e&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Not a string or buffer");var i=t._finishFlushFlag;return t._processChunk(e,i)}function w(t){if(!(this instanceof w))return new w(t);A.call(this,t,o.DEFLATE)}function _(t){if(!(this instanceof _))return new _(t);A.call(this,t,o.INFLATE)}function M(t){if(!(this instanceof M))return new M(t);A.call(this,t,o.GZIP)}function k(t){if(!(this instanceof k))return new k(t);A.call(this,t,o.GUNZIP)}function x(t){if(!(this instanceof x))return new x(t);A.call(this,t,o.DEFLATERAW)}function E(t){if(!(this instanceof E))return new E(t);A.call(this,t,o.INFLATERAW)}function S(t){if(!(this instanceof S))return new S(t);A.call(this,t,o.UNZIP)}function T(t){return t===o.Z_NO_FLUSH||t===o.Z_PARTIAL_FLUSH||t===o.Z_SYNC_FLUSH||t===o.Z_FULL_FLUSH||t===o.Z_FINISH||t===o.Z_BLOCK}function A(t,i){var r=this;if(this._opts=t=t||{},this._chunkSize=t.chunkSize||e.Z_DEFAULT_CHUNK,s.call(this,t),t.flush&&!T(t.flush))throw new Error("Invalid flush flag: "+t.flush);if(t.finishFlush&&!T(t.finishFlush))throw new Error("Invalid flush flag: "+t.finishFlush);if(this._flushFlag=t.flush||o.Z_NO_FLUSH,this._finishFlushFlag=void 0!==t.finishFlush?t.finishFlush:o.Z_FINISH,t.chunkSize&&(t.chunkSize<e.Z_MIN_CHUNK||t.chunkSize>e.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+t.chunkSize);if(t.windowBits&&(t.windowBits<e.Z_MIN_WINDOWBITS||t.windowBits>e.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+t.windowBits);if(t.level&&(t.level<e.Z_MIN_LEVEL||t.level>e.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+t.level);if(t.memLevel&&(t.memLevel<e.Z_MIN_MEMLEVEL||t.memLevel>e.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+t.memLevel);if(t.strategy&&t.strategy!=e.Z_FILTERED&&t.strategy!=e.Z_HUFFMAN_ONLY&&t.strategy!=e.Z_RLE&&t.strategy!=e.Z_FIXED&&t.strategy!=e.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+t.strategy);if(t.dictionary&&!n.isBuffer(t.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new o.Zlib(i);var a=this;this._hadError=!1,this._handle.onerror=function(t,i){I(a),a._hadError=!0;var r=new Error(t);r.errno=i,r.code=e.codes[i],a.emit("error",r)};var h=e.Z_DEFAULT_COMPRESSION;"number"==typeof t.level&&(h=t.level);var u=e.Z_DEFAULT_STRATEGY;"number"==typeof t.strategy&&(u=t.strategy),this._handle.init(t.windowBits||e.Z_DEFAULT_WINDOWBITS,h,t.memLevel||e.Z_DEFAULT_MEMLEVEL,u,t.dictionary),this._buffer=n.allocUnsafe(this._chunkSize),this._offset=0,this._level=h,this._strategy=u,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!r._handle},configurable:!0,enumerable:!0})}function I(t,e){e&&r.nextTick(e),t._handle&&(t._handle.close(),t._handle=null)}function C(t){t.emit("close")}Object.defineProperty(e,"codes",{enumerable:!0,value:Object.freeze(p),writable:!1}),e.Deflate=w,e.Inflate=_,e.Gzip=M,e.Gunzip=k,e.DeflateRaw=x,e.InflateRaw=E,e.Unzip=S,e.createDeflate=function(t){return new w(t)},e.createInflate=function(t){return new _(t)},e.createDeflateRaw=function(t){return new x(t)},e.createInflateRaw=function(t){return new E(t)},e.createGzip=function(t){return new M(t)},e.createGunzip=function(t){return new k(t)},e.createUnzip=function(t){return new S(t)},e.deflate=function(t,e,i){return"function"==typeof e&&(i=e,e={}),v(new w(e),t,i)},e.deflateSync=function(t,e){return y(new w(e),t)},e.gzip=function(t,e,i){return"function"==typeof e&&(i=e,e={}),v(new M(e),t,i)},e.gzipSync=function(t,e){return y(new M(e),t)},e.deflateRaw=function(t,e,i){return"function"==typeof e&&(i=e,e={}),v(new x(e),t,i)},e.deflateRawSync=function(t,e){return y(new x(e),t)},e.unzip=function(t,e,i){return"function"==typeof e&&(i=e,e={}),v(new S(e),t,i)},e.unzipSync=function(t,e){return y(new S(e),t)},e.inflate=function(t,e,i){return"function"==typeof e&&(i=e,e={}),v(new _(e),t,i)},e.inflateSync=function(t,e){return y(new _(e),t)},e.gunzip=function(t,e,i){return"function"==typeof e&&(i=e,e={}),v(new k(e),t,i)},e.gunzipSync=function(t,e){return y(new k(e),t)},e.inflateRaw=function(t,e,i){return"function"==typeof e&&(i=e,e={}),v(new E(e),t,i)},e.inflateRawSync=function(t,e){return y(new E(e),t)},a.inherits(A,s),A.prototype.params=function(t,i,n){if(t<e.Z_MIN_LEVEL||t>e.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+t);if(i!=e.Z_FILTERED&&i!=e.Z_HUFFMAN_ONLY&&i!=e.Z_RLE&&i!=e.Z_FIXED&&i!=e.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+i);if(this._level!==t||this._strategy!==i){var s=this;this.flush(o.Z_SYNC_FLUSH,(function(){h(s._handle,"zlib binding closed"),s._handle.params(t,i),s._hadError||(s._level=t,s._strategy=i,n&&n())}))}else r.nextTick(n)},A.prototype.reset=function(){return h(this._handle,"zlib binding closed"),this._handle.reset()},A.prototype._flush=function(t){this._transform(n.alloc(0),"",t)},A.prototype.flush=function(t,e){var i=this,s=this._writableState;("function"==typeof t||void 0===t&&!e)&&(e=t,t=o.Z_FULL_FLUSH),s.ended?e&&r.nextTick(e):s.ending?e&&this.once("end",e):s.needDrain?e&&this.once("drain",(function(){return i.flush(t,e)})):(this._flushFlag=t,this.write(n.alloc(0),"",e))},A.prototype.close=function(t){I(this,t),r.nextTick(C,this)},A.prototype._transform=function(t,e,i){var r,s=this._writableState,a=(s.ending||s.ended)&&(!t||s.length===t.length);return null===t||n.isBuffer(t)?this._handle?(a?r=this._finishFlushFlag:(r=this._flushFlag,t.length>=s.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH)),void this._processChunk(t,r,i)):i(new Error("zlib binding closed")):i(new Error("invalid input"))},A.prototype._processChunk=function(t,e,i){var r=t&&t.length,s=this._chunkSize-this._offset,o=0,a=this,c="function"==typeof i;if(!c){var d,f=[],p=0;this.on("error",(function(t){d=t})),h(this._handle,"zlib binding closed");do{var m=this._handle.writeSync(e,t,o,r,this._buffer,this._offset,s)}while(!this._hadError&&v(m[0],m[1]));if(this._hadError)throw d;if(p>=u)throw I(this),new RangeError(l);var g=n.concat(f,p);return I(this),g}h(this._handle,"zlib binding closed");var b=this._handle.write(e,t,o,r,this._buffer,this._offset,s);function v(u,l){if(this&&(this.buffer=null,this.callback=null),!a._hadError){var d=s-l;if(h(d>=0,"have should not go down"),d>0){var m=a._buffer.slice(a._offset,a._offset+d);a._offset+=d,c?a.push(m):(f.push(m),p+=m.length)}if((0===l||a._offset>=a._chunkSize)&&(s=a._chunkSize,a._offset=0,a._buffer=n.allocUnsafe(a._chunkSize)),0===l){if(o+=r-u,r=u,!c)return!0;var g=a._handle.write(e,t,o,r,a._buffer,a._offset,a._chunkSize);return g.callback=v,void(g.buffer=t)}if(!c)return!1;i()}}b.buffer=t,b.callback=v},a.inherits(w,A),a.inherits(_,A),a.inherits(M,A),a.inherits(k,A),a.inherits(x,A),a.inherits(E,A),a.inherits(S,A)},1909:(t,e,i)=>{var r=i(8764).Buffer;t.exports=function(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative');return r.allocUnsafe?r.allocUnsafe(t):new r(t)}},2822:(t,e,i)=>{var r=i(8764).Buffer,n=i(7676),s=i(1909);t.exports=function(t,e,i){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative');if(r.alloc)return r.alloc(t,e,i);var o=s(t);return 0===t?o:void 0===e?n(o,0):("string"!=typeof i&&(i=void 0),n(o,e,i))}},7676:(t,e,i)=>{var r=i(8764).Buffer,n=function(){try{if(!r.isEncoding("latin1"))return!1;var t=r.alloc?r.alloc(4):new r(4);return t.fill("ab","ucs2"),"61006200"===t.toString("hex")}catch(t){return!1}}();function s(t,e,i,r){if(i<0||r>t.length)throw new RangeError("Out of range index");return i>>>=0,(r=void 0===r?t.length:r>>>0)>i&&t.fill(e,i,r),t}t.exports=function(t,e,i,o,a){if(n)return t.fill(e,i,o,a);if("number"==typeof e)return s(t,e,i,o);if("string"==typeof e){if("string"==typeof i?(a=i,i=0,o=t.length):"string"==typeof o&&(a=o,o=t.length),void 0!==a&&"string"!=typeof a)throw new TypeError("encoding must be a string");if("latin1"===a&&(a="binary"),"string"==typeof a&&!r.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(""===e)return s(t,0,i,o);if(function(t){return 1===t.length&&t.charCodeAt(0)<256}(e))return s(t,e.charCodeAt(0),i,o);e=new r(e,a)}return r.isBuffer(e)?function(t,e,i,r){if(i<0||r>t.length)throw new RangeError("Out of range index");if(r<=i)return t;i>>>=0,r=void 0===r?t.length:r>>>0;for(var n=i,s=e.length;n<=r-s;)e.copy(t,n),n+=s;return n!==r&&e.copy(t,n,0,r-n),t}(t,e,i,o):s(t,0,i,o)}},7295:(t,e,i)=>{var r=i(8764).Buffer;t.exports=function(t,e){for(var i=Math.min(t.length,e.length),n=new r(i),s=0;s<i;++s)n[s]=t[s]^e[s];return n}},8764:(t,e,i)=>{"use strict";var r=i(5108);const n=i(9742),s=i(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.alloc(+t)},e.INSPECT_MAX_BYTES=50;const a=2147483647;function h(t){if(t>a)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,i){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return d(t)}return l(t,e,i)}function l(t,e,i){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const i=0|g(t,e);let r=h(i);const n=r.write(t,e);return n!==i&&(r=r.slice(0,n)),r}(t,e);if(ArrayBuffer.isView(t))return function(t){if(J(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(J(t,ArrayBuffer)||t&&J(t.buffer,ArrayBuffer))return p(t,e,i);if("undefined"!=typeof SharedArrayBuffer&&(J(t,SharedArrayBuffer)||t&&J(t.buffer,SharedArrayBuffer)))return p(t,e,i);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return u.from(r,e,i);const n=function(t){if(u.isBuffer(t)){const e=0|m(t.length),i=h(e);return 0===i.length||t.copy(i,0,0,e),i}return void 0!==t.length?"number"!=typeof t.length||Y(t.length)?h(0):f(t):"Buffer"===t.type&&Array.isArray(t.data)?f(t.data):void 0}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function d(t){return c(t),h(t<0?0:0|m(t))}function f(t){const e=t.length<0?0:0|m(t.length),i=h(e);for(let r=0;r<e;r+=1)i[r]=255&t[r];return i}function p(t,e,i){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(i||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===e&&void 0===i?new Uint8Array(t):void 0===i?new Uint8Array(t,e):new Uint8Array(t,e,i),Object.setPrototypeOf(r,u.prototype),r}function m(t){if(t>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function g(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||J(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const i=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===i)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return V(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return K(t).length;default:if(n)return r?-1:V(t).length;e=(""+e).toLowerCase(),n=!0}}function b(t,e,i){let r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return B(this,e,i);case"utf8":case"utf-8":return T(this,e,i);case"ascii":return I(this,e,i);case"latin1":case"binary":return C(this,e,i);case"base64":return S(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,i);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function v(t,e,i){const r=t[e];t[e]=t[i],t[i]=r}function y(t,e,i,r,n){if(0===t.length)return-1;if("string"==typeof i?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),Y(i=+i)&&(i=n?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(n)return-1;i=t.length-1}else if(i<0){if(!n)return-1;i=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:w(t,e,i,r,n);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):w(t,[e],i,r,n);throw new TypeError("val must be string, number or Buffer")}function w(t,e,i,r,n){let s,o=1,a=t.length,h=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;o=2,a/=2,h/=2,i/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(n){let r=-1;for(s=i;s<a;s++)if(u(t,s)===u(e,-1===r?0:s-r)){if(-1===r&&(r=s),s-r+1===h)return r*o}else-1!==r&&(s-=s-r),r=-1}else for(i+h>a&&(i=a-h),s=i;s>=0;s--){let i=!0;for(let r=0;r<h;r++)if(u(t,s+r)!==u(e,r)){i=!1;break}if(i)return s}return-1}function _(t,e,i,r){i=Number(i)||0;const n=t.length-i;r?(r=Number(r))>n&&(r=n):r=n;const s=e.length;let o;for(r>s/2&&(r=s/2),o=0;o<r;++o){const r=parseInt(e.substr(2*o,2),16);if(Y(r))return o;t[i+o]=r}return o}function M(t,e,i,r){return G(V(e,t.length-i),t,i,r)}function k(t,e,i,r){return G(function(t){const e=[];for(let i=0;i<t.length;++i)e.push(255&t.charCodeAt(i));return e}(e),t,i,r)}function x(t,e,i,r){return G(K(e),t,i,r)}function E(t,e,i,r){return G(function(t,e){let i,r,n;const s=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)i=t.charCodeAt(o),r=i>>8,n=i%256,s.push(n),s.push(r);return s}(e,t.length-i),t,i,r)}function S(t,e,i){return 0===e&&i===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,i))}function T(t,e,i){i=Math.min(t.length,i);const r=[];let n=e;for(;n<i;){const e=t[n];let s=null,o=e>239?4:e>223?3:e>191?2:1;if(n+o<=i){let i,r,a,h;switch(o){case 1:e<128&&(s=e);break;case 2:i=t[n+1],128==(192&i)&&(h=(31&e)<<6|63&i,h>127&&(s=h));break;case 3:i=t[n+1],r=t[n+2],128==(192&i)&&128==(192&r)&&(h=(15&e)<<12|(63&i)<<6|63&r,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:i=t[n+1],r=t[n+2],a=t[n+3],128==(192&i)&&128==(192&r)&&128==(192&a)&&(h=(15&e)<<18|(63&i)<<12|(63&r)<<6|63&a,h>65535&&h<1114112&&(s=h))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),n+=o}return function(t){const e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);let i="",r=0;for(;r<e;)i+=String.fromCharCode.apply(String,t.slice(r,r+=A));return i}(r)}e.kMaxLength=a,u.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),u.TYPED_ARRAY_SUPPORT||void 0===r||"function"!=typeof r.error||r.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,i){return l(t,e,i)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,e,i){return function(t,e,i){return c(t),t<=0?h(t):void 0!==e?"string"==typeof i?h(t).fill(e,i):h(t).fill(e):h(t)}(t,e,i)},u.allocUnsafe=function(t){return d(t)},u.allocUnsafeSlow=function(t){return d(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(J(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),J(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let i=t.length,r=e.length;for(let n=0,s=Math.min(i,r);n<s;++n)if(t[n]!==e[n]){i=t[n],r=e[n];break}return i<r?-1:r<i?1:0},u.isEncoding=function(t){switch(String(t).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}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);let i;if(void 0===e)for(e=0,i=0;i<t.length;++i)e+=t[i].length;const r=u.allocUnsafe(e);let n=0;for(i=0;i<t.length;++i){let e=t[i];if(J(e,Uint8Array))n+e.length>r.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(r,n)):Uint8Array.prototype.set.call(r,e,n);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(r,n)}n+=e.length}return r},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)v(this,e,e+1);return this},u.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)v(this,e,e+3),v(this,e+1,e+2);return this},u.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},u.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?T(this,0,t):b.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){let t="";const i=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(t+=" ... "),"<Buffer "+t+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,i,r,n){if(J(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===i&&(i=t?t.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),e<0||i>t.length||r<0||n>this.length)throw new RangeError("out of range index");if(r>=n&&e>=i)return 0;if(r>=n)return-1;if(e>=i)return 1;if(this===t)return 0;let s=(n>>>=0)-(r>>>=0),o=(i>>>=0)-(e>>>=0);const a=Math.min(s,o),h=this.slice(r,n),l=t.slice(e,i);for(let t=0;t<a;++t)if(h[t]!==l[t]){s=h[t],o=l[t];break}return s<o?-1:o<s?1:0},u.prototype.includes=function(t,e,i){return-1!==this.indexOf(t,e,i)},u.prototype.indexOf=function(t,e,i){return y(this,t,e,i,!0)},u.prototype.lastIndexOf=function(t,e,i){return y(this,t,e,i,!1)},u.prototype.write=function(t,e,i,r){if(void 0===e)r="utf8",i=this.length,e=0;else if(void 0===i&&"string"==typeof e)r=e,i=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(i)?(i>>>=0,void 0===r&&(r="utf8")):(r=i,i=void 0)}const n=this.length-e;if((void 0===i||i>n)&&(i=n),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let s=!1;for(;;)switch(r){case"hex":return _(this,t,e,i);case"utf8":case"utf-8":return M(this,t,e,i);case"ascii":case"latin1":case"binary":return k(this,t,e,i);case"base64":return x(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,i);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const A=4096;function I(t,e,i){let r="";i=Math.min(t.length,i);for(let n=e;n<i;++n)r+=String.fromCharCode(127&t[n]);return r}function C(t,e,i){let r="";i=Math.min(t.length,i);for(let n=e;n<i;++n)r+=String.fromCharCode(t[n]);return r}function B(t,e,i){const r=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>r)&&(i=r);let n="";for(let r=e;r<i;++r)n+=X[t[r]];return n}function R(t,e,i){const r=t.slice(e,i);let n="";for(let t=0;t<r.length-1;t+=2)n+=String.fromCharCode(r[t]+256*r[t+1]);return n}function P(t,e,i){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,i,r,n,s){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw new RangeError('"value" argument is out of bounds');if(i+r>t.length)throw new RangeError("Index out of range")}function O(t,e,i,r,n){H(e,r,n,t,i,7);let s=Number(e&BigInt(4294967295));t[i++]=s,s>>=8,t[i++]=s,s>>=8,t[i++]=s,s>>=8,t[i++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[i++]=o,o>>=8,t[i++]=o,o>>=8,t[i++]=o,o>>=8,t[i++]=o,i}function D(t,e,i,r,n){H(e,r,n,t,i,7);let s=Number(e&BigInt(4294967295));t[i+7]=s,s>>=8,t[i+6]=s,s>>=8,t[i+5]=s,s>>=8,t[i+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[i+3]=o,o>>=8,t[i+2]=o,o>>=8,t[i+1]=o,o>>=8,t[i]=o,i+8}function N(t,e,i,r,n,s){if(i+r>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function j(t,e,i,r,n){return e=+e,i>>>=0,n||N(t,0,i,4),s.write(t,e,i,r,23,4),i+4}function U(t,e,i,r,n){return e=+e,i>>>=0,n||N(t,0,i,8),s.write(t,e,i,r,52,8),i+8}u.prototype.slice=function(t,e){const i=this.length;(t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e<t&&(e=t);const r=this.subarray(t,e);return Object.setPrototypeOf(r,u.prototype),r},u.prototype.readUintLE=u.prototype.readUIntLE=function(t,e,i){t>>>=0,e>>>=0,i||P(t,e,this.length);let r=this[t],n=1,s=0;for(;++s<e&&(n*=256);)r+=this[t+s]*n;return r},u.prototype.readUintBE=u.prototype.readUIntBE=function(t,e,i){t>>>=0,e>>>=0,i||P(t,e,this.length);let r=this[t+--e],n=1;for(;e>0&&(n*=256);)r+=this[t+--e]*n;return r},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=Q((function(t){W(t>>>=0,"offset");const e=this[t],i=this[t+7];void 0!==e&&void 0!==i||$(t,this.length-8);const r=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,n=this[++t]+256*this[++t]+65536*this[++t]+i*2**24;return BigInt(r)+(BigInt(n)<<BigInt(32))})),u.prototype.readBigUInt64BE=Q((function(t){W(t>>>=0,"offset");const e=this[t],i=this[t+7];void 0!==e&&void 0!==i||$(t,this.length-8);const r=e*2**24+65536*this[++t]+256*this[++t]+this[++t],n=this[++t]*2**24+65536*this[++t]+256*this[++t]+i;return(BigInt(r)<<BigInt(32))+BigInt(n)})),u.prototype.readIntLE=function(t,e,i){t>>>=0,e>>>=0,i||P(t,e,this.length);let r=this[t],n=1,s=0;for(;++s<e&&(n*=256);)r+=this[t+s]*n;return n*=128,r>=n&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,i){t>>>=0,e>>>=0,i||P(t,e,this.length);let r=e,n=1,s=this[t+--r];for(;r>0&&(n*=256);)s+=this[t+--r]*n;return n*=128,s>=n&&(s-=Math.pow(2,8*e)),s},u.prototype.readInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||P(t,2,this.length);const i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},u.prototype.readInt16BE=function(t,e){t>>>=0,e||P(t,2,this.length);const i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=Q((function(t){W(t>>>=0,"offset");const e=this[t],i=this[t+7];void 0!==e&&void 0!==i||$(t,this.length-8);const r=this[t+4]+256*this[t+5]+65536*this[t+6]+(i<<24);return(BigInt(r)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),u.prototype.readBigInt64BE=Q((function(t){W(t>>>=0,"offset");const e=this[t],i=this[t+7];void 0!==e&&void 0!==i||$(t,this.length-8);const r=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(r)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+i)})),u.prototype.readFloatLE=function(t,e){return t>>>=0,e||P(t,4,this.length),s.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||P(t,4,this.length),s.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||P(t,8,this.length),s.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||P(t,8,this.length),s.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,i,r){t=+t,e>>>=0,i>>>=0,r||L(this,t,e,i,Math.pow(2,8*i)-1,0);let n=1,s=0;for(this[e]=255&t;++s<i&&(n*=256);)this[e+s]=t/n&255;return e+i},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,e,i,r){t=+t,e>>>=0,i>>>=0,r||L(this,t,e,i,Math.pow(2,8*i)-1,0);let n=i-1,s=1;for(this[e+n]=255&t;--n>=0&&(s*=256);)this[e+n]=t/s&255;return e+i},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,i){return t=+t,e>>>=0,i||L(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,i){return t=+t,e>>>=0,i||L(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,i){return t=+t,e>>>=0,i||L(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,i){return t=+t,e>>>=0,i||L(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,i){return t=+t,e>>>=0,i||L(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigUInt64LE=Q((function(t,e=0){return O(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Q((function(t,e=0){return D(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,i,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*i-1);L(this,t,e,i,r-1,-r)}let n=0,s=1,o=0;for(this[e]=255&t;++n<i&&(s*=256);)t<0&&0===o&&0!==this[e+n-1]&&(o=1),this[e+n]=(t/s>>0)-o&255;return e+i},u.prototype.writeIntBE=function(t,e,i,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*i-1);L(this,t,e,i,r-1,-r)}let n=i-1,s=1,o=0;for(this[e+n]=255&t;--n>=0&&(s*=256);)t<0&&0===o&&0!==this[e+n+1]&&(o=1),this[e+n]=(t/s>>0)-o&255;return e+i},u.prototype.writeInt8=function(t,e,i){return t=+t,e>>>=0,i||L(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,i){return t=+t,e>>>=0,i||L(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,i){return t=+t,e>>>=0,i||L(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,i){return t=+t,e>>>=0,i||L(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,i){return t=+t,e>>>=0,i||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigInt64LE=Q((function(t,e=0){return O(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Q((function(t,e=0){return D(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,i){return j(this,t,e,!0,i)},u.prototype.writeFloatBE=function(t,e,i){return j(this,t,e,!1,i)},u.prototype.writeDoubleLE=function(t,e,i){return U(this,t,e,!0,i)},u.prototype.writeDoubleBE=function(t,e,i){return U(this,t,e,!1,i)},u.prototype.copy=function(t,e,i,r){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(i||(i=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<i&&(r=i),r===i)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-i&&(r=t.length-e+i);const n=r-i;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,i,r):Uint8Array.prototype.set.call(t,this.subarray(i,r),e),n},u.prototype.fill=function(t,e,i,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,i=this.length):"string"==typeof i&&(r=i,i=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===t.length){const e=t.charCodeAt(0);("utf8"===r&&e<128||"latin1"===r)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;let n;if(e>>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(n=e;n<i;++n)this[n]=t;else{const s=u.isBuffer(t)?t:u.from(t,r),o=s.length;if(0===o)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(n=0;n<i-e;++n)this[n+e]=s[n%o]}return this};const F={};function q(t,e,i){F[t]=class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function z(t){let e="",i=t.length;const r="-"===t[0]?1:0;for(;i>=r+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}function H(t,e,i,r,n,s){if(t>i||t<e){const r="bigint"==typeof e?"n":"";let n;throw n=s>3?0===e||e===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(s+1)}${r}`:`>= -(2${r} ** ${8*(s+1)-1}${r}) and < 2 ** ${8*(s+1)-1}${r}`:`>= ${e}${r} and <= ${i}${r}`,new F.ERR_OUT_OF_RANGE("value",n,t)}!function(t,e,i){W(e,"offset"),void 0!==t[e]&&void 0!==t[e+i]||$(e,t.length-(i+1))}(r,n,s)}function W(t,e){if("number"!=typeof t)throw new F.ERR_INVALID_ARG_TYPE(e,"number",t)}function $(t,e,i){if(Math.floor(t)!==t)throw W(t,i),new F.ERR_OUT_OF_RANGE(i||"offset","an integer",t);if(e<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${e}`,t)}q("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),q("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),q("ERR_OUT_OF_RANGE",(function(t,e,i){let r=`The value of "${t}" is out of range.`,n=i;return Number.isInteger(i)&&Math.abs(i)>2**32?n=z(String(i)):"bigint"==typeof i&&(n=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(n=z(n)),n+="n"),r+=` It must be ${e}. Received ${n}`,r}),RangeError);const Z=/[^+/0-9A-Za-z-_]/g;function V(t,e){let i;e=e||1/0;const r=t.length;let n=null;const s=[];for(let o=0;o<r;++o){if(i=t.charCodeAt(o),i>55295&&i<57344){if(!n){if(i>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===r){(e-=3)>-1&&s.push(239,191,189);continue}n=i;continue}if(i<56320){(e-=3)>-1&&s.push(239,191,189),n=i;continue}i=65536+(n-55296<<10|i-56320)}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,i<128){if((e-=1)<0)break;s.push(i)}else if(i<2048){if((e-=2)<0)break;s.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;s.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return s}function K(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(Z,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function G(t,e,i,r){let n;for(n=0;n<r&&!(n+i>=e.length||n>=t.length);++n)e[n+i]=t[n];return n}function J(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}const X=function(){const t="0123456789abcdef",e=new Array(256);for(let i=0;i<16;++i){const r=16*i;for(let n=0;n<16;++n)e[r+n]=t[i]+t[n]}return e}();function Q(t){return"undefined"==typeof BigInt?tt:t}function tt(){throw new Error("BigInt not supported")}},584:t=>{t.exports={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",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",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",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},9421:(t,e,i)=>{const r=i(7117),n=i(4375);t.exports=class{constructor(t,e){if(this.store=t,this.chunkLength=t.chunkLength,this.inProgressGets=new Map,!this.store||!this.store.get||!this.store.put)throw new Error("First argument must be abstract-chunk-store compliant");this.cache=new r(e)}put(t,e,i=(()=>{})){if(!this.cache)return n((()=>i(new Error("CacheStore closed"))));this.cache.remove(t),this.store.put(t,e,i)}get(t,e,i=(()=>{})){if("function"==typeof e)return this.get(t,null,e);if(!this.cache)return n((()=>i(new Error("CacheStore closed"))));e||(e={});let r=this.cache.get(t);if(r){const t=e.offset||0,s=e.length||r.length-t;return 0===t&&s===r.length||(r=r.slice(t,s+t)),n((()=>i(null,r)))}let s=this.inProgressGets.get(t);const o=!!s;s||(s=[],this.inProgressGets.set(t,s)),s.push({opts:e,cb:i}),o||this.store.get(t,((e,i)=>{e||null==this.cache||this.cache.set(t,i);const r=this.inProgressGets.get(t);this.inProgressGets.delete(t);for(const{opts:t,cb:n}of r)if(e)n(e);else{const e=t.offset||0,r=t.length||i.length-e;let s=i;0===e&&r===i.length||(s=i.slice(e,r+e)),n(null,s)}}))}close(t=(()=>{})){if(!this.cache)return n((()=>t(new Error("CacheStore closed"))));this.cache=null,this.store.close(t)}destroy(t=(()=>{})){if(!this.cache)return n((()=>t(new Error("CacheStore closed"))));this.cache=null,this.store.destroy(t)}}},1924:(t,e,i)=>{"use strict";var r=i(210),n=i(5559),s=n(r("String.prototype.indexOf"));t.exports=function(t,e){var i=r(t,!!e);return"function"==typeof i&&s(t,".prototype.")>-1?n(i):i}},5559:(t,e,i)=>{"use strict";var r=i(8612),n=i(210),s=n("%Function.prototype.apply%"),o=n("%Function.prototype.call%"),a=n("%Reflect.apply%",!0)||r.call(o,s),h=n("%Object.getOwnPropertyDescriptor%",!0),u=n("%Object.defineProperty%",!0),l=n("%Math.max%");if(u)try{u({},"a",{value:1})}catch(t){u=null}t.exports=function(t){var e=a(r,o,arguments);if(h&&u){var i=h(e,"length");i.configurable&&u(e,"length",{value:1+l(0,t.length-(arguments.length-1))})}return e};var c=function(){return a(r,s,arguments)};u?u(t.exports,"apply",{value:c}):t.exports.apply=c},5293:(t,e,i)=>{const r=i(9e3),n=i(8473);class s extends n.Writable{constructor(t,e,i={}){if(super(i),!t||!t.put||!t.get)throw new Error("First argument must be an abstract-chunk-store compliant store");if(!(e=Number(e)))throw new Error("Second argument must be a chunk length");const n=void 0!==i.zeroPadding&&i.zeroPadding;this._blockstream=new r(e,{...i,zeroPadding:n}),this._outstandingPuts=0,this._storeMaxOutstandingPuts=i.storeMaxOutstandingPuts||16;let s=0;this._blockstream.on("data",(e=>{this.destroyed||(this._outstandingPuts+=1,this._outstandingPuts>=this._storeMaxOutstandingPuts&&this._blockstream.pause(),t.put(s,e,(t=>{if(t)return this.destroy(t);this._outstandingPuts-=1,this._outstandingPuts<this._storeMaxOutstandingPuts&&this._blockstream.resume(),0===this._outstandingPuts&&"function"==typeof this._finalCb&&(this._finalCb(null),this._finalCb=null)})),s+=1)})).on("error",(t=>{this.destroy(t)}))}_write(t,e,i){this._blockstream.write(t,e,i)}_final(t){this._blockstream.end(),this._blockstream.once("end",(()=>{0===this._outstandingPuts?t(null):this._finalCb=t}))}destroy(t){this.destroyed||(this.destroyed=!0,t&&this.emit("error",t),this.emit("close"))}}t.exports=s},1027:(t,e,i)=>{var r=i(9509).Buffer,n=i(2830).Transform,s=i(2553).s;function o(t){n.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}i(5717)(o,n),o.prototype.update=function(t,e,i){"string"==typeof t&&(t=r.from(t,e));var n=this._update(t);return this.hashMode?this:(i&&(n=this._toString(n,i)),n)},o.prototype.setAutoPadding=function(){},o.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},o.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},o.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},o.prototype._transform=function(t,e,i){var r;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){r=t}finally{i(r)}},o.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},o.prototype._finalOrDigest=function(t){var e=this.__final()||r.alloc(0);return t&&(e=this._toString(e,t,!0)),e},o.prototype._toString=function(t,e,i){if(this._decoder||(this._decoder=new s(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var r=this._decoder.write(t);return i&&(r+=this._decoder.end()),r},t.exports=o},6313:(t,e,i)=>{var r=i(8764).Buffer,n=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}var e,i,n;try{e=Map}catch(t){e=function(){}}try{i=Set}catch(t){i=function(){}}try{n=Promise}catch(t){n=function(){}}function s(o,h,u,l,c){"object"==typeof h&&(u=h.depth,l=h.prototype,c=h.includeNonEnumerable,h=h.circular);var d=[],f=[],p=void 0!==r;return void 0===h&&(h=!0),void 0===u&&(u=1/0),function o(u,m){if(null===u)return null;if(0===m)return u;var g,b;if("object"!=typeof u)return u;if(t(u,e))g=new e;else if(t(u,i))g=new i;else if(t(u,n))g=new n((function(t,e){u.then((function(e){t(o(e,m-1))}),(function(t){e(o(t,m-1))}))}));else if(s.__isArray(u))g=[];else if(s.__isRegExp(u))g=new RegExp(u.source,a(u)),u.lastIndex&&(g.lastIndex=u.lastIndex);else if(s.__isDate(u))g=new Date(u.getTime());else{if(p&&r.isBuffer(u))return g=r.allocUnsafe?r.allocUnsafe(u.length):new r(u.length),u.copy(g),g;t(u,Error)?g=Object.create(u):void 0===l?(b=Object.getPrototypeOf(u),g=Object.create(b)):(g=Object.create(l),b=l)}if(h){var v=d.indexOf(u);if(-1!=v)return f[v];d.push(u),f.push(g)}for(var y in t(u,e)&&u.forEach((function(t,e){var i=o(e,m-1),r=o(t,m-1);g.set(i,r)})),t(u,i)&&u.forEach((function(t){var e=o(t,m-1);g.add(e)})),u){var w;b&&(w=Object.getOwnPropertyDescriptor(b,y)),w&&null==w.set||(g[y]=o(u[y],m-1))}if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(u);for(y=0;y<_.length;y++){var M=_[y];(!(x=Object.getOwnPropertyDescriptor(u,M))||x.enumerable||c)&&(g[M]=o(u[M],m-1),x.enumerable||Object.defineProperty(g,M,{enumerable:!1}))}}if(c){var k=Object.getOwnPropertyNames(u);for(y=0;y<k.length;y++){var x,E=k[y];(x=Object.getOwnPropertyDescriptor(u,E))&&x.enumerable||(g[E]=o(u[E],m-1),Object.defineProperty(g,E,{enumerable:!1}))}}return g}(o,u)}function o(t){return Object.prototype.toString.call(t)}function a(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}return s.clonePrototype=function(t){if(null===t)return null;var e=function(){};return e.prototype=t,new e},s.__objToStr=o,s.__isDate=function(t){return"object"==typeof t&&"[object Date]"===o(t)},s.__isArray=function(t){return"object"==typeof t&&"[object Array]"===o(t)},s.__isRegExp=function(t){return"object"==typeof t&&"[object RegExp]"===o(t)},s.__getRegExpFlags=a,s}();t.exports&&(t.exports=n)},5108:(t,e,i)=>{var r=i(9539),n=i(9282);function s(){return(new Date).getTime()}var o,a=Array.prototype.slice,h={};o=void 0!==i.g&&i.g.console?i.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var u=[[function(){},"log"],[function(){o.log.apply(o,arguments)},"info"],[function(){o.log.apply(o,arguments)},"warn"],[function(){o.warn.apply(o,arguments)},"error"],[function(t){h[t]=s()},"time"],[function(t){var e=h[t];if(!e)throw new Error("No such label: "+t);delete h[t];var i=s()-e;o.log(t+": "+i+"ms")},"timeEnd"],[function(){var t=new Error;t.name="Trace",t.message=r.format.apply(null,arguments),o.error(t.stack)},"trace"],[function(t){o.log(r.inspect(t)+"\n")},"dir"],[function(t){if(!t){var e=a.call(arguments,1);n.ok(!1,r.format.apply(null,e))}},"assert"]],l=0;l<u.length;l++){var c=u[l],d=c[0],f=c[1];o[f]||(o[f]=d)}t.exports=o},9648:t=>{t.exports=function(){for(var t=navigator.hardwareConcurrency||1,e=[],i=0;i<t;i++)e.push({model:"",speed:0,times:{user:0,nice:0,sys:0,idle:0,irq:0}});return e}},6393:(t,e,i)=>{var r=i(8764).Buffer,n=i(6266),s=i(6426);t.exports=function(t){return new a(t)};var o={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function a(t){this.curveType=o[t],this.curveType||(this.curveType={name:t}),this.curve=new n.ec(this.curveType.name),this.keys=void 0}function h(t,e,i){Array.isArray(t)||(t=t.toArray());var n=new r(t);if(i&&n.length<i){var s=new r(i-n.length);s.fill(0),n=r.concat([s,n])}return e?n.toString(e):n}o.p224=o.secp224r1,o.p256=o.secp256r1=o.prime256v1,o.p192=o.secp192r1=o.prime192v1,o.p384=o.secp384r1,o.p521=o.secp521r1,a.prototype.generateKeys=function(t,e){return this.keys=this.curve.genKeyPair(),this.getPublicKey(t,e)},a.prototype.computeSecret=function(t,e,i){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),h(this.curve.keyFromPublic(t).getPublic().mul(this.keys.getPrivate()).getX(),i,this.curveType.byteLength)},a.prototype.getPublicKey=function(t,e){var i=this.keys.getPublic("compressed"===e,!0);return"hybrid"===e&&(i[i.length-1]%2?i[0]=7:i[0]=6),h(i,t)},a.prototype.getPrivateKey=function(t){return h(this.keys.getPrivate(),t)},a.prototype.setPublicKey=function(t,e){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),this.keys._importPublic(t),this},a.prototype.setPrivateKey=function(t,e){e=e||"utf8",r.isBuffer(t)||(t=new r(t,e));var i=new s(t);return i=i.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(i),this}},6426:function(t,e,i){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function s(t,e,i){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var o;"object"==typeof t?t.exports=s:e.BN=s,s.BN=s,s.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:i(8623).Buffer}catch(t){}function a(t,e){var i=t.charCodeAt(e);return i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function h(t,e,i){var r=a(t,i);return i-1>=e&&(r|=a(t,i-1)<<4),r}function u(t,e,i,r){for(var n=0,s=Math.min(t.length,i),o=e;o<s;o++){var a=t.charCodeAt(o)-48;n*=r,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}s.isBN=function(t){return t instanceof s||null!==t&&"object"==typeof t&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===e?this._parseHex(t,n,i):(this._parseBase(t,e,n),"le"===i&&this._initArray(this.toArray(),e,i)))},s.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},s.prototype._initArray=function(t,e,i){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var s,o,a=0;if("be"===i)for(n=t.length-1,s=0;n>=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===i)for(n=0,s=0;n<t.length;n+=3)o=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(t,e,i){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,s=0,o=0;if("be"===i)for(r=t.length-1;r>=e;r-=2)n=h(t,e,r)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(r=(t.length-e)%2==0?e+1:e;r<t.length;r+=2)n=h(t,e,r)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this.strip()},s.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var s=t.length-i,o=s%r,a=Math.min(s,s-o)+i,h=0,l=i;l<a;l+=r)h=u(t,l,l+r,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==o){var c=1;for(h=u(t,l,t.length,e),l=0;l<o;l++)c*=e;this.imuln(c),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this.strip()},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],s=0|e.words[0],o=n*s,a=67108863&o,h=o/67108864|0;i.words[0]=a;for(var u=1;u<r;u++){for(var l=h>>>26,c=67108863&h,d=Math.min(u,e.length-1),f=Math.max(0,u-t.length+1);f<=d;f++){var p=u-f|0;l+=(o=(n=0|t.words[p])*(s=0|e.words[f])+c)/67108864|0,c=67108863&o}i.words[u]=0|c,h=0|l}return 0!==h?i.words[u]=0|h:i.length--,i.strip()}s.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var n=0,s=0,o=0;o<this.length;o++){var a=this.words[o],h=(16777215&(a<<n|s)).toString(16);i=0!=(s=a>>>24-n&16777215)||o!==this.length-1?l[6-h.length]+h+i:h+i,(n+=2)>=26&&(n-=26,o--)}for(0!==s&&(i=s.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var u=c[t],f=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(t);i=(p=p.idivn(f)).isZero()?m+i:l[u-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return r(void 0!==o),this.toArrayLike(o,t,e)},s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,i){var n=this.byteLength(),s=i||Math.max(1,n);r(n<=s,"byte array longer than desired length"),r(s>0,"Requested array length <= 0"),this.strip();var o,a,h="le"===e,u=new t(s),l=this.clone();if(h){for(a=0;!l.isZero();a++)o=l.andln(255),l.iushrn(8),u[a]=o;for(;a<s;a++)u[a]=0}else{for(a=0;a<s-n;a++)u[a]=0;for(a=0;!l.isZero();a++)o=l.andln(255),l.iushrn(8),u[s-a-1]=o}return u},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var i=this._zeroBits(this.words[e]);if(t+=i,26!==i)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},s.prototype.ior=function(t){return r(0==(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=e.length,this.strip()},s.prototype.iand=function(t){return r(0==(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;r<i.length;r++)this.words[r]=e.words[r]^i.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},s.prototype.ixor=function(t){return r(0==(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},s.prototype.iadd=function(t){var e,i,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0,s=0;s<r.length;s++)e=(0|i.words[s])+(0|r.words[s])+n,this.words[s]=67108863&e,n=e>>>26;for(;0!==n&&s<i.length;s++)e=(0|i.words[s])+n,this.words[s]=67108863&e,n=e>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var s=0,o=0;o<r.length;o++)s=(e=(0|i.words[o])-(0|r.words[o])+s)>>26,this.words[o]=67108863&e;for(;0!==s&&o<i.length;o++)s=(e=(0|i.words[o])+s)>>26,this.words[o]=67108863&e;if(0===s&&o<i.length&&i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this.length=Math.max(this.length,o),i!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,i){var r,n,s,o=t.words,a=e.words,h=i.words,u=0,l=0|o[0],c=8191&l,d=l>>>13,f=0|o[1],p=8191&f,m=f>>>13,g=0|o[2],b=8191&g,v=g>>>13,y=0|o[3],w=8191&y,_=y>>>13,M=0|o[4],k=8191&M,x=M>>>13,E=0|o[5],S=8191&E,T=E>>>13,A=0|o[6],I=8191&A,C=A>>>13,B=0|o[7],R=8191&B,P=B>>>13,L=0|o[8],O=8191&L,D=L>>>13,N=0|o[9],j=8191&N,U=N>>>13,F=0|a[0],q=8191&F,z=F>>>13,H=0|a[1],W=8191&H,$=H>>>13,Z=0|a[2],V=8191&Z,K=Z>>>13,G=0|a[3],J=8191&G,Y=G>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],it=8191&et,rt=et>>>13,nt=0|a[6],st=8191&nt,ot=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,lt=0|a[8],ct=8191<,dt=lt>>>13,ft=0|a[9],pt=8191&ft,mt=ft>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(u+(r=Math.imul(c,q))|0)+((8191&(n=(n=Math.imul(c,z))+Math.imul(d,q)|0))<<13)|0;u=((s=Math.imul(d,z))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(p,q),n=(n=Math.imul(p,z))+Math.imul(m,q)|0,s=Math.imul(m,z);var bt=(u+(r=r+Math.imul(c,W)|0)|0)+((8191&(n=(n=n+Math.imul(c,$)|0)+Math.imul(d,W)|0))<<13)|0;u=((s=s+Math.imul(d,$)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,q),n=(n=Math.imul(b,z))+Math.imul(v,q)|0,s=Math.imul(v,z),r=r+Math.imul(p,W)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(m,W)|0,s=s+Math.imul(m,$)|0;var vt=(u+(r=r+Math.imul(c,V)|0)|0)+((8191&(n=(n=n+Math.imul(c,K)|0)+Math.imul(d,V)|0))<<13)|0;u=((s=s+Math.imul(d,K)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(w,q),n=(n=Math.imul(w,z))+Math.imul(_,q)|0,s=Math.imul(_,z),r=r+Math.imul(b,W)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(v,W)|0,s=s+Math.imul(v,$)|0,r=r+Math.imul(p,V)|0,n=(n=n+Math.imul(p,K)|0)+Math.imul(m,V)|0,s=s+Math.imul(m,K)|0;var yt=(u+(r=r+Math.imul(c,J)|0)|0)+((8191&(n=(n=n+Math.imul(c,Y)|0)+Math.imul(d,J)|0))<<13)|0;u=((s=s+Math.imul(d,Y)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(k,q),n=(n=Math.imul(k,z))+Math.imul(x,q)|0,s=Math.imul(x,z),r=r+Math.imul(w,W)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(_,W)|0,s=s+Math.imul(_,$)|0,r=r+Math.imul(b,V)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(v,V)|0,s=s+Math.imul(v,K)|0,r=r+Math.imul(p,J)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(m,J)|0,s=s+Math.imul(m,Y)|0;var wt=(u+(r=r+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;u=((s=s+Math.imul(d,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(S,q),n=(n=Math.imul(S,z))+Math.imul(T,q)|0,s=Math.imul(T,z),r=r+Math.imul(k,W)|0,n=(n=n+Math.imul(k,$)|0)+Math.imul(x,W)|0,s=s+Math.imul(x,$)|0,r=r+Math.imul(w,V)|0,n=(n=n+Math.imul(w,K)|0)+Math.imul(_,V)|0,s=s+Math.imul(_,K)|0,r=r+Math.imul(b,J)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(v,J)|0,s=s+Math.imul(v,Y)|0,r=r+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,tt)|0;var _t=(u+(r=r+Math.imul(c,it)|0)|0)+((8191&(n=(n=n+Math.imul(c,rt)|0)+Math.imul(d,it)|0))<<13)|0;u=((s=s+Math.imul(d,rt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(I,q),n=(n=Math.imul(I,z))+Math.imul(C,q)|0,s=Math.imul(C,z),r=r+Math.imul(S,W)|0,n=(n=n+Math.imul(S,$)|0)+Math.imul(T,W)|0,s=s+Math.imul(T,$)|0,r=r+Math.imul(k,V)|0,n=(n=n+Math.imul(k,K)|0)+Math.imul(x,V)|0,s=s+Math.imul(x,K)|0,r=r+Math.imul(w,J)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,J)|0,s=s+Math.imul(_,Y)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,Q)|0,s=s+Math.imul(v,tt)|0,r=r+Math.imul(p,it)|0,n=(n=n+Math.imul(p,rt)|0)+Math.imul(m,it)|0,s=s+Math.imul(m,rt)|0;var Mt=(u+(r=r+Math.imul(c,st)|0)|0)+((8191&(n=(n=n+Math.imul(c,ot)|0)+Math.imul(d,st)|0))<<13)|0;u=((s=s+Math.imul(d,ot)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(R,q),n=(n=Math.imul(R,z))+Math.imul(P,q)|0,s=Math.imul(P,z),r=r+Math.imul(I,W)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(C,W)|0,s=s+Math.imul(C,$)|0,r=r+Math.imul(S,V)|0,n=(n=n+Math.imul(S,K)|0)+Math.imul(T,V)|0,s=s+Math.imul(T,K)|0,r=r+Math.imul(k,J)|0,n=(n=n+Math.imul(k,Y)|0)+Math.imul(x,J)|0,s=s+Math.imul(x,Y)|0,r=r+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,tt)|0,r=r+Math.imul(b,it)|0,n=(n=n+Math.imul(b,rt)|0)+Math.imul(v,it)|0,s=s+Math.imul(v,rt)|0,r=r+Math.imul(p,st)|0,n=(n=n+Math.imul(p,ot)|0)+Math.imul(m,st)|0,s=s+Math.imul(m,ot)|0;var kt=(u+(r=r+Math.imul(c,ht)|0)|0)+((8191&(n=(n=n+Math.imul(c,ut)|0)+Math.imul(d,ht)|0))<<13)|0;u=((s=s+Math.imul(d,ut)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(O,q),n=(n=Math.imul(O,z))+Math.imul(D,q)|0,s=Math.imul(D,z),r=r+Math.imul(R,W)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(P,W)|0,s=s+Math.imul(P,$)|0,r=r+Math.imul(I,V)|0,n=(n=n+Math.imul(I,K)|0)+Math.imul(C,V)|0,s=s+Math.imul(C,K)|0,r=r+Math.imul(S,J)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(T,J)|0,s=s+Math.imul(T,Y)|0,r=r+Math.imul(k,Q)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(x,Q)|0,s=s+Math.imul(x,tt)|0,r=r+Math.imul(w,it)|0,n=(n=n+Math.imul(w,rt)|0)+Math.imul(_,it)|0,s=s+Math.imul(_,rt)|0,r=r+Math.imul(b,st)|0,n=(n=n+Math.imul(b,ot)|0)+Math.imul(v,st)|0,s=s+Math.imul(v,ot)|0,r=r+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,s=s+Math.imul(m,ut)|0;var xt=(u+(r=r+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;u=((s=s+Math.imul(d,dt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(j,q),n=(n=Math.imul(j,z))+Math.imul(U,q)|0,s=Math.imul(U,z),r=r+Math.imul(O,W)|0,n=(n=n+Math.imul(O,$)|0)+Math.imul(D,W)|0,s=s+Math.imul(D,$)|0,r=r+Math.imul(R,V)|0,n=(n=n+Math.imul(R,K)|0)+Math.imul(P,V)|0,s=s+Math.imul(P,K)|0,r=r+Math.imul(I,J)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(C,J)|0,s=s+Math.imul(C,Y)|0,r=r+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(T,Q)|0,s=s+Math.imul(T,tt)|0,r=r+Math.imul(k,it)|0,n=(n=n+Math.imul(k,rt)|0)+Math.imul(x,it)|0,s=s+Math.imul(x,rt)|0,r=r+Math.imul(w,st)|0,n=(n=n+Math.imul(w,ot)|0)+Math.imul(_,st)|0,s=s+Math.imul(_,ot)|0,r=r+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(v,ht)|0,s=s+Math.imul(v,ut)|0,r=r+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,dt)|0)+Math.imul(m,ct)|0,s=s+Math.imul(m,dt)|0;var Et=(u+(r=r+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,mt)|0)+Math.imul(d,pt)|0))<<13)|0;u=((s=s+Math.imul(d,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(j,W),n=(n=Math.imul(j,$))+Math.imul(U,W)|0,s=Math.imul(U,$),r=r+Math.imul(O,V)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(D,V)|0,s=s+Math.imul(D,K)|0,r=r+Math.imul(R,J)|0,n=(n=n+Math.imul(R,Y)|0)+Math.imul(P,J)|0,s=s+Math.imul(P,Y)|0,r=r+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,s=s+Math.imul(C,tt)|0,r=r+Math.imul(S,it)|0,n=(n=n+Math.imul(S,rt)|0)+Math.imul(T,it)|0,s=s+Math.imul(T,rt)|0,r=r+Math.imul(k,st)|0,n=(n=n+Math.imul(k,ot)|0)+Math.imul(x,st)|0,s=s+Math.imul(x,ot)|0,r=r+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(_,ht)|0,s=s+Math.imul(_,ut)|0,r=r+Math.imul(b,ct)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(v,ct)|0,s=s+Math.imul(v,dt)|0;var St=(u+(r=r+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((s=s+Math.imul(m,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(j,V),n=(n=Math.imul(j,K))+Math.imul(U,V)|0,s=Math.imul(U,K),r=r+Math.imul(O,J)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(D,J)|0,s=s+Math.imul(D,Y)|0,r=r+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,tt)|0,r=r+Math.imul(I,it)|0,n=(n=n+Math.imul(I,rt)|0)+Math.imul(C,it)|0,s=s+Math.imul(C,rt)|0,r=r+Math.imul(S,st)|0,n=(n=n+Math.imul(S,ot)|0)+Math.imul(T,st)|0,s=s+Math.imul(T,ot)|0,r=r+Math.imul(k,ht)|0,n=(n=n+Math.imul(k,ut)|0)+Math.imul(x,ht)|0,s=s+Math.imul(x,ut)|0,r=r+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,dt)|0)+Math.imul(_,ct)|0,s=s+Math.imul(_,dt)|0;var Tt=(u+(r=r+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,pt)|0))<<13)|0;u=((s=s+Math.imul(v,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(j,J),n=(n=Math.imul(j,Y))+Math.imul(U,J)|0,s=Math.imul(U,Y),r=r+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(D,Q)|0,s=s+Math.imul(D,tt)|0,r=r+Math.imul(R,it)|0,n=(n=n+Math.imul(R,rt)|0)+Math.imul(P,it)|0,s=s+Math.imul(P,rt)|0,r=r+Math.imul(I,st)|0,n=(n=n+Math.imul(I,ot)|0)+Math.imul(C,st)|0,s=s+Math.imul(C,ot)|0,r=r+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(T,ht)|0,s=s+Math.imul(T,ut)|0,r=r+Math.imul(k,ct)|0,n=(n=n+Math.imul(k,dt)|0)+Math.imul(x,ct)|0,s=s+Math.imul(x,dt)|0;var At=(u+(r=r+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((s=s+Math.imul(_,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(j,Q),n=(n=Math.imul(j,tt))+Math.imul(U,Q)|0,s=Math.imul(U,tt),r=r+Math.imul(O,it)|0,n=(n=n+Math.imul(O,rt)|0)+Math.imul(D,it)|0,s=s+Math.imul(D,rt)|0,r=r+Math.imul(R,st)|0,n=(n=n+Math.imul(R,ot)|0)+Math.imul(P,st)|0,s=s+Math.imul(P,ot)|0,r=r+Math.imul(I,ht)|0,n=(n=n+Math.imul(I,ut)|0)+Math.imul(C,ht)|0,s=s+Math.imul(C,ut)|0,r=r+Math.imul(S,ct)|0,n=(n=n+Math.imul(S,dt)|0)+Math.imul(T,ct)|0,s=s+Math.imul(T,dt)|0;var It=(u+(r=r+Math.imul(k,pt)|0)|0)+((8191&(n=(n=n+Math.imul(k,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((s=s+Math.imul(x,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(j,it),n=(n=Math.imul(j,rt))+Math.imul(U,it)|0,s=Math.imul(U,rt),r=r+Math.imul(O,st)|0,n=(n=n+Math.imul(O,ot)|0)+Math.imul(D,st)|0,s=s+Math.imul(D,ot)|0,r=r+Math.imul(R,ht)|0,n=(n=n+Math.imul(R,ut)|0)+Math.imul(P,ht)|0,s=s+Math.imul(P,ut)|0,r=r+Math.imul(I,ct)|0,n=(n=n+Math.imul(I,dt)|0)+Math.imul(C,ct)|0,s=s+Math.imul(C,dt)|0;var Ct=(u+(r=r+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((s=s+Math.imul(T,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(j,st),n=(n=Math.imul(j,ot))+Math.imul(U,st)|0,s=Math.imul(U,ot),r=r+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(D,ht)|0,s=s+Math.imul(D,ut)|0,r=r+Math.imul(R,ct)|0,n=(n=n+Math.imul(R,dt)|0)+Math.imul(P,ct)|0,s=s+Math.imul(P,dt)|0;var Bt=(u+(r=r+Math.imul(I,pt)|0)|0)+((8191&(n=(n=n+Math.imul(I,mt)|0)+Math.imul(C,pt)|0))<<13)|0;u=((s=s+Math.imul(C,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,r=Math.imul(j,ht),n=(n=Math.imul(j,ut))+Math.imul(U,ht)|0,s=Math.imul(U,ut),r=r+Math.imul(O,ct)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(D,ct)|0,s=s+Math.imul(D,dt)|0;var Rt=(u+(r=r+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((s=s+Math.imul(P,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(j,ct),n=(n=Math.imul(j,dt))+Math.imul(U,ct)|0,s=Math.imul(U,dt);var Pt=(u+(r=r+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(D,pt)|0))<<13)|0;u=((s=s+Math.imul(D,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Lt=(u+(r=Math.imul(j,pt))|0)+((8191&(n=(n=Math.imul(j,mt))+Math.imul(U,pt)|0))<<13)|0;return u=((s=Math.imul(U,mt))+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,h[0]=gt,h[1]=bt,h[2]=vt,h[3]=yt,h[4]=wt,h[5]=_t,h[6]=Mt,h[7]=kt,h[8]=xt,h[9]=Et,h[10]=St,h[11]=Tt,h[12]=At,h[13]=It,h[14]=Ct,h[15]=Bt,h[16]=Rt,h[17]=Pt,h[18]=Lt,0!==u&&(h[19]=u,i.length++),i};function m(t,e,i){return(new g).mulp(t,e,i)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=f),s.prototype.mulTo=function(t,e){var i,r=this.length+t.length;return i=10===this.length&&10===t.length?p(this,t,e):r<63?f(this,t,e):r<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,s=0;s<i.length-1;s++){var o=n;n=0;for(var a=67108863&r,h=Math.min(s,e.length-1),u=Math.max(0,s-t.length+1);u<=h;u++){var l=s-u,c=(0|t.words[l])*(0|e.words[u]),d=67108863&c;a=67108863&(d=d+a|0),n+=(o=(o=o+(c/67108864|0)|0)+(d>>>26)|0)>>>26,o&=67108863}i.words[s]=a,r=o,o=n}return 0!==r?i.words[s]=r:i.length--,i.strip()}(this,t,e):m(this,t,e),i},g.prototype.makeRBT=function(t){for(var e=new Array(t),i=s.prototype._countBits(t)-1,r=0;r<t;r++)e[r]=this.revBin(r,i,t);return e},g.prototype.revBin=function(t,e,i){if(0===t||t===i-1)return t;for(var r=0,n=0;n<e;n++)r|=(1&t)<<e-n-1,t>>=1;return r},g.prototype.permute=function(t,e,i,r,n,s){for(var o=0;o<s;o++)r[o]=e[t[o]],n[o]=i[t[o]]},g.prototype.transform=function(t,e,i,r,n,s){this.permute(s,t,e,i,r,n);for(var o=1;o<n;o<<=1)for(var a=o<<1,h=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),l=0;l<n;l+=a)for(var c=h,d=u,f=0;f<o;f++){var p=i[l+f],m=r[l+f],g=i[l+f+o],b=r[l+f+o],v=c*g-d*b;b=c*b+d*g,g=v,i[l+f]=p+g,r[l+f]=m+b,i[l+f+o]=p-g,r[l+f+o]=m-b,f!==a&&(v=h*c-u*d,d=h*d+u*c,c=v)}},g.prototype.guessLen13b=function(t,e){var i=1|Math.max(e,t),r=1&i,n=0;for(i=i/2|0;i;i>>>=1)n++;return 1<<n+1+r},g.prototype.conjugate=function(t,e,i){if(!(i<=1))for(var r=0;r<i/2;r++){var n=t[r];t[r]=t[i-r-1],t[i-r-1]=n,n=e[r],e[r]=-e[i-r-1],e[i-r-1]=-n}},g.prototype.normalize13b=function(t,e){for(var i=0,r=0;r<e/2;r++){var n=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+i;t[r]=67108863&n,i=n<67108864?0:n/67108864|0}return t},g.prototype.convert13b=function(t,e,i,n){for(var s=0,o=0;o<e;o++)s+=0|t[o],i[2*o]=8191&s,s>>>=13,i[2*o+1]=8191&s,s>>>=13;for(o=2*e;o<n;++o)i[o]=0;r(0===s),r(0==(-8192&s))},g.prototype.stub=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=0;return e},g.prototype.mulp=function(t,e,i){var r=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(r),s=this.stub(r),o=new Array(r),a=new Array(r),h=new Array(r),u=new Array(r),l=new Array(r),c=new Array(r),d=i.words;d.length=r,this.convert13b(t.words,t.length,o,r),this.convert13b(e.words,e.length,u,r),this.transform(o,s,a,h,r,n),this.transform(u,s,l,c,r,n);for(var f=0;f<r;f++){var p=a[f]*l[f]-h[f]*c[f];h[f]=a[f]*c[f]+h[f]*l[f],a[f]=p}return this.conjugate(a,h,r),this.transform(a,h,d,s,r,n),this.conjugate(d,s,r),this.normalize13b(d,r),i.negative=t.negative^e.negative,i.length=t.length+e.length,i.strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),m(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){r("number"==typeof t),r(t<67108864);for(var e=0,i=0;i<this.length;i++){var n=(0|this.words[i])*t,s=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=s>>>26,this.words[i]=67108863&s}return 0!==e&&(this.words[i]=e,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i<e.length;i++){var r=i/26|0,n=i%26;e[i]=(t.words[r]&1<<n)>>>n}return e}(t);if(0===e.length)return new s(1);for(var i=this,r=0;r<e.length&&0===e[r];r++,i=i.sqr());if(++r<e.length)for(var n=i.sqr();r<e.length;r++,n=n.sqr())0!==e[r]&&(i=i.mul(n));return i},s.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,i=t%26,n=(t-i)/26,s=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&s,h=(0|this.words[e])-a<<i;this.words[e]=h|o,o=a>>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},s.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,i){var n;r("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<<s,h=i;if(n-=o,n=Math.max(0,n),h){for(var u=0;u<o;u++)h.words[u]=this.words[u];h.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=n);u--){var c=0|this.words[u];this.words[u]=l<<26-s|c>>>s,l=c&a}return h&&0!==l&&(h.words[h.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26,n=1<<e;return!(this.length<=i||!(this.words[i]&n))},s.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return r("number"==typeof t),r(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,i){var n,s,o=t.length+i;this._expand(o);var a=0;for(n=0;n<t.length;n++){s=(0|this.words[n+i])+a;var h=(0|t.words[n])*e;a=((s-=67108863&h)>>26)-(h/67108864|0),this.words[n+i]=67108863&s}for(;n<this.length-i;n++)a=(s=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&s;if(0===a)return this.strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(s=-(0|this.words[n])+a)>>26,this.words[n]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,e){var i=(this.length,t.length),r=this.clone(),n=t,o=0|n.words[n.length-1];0!=(i=26-this._countBits(o))&&(n=n.ushln(i),r.iushln(i),o=0|n.words[n.length-1]);var a,h=r.length-n.length;if("mod"!==e){(a=new s(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=r.clone()._ishlnsubmul(n,1,h);0===l.negative&&(r=l,a&&(a.words[h]=1));for(var c=h-1;c>=0;c--){var d=67108864*(0|r.words[n.length+c])+(0|r.words[n.length+c-1]);for(d=Math.min(d/o|0,67108863),r._ishlnsubmul(n,d,c);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(n,1,c),r.isZero()||(r.negative^=1);a&&(a.words[c]=d)}return a&&a.strip(),r.strip(),"div"!==e&&0!==i&&r.iushrn(i),{div:a||null,mod:r}},s.prototype.divmod=function(t,e,i){return r(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),s=i.cmp(r);return s<0||1===n&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,i=0,n=this.length-1;n>=0;n--)i=(e*i+(0|this.words[n]))%t;return i},s.prototype.idivn=function(t){r(t<=67108863);for(var e=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*e;this.words[i]=n/t|0,e=n%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new s(1),o=new s(0),a=new s(0),h=new s(1),u=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++u;for(var l=i.clone(),c=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(l),h.isub(c)),a.iushrn(1),h.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(a),o.isub(h)):(i.isub(e),a.isub(n),h.isub(o))}return{a,b:h,gcd:i.iushln(u)}},s.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new s(1),a=new s(0),h=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var u=0,l=1;0==(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(h),o.iushrn(1);for(var c=0,d=1;0==(i.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(i.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(a)):(i.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var s=e;e=i,i=s}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var s=n,o=i;0!==s&&o<this.length;o++){var a=0|this.words[o];s=(a+=s)>>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){r<n?e=-1:r>n&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new k(t)},s.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},n(y,v),y.prototype.split=function(t,e){for(var i=4194303,r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var s=t.words[9];for(e.words[e.length++]=s&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(o&i)<<4|s>>>22,s=o}s>>>=22,t.words[n-10]=s,0===s&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i<t.length;i++){var r=0|t.words[i];e+=977*r,t.words[i]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(w,v),n(_,v),n(M,v),M.prototype.imulK=function(t){for(var e=0,i=0;i<t.length;i++){var r=19*(0|t.words[i])+e,n=67108863&r;r>>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return b[t]=e,e},k.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},k.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new s(1)).iushrn(2);return this.pow(t,i)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);r(!n.isZero());var a=new s(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);0!==this.pow(l,u).cmp(h);)l.redIAdd(h);for(var c=this.pow(l,n),d=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),p=o;0!==f.cmp(a);){for(var m=f,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var b=this.pow(c,new s(1).iushln(p-g-1));d=d.redMul(b),c=b.redSqr(),f=f.redMul(c),p=g}return d},k.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},k.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var i=new Array(16);i[0]=new s(1).toRed(this),i[1]=t;for(var r=2;r<i.length;r++)i[r]=this.mul(i[r-1],t);var n=i[0],o=0,a=0,h=e.bitLength()%26;for(0===h&&(h=26),r=e.length-1;r>=0;r--){for(var u=e.words[r],l=h-1;l>=0;l--){var c=u>>l&1;n!==i[0]&&(n=this.sqr(n)),0!==c||0!==o?(o<<=1,o|=c,(4==++a||0===r&&0===l)&&(n=this.mul(n,i[o]),a=0,o=0)):a=0}h=26}return n},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new x(t)},n(x,k),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var i=t.mul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=i.nmd(t),this)},3482:(t,e,i)=>{"use strict";var r=i(5717),n=i(2318),s=i(9785),o=i(9072),a=i(1027);function h(t){a.call(this,"digest"),this._hash=t}r(h,a),h.prototype._update=function(t){this._hash.update(t)},h.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new n:"rmd160"===t||"ripemd160"===t?new s:new h(o(t))}},8028:(t,e,i)=>{var r=i(2318);t.exports=function(t){return(new r).update(t).digest()}},8355:(t,e,i)=>{"use strict";var r=i(5717),n=i(1031),s=i(1027),o=i(9509).Buffer,a=i(8028),h=i(9785),u=i(9072),l=o.alloc(128);function c(t,e){s.call(this,"digest"),"string"==typeof e&&(e=o.from(e));var i="sha512"===t||"sha384"===t?128:64;this._alg=t,this._key=e,e.length>i?e=("rmd160"===t?new h:u(t)).update(e).digest():e.length<i&&(e=o.concat([e,l],i));for(var r=this._ipad=o.allocUnsafe(i),n=this._opad=o.allocUnsafe(i),a=0;a<i;a++)r[a]=54^e[a],n[a]=92^e[a];this._hash="rmd160"===t?new h:u(t),this._hash.update(r)}r(c,s),c.prototype._update=function(t){this._hash.update(t)},c.prototype._final=function(){var t=this._hash.digest();return("rmd160"===this._alg?new h:u(this._alg)).update(this._opad).update(t).digest()},t.exports=function(t,e){return"rmd160"===(t=t.toLowerCase())||"ripemd160"===t?new c("rmd160",e):"md5"===t?new n(a,e):new c(t,e)}},1031:(t,e,i)=>{"use strict";var r=i(5717),n=i(9509).Buffer,s=i(1027),o=n.alloc(128),a=64;function h(t,e){s.call(this,"digest"),"string"==typeof e&&(e=n.from(e)),this._alg=t,this._key=e,e.length>a?e=t(e):e.length<a&&(e=n.concat([e,o],a));for(var i=this._ipad=n.allocUnsafe(a),r=this._opad=n.allocUnsafe(a),h=0;h<a;h++)i[h]=54^e[h],r[h]=92^e[h];this._hash=[i]}r(h,s),h.prototype._update=function(t){this._hash.push(t)},h.prototype._final=function(){var t=this._alg(n.concat(this._hash));return this._alg(n.concat([this._opad,t]))},t.exports=h},3202:(t,e,i)=>{var r=i(8764).Buffer;const n=i(5799),s=i(9e3),o=i(3786),a=i(6470),h=i(452),u=i(970),l=i(1351),c=i(5673),d=i(778),f=i(4595),p=i(4375),m=i(4159),g=i(8473),b=i(2528);function v(t,e,i){if("undefined"!=typeof FileList&&t instanceof FileList&&(t=Array.from(t)),Array.isArray(t)||(t=[t]),0===t.length)throw new Error("invalid input type");t.forEach((t=>{if(null==t)throw new Error(`invalid input type: ${t}`)})),1!==(t=t.map((t=>_(t)&&"string"==typeof t.path&&"function"==typeof b?t.path:t))).length||"string"==typeof t[0]||t[0].name||(t[0].name=e.name);let n=null;t.forEach(((e,i)=>{if("string"==typeof e)return;let r=e.fullPath||e.name;r||(r=`Unknown File ${i+1}`,e.unknownName=!0),e.path=r.split("/"),e.path[0]||e.path.shift(),e.path.length<2?n=null:0===i&&t.length>1?n=e.path[0]:e.path[0]!==n&&(n=null)})),(void 0===e.filterJunkFiles||e.filterJunkFiles)&&(t=t.filter((t=>"string"==typeof t||!y(t.path)))),n&&t.forEach((t=>{const e=(r.isBuffer(t)||M(t))&&!t.path;"string"==typeof t||e||t.path.shift()})),!e.name&&n&&(e.name=n),e.name||t.some((t=>"string"==typeof t?(e.name=a.basename(t),!0):!t.unknownName&&(e.name=t.path[t.path.length-1],!0))),e.name||(e.name=`Unnamed Torrent ${Date.now()}`);const s=t.reduce(((t,e)=>t+Number("string"==typeof e)),0);let o=1===t.length;if(1===t.length&&"string"==typeof t[0]){if("function"!=typeof b)throw new Error("filesystem paths do not work in the browser");u(t[0],((t,e)=>{if(t)return i(t);o=e,l()}))}else p(l);function l(){f(t.map((t=>e=>{const i={};if(_(t))i.getStream=function(t){return()=>new h(t)}(t),i.length=t.size;else if(r.isBuffer(t))i.getStream=(n=t,()=>{const t=new g.PassThrough;return t.end(n),t}),i.length=t.length;else{if(!M(t)){if("string"==typeof t){if("function"!=typeof b)throw new Error("filesystem paths do not work in the browser");return void b(t,s>1||o,e)}throw new Error("invalid input type")}i.getStream=function(t,e){return()=>{const i=new g.Transform;return i._transform=function(t,i,r){e.length+=t.length,this.push(t),r()},t.pipe(i),i}}(t,i),i.length=0}var n;i.path=t.path,e(null,i)})),((t,e)=>{if(t)return i(t);e=e.flat(),i(null,e,o)}))}}function y(t){const e=t[t.length-1];return"."===e[0]&&l.is(e)}function w(t,e){return t+e.length}function _(t){return"undefined"!=typeof Blob&&t instanceof Blob}function M(t){return"object"==typeof t&&null!=t&&"function"==typeof t.pipe}t.exports=function(e,i,a){"function"==typeof i&&([i,a]=[a,i]),v(e,i=i?Object.assign({},i):{},((e,h,u)=>{if(e)return a(e);i.singleFileTorrent=u,function(e,i,a){let h=i.announceList;h||("string"==typeof i.announce?h=[[i.announce]]:Array.isArray(i.announce)&&(h=i.announce.map((t=>[t])))),h||(h=[]),globalThis.WEBTORRENT_ANNOUNCE&&("string"==typeof globalThis.WEBTORRENT_ANNOUNCE?h.push([[globalThis.WEBTORRENT_ANNOUNCE]]):Array.isArray(globalThis.WEBTORRENT_ANNOUNCE)&&(h=h.concat(globalThis.WEBTORRENT_ANNOUNCE.map((t=>[t]))))),void 0===i.announce&&void 0===i.announceList&&(h=h.concat(t.exports.announceList)),"string"==typeof i.urlList&&(i.urlList=[i.urlList]);const u={info:{name:i.name},"creation date":Math.ceil((Number(i.creationDate)||Date.now())/1e3),encoding:"UTF-8"};0!==h.length&&(u.announce=h[0][0],u["announce-list"]=h),void 0!==i.comment&&(u.comment=i.comment),void 0!==i.createdBy&&(u["created by"]=i.createdBy),void 0!==i.private&&(u.info.private=Number(i.private)),void 0!==i.info&&Object.assign(u.info,i.info),void 0!==i.sslCert&&(u.info["ssl-cert"]=i.sslCert),void 0!==i.urlList&&(u["url-list"]=i.urlList);const l=e.reduce(w,0),f=i.pieceLength||o(l);u.info["piece length"]=f,function(t,e,i,n,o){o=d(o);const a=[];let h=0,u=0;const l=t.map((t=>t.getStream));let f=0,p=0,g=!1;const b=new c(l),v=new s(e,{zeroPadding:!1});function y(t){h+=t.length;const e=p;m(t,(r=>{a[e]=r,f-=1,f<5&&v.resume(),u+=t.length,n.onProgress&&n.onProgress(u,i),k()})),f+=1,f>=5&&v.pause(),p+=1}function w(){g=!0,k()}function _(t){M(),o(t)}function M(){b.removeListener("error",_),v.removeListener("data",y),v.removeListener("end",w),v.removeListener("error",_)}function k(){g&&0===f&&(M(),o(null,r.from(a.join(""),"hex"),h))}b.on("error",_),b.pipe(v).on("data",y).on("end",w).on("error",_)}(e,f,l,i,((t,r,s)=>{if(t)return a(t);u.info.pieces=r,e.forEach((t=>{delete t.getStream})),i.singleFileTorrent?u.info.length=s:u.info.files=e,a(null,n.encode(u))}))}(h,i,a)}))},t.exports.parseInput=function(t,e,i){"function"==typeof e&&([e,i]=[i,e]),v(t,e=e?Object.assign({},e):{},i)},t.exports.announceList=[["udp://tracker.leechers-paradise.org:6969"],["udp://tracker.coppersurfer.tk:6969"],["udp://tracker.opentrackr.org:1337"],["udp://explodie.org:6969"],["udp://tracker.empire-js.us:1337"],["wss://tracker.btorrent.xyz"],["wss://tracker.openwebtorrent.com"]],t.exports.isJunkPath=y},5835:(t,e,i)=>{"use strict";e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=i(1798),e.createHash=e.Hash=i(3482),e.createHmac=e.Hmac=i(8355);var r=i(6042),n=Object.keys(r),s=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(n);e.getHashes=function(){return s};var o=i(5632);e.pbkdf2=o.pbkdf2,e.pbkdf2Sync=o.pbkdf2Sync;var a=i(3614);e.Cipher=a.Cipher,e.createCipher=a.createCipher,e.Cipheriv=a.Cipheriv,e.createCipheriv=a.createCipheriv,e.Decipher=a.Decipher,e.createDecipher=a.createDecipher,e.Decipheriv=a.Decipheriv,e.createDecipheriv=a.createDecipheriv,e.getCiphers=a.getCiphers,e.listCiphers=a.listCiphers;var h=i(2607);e.DiffieHellmanGroup=h.DiffieHellmanGroup,e.createDiffieHellmanGroup=h.createDiffieHellmanGroup,e.getDiffieHellman=h.getDiffieHellman,e.createDiffieHellman=h.createDiffieHellman,e.DiffieHellman=h.DiffieHellman;var u=i(4743);e.createSign=u.createSign,e.Sign=u.Sign,e.createVerify=u.createVerify,e.Verify=u.Verify,e.createECDH=i(6393);var l=i(7900);e.publicEncrypt=l.publicEncrypt,e.privateEncrypt=l.privateEncrypt,e.publicDecrypt=l.publicDecrypt,e.privateDecrypt=l.privateDecrypt;var c=i(7963);e.randomFill=c.randomFill,e.randomFillSync=c.randomFillSync,e.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},1227:(t,e,i)=>{var r=i(5108),n=i(9590);e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const i="color: "+this.color;e.splice(1,0,i,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(r++,"%c"===t&&(n=r))})),e.splice(n,0,i)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}return!t&&void 0!==n&&"env"in n&&(t=n.env.DEBUG),t},e.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,r.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.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"],e.log=r.debug||r.log||(()=>{}),t.exports=i(2447)(e);const{formatters:s}=t.exports;s.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},2447:(t,e,i)=>{var r=i(5108);t.exports=function(t){function e(t){let i,r,s,o=null;function a(...t){if(!a.enabled)return;const r=a,n=Number(new Date),s=n-(i||n);r.diff=s,r.prev=i,r.curr=n,i=n,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let o=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((i,n)=>{if("%%"===i)return"%";o++;const s=e.formatters[n];if("function"==typeof s){const e=t[o];i=s.call(r,e),t.splice(o,1),o--}return i})),e.formatArgs.call(r,t),(r.log||e.log).apply(r,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=n,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(r!==e.namespaces&&(r=e.namespaces,s=e.enabled(t)),s),set:t=>{o=t}}),"function"==typeof e.init&&e.init(a),a}function n(t,i){const r=e(this.namespace+(void 0===i?":":i)+t);return r.log=this.log,r}function s(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){const t=[...e.names.map(s),...e.skips.map(s).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let i;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const r=("string"==typeof t?t:"").split(/[\s,]+/),n=r.length;for(i=0;i<n;i++)r[i]&&("-"===(t=r[i].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let i,r;for(i=0,r=e.skips.length;i<r;i++)if(e.skips[i].test(t))return!1;for(i=0,r=e.names.length;i<r;i++)if(e.names[i].test(t))return!0;return!1},e.humanize=i(7824),e.destroy=function(){r.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((i=>{e[i]=t[i]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let i=0;for(let e=0;e<t.length;e++)i=(i<<5)-i+t.charCodeAt(e),i|=0;return e.colors[Math.abs(i)%e.colors.length]},e.enable(e.load()),e}},4289:(t,e,i)=>{"use strict";var r=i(2215),n="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),s=Object.prototype.toString,o=Array.prototype.concat,a=Object.defineProperty,h=a&&function(){var t={};try{for(var e in a(t,"x",{enumerable:!1,value:t}),t)return!1;return t.x===t}catch(t){return!1}}(),u=function(t,e,i,r){var n;(!(e in t)||"function"==typeof(n=r)&&"[object Function]"===s.call(n)&&r())&&(h?a(t,e,{configurable:!0,enumerable:!1,value:i,writable:!0}):t[e]=i)},l=function(t,e){var i=arguments.length>2?arguments[2]:{},s=r(e);n&&(s=o.call(s,Object.getOwnPropertySymbols(e)));for(var a=0;a<s.length;a+=1)u(t,s[a],e[s[a]],i[s[a]])};l.supportsDescriptors=!!h,t.exports=l},5251:(t,e,i)=>{"use strict";e.utils=i(1278),e.Cipher=i(5756),e.DES=i(327),e.CBC=i(9051),e.EDE=i(651)},9051:(t,e,i)=>{"use strict";var r=i(9746),n=i(5717),s={};function o(t){r.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=t[e]}e.instantiate=function(t){function e(e){t.call(this,e),this._cbcInit()}n(e,t);for(var i=Object.keys(s),r=0;r<i.length;r++){var o=i[r];e.prototype[o]=s[o]}return e.create=function(t){return new e(t)},e},s._cbcInit=function(){var t=new o(this.options.iv);this._cbcState=t},s._update=function(t,e,i,r){var n=this._cbcState,s=this.constructor.super_.prototype,o=n.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)o[a]^=t[e+a];for(s._update.call(this,o,0,i,r),a=0;a<this.blockSize;a++)o[a]=i[r+a]}else{for(s._update.call(this,t,e,i,r),a=0;a<this.blockSize;a++)i[r+a]^=o[a];for(a=0;a<this.blockSize;a++)o[a]=t[e+a]}}},5756:(t,e,i)=>{"use strict";var r=i(9746);function n(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}t.exports=n,n.prototype._init=function(){},n.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},n.prototype._buffer=function(t,e){for(var i=Math.min(this.buffer.length-this.bufferOff,t.length-e),r=0;r<i;r++)this.buffer[this.bufferOff+r]=t[e+r];return this.bufferOff+=i,i},n.prototype._flushBuffer=function(t,e){return this._update(this.buffer,0,t,e),this.bufferOff=0,this.blockSize},n.prototype._updateEncrypt=function(t){var e=0,i=0,r=(this.bufferOff+t.length)/this.blockSize|0,n=new Array(r*this.blockSize);0!==this.bufferOff&&(e+=this._buffer(t,e),this.bufferOff===this.buffer.length&&(i+=this._flushBuffer(n,i)));for(var s=t.length-(t.length-e)%this.blockSize;e<s;e+=this.blockSize)this._update(t,e,n,i),i+=this.blockSize;for(;e<t.length;e++,this.bufferOff++)this.buffer[this.bufferOff]=t[e];return n},n.prototype._updateDecrypt=function(t){for(var e=0,i=0,r=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,n=new Array(r*this.blockSize);r>0;r--)e+=this._buffer(t,e),i+=this._flushBuffer(n,i);return e+=this._buffer(t,e),n},n.prototype.final=function(t){var e,i;return t&&(e=this.update(t)),i="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(i):i},n.prototype._pad=function(t,e){if(0===e)return!1;for(;e<t.length;)t[e++]=0;return!0},n.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var t=new Array(this.blockSize);return this._update(this.buffer,0,t,0),t},n.prototype._unpad=function(t){return t},n.prototype._finalDecrypt=function(){r.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)}},327:(t,e,i)=>{"use strict";var r=i(9746),n=i(5717),s=i(1278),o=i(5756);function a(){this.tmp=new Array(2),this.keys=null}function h(t){o.call(this,t);var e=new a;this._desState=e,this.deriveKeys(e,t.key)}n(h,o),t.exports=h,h.create=function(t){return new h(t)};var u=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];h.prototype.deriveKeys=function(t,e){t.keys=new Array(32),r.equal(e.length,this.blockSize,"Invalid key length");var i=s.readUInt32BE(e,0),n=s.readUInt32BE(e,4);s.pc1(i,n,t.tmp,0),i=t.tmp[0],n=t.tmp[1];for(var o=0;o<t.keys.length;o+=2){var a=u[o>>>1];i=s.r28shl(i,a),n=s.r28shl(n,a),s.pc2(i,n,t.keys,o)}},h.prototype._update=function(t,e,i,r){var n=this._desState,o=s.readUInt32BE(t,e),a=s.readUInt32BE(t,e+4);s.ip(o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],"encrypt"===this.type?this._encrypt(n,o,a,n.tmp,0):this._decrypt(n,o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],s.writeUInt32BE(i,o,r),s.writeUInt32BE(i,a,r+4)},h.prototype._pad=function(t,e){for(var i=t.length-e,r=e;r<t.length;r++)t[r]=i;return!0},h.prototype._unpad=function(t){for(var e=t[t.length-1],i=t.length-e;i<t.length;i++)r.equal(t[i],e);return t.slice(0,t.length-e)},h.prototype._encrypt=function(t,e,i,r,n){for(var o=e,a=i,h=0;h<t.keys.length;h+=2){var u=t.keys[h],l=t.keys[h+1];s.expand(a,t.tmp,0),u^=t.tmp[0],l^=t.tmp[1];var c=s.substitute(u,l),d=a;a=(o^s.permute(c))>>>0,o=d}s.rip(a,o,r,n)},h.prototype._decrypt=function(t,e,i,r,n){for(var o=i,a=e,h=t.keys.length-2;h>=0;h-=2){var u=t.keys[h],l=t.keys[h+1];s.expand(o,t.tmp,0),u^=t.tmp[0],l^=t.tmp[1];var c=s.substitute(u,l),d=o;o=(a^s.permute(c))>>>0,a=d}s.rip(o,a,r,n)}},651:(t,e,i)=>{"use strict";var r=i(9746),n=i(5717),s=i(5756),o=i(327);function a(t,e){r.equal(e.length,24,"Invalid key length");var i=e.slice(0,8),n=e.slice(8,16),s=e.slice(16,24);this.ciphers="encrypt"===t?[o.create({type:"encrypt",key:i}),o.create({type:"decrypt",key:n}),o.create({type:"encrypt",key:s})]:[o.create({type:"decrypt",key:s}),o.create({type:"encrypt",key:n}),o.create({type:"decrypt",key:i})]}function h(t){s.call(this,t);var e=new a(this.type,this.options.key);this._edeState=e}n(h,s),t.exports=h,h.create=function(t){return new h(t)},h.prototype._update=function(t,e,i,r){var n=this._edeState;n.ciphers[0]._update(t,e,i,r),n.ciphers[1]._update(i,r,i,r),n.ciphers[2]._update(i,r,i,r)},h.prototype._pad=o.prototype._pad,h.prototype._unpad=o.prototype._unpad},1278:(t,e)=>{"use strict";e.readUInt32BE=function(t,e){return(t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e])>>>0},e.writeUInt32BE=function(t,e,i){t[0+i]=e>>>24,t[1+i]=e>>>16&255,t[2+i]=e>>>8&255,t[3+i]=255&e},e.ip=function(t,e,i,r){for(var n=0,s=0,o=6;o>=0;o-=2){for(var a=0;a<=24;a+=8)n<<=1,n|=e>>>a+o&1;for(a=0;a<=24;a+=8)n<<=1,n|=t>>>a+o&1}for(o=6;o>=0;o-=2){for(a=1;a<=25;a+=8)s<<=1,s|=e>>>a+o&1;for(a=1;a<=25;a+=8)s<<=1,s|=t>>>a+o&1}i[r+0]=n>>>0,i[r+1]=s>>>0},e.rip=function(t,e,i,r){for(var n=0,s=0,o=0;o<4;o++)for(var a=24;a>=0;a-=8)n<<=1,n|=e>>>a+o&1,n<<=1,n|=t>>>a+o&1;for(o=4;o<8;o++)for(a=24;a>=0;a-=8)s<<=1,s|=e>>>a+o&1,s<<=1,s|=t>>>a+o&1;i[r+0]=n>>>0,i[r+1]=s>>>0},e.pc1=function(t,e,i,r){for(var n=0,s=0,o=7;o>=5;o--){for(var a=0;a<=24;a+=8)n<<=1,n|=e>>a+o&1;for(a=0;a<=24;a+=8)n<<=1,n|=t>>a+o&1}for(a=0;a<=24;a+=8)n<<=1,n|=e>>a+o&1;for(o=1;o<=3;o++){for(a=0;a<=24;a+=8)s<<=1,s|=e>>a+o&1;for(a=0;a<=24;a+=8)s<<=1,s|=t>>a+o&1}for(a=0;a<=24;a+=8)s<<=1,s|=t>>a+o&1;i[r+0]=n>>>0,i[r+1]=s>>>0},e.r28shl=function(t,e){return t<<e&268435455|t>>>28-e};var i=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];e.pc2=function(t,e,r,n){for(var s=0,o=0,a=i.length>>>1,h=0;h<a;h++)s<<=1,s|=t>>>i[h]&1;for(h=a;h<i.length;h++)o<<=1,o|=e>>>i[h]&1;r[n+0]=s>>>0,r[n+1]=o>>>0},e.expand=function(t,e,i){var r=0,n=0;r=(1&t)<<5|t>>>27;for(var s=23;s>=15;s-=4)r<<=6,r|=t>>>s&63;for(s=11;s>=3;s-=4)n|=t>>>s&63,n<<=6;n|=(31&t)<<1|t>>>31,e[i+0]=r>>>0,e[i+1]=n>>>0};var r=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];e.substitute=function(t,e){for(var i=0,n=0;n<4;n++)i<<=4,i|=r[64*n+(t>>>18-6*n&63)];for(n=0;n<4;n++)i<<=4,i|=r[256+64*n+(e>>>18-6*n&63)];return i>>>0};var n=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];e.permute=function(t){for(var e=0,i=0;i<n.length;i++)e<<=1,e|=t>>>n[i]&1;return e>>>0},e.padSplit=function(t,e,i){for(var r=t.toString(2);r.length<e;)r="0"+r;for(var n=[],s=0;s<e;s+=i)n.push(r.slice(s,s+i));return n.join(" ")}},2607:(t,e,i)=>{var r=i(8764).Buffer,n=i(3590),s=i(9799),o=i(7426),a={binary:!0,hex:!0,base64:!0};e.DiffieHellmanGroup=e.createDiffieHellmanGroup=e.getDiffieHellman=function(t){var e=new r(s[t].prime,"hex"),i=new r(s[t].gen,"hex");return new o(e,i)},e.createDiffieHellman=e.DiffieHellman=function t(e,i,s,h){return r.isBuffer(i)||void 0===a[i]?t(e,"binary",i,s):(i=i||"binary",h=h||"binary",s=s||new r([2]),r.isBuffer(s)||(s=new r(s,h)),"number"==typeof e?new o(n(e,s),s,!0):(r.isBuffer(e)||(e=new r(e,i)),new o(e,s,!0)))}},7426:(t,e,i)=>{var r=i(8764).Buffer,n=i(3620),s=new(i(3047)),o=new n(24),a=new n(11),h=new n(10),u=new n(3),l=new n(7),c=i(3590),d=i(1798);function f(t,e){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),this._pub=new n(t),this}function p(t,e){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),this._priv=new n(t),this}t.exports=g;var m={};function g(t,e,i){this.setGenerator(e),this.__prime=new n(t),this._prime=n.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,i?(this.setPublicKey=f,this.setPrivateKey=p):this._primeCode=8}function b(t,e){var i=new r(t.toArray());return e?i.toString(e):i}Object.defineProperty(g.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(t,e){var i=e.toString("hex"),r=[i,t.toString(16)].join("_");if(r in m)return m[r];var n,d=0;if(t.isEven()||!c.simpleSieve||!c.fermatTest(t)||!s.test(t))return d+=1,d+="02"===i||"05"===i?8:4,m[r]=d,d;switch(s.test(t.shrn(1))||(d+=2),i){case"02":t.mod(o).cmp(a)&&(d+=8);break;case"05":(n=t.mod(h)).cmp(u)&&n.cmp(l)&&(d+=8);break;default:d+=4}return m[r]=d,d}(this.__prime,this.__gen)),this._primeCode}}),g.prototype.generateKeys=function(){return this._priv||(this._priv=new n(d(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},g.prototype.computeSecret=function(t){var e=(t=(t=new n(t)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new r(e.toArray()),s=this.getPrime();if(i.length<s.length){var o=new r(s.length-i.length);o.fill(0),i=r.concat([o,i])}return i},g.prototype.getPublicKey=function(t){return b(this._pub,t)},g.prototype.getPrivateKey=function(t){return b(this._priv,t)},g.prototype.getPrime=function(t){return b(this.__prime,t)},g.prototype.getGenerator=function(t){return b(this._gen,t)},g.prototype.setGenerator=function(t,e){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),this.__gen=t,this._gen=new n(t),this}},3590:(t,e,i)=>{var r=i(1798);t.exports=v,v.simpleSieve=g,v.fermatTest=b;var n=i(3620),s=new n(24),o=new(i(3047)),a=new n(1),h=new n(2),u=new n(5),l=(new n(16),new n(8),new n(10)),c=new n(3),d=(new n(7),new n(11)),f=new n(4),p=(new n(12),null);function m(){if(null!==p)return p;var t=[];t[0]=2;for(var e=1,i=3;i<1048576;i+=2){for(var r=Math.ceil(Math.sqrt(i)),n=0;n<e&&t[n]<=r&&i%t[n]!=0;n++);e!==n&&t[n]<=r||(t[e++]=i)}return p=t,t}function g(t){for(var e=m(),i=0;i<e.length;i++)if(0===t.modn(e[i]))return 0===t.cmpn(e[i]);return!0}function b(t){var e=n.mont(t);return 0===h.toRed(e).redPow(t.subn(1)).fromRed().cmpn(1)}function v(t,e){if(t<16)return new n(2===e||5===e?[140,123]:[140,39]);var i,p;for(e=new n(e);;){for(i=new n(r(Math.ceil(t/8)));i.bitLength()>t;)i.ishrn(1);if(i.isEven()&&i.iadd(a),i.testn(1)||i.iadd(h),e.cmp(h)){if(!e.cmp(u))for(;i.mod(l).cmp(c);)i.iadd(f)}else for(;i.mod(s).cmp(d);)i.iadd(f);if(g(p=i.shrn(1))&&g(i)&&b(p)&&b(i)&&o.test(p)&&o.test(i))return i}}},3620:function(t,e,i){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function s(t,e,i){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var o;"object"==typeof t?t.exports=s:e.BN=s,s.BN=s,s.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:i(7748).Buffer}catch(t){}function a(t,e){var i=t.charCodeAt(e);return i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function h(t,e,i){var r=a(t,i);return i-1>=e&&(r|=a(t,i-1)<<4),r}function u(t,e,i,r){for(var n=0,s=Math.min(t.length,i),o=e;o<s;o++){var a=t.charCodeAt(o)-48;n*=r,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}s.isBN=function(t){return t instanceof s||null!==t&&"object"==typeof t&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===e?this._parseHex(t,n,i):(this._parseBase(t,e,n),"le"===i&&this._initArray(this.toArray(),e,i)))},s.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},s.prototype._initArray=function(t,e,i){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var s,o,a=0;if("be"===i)for(n=t.length-1,s=0;n>=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===i)for(n=0,s=0;n<t.length;n+=3)o=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(t,e,i){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,s=0,o=0;if("be"===i)for(r=t.length-1;r>=e;r-=2)n=h(t,e,r)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(r=(t.length-e)%2==0?e+1:e;r<t.length;r+=2)n=h(t,e,r)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this.strip()},s.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var s=t.length-i,o=s%r,a=Math.min(s,s-o)+i,h=0,l=i;l<a;l+=r)h=u(t,l,l+r,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==o){var c=1;for(h=u(t,l,t.length,e),l=0;l<o;l++)c*=e;this.imuln(c),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this.strip()},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],s=0|e.words[0],o=n*s,a=67108863&o,h=o/67108864|0;i.words[0]=a;for(var u=1;u<r;u++){for(var l=h>>>26,c=67108863&h,d=Math.min(u,e.length-1),f=Math.max(0,u-t.length+1);f<=d;f++){var p=u-f|0;l+=(o=(n=0|t.words[p])*(s=0|e.words[f])+c)/67108864|0,c=67108863&o}i.words[u]=0|c,h=0|l}return 0!==h?i.words[u]=0|h:i.length--,i.strip()}s.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var n=0,s=0,o=0;o<this.length;o++){var a=this.words[o],h=(16777215&(a<<n|s)).toString(16);i=0!=(s=a>>>24-n&16777215)||o!==this.length-1?l[6-h.length]+h+i:h+i,(n+=2)>=26&&(n-=26,o--)}for(0!==s&&(i=s.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var u=c[t],f=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(t);i=(p=p.idivn(f)).isZero()?m+i:l[u-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return r(void 0!==o),this.toArrayLike(o,t,e)},s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,i){var n=this.byteLength(),s=i||Math.max(1,n);r(n<=s,"byte array longer than desired length"),r(s>0,"Requested array length <= 0"),this.strip();var o,a,h="le"===e,u=new t(s),l=this.clone();if(h){for(a=0;!l.isZero();a++)o=l.andln(255),l.iushrn(8),u[a]=o;for(;a<s;a++)u[a]=0}else{for(a=0;a<s-n;a++)u[a]=0;for(a=0;!l.isZero();a++)o=l.andln(255),l.iushrn(8),u[s-a-1]=o}return u},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var i=this._zeroBits(this.words[e]);if(t+=i,26!==i)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},s.prototype.ior=function(t){return r(0==(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=e.length,this.strip()},s.prototype.iand=function(t){return r(0==(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;r<i.length;r++)this.words[r]=e.words[r]^i.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},s.prototype.ixor=function(t){return r(0==(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},s.prototype.iadd=function(t){var e,i,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0,s=0;s<r.length;s++)e=(0|i.words[s])+(0|r.words[s])+n,this.words[s]=67108863&e,n=e>>>26;for(;0!==n&&s<i.length;s++)e=(0|i.words[s])+n,this.words[s]=67108863&e,n=e>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var s=0,o=0;o<r.length;o++)s=(e=(0|i.words[o])-(0|r.words[o])+s)>>26,this.words[o]=67108863&e;for(;0!==s&&o<i.length;o++)s=(e=(0|i.words[o])+s)>>26,this.words[o]=67108863&e;if(0===s&&o<i.length&&i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this.length=Math.max(this.length,o),i!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,i){var r,n,s,o=t.words,a=e.words,h=i.words,u=0,l=0|o[0],c=8191&l,d=l>>>13,f=0|o[1],p=8191&f,m=f>>>13,g=0|o[2],b=8191&g,v=g>>>13,y=0|o[3],w=8191&y,_=y>>>13,M=0|o[4],k=8191&M,x=M>>>13,E=0|o[5],S=8191&E,T=E>>>13,A=0|o[6],I=8191&A,C=A>>>13,B=0|o[7],R=8191&B,P=B>>>13,L=0|o[8],O=8191&L,D=L>>>13,N=0|o[9],j=8191&N,U=N>>>13,F=0|a[0],q=8191&F,z=F>>>13,H=0|a[1],W=8191&H,$=H>>>13,Z=0|a[2],V=8191&Z,K=Z>>>13,G=0|a[3],J=8191&G,Y=G>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],it=8191&et,rt=et>>>13,nt=0|a[6],st=8191&nt,ot=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,lt=0|a[8],ct=8191<,dt=lt>>>13,ft=0|a[9],pt=8191&ft,mt=ft>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(u+(r=Math.imul(c,q))|0)+((8191&(n=(n=Math.imul(c,z))+Math.imul(d,q)|0))<<13)|0;u=((s=Math.imul(d,z))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(p,q),n=(n=Math.imul(p,z))+Math.imul(m,q)|0,s=Math.imul(m,z);var bt=(u+(r=r+Math.imul(c,W)|0)|0)+((8191&(n=(n=n+Math.imul(c,$)|0)+Math.imul(d,W)|0))<<13)|0;u=((s=s+Math.imul(d,$)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,q),n=(n=Math.imul(b,z))+Math.imul(v,q)|0,s=Math.imul(v,z),r=r+Math.imul(p,W)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(m,W)|0,s=s+Math.imul(m,$)|0;var vt=(u+(r=r+Math.imul(c,V)|0)|0)+((8191&(n=(n=n+Math.imul(c,K)|0)+Math.imul(d,V)|0))<<13)|0;u=((s=s+Math.imul(d,K)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(w,q),n=(n=Math.imul(w,z))+Math.imul(_,q)|0,s=Math.imul(_,z),r=r+Math.imul(b,W)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(v,W)|0,s=s+Math.imul(v,$)|0,r=r+Math.imul(p,V)|0,n=(n=n+Math.imul(p,K)|0)+Math.imul(m,V)|0,s=s+Math.imul(m,K)|0;var yt=(u+(r=r+Math.imul(c,J)|0)|0)+((8191&(n=(n=n+Math.imul(c,Y)|0)+Math.imul(d,J)|0))<<13)|0;u=((s=s+Math.imul(d,Y)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(k,q),n=(n=Math.imul(k,z))+Math.imul(x,q)|0,s=Math.imul(x,z),r=r+Math.imul(w,W)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(_,W)|0,s=s+Math.imul(_,$)|0,r=r+Math.imul(b,V)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(v,V)|0,s=s+Math.imul(v,K)|0,r=r+Math.imul(p,J)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(m,J)|0,s=s+Math.imul(m,Y)|0;var wt=(u+(r=r+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;u=((s=s+Math.imul(d,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(S,q),n=(n=Math.imul(S,z))+Math.imul(T,q)|0,s=Math.imul(T,z),r=r+Math.imul(k,W)|0,n=(n=n+Math.imul(k,$)|0)+Math.imul(x,W)|0,s=s+Math.imul(x,$)|0,r=r+Math.imul(w,V)|0,n=(n=n+Math.imul(w,K)|0)+Math.imul(_,V)|0,s=s+Math.imul(_,K)|0,r=r+Math.imul(b,J)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(v,J)|0,s=s+Math.imul(v,Y)|0,r=r+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,tt)|0;var _t=(u+(r=r+Math.imul(c,it)|0)|0)+((8191&(n=(n=n+Math.imul(c,rt)|0)+Math.imul(d,it)|0))<<13)|0;u=((s=s+Math.imul(d,rt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(I,q),n=(n=Math.imul(I,z))+Math.imul(C,q)|0,s=Math.imul(C,z),r=r+Math.imul(S,W)|0,n=(n=n+Math.imul(S,$)|0)+Math.imul(T,W)|0,s=s+Math.imul(T,$)|0,r=r+Math.imul(k,V)|0,n=(n=n+Math.imul(k,K)|0)+Math.imul(x,V)|0,s=s+Math.imul(x,K)|0,r=r+Math.imul(w,J)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,J)|0,s=s+Math.imul(_,Y)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,Q)|0,s=s+Math.imul(v,tt)|0,r=r+Math.imul(p,it)|0,n=(n=n+Math.imul(p,rt)|0)+Math.imul(m,it)|0,s=s+Math.imul(m,rt)|0;var Mt=(u+(r=r+Math.imul(c,st)|0)|0)+((8191&(n=(n=n+Math.imul(c,ot)|0)+Math.imul(d,st)|0))<<13)|0;u=((s=s+Math.imul(d,ot)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(R,q),n=(n=Math.imul(R,z))+Math.imul(P,q)|0,s=Math.imul(P,z),r=r+Math.imul(I,W)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(C,W)|0,s=s+Math.imul(C,$)|0,r=r+Math.imul(S,V)|0,n=(n=n+Math.imul(S,K)|0)+Math.imul(T,V)|0,s=s+Math.imul(T,K)|0,r=r+Math.imul(k,J)|0,n=(n=n+Math.imul(k,Y)|0)+Math.imul(x,J)|0,s=s+Math.imul(x,Y)|0,r=r+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,tt)|0,r=r+Math.imul(b,it)|0,n=(n=n+Math.imul(b,rt)|0)+Math.imul(v,it)|0,s=s+Math.imul(v,rt)|0,r=r+Math.imul(p,st)|0,n=(n=n+Math.imul(p,ot)|0)+Math.imul(m,st)|0,s=s+Math.imul(m,ot)|0;var kt=(u+(r=r+Math.imul(c,ht)|0)|0)+((8191&(n=(n=n+Math.imul(c,ut)|0)+Math.imul(d,ht)|0))<<13)|0;u=((s=s+Math.imul(d,ut)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(O,q),n=(n=Math.imul(O,z))+Math.imul(D,q)|0,s=Math.imul(D,z),r=r+Math.imul(R,W)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(P,W)|0,s=s+Math.imul(P,$)|0,r=r+Math.imul(I,V)|0,n=(n=n+Math.imul(I,K)|0)+Math.imul(C,V)|0,s=s+Math.imul(C,K)|0,r=r+Math.imul(S,J)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(T,J)|0,s=s+Math.imul(T,Y)|0,r=r+Math.imul(k,Q)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(x,Q)|0,s=s+Math.imul(x,tt)|0,r=r+Math.imul(w,it)|0,n=(n=n+Math.imul(w,rt)|0)+Math.imul(_,it)|0,s=s+Math.imul(_,rt)|0,r=r+Math.imul(b,st)|0,n=(n=n+Math.imul(b,ot)|0)+Math.imul(v,st)|0,s=s+Math.imul(v,ot)|0,r=r+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,s=s+Math.imul(m,ut)|0;var xt=(u+(r=r+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;u=((s=s+Math.imul(d,dt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(j,q),n=(n=Math.imul(j,z))+Math.imul(U,q)|0,s=Math.imul(U,z),r=r+Math.imul(O,W)|0,n=(n=n+Math.imul(O,$)|0)+Math.imul(D,W)|0,s=s+Math.imul(D,$)|0,r=r+Math.imul(R,V)|0,n=(n=n+Math.imul(R,K)|0)+Math.imul(P,V)|0,s=s+Math.imul(P,K)|0,r=r+Math.imul(I,J)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(C,J)|0,s=s+Math.imul(C,Y)|0,r=r+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(T,Q)|0,s=s+Math.imul(T,tt)|0,r=r+Math.imul(k,it)|0,n=(n=n+Math.imul(k,rt)|0)+Math.imul(x,it)|0,s=s+Math.imul(x,rt)|0,r=r+Math.imul(w,st)|0,n=(n=n+Math.imul(w,ot)|0)+Math.imul(_,st)|0,s=s+Math.imul(_,ot)|0,r=r+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(v,ht)|0,s=s+Math.imul(v,ut)|0,r=r+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,dt)|0)+Math.imul(m,ct)|0,s=s+Math.imul(m,dt)|0;var Et=(u+(r=r+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,mt)|0)+Math.imul(d,pt)|0))<<13)|0;u=((s=s+Math.imul(d,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(j,W),n=(n=Math.imul(j,$))+Math.imul(U,W)|0,s=Math.imul(U,$),r=r+Math.imul(O,V)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(D,V)|0,s=s+Math.imul(D,K)|0,r=r+Math.imul(R,J)|0,n=(n=n+Math.imul(R,Y)|0)+Math.imul(P,J)|0,s=s+Math.imul(P,Y)|0,r=r+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,s=s+Math.imul(C,tt)|0,r=r+Math.imul(S,it)|0,n=(n=n+Math.imul(S,rt)|0)+Math.imul(T,it)|0,s=s+Math.imul(T,rt)|0,r=r+Math.imul(k,st)|0,n=(n=n+Math.imul(k,ot)|0)+Math.imul(x,st)|0,s=s+Math.imul(x,ot)|0,r=r+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(_,ht)|0,s=s+Math.imul(_,ut)|0,r=r+Math.imul(b,ct)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(v,ct)|0,s=s+Math.imul(v,dt)|0;var St=(u+(r=r+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((s=s+Math.imul(m,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(j,V),n=(n=Math.imul(j,K))+Math.imul(U,V)|0,s=Math.imul(U,K),r=r+Math.imul(O,J)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(D,J)|0,s=s+Math.imul(D,Y)|0,r=r+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,tt)|0,r=r+Math.imul(I,it)|0,n=(n=n+Math.imul(I,rt)|0)+Math.imul(C,it)|0,s=s+Math.imul(C,rt)|0,r=r+Math.imul(S,st)|0,n=(n=n+Math.imul(S,ot)|0)+Math.imul(T,st)|0,s=s+Math.imul(T,ot)|0,r=r+Math.imul(k,ht)|0,n=(n=n+Math.imul(k,ut)|0)+Math.imul(x,ht)|0,s=s+Math.imul(x,ut)|0,r=r+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,dt)|0)+Math.imul(_,ct)|0,s=s+Math.imul(_,dt)|0;var Tt=(u+(r=r+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,pt)|0))<<13)|0;u=((s=s+Math.imul(v,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(j,J),n=(n=Math.imul(j,Y))+Math.imul(U,J)|0,s=Math.imul(U,Y),r=r+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(D,Q)|0,s=s+Math.imul(D,tt)|0,r=r+Math.imul(R,it)|0,n=(n=n+Math.imul(R,rt)|0)+Math.imul(P,it)|0,s=s+Math.imul(P,rt)|0,r=r+Math.imul(I,st)|0,n=(n=n+Math.imul(I,ot)|0)+Math.imul(C,st)|0,s=s+Math.imul(C,ot)|0,r=r+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(T,ht)|0,s=s+Math.imul(T,ut)|0,r=r+Math.imul(k,ct)|0,n=(n=n+Math.imul(k,dt)|0)+Math.imul(x,ct)|0,s=s+Math.imul(x,dt)|0;var At=(u+(r=r+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((s=s+Math.imul(_,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(j,Q),n=(n=Math.imul(j,tt))+Math.imul(U,Q)|0,s=Math.imul(U,tt),r=r+Math.imul(O,it)|0,n=(n=n+Math.imul(O,rt)|0)+Math.imul(D,it)|0,s=s+Math.imul(D,rt)|0,r=r+Math.imul(R,st)|0,n=(n=n+Math.imul(R,ot)|0)+Math.imul(P,st)|0,s=s+Math.imul(P,ot)|0,r=r+Math.imul(I,ht)|0,n=(n=n+Math.imul(I,ut)|0)+Math.imul(C,ht)|0,s=s+Math.imul(C,ut)|0,r=r+Math.imul(S,ct)|0,n=(n=n+Math.imul(S,dt)|0)+Math.imul(T,ct)|0,s=s+Math.imul(T,dt)|0;var It=(u+(r=r+Math.imul(k,pt)|0)|0)+((8191&(n=(n=n+Math.imul(k,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((s=s+Math.imul(x,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(j,it),n=(n=Math.imul(j,rt))+Math.imul(U,it)|0,s=Math.imul(U,rt),r=r+Math.imul(O,st)|0,n=(n=n+Math.imul(O,ot)|0)+Math.imul(D,st)|0,s=s+Math.imul(D,ot)|0,r=r+Math.imul(R,ht)|0,n=(n=n+Math.imul(R,ut)|0)+Math.imul(P,ht)|0,s=s+Math.imul(P,ut)|0,r=r+Math.imul(I,ct)|0,n=(n=n+Math.imul(I,dt)|0)+Math.imul(C,ct)|0,s=s+Math.imul(C,dt)|0;var Ct=(u+(r=r+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((s=s+Math.imul(T,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(j,st),n=(n=Math.imul(j,ot))+Math.imul(U,st)|0,s=Math.imul(U,ot),r=r+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(D,ht)|0,s=s+Math.imul(D,ut)|0,r=r+Math.imul(R,ct)|0,n=(n=n+Math.imul(R,dt)|0)+Math.imul(P,ct)|0,s=s+Math.imul(P,dt)|0;var Bt=(u+(r=r+Math.imul(I,pt)|0)|0)+((8191&(n=(n=n+Math.imul(I,mt)|0)+Math.imul(C,pt)|0))<<13)|0;u=((s=s+Math.imul(C,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,r=Math.imul(j,ht),n=(n=Math.imul(j,ut))+Math.imul(U,ht)|0,s=Math.imul(U,ut),r=r+Math.imul(O,ct)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(D,ct)|0,s=s+Math.imul(D,dt)|0;var Rt=(u+(r=r+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((s=s+Math.imul(P,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(j,ct),n=(n=Math.imul(j,dt))+Math.imul(U,ct)|0,s=Math.imul(U,dt);var Pt=(u+(r=r+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(D,pt)|0))<<13)|0;u=((s=s+Math.imul(D,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Lt=(u+(r=Math.imul(j,pt))|0)+((8191&(n=(n=Math.imul(j,mt))+Math.imul(U,pt)|0))<<13)|0;return u=((s=Math.imul(U,mt))+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,h[0]=gt,h[1]=bt,h[2]=vt,h[3]=yt,h[4]=wt,h[5]=_t,h[6]=Mt,h[7]=kt,h[8]=xt,h[9]=Et,h[10]=St,h[11]=Tt,h[12]=At,h[13]=It,h[14]=Ct,h[15]=Bt,h[16]=Rt,h[17]=Pt,h[18]=Lt,0!==u&&(h[19]=u,i.length++),i};function m(t,e,i){return(new g).mulp(t,e,i)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=f),s.prototype.mulTo=function(t,e){var i,r=this.length+t.length;return i=10===this.length&&10===t.length?p(this,t,e):r<63?f(this,t,e):r<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,s=0;s<i.length-1;s++){var o=n;n=0;for(var a=67108863&r,h=Math.min(s,e.length-1),u=Math.max(0,s-t.length+1);u<=h;u++){var l=s-u,c=(0|t.words[l])*(0|e.words[u]),d=67108863&c;a=67108863&(d=d+a|0),n+=(o=(o=o+(c/67108864|0)|0)+(d>>>26)|0)>>>26,o&=67108863}i.words[s]=a,r=o,o=n}return 0!==r?i.words[s]=r:i.length--,i.strip()}(this,t,e):m(this,t,e),i},g.prototype.makeRBT=function(t){for(var e=new Array(t),i=s.prototype._countBits(t)-1,r=0;r<t;r++)e[r]=this.revBin(r,i,t);return e},g.prototype.revBin=function(t,e,i){if(0===t||t===i-1)return t;for(var r=0,n=0;n<e;n++)r|=(1&t)<<e-n-1,t>>=1;return r},g.prototype.permute=function(t,e,i,r,n,s){for(var o=0;o<s;o++)r[o]=e[t[o]],n[o]=i[t[o]]},g.prototype.transform=function(t,e,i,r,n,s){this.permute(s,t,e,i,r,n);for(var o=1;o<n;o<<=1)for(var a=o<<1,h=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),l=0;l<n;l+=a)for(var c=h,d=u,f=0;f<o;f++){var p=i[l+f],m=r[l+f],g=i[l+f+o],b=r[l+f+o],v=c*g-d*b;b=c*b+d*g,g=v,i[l+f]=p+g,r[l+f]=m+b,i[l+f+o]=p-g,r[l+f+o]=m-b,f!==a&&(v=h*c-u*d,d=h*d+u*c,c=v)}},g.prototype.guessLen13b=function(t,e){var i=1|Math.max(e,t),r=1&i,n=0;for(i=i/2|0;i;i>>>=1)n++;return 1<<n+1+r},g.prototype.conjugate=function(t,e,i){if(!(i<=1))for(var r=0;r<i/2;r++){var n=t[r];t[r]=t[i-r-1],t[i-r-1]=n,n=e[r],e[r]=-e[i-r-1],e[i-r-1]=-n}},g.prototype.normalize13b=function(t,e){for(var i=0,r=0;r<e/2;r++){var n=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+i;t[r]=67108863&n,i=n<67108864?0:n/67108864|0}return t},g.prototype.convert13b=function(t,e,i,n){for(var s=0,o=0;o<e;o++)s+=0|t[o],i[2*o]=8191&s,s>>>=13,i[2*o+1]=8191&s,s>>>=13;for(o=2*e;o<n;++o)i[o]=0;r(0===s),r(0==(-8192&s))},g.prototype.stub=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=0;return e},g.prototype.mulp=function(t,e,i){var r=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(r),s=this.stub(r),o=new Array(r),a=new Array(r),h=new Array(r),u=new Array(r),l=new Array(r),c=new Array(r),d=i.words;d.length=r,this.convert13b(t.words,t.length,o,r),this.convert13b(e.words,e.length,u,r),this.transform(o,s,a,h,r,n),this.transform(u,s,l,c,r,n);for(var f=0;f<r;f++){var p=a[f]*l[f]-h[f]*c[f];h[f]=a[f]*c[f]+h[f]*l[f],a[f]=p}return this.conjugate(a,h,r),this.transform(a,h,d,s,r,n),this.conjugate(d,s,r),this.normalize13b(d,r),i.negative=t.negative^e.negative,i.length=t.length+e.length,i.strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),m(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){r("number"==typeof t),r(t<67108864);for(var e=0,i=0;i<this.length;i++){var n=(0|this.words[i])*t,s=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=s>>>26,this.words[i]=67108863&s}return 0!==e&&(this.words[i]=e,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i<e.length;i++){var r=i/26|0,n=i%26;e[i]=(t.words[r]&1<<n)>>>n}return e}(t);if(0===e.length)return new s(1);for(var i=this,r=0;r<e.length&&0===e[r];r++,i=i.sqr());if(++r<e.length)for(var n=i.sqr();r<e.length;r++,n=n.sqr())0!==e[r]&&(i=i.mul(n));return i},s.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,i=t%26,n=(t-i)/26,s=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&s,h=(0|this.words[e])-a<<i;this.words[e]=h|o,o=a>>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},s.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,i){var n;r("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<<s,h=i;if(n-=o,n=Math.max(0,n),h){for(var u=0;u<o;u++)h.words[u]=this.words[u];h.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=n);u--){var c=0|this.words[u];this.words[u]=l<<26-s|c>>>s,l=c&a}return h&&0!==l&&(h.words[h.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26,n=1<<e;return!(this.length<=i||!(this.words[i]&n))},s.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return r("number"==typeof t),r(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,i){var n,s,o=t.length+i;this._expand(o);var a=0;for(n=0;n<t.length;n++){s=(0|this.words[n+i])+a;var h=(0|t.words[n])*e;a=((s-=67108863&h)>>26)-(h/67108864|0),this.words[n+i]=67108863&s}for(;n<this.length-i;n++)a=(s=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&s;if(0===a)return this.strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(s=-(0|this.words[n])+a)>>26,this.words[n]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,e){var i=(this.length,t.length),r=this.clone(),n=t,o=0|n.words[n.length-1];0!=(i=26-this._countBits(o))&&(n=n.ushln(i),r.iushln(i),o=0|n.words[n.length-1]);var a,h=r.length-n.length;if("mod"!==e){(a=new s(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=r.clone()._ishlnsubmul(n,1,h);0===l.negative&&(r=l,a&&(a.words[h]=1));for(var c=h-1;c>=0;c--){var d=67108864*(0|r.words[n.length+c])+(0|r.words[n.length+c-1]);for(d=Math.min(d/o|0,67108863),r._ishlnsubmul(n,d,c);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(n,1,c),r.isZero()||(r.negative^=1);a&&(a.words[c]=d)}return a&&a.strip(),r.strip(),"div"!==e&&0!==i&&r.iushrn(i),{div:a||null,mod:r}},s.prototype.divmod=function(t,e,i){return r(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),s=i.cmp(r);return s<0||1===n&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,i=0,n=this.length-1;n>=0;n--)i=(e*i+(0|this.words[n]))%t;return i},s.prototype.idivn=function(t){r(t<=67108863);for(var e=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*e;this.words[i]=n/t|0,e=n%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new s(1),o=new s(0),a=new s(0),h=new s(1),u=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++u;for(var l=i.clone(),c=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(l),h.isub(c)),a.iushrn(1),h.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(a),o.isub(h)):(i.isub(e),a.isub(n),h.isub(o))}return{a,b:h,gcd:i.iushln(u)}},s.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new s(1),a=new s(0),h=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var u=0,l=1;0==(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(h),o.iushrn(1);for(var c=0,d=1;0==(i.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(i.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(a)):(i.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var s=e;e=i,i=s}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var s=n,o=i;0!==s&&o<this.length;o++){var a=0|this.words[o];s=(a+=s)>>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){r<n?e=-1:r>n&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new k(t)},s.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},n(y,v),y.prototype.split=function(t,e){for(var i=4194303,r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var s=t.words[9];for(e.words[e.length++]=s&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(o&i)<<4|s>>>22,s=o}s>>>=22,t.words[n-10]=s,0===s&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i<t.length;i++){var r=0|t.words[i];e+=977*r,t.words[i]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(w,v),n(_,v),n(M,v),M.prototype.imulK=function(t){for(var e=0,i=0;i<t.length;i++){var r=19*(0|t.words[i])+e,n=67108863&r;r>>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return b[t]=e,e},k.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},k.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new s(1)).iushrn(2);return this.pow(t,i)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);r(!n.isZero());var a=new s(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);0!==this.pow(l,u).cmp(h);)l.redIAdd(h);for(var c=this.pow(l,n),d=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),p=o;0!==f.cmp(a);){for(var m=f,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var b=this.pow(c,new s(1).iushln(p-g-1));d=d.redMul(b),c=b.redSqr(),f=f.redMul(c),p=g}return d},k.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},k.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var i=new Array(16);i[0]=new s(1).toRed(this),i[1]=t;for(var r=2;r<i.length;r++)i[r]=this.mul(i[r-1],t);var n=i[0],o=0,a=0,h=e.bitLength()%26;for(0===h&&(h=26),r=e.length-1;r>=0;r--){for(var u=e.words[r],l=h-1;l>=0;l--){var c=u>>l&1;n!==i[0]&&(n=this.sqr(n)),0!==c||0!==o?(o<<=1,o|=c,(4==++a||0===r&&0===l)&&(n=this.mul(n,i[o]),a=0,o=0)):a=0}h=26}return n},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new x(t)},n(x,k),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var i=t.mul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=i.nmd(t),this)},2510:(t,e,i)=>{"use strict";var r=i(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0});const n=i(2830),s=i(5103),o=i(8984),a=i(1471),h=i(2451);e.EbmlStreamDecoderOptions=class{constructor(){this.bufferTagIds=[]}};class u extends n.Transform{constructor(t={}){super(Object.assign({},t,{readableObjectMode:!0})),this._currentBufferOffset=0,this._tagStack=[],this._buffer=r.alloc(0),this._bufferTagIds=[],this._bufferTagIds=t.bufferTagIds||[]}get buffer(){return this._buffer}_transform(t,e,i){for(this._buffer=r.concat([this._buffer,r.from(t)]);this.parseTags(););i()}parseTags(){const t=this.readTagHeader(this._buffer);if(!t)return!1;if(t.type===o.EbmlElementType.Master&&!this._bufferTagIds.some((e=>e===t.id)))return this._tagStack.push(t),this.emitTag(t,a.EbmlTagPosition.Start),this.advanceBuffer(t.tagHeaderLength),!0;{if(this._buffer.length<t.tagHeaderLength+t.size)return!1;const e=this._buffer.slice(t.tagHeaderLength,t.tagHeaderLength+t.size);for(this.emitTag(t,a.EbmlTagPosition.Content,e),this.advanceBuffer(t.tagHeaderLength+t.size);this._tagStack.length>0;){const t=this._tagStack[this._tagStack.length-1];if(this._currentBufferOffset<t.absoluteStart+t.tagHeaderLength+t.size)break;this.emitTag(t,a.EbmlTagPosition.End),this._tagStack.pop()}}return!0}advanceBuffer(t){this._currentBufferOffset+=t,this._buffer=this._buffer.slice(t)}readTagHeader(t,e=0){if(0==t.length)return null;const i=s.Tools.readVint(t,e);if(null==i)return null;const r=s.Tools.readVint(t,e+i.length);if(null==r)return null;const n=s.Tools.readHexString(t,e,e+i.length),o=Number.parseInt(n,16);let a=h.EbmlTagFactory.create(o);return a.size=r.value,Object.assign(a,{absoluteStart:this._currentBufferOffset+e,tagHeaderLength:i.length+r.length})}emitTag(t,e,i){let r=h.EbmlTagFactory.create(t.id);r.size=t.size,r.position=e,e===a.EbmlTagPosition.Content&&r.parseContent(i),this.push(r)}}e.EbmlStreamDecoder=u},1875:(t,e,i)=>{"use strict";var r=i(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0});const n=i(2830),s=i(1471),o=i(2090);class a extends n.Transform{constructor(t={}){super(Object.assign({},t,{writableObjectMode:!0})),this.dataBuffer=r.alloc(0),this.mCorked=!1,this.openTags=[]}_transform(t,e,i){if(t){if(!t.id)throw new Error(`No id found for ${JSON.stringify(t)}`);switch(t.position){case s.EbmlTagPosition.Start:this.startTag(t);break;case s.EbmlTagPosition.Content:this.writeTag(t);break;case s.EbmlTagPosition.End:this.endTag(t)}}i()}bufferAndFlush(t){this.dataBuffer=r.concat([this.dataBuffer,t]),this._flush((()=>{}))}_flush(t){let e=null;this.dataBuffer.length>0&&!this.mCorked&&(e=r.from(this.dataBuffer),this.dataBuffer=r.alloc(0),this.push(e)),t()}_bufferAndFlush(t){this.bufferAndFlush(t)}flush(){this._flush((()=>{}))}get buffer(){return this.dataBuffer}set buffer(t){this.dataBuffer=t}get stack(){return this.openTags}cork(){this.mCorked=!0}uncork(){this.mCorked=!1,this._flush((()=>{}))}writeTag(t){this.openTags.length>0?this.openTags[this.openTags.length-1].Children.push(t):this.bufferAndFlush(t.encode())}startTag(t){this.openTags.length>0&&this.openTags[this.openTags.length-1].Children.push(t),this.openTags.push(t)}endTag(t){const e=this.openTags.pop();if(t.id!==e.id)throw`Logic error - closing tag "${o.EbmlTagId[t.id]}" is not expected tag "${o.EbmlTagId[e.id]}"`;this.openTags.length<1&&this.bufferAndFlush(e.encode())}}e.EbmlStreamEncoder=a},3277:(t,e,i)=>{"use strict";i(5103).Tools;var r=i(2510);e.LE=r.EbmlStreamDecoder,i(1875).EbmlStreamEncoder,i(5016).Block,i(5563).BlockLacing,i(9958).EbmlDataTag,i(8984).EbmlElementType,i(2785).EbmlMasterTag,i(6819).EbmlTag,i(2451).EbmlTagFactory;var n=i(2090);e.Av=n.EbmlTagId,i(1471).EbmlTagPosition,i(8212).SimpleBlock},6819:(t,e,i)=>{"use strict";var r=i(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0});const n=i(2090),s=i(5103);e.EbmlTag=class{constructor(t,e,i){this.id=t,this.type=e,this.position=i}getTagDeclaration(){let t=this.id.toString(16);return t.length%2!=0&&(t=`0${t}`),r.from(t,"hex")}encode(){let t=null,e=this.encodeContent();if(-1===this.size)t=r.from("01ffffffffffffff","hex");else{let i;[n.EbmlTagId.Segment,n.EbmlTagId.Cluster].some((t=>t===this.id))&&(i=8),t=s.Tools.writeVint(e.length,i)}return r.concat([this.getTagDeclaration(),t,e])}}},2451:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(2090),n=i(2785),s=i(9958),o=i(5016),a=i(8212),h=i(8984);e.EbmlTagFactory=class{static create(t,e){if(void 0!==r.EbmlTagId[t]){let i;switch(t){case r.EbmlTagId.Block:return new o.Block;case r.EbmlTagId.SimpleBlock:return new a.SimpleBlock;case r.EbmlTagId.ChapterDisplay:case r.EbmlTagId.ContentCompression:case r.EbmlTagId.ContentEncryption:case r.EbmlTagId.SilentTracks:case r.EbmlTagId.ContentEncoding:case r.EbmlTagId.TrackTranslate:case r.EbmlTagId.ChapProcessCommand:case r.EbmlTagId.ChapterTranslate:case r.EbmlTagId.ChapProcess:case r.EbmlTagId.Tag:case r.EbmlTagId.Segment:case r.EbmlTagId.SimpleTag:case r.EbmlTagId.Targets:case r.EbmlTagId.Tags:case r.EbmlTagId.ChapterTrack:case r.EbmlTagId.ChapterAtom:case r.EbmlTagId.EditionEntry:case r.EbmlTagId.Chapters:case r.EbmlTagId.AttachedFile:case r.EbmlTagId.Attachments:case r.EbmlTagId.CueReference:case r.EbmlTagId.CueTrackPositions:case r.EbmlTagId.CuePoint:case r.EbmlTagId.Cues:case r.EbmlTagId.ContentEncAESSettings:case r.EbmlTagId.ContentEncodings:case r.EbmlTagId.TrackJoinBlocks:case r.EbmlTagId.TrackPlane:case r.EbmlTagId.TrackCombinePlanes:case r.EbmlTagId.TrackOperation:case r.EbmlTagId.Audio:case r.EbmlTagId.Video:case r.EbmlTagId.TrackEntry:case r.EbmlTagId.Tracks:case r.EbmlTagId.ReferenceFrame:case r.EbmlTagId.TimeSlice:case r.EbmlTagId.Slices:case r.EbmlTagId.BlockMore:case r.EbmlTagId.BlockAdditions:case r.EbmlTagId.BlockGroup:case r.EbmlTagId.Cluster:case r.EbmlTagId.Info:case r.EbmlTagId.Seek:case r.EbmlTagId.SeekHead:case r.EbmlTagId.SignatureElementList:case r.EbmlTagId.SignatureElements:case r.EbmlTagId.SignatureSlot:case r.EbmlTagId.EBML:i=h.EbmlElementType.Master;break;case r.EbmlTagId.TrackType:case r.EbmlTagId.FlagDefault:case r.EbmlTagId.ChapterTrackNumber:case r.EbmlTagId.ChapterTimeStart:case r.EbmlTagId.ChapterTimeEnd:case r.EbmlTagId.CueRefTime:case r.EbmlTagId.CueRefCluster:case r.EbmlTagId.ChapterFlagHidden:case r.EbmlTagId.ContentCompAlgo:case r.EbmlTagId.DocTypeReadVersion:case r.EbmlTagId.EBMLVersion:case r.EbmlTagId.DocTypeVersion:case r.EbmlTagId.TagDefault:case r.EbmlTagId.ChapterFlagEnabled:case r.EbmlTagId.FileUsedStartTime:case r.EbmlTagId.FileUsedEndTime:case r.EbmlTagId.ContentEncodingOrder:case r.EbmlTagId.ContentEncodingScope:case r.EbmlTagId.ContentEncodingType:case r.EbmlTagId.CueBlockNumber:case r.EbmlTagId.BitDepth:case r.EbmlTagId.ChapProcessTime:case r.EbmlTagId.ChapProcessCodecID:case r.EbmlTagId.AttachmentLink:case r.EbmlTagId.TagAttachmentUID:case r.EbmlTagId.TagChapterUID:case r.EbmlTagId.TagEditionUID:case r.EbmlTagId.TagTrackUID:case r.EbmlTagId.TargetTypeValue:case r.EbmlTagId.ChapterPhysicalEquiv:case r.EbmlTagId.ChapterSegmentEditionUID:case r.EbmlTagId.ChapterUID:case r.EbmlTagId.EditionFlagOrdered:case r.EbmlTagId.EditionFlagDefault:case r.EbmlTagId.EditionFlagHidden:case r.EbmlTagId.EditionUID:case r.EbmlTagId.FileUID:case r.EbmlTagId.CueRefCodecState:case r.EbmlTagId.CueRefNumber:case r.EbmlTagId.CueCodecState:case r.EbmlTagId.CueDuration:case r.EbmlTagId.CueRelativePosition:case r.EbmlTagId.CueClusterPosition:case r.EbmlTagId.CueTrack:case r.EbmlTagId.CueTime:case r.EbmlTagId.AESSettingsCipherMode:case r.EbmlTagId.ContentSigHashAlgo:case r.EbmlTagId.ContentSigAlgo:case r.EbmlTagId.ContentEncAlgo:case r.EbmlTagId.TrickMasterTrackUID:case r.EbmlTagId.TrickTrackFlag:case r.EbmlTagId.TrickTrackUID:case r.EbmlTagId.TrackJoinUID:case r.EbmlTagId.TrackPlaneType:case r.EbmlTagId.TrackPlaneUID:case r.EbmlTagId.Channels:case r.EbmlTagId.AspectRatioType:case r.EbmlTagId.DisplayUnit:case r.EbmlTagId.DisplayHeight:case r.EbmlTagId.DisplayWidth:case r.EbmlTagId.PixelCropRight:case r.EbmlTagId.PixelCropLeft:case r.EbmlTagId.PixelCropTop:case r.EbmlTagId.PixelCropBottom:case r.EbmlTagId.PixelHeight:case r.EbmlTagId.PixelWidth:case r.EbmlTagId.OldStereoMode:case r.EbmlTagId.AlphaMode:case r.EbmlTagId.StereoMode:case r.EbmlTagId.FlagInterlaced:case r.EbmlTagId.TrackTranslateCodec:case r.EbmlTagId.TrackTranslateEditionUID:case r.EbmlTagId.SeekPreRoll:case r.EbmlTagId.CodecDelay:case r.EbmlTagId.TrackOverlay:case r.EbmlTagId.CodecDecodeAll:case r.EbmlTagId.MaxBlockAdditionID:case r.EbmlTagId.DefaultDecodedFieldDuration:case r.EbmlTagId.DefaultDuration:case r.EbmlTagId.MaxCache:case r.EbmlTagId.MinCache:case r.EbmlTagId.FlagLacing:case r.EbmlTagId.FlagForced:case r.EbmlTagId.FlagEnabled:case r.EbmlTagId.TrackUID:case r.EbmlTagId.TrackNumber:case r.EbmlTagId.ReferenceTimeCode:case r.EbmlTagId.ReferenceOffset:case r.EbmlTagId.SliceDuration:case r.EbmlTagId.Delay:case r.EbmlTagId.BlockAdditionID:case r.EbmlTagId.FrameNumber:case r.EbmlTagId.LaceNumber:case r.EbmlTagId.ReferencePriority:case r.EbmlTagId.BlockDuration:case r.EbmlTagId.BlockAddID:case r.EbmlTagId.PrevSize:case r.EbmlTagId.Position:case r.EbmlTagId.SilentTrackNumber:case r.EbmlTagId.Timecode:case r.EbmlTagId.TimecodeScaleDenominator:case r.EbmlTagId.TimecodeScale:case r.EbmlTagId.ChapterTranslateCodec:case r.EbmlTagId.ChapterTranslateEditionUID:case r.EbmlTagId.SeekPosition:case r.EbmlTagId.SignatureHash:case r.EbmlTagId.SignatureAlgo:case r.EbmlTagId.EBMLMaxSizeLength:case r.EbmlTagId.EBMLMaxIDLength:case r.EbmlTagId.EBMLReadVersion:i=h.EbmlElementType.UnsignedInt;break;case r.EbmlTagId.TrackOffset:case r.EbmlTagId.DiscardPadding:case r.EbmlTagId.ReferenceVirtual:case r.EbmlTagId.ReferenceBlock:i=h.EbmlElementType.Integer;break;case r.EbmlTagId.CodecID:case r.EbmlTagId.DocType:case r.EbmlTagId.FileMimeType:case r.EbmlTagId.TagLanguage:case r.EbmlTagId.TargetType:case r.EbmlTagId.ChapCountry:case r.EbmlTagId.ChapLanguage:case r.EbmlTagId.CodecDownloadURL:case r.EbmlTagId.CodecInfoURL:case r.EbmlTagId.Language:i=h.EbmlElementType.String;break;case r.EbmlTagId.ChapString:case r.EbmlTagId.TagString:case r.EbmlTagId.ChapterStringUID:case r.EbmlTagId.WritingApp:case r.EbmlTagId.SegmentFilename:case r.EbmlTagId.CodecName:case r.EbmlTagId.TagName:case r.EbmlTagId.FileName:case r.EbmlTagId.FileDescription:case r.EbmlTagId.CodecSettings:case r.EbmlTagId.Name:case r.EbmlTagId.MuxingApp:case r.EbmlTagId.Title:case r.EbmlTagId.NextFilename:case r.EbmlTagId.PrevFilename:i=h.EbmlElementType.UTF8;break;case r.EbmlTagId.ContentCompSettings:case r.EbmlTagId.SegmentFamily:case r.EbmlTagId.TagBinary:case r.EbmlTagId.FileReferral:case r.EbmlTagId.SignedElement:case r.EbmlTagId.ChapProcessData:case r.EbmlTagId.ChapProcessPrivate:case r.EbmlTagId.ChapterSegmentUID:case r.EbmlTagId.FileData:case r.EbmlTagId.ContentSigKeyID:case r.EbmlTagId.ContentSignature:case r.EbmlTagId.ContentEncKeyID:case r.EbmlTagId.TrickMasterTrackSegmentUID:case r.EbmlTagId.TrickTrackSegmentUID:case r.EbmlTagId.ChannelPositions:case r.EbmlTagId.ColourSpace:case r.EbmlTagId.TrackTranslateTrackID:case r.EbmlTagId.CodecPrivate:case r.EbmlTagId.EncryptedBlock:case r.EbmlTagId.CodecState:case r.EbmlTagId.BlockAdditional:case r.EbmlTagId.BlockVirtual:case r.EbmlTagId.ChapterTranslateID:case r.EbmlTagId.NextUID:case r.EbmlTagId.PrevUID:case r.EbmlTagId.SegmentUID:case r.EbmlTagId.SeekID:case r.EbmlTagId.Signature:case r.EbmlTagId.SignaturePublicKey:case r.EbmlTagId.CRC32:case r.EbmlTagId.Void:i=h.EbmlElementType.Binary;break;case r.EbmlTagId.Duration:case r.EbmlTagId.OutputSamplingFrequency:case r.EbmlTagId.SamplingFrequency:case r.EbmlTagId.FrameRate:case r.EbmlTagId.GammaValue:case r.EbmlTagId.TrackTimecodeScale:i=h.EbmlElementType.Float;break;case r.EbmlTagId.DateUTC:i=h.EbmlElementType.Date}if(void 0===e)e=i;else if(e!==i)throw new Error(`Trying to create tag of well-known type "${r.EbmlTagId[t]}" using content type "${e}" (which is incorrect). Either pass the correct type or ignore the type parameter to EbmlTag.create()`)}switch(e){case h.EbmlElementType.Master:return new n.EbmlMasterTag(t);case h.EbmlElementType.UTF8:case h.EbmlElementType.Binary:case h.EbmlElementType.Date:case h.EbmlElementType.Float:case h.EbmlElementType.Integer:case h.EbmlElementType.String:case h.EbmlElementType.UnsignedInt:default:return new s.EbmlDataTag(t,e)}}}},5563:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),(i=e.BlockLacing||(e.BlockLacing={}))[i.None=0]="None",i[i.Xiph=1]="Xiph",i[i.EBML=2]="EBML",i[i.FixedSize=3]="FixedSize"},8984:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),(i=e.EbmlElementType||(e.EbmlElementType={})).Master="m",i.UnsignedInt="u",i.Integer="i",i.String="s",i.UTF8="8",i.Binary="b",i.Float="f",i.Date="d"},2090:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),(i=e.EbmlTagId||(e.EbmlTagId={}))[i.ChapterDisplay=128]="ChapterDisplay",i[i.TrackType=131]="TrackType",i[i.ChapString=133]="ChapString",i[i.CodecID=134]="CodecID",i[i.FlagDefault=136]="FlagDefault",i[i.ChapterTrackNumber=137]="ChapterTrackNumber",i[i.ChapterTimeStart=145]="ChapterTimeStart",i[i.ChapterTimeEnd=146]="ChapterTimeEnd",i[i.CueRefTime=150]="CueRefTime",i[i.CueRefCluster=151]="CueRefCluster",i[i.ChapterFlagHidden=152]="ChapterFlagHidden",i[i.ContentCompAlgo=16980]="ContentCompAlgo",i[i.ContentCompSettings=16981]="ContentCompSettings",i[i.DocType=17026]="DocType",i[i.DocTypeReadVersion=17029]="DocTypeReadVersion",i[i.EBMLVersion=17030]="EBMLVersion",i[i.DocTypeVersion=17031]="DocTypeVersion",i[i.SegmentFamily=17476]="SegmentFamily",i[i.DateUTC=17505]="DateUTC",i[i.TagDefault=17540]="TagDefault",i[i.TagBinary=17541]="TagBinary",i[i.TagString=17543]="TagString",i[i.Duration=17545]="Duration",i[i.ChapterFlagEnabled=17816]="ChapterFlagEnabled",i[i.FileMimeType=18016]="FileMimeType",i[i.FileUsedStartTime=18017]="FileUsedStartTime",i[i.FileUsedEndTime=18018]="FileUsedEndTime",i[i.FileReferral=18037]="FileReferral",i[i.ContentEncodingOrder=20529]="ContentEncodingOrder",i[i.ContentEncodingScope=20530]="ContentEncodingScope",i[i.ContentEncodingType=20531]="ContentEncodingType",i[i.ContentCompression=20532]="ContentCompression",i[i.ContentEncryption=20533]="ContentEncryption",i[i.CueBlockNumber=21368]="CueBlockNumber",i[i.ChapterStringUID=22100]="ChapterStringUID",i[i.WritingApp=22337]="WritingApp",i[i.SilentTracks=22612]="SilentTracks",i[i.ContentEncoding=25152]="ContentEncoding",i[i.BitDepth=25188]="BitDepth",i[i.SignedElement=25906]="SignedElement",i[i.TrackTranslate=26148]="TrackTranslate",i[i.ChapProcessCommand=26897]="ChapProcessCommand",i[i.ChapProcessTime=26914]="ChapProcessTime",i[i.ChapterTranslate=26916]="ChapterTranslate",i[i.ChapProcessData=26931]="ChapProcessData",i[i.ChapProcess=26948]="ChapProcess",i[i.ChapProcessCodecID=26965]="ChapProcessCodecID",i[i.Tag=29555]="Tag",i[i.SegmentFilename=29572]="SegmentFilename",i[i.AttachmentLink=29766]="AttachmentLink",i[i.CodecName=2459272]="CodecName",i[i.Segment=408125543]="Segment",i[i.TagLanguage=17530]="TagLanguage",i[i.TagName=17827]="TagName",i[i.SimpleTag=26568]="SimpleTag",i[i.TagAttachmentUID=25542]="TagAttachmentUID",i[i.TagChapterUID=25540]="TagChapterUID",i[i.TagEditionUID=25545]="TagEditionUID",i[i.TagTrackUID=25541]="TagTrackUID",i[i.TargetType=25546]="TargetType",i[i.TargetTypeValue=26826]="TargetTypeValue",i[i.Targets=25536]="Targets",i[i.Tags=307544935]="Tags",i[i.ChapProcessPrivate=17677]="ChapProcessPrivate",i[i.ChapCountry=17278]="ChapCountry",i[i.ChapLanguage=17276]="ChapLanguage",i[i.ChapterTrack=143]="ChapterTrack",i[i.ChapterPhysicalEquiv=25539]="ChapterPhysicalEquiv",i[i.ChapterSegmentEditionUID=28348]="ChapterSegmentEditionUID",i[i.ChapterSegmentUID=28263]="ChapterSegmentUID",i[i.ChapterUID=29636]="ChapterUID",i[i.ChapterAtom=182]="ChapterAtom",i[i.EditionFlagOrdered=17885]="EditionFlagOrdered",i[i.EditionFlagDefault=17883]="EditionFlagDefault",i[i.EditionFlagHidden=17853]="EditionFlagHidden",i[i.EditionUID=17852]="EditionUID",i[i.EditionEntry=17849]="EditionEntry",i[i.Chapters=272869232]="Chapters",i[i.FileUID=18094]="FileUID",i[i.FileData=18012]="FileData",i[i.FileName=18030]="FileName",i[i.FileDescription=18046]="FileDescription",i[i.AttachedFile=24999]="AttachedFile",i[i.Attachments=423732329]="Attachments",i[i.CueRefCodecState=235]="CueRefCodecState",i[i.CueRefNumber=21343]="CueRefNumber",i[i.CueReference=219]="CueReference",i[i.CueCodecState=234]="CueCodecState",i[i.CueDuration=178]="CueDuration",i[i.CueRelativePosition=240]="CueRelativePosition",i[i.CueClusterPosition=241]="CueClusterPosition",i[i.CueTrack=247]="CueTrack",i[i.CueTrackPositions=183]="CueTrackPositions",i[i.CueTime=179]="CueTime",i[i.CuePoint=187]="CuePoint",i[i.Cues=475249515]="Cues",i[i.AESSettingsCipherMode=18408]="AESSettingsCipherMode",i[i.ContentEncAESSettings=18407]="ContentEncAESSettings",i[i.ContentSigHashAlgo=18406]="ContentSigHashAlgo",i[i.ContentSigAlgo=18405]="ContentSigAlgo",i[i.ContentSigKeyID=18404]="ContentSigKeyID",i[i.ContentSignature=18403]="ContentSignature",i[i.ContentEncKeyID=18402]="ContentEncKeyID",i[i.ContentEncAlgo=18401]="ContentEncAlgo",i[i.ContentEncodings=28032]="ContentEncodings",i[i.TrickMasterTrackSegmentUID=196]="TrickMasterTrackSegmentUID",i[i.TrickMasterTrackUID=199]="TrickMasterTrackUID",i[i.TrickTrackFlag=198]="TrickTrackFlag",i[i.TrickTrackSegmentUID=193]="TrickTrackSegmentUID",i[i.TrickTrackUID=192]="TrickTrackUID",i[i.TrackJoinUID=237]="TrackJoinUID",i[i.TrackJoinBlocks=233]="TrackJoinBlocks",i[i.TrackPlaneType=230]="TrackPlaneType",i[i.TrackPlaneUID=229]="TrackPlaneUID",i[i.TrackPlane=228]="TrackPlane",i[i.TrackCombinePlanes=227]="TrackCombinePlanes",i[i.TrackOperation=226]="TrackOperation",i[i.ChannelPositions=32123]="ChannelPositions",i[i.Channels=159]="Channels",i[i.OutputSamplingFrequency=30901]="OutputSamplingFrequency",i[i.SamplingFrequency=181]="SamplingFrequency",i[i.Audio=225]="Audio",i[i.FrameRate=2327523]="FrameRate",i[i.GammaValue=3126563]="GammaValue",i[i.ColourSpace=3061028]="ColourSpace",i[i.AspectRatioType=21683]="AspectRatioType",i[i.DisplayUnit=21682]="DisplayUnit",i[i.DisplayHeight=21690]="DisplayHeight",i[i.DisplayWidth=21680]="DisplayWidth",i[i.PixelCropRight=21725]="PixelCropRight",i[i.PixelCropLeft=21708]="PixelCropLeft",i[i.PixelCropTop=21691]="PixelCropTop",i[i.PixelCropBottom=21674]="PixelCropBottom",i[i.PixelHeight=186]="PixelHeight",i[i.PixelWidth=176]="PixelWidth",i[i.OldStereoMode=21433]="OldStereoMode",i[i.AlphaMode=21440]="AlphaMode",i[i.StereoMode=21432]="StereoMode",i[i.FlagInterlaced=154]="FlagInterlaced",i[i.Video=224]="Video",i[i.TrackTranslateTrackID=26277]="TrackTranslateTrackID",i[i.TrackTranslateCodec=26303]="TrackTranslateCodec",i[i.TrackTranslateEditionUID=26364]="TrackTranslateEditionUID",i[i.SeekPreRoll=22203]="SeekPreRoll",i[i.CodecDelay=22186]="CodecDelay",i[i.TrackOverlay=28587]="TrackOverlay",i[i.CodecDecodeAll=170]="CodecDecodeAll",i[i.CodecDownloadURL=2536e3]="CodecDownloadURL",i[i.CodecInfoURL=3883072]="CodecInfoURL",i[i.CodecSettings=3839639]="CodecSettings",i[i.CodecPrivate=25506]="CodecPrivate",i[i.Language=2274716]="Language",i[i.Name=21358]="Name",i[i.MaxBlockAdditionID=21998]="MaxBlockAdditionID",i[i.TrackOffset=21375]="TrackOffset",i[i.TrackTimecodeScale=2306383]="TrackTimecodeScale",i[i.DefaultDecodedFieldDuration=2313850]="DefaultDecodedFieldDuration",i[i.DefaultDuration=2352003]="DefaultDuration",i[i.MaxCache=28152]="MaxCache",i[i.MinCache=28135]="MinCache",i[i.FlagLacing=156]="FlagLacing",i[i.FlagForced=21930]="FlagForced",i[i.FlagEnabled=185]="FlagEnabled",i[i.TrackUID=29637]="TrackUID",i[i.TrackNumber=215]="TrackNumber",i[i.TrackEntry=174]="TrackEntry",i[i.Tracks=374648427]="Tracks",i[i.EncryptedBlock=175]="EncryptedBlock",i[i.ReferenceTimeCode=202]="ReferenceTimeCode",i[i.ReferenceOffset=201]="ReferenceOffset",i[i.ReferenceFrame=200]="ReferenceFrame",i[i.SliceDuration=207]="SliceDuration",i[i.Delay=206]="Delay",i[i.BlockAdditionID=203]="BlockAdditionID",i[i.FrameNumber=205]="FrameNumber",i[i.LaceNumber=204]="LaceNumber",i[i.TimeSlice=232]="TimeSlice",i[i.Slices=142]="Slices",i[i.DiscardPadding=30114]="DiscardPadding",i[i.CodecState=164]="CodecState",i[i.ReferenceVirtual=253]="ReferenceVirtual",i[i.ReferenceBlock=251]="ReferenceBlock",i[i.ReferencePriority=250]="ReferencePriority",i[i.BlockDuration=155]="BlockDuration",i[i.BlockAdditional=165]="BlockAdditional",i[i.BlockAddID=238]="BlockAddID",i[i.BlockMore=166]="BlockMore",i[i.BlockAdditions=30113]="BlockAdditions",i[i.BlockVirtual=162]="BlockVirtual",i[i.Block=161]="Block",i[i.BlockGroup=160]="BlockGroup",i[i.SimpleBlock=163]="SimpleBlock",i[i.PrevSize=171]="PrevSize",i[i.Position=167]="Position",i[i.SilentTrackNumber=22743]="SilentTrackNumber",i[i.Timecode=231]="Timecode",i[i.Cluster=524531317]="Cluster",i[i.MuxingApp=19840]="MuxingApp",i[i.Title=31657]="Title",i[i.TimecodeScaleDenominator=2807730]="TimecodeScaleDenominator",i[i.TimecodeScale=2807729]="TimecodeScale",i[i.ChapterTranslateID=27045]="ChapterTranslateID",i[i.ChapterTranslateCodec=27071]="ChapterTranslateCodec",i[i.ChapterTranslateEditionUID=27132]="ChapterTranslateEditionUID",i[i.NextFilename=4096955]="NextFilename",i[i.NextUID=4110627]="NextUID",i[i.PrevFilename=3965867]="PrevFilename",i[i.PrevUID=3979555]="PrevUID",i[i.SegmentUID=29604]="SegmentUID",i[i.Info=357149030]="Info",i[i.SeekPosition=21420]="SeekPosition",i[i.SeekID=21419]="SeekID",i[i.Seek=19899]="Seek",i[i.SeekHead=290298740]="SeekHead",i[i.SignatureElementList=32379]="SignatureElementList",i[i.SignatureElements=32347]="SignatureElements",i[i.Signature=32437]="Signature",i[i.SignaturePublicKey=32421]="SignaturePublicKey",i[i.SignatureHash=32410]="SignatureHash",i[i.SignatureAlgo=32394]="SignatureAlgo",i[i.SignatureSlot=458458727]="SignatureSlot",i[i.CRC32=191]="CRC32",i[i.Void=236]="Void",i[i.EBMLMaxSizeLength=17139]="EBMLMaxSizeLength",i[i.EBMLMaxIDLength=17138]="EBMLMaxIDLength",i[i.EBMLReadVersion=17143]="EBMLReadVersion",i[i.EBML=440786851]="EBML"},1471:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),(i=e.EbmlTagPosition||(e.EbmlTagPosition={}))[i.Start=0]="Start",i[i.Content=1]="Content",i[i.End=2]="End"},5016:(t,e,i)=>{"use strict";var r=i(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0});const n=i(9958),s=i(5563),o=i(5103),a=i(2090),h=i(8984);class u extends n.EbmlDataTag{constructor(t){super(t||a.EbmlTagId.Block,h.EbmlElementType.Binary)}writeTrackBuffer(){return o.Tools.writeVint(this.track)}writeValueBuffer(){let t=r.alloc(2);return t.writeInt16BE(this.value,0),t}writeFlagsBuffer(){let t=0;switch(this.invisible&&(t|=16),this.lacing){case s.BlockLacing.None:break;case s.BlockLacing.Xiph:t|=4;break;case s.BlockLacing.EBML:t|=8;break;case s.BlockLacing.FixedSize:t|=12}return r.of(t)}encodeContent(){return r.concat([this.writeTrackBuffer(),this.writeValueBuffer(),this.writeFlagsBuffer(),this.payload])}parseContent(t){const e=o.Tools.readVint(t);this.track=e.value,this.value=o.Tools.readSigned(t.subarray(e.length,e.length+2));let i=t[e.length+2];switch(this.invisible=Boolean(16&i),12&i){case 0:this.lacing=s.BlockLacing.None;break;case 4:this.lacing=s.BlockLacing.Xiph;break;case 8:this.lacing=s.BlockLacing.EBML;break;case 12:this.lacing=s.BlockLacing.FixedSize}this.payload=t.slice(e.length+3)}}e.Block=u},9958:(t,e,i)=>{"use strict";var r=i(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0});const n=i(6819),s=i(8984),o=i(5103),a=i(1471);class h extends n.EbmlTag{constructor(t,e){super(t,e,a.EbmlTagPosition.Content)}parseContent(t){switch(this.type){case s.EbmlElementType.UnsignedInt:this.data=o.Tools.readUnsigned(t);break;case s.EbmlElementType.Float:this.data=o.Tools.readFloat(t);break;case s.EbmlElementType.Integer:this.data=o.Tools.readSigned(t);break;case s.EbmlElementType.String:this.data=String.fromCharCode(...t);break;case s.EbmlElementType.UTF8:this.data=o.Tools.readUtf8(t);break;default:this.data=t}}encodeContent(){switch(this.type){case s.EbmlElementType.UnsignedInt:return o.Tools.writeUnsigned(this.data);case s.EbmlElementType.Float:return o.Tools.writeFloat(this.data);case s.EbmlElementType.Integer:return o.Tools.writeSigned(this.data);case s.EbmlElementType.String:return r.from(this.data,"ascii");case s.EbmlElementType.UTF8:return r.from(this.data,"utf8");case s.EbmlElementType.Binary:default:return this.data}}}e.EbmlDataTag=h},2785:(t,e,i)=>{"use strict";var r=i(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0});const n=i(6819),s=i(8984),o=i(1471),a=i(5103),h=i(2451);class u extends n.EbmlTag{constructor(t,e=o.EbmlTagPosition.Content){super(t,s.EbmlElementType.Master,e),this._children=[]}get Children(){return this._children}set Children(t){this._children=t}encodeContent(){return r.concat(this._children.map((t=>t.encode())))}parseContent(t){for(;t.length>0;){const e=a.Tools.readVint(t),i=a.Tools.readVint(t,e.length),r=a.Tools.readHexString(t,0,e.length),n=Number.parseInt(r,16);let s=h.EbmlTagFactory.create(n);s.size=i.value;let o=e.length+i.length+i.value;s.parseContent(t.slice(e.length+i.length,o)),this._children.push(s),t=t.slice(o)}}}e.EbmlMasterTag=u},8212:(t,e,i)=>{"use strict";var r=i(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0});const n=i(5103),s=i(5016),o=i(2090);class a extends s.Block{constructor(){super(o.EbmlTagId.SimpleBlock)}encodeContent(){let t=this.writeFlagsBuffer();return this.keyframe&&(t[0]|=128),this.discardable&&(t[0]|=1),r.concat([this.writeTrackBuffer(),this.writeValueBuffer(),t,this.payload])}parseContent(t){super.parseContent(t);let e=t[n.Tools.readVint(t).length+2];this.keyframe=Boolean(128&e),this.discardable=Boolean(1&e)}}e.SimpleBlock=a},5103:(t,e,i)=>{"use strict";var r=i(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0});class n{static readVint(t,e=0){const i=8-Math.floor(Math.log2(t[e]));if(i>8){const r=n.readHexString(t,e,e+i);throw new Error(`Unrepresentable length: ${i} ${r}`)}if(isNaN(i)||e+i>t.length)return null;if(8===i&&t[e+1]>=32&&t.subarray(e+2,e+8).some((t=>t>0)))return{length:8,value:-1};let r=t[e]&(1<<8-i)-1;for(let n=1;n<i;n+=1)r*=Math.pow(2,8),r+=t[e+n];return r===Math.pow(2,7*i)-1&&(r=-1),{length:i,value:r}}static writeVint(t,e){if(t<0||t>Math.pow(2,53))throw new Error(`Unrepresentable value: ${t}`);let i=e;if(!i)for(i=1;i<=8&&!(t<Math.pow(2,7*i)-1);i+=1);const n=r.alloc(i);let s=t;for(let t=1;t<=i;t+=1){const e=255&s;n[i-t]=e,s-=e,s/=Math.pow(2,8)}return n[0]|=1<<8-i,n}static padStart(t){return 0==t.length?"00":1==t.length?"0"+t:t}static readHexString(t,e=0,i=t.byteLength){return Array.from(t.subarray(e,i)).map((t=>Number(t).toString(16))).reduce(((t,e)=>`${t}${this.padStart(e)}`),"")}static readUtf8(t){try{return r.from(t).toString("utf8")}catch(t){return null}}static readUnsigned(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 1:return e.getUint8(0);case 2:return e.getUint16(0);case 4:return e.getUint32(0)}if(t.byteLength<=6)return t.reduce(((t,e)=>256*t+e),0);var i=n.readHexString(t,0,t.byteLength),r=parseInt(i,16);return r<=Math.pow(256,6)?r:i}static writeUnsigned(t){if("string"==typeof t)return r.from(t,"hex");{var e=r.alloc(6);e.fill(0),e.writeUIntBE(t,0,6);let i=e.findIndex((t=>0!==t));return-1===i&&(i=e.length-1),e.slice(i)}}static readSigned(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 1:return e.getInt8(0);case 2:return e.getInt16(0);case 4:return e.getInt32(0);default:return NaN}}static writeSigned(t){var e=r.alloc(8);return e.writeInt32BE(t,0),e}static readFloat(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:return e.getFloat32(0);case 8:return e.getFloat64(0);default:return NaN}}static writeFloat(t){let e=r.alloc(8);return e.writeFloatBE(t,0)<=4&&(e=e.slice(0,4)),e}}e.Tools=n},6266:(t,e,i)=>{"use strict";var r=e;r.version=i(8597).i8,r.utils=i(953),r.rand=i(9931),r.curve=i(8254),r.curves=i(5427),r.ec=i(7954),r.eddsa=i(5980)},4918:(t,e,i)=>{"use strict";var r=i(3785),n=i(953),s=n.getNAF,o=n.getJSF,a=n.assert;function h(t,e){this.type=t,this.p=new r(e.p,16),this.red=e.prime?r.red(e.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=e.n&&new r(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=h,h.prototype.point=function(){throw new Error("Not implemented")},h.prototype.validate=function(){throw new Error("Not implemented")},h.prototype._fixedNafMul=function(t,e){a(t.precomputed);var i=t._getDoubles(),r=s(e,1,this._bitLength),n=(1<<i.step+1)-(i.step%2==0?2:1);n/=3;var o,h,u=[];for(o=0;o<r.length;o+=i.step){h=0;for(var l=o+i.step-1;l>=o;l--)h=(h<<1)+r[l];u.push(h)}for(var c=this.jpoint(null,null,null),d=this.jpoint(null,null,null),f=n;f>0;f--){for(o=0;o<u.length;o++)(h=u[o])===f?d=d.mixedAdd(i.points[o]):h===-f&&(d=d.mixedAdd(i.points[o].neg()));c=c.add(d)}return c.toP()},h.prototype._wnafMul=function(t,e){var i=4,r=t._getNAFPoints(i);i=r.wnd;for(var n=r.points,o=s(e,i,this._bitLength),h=this.jpoint(null,null,null),u=o.length-1;u>=0;u--){for(var l=0;u>=0&&0===o[u];u--)l++;if(u>=0&&l++,h=h.dblp(l),u<0)break;var c=o[u];a(0!==c),h="affine"===t.type?c>0?h.mixedAdd(n[c-1>>1]):h.mixedAdd(n[-c-1>>1].neg()):c>0?h.add(n[c-1>>1]):h.add(n[-c-1>>1].neg())}return"affine"===t.type?h.toP():h},h.prototype._wnafMulAdd=function(t,e,i,r,n){var a,h,u,l=this._wnafT1,c=this._wnafT2,d=this._wnafT3,f=0;for(a=0;a<r;a++){var p=(u=e[a])._getNAFPoints(t);l[a]=p.wnd,c[a]=p.points}for(a=r-1;a>=1;a-=2){var m=a-1,g=a;if(1===l[m]&&1===l[g]){var b=[e[m],null,null,e[g]];0===e[m].y.cmp(e[g].y)?(b[1]=e[m].add(e[g]),b[2]=e[m].toJ().mixedAdd(e[g].neg())):0===e[m].y.cmp(e[g].y.redNeg())?(b[1]=e[m].toJ().mixedAdd(e[g]),b[2]=e[m].add(e[g].neg())):(b[1]=e[m].toJ().mixedAdd(e[g]),b[2]=e[m].toJ().mixedAdd(e[g].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],y=o(i[m],i[g]);for(f=Math.max(y[0].length,f),d[m]=new Array(f),d[g]=new Array(f),h=0;h<f;h++){var w=0|y[0][h],_=0|y[1][h];d[m][h]=v[3*(w+1)+(_+1)],d[g][h]=0,c[m]=b}}else d[m]=s(i[m],l[m],this._bitLength),d[g]=s(i[g],l[g],this._bitLength),f=Math.max(d[m].length,f),f=Math.max(d[g].length,f)}var M=this.jpoint(null,null,null),k=this._wnafT4;for(a=f;a>=0;a--){for(var x=0;a>=0;){var E=!0;for(h=0;h<r;h++)k[h]=0|d[h][a],0!==k[h]&&(E=!1);if(!E)break;x++,a--}if(a>=0&&x++,M=M.dblp(x),a<0)break;for(h=0;h<r;h++){var S=k[h];0!==S&&(S>0?u=c[h][S-1>>1]:S<0&&(u=c[h][-S-1>>1].neg()),M="affine"===u.type?M.mixedAdd(u):M.add(u))}}for(a=0;a<r;a++)c[a]=null;return n?M:M.toP()},h.BasePoint=u,u.prototype.eq=function(){throw new Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},h.prototype.decodePoint=function(t,e){t=n.toArray(t,e);var i=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*i)return 6===t[0]?a(t[t.length-1]%2==0):7===t[0]&&a(t[t.length-1]%2==1),this.point(t.slice(1,1+i),t.slice(1+i,1+2*i));if((2===t[0]||3===t[0])&&t.length-1===i)return this.pointFromX(t.slice(1,1+i),3===t[0]);throw new Error("Unknown point format")},u.prototype.encodeCompressed=function(t){return this.encode(t,!0)},u.prototype._encode=function(t){var e=this.curve.p.byteLength(),i=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(i):[4].concat(i,this.getY().toArray("be",e))},u.prototype.encode=function(t,e){return n.encode(this._encode(e),t)},u.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},u.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},u.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],r=this,n=0;n<e;n+=t){for(var s=0;s<t;s++)r=r.dbl();i.push(r)}return{step:t,points:i}},u.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],i=(1<<t)-1,r=1===i?null:this.dbl(),n=1;n<i;n++)e[n]=e[n-1].add(r);return{wnd:t,points:e}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(t){for(var e=this,i=0;i<t;i++)e=e.dbl();return e}},1138:(t,e,i)=>{"use strict";var r=i(953),n=i(3785),s=i(5717),o=i(4918),a=r.assert;function h(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,o.call(this,"edwards",t),this.a=new n(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function u(t,e,i,r,s){o.BasePoint.call(this,t,"projective"),null===e&&null===i&&null===r?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new n(e,16),this.y=new n(i,16),this.z=r?new n(r,16):this.curve.one,this.t=s&&new n(s,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}s(h,o),t.exports=h,h.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},h.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},h.prototype.jpoint=function(t,e,i,r){return this.point(t,e,i,r)},h.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var i=t.redSqr(),r=this.c2.redSub(this.a.redMul(i)),s=this.one.redSub(this.c2.redMul(this.d).redMul(i)),o=r.redMul(s.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var h=a.fromRed().isOdd();return(e&&!h||!e&&h)&&(a=a.redNeg()),this.point(t,a)},h.prototype.pointFromY=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var i=t.redSqr(),r=i.redSub(this.c2),s=i.redMul(this.d).redMul(this.c2).redSub(this.a),o=r.redMul(s.redInvm());if(0===o.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},h.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),i=t.y.redSqr(),r=e.redMul(this.a).redAdd(i),n=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(i)));return 0===r.cmp(n)},s(u,o.BasePoint),h.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},h.prototype.point=function(t,e,i,r){return new u(this,t,e,i,r)},u.fromJSON=function(t,e){return new u(t,e[0],e[1],e[2])},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var r=this.curve._mulA(t),n=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),s=r.redAdd(e),o=s.redSub(i),a=r.redSub(e),h=n.redMul(o),u=s.redMul(a),l=n.redMul(a),c=o.redMul(s);return this.curve.point(h,u,c,l)},u.prototype._projDbl=function(){var t,e,i,r,n,s,o=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),h=this.y.redSqr();if(this.curve.twisted){var u=(r=this.curve._mulA(a)).redAdd(h);this.zOne?(t=o.redSub(a).redSub(h).redMul(u.redSub(this.curve.two)),e=u.redMul(r.redSub(h)),i=u.redSqr().redSub(u).redSub(u)):(n=this.z.redSqr(),s=u.redSub(n).redISub(n),t=o.redSub(a).redISub(h).redMul(s),e=u.redMul(r.redSub(h)),i=u.redMul(s))}else r=a.redAdd(h),n=this.curve._mulC(this.z).redSqr(),s=r.redSub(n).redSub(n),t=this.curve._mulC(o.redISub(r)).redMul(s),e=this.curve._mulC(r).redMul(a.redISub(h)),i=r.redMul(s);return this.curve.point(t,e,i)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),i=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),r=this.t.redMul(this.curve.dd).redMul(t.t),n=this.z.redMul(t.z.redAdd(t.z)),s=i.redSub(e),o=n.redSub(r),a=n.redAdd(r),h=i.redAdd(e),u=s.redMul(o),l=a.redMul(h),c=s.redMul(h),d=o.redMul(a);return this.curve.point(u,l,d,c)},u.prototype._projAdd=function(t){var e,i,r=this.z.redMul(t.z),n=r.redSqr(),s=this.x.redMul(t.x),o=this.y.redMul(t.y),a=this.curve.d.redMul(s).redMul(o),h=n.redSub(a),u=n.redAdd(a),l=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(s).redISub(o),c=r.redMul(h).redMul(l);return this.curve.twisted?(e=r.redMul(u).redMul(o.redSub(this.curve._mulA(s))),i=h.redMul(u)):(e=r.redMul(u).redMul(o.redSub(s)),i=this.curve._mulC(h).redMul(u)),this.curve.point(c,e,i)},u.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},u.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,i){return this.curve._wnafMulAdd(1,[this,e],[t,i],2,!1)},u.prototype.jmulAdd=function(t,e,i){return this.curve._wnafMulAdd(1,[this,e],[t,i],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},u.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var i=t.clone(),r=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(r),0===this.x.cmp(e))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},8254:(t,e,i)=>{"use strict";var r=e;r.base=i(4918),r.short=i(6673),r.mont=i(2881),r.edwards=i(1138)},2881:(t,e,i)=>{"use strict";var r=i(3785),n=i(5717),s=i(4918),o=i(953);function a(t){s.call(this,"mont",t),this.a=new r(t.a,16).toRed(this.red),this.b=new r(t.b,16).toRed(this.red),this.i4=new r(4).toRed(this.red).redInvm(),this.two=new r(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function h(t,e,i){s.BasePoint.call(this,t,"projective"),null===e&&null===i?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new r(e,16),this.z=new r(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(a,s),t.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,i=e.redSqr(),r=i.redMul(e).redAdd(i.redMul(this.a)).redAdd(e);return 0===r.redSqrt().redSqr().cmp(r)},n(h,s.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(o.toArray(t,e),1)},a.prototype.point=function(t,e){return new h(this,t,e)},a.prototype.pointFromJSON=function(t){return h.fromJSON(this,t)},h.prototype.precompute=function(){},h.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},h.fromJSON=function(t,e){return new h(t,e[0],e[1]||t.one)},h.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},h.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),i=t.redSub(e),r=t.redMul(e),n=i.redMul(e.redAdd(this.curve.a24.redMul(i)));return this.curve.point(r,n)},h.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.diffAdd=function(t,e){var i=this.x.redAdd(this.z),r=this.x.redSub(this.z),n=t.x.redAdd(t.z),s=t.x.redSub(t.z).redMul(i),o=n.redMul(r),a=e.z.redMul(s.redAdd(o).redSqr()),h=e.x.redMul(s.redISub(o).redSqr());return this.curve.point(a,h)},h.prototype.mul=function(t){for(var e=t.clone(),i=this,r=this.curve.point(null,null),n=[];0!==e.cmpn(0);e.iushrn(1))n.push(e.andln(1));for(var s=n.length-1;s>=0;s--)0===n[s]?(i=i.diffAdd(r,this),r=r.dbl()):(r=i.diffAdd(r,this),i=i.dbl());return r},h.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},h.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},h.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},6673:(t,e,i)=>{"use strict";var r=i(953),n=i(3785),s=i(5717),o=i(4918),a=r.assert;function h(t){o.call(this,"short",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(t,e,i,r){o.BasePoint.call(this,t,"affine"),null===e&&null===i?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(e,16),this.y=new n(i,16),r&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function l(t,e,i,r){o.BasePoint.call(this,t,"jacobian"),null===e&&null===i&&null===r?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(e,16),this.y=new n(i,16),this.z=new n(r,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}s(h,o),t.exports=h,h.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,i;if(t.beta)e=new n(t.beta,16).toRed(this.red);else{var r=this._getEndoRoots(this.p);e=(e=r[0].cmp(r[1])<0?r[0]:r[1]).toRed(this.red)}if(t.lambda)i=new n(t.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(e))?i=s[0]:(i=s[1],a(0===this.g.mul(i).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:i,basis:t.basis?t.basis.map((function(t){return{a:new n(t.a,16),b:new n(t.b,16)}})):this._getEndoBasis(i)}}},h.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:n.mont(t),i=new n(2).toRed(e).redInvm(),r=i.redNeg(),s=new n(3).toRed(e).redNeg().redSqrt().redMul(i);return[r.redAdd(s).fromRed(),r.redSub(s).fromRed()]},h.prototype._getEndoBasis=function(t){for(var e,i,r,s,o,a,h,u,l,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=t,f=this.n.clone(),p=new n(1),m=new n(0),g=new n(0),b=new n(1),v=0;0!==d.cmpn(0);){var y=f.div(d);u=f.sub(y.mul(d)),l=g.sub(y.mul(p));var w=b.sub(y.mul(m));if(!r&&u.cmp(c)<0)e=h.neg(),i=p,r=u.neg(),s=l;else if(r&&2==++v)break;h=u,f=d,d=u,g=p,p=l,b=m,m=w}o=u.neg(),a=l;var _=r.sqr().add(s.sqr());return o.sqr().add(a.sqr()).cmp(_)>=0&&(o=e,a=i),r.negative&&(r=r.neg(),s=s.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:r,b:s},{a:o,b:a}]},h.prototype._endoSplit=function(t){var e=this.endo.basis,i=e[0],r=e[1],n=r.b.mul(t).divRound(this.n),s=i.b.neg().mul(t).divRound(this.n),o=n.mul(i.a),a=s.mul(r.a),h=n.mul(i.b),u=s.mul(r.b);return{k1:t.sub(o).sub(a),k2:h.add(u).neg()}},h.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var i=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),r=i.redSqrt();if(0!==r.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");var s=r.fromRed().isOdd();return(e&&!s||!e&&s)&&(r=r.redNeg()),this.point(t,r)},h.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,i=t.y,r=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(r).redIAdd(this.b);return 0===i.redSqr().redISub(n).cmpn(0)},h.prototype._endoWnafMulAdd=function(t,e,i){for(var r=this._endoWnafT1,n=this._endoWnafT2,s=0;s<t.length;s++){var o=this._endoSplit(e[s]),a=t[s],h=a._getBeta();o.k1.negative&&(o.k1.ineg(),a=a.neg(!0)),o.k2.negative&&(o.k2.ineg(),h=h.neg(!0)),r[2*s]=a,r[2*s+1]=h,n[2*s]=o.k1,n[2*s+1]=o.k2}for(var u=this._wnafMulAdd(1,r,n,2*s,i),l=0;l<2*s;l++)r[l]=null,n[l]=null;return u},s(u,o.BasePoint),h.prototype.point=function(t,e,i){return new u(this,t,e,i)},h.prototype.pointFromJSON=function(t,e){return u.fromJSON(this,t,e)},u.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var i=this.curve,r=function(t){return i.point(t.x.redMul(i.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(r)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(r)}}}return e}},u.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},u.fromJSON=function(t,e,i){"string"==typeof e&&(e=JSON.parse(e));var r=t.point(e[0],e[1],i);if(!e[2])return r;function n(e){return t.point(e[0],e[1],i)}var s=e[2];return r.precomputed={beta:null,doubles:s.doubles&&{step:s.doubles.step,points:[r].concat(s.doubles.points.map(n))},naf:s.naf&&{wnd:s.naf.wnd,points:[r].concat(s.naf.points.map(n))}},r},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var i=e.redSqr().redISub(this.x).redISub(t.x),r=e.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,r)},u.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,i=this.x.redSqr(),r=t.redInvm(),n=i.redAdd(i).redIAdd(i).redIAdd(e).redMul(r),s=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(t){return t=new n(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,i){var r=[this,e],n=[t,i];return this.curve.endo?this.curve._endoWnafMulAdd(r,n):this.curve._wnafMulAdd(1,r,n,2)},u.prototype.jmulAdd=function(t,e,i){var r=[this,e],n=[t,i];return this.curve.endo?this.curve._endoWnafMulAdd(r,n,!0):this.curve._wnafMulAdd(1,r,n,2,!0)},u.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},u.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var i=this.precomputed,r=function(t){return t.neg()};e.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(r)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(r)}}}return e},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},s(l,o.BasePoint),h.prototype.jpoint=function(t,e,i){return new l(this,t,e,i)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),i=this.x.redMul(e),r=this.y.redMul(e).redMul(t);return this.curve.point(i,r)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),i=this.z.redSqr(),r=this.x.redMul(e),n=t.x.redMul(i),s=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(i.redMul(this.z)),a=r.redSub(n),h=s.redSub(o);if(0===a.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),c=r.redMul(u),d=h.redSqr().redIAdd(l).redISub(c).redISub(c),f=h.redMul(c.redISub(d)).redISub(s.redMul(l)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(d,f,p)},l.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),i=this.x,r=t.x.redMul(e),n=this.y,s=t.y.redMul(e).redMul(this.z),o=i.redSub(r),a=n.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=o.redSqr(),u=h.redMul(o),l=i.redMul(h),c=a.redSqr().redIAdd(u).redISub(l).redISub(l),d=a.redMul(l.redISub(c)).redISub(n.redMul(u)),f=this.z.redMul(o);return this.curve.jpoint(c,d,f)},l.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var i=this;for(e=0;e<t;e++)i=i.dbl();return i}var r=this.curve.a,n=this.curve.tinv,s=this.x,o=this.y,a=this.z,h=a.redSqr().redSqr(),u=o.redAdd(o);for(e=0;e<t;e++){var l=s.redSqr(),c=u.redSqr(),d=c.redSqr(),f=l.redAdd(l).redIAdd(l).redIAdd(r.redMul(h)),p=s.redMul(c),m=f.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),b=f.redMul(g);b=b.redIAdd(b).redISub(d);var v=u.redMul(a);e+1<t&&(h=h.redMul(d)),s=m,a=v,u=b}return this.curve.jpoint(s,u.redMul(n),a)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},l.prototype._zeroDbl=function(){var t,e,i;if(this.zOne){var r=this.x.redSqr(),n=this.y.redSqr(),s=n.redSqr(),o=this.x.redAdd(n).redSqr().redISub(r).redISub(s);o=o.redIAdd(o);var a=r.redAdd(r).redIAdd(r),h=a.redSqr().redISub(o).redISub(o),u=s.redIAdd(s);u=(u=u.redIAdd(u)).redIAdd(u),t=h,e=a.redMul(o.redISub(h)).redISub(u),i=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),c=this.y.redSqr(),d=c.redSqr(),f=this.x.redAdd(c).redSqr().redISub(l).redISub(d);f=f.redIAdd(f);var p=l.redAdd(l).redIAdd(l),m=p.redSqr(),g=d.redIAdd(d);g=(g=g.redIAdd(g)).redIAdd(g),t=m.redISub(f).redISub(f),e=p.redMul(f.redISub(t)).redISub(g),i=(i=this.y.redMul(this.z)).redIAdd(i)}return this.curve.jpoint(t,e,i)},l.prototype._threeDbl=function(){var t,e,i;if(this.zOne){var r=this.x.redSqr(),n=this.y.redSqr(),s=n.redSqr(),o=this.x.redAdd(n).redSqr().redISub(r).redISub(s);o=o.redIAdd(o);var a=r.redAdd(r).redIAdd(r).redIAdd(this.curve.a),h=a.redSqr().redISub(o).redISub(o);t=h;var u=s.redIAdd(s);u=(u=u.redIAdd(u)).redIAdd(u),e=a.redMul(o.redISub(h)).redISub(u),i=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),c=this.y.redSqr(),d=this.x.redMul(c),f=this.x.redSub(l).redMul(this.x.redAdd(l));f=f.redAdd(f).redIAdd(f);var p=d.redIAdd(d),m=(p=p.redIAdd(p)).redAdd(p);t=f.redSqr().redISub(m),i=this.y.redAdd(this.z).redSqr().redISub(c).redISub(l);var g=c.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),e=f.redMul(p.redISub(t)).redISub(g)}return this.curve.jpoint(t,e,i)},l.prototype._dbl=function(){var t=this.curve.a,e=this.x,i=this.y,r=this.z,n=r.redSqr().redSqr(),s=e.redSqr(),o=i.redSqr(),a=s.redAdd(s).redIAdd(s).redIAdd(t.redMul(n)),h=e.redAdd(e),u=(h=h.redIAdd(h)).redMul(o),l=a.redSqr().redISub(u.redAdd(u)),c=u.redISub(l),d=o.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var f=a.redMul(c).redISub(d),p=i.redAdd(i).redMul(r);return this.curve.jpoint(l,f,p)},l.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),i=this.z.redSqr(),r=e.redSqr(),n=t.redAdd(t).redIAdd(t),s=n.redSqr(),o=this.x.redAdd(e).redSqr().redISub(t).redISub(r),a=(o=(o=(o=o.redIAdd(o)).redAdd(o).redIAdd(o)).redISub(s)).redSqr(),h=r.redIAdd(r);h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var u=n.redIAdd(o).redSqr().redISub(s).redISub(a).redISub(h),l=e.redMul(u);l=(l=l.redIAdd(l)).redIAdd(l);var c=this.x.redMul(a).redISub(l);c=(c=c.redIAdd(c)).redIAdd(c);var d=this.y.redMul(u.redMul(h.redISub(u)).redISub(o.redMul(a)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var f=this.z.redAdd(o).redSqr().redISub(i).redISub(a);return this.curve.jpoint(c,d,f)},l.prototype.mul=function(t,e){return t=new n(t,e),this.curve._wnafMul(this,t)},l.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),i=t.z.redSqr();if(0!==this.x.redMul(i).redISub(t.x.redMul(e)).cmpn(0))return!1;var r=e.redMul(this.z),n=i.redMul(t.z);return 0===this.y.redMul(n).redISub(t.y.redMul(r)).cmpn(0)},l.prototype.eqXToP=function(t){var e=this.z.redSqr(),i=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(i))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(e);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(i.redIAdd(n),0===this.x.cmp(i))return!0}},l.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},5427:(t,e,i)=>{"use strict";var r,n=e,s=i(3715),o=i(8254),a=i(953).assert;function h(t){"short"===t.type?this.curve=new o.short(t):"edwards"===t.type?this.curve=new o.edwards(t):this.curve=new o.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var i=new h(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:i}),i}})}n.PresetCurve=h,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:s.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:s.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:s.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:s.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:s.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=i(1037)}catch(t){r=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:s.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},7954:(t,e,i)=>{"use strict";var r=i(3785),n=i(2156),s=i(953),o=i(5427),a=i(9931),h=s.assert,u=i(1251),l=i(611);function c(t){if(!(this instanceof c))return new c(t);"string"==typeof t&&(h(Object.prototype.hasOwnProperty.call(o,t),"Unknown curve "+t),t=o[t]),t instanceof o.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=c,c.prototype.keyPair=function(t){return new u(this,t)},c.prototype.keyFromPrivate=function(t,e){return u.fromPrivate(this,t,e)},c.prototype.keyFromPublic=function(t,e){return u.fromPublic(this,t,e)},c.prototype.genKeyPair=function(t){t||(t={});for(var e=new n({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),s=this.n.sub(new r(2));;){var o=new r(e.generate(i));if(!(o.cmp(s)>0))return o.iaddn(1),this.keyFromPrivate(o)}},c.prototype._truncateToN=function(t,e){var i=8*t.byteLength()-this.n.bitLength();return i>0&&(t=t.ushrn(i)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},c.prototype.sign=function(t,e,i,s){"object"==typeof i&&(s=i,i=null),s||(s={}),e=this.keyFromPrivate(e,i),t=this._truncateToN(new r(t,16));for(var o=this.n.byteLength(),a=e.getPrivate().toArray("be",o),h=t.toArray("be",o),u=new n({hash:this.hash,entropy:a,nonce:h,pers:s.pers,persEnc:s.persEnc||"utf8"}),c=this.n.sub(new r(1)),d=0;;d++){var f=s.k?s.k(d):new r(u.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(c)>=0)){var p=this.g.mul(f);if(!p.isInfinity()){var m=p.getX(),g=m.umod(this.n);if(0!==g.cmpn(0)){var b=f.invm(this.n).mul(g.mul(e.getPrivate()).iadd(t));if(0!==(b=b.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==m.cmp(g)?2:0);return s.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),v^=1),new l({r:g,s:b,recoveryParam:v})}}}}}},c.prototype.verify=function(t,e,i,n){t=this._truncateToN(new r(t,16)),i=this.keyFromPublic(i,n);var s=(e=new l(e,"hex")).r,o=e.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,h=o.invm(this.n),u=h.mul(t).umod(this.n),c=h.mul(s).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,i.getPublic(),c)).isInfinity()&&a.eqXToP(s):!(a=this.g.mulAdd(u,i.getPublic(),c)).isInfinity()&&0===a.getX().umod(this.n).cmp(s)},c.prototype.recoverPubKey=function(t,e,i,n){h((3&i)===i,"The recovery param is more than two bits"),e=new l(e,n);var s=this.n,o=new r(t),a=e.r,u=e.s,c=1&i,d=i>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");a=d?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var f=e.r.invm(s),p=s.sub(o).mul(f).umod(s),m=u.mul(f).umod(s);return this.g.mulAdd(p,a,m)},c.prototype.getKeyRecoveryParam=function(t,e,i,r){if(null!==(e=new l(e,r)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var s;try{s=this.recoverPubKey(t,e,n)}catch(t){continue}if(s.eq(i))return n}throw new Error("Unable to find valid recovery factor")}},1251:(t,e,i)=>{"use strict";var r=i(3785),n=i(953).assert;function s(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=s,s.fromPublic=function(t,e,i){return e instanceof s?e:new s(t,{pub:e,pubEnc:i})},s.fromPrivate=function(t,e,i){return e instanceof s?e:new s(t,{priv:e,privEnc:i})},s.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},s.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},s.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},s.prototype._importPrivate=function(t,e){this.priv=new r(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},s.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?n(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},s.prototype.derive=function(t){return t.validate()||n(t.validate(),"public point not validated"),t.mul(this.priv).getX()},s.prototype.sign=function(t,e,i){return this.ec.sign(t,this,e,i)},s.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},s.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},611:(t,e,i)=>{"use strict";var r=i(3785),n=i(953),s=n.assert;function o(t,e){if(t instanceof o)return t;this._importDER(t,e)||(s(t.r&&t.s,"Signature without r or s"),this.r=new r(t.r,16),this.s=new r(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function h(t,e){var i=t[e.place++];if(!(128&i))return i;var r=15&i;if(0===r||r>4)return!1;for(var n=0,s=0,o=e.place;s<r;s++,o++)n<<=8,n|=t[o],n>>>=0;return!(n<=127)&&(e.place=o,n)}function u(t){for(var e=0,i=t.length-1;!t[e]&&!(128&t[e+1])&&e<i;)e++;return 0===e?t:t.slice(e)}function l(t,e){if(e<128)t.push(e);else{var i=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|i);--i;)t.push(e>>>(i<<3)&255);t.push(e)}}t.exports=o,o.prototype._importDER=function(t,e){t=n.toArray(t,e);var i=new a;if(48!==t[i.place++])return!1;var s=h(t,i);if(!1===s)return!1;if(s+i.place!==t.length)return!1;if(2!==t[i.place++])return!1;var o=h(t,i);if(!1===o)return!1;var u=t.slice(i.place,o+i.place);if(i.place+=o,2!==t[i.place++])return!1;var l=h(t,i);if(!1===l)return!1;if(t.length!==l+i.place)return!1;var c=t.slice(i.place,l+i.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}return this.r=new r(u),this.s=new r(c),this.recoveryParam=null,!0},o.prototype.toDER=function(t){var e=this.r.toArray(),i=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&i[0]&&(i=[0].concat(i)),e=u(e),i=u(i);!(i[0]||128&i[1]);)i=i.slice(1);var r=[2];l(r,e.length),(r=r.concat(e)).push(2),l(r,i.length);var s=r.concat(i),o=[48];return l(o,s.length),o=o.concat(s),n.encode(o,t)}},5980:(t,e,i)=>{"use strict";var r=i(3715),n=i(5427),s=i(953),o=s.assert,a=s.parseBytes,h=i(9087),u=i(3622);function l(t){if(o("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof l))return new l(t);t=n[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=r.sha512}t.exports=l,l.prototype.sign=function(t,e){t=a(t);var i=this.keyFromSecret(e),r=this.hashInt(i.messagePrefix(),t),n=this.g.mul(r),s=this.encodePoint(n),o=this.hashInt(s,i.pubBytes(),t).mul(i.priv()),h=r.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:h,Rencoded:s})},l.prototype.verify=function(t,e,i){t=a(t),e=this.makeSignature(e);var r=this.keyFromPublic(i),n=this.hashInt(e.Rencoded(),r.pubBytes(),t),s=this.g.mul(e.S());return e.R().add(r.pub().mul(n)).eq(s)},l.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return s.intFromLE(t.digest()).umod(this.curve.n)},l.prototype.keyFromPublic=function(t){return h.fromPublic(this,t)},l.prototype.keyFromSecret=function(t){return h.fromSecret(this,t)},l.prototype.makeSignature=function(t){return t instanceof u?t:new u(this,t)},l.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},l.prototype.decodePoint=function(t){var e=(t=s.parseBytes(t)).length-1,i=t.slice(0,e).concat(-129&t[e]),r=0!=(128&t[e]),n=s.intFromLE(i);return this.curve.pointFromY(n,r)},l.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},l.prototype.decodeInt=function(t){return s.intFromLE(t)},l.prototype.isPoint=function(t){return t instanceof this.pointClass}},9087:(t,e,i)=>{"use strict";var r=i(953),n=r.assert,s=r.parseBytes,o=r.cachedProperty;function a(t,e){this.eddsa=t,this._secret=s(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=s(e.pub)}a.fromPublic=function(t,e){return e instanceof a?e:new a(t,{pub:e})},a.fromSecret=function(t,e){return e instanceof a?e:new a(t,{secret:e})},a.prototype.secret=function(){return this._secret},o(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),o(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),o(a,"privBytes",(function(){var t=this.eddsa,e=this.hash(),i=t.encodingLength-1,r=e.slice(0,t.encodingLength);return r[0]&=248,r[i]&=127,r[i]|=64,r})),o(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),o(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),o(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(t){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},a.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},a.prototype.getSecret=function(t){return n(this._secret,"KeyPair is public only"),r.encode(this.secret(),t)},a.prototype.getPublic=function(t){return r.encode(this.pubBytes(),t)},t.exports=a},3622:(t,e,i)=>{"use strict";var r=i(3785),n=i(953),s=n.assert,o=n.cachedProperty,a=n.parseBytes;function h(t,e){this.eddsa=t,"object"!=typeof e&&(e=a(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),s(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof r&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}o(h,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),o(h,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),o(h,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),o(h,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),h.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},h.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},t.exports=h},1037:t=>{t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},953:(t,e,i)=>{"use strict";var r=e,n=i(3785),s=i(9746),o=i(4504);r.assert=s,r.toArray=o.toArray,r.zero2=o.zero2,r.toHex=o.toHex,r.encode=o.encode,r.getNAF=function(t,e,i){var r=new Array(Math.max(t.bitLength(),i)+1);r.fill(0);for(var n=1<<e+1,s=t.clone(),o=0;o<r.length;o++){var a,h=s.andln(n-1);s.isOdd()?(a=h>(n>>1)-1?(n>>1)-h:h,s.isubn(a)):a=0,r[o]=a,s.iushrn(1)}return r},r.getJSF=function(t,e){var i=[[],[]];t=t.clone(),e=e.clone();for(var r,n=0,s=0;t.cmpn(-n)>0||e.cmpn(-s)>0;){var o,a,h=t.andln(3)+n&3,u=e.andln(3)+s&3;3===h&&(h=-1),3===u&&(u=-1),o=0==(1&h)?0:3!=(r=t.andln(7)+n&7)&&5!==r||2!==u?h:-h,i[0].push(o),a=0==(1&u)?0:3!=(r=e.andln(7)+s&7)&&5!==r||2!==h?u:-u,i[1].push(a),2*n===o+1&&(n=1-n),2*s===a+1&&(s=1-s),t.iushrn(1),e.iushrn(1)}return i},r.cachedProperty=function(t,e,i){var r="_"+e;t.prototype[e]=function(){return void 0!==this[r]?this[r]:this[r]=i.call(this)}},r.parseBytes=function(t){return"string"==typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new n(t,"hex","le")}},3785:function(t,e,i){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function s(t,e,i){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var o;"object"==typeof t?t.exports=s:e.BN=s,s.BN=s,s.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:i(5568).Buffer}catch(t){}function a(t,e){var i=t.charCodeAt(e);return i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function h(t,e,i){var r=a(t,i);return i-1>=e&&(r|=a(t,i-1)<<4),r}function u(t,e,i,r){for(var n=0,s=Math.min(t.length,i),o=e;o<s;o++){var a=t.charCodeAt(o)-48;n*=r,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}s.isBN=function(t){return t instanceof s||null!==t&&"object"==typeof t&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===e?this._parseHex(t,n,i):(this._parseBase(t,e,n),"le"===i&&this._initArray(this.toArray(),e,i)))},s.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},s.prototype._initArray=function(t,e,i){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var s,o,a=0;if("be"===i)for(n=t.length-1,s=0;n>=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===i)for(n=0,s=0;n<t.length;n+=3)o=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(t,e,i){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,s=0,o=0;if("be"===i)for(r=t.length-1;r>=e;r-=2)n=h(t,e,r)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(r=(t.length-e)%2==0?e+1:e;r<t.length;r+=2)n=h(t,e,r)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this.strip()},s.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var s=t.length-i,o=s%r,a=Math.min(s,s-o)+i,h=0,l=i;l<a;l+=r)h=u(t,l,l+r,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==o){var c=1;for(h=u(t,l,t.length,e),l=0;l<o;l++)c*=e;this.imuln(c),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this.strip()},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],s=0|e.words[0],o=n*s,a=67108863&o,h=o/67108864|0;i.words[0]=a;for(var u=1;u<r;u++){for(var l=h>>>26,c=67108863&h,d=Math.min(u,e.length-1),f=Math.max(0,u-t.length+1);f<=d;f++){var p=u-f|0;l+=(o=(n=0|t.words[p])*(s=0|e.words[f])+c)/67108864|0,c=67108863&o}i.words[u]=0|c,h=0|l}return 0!==h?i.words[u]=0|h:i.length--,i.strip()}s.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var n=0,s=0,o=0;o<this.length;o++){var a=this.words[o],h=(16777215&(a<<n|s)).toString(16);i=0!=(s=a>>>24-n&16777215)||o!==this.length-1?l[6-h.length]+h+i:h+i,(n+=2)>=26&&(n-=26,o--)}for(0!==s&&(i=s.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var u=c[t],f=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(t);i=(p=p.idivn(f)).isZero()?m+i:l[u-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return r(void 0!==o),this.toArrayLike(o,t,e)},s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,i){var n=this.byteLength(),s=i||Math.max(1,n);r(n<=s,"byte array longer than desired length"),r(s>0,"Requested array length <= 0"),this.strip();var o,a,h="le"===e,u=new t(s),l=this.clone();if(h){for(a=0;!l.isZero();a++)o=l.andln(255),l.iushrn(8),u[a]=o;for(;a<s;a++)u[a]=0}else{for(a=0;a<s-n;a++)u[a]=0;for(a=0;!l.isZero();a++)o=l.andln(255),l.iushrn(8),u[s-a-1]=o}return u},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var i=this._zeroBits(this.words[e]);if(t+=i,26!==i)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},s.prototype.ior=function(t){return r(0==(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=e.length,this.strip()},s.prototype.iand=function(t){return r(0==(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;r<i.length;r++)this.words[r]=e.words[r]^i.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},s.prototype.ixor=function(t){return r(0==(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},s.prototype.iadd=function(t){var e,i,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0,s=0;s<r.length;s++)e=(0|i.words[s])+(0|r.words[s])+n,this.words[s]=67108863&e,n=e>>>26;for(;0!==n&&s<i.length;s++)e=(0|i.words[s])+n,this.words[s]=67108863&e,n=e>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var s=0,o=0;o<r.length;o++)s=(e=(0|i.words[o])-(0|r.words[o])+s)>>26,this.words[o]=67108863&e;for(;0!==s&&o<i.length;o++)s=(e=(0|i.words[o])+s)>>26,this.words[o]=67108863&e;if(0===s&&o<i.length&&i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this.length=Math.max(this.length,o),i!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,i){var r,n,s,o=t.words,a=e.words,h=i.words,u=0,l=0|o[0],c=8191&l,d=l>>>13,f=0|o[1],p=8191&f,m=f>>>13,g=0|o[2],b=8191&g,v=g>>>13,y=0|o[3],w=8191&y,_=y>>>13,M=0|o[4],k=8191&M,x=M>>>13,E=0|o[5],S=8191&E,T=E>>>13,A=0|o[6],I=8191&A,C=A>>>13,B=0|o[7],R=8191&B,P=B>>>13,L=0|o[8],O=8191&L,D=L>>>13,N=0|o[9],j=8191&N,U=N>>>13,F=0|a[0],q=8191&F,z=F>>>13,H=0|a[1],W=8191&H,$=H>>>13,Z=0|a[2],V=8191&Z,K=Z>>>13,G=0|a[3],J=8191&G,Y=G>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],it=8191&et,rt=et>>>13,nt=0|a[6],st=8191&nt,ot=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,lt=0|a[8],ct=8191<,dt=lt>>>13,ft=0|a[9],pt=8191&ft,mt=ft>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(u+(r=Math.imul(c,q))|0)+((8191&(n=(n=Math.imul(c,z))+Math.imul(d,q)|0))<<13)|0;u=((s=Math.imul(d,z))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(p,q),n=(n=Math.imul(p,z))+Math.imul(m,q)|0,s=Math.imul(m,z);var bt=(u+(r=r+Math.imul(c,W)|0)|0)+((8191&(n=(n=n+Math.imul(c,$)|0)+Math.imul(d,W)|0))<<13)|0;u=((s=s+Math.imul(d,$)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,q),n=(n=Math.imul(b,z))+Math.imul(v,q)|0,s=Math.imul(v,z),r=r+Math.imul(p,W)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(m,W)|0,s=s+Math.imul(m,$)|0;var vt=(u+(r=r+Math.imul(c,V)|0)|0)+((8191&(n=(n=n+Math.imul(c,K)|0)+Math.imul(d,V)|0))<<13)|0;u=((s=s+Math.imul(d,K)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(w,q),n=(n=Math.imul(w,z))+Math.imul(_,q)|0,s=Math.imul(_,z),r=r+Math.imul(b,W)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(v,W)|0,s=s+Math.imul(v,$)|0,r=r+Math.imul(p,V)|0,n=(n=n+Math.imul(p,K)|0)+Math.imul(m,V)|0,s=s+Math.imul(m,K)|0;var yt=(u+(r=r+Math.imul(c,J)|0)|0)+((8191&(n=(n=n+Math.imul(c,Y)|0)+Math.imul(d,J)|0))<<13)|0;u=((s=s+Math.imul(d,Y)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(k,q),n=(n=Math.imul(k,z))+Math.imul(x,q)|0,s=Math.imul(x,z),r=r+Math.imul(w,W)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(_,W)|0,s=s+Math.imul(_,$)|0,r=r+Math.imul(b,V)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(v,V)|0,s=s+Math.imul(v,K)|0,r=r+Math.imul(p,J)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(m,J)|0,s=s+Math.imul(m,Y)|0;var wt=(u+(r=r+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;u=((s=s+Math.imul(d,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(S,q),n=(n=Math.imul(S,z))+Math.imul(T,q)|0,s=Math.imul(T,z),r=r+Math.imul(k,W)|0,n=(n=n+Math.imul(k,$)|0)+Math.imul(x,W)|0,s=s+Math.imul(x,$)|0,r=r+Math.imul(w,V)|0,n=(n=n+Math.imul(w,K)|0)+Math.imul(_,V)|0,s=s+Math.imul(_,K)|0,r=r+Math.imul(b,J)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(v,J)|0,s=s+Math.imul(v,Y)|0,r=r+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,tt)|0;var _t=(u+(r=r+Math.imul(c,it)|0)|0)+((8191&(n=(n=n+Math.imul(c,rt)|0)+Math.imul(d,it)|0))<<13)|0;u=((s=s+Math.imul(d,rt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(I,q),n=(n=Math.imul(I,z))+Math.imul(C,q)|0,s=Math.imul(C,z),r=r+Math.imul(S,W)|0,n=(n=n+Math.imul(S,$)|0)+Math.imul(T,W)|0,s=s+Math.imul(T,$)|0,r=r+Math.imul(k,V)|0,n=(n=n+Math.imul(k,K)|0)+Math.imul(x,V)|0,s=s+Math.imul(x,K)|0,r=r+Math.imul(w,J)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,J)|0,s=s+Math.imul(_,Y)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,Q)|0,s=s+Math.imul(v,tt)|0,r=r+Math.imul(p,it)|0,n=(n=n+Math.imul(p,rt)|0)+Math.imul(m,it)|0,s=s+Math.imul(m,rt)|0;var Mt=(u+(r=r+Math.imul(c,st)|0)|0)+((8191&(n=(n=n+Math.imul(c,ot)|0)+Math.imul(d,st)|0))<<13)|0;u=((s=s+Math.imul(d,ot)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(R,q),n=(n=Math.imul(R,z))+Math.imul(P,q)|0,s=Math.imul(P,z),r=r+Math.imul(I,W)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(C,W)|0,s=s+Math.imul(C,$)|0,r=r+Math.imul(S,V)|0,n=(n=n+Math.imul(S,K)|0)+Math.imul(T,V)|0,s=s+Math.imul(T,K)|0,r=r+Math.imul(k,J)|0,n=(n=n+Math.imul(k,Y)|0)+Math.imul(x,J)|0,s=s+Math.imul(x,Y)|0,r=r+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,tt)|0,r=r+Math.imul(b,it)|0,n=(n=n+Math.imul(b,rt)|0)+Math.imul(v,it)|0,s=s+Math.imul(v,rt)|0,r=r+Math.imul(p,st)|0,n=(n=n+Math.imul(p,ot)|0)+Math.imul(m,st)|0,s=s+Math.imul(m,ot)|0;var kt=(u+(r=r+Math.imul(c,ht)|0)|0)+((8191&(n=(n=n+Math.imul(c,ut)|0)+Math.imul(d,ht)|0))<<13)|0;u=((s=s+Math.imul(d,ut)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(O,q),n=(n=Math.imul(O,z))+Math.imul(D,q)|0,s=Math.imul(D,z),r=r+Math.imul(R,W)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(P,W)|0,s=s+Math.imul(P,$)|0,r=r+Math.imul(I,V)|0,n=(n=n+Math.imul(I,K)|0)+Math.imul(C,V)|0,s=s+Math.imul(C,K)|0,r=r+Math.imul(S,J)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(T,J)|0,s=s+Math.imul(T,Y)|0,r=r+Math.imul(k,Q)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(x,Q)|0,s=s+Math.imul(x,tt)|0,r=r+Math.imul(w,it)|0,n=(n=n+Math.imul(w,rt)|0)+Math.imul(_,it)|0,s=s+Math.imul(_,rt)|0,r=r+Math.imul(b,st)|0,n=(n=n+Math.imul(b,ot)|0)+Math.imul(v,st)|0,s=s+Math.imul(v,ot)|0,r=r+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,s=s+Math.imul(m,ut)|0;var xt=(u+(r=r+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;u=((s=s+Math.imul(d,dt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(j,q),n=(n=Math.imul(j,z))+Math.imul(U,q)|0,s=Math.imul(U,z),r=r+Math.imul(O,W)|0,n=(n=n+Math.imul(O,$)|0)+Math.imul(D,W)|0,s=s+Math.imul(D,$)|0,r=r+Math.imul(R,V)|0,n=(n=n+Math.imul(R,K)|0)+Math.imul(P,V)|0,s=s+Math.imul(P,K)|0,r=r+Math.imul(I,J)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(C,J)|0,s=s+Math.imul(C,Y)|0,r=r+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(T,Q)|0,s=s+Math.imul(T,tt)|0,r=r+Math.imul(k,it)|0,n=(n=n+Math.imul(k,rt)|0)+Math.imul(x,it)|0,s=s+Math.imul(x,rt)|0,r=r+Math.imul(w,st)|0,n=(n=n+Math.imul(w,ot)|0)+Math.imul(_,st)|0,s=s+Math.imul(_,ot)|0,r=r+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(v,ht)|0,s=s+Math.imul(v,ut)|0,r=r+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,dt)|0)+Math.imul(m,ct)|0,s=s+Math.imul(m,dt)|0;var Et=(u+(r=r+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,mt)|0)+Math.imul(d,pt)|0))<<13)|0;u=((s=s+Math.imul(d,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(j,W),n=(n=Math.imul(j,$))+Math.imul(U,W)|0,s=Math.imul(U,$),r=r+Math.imul(O,V)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(D,V)|0,s=s+Math.imul(D,K)|0,r=r+Math.imul(R,J)|0,n=(n=n+Math.imul(R,Y)|0)+Math.imul(P,J)|0,s=s+Math.imul(P,Y)|0,r=r+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,s=s+Math.imul(C,tt)|0,r=r+Math.imul(S,it)|0,n=(n=n+Math.imul(S,rt)|0)+Math.imul(T,it)|0,s=s+Math.imul(T,rt)|0,r=r+Math.imul(k,st)|0,n=(n=n+Math.imul(k,ot)|0)+Math.imul(x,st)|0,s=s+Math.imul(x,ot)|0,r=r+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(_,ht)|0,s=s+Math.imul(_,ut)|0,r=r+Math.imul(b,ct)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(v,ct)|0,s=s+Math.imul(v,dt)|0;var St=(u+(r=r+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((s=s+Math.imul(m,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(j,V),n=(n=Math.imul(j,K))+Math.imul(U,V)|0,s=Math.imul(U,K),r=r+Math.imul(O,J)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(D,J)|0,s=s+Math.imul(D,Y)|0,r=r+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,tt)|0,r=r+Math.imul(I,it)|0,n=(n=n+Math.imul(I,rt)|0)+Math.imul(C,it)|0,s=s+Math.imul(C,rt)|0,r=r+Math.imul(S,st)|0,n=(n=n+Math.imul(S,ot)|0)+Math.imul(T,st)|0,s=s+Math.imul(T,ot)|0,r=r+Math.imul(k,ht)|0,n=(n=n+Math.imul(k,ut)|0)+Math.imul(x,ht)|0,s=s+Math.imul(x,ut)|0,r=r+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,dt)|0)+Math.imul(_,ct)|0,s=s+Math.imul(_,dt)|0;var Tt=(u+(r=r+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,pt)|0))<<13)|0;u=((s=s+Math.imul(v,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(j,J),n=(n=Math.imul(j,Y))+Math.imul(U,J)|0,s=Math.imul(U,Y),r=r+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(D,Q)|0,s=s+Math.imul(D,tt)|0,r=r+Math.imul(R,it)|0,n=(n=n+Math.imul(R,rt)|0)+Math.imul(P,it)|0,s=s+Math.imul(P,rt)|0,r=r+Math.imul(I,st)|0,n=(n=n+Math.imul(I,ot)|0)+Math.imul(C,st)|0,s=s+Math.imul(C,ot)|0,r=r+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(T,ht)|0,s=s+Math.imul(T,ut)|0,r=r+Math.imul(k,ct)|0,n=(n=n+Math.imul(k,dt)|0)+Math.imul(x,ct)|0,s=s+Math.imul(x,dt)|0;var At=(u+(r=r+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((s=s+Math.imul(_,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(j,Q),n=(n=Math.imul(j,tt))+Math.imul(U,Q)|0,s=Math.imul(U,tt),r=r+Math.imul(O,it)|0,n=(n=n+Math.imul(O,rt)|0)+Math.imul(D,it)|0,s=s+Math.imul(D,rt)|0,r=r+Math.imul(R,st)|0,n=(n=n+Math.imul(R,ot)|0)+Math.imul(P,st)|0,s=s+Math.imul(P,ot)|0,r=r+Math.imul(I,ht)|0,n=(n=n+Math.imul(I,ut)|0)+Math.imul(C,ht)|0,s=s+Math.imul(C,ut)|0,r=r+Math.imul(S,ct)|0,n=(n=n+Math.imul(S,dt)|0)+Math.imul(T,ct)|0,s=s+Math.imul(T,dt)|0;var It=(u+(r=r+Math.imul(k,pt)|0)|0)+((8191&(n=(n=n+Math.imul(k,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((s=s+Math.imul(x,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(j,it),n=(n=Math.imul(j,rt))+Math.imul(U,it)|0,s=Math.imul(U,rt),r=r+Math.imul(O,st)|0,n=(n=n+Math.imul(O,ot)|0)+Math.imul(D,st)|0,s=s+Math.imul(D,ot)|0,r=r+Math.imul(R,ht)|0,n=(n=n+Math.imul(R,ut)|0)+Math.imul(P,ht)|0,s=s+Math.imul(P,ut)|0,r=r+Math.imul(I,ct)|0,n=(n=n+Math.imul(I,dt)|0)+Math.imul(C,ct)|0,s=s+Math.imul(C,dt)|0;var Ct=(u+(r=r+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((s=s+Math.imul(T,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(j,st),n=(n=Math.imul(j,ot))+Math.imul(U,st)|0,s=Math.imul(U,ot),r=r+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(D,ht)|0,s=s+Math.imul(D,ut)|0,r=r+Math.imul(R,ct)|0,n=(n=n+Math.imul(R,dt)|0)+Math.imul(P,ct)|0,s=s+Math.imul(P,dt)|0;var Bt=(u+(r=r+Math.imul(I,pt)|0)|0)+((8191&(n=(n=n+Math.imul(I,mt)|0)+Math.imul(C,pt)|0))<<13)|0;u=((s=s+Math.imul(C,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,r=Math.imul(j,ht),n=(n=Math.imul(j,ut))+Math.imul(U,ht)|0,s=Math.imul(U,ut),r=r+Math.imul(O,ct)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(D,ct)|0,s=s+Math.imul(D,dt)|0;var Rt=(u+(r=r+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((s=s+Math.imul(P,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(j,ct),n=(n=Math.imul(j,dt))+Math.imul(U,ct)|0,s=Math.imul(U,dt);var Pt=(u+(r=r+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(D,pt)|0))<<13)|0;u=((s=s+Math.imul(D,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Lt=(u+(r=Math.imul(j,pt))|0)+((8191&(n=(n=Math.imul(j,mt))+Math.imul(U,pt)|0))<<13)|0;return u=((s=Math.imul(U,mt))+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,h[0]=gt,h[1]=bt,h[2]=vt,h[3]=yt,h[4]=wt,h[5]=_t,h[6]=Mt,h[7]=kt,h[8]=xt,h[9]=Et,h[10]=St,h[11]=Tt,h[12]=At,h[13]=It,h[14]=Ct,h[15]=Bt,h[16]=Rt,h[17]=Pt,h[18]=Lt,0!==u&&(h[19]=u,i.length++),i};function m(t,e,i){return(new g).mulp(t,e,i)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=f),s.prototype.mulTo=function(t,e){var i,r=this.length+t.length;return i=10===this.length&&10===t.length?p(this,t,e):r<63?f(this,t,e):r<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,s=0;s<i.length-1;s++){var o=n;n=0;for(var a=67108863&r,h=Math.min(s,e.length-1),u=Math.max(0,s-t.length+1);u<=h;u++){var l=s-u,c=(0|t.words[l])*(0|e.words[u]),d=67108863&c;a=67108863&(d=d+a|0),n+=(o=(o=o+(c/67108864|0)|0)+(d>>>26)|0)>>>26,o&=67108863}i.words[s]=a,r=o,o=n}return 0!==r?i.words[s]=r:i.length--,i.strip()}(this,t,e):m(this,t,e),i},g.prototype.makeRBT=function(t){for(var e=new Array(t),i=s.prototype._countBits(t)-1,r=0;r<t;r++)e[r]=this.revBin(r,i,t);return e},g.prototype.revBin=function(t,e,i){if(0===t||t===i-1)return t;for(var r=0,n=0;n<e;n++)r|=(1&t)<<e-n-1,t>>=1;return r},g.prototype.permute=function(t,e,i,r,n,s){for(var o=0;o<s;o++)r[o]=e[t[o]],n[o]=i[t[o]]},g.prototype.transform=function(t,e,i,r,n,s){this.permute(s,t,e,i,r,n);for(var o=1;o<n;o<<=1)for(var a=o<<1,h=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),l=0;l<n;l+=a)for(var c=h,d=u,f=0;f<o;f++){var p=i[l+f],m=r[l+f],g=i[l+f+o],b=r[l+f+o],v=c*g-d*b;b=c*b+d*g,g=v,i[l+f]=p+g,r[l+f]=m+b,i[l+f+o]=p-g,r[l+f+o]=m-b,f!==a&&(v=h*c-u*d,d=h*d+u*c,c=v)}},g.prototype.guessLen13b=function(t,e){var i=1|Math.max(e,t),r=1&i,n=0;for(i=i/2|0;i;i>>>=1)n++;return 1<<n+1+r},g.prototype.conjugate=function(t,e,i){if(!(i<=1))for(var r=0;r<i/2;r++){var n=t[r];t[r]=t[i-r-1],t[i-r-1]=n,n=e[r],e[r]=-e[i-r-1],e[i-r-1]=-n}},g.prototype.normalize13b=function(t,e){for(var i=0,r=0;r<e/2;r++){var n=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+i;t[r]=67108863&n,i=n<67108864?0:n/67108864|0}return t},g.prototype.convert13b=function(t,e,i,n){for(var s=0,o=0;o<e;o++)s+=0|t[o],i[2*o]=8191&s,s>>>=13,i[2*o+1]=8191&s,s>>>=13;for(o=2*e;o<n;++o)i[o]=0;r(0===s),r(0==(-8192&s))},g.prototype.stub=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=0;return e},g.prototype.mulp=function(t,e,i){var r=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(r),s=this.stub(r),o=new Array(r),a=new Array(r),h=new Array(r),u=new Array(r),l=new Array(r),c=new Array(r),d=i.words;d.length=r,this.convert13b(t.words,t.length,o,r),this.convert13b(e.words,e.length,u,r),this.transform(o,s,a,h,r,n),this.transform(u,s,l,c,r,n);for(var f=0;f<r;f++){var p=a[f]*l[f]-h[f]*c[f];h[f]=a[f]*c[f]+h[f]*l[f],a[f]=p}return this.conjugate(a,h,r),this.transform(a,h,d,s,r,n),this.conjugate(d,s,r),this.normalize13b(d,r),i.negative=t.negative^e.negative,i.length=t.length+e.length,i.strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),m(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){r("number"==typeof t),r(t<67108864);for(var e=0,i=0;i<this.length;i++){var n=(0|this.words[i])*t,s=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=s>>>26,this.words[i]=67108863&s}return 0!==e&&(this.words[i]=e,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i<e.length;i++){var r=i/26|0,n=i%26;e[i]=(t.words[r]&1<<n)>>>n}return e}(t);if(0===e.length)return new s(1);for(var i=this,r=0;r<e.length&&0===e[r];r++,i=i.sqr());if(++r<e.length)for(var n=i.sqr();r<e.length;r++,n=n.sqr())0!==e[r]&&(i=i.mul(n));return i},s.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,i=t%26,n=(t-i)/26,s=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&s,h=(0|this.words[e])-a<<i;this.words[e]=h|o,o=a>>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},s.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,i){var n;r("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<<s,h=i;if(n-=o,n=Math.max(0,n),h){for(var u=0;u<o;u++)h.words[u]=this.words[u];h.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=n);u--){var c=0|this.words[u];this.words[u]=l<<26-s|c>>>s,l=c&a}return h&&0!==l&&(h.words[h.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26,n=1<<e;return!(this.length<=i||!(this.words[i]&n))},s.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return r("number"==typeof t),r(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,i){var n,s,o=t.length+i;this._expand(o);var a=0;for(n=0;n<t.length;n++){s=(0|this.words[n+i])+a;var h=(0|t.words[n])*e;a=((s-=67108863&h)>>26)-(h/67108864|0),this.words[n+i]=67108863&s}for(;n<this.length-i;n++)a=(s=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&s;if(0===a)return this.strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(s=-(0|this.words[n])+a)>>26,this.words[n]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,e){var i=(this.length,t.length),r=this.clone(),n=t,o=0|n.words[n.length-1];0!=(i=26-this._countBits(o))&&(n=n.ushln(i),r.iushln(i),o=0|n.words[n.length-1]);var a,h=r.length-n.length;if("mod"!==e){(a=new s(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=r.clone()._ishlnsubmul(n,1,h);0===l.negative&&(r=l,a&&(a.words[h]=1));for(var c=h-1;c>=0;c--){var d=67108864*(0|r.words[n.length+c])+(0|r.words[n.length+c-1]);for(d=Math.min(d/o|0,67108863),r._ishlnsubmul(n,d,c);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(n,1,c),r.isZero()||(r.negative^=1);a&&(a.words[c]=d)}return a&&a.strip(),r.strip(),"div"!==e&&0!==i&&r.iushrn(i),{div:a||null,mod:r}},s.prototype.divmod=function(t,e,i){return r(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),s=i.cmp(r);return s<0||1===n&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,i=0,n=this.length-1;n>=0;n--)i=(e*i+(0|this.words[n]))%t;return i},s.prototype.idivn=function(t){r(t<=67108863);for(var e=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*e;this.words[i]=n/t|0,e=n%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new s(1),o=new s(0),a=new s(0),h=new s(1),u=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++u;for(var l=i.clone(),c=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(l),h.isub(c)),a.iushrn(1),h.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(a),o.isub(h)):(i.isub(e),a.isub(n),h.isub(o))}return{a,b:h,gcd:i.iushln(u)}},s.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new s(1),a=new s(0),h=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var u=0,l=1;0==(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(h),o.iushrn(1);for(var c=0,d=1;0==(i.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(i.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(a)):(i.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var s=e;e=i,i=s}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var s=n,o=i;0!==s&&o<this.length;o++){var a=0|this.words[o];s=(a+=s)>>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){r<n?e=-1:r>n&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new k(t)},s.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},n(y,v),y.prototype.split=function(t,e){for(var i=4194303,r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var s=t.words[9];for(e.words[e.length++]=s&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(o&i)<<4|s>>>22,s=o}s>>>=22,t.words[n-10]=s,0===s&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i<t.length;i++){var r=0|t.words[i];e+=977*r,t.words[i]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(w,v),n(_,v),n(M,v),M.prototype.imulK=function(t){for(var e=0,i=0;i<t.length;i++){var r=19*(0|t.words[i])+e,n=67108863&r;r>>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return b[t]=e,e},k.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},k.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new s(1)).iushrn(2);return this.pow(t,i)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);r(!n.isZero());var a=new s(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);0!==this.pow(l,u).cmp(h);)l.redIAdd(h);for(var c=this.pow(l,n),d=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),p=o;0!==f.cmp(a);){for(var m=f,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var b=this.pow(c,new s(1).iushln(p-g-1));d=d.redMul(b),c=b.redSqr(),f=f.redMul(c),p=g}return d},k.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},k.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var i=new Array(16);i[0]=new s(1).toRed(this),i[1]=t;for(var r=2;r<i.length;r++)i[r]=this.mul(i[r-1],t);var n=i[0],o=0,a=0,h=e.bitLength()%26;for(0===h&&(h=26),r=e.length-1;r>=0;r--){for(var u=e.words[r],l=h-1;l>=0;l--){var c=u>>l&1;n!==i[0]&&(n=this.sqr(n)),0!==c||0!==o?(o<<=1,o|=c,(4==++a||0===r&&0===l)&&(n=this.mul(n,i[o]),a=0,o=0)):a=0}h=26}return n},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new x(t)},n(x,k),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var i=t.mul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=i.nmd(t),this)},2840:(t,e,i)=>{var r=i(9590),n=i(778),s=function(){},o=function(t,e,i){if("function"==typeof e)return o(t,null,e);e||(e={}),i=n(i||s);var a=t._writableState,h=t._readableState,u=e.readable||!1!==e.readable&&t.readable,l=e.writable||!1!==e.writable&&t.writable,c=!1,d=function(){t.writable||f()},f=function(){l=!1,u||i.call(t)},p=function(){u=!1,l||i.call(t)},m=function(e){i.call(t,e?new Error("exited with error code: "+e):null)},g=function(e){i.call(t,e)},b=function(){r.nextTick(v)},v=function(){if(!c)return(!u||h&&h.ended&&!h.destroyed)&&(!l||a&&a.ended&&!a.destroyed)?void 0:i.call(t,new Error("premature close"))},y=function(){t.req.on("finish",f)};return function(t){return t.setHeader&&"function"==typeof t.abort}(t)?(t.on("complete",f),t.on("abort",b),t.req?y():t.on("request",y)):l&&!a&&(t.on("end",d),t.on("close",d)),function(t){return t.stdio&&Array.isArray(t.stdio)&&3===t.stdio.length}(t)&&t.on("exit",m),t.on("end",p),t.on("finish",f),!1!==e.error&&t.on("error",g),t.on("close",b),function(){c=!0,t.removeListener("complete",f),t.removeListener("abort",b),t.removeListener("request",y),t.req&&t.req.removeListener("finish",f),t.removeListener("end",d),t.removeListener("close",d),t.removeListener("finish",f),t.removeListener("exit",m),t.removeListener("end",p),t.removeListener("error",g),t.removeListener("close",b)}};t.exports=o},2114:t=>{"use strict";function e(t,e){for(const i in e)Object.defineProperty(t,i,{value:e[i],enumerable:!0,configurable:!0});return t}t.exports=function(t,i,r){if(!t||"string"==typeof t)throw new TypeError("Please pass an Error to err-code");r||(r={}),"object"==typeof i&&(r=i,i=""),i&&(r.code=i);try{return e(t,r)}catch(i){r.message=t.message,r.stack=t.stack;const n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(t)),e(new n,r)}}},8091:t=>{"use strict";function e(t,e){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var i=Object(t),r=1;r<arguments.length;r++){var n=arguments[r];if(null!=n)for(var s=Object.keys(Object(n)),o=0,a=s.length;o<a;o++){var h=s[o],u=Object.getOwnPropertyDescriptor(n,h);void 0!==u&&u.enumerable&&(i[h]=n[h])}}return i}t.exports={assign:e,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:e})}}},7187:(t,e,i)=>{"use strict";var r,n=i(5108),s="object"==typeof Reflect?Reflect:null,o=s&&"function"==typeof s.apply?s.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)};r=s&&"function"==typeof s.ownKeys?s.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function(t){return t!=t};function h(){h.init.call(this)}t.exports=h,t.exports.once=function(t,e){return new Promise((function(i,r){function n(i){t.removeListener(e,s),r(i)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",n),i([].slice.call(arguments))}v(t,e,s,{once:!0}),"error"!==e&&function(t,e,i){"function"==typeof t.on&&v(t,"error",e,{once:!0})}(t,n)}))},h.EventEmitter=h,h.prototype._events=void 0,h.prototype._eventsCount=0,h.prototype._maxListeners=void 0;var u=10;function l(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?h.defaultMaxListeners:t._maxListeners}function d(t,e,i,r){var s,o,a,h;if(l(i),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,i.listener?i.listener:i),o=t._events),a=o[e]),void 0===a)a=o[e]=i,++t._eventsCount;else if("function"==typeof a?a=o[e]=r?[i,a]:[a,i]:r?a.unshift(i):a.push(i),(s=c(t))>0&&a.length>s&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,h=u,n&&n.warn&&n.warn(h)}return t}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,i){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},n=f.bind(r);return n.listener=i,r.wrapFn=n,n}function m(t,e,i){var r=t._events;if(void 0===r)return[];var n=r[e];return void 0===n?[]:"function"==typeof n?i?[n.listener||n]:[n]:i?function(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}(n):b(n,n.length)}function g(t){var e=this._events;if(void 0!==e){var i=e[t];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function b(t,e){for(var i=new Array(e),r=0;r<e;++r)i[r]=t[r];return i}function v(t,e,i,r){if("function"==typeof t.on)r.once?t.once(e,i):t.on(e,i);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function n(s){r.once&&t.removeEventListener(e,n),i(s)}))}}Object.defineProperty(h,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");u=t}}),h.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},h.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},h.prototype.getMaxListeners=function(){return c(this)},h.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e.push(arguments[i]);var r="error"===t,n=this._events;if(void 0!==n)r=r&&void 0===n.error;else if(!r)return!1;if(r){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var h=n[t];if(void 0===h)return!1;if("function"==typeof h)o(h,this,e);else{var u=h.length,l=b(h,u);for(i=0;i<u;++i)o(l[i],this,e)}return!0},h.prototype.addListener=function(t,e){return d(this,t,e,!1)},h.prototype.on=h.prototype.addListener,h.prototype.prependListener=function(t,e){return d(this,t,e,!0)},h.prototype.once=function(t,e){return l(e),this.on(t,p(this,t,e)),this},h.prototype.prependOnceListener=function(t,e){return l(e),this.prependListener(t,p(this,t,e)),this},h.prototype.removeListener=function(t,e){var i,r,n,s,o;if(l(e),void 0===(r=this._events))return this;if(void 0===(i=r[t]))return this;if(i===e||i.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){for(n=-1,s=i.length-1;s>=0;s--)if(i[s]===e||i[s].listener===e){o=i[s].listener,n=s;break}if(n<0)return this;0===n?i.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(i,n),1===i.length&&(r[t]=i[0]),void 0!==r.removeListener&&this.emit("removeListener",t,o||e)}return this},h.prototype.off=h.prototype.removeListener,h.prototype.removeAllListeners=function(t){var e,i,r;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[t]),this;if(0===arguments.length){var n,s=Object.keys(i);for(r=0;r<s.length;++r)"removeListener"!==(n=s[r])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=i[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},h.prototype.listeners=function(t){return m(this,t,!0)},h.prototype.rawListeners=function(t){return m(this,t,!1)},h.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},h.prototype.listenerCount=g,h.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},3048:(t,e,i)=>{var r=i(9509).Buffer,n=i(2318);t.exports=function(t,e,i,s){if(r.isBuffer(t)||(t=r.from(t,"binary")),e&&(r.isBuffer(e)||(e=r.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var o=i/8,a=r.alloc(o),h=r.alloc(s||0),u=r.alloc(0);o>0||s>0;){var l=new n;l.update(u),l.update(t),e&&l.update(e),u=l.digest();var c=0;if(o>0){var d=a.length-o;c=Math.min(o,u.length),u.copy(a,d,0,c),o-=c}if(c<u.length&&s>0){var f=h.length-s,p=Math.min(s,u.length-c);u.copy(h,f,c,c+p),s-=p}}return u.fill(0),{key:a,iv:h}}},3975:t=>{t.exports=class{constructor(t){if(!(t>0)||0!=(t-1&t))throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(t),this.mask=t-1,this.top=0,this.btm=0,this.next=null}push(t){return void 0===this.buffer[this.top]&&(this.buffer[this.top]=t,this.top=this.top+1&this.mask,!0)}shift(){const t=this.buffer[this.btm];if(void 0!==t)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,t}peek(){return this.buffer[this.btm]}isEmpty(){return void 0===this.buffer[this.btm]}}},1607:(t,e,i)=>{const r=i(3975);t.exports=class{constructor(t){this.hwm=t||16,this.head=new r(this.hwm),this.tail=this.head}push(t){if(!this.head.push(t)){const e=this.head;this.head=e.next=new r(2*this.head.buffer.length),this.head.push(t)}}shift(){const t=this.tail.shift();if(void 0===t&&this.tail.next){const t=this.tail.next;return this.tail.next=null,this.tail=t,this.tail.shift()}return t}peek(){return this.tail.peek()}isEmpty(){return this.head.isEmpty()}}},452:(t,e,i)=>{const{Readable:r}=i(8473),n=i(5054);t.exports=class extends r{constructor(t,e={}){super(e),this._offset=0,this._ready=!1,this._file=t,this._size=t.size,this._chunkSize=e.chunkSize||Math.max(this._size/1e3,204800);const i=new FileReader;i.onload=()=>{this.push(n(i.result))},i.onerror=()=>{this.emit("error",i.error)},this.reader=i,this._generateHeaderBlocks(t,e,((t,e)=>{if(t)return this.emit("error",t);Array.isArray(e)&&e.forEach((t=>this.push(t))),this._ready=!0,this.emit("_ready")}))}_generateHeaderBlocks(t,e,i){i(null,[])}_read(){if(!this._ready)return void this.once("_ready",this._read.bind(this));const t=this._offset;let e=this._offset+this._chunkSize;if(e>this._size&&(e=this._size),t===this._size)return this.destroy(),void this.push(null);this.reader.readAsArrayBuffer(this._file.slice(t,e)),this._offset=e}destroy(){if(this._file=null,this.reader){this.reader.onload=null,this.reader.onerror=null;try{this.reader.abort()}catch(t){}}this.reader=null}}},9804:t=>{var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString;t.exports=function(t,r,n){if("[object Function]"!==i.call(r))throw new TypeError("iterator must be a function");var s=t.length;if(s===+s)for(var o=0;o<s;o++)r.call(n,t[o],o,t);else for(var a in t)e.call(t,a)&&r.call(n,t[a],a,t)}},7648:t=>{"use strict";var e="Function.prototype.bind called on incompatible ",i=Array.prototype.slice,r=Object.prototype.toString,n="[object Function]";t.exports=function(t){var s=this;if("function"!=typeof s||r.call(s)!==n)throw new TypeError(e+s);for(var o,a=i.call(arguments,1),h=function(){if(this instanceof o){var e=s.apply(this,a.concat(i.call(arguments)));return Object(e)===e?e:this}return s.apply(t,a.concat(i.call(arguments)))},u=Math.max(0,s.length-a.length),l=[],c=0;c<u;c++)l.push("$"+c);if(o=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(h),s.prototype){var d=function(){};d.prototype=s.prototype,o.prototype=new d,d.prototype=null}return o}},8612:(t,e,i)=>{"use strict";var r=i(7648);t.exports=Function.prototype.bind||r},5177:t=>{t.exports=function(){if("undefined"==typeof globalThis)return null;var t={RTCPeerConnection:globalThis.RTCPeerConnection||globalThis.mozRTCPeerConnection||globalThis.webkitRTCPeerConnection,RTCSessionDescription:globalThis.RTCSessionDescription||globalThis.mozRTCSessionDescription||globalThis.webkitRTCSessionDescription,RTCIceCandidate:globalThis.RTCIceCandidate||globalThis.mozRTCIceCandidate||globalThis.webkitRTCIceCandidate};return t.RTCPeerConnection?t:null}},210:(t,e,i)=>{"use strict";var r,n=SyntaxError,s=Function,o=TypeError,a=function(t){try{return s('"use strict"; return ('+t+").constructor;")()}catch(t){}},h=Object.getOwnPropertyDescriptor;if(h)try{h({},"")}catch(t){h=null}var u=function(){throw new o},l=h?function(){try{return u}catch(t){try{return h(arguments,"callee").get}catch(t){return u}}}():u,c=i(1405)(),d=Object.getPrototypeOf||function(t){return t.__proto__},f={},p="undefined"==typeof Uint8Array?r:d(Uint8Array),m={"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":c?d([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":s,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":c?d(d([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&c?d((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&c?d((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":c?d(""[Symbol.iterator]()):r,"%Symbol%":c?Symbol:r,"%SyntaxError%":n,"%ThrowTypeError%":l,"%TypedArray%":p,"%TypeError%":o,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet},g=function t(e){var i;if("%AsyncFunction%"===e)i=a("async function () {}");else if("%GeneratorFunction%"===e)i=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)i=a("async function* () {}");else if("%AsyncGenerator%"===e){var r=t("%AsyncGeneratorFunction%");r&&(i=r.prototype)}else if("%AsyncIteratorPrototype%"===e){var n=t("%AsyncGenerator%");n&&(i=d(n.prototype))}return m[e]=i,i},b={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=i(8612),y=i(7642),w=v.call(Function.call,Array.prototype.concat),_=v.call(Function.apply,Array.prototype.splice),M=v.call(Function.call,String.prototype.replace),k=v.call(Function.call,String.prototype.slice),x=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,E=/\\(\\)?/g,S=function(t){var e=k(t,0,1),i=k(t,-1);if("%"===e&&"%"!==i)throw new n("invalid intrinsic syntax, expected closing `%`");if("%"===i&&"%"!==e)throw new n("invalid intrinsic syntax, expected opening `%`");var r=[];return M(t,x,(function(t,e,i,n){r[r.length]=i?M(n,E,"$1"):e||t})),r},T=function(t,e){var i,r=t;if(y(b,r)&&(r="%"+(i=b[r])[0]+"%"),y(m,r)){var s=m[r];if(s===f&&(s=g(r)),void 0===s&&!e)throw new o("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:s}}throw new n("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new o('"allowMissing" argument must be a boolean');var i=S(t),r=i.length>0?i[0]:"",s=T("%"+r+"%",e),a=s.name,u=s.value,l=!1,c=s.alias;c&&(r=c[0],_(i,w([0,1],c)));for(var d=1,f=!0;d<i.length;d+=1){var p=i[d],g=k(p,0,1),b=k(p,-1);if(('"'===g||"'"===g||"`"===g||'"'===b||"'"===b||"`"===b)&&g!==b)throw new n("property names with quotes must have matching quotes");if("constructor"!==p&&f||(l=!0),y(m,a="%"+(r+="."+p)+"%"))u=m[a];else if(null!=u){if(!(p in u)){if(!e)throw new o("base intrinsic for "+t+" exists, but the property is not available.");return}if(h&&d+1>=i.length){var v=h(u,p);u=(f=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:u[p]}else f=y(u,p),u=u[p];f&&!l&&(m[a]=u)}}return u}},1405:(t,e,i)=>{"use strict";var r="undefined"!=typeof Symbol&&Symbol,n=i(5419);t.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&n()}},5419:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),i=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(i))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(t,e);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},6410:(t,e,i)=>{"use strict";var r=i(5419);t.exports=function(){return r()&&!!Symbol.toStringTag}},7642:(t,e,i)=>{"use strict";var r=i(8612);t.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},3349:(t,e,i)=>{"use strict";var r=i(9509).Buffer,n=i(8473).Transform;function s(t){n.call(this),this._block=r.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}i(5717)(s,n),s.prototype._transform=function(t,e,i){var r=null;try{this.update(t,e)}catch(t){r=t}i(r)},s.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},s.prototype.update=function(t,e){if(function(t,e){if(!r.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer")}(t),this._finalized)throw new Error("Digest already called");r.isBuffer(t)||(t=r.from(t,e));for(var i=this._block,n=0;this._blockOffset+t.length-n>=this._blockSize;){for(var s=this._blockOffset;s<this._blockSize;)i[s++]=t[n++];this._update(),this._blockOffset=0}for(;n<t.length;)i[this._blockOffset++]=t[n++];for(var o=0,a=8*t.length;a>0;++o)this._length[o]+=a,(a=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*a);return this},s.prototype._update=function(){throw new Error("_update is not implemented")},s.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var i=0;i<4;++i)this._length[i]=0;return e},s.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=s},3715:(t,e,i)=>{var r=e;r.utils=i(6436),r.common=i(5772),r.sha=i(9041),r.ripemd=i(2949),r.hmac=i(2344),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},5772:(t,e,i)=>{"use strict";var r=i(6436),n=i(9746);function s(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=s,s.prototype.update=function(t,e){if(t=r.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var i=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-i,t.length),0===this.pending.length&&(this.pending=null),t=r.join32(t,0,t.length-i,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this},s.prototype.digest=function(t){return this.update(this._pad()),n(null===this.pending),this._digest(t)},s.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,i=e-(t+this.padLength)%e,r=new Array(i+this.padLength);r[0]=128;for(var n=1;n<i;n++)r[n]=0;if(t<<=3,"big"===this.endian){for(var s=8;s<this.padLength;s++)r[n++]=0;r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=t>>>24&255,r[n++]=t>>>16&255,r[n++]=t>>>8&255,r[n++]=255&t}else for(r[n++]=255&t,r[n++]=t>>>8&255,r[n++]=t>>>16&255,r[n++]=t>>>24&255,r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=0,s=8;s<this.padLength;s++)r[n++]=0;return r}},2344:(t,e,i)=>{"use strict";var r=i(6436),n=i(9746);function s(t,e,i){if(!(this instanceof s))return new s(t,e,i);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(r.toArray(e,i))}t.exports=s,s.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),n(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},s.prototype.update=function(t,e){return this.inner.update(t,e),this},s.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},2949:(t,e,i)=>{"use strict";var r=i(6436),n=i(5772),s=r.rotl32,o=r.sum32,a=r.sum32_3,h=r.sum32_4,u=n.BlockHash;function l(){if(!(this instanceof l))return new l;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function c(t,e,i,r){return t<=15?e^i^r:t<=31?e&i|~e&r:t<=47?(e|~i)^r:t<=63?e&r|i&~r:e^(i|~r)}function d(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function f(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}r.inherits(l,u),e.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(t,e){for(var i=this.h[0],r=this.h[1],n=this.h[2],u=this.h[3],l=this.h[4],v=i,y=r,w=n,_=u,M=l,k=0;k<80;k++){var x=o(s(h(i,c(k,r,n,u),t[p[k]+e],d(k)),g[k]),l);i=l,l=u,u=s(n,10),n=r,r=x,x=o(s(h(v,c(79-k,y,w,_),t[m[k]+e],f(k)),b[k]),M),v=M,M=_,_=s(w,10),w=y,y=x}x=a(this.h[1],n,_),this.h[1]=a(this.h[2],u,M),this.h[2]=a(this.h[3],l,v),this.h[3]=a(this.h[4],i,y),this.h[4]=a(this.h[0],r,w),this.h[0]=x},l.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h,"little"):r.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],m=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],b=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},9041:(t,e,i)=>{"use strict";e.sha1=i(4761),e.sha224=i(799),e.sha256=i(9344),e.sha384=i(772),e.sha512=i(5900)},4761:(t,e,i)=>{"use strict";var r=i(6436),n=i(5772),s=i(7038),o=r.rotl32,a=r.sum32,h=r.sum32_5,u=s.ft_1,l=n.BlockHash,c=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}r.inherits(d,l),t.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(t,e){for(var i=this.W,r=0;r<16;r++)i[r]=t[e+r];for(;r<i.length;r++)i[r]=o(i[r-3]^i[r-8]^i[r-14]^i[r-16],1);var n=this.h[0],s=this.h[1],l=this.h[2],d=this.h[3],f=this.h[4];for(r=0;r<i.length;r++){var p=~~(r/20),m=h(o(n,5),u(p,s,l,d),f,i[r],c[p]);f=d,d=l,l=o(s,30),s=n,n=m}this.h[0]=a(this.h[0],n),this.h[1]=a(this.h[1],s),this.h[2]=a(this.h[2],l),this.h[3]=a(this.h[3],d),this.h[4]=a(this.h[4],f)},d.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},799:(t,e,i)=>{"use strict";var r=i(6436),n=i(9344);function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}r.inherits(s,n),t.exports=s,s.blockSize=512,s.outSize=224,s.hmacStrength=192,s.padLength=64,s.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h.slice(0,7),"big"):r.split32(this.h.slice(0,7),"big")}},9344:(t,e,i)=>{"use strict";var r=i(6436),n=i(5772),s=i(7038),o=i(9746),a=r.sum32,h=r.sum32_4,u=r.sum32_5,l=s.ch32,c=s.maj32,d=s.s0_256,f=s.s1_256,p=s.g0_256,m=s.g1_256,g=n.BlockHash,b=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=b,this.W=new Array(64)}r.inherits(v,g),t.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(t,e){for(var i=this.W,r=0;r<16;r++)i[r]=t[e+r];for(;r<i.length;r++)i[r]=h(m(i[r-2]),i[r-7],p(i[r-15]),i[r-16]);var n=this.h[0],s=this.h[1],g=this.h[2],b=this.h[3],v=this.h[4],y=this.h[5],w=this.h[6],_=this.h[7];for(o(this.k.length===i.length),r=0;r<i.length;r++){var M=u(_,f(v),l(v,y,w),this.k[r],i[r]),k=a(d(n),c(n,s,g));_=w,w=y,y=v,v=a(b,M),b=g,g=s,s=n,n=a(M,k)}this.h[0]=a(this.h[0],n),this.h[1]=a(this.h[1],s),this.h[2]=a(this.h[2],g),this.h[3]=a(this.h[3],b),this.h[4]=a(this.h[4],v),this.h[5]=a(this.h[5],y),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],_)},v.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},772:(t,e,i)=>{"use strict";var r=i(6436),n=i(5900);function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}r.inherits(s,n),t.exports=s,s.blockSize=1024,s.outSize=384,s.hmacStrength=192,s.padLength=128,s.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h.slice(0,12),"big"):r.split32(this.h.slice(0,12),"big")}},5900:(t,e,i)=>{"use strict";var r=i(6436),n=i(5772),s=i(9746),o=r.rotr64_hi,a=r.rotr64_lo,h=r.shr64_hi,u=r.shr64_lo,l=r.sum64,c=r.sum64_hi,d=r.sum64_lo,f=r.sum64_4_hi,p=r.sum64_4_lo,m=r.sum64_5_hi,g=r.sum64_5_lo,b=n.BlockHash,v=[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];function y(){if(!(this instanceof y))return new y;b.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function w(t,e,i,r,n){var s=t&i^~t&n;return s<0&&(s+=4294967296),s}function _(t,e,i,r,n,s){var o=e&r^~e&s;return o<0&&(o+=4294967296),o}function M(t,e,i,r,n){var s=t&i^t&n^i&n;return s<0&&(s+=4294967296),s}function k(t,e,i,r,n,s){var o=e&r^e&s^r&s;return o<0&&(o+=4294967296),o}function x(t,e){var i=o(t,e,28)^o(e,t,2)^o(e,t,7);return i<0&&(i+=4294967296),i}function E(t,e){var i=a(t,e,28)^a(e,t,2)^a(e,t,7);return i<0&&(i+=4294967296),i}function S(t,e){var i=a(t,e,14)^a(t,e,18)^a(e,t,9);return i<0&&(i+=4294967296),i}function T(t,e){var i=o(t,e,1)^o(t,e,8)^h(t,e,7);return i<0&&(i+=4294967296),i}function A(t,e){var i=a(t,e,1)^a(t,e,8)^u(t,e,7);return i<0&&(i+=4294967296),i}function I(t,e){var i=a(t,e,19)^a(e,t,29)^u(t,e,6);return i<0&&(i+=4294967296),i}r.inherits(y,b),t.exports=y,y.blockSize=1024,y.outSize=512,y.hmacStrength=192,y.padLength=128,y.prototype._prepareBlock=function(t,e){for(var i=this.W,r=0;r<32;r++)i[r]=t[e+r];for(;r<i.length;r+=2){var n=(g=i[r-4],b=i[r-3],v=void 0,(v=o(g,b,19)^o(b,g,29)^h(g,b,6))<0&&(v+=4294967296),v),s=I(i[r-4],i[r-3]),a=i[r-14],u=i[r-13],l=T(i[r-30],i[r-29]),c=A(i[r-30],i[r-29]),d=i[r-32],m=i[r-31];i[r]=f(n,s,a,u,l,c,d,m),i[r+1]=p(n,s,a,u,l,c,d,m)}var g,b,v},y.prototype._update=function(t,e){this._prepareBlock(t,e);var i,r,n,a=this.W,h=this.h[0],u=this.h[1],f=this.h[2],p=this.h[3],b=this.h[4],v=this.h[5],y=this.h[6],T=this.h[7],A=this.h[8],I=this.h[9],C=this.h[10],B=this.h[11],R=this.h[12],P=this.h[13],L=this.h[14],O=this.h[15];s(this.k.length===a.length);for(var D=0;D<a.length;D+=2){var N=L,j=O,U=(n=void 0,(n=o(i=A,r=I,14)^o(i,r,18)^o(r,i,9))<0&&(n+=4294967296),n),F=S(A,I),q=w(A,0,C,0,R),z=_(0,I,0,B,0,P),H=this.k[D],W=this.k[D+1],$=a[D],Z=a[D+1],V=m(N,j,U,F,q,z,H,W,$,Z),K=g(N,j,U,F,q,z,H,W,$,Z);N=x(h,u),j=E(h,u),U=M(h,0,f,0,b),F=k(0,u,0,p,0,v);var G=c(N,j,U,F),J=d(N,j,U,F);L=R,O=P,R=C,P=B,C=A,B=I,A=c(y,T,V,K),I=d(T,T,V,K),y=b,T=v,b=f,v=p,f=h,p=u,h=c(V,K,G,J),u=d(V,K,G,J)}l(this.h,0,h,u),l(this.h,2,f,p),l(this.h,4,b,v),l(this.h,6,y,T),l(this.h,8,A,I),l(this.h,10,C,B),l(this.h,12,R,P),l(this.h,14,L,O)},y.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},7038:(t,e,i)=>{"use strict";var r=i(6436).rotr32;function n(t,e,i){return t&e^~t&i}function s(t,e,i){return t&e^t&i^e&i}function o(t,e,i){return t^e^i}e.ft_1=function(t,e,i,r){return 0===t?n(e,i,r):1===t||3===t?o(e,i,r):2===t?s(e,i,r):void 0},e.ch32=n,e.maj32=s,e.p32=o,e.s0_256=function(t){return r(t,2)^r(t,13)^r(t,22)},e.s1_256=function(t){return r(t,6)^r(t,11)^r(t,25)},e.g0_256=function(t){return r(t,7)^r(t,18)^t>>>3},e.g1_256=function(t){return r(t,17)^r(t,19)^t>>>10}},6436:(t,e,i)=>{"use strict";var r=i(9746),n=i(5717);function s(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function h(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=n,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var i=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)i.push(parseInt(t[n]+t[n+1],16))}else for(var r=0,n=0;n<t.length;n++){var o=t.charCodeAt(n);o<128?i[r++]=o:o<2048?(i[r++]=o>>6|192,i[r++]=63&o|128):s(t,n)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++n)),i[r++]=o>>18|240,i[r++]=o>>12&63|128,i[r++]=o>>6&63|128,i[r++]=63&o|128):(i[r++]=o>>12|224,i[r++]=o>>6&63|128,i[r++]=63&o|128)}else for(n=0;n<t.length;n++)i[n]=0|t[n];return i},e.toHex=function(t){for(var e="",i=0;i<t.length;i++)e+=a(t[i].toString(16));return e},e.htonl=o,e.toHex32=function(t,e){for(var i="",r=0;r<t.length;r++){var n=t[r];"little"===e&&(n=o(n)),i+=h(n.toString(16))}return i},e.zero2=a,e.zero8=h,e.join32=function(t,e,i,n){var s=i-e;r(s%4==0);for(var o=new Array(s/4),a=0,h=e;a<o.length;a++,h+=4){var u;u="big"===n?t[h]<<24|t[h+1]<<16|t[h+2]<<8|t[h+3]:t[h+3]<<24|t[h+2]<<16|t[h+1]<<8|t[h],o[a]=u>>>0}return o},e.split32=function(t,e){for(var i=new Array(4*t.length),r=0,n=0;r<t.length;r++,n+=4){var s=t[r];"big"===e?(i[n]=s>>>24,i[n+1]=s>>>16&255,i[n+2]=s>>>8&255,i[n+3]=255&s):(i[n+3]=s>>>24,i[n+2]=s>>>16&255,i[n+1]=s>>>8&255,i[n]=255&s)}return i},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,i){return t+e+i>>>0},e.sum32_4=function(t,e,i,r){return t+e+i+r>>>0},e.sum32_5=function(t,e,i,r,n){return t+e+i+r+n>>>0},e.sum64=function(t,e,i,r){var n=t[e],s=r+t[e+1]>>>0,o=(s<r?1:0)+i+n;t[e]=o>>>0,t[e+1]=s},e.sum64_hi=function(t,e,i,r){return(e+r>>>0<e?1:0)+t+i>>>0},e.sum64_lo=function(t,e,i,r){return e+r>>>0},e.sum64_4_hi=function(t,e,i,r,n,s,o,a){var h=0,u=e;return h+=(u=u+r>>>0)<e?1:0,h+=(u=u+s>>>0)<s?1:0,t+i+n+o+(h+=(u=u+a>>>0)<a?1:0)>>>0},e.sum64_4_lo=function(t,e,i,r,n,s,o,a){return e+r+s+a>>>0},e.sum64_5_hi=function(t,e,i,r,n,s,o,a,h,u){var l=0,c=e;return l+=(c=c+r>>>0)<e?1:0,l+=(c=c+s>>>0)<s?1:0,l+=(c=c+a>>>0)<a?1:0,t+i+n+o+h+(l+=(c=c+u>>>0)<u?1:0)>>>0},e.sum64_5_lo=function(t,e,i,r,n,s,o,a,h,u){return e+r+s+a+u>>>0},e.rotr64_hi=function(t,e,i){return(e<<32-i|t>>>i)>>>0},e.rotr64_lo=function(t,e,i){return(t<<32-i|e>>>i)>>>0},e.shr64_hi=function(t,e,i){return t>>>i},e.shr64_lo=function(t,e,i){return(t<<32-i|e>>>i)>>>0}},2156:(t,e,i)=>{"use strict";var r=i(3715),n=i(4504),s=i(9746);function o(t){if(!(this instanceof o))return new o(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=n.toArray(t.entropy,t.entropyEnc||"hex"),i=n.toArray(t.nonce,t.nonceEnc||"hex"),r=n.toArray(t.pers,t.persEnc||"hex");s(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,i,r)}t.exports=o,o.prototype._init=function(t,e,i){var r=t.concat(e).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(r),this._reseed=1,this.reseedInterval=281474976710656},o.prototype._hmac=function(){return new r.hmac(this.hash,this.K)},o.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},o.prototype.reseed=function(t,e,i,r){"string"!=typeof e&&(r=i,i=e,e=null),t=n.toArray(t,e),i=n.toArray(i,r),s(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(i||[])),this._reseed=1},o.prototype.generate=function(t,e,i,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(r=i,i=e,e=null),i&&(i=n.toArray(i,r||"hex"),this._update(i));for(var s=[];s.length<t;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var o=s.slice(0,t);return this._update(i),this._reseed++,n.encode(o,e)}},9267:(t,e,i)=>{var r=i(8501),n=i(8575),s=t.exports;for(var o in r)r.hasOwnProperty(o)&&(s[o]=r[o]);function a(t){if("string"==typeof t&&(t=n.parse(t)),t.protocol||(t.protocol="https:"),"https:"!==t.protocol)throw new Error('Protocol "'+t.protocol+'" not supported. Expected "https:"');return t}s.request=function(t,e){return t=a(t),r.request.call(this,t,e)},s.get=function(t,e){return t=a(t),r.get.call(this,t,e)}},4137:(t,e,i)=>{"use strict";var r=i(8764).Buffer;const n=i(3029),s=i(7187).EventEmitter,o=i(4375);t.exports=class extends s{constructor(t,e){if(e||(e={}),super(),this.chunkLength=Number(t),!this.chunkLength)throw new Error("First argument must be a chunk length");this.closed=!1,this.destroyed=!1,this.length=Number(e.length)||1/0,this.name=e.name||"idb-chunk-store",this.length!==1/0&&(this.lastChunkLength=this.length%this.chunkLength||this.chunkLength,this.lastChunkIndex=Math.ceil(this.length/this.chunkLength)-1),this.dbPromise=n.openDB(this.name,void 0,{upgrade:t=>{t.createObjectStore("chunks")},blocking:()=>{this.close()},terminated:()=>{this.closed=!0,this.emit("error",new Error("Database unexpectedly closed"))}})}put(t,e,i=(()=>{})){if(this.closed)return o((()=>i(new Error("Storage is closed"))));const r=t===this.lastChunkIndex;return r&&e.length!==this.lastChunkLength?o((()=>i(new Error("Last chunk length must be "+this.lastChunkLength)))):r||e.length===this.chunkLength?(0===(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)).byteOffset&&e.byteLength===e.buffer.byteLength||(e=e.slice()),void(async()=>{try{const i=await this.dbPromise;await i.put("chunks",e,t)}catch(t){return void i(t)}i(null)})()):o((()=>i(new Error("Chunk length must be "+this.chunkLength))))}get(t,e,i=(()=>{})){return"function"==typeof e?this.get(t,{},e):(e||(e={}),this.closed?o((()=>i(new Error("Storage is closed")))):void(async()=>{let n;try{const e=await this.dbPromise;n=await e.get("chunks",t)}catch(t){return void i(t)}if(null==n){const t=new Error("Chunk not found");return t.notFound=!0,void i(t)}let s=r.from(n.buffer,n.byteOffset,n.byteLength);const o=e.offset||0,a=e.length||s.length-o;0===o&&a===s.length||(s=s.slice(o,a+o)),i(null,s)})())}close(t=(()=>{})){if(this.closed)return o((()=>t(new Error("Storage is closed"))));this.closed=!0,(async()=>{try{(await this.dbPromise).close()}catch(e){return void t(e)}t(null)})()}destroy(t=(()=>{})){return this.closed?o((()=>t(new Error("Storage is closed")))):this.destroyed?o((()=>t(new Error("Storage is destroyed")))):(this.destroyed=!0,void this.close((async e=>{if(e)t(e);else{try{await n.deleteDB(this.name)}catch(e){return void t(e)}t(null)}})))}}},3029:(t,e,i)=>{"use strict";let r,n;i.r(e),i.d(e,{deleteDB:()=>m,openDB:()=>p,unwrap:()=>f,wrap:()=>d});const s=new WeakMap,o=new WeakMap,a=new WeakMap,h=new WeakMap,u=new WeakMap;let l={get(t,e,i){if(t instanceof IDBTransaction){if("done"===e)return o.get(t);if("objectStoreNames"===e)return t.objectStoreNames||a.get(t);if("store"===e)return i.objectStoreNames[1]?void 0:i.objectStore(i.objectStoreNames[0])}return d(t[e])},set:(t,e,i)=>(t[e]=i,!0),has:(t,e)=>t instanceof IDBTransaction&&("done"===e||"store"===e)||e in t};function c(t){return"function"==typeof t?(e=t)!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(n||(n=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(f(this),t),d(s.get(this))}:function(...t){return d(e.apply(f(this),t))}:function(t,...i){const r=e.call(f(this),t,...i);return a.set(r,t.sort?t.sort():[t]),d(r)}:(t instanceof IDBTransaction&&function(t){if(o.has(t))return;const e=new Promise(((e,i)=>{const r=()=>{t.removeEventListener("complete",n),t.removeEventListener("error",s),t.removeEventListener("abort",s)},n=()=>{e(),r()},s=()=>{i(t.error||new DOMException("AbortError","AbortError")),r()};t.addEventListener("complete",n),t.addEventListener("error",s),t.addEventListener("abort",s)}));o.set(t,e)}(t),i=t,(r||(r=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((t=>i instanceof t))?new Proxy(t,l):t);var e,i}function d(t){if(t instanceof IDBRequest)return function(t){const e=new Promise(((e,i)=>{const r=()=>{t.removeEventListener("success",n),t.removeEventListener("error",s)},n=()=>{e(d(t.result)),r()},s=()=>{i(t.error),r()};t.addEventListener("success",n),t.addEventListener("error",s)}));return e.then((e=>{e instanceof IDBCursor&&s.set(e,t)})).catch((()=>{})),u.set(e,t),e}(t);if(h.has(t))return h.get(t);const e=c(t);return e!==t&&(h.set(t,e),u.set(e,t)),e}const f=t=>u.get(t);function p(t,e,{blocked:i,upgrade:r,blocking:n,terminated:s}={}){const o=indexedDB.open(t,e),a=d(o);return r&&o.addEventListener("upgradeneeded",(t=>{r(d(o.result),t.oldVersion,t.newVersion,d(o.transaction))})),i&&o.addEventListener("blocked",(()=>i())),a.then((t=>{s&&t.addEventListener("close",(()=>s())),n&&t.addEventListener("versionchange",(()=>n()))})).catch((()=>{})),a}function m(t,{blocked:e}={}){const i=indexedDB.deleteDatabase(t);return e&&i.addEventListener("blocked",(()=>e())),d(i).then((()=>{}))}const g=["get","getKey","getAll","getAllKeys","count"],b=["put","add","delete","clear"],v=new Map;function y(t,e){if(!(t instanceof IDBDatabase)||e in t||"string"!=typeof e)return;if(v.get(e))return v.get(e);const i=e.replace(/FromIndex$/,""),r=e!==i,n=b.includes(i);if(!(i in(r?IDBIndex:IDBObjectStore).prototype)||!n&&!g.includes(i))return;const s=async function(t,...e){const s=this.transaction(t,n?"readwrite":"readonly");let o=s.store;return r&&(o=o.index(e.shift())),(await Promise.all([o[i](...e),n&&s.done]))[0]};return v.set(e,s),s}var w;w=l,l={...w,get:(t,e,i)=>y(t,e)||w.get(t,e,i),has:(t,e)=>!!y(t,e)||w.has(t,e)}},645:(t,e)=>{e.read=function(t,e,i,r,n){var s,o,a=8*n-r-1,h=(1<<a)-1,u=h>>1,l=-7,c=i?n-1:0,d=i?-1:1,f=t[e+c];for(c+=d,s=f&(1<<-l)-1,f>>=-l,l+=a;l>0;s=256*s+t[e+c],c+=d,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=r;l>0;o=256*o+t[e+c],c+=d,l-=8);if(0===s)s=1-u;else{if(s===h)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,r),s-=u}return(f?-1:1)*o*Math.pow(2,s-r)},e.write=function(t,e,i,r,n,s){var o,a,h,u=8*s-n-1,l=(1<<u)-1,c=l>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:s-1,p=r?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-o))<1&&(o--,h*=2),(e+=o+c>=1?d/h:d*Math.pow(2,1-c))*h>=2&&(o++,h/=2),o+c>=l?(a=0,o=l):o+c>=1?(a=(e*h-1)*Math.pow(2,n),o+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,n),o=0));n>=8;t[i+f]=255&a,f+=p,a/=256,n-=8);for(o=o<<n|a,u+=n;u>0;t[i+f]=255&o,f+=p,o/=256,u-=8);t[i+f-p]|=128*m}},3700:(t,e,i)=>{const r=i(4375);t.exports=class{constructor(t){if(this.store=t,this.chunkLength=t.chunkLength,!this.store||!this.store.get||!this.store.put)throw new Error("First argument must be abstract-chunk-store compliant");this.mem=[]}put(t,e,i=(()=>{})){this.mem[t]=e,this.store.put(t,e,(e=>{this.mem[t]=null,i(e)}))}get(t,e,i=(()=>{})){if("function"==typeof e)return this.get(t,null,e);let n=this.mem[t];if(!n)return this.store.get(t,e,i);e||(e={});const s=e.offset||0,o=e.length||n.length-s;0===s&&o===n.length||(n=n.slice(s,o+s)),r((()=>i(null,n)))}close(t=(()=>{})){this.store.close(t)}destroy(t=(()=>{})){this.store.destroy(t)}}},5717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}}},2584:(t,e,i)=>{"use strict";var r=i(6410)(),n=i(1924)("Object.prototype.toString"),s=function(t){return!(r&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===n(t)},o=function(t){return!!s(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==n(t)&&"[object Function]"===n(t.callee)},a=function(){return s(arguments)}();s.isLegacyArguments=o,t.exports=a?s:o},4264:t=>{t.exports=function(t){for(var e=0,i=t.length;e<i;++e)if(t.charCodeAt(e)>127)return!1;return!0}},8662:(t,e,i)=>{"use strict";var r,n=Object.prototype.toString,s=Function.prototype.toString,o=/^\s*(?:function)?\*/,a=i(6410)(),h=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(o.test(s.call(t)))return!0;if(!a)return"[object GeneratorFunction]"===n.call(t);if(!h)return!1;if(void 0===r){var e=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(t){}}();r=!!e&&h(e)}return h(t)===r}},8611:t=>{"use strict";t.exports=function(t){return t!=t}},360:(t,e,i)=>{"use strict";var r=i(5559),n=i(4289),s=i(8611),o=i(9415),a=i(3194),h=r(o(),Number);n(h,{getPolyfill:o,implementation:s,shim:a}),t.exports=h},9415:(t,e,i)=>{"use strict";var r=i(8611);t.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:r}},3194:(t,e,i)=>{"use strict";var r=i(4289),n=i(9415);t.exports=function(){var t=n();return r(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t}},5692:(t,e,i)=>{"use strict";var r=i(9804),n=i(3083),s=i(1924),o=s("Object.prototype.toString"),a=i(6410)(),h="undefined"==typeof globalThis?i.g:globalThis,u=n(),l=s("Array.prototype.indexOf",!0)||function(t,e){for(var i=0;i<t.length;i+=1)if(t[i]===e)return i;return-1},c=s("String.prototype.slice"),d={},f=i(882),p=Object.getPrototypeOf;a&&f&&p&&r(u,(function(t){var e=new h[t];if(Symbol.toStringTag in e){var i=p(e),r=f(i,Symbol.toStringTag);if(!r){var n=p(i);r=f(n,Symbol.toStringTag)}d[t]=r.get}})),t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!a||!(Symbol.toStringTag in t)){var e=c(o(t),8,-1);return l(u,e)>-1}return!!f&&function(t){var e=!1;return r(d,(function(i,r){if(!e)try{e=i.call(t)===r}catch(t){}})),e}(t)}},4501:t=>{t.exports=r,r.strict=n,r.loose=s;var e=Object.prototype.toString,i={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function r(t){return n(t)||s(t)}function n(t){return t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array}function s(t){return i[e.call(t)]}},1351:(t,e)=>{"use strict";e.re=()=>{throw new Error("`junk.re` was renamed to `junk.regex`")},e.regex=new RegExp(["^npm-debug\\.log$","^\\..*\\.swp$","^\\.DS_Store$","^\\.AppleDouble$","^\\.LSOverride$","^Icon\\r$","^\\._.*","^\\.Spotlight-V100(?:$|\\/)","\\.Trashes","^__MACOSX$","~$","^Thumbs\\.db$","^ehthumbs\\.db$","^Desktop\\.ini$","@eaDir$"].join("|")),e.is=t=>e.regex.test(t),e.not=t=>!e.is(t),e.default=t.exports},5516:(t,e,i)=>{e.RateLimiter=i(1114),e.TokenBucket=i(4976)},6188:(t,e,i)=>{var r=i(9590);t.exports=function(){if(void 0!==r&&r.hrtime){var t=r.hrtime(),e=t[0],i=t[1];return 1e3*e+Math.floor(i/1e6)}return(new Date).getTime()}},1114:(t,e,i)=>{var r=i(9590),n=i(4976),s=i(6188),o=function(t,e,i){this.tokenBucket=new n(t,t,e,null),this.tokenBucket.content=t,this.curIntervalStart=s(),this.tokensThisInterval=0,this.fireImmediately=i};o.prototype={tokenBucket:null,curIntervalStart:0,tokensThisInterval:0,fireImmediately:!1,removeTokens:function(t,e){if(t>this.tokenBucket.bucketSize)return r.nextTick(e.bind(null,"Requested tokens "+t+" exceeds maximum tokens per interval "+this.tokenBucket.bucketSize,null)),!1;var i=this,n=s();if((n<this.curIntervalStart||n-this.curIntervalStart>=this.tokenBucket.interval)&&(this.curIntervalStart=n,this.tokensThisInterval=0),t>this.tokenBucket.tokensPerInterval-this.tokensThisInterval){if(this.fireImmediately)r.nextTick(e.bind(null,null,-1));else{var o=Math.ceil(this.curIntervalStart+this.tokenBucket.interval-n);setTimeout((function(){i.tokenBucket.removeTokens(t,a)}),o)}return!1}return this.tokenBucket.removeTokens(t,a);function a(r,n){if(r)return e(r,null);i.tokensThisInterval+=t,e(null,n)}},tryRemoveTokens:function(t){if(t>this.tokenBucket.bucketSize)return!1;var e=s();if((e<this.curIntervalStart||e-this.curIntervalStart>=this.tokenBucket.interval)&&(this.curIntervalStart=e,this.tokensThisInterval=0),t>this.tokenBucket.tokensPerInterval-this.tokensThisInterval)return!1;var i=this.tokenBucket.tryRemoveTokens(t);return i&&(this.tokensThisInterval+=t),i},getTokensRemaining:function(){return this.tokenBucket.drip(),this.tokenBucket.content}},t.exports=o},4976:(t,e,i)=>{var r=i(9590),n=function(t,e,i,r){if(this.bucketSize=t,this.tokensPerInterval=e,"string"==typeof i)switch(i){case"sec":case"second":this.interval=1e3;break;case"min":case"minute":this.interval=6e4;break;case"hr":case"hour":this.interval=36e5;break;case"day":this.interval=864e5;break;default:throw new Error("Invaid interval "+i)}else this.interval=i;this.parentBucket=r,this.content=0,this.lastDrip=+new Date};n.prototype={bucketSize:1,tokensPerInterval:1,interval:1e3,parentBucket:null,content:0,lastDrip:0,removeTokens:function(t,e){var i=this;return this.bucketSize?t>this.bucketSize?(r.nextTick(e.bind(null,"Requested tokens "+t+" exceeds bucket size "+this.bucketSize,null)),!1):(this.drip(),t>this.content?n():this.parentBucket?this.parentBucket.removeTokens(t,(function(r,s){return r?e(r,null):t>i.content?n():(i.content-=t,void e(null,Math.min(s,i.content)))})):(this.content-=t,r.nextTick(e.bind(null,null,this.content)),!0)):(r.nextTick(e.bind(null,null,t,Number.POSITIVE_INFINITY)),!0);function n(){var r=Math.ceil((t-i.content)*(i.interval/i.tokensPerInterval));return setTimeout((function(){i.removeTokens(t,e)}),r),!1}},tryRemoveTokens:function(t){return!(this.bucketSize&&(t>this.bucketSize||(this.drip(),t>this.content||this.parentBucket&&!this.parentBucket.tryRemoveTokens(t)||(this.content-=t,0))))},drip:function(){if(this.tokensPerInterval){var t=+new Date,e=Math.max(t-this.lastDrip,0);this.lastDrip=t;var i=e*(this.tokensPerInterval/this.interval);this.content=Math.min(this.content+i,this.bucketSize)}else this.content=this.bucketSize}},t.exports=n},7117:(t,e,i)=>{var r=i(7187),n=i(5717);function s(t){if(!(this instanceof s))return new s(t);"number"==typeof t&&(t={max:t}),t||(t={}),r.EventEmitter.call(this),this.cache={},this.head=this.tail=null,this.length=0,this.max=t.max||1e3,this.maxAge=t.maxAge||0}t.exports=s,n(s,r.EventEmitter),Object.defineProperty(s.prototype,"keys",{get:function(){return Object.keys(this.cache)}}),s.prototype.clear=function(){this.cache={},this.head=this.tail=null,this.length=0},s.prototype.remove=function(t){if("string"!=typeof t&&(t=""+t),this.cache.hasOwnProperty(t)){var e=this.cache[t];return delete this.cache[t],this._unlink(t,e.prev,e.next),e.value}},s.prototype._unlink=function(t,e,i){this.length--,0===this.length?this.head=this.tail=null:this.head===t?(this.head=e,this.cache[this.head].next=null):this.tail===t?(this.tail=i,this.cache[this.tail].prev=null):(this.cache[e].next=i,this.cache[i].prev=e)},s.prototype.peek=function(t){if(this.cache.hasOwnProperty(t)){var e=this.cache[t];if(this._checkAge(t,e))return e.value}},s.prototype.set=function(t,e){var i;if("string"!=typeof t&&(t=""+t),this.cache.hasOwnProperty(t)){if((i=this.cache[t]).value=e,this.maxAge&&(i.modified=Date.now()),t===this.head)return e;this._unlink(t,i.prev,i.next)}else i={value:e,modified:0,next:null,prev:null},this.maxAge&&(i.modified=Date.now()),this.cache[t]=i,this.length===this.max&&this.evict();return this.length++,i.next=null,i.prev=this.head,this.head&&(this.cache[this.head].next=t),this.head=t,this.tail||(this.tail=t),e},s.prototype._checkAge=function(t,e){return!(this.maxAge&&Date.now()-e.modified>this.maxAge&&(this.remove(t),this.emit("evict",{key:t,value:e.value}),1))},s.prototype.get=function(t){if("string"!=typeof t&&(t=""+t),this.cache.hasOwnProperty(t)){var e=this.cache[t];if(this._checkAge(t,e))return this.head!==t&&(t===this.tail?(this.tail=e.next,this.cache[this.tail].prev=null):this.cache[e.prev].next=e.next,this.cache[e.next].prev=e.prev,this.cache[this.head].next=t,e.prev=this.head,e.next=null,this.head=t),e.value}},s.prototype.evict=function(){if(this.tail){var t=this.tail,e=this.remove(this.tail);this.emit("evict",{key:t,value:e})}}},9417:(t,e,i)=>{var r=i(8764).Buffer;const n=i(6581),{EventEmitter:s}=i(7187),o=i(1227)("lt_donthave");t.exports=()=>{class t extends s{constructor(t){super(),this._peerSupports=!1,this._wire=t}onExtendedHandshake(){this._peerSupports=!0}onMessage(t){let e;try{e=t.readUInt32BE()}catch(t){return}this._wire.peerPieces.get(e)&&(o("got donthave %d",e),this._wire.peerPieces.set(e,!1),this.emit("donthave",e),this._failRequests(e))}donthave(t){if(!this._peerSupports)return;o("donthave %d",t);const e=r.alloc(4);e.writeUInt32BE(t),this._wire.extended("lt_donthave",e)}_failRequests(t){const e=this._wire.requests;for(let i=0;i<e.length;i++){const r=e[i];r.piece===t&&(n(e,i),i-=1,this._wire._callback(r,new Error("peer sent donthave"),null))}}}return t.prototype.name="lt_donthave",t}},9566:(t,e,i)=>{var r=i(8764).Buffer;t.exports=o,t.exports.decode=o,t.exports.encode=function(t){t=Object.assign({},t);let e=new Set;t.xt&&"string"==typeof t.xt&&e.add(t.xt),t.xt&&Array.isArray(t.xt)&&(e=new Set(t.xt)),t.infoHashBuffer&&e.add(`urn:btih:${t.infoHashBuffer.toString("hex")}`),t.infoHash&&e.add(`urn:btih:${t.infoHash}`),t.infoHashV2Buffer&&e.add(t.xt=`urn:btmh:1220${t.infoHashV2Buffer.toString("hex")}`),t.infoHashV2&&e.add(`urn:btmh:1220${t.infoHashV2}`);const i=Array.from(e);1===i.length&&(t.xt=i[0]),i.length>1&&(t.xt=i),t.publicKeyBuffer&&(t.xs=`urn:btpk:${t.publicKeyBuffer.toString("hex")}`),t.publicKey&&(t.xs=`urn:btpk:${t.publicKey}`),t.name&&(t.dn=t.name),t.keywords&&(t.kt=t.keywords),t.announce&&(t.tr=t.announce),t.urlList&&(t.ws=t.urlList,delete t.as),t.peerAddresses&&(t["x.pe"]=t.peerAddresses);let r="magnet:?";return Object.keys(t).filter((t=>2===t.length||"x.pe"===t)).forEach(((e,i)=>{const n=Array.isArray(t[e])?t[e]:[t[e]];n.forEach(((t,n)=>{(i>0||n>0)&&("kt"!==e&&"so"!==e||0===n)&&(r+="&"),"dn"===e&&(t=encodeURIComponent(t).replace(/%20/g,"+")),"tr"!==e&&"as"!==e&&"ws"!==e||(t=encodeURIComponent(t)),"xs"!==e||t.startsWith("urn:btpk:")||(t=encodeURIComponent(t)),"kt"===e&&(t=encodeURIComponent(t)),"so"!==e&&(r+="kt"===e&&n>0?`+${t}`:`${e}=${t}`)})),"so"===e&&(r+=`${e}=${s.compose(n)}`)})),r};const n=i(5017),s=i(7500);function o(t){const e={},i=t.split("magnet:?")[1];let o;return(i&&i.length>=0?i.split("&"):[]).forEach((t=>{const i=t.split("=");if(2!==i.length)return;const r=i[0];let n=i[1];"dn"===r&&(n=decodeURIComponent(n).replace(/\+/g," ")),"tr"!==r&&"xs"!==r&&"as"!==r&&"ws"!==r||(n=decodeURIComponent(n)),"kt"===r&&(n=decodeURIComponent(n).split("+")),"ix"===r&&(n=Number(n)),"so"===r&&(n=s.parse(decodeURIComponent(n).split(","))),e[r]?(Array.isArray(e[r])||(e[r]=[e[r]]),e[r].push(n)):e[r]=n})),e.xt&&(Array.isArray(e.xt)?e.xt:[e.xt]).forEach((t=>{if(o=t.match(/^urn:btih:(.{40})/))e.infoHash=o[1].toLowerCase();else if(o=t.match(/^urn:btih:(.{32})/)){const t=n.decode(o[1]);e.infoHash=r.from(t,"binary").toString("hex")}else(o=t.match(/^urn:btmh:1220(.{64})/))&&(e.infoHashV2=o[1].toLowerCase())})),e.xs&&(Array.isArray(e.xs)?e.xs:[e.xs]).forEach((t=>{(o=t.match(/^urn:btpk:(.{64})/))&&(e.publicKey=o[1].toLowerCase())})),e.infoHash&&(e.infoHashBuffer=r.from(e.infoHash,"hex")),e.infoHashV2&&(e.infoHashV2Buffer=r.from(e.infoHashV2,"hex")),e.publicKey&&(e.publicKeyBuffer=r.from(e.publicKey,"hex")),e.dn&&(e.name=e.dn),e.kt&&(e.keywords=e.kt),e.announce=[],("string"==typeof e.tr||Array.isArray(e.tr))&&(e.announce=e.announce.concat(e.tr)),e.urlList=[],("string"==typeof e.as||Array.isArray(e.as))&&(e.urlList=e.urlList.concat(e.as)),("string"==typeof e.ws||Array.isArray(e.ws))&&(e.urlList=e.urlList.concat(e.ws)),e.peerAddresses=[],("string"==typeof e["x.pe"]||Array.isArray(e["x.pe"]))&&(e.peerAddresses=e.peerAddresses.concat(e["x.pe"])),e.announce=Array.from(new Set(e.announce)),e.urlList=Array.from(new Set(e.urlList)),e.peerAddresses=Array.from(new Set(e.peerAddresses)),e}},2318:(t,e,i)=>{"use strict";var r=i(5717),n=i(3349),s=i(9509).Buffer,o=new Array(16);function a(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function h(t,e){return t<<e|t>>>32-e}function u(t,e,i,r,n,s,o){return h(t+(e&i|~e&r)+n+s|0,o)+e|0}function l(t,e,i,r,n,s,o){return h(t+(e&r|i&~r)+n+s|0,o)+e|0}function c(t,e,i,r,n,s,o){return h(t+(e^i^r)+n+s|0,o)+e|0}function d(t,e,i,r,n,s,o){return h(t+(i^(e|~r))+n+s|0,o)+e|0}r(a,n),a.prototype._update=function(){for(var t=o,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var i=this._a,r=this._b,n=this._c,s=this._d;i=u(i,r,n,s,t[0],3614090360,7),s=u(s,i,r,n,t[1],3905402710,12),n=u(n,s,i,r,t[2],606105819,17),r=u(r,n,s,i,t[3],3250441966,22),i=u(i,r,n,s,t[4],4118548399,7),s=u(s,i,r,n,t[5],1200080426,12),n=u(n,s,i,r,t[6],2821735955,17),r=u(r,n,s,i,t[7],4249261313,22),i=u(i,r,n,s,t[8],1770035416,7),s=u(s,i,r,n,t[9],2336552879,12),n=u(n,s,i,r,t[10],4294925233,17),r=u(r,n,s,i,t[11],2304563134,22),i=u(i,r,n,s,t[12],1804603682,7),s=u(s,i,r,n,t[13],4254626195,12),n=u(n,s,i,r,t[14],2792965006,17),i=l(i,r=u(r,n,s,i,t[15],1236535329,22),n,s,t[1],4129170786,5),s=l(s,i,r,n,t[6],3225465664,9),n=l(n,s,i,r,t[11],643717713,14),r=l(r,n,s,i,t[0],3921069994,20),i=l(i,r,n,s,t[5],3593408605,5),s=l(s,i,r,n,t[10],38016083,9),n=l(n,s,i,r,t[15],3634488961,14),r=l(r,n,s,i,t[4],3889429448,20),i=l(i,r,n,s,t[9],568446438,5),s=l(s,i,r,n,t[14],3275163606,9),n=l(n,s,i,r,t[3],4107603335,14),r=l(r,n,s,i,t[8],1163531501,20),i=l(i,r,n,s,t[13],2850285829,5),s=l(s,i,r,n,t[2],4243563512,9),n=l(n,s,i,r,t[7],1735328473,14),i=c(i,r=l(r,n,s,i,t[12],2368359562,20),n,s,t[5],4294588738,4),s=c(s,i,r,n,t[8],2272392833,11),n=c(n,s,i,r,t[11],1839030562,16),r=c(r,n,s,i,t[14],4259657740,23),i=c(i,r,n,s,t[1],2763975236,4),s=c(s,i,r,n,t[4],1272893353,11),n=c(n,s,i,r,t[7],4139469664,16),r=c(r,n,s,i,t[10],3200236656,23),i=c(i,r,n,s,t[13],681279174,4),s=c(s,i,r,n,t[0],3936430074,11),n=c(n,s,i,r,t[3],3572445317,16),r=c(r,n,s,i,t[6],76029189,23),i=c(i,r,n,s,t[9],3654602809,4),s=c(s,i,r,n,t[12],3873151461,11),n=c(n,s,i,r,t[15],530742520,16),i=d(i,r=c(r,n,s,i,t[2],3299628645,23),n,s,t[0],4096336452,6),s=d(s,i,r,n,t[7],1126891415,10),n=d(n,s,i,r,t[14],2878612391,15),r=d(r,n,s,i,t[5],4237533241,21),i=d(i,r,n,s,t[12],1700485571,6),s=d(s,i,r,n,t[3],2399980690,10),n=d(n,s,i,r,t[10],4293915773,15),r=d(r,n,s,i,t[1],2240044497,21),i=d(i,r,n,s,t[8],1873313359,6),s=d(s,i,r,n,t[15],4264355552,10),n=d(n,s,i,r,t[6],2734768916,15),r=d(r,n,s,i,t[13],1309151649,21),i=d(i,r,n,s,t[4],4149444226,6),s=d(s,i,r,n,t[11],3174756917,10),n=d(n,s,i,r,t[2],718787259,15),r=d(r,n,s,i,t[9],3951481745,21),this._a=this._a+i|0,this._b=this._b+r|0,this._c=this._c+n|0,this._d=this._d+s|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=s.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=a},6567:(t,e,i)=>{t.exports=a;var r=i(5717),n=i(8473),s=i(2885),o="undefined"!=typeof window&&window.MediaSource;function a(t,e){var i=this;if(!(i instanceof a))return new a(t,e);if(!o)throw new Error("web browser lacks MediaSource support");e||(e={}),i._debug=e.debug,i._bufferDuration=e.bufferDuration||60,i._elem=t,i._mediaSource=new o,i._streams=[],i.detailedError=null,i._errorHandler=function(){i._elem.removeEventListener("error",i._errorHandler),i._streams.slice().forEach((function(t){t.destroy(i._elem.error)}))},i._elem.addEventListener("error",i._errorHandler),i._elem.src=window.URL.createObjectURL(i._mediaSource)}function h(t,e){var i=this;if(n.Writable.call(i),i._wrapper=t,i._elem=t._elem,i._mediaSource=t._mediaSource,i._allStreams=t._streams,i._allStreams.push(i),i._bufferDuration=t._bufferDuration,i._sourceBuffer=null,i._debugBuffers=[],i._openHandler=function(){i._onSourceOpen()},i._flowHandler=function(){i._flow()},i._errorHandler=function(t){i.destroyed||i.emit("error",t)},"string"==typeof e)i._type=e,"open"===i._mediaSource.readyState?i._createSourceBuffer():i._mediaSource.addEventListener("sourceopen",i._openHandler);else if(null===e._sourceBuffer)e.destroy(),i._type=e._type,i._mediaSource.addEventListener("sourceopen",i._openHandler);else{if(!e._sourceBuffer)throw new Error("The argument to MediaElementWrapper.createWriteStream must be a string or a previous stream returned from that function");e.destroy(),i._type=e._type,i._sourceBuffer=e._sourceBuffer,i._debugBuffers=e._debugBuffers,i._sourceBuffer.addEventListener("updateend",i._flowHandler),i._sourceBuffer.addEventListener("error",i._errorHandler)}i._elem.addEventListener("timeupdate",i._flowHandler),i.on("error",(function(t){i._wrapper.error(t)})),i.on("finish",(function(){if(!i.destroyed&&(i._finished=!0,i._allStreams.every((function(t){return t._finished})))){i._wrapper._dumpDebugData();try{i._mediaSource.endOfStream()}catch(t){}}}))}a.prototype.createWriteStream=function(t){return new h(this,t)},a.prototype.error=function(t){var e=this;e.detailedError||(e.detailedError=t),e._dumpDebugData();try{e._mediaSource.endOfStream("decode")}catch(t){}try{window.URL.revokeObjectURL(e._elem.src)}catch(t){}},a.prototype._dumpDebugData=function(){var t=this;t._debug&&(t._debug=!1,t._streams.forEach((function(t,e){var i,r,n;i=t._debugBuffers,r="mediasource-stream-"+e,(n=document.createElement("a")).href=window.URL.createObjectURL(new window.Blob(i)),n.download=r,n.click()})))},r(h,n.Writable),h.prototype._onSourceOpen=function(){var t=this;t.destroyed||(t._mediaSource.removeEventListener("sourceopen",t._openHandler),t._createSourceBuffer())},h.prototype.destroy=function(t){var e=this;e.destroyed||(e.destroyed=!0,e._allStreams.splice(e._allStreams.indexOf(e),1),e._mediaSource.removeEventListener("sourceopen",e._openHandler),e._elem.removeEventListener("timeupdate",e._flowHandler),e._sourceBuffer&&(e._sourceBuffer.removeEventListener("updateend",e._flowHandler),e._sourceBuffer.removeEventListener("error",e._errorHandler),"open"===e._mediaSource.readyState&&e._sourceBuffer.abort()),t&&e.emit("error",t),e.emit("close"))},h.prototype._createSourceBuffer=function(){var t=this;if(!t.destroyed)if(o.isTypeSupported(t._type)){if(t._sourceBuffer=t._mediaSource.addSourceBuffer(t._type),t._sourceBuffer.addEventListener("updateend",t._flowHandler),t._sourceBuffer.addEventListener("error",t._errorHandler),t._cb){var e=t._cb;t._cb=null,e()}}else t.destroy(new Error("The provided type is not supported"))},h.prototype._write=function(t,e,i){var r=this;if(!r.destroyed)if(r._sourceBuffer){if(r._sourceBuffer.updating)return i(new Error("Cannot append buffer while source buffer updating"));var n=s(t);r._wrapper._debug&&r._debugBuffers.push(n);try{r._sourceBuffer.appendBuffer(n)}catch(t){return void r.destroy(t)}r._cb=i}else r._cb=function(n){if(n)return i(n);r._write(t,e,i)}},h.prototype._flow=function(){var t=this;if(!t.destroyed&&t._sourceBuffer&&!t._sourceBuffer.updating&&!("open"===t._mediaSource.readyState&&t._getBufferDuration()>t._bufferDuration)&&t._cb){var e=t._cb;t._cb=null,e()}},h.prototype._getBufferDuration=function(){for(var t=this._sourceBuffer.buffered,e=this._elem.currentTime,i=-1,r=0;r<t.length;r++){var n=t.start(r),s=t.end(r)+0;if(n>e)break;(i>=0||e<=s)&&(i=s)}var o=i-e;return o<0&&(o=0),o}},1191:(t,e,i)=>{t.exports=n;const r=i(4375);function n(t,e){if(!(this instanceof n))return new n(t,e);if(e||(e={}),this.chunkLength=Number(t),!this.chunkLength)throw new Error("First argument must be a chunk length");this.chunks=[],this.closed=!1,this.length=Number(e.length)||1/0,this.length!==1/0&&(this.lastChunkLength=this.length%this.chunkLength||this.chunkLength,this.lastChunkIndex=Math.ceil(this.length/this.chunkLength)-1)}n.prototype.put=function(t,e,i=(()=>{})){if(this.closed)return r((()=>i(new Error("Storage is closed"))));const n=t===this.lastChunkIndex;return n&&e.length!==this.lastChunkLength?r((()=>i(new Error("Last chunk length must be "+this.lastChunkLength)))):n||e.length===this.chunkLength?(this.chunks[t]=e,void r((()=>i(null)))):r((()=>i(new Error("Chunk length must be "+this.chunkLength))))},n.prototype.get=function(t,e,i=(()=>{})){if("function"==typeof e)return this.get(t,null,e);if(this.closed)return r((()=>i(new Error("Storage is closed"))));let n=this.chunks[t];if(!n){const t=new Error("Chunk not found");return t.notFound=!0,r((()=>i(t)))}e||(e={});const s=e.offset||0,o=e.length||n.length-s;0===s&&o===n.length||(n=n.slice(s,o+s)),r((()=>i(null,n)))},n.prototype.close=n.prototype.destroy=function(t=(()=>{})){if(this.closed)return r((()=>t(new Error("Storage is closed"))));this.closed=!0,this.chunks=null,r((()=>t(null)))}},3047:(t,e,i)=>{var r=i(6240),n=i(9931);function s(t){this.rand=t||new n.Rand}t.exports=s,s.create=function(t){return new s(t)},s.prototype._randbelow=function(t){var e=t.bitLength(),i=Math.ceil(e/8);do{var n=new r(this.rand.generate(i))}while(n.cmp(t)>=0);return n},s.prototype._randrange=function(t,e){var i=e.sub(t);return t.add(this._randbelow(i))},s.prototype.test=function(t,e,i){var n=t.bitLength(),s=r.mont(t),o=new r(1).toRed(s);e||(e=Math.max(1,n/48|0));for(var a=t.subn(1),h=0;!a.testn(h);h++);for(var u=t.shrn(h),l=a.toRed(s);e>0;e--){var c=this._randrange(new r(2),a);i&&i(c);var d=c.toRed(s).redPow(u);if(0!==d.cmp(o)&&0!==d.cmp(l)){for(var f=1;f<h;f++){if(0===(d=d.redSqr()).cmp(o))return!1;if(0===d.cmp(l))break}if(f===h)return!1}}return!0},s.prototype.getDivisor=function(t,e){var i=t.bitLength(),n=r.mont(t),s=new r(1).toRed(n);e||(e=Math.max(1,i/48|0));for(var o=t.subn(1),a=0;!o.testn(a);a++);for(var h=t.shrn(a),u=o.toRed(n);e>0;e--){var l=this._randrange(new r(2),o),c=t.gcd(l);if(0!==c.cmpn(1))return c;var d=l.toRed(n).redPow(h);if(0!==d.cmp(s)&&0!==d.cmp(u)){for(var f=1;f<a;f++){if(0===(d=d.redSqr()).cmp(s))return d.fromRed().subn(1).gcd(t);if(0===d.cmp(u))break}if(f===a)return(d=d.redSqr()).fromRed().subn(1).gcd(t)}}return!1}},6240:function(t,e,i){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function s(t,e,i){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var o;"object"==typeof t?t.exports=s:e.BN=s,s.BN=s,s.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:i(6619).Buffer}catch(t){}function a(t,e){var i=t.charCodeAt(e);return i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function h(t,e,i){var r=a(t,i);return i-1>=e&&(r|=a(t,i-1)<<4),r}function u(t,e,i,r){for(var n=0,s=Math.min(t.length,i),o=e;o<s;o++){var a=t.charCodeAt(o)-48;n*=r,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}s.isBN=function(t){return t instanceof s||null!==t&&"object"==typeof t&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===e?this._parseHex(t,n,i):(this._parseBase(t,e,n),"le"===i&&this._initArray(this.toArray(),e,i)))},s.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},s.prototype._initArray=function(t,e,i){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var s,o,a=0;if("be"===i)for(n=t.length-1,s=0;n>=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===i)for(n=0,s=0;n<t.length;n+=3)o=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(t,e,i){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,s=0,o=0;if("be"===i)for(r=t.length-1;r>=e;r-=2)n=h(t,e,r)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(r=(t.length-e)%2==0?e+1:e;r<t.length;r+=2)n=h(t,e,r)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this.strip()},s.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var s=t.length-i,o=s%r,a=Math.min(s,s-o)+i,h=0,l=i;l<a;l+=r)h=u(t,l,l+r,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==o){var c=1;for(h=u(t,l,t.length,e),l=0;l<o;l++)c*=e;this.imuln(c),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this.strip()},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],s=0|e.words[0],o=n*s,a=67108863&o,h=o/67108864|0;i.words[0]=a;for(var u=1;u<r;u++){for(var l=h>>>26,c=67108863&h,d=Math.min(u,e.length-1),f=Math.max(0,u-t.length+1);f<=d;f++){var p=u-f|0;l+=(o=(n=0|t.words[p])*(s=0|e.words[f])+c)/67108864|0,c=67108863&o}i.words[u]=0|c,h=0|l}return 0!==h?i.words[u]=0|h:i.length--,i.strip()}s.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var n=0,s=0,o=0;o<this.length;o++){var a=this.words[o],h=(16777215&(a<<n|s)).toString(16);i=0!=(s=a>>>24-n&16777215)||o!==this.length-1?l[6-h.length]+h+i:h+i,(n+=2)>=26&&(n-=26,o--)}for(0!==s&&(i=s.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var u=c[t],f=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(t);i=(p=p.idivn(f)).isZero()?m+i:l[u-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return r(void 0!==o),this.toArrayLike(o,t,e)},s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,i){var n=this.byteLength(),s=i||Math.max(1,n);r(n<=s,"byte array longer than desired length"),r(s>0,"Requested array length <= 0"),this.strip();var o,a,h="le"===e,u=new t(s),l=this.clone();if(h){for(a=0;!l.isZero();a++)o=l.andln(255),l.iushrn(8),u[a]=o;for(;a<s;a++)u[a]=0}else{for(a=0;a<s-n;a++)u[a]=0;for(a=0;!l.isZero();a++)o=l.andln(255),l.iushrn(8),u[s-a-1]=o}return u},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var i=this._zeroBits(this.words[e]);if(t+=i,26!==i)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},s.prototype.ior=function(t){return r(0==(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=e.length,this.strip()},s.prototype.iand=function(t){return r(0==(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;r<i.length;r++)this.words[r]=e.words[r]^i.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},s.prototype.ixor=function(t){return r(0==(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},s.prototype.iadd=function(t){var e,i,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0,s=0;s<r.length;s++)e=(0|i.words[s])+(0|r.words[s])+n,this.words[s]=67108863&e,n=e>>>26;for(;0!==n&&s<i.length;s++)e=(0|i.words[s])+n,this.words[s]=67108863&e,n=e>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var s=0,o=0;o<r.length;o++)s=(e=(0|i.words[o])-(0|r.words[o])+s)>>26,this.words[o]=67108863&e;for(;0!==s&&o<i.length;o++)s=(e=(0|i.words[o])+s)>>26,this.words[o]=67108863&e;if(0===s&&o<i.length&&i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this.length=Math.max(this.length,o),i!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,i){var r,n,s,o=t.words,a=e.words,h=i.words,u=0,l=0|o[0],c=8191&l,d=l>>>13,f=0|o[1],p=8191&f,m=f>>>13,g=0|o[2],b=8191&g,v=g>>>13,y=0|o[3],w=8191&y,_=y>>>13,M=0|o[4],k=8191&M,x=M>>>13,E=0|o[5],S=8191&E,T=E>>>13,A=0|o[6],I=8191&A,C=A>>>13,B=0|o[7],R=8191&B,P=B>>>13,L=0|o[8],O=8191&L,D=L>>>13,N=0|o[9],j=8191&N,U=N>>>13,F=0|a[0],q=8191&F,z=F>>>13,H=0|a[1],W=8191&H,$=H>>>13,Z=0|a[2],V=8191&Z,K=Z>>>13,G=0|a[3],J=8191&G,Y=G>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],it=8191&et,rt=et>>>13,nt=0|a[6],st=8191&nt,ot=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,lt=0|a[8],ct=8191<,dt=lt>>>13,ft=0|a[9],pt=8191&ft,mt=ft>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(u+(r=Math.imul(c,q))|0)+((8191&(n=(n=Math.imul(c,z))+Math.imul(d,q)|0))<<13)|0;u=((s=Math.imul(d,z))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(p,q),n=(n=Math.imul(p,z))+Math.imul(m,q)|0,s=Math.imul(m,z);var bt=(u+(r=r+Math.imul(c,W)|0)|0)+((8191&(n=(n=n+Math.imul(c,$)|0)+Math.imul(d,W)|0))<<13)|0;u=((s=s+Math.imul(d,$)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,q),n=(n=Math.imul(b,z))+Math.imul(v,q)|0,s=Math.imul(v,z),r=r+Math.imul(p,W)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(m,W)|0,s=s+Math.imul(m,$)|0;var vt=(u+(r=r+Math.imul(c,V)|0)|0)+((8191&(n=(n=n+Math.imul(c,K)|0)+Math.imul(d,V)|0))<<13)|0;u=((s=s+Math.imul(d,K)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(w,q),n=(n=Math.imul(w,z))+Math.imul(_,q)|0,s=Math.imul(_,z),r=r+Math.imul(b,W)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(v,W)|0,s=s+Math.imul(v,$)|0,r=r+Math.imul(p,V)|0,n=(n=n+Math.imul(p,K)|0)+Math.imul(m,V)|0,s=s+Math.imul(m,K)|0;var yt=(u+(r=r+Math.imul(c,J)|0)|0)+((8191&(n=(n=n+Math.imul(c,Y)|0)+Math.imul(d,J)|0))<<13)|0;u=((s=s+Math.imul(d,Y)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(k,q),n=(n=Math.imul(k,z))+Math.imul(x,q)|0,s=Math.imul(x,z),r=r+Math.imul(w,W)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(_,W)|0,s=s+Math.imul(_,$)|0,r=r+Math.imul(b,V)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(v,V)|0,s=s+Math.imul(v,K)|0,r=r+Math.imul(p,J)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(m,J)|0,s=s+Math.imul(m,Y)|0;var wt=(u+(r=r+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;u=((s=s+Math.imul(d,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(S,q),n=(n=Math.imul(S,z))+Math.imul(T,q)|0,s=Math.imul(T,z),r=r+Math.imul(k,W)|0,n=(n=n+Math.imul(k,$)|0)+Math.imul(x,W)|0,s=s+Math.imul(x,$)|0,r=r+Math.imul(w,V)|0,n=(n=n+Math.imul(w,K)|0)+Math.imul(_,V)|0,s=s+Math.imul(_,K)|0,r=r+Math.imul(b,J)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(v,J)|0,s=s+Math.imul(v,Y)|0,r=r+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,tt)|0;var _t=(u+(r=r+Math.imul(c,it)|0)|0)+((8191&(n=(n=n+Math.imul(c,rt)|0)+Math.imul(d,it)|0))<<13)|0;u=((s=s+Math.imul(d,rt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(I,q),n=(n=Math.imul(I,z))+Math.imul(C,q)|0,s=Math.imul(C,z),r=r+Math.imul(S,W)|0,n=(n=n+Math.imul(S,$)|0)+Math.imul(T,W)|0,s=s+Math.imul(T,$)|0,r=r+Math.imul(k,V)|0,n=(n=n+Math.imul(k,K)|0)+Math.imul(x,V)|0,s=s+Math.imul(x,K)|0,r=r+Math.imul(w,J)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,J)|0,s=s+Math.imul(_,Y)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,Q)|0,s=s+Math.imul(v,tt)|0,r=r+Math.imul(p,it)|0,n=(n=n+Math.imul(p,rt)|0)+Math.imul(m,it)|0,s=s+Math.imul(m,rt)|0;var Mt=(u+(r=r+Math.imul(c,st)|0)|0)+((8191&(n=(n=n+Math.imul(c,ot)|0)+Math.imul(d,st)|0))<<13)|0;u=((s=s+Math.imul(d,ot)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(R,q),n=(n=Math.imul(R,z))+Math.imul(P,q)|0,s=Math.imul(P,z),r=r+Math.imul(I,W)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(C,W)|0,s=s+Math.imul(C,$)|0,r=r+Math.imul(S,V)|0,n=(n=n+Math.imul(S,K)|0)+Math.imul(T,V)|0,s=s+Math.imul(T,K)|0,r=r+Math.imul(k,J)|0,n=(n=n+Math.imul(k,Y)|0)+Math.imul(x,J)|0,s=s+Math.imul(x,Y)|0,r=r+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,tt)|0,r=r+Math.imul(b,it)|0,n=(n=n+Math.imul(b,rt)|0)+Math.imul(v,it)|0,s=s+Math.imul(v,rt)|0,r=r+Math.imul(p,st)|0,n=(n=n+Math.imul(p,ot)|0)+Math.imul(m,st)|0,s=s+Math.imul(m,ot)|0;var kt=(u+(r=r+Math.imul(c,ht)|0)|0)+((8191&(n=(n=n+Math.imul(c,ut)|0)+Math.imul(d,ht)|0))<<13)|0;u=((s=s+Math.imul(d,ut)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(O,q),n=(n=Math.imul(O,z))+Math.imul(D,q)|0,s=Math.imul(D,z),r=r+Math.imul(R,W)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(P,W)|0,s=s+Math.imul(P,$)|0,r=r+Math.imul(I,V)|0,n=(n=n+Math.imul(I,K)|0)+Math.imul(C,V)|0,s=s+Math.imul(C,K)|0,r=r+Math.imul(S,J)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(T,J)|0,s=s+Math.imul(T,Y)|0,r=r+Math.imul(k,Q)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(x,Q)|0,s=s+Math.imul(x,tt)|0,r=r+Math.imul(w,it)|0,n=(n=n+Math.imul(w,rt)|0)+Math.imul(_,it)|0,s=s+Math.imul(_,rt)|0,r=r+Math.imul(b,st)|0,n=(n=n+Math.imul(b,ot)|0)+Math.imul(v,st)|0,s=s+Math.imul(v,ot)|0,r=r+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,s=s+Math.imul(m,ut)|0;var xt=(u+(r=r+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;u=((s=s+Math.imul(d,dt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(j,q),n=(n=Math.imul(j,z))+Math.imul(U,q)|0,s=Math.imul(U,z),r=r+Math.imul(O,W)|0,n=(n=n+Math.imul(O,$)|0)+Math.imul(D,W)|0,s=s+Math.imul(D,$)|0,r=r+Math.imul(R,V)|0,n=(n=n+Math.imul(R,K)|0)+Math.imul(P,V)|0,s=s+Math.imul(P,K)|0,r=r+Math.imul(I,J)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(C,J)|0,s=s+Math.imul(C,Y)|0,r=r+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(T,Q)|0,s=s+Math.imul(T,tt)|0,r=r+Math.imul(k,it)|0,n=(n=n+Math.imul(k,rt)|0)+Math.imul(x,it)|0,s=s+Math.imul(x,rt)|0,r=r+Math.imul(w,st)|0,n=(n=n+Math.imul(w,ot)|0)+Math.imul(_,st)|0,s=s+Math.imul(_,ot)|0,r=r+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(v,ht)|0,s=s+Math.imul(v,ut)|0,r=r+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,dt)|0)+Math.imul(m,ct)|0,s=s+Math.imul(m,dt)|0;var Et=(u+(r=r+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,mt)|0)+Math.imul(d,pt)|0))<<13)|0;u=((s=s+Math.imul(d,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(j,W),n=(n=Math.imul(j,$))+Math.imul(U,W)|0,s=Math.imul(U,$),r=r+Math.imul(O,V)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(D,V)|0,s=s+Math.imul(D,K)|0,r=r+Math.imul(R,J)|0,n=(n=n+Math.imul(R,Y)|0)+Math.imul(P,J)|0,s=s+Math.imul(P,Y)|0,r=r+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,s=s+Math.imul(C,tt)|0,r=r+Math.imul(S,it)|0,n=(n=n+Math.imul(S,rt)|0)+Math.imul(T,it)|0,s=s+Math.imul(T,rt)|0,r=r+Math.imul(k,st)|0,n=(n=n+Math.imul(k,ot)|0)+Math.imul(x,st)|0,s=s+Math.imul(x,ot)|0,r=r+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(_,ht)|0,s=s+Math.imul(_,ut)|0,r=r+Math.imul(b,ct)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(v,ct)|0,s=s+Math.imul(v,dt)|0;var St=(u+(r=r+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((s=s+Math.imul(m,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(j,V),n=(n=Math.imul(j,K))+Math.imul(U,V)|0,s=Math.imul(U,K),r=r+Math.imul(O,J)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(D,J)|0,s=s+Math.imul(D,Y)|0,r=r+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,tt)|0,r=r+Math.imul(I,it)|0,n=(n=n+Math.imul(I,rt)|0)+Math.imul(C,it)|0,s=s+Math.imul(C,rt)|0,r=r+Math.imul(S,st)|0,n=(n=n+Math.imul(S,ot)|0)+Math.imul(T,st)|0,s=s+Math.imul(T,ot)|0,r=r+Math.imul(k,ht)|0,n=(n=n+Math.imul(k,ut)|0)+Math.imul(x,ht)|0,s=s+Math.imul(x,ut)|0,r=r+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,dt)|0)+Math.imul(_,ct)|0,s=s+Math.imul(_,dt)|0;var Tt=(u+(r=r+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,pt)|0))<<13)|0;u=((s=s+Math.imul(v,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(j,J),n=(n=Math.imul(j,Y))+Math.imul(U,J)|0,s=Math.imul(U,Y),r=r+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(D,Q)|0,s=s+Math.imul(D,tt)|0,r=r+Math.imul(R,it)|0,n=(n=n+Math.imul(R,rt)|0)+Math.imul(P,it)|0,s=s+Math.imul(P,rt)|0,r=r+Math.imul(I,st)|0,n=(n=n+Math.imul(I,ot)|0)+Math.imul(C,st)|0,s=s+Math.imul(C,ot)|0,r=r+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(T,ht)|0,s=s+Math.imul(T,ut)|0,r=r+Math.imul(k,ct)|0,n=(n=n+Math.imul(k,dt)|0)+Math.imul(x,ct)|0,s=s+Math.imul(x,dt)|0;var At=(u+(r=r+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((s=s+Math.imul(_,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(j,Q),n=(n=Math.imul(j,tt))+Math.imul(U,Q)|0,s=Math.imul(U,tt),r=r+Math.imul(O,it)|0,n=(n=n+Math.imul(O,rt)|0)+Math.imul(D,it)|0,s=s+Math.imul(D,rt)|0,r=r+Math.imul(R,st)|0,n=(n=n+Math.imul(R,ot)|0)+Math.imul(P,st)|0,s=s+Math.imul(P,ot)|0,r=r+Math.imul(I,ht)|0,n=(n=n+Math.imul(I,ut)|0)+Math.imul(C,ht)|0,s=s+Math.imul(C,ut)|0,r=r+Math.imul(S,ct)|0,n=(n=n+Math.imul(S,dt)|0)+Math.imul(T,ct)|0,s=s+Math.imul(T,dt)|0;var It=(u+(r=r+Math.imul(k,pt)|0)|0)+((8191&(n=(n=n+Math.imul(k,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((s=s+Math.imul(x,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(j,it),n=(n=Math.imul(j,rt))+Math.imul(U,it)|0,s=Math.imul(U,rt),r=r+Math.imul(O,st)|0,n=(n=n+Math.imul(O,ot)|0)+Math.imul(D,st)|0,s=s+Math.imul(D,ot)|0,r=r+Math.imul(R,ht)|0,n=(n=n+Math.imul(R,ut)|0)+Math.imul(P,ht)|0,s=s+Math.imul(P,ut)|0,r=r+Math.imul(I,ct)|0,n=(n=n+Math.imul(I,dt)|0)+Math.imul(C,ct)|0,s=s+Math.imul(C,dt)|0;var Ct=(u+(r=r+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((s=s+Math.imul(T,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(j,st),n=(n=Math.imul(j,ot))+Math.imul(U,st)|0,s=Math.imul(U,ot),r=r+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(D,ht)|0,s=s+Math.imul(D,ut)|0,r=r+Math.imul(R,ct)|0,n=(n=n+Math.imul(R,dt)|0)+Math.imul(P,ct)|0,s=s+Math.imul(P,dt)|0;var Bt=(u+(r=r+Math.imul(I,pt)|0)|0)+((8191&(n=(n=n+Math.imul(I,mt)|0)+Math.imul(C,pt)|0))<<13)|0;u=((s=s+Math.imul(C,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,r=Math.imul(j,ht),n=(n=Math.imul(j,ut))+Math.imul(U,ht)|0,s=Math.imul(U,ut),r=r+Math.imul(O,ct)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(D,ct)|0,s=s+Math.imul(D,dt)|0;var Rt=(u+(r=r+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((s=s+Math.imul(P,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(j,ct),n=(n=Math.imul(j,dt))+Math.imul(U,ct)|0,s=Math.imul(U,dt);var Pt=(u+(r=r+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(D,pt)|0))<<13)|0;u=((s=s+Math.imul(D,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Lt=(u+(r=Math.imul(j,pt))|0)+((8191&(n=(n=Math.imul(j,mt))+Math.imul(U,pt)|0))<<13)|0;return u=((s=Math.imul(U,mt))+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,h[0]=gt,h[1]=bt,h[2]=vt,h[3]=yt,h[4]=wt,h[5]=_t,h[6]=Mt,h[7]=kt,h[8]=xt,h[9]=Et,h[10]=St,h[11]=Tt,h[12]=At,h[13]=It,h[14]=Ct,h[15]=Bt,h[16]=Rt,h[17]=Pt,h[18]=Lt,0!==u&&(h[19]=u,i.length++),i};function m(t,e,i){return(new g).mulp(t,e,i)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=f),s.prototype.mulTo=function(t,e){var i,r=this.length+t.length;return i=10===this.length&&10===t.length?p(this,t,e):r<63?f(this,t,e):r<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,s=0;s<i.length-1;s++){var o=n;n=0;for(var a=67108863&r,h=Math.min(s,e.length-1),u=Math.max(0,s-t.length+1);u<=h;u++){var l=s-u,c=(0|t.words[l])*(0|e.words[u]),d=67108863&c;a=67108863&(d=d+a|0),n+=(o=(o=o+(c/67108864|0)|0)+(d>>>26)|0)>>>26,o&=67108863}i.words[s]=a,r=o,o=n}return 0!==r?i.words[s]=r:i.length--,i.strip()}(this,t,e):m(this,t,e),i},g.prototype.makeRBT=function(t){for(var e=new Array(t),i=s.prototype._countBits(t)-1,r=0;r<t;r++)e[r]=this.revBin(r,i,t);return e},g.prototype.revBin=function(t,e,i){if(0===t||t===i-1)return t;for(var r=0,n=0;n<e;n++)r|=(1&t)<<e-n-1,t>>=1;return r},g.prototype.permute=function(t,e,i,r,n,s){for(var o=0;o<s;o++)r[o]=e[t[o]],n[o]=i[t[o]]},g.prototype.transform=function(t,e,i,r,n,s){this.permute(s,t,e,i,r,n);for(var o=1;o<n;o<<=1)for(var a=o<<1,h=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),l=0;l<n;l+=a)for(var c=h,d=u,f=0;f<o;f++){var p=i[l+f],m=r[l+f],g=i[l+f+o],b=r[l+f+o],v=c*g-d*b;b=c*b+d*g,g=v,i[l+f]=p+g,r[l+f]=m+b,i[l+f+o]=p-g,r[l+f+o]=m-b,f!==a&&(v=h*c-u*d,d=h*d+u*c,c=v)}},g.prototype.guessLen13b=function(t,e){var i=1|Math.max(e,t),r=1&i,n=0;for(i=i/2|0;i;i>>>=1)n++;return 1<<n+1+r},g.prototype.conjugate=function(t,e,i){if(!(i<=1))for(var r=0;r<i/2;r++){var n=t[r];t[r]=t[i-r-1],t[i-r-1]=n,n=e[r],e[r]=-e[i-r-1],e[i-r-1]=-n}},g.prototype.normalize13b=function(t,e){for(var i=0,r=0;r<e/2;r++){var n=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+i;t[r]=67108863&n,i=n<67108864?0:n/67108864|0}return t},g.prototype.convert13b=function(t,e,i,n){for(var s=0,o=0;o<e;o++)s+=0|t[o],i[2*o]=8191&s,s>>>=13,i[2*o+1]=8191&s,s>>>=13;for(o=2*e;o<n;++o)i[o]=0;r(0===s),r(0==(-8192&s))},g.prototype.stub=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=0;return e},g.prototype.mulp=function(t,e,i){var r=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(r),s=this.stub(r),o=new Array(r),a=new Array(r),h=new Array(r),u=new Array(r),l=new Array(r),c=new Array(r),d=i.words;d.length=r,this.convert13b(t.words,t.length,o,r),this.convert13b(e.words,e.length,u,r),this.transform(o,s,a,h,r,n),this.transform(u,s,l,c,r,n);for(var f=0;f<r;f++){var p=a[f]*l[f]-h[f]*c[f];h[f]=a[f]*c[f]+h[f]*l[f],a[f]=p}return this.conjugate(a,h,r),this.transform(a,h,d,s,r,n),this.conjugate(d,s,r),this.normalize13b(d,r),i.negative=t.negative^e.negative,i.length=t.length+e.length,i.strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),m(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){r("number"==typeof t),r(t<67108864);for(var e=0,i=0;i<this.length;i++){var n=(0|this.words[i])*t,s=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=s>>>26,this.words[i]=67108863&s}return 0!==e&&(this.words[i]=e,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i<e.length;i++){var r=i/26|0,n=i%26;e[i]=(t.words[r]&1<<n)>>>n}return e}(t);if(0===e.length)return new s(1);for(var i=this,r=0;r<e.length&&0===e[r];r++,i=i.sqr());if(++r<e.length)for(var n=i.sqr();r<e.length;r++,n=n.sqr())0!==e[r]&&(i=i.mul(n));return i},s.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,i=t%26,n=(t-i)/26,s=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&s,h=(0|this.words[e])-a<<i;this.words[e]=h|o,o=a>>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},s.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,i){var n;r("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<<s,h=i;if(n-=o,n=Math.max(0,n),h){for(var u=0;u<o;u++)h.words[u]=this.words[u];h.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=n);u--){var c=0|this.words[u];this.words[u]=l<<26-s|c>>>s,l=c&a}return h&&0!==l&&(h.words[h.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26,n=1<<e;return!(this.length<=i||!(this.words[i]&n))},s.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return r("number"==typeof t),r(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,i){var n,s,o=t.length+i;this._expand(o);var a=0;for(n=0;n<t.length;n++){s=(0|this.words[n+i])+a;var h=(0|t.words[n])*e;a=((s-=67108863&h)>>26)-(h/67108864|0),this.words[n+i]=67108863&s}for(;n<this.length-i;n++)a=(s=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&s;if(0===a)return this.strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(s=-(0|this.words[n])+a)>>26,this.words[n]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,e){var i=(this.length,t.length),r=this.clone(),n=t,o=0|n.words[n.length-1];0!=(i=26-this._countBits(o))&&(n=n.ushln(i),r.iushln(i),o=0|n.words[n.length-1]);var a,h=r.length-n.length;if("mod"!==e){(a=new s(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=r.clone()._ishlnsubmul(n,1,h);0===l.negative&&(r=l,a&&(a.words[h]=1));for(var c=h-1;c>=0;c--){var d=67108864*(0|r.words[n.length+c])+(0|r.words[n.length+c-1]);for(d=Math.min(d/o|0,67108863),r._ishlnsubmul(n,d,c);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(n,1,c),r.isZero()||(r.negative^=1);a&&(a.words[c]=d)}return a&&a.strip(),r.strip(),"div"!==e&&0!==i&&r.iushrn(i),{div:a||null,mod:r}},s.prototype.divmod=function(t,e,i){return r(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),s=i.cmp(r);return s<0||1===n&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,i=0,n=this.length-1;n>=0;n--)i=(e*i+(0|this.words[n]))%t;return i},s.prototype.idivn=function(t){r(t<=67108863);for(var e=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*e;this.words[i]=n/t|0,e=n%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new s(1),o=new s(0),a=new s(0),h=new s(1),u=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++u;for(var l=i.clone(),c=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(l),h.isub(c)),a.iushrn(1),h.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(a),o.isub(h)):(i.isub(e),a.isub(n),h.isub(o))}return{a,b:h,gcd:i.iushln(u)}},s.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new s(1),a=new s(0),h=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var u=0,l=1;0==(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(h),o.iushrn(1);for(var c=0,d=1;0==(i.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(i.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(a)):(i.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var s=e;e=i,i=s}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var s=n,o=i;0!==s&&o<this.length;o++){var a=0|this.words[o];s=(a+=s)>>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){r<n?e=-1:r>n&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new k(t)},s.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},n(y,v),y.prototype.split=function(t,e){for(var i=4194303,r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var s=t.words[9];for(e.words[e.length++]=s&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(o&i)<<4|s>>>22,s=o}s>>>=22,t.words[n-10]=s,0===s&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i<t.length;i++){var r=0|t.words[i];e+=977*r,t.words[i]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(w,v),n(_,v),n(M,v),M.prototype.imulK=function(t){for(var e=0,i=0;i<t.length;i++){var r=19*(0|t.words[i])+e,n=67108863&r;r>>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return b[t]=e,e},k.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},k.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new s(1)).iushrn(2);return this.pow(t,i)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);r(!n.isZero());var a=new s(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);0!==this.pow(l,u).cmp(h);)l.redIAdd(h);for(var c=this.pow(l,n),d=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),p=o;0!==f.cmp(a);){for(var m=f,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var b=this.pow(c,new s(1).iushln(p-g-1));d=d.redMul(b),c=b.redSqr(),f=f.redMul(c),p=g}return d},k.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},k.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var i=new Array(16);i[0]=new s(1).toRed(this),i[1]=t;for(var r=2;r<i.length;r++)i[r]=this.mul(i[r-1],t);var n=i[0],o=0,a=0,h=e.bitLength()%26;for(0===h&&(h=26),r=e.length-1;r>=0;r--){for(var u=e.words[r],l=h-1;l>=0;l--){var c=u>>l&1;n!==i[0]&&(n=this.sqr(n)),0!==c||0!==o?(o<<=1,o|=c,(4==++a||0===r&&0===l)&&(n=this.mul(n,i[o]),a=0,o=0)):a=0}h=26}return n},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new x(t)},n(x,k),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var i=t.mul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=i.nmd(t),this)},9146:t=>{"use strict";function e(){this._types=Object.create(null),this._extensions=Object.create(null);for(let t=0;t<arguments.length;t++)this.define(arguments[t]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}e.prototype.define=function(t,e){for(let i in t){let r=t[i].map((function(t){return t.toLowerCase()}));i=i.toLowerCase();for(let t=0;t<r.length;t++){const n=r[t];if("*"!==n[0]){if(!e&&n in this._types)throw new Error('Attempt to change mapping for "'+n+'" extension from "'+this._types[n]+'" to "'+i+'". Pass `force=true` to allow this, otherwise remove "'+n+'" from the list of extensions for "'+i+'".');this._types[n]=i}}if(e||!this._extensions[i]){const t=r[0];this._extensions[i]="*"!==t[0]?t:t.substr(1)}}},e.prototype.getType=function(t){let e=(t=String(t)).replace(/^.*[/\\]/,"").toLowerCase(),i=e.replace(/^.*\./,"").toLowerCase(),r=e.length<t.length;return(i.length<e.length-1||!r)&&this._types[i]||null},e.prototype.getExtension=function(t){return(t=/^\s*([^;\s]*)/.test(t)&&RegExp.$1)&&this._extensions[t.toLowerCase()]||null},t.exports=e},3893:(t,e,i)=>{"use strict";let r=i(9146);t.exports=new r(i(4415),i(3014))},3014:t=>{t.exports={"application/prs.cww":["cww"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.sap.vds":["vds"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}},4415:t=>{t.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}},9746:t=>{function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,i){if(t!=e)throw new Error(i||"Assertion failed: "+t+" != "+e)}},4504:(t,e)=>{"use strict";var i=e;function r(t){return 1===t.length?"0"+t:t}function n(t){for(var e="",i=0;i<t.length;i++)e+=r(t[i].toString(16));return e}i.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var i=[];if("string"!=typeof t){for(var r=0;r<t.length;r++)i[r]=0|t[r];return i}if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),r=0;r<t.length;r+=2)i.push(parseInt(t[r]+t[r+1],16));else for(r=0;r<t.length;r++){var n=t.charCodeAt(r),s=n>>8,o=255&n;s?i.push(s,o):i.push(o)}return i},i.zero2=r,i.toHex=n,i.encode=function(t,e){return"hex"===e?n(t):t}},9199:(t,e,i)=>{var r=i(8764).Buffer,n=i(2068),s=i(5597),o=i(4372),a=20828448e5;function h(t,e,i){for(var r=e;r<i;r++)t[r]=0}function u(t,e,i){e.writeUInt32BE(Math.floor((t.getTime()+a)/1e3),i)}function l(t,e,i){e.writeUIntBE(Math.floor((t.getTime()+a)/1e3),i,6)}function c(t,e,i){e.writeUInt16BE(Math.floor(t)%65536,i),e.writeUInt16BE(Math.floor(256*t*256)%65536,i+2)}function d(t,e,i){t||(t=[0,0,0,0,0,0,0,0,0]);for(var r=0;r<t.length;r++)c(t[r],e,i+4*r)}function f(t){for(var e=new Array(t.length/4),i=0;i<e.length;i++)e[i]=g(t,4*i);return e}function p(t,e){return new Date(1e3*t.readUIntBE(e,6)-a)}function m(t,e){return new Date(1e3*t.readUInt32BE(e)-a)}function g(t,e){return t.readUInt16BE(e)+t.readUInt16BE(e+2)/65536}function b(t,e){return t[e]+t[e+1]/256}function v(t,e,i){var r;for(r=0;r<i&&0!==t[e+r];r++);return t.toString("utf8",e,e+r)}e.fullBoxes={},["mvhd","tkhd","mdhd","vmhd","smhd","stsd","esds","stsz","stco","co64","stss","stts","ctts","stsc","dref","elst","hdlr","mehd","trex","mfhd","tfhd","tfdt","trun"].forEach((function(t){e.fullBoxes[t]=!0})),e.ftyp={},e.ftyp.encode=function(t,i,n){i=i?i.slice(n):r.alloc(e.ftyp.encodingLength(t));var s=t.compatibleBrands||[];i.write(t.brand,0,4,"ascii"),i.writeUInt32BE(t.brandVersion,4);for(var o=0;o<s.length;o++)i.write(s[o],8+4*o,4,"ascii");return e.ftyp.encode.bytes=8+4*s.length,i},e.ftyp.decode=function(t,e){for(var i=(t=t.slice(e)).toString("ascii",0,4),r=t.readUInt32BE(4),n=[],s=8;s<t.length;s+=4)n.push(t.toString("ascii",s,s+4));return{brand:i,brandVersion:r,compatibleBrands:n}},e.ftyp.encodingLength=function(t){return 8+4*(t.compatibleBrands||[]).length},e.mvhd={},e.mvhd.encode=function(t,i,n){return i=i?i.slice(n):r.alloc(96),u(t.ctime||new Date,i,0),u(t.mtime||new Date,i,4),i.writeUInt32BE(t.timeScale||0,8),i.writeUInt32BE(t.duration||0,12),c(t.preferredRate||0,i,16),function(t,e,i){e[20]=Math.floor(t)%256,e[21]=Math.floor(256*t)%256}(t.preferredVolume||0,i),h(i,22,32),d(t.matrix,i,32),i.writeUInt32BE(t.previewTime||0,68),i.writeUInt32BE(t.previewDuration||0,72),i.writeUInt32BE(t.posterTime||0,76),i.writeUInt32BE(t.selectionTime||0,80),i.writeUInt32BE(t.selectionDuration||0,84),i.writeUInt32BE(t.currentTime||0,88),i.writeUInt32BE(t.nextTrackId||0,92),e.mvhd.encode.bytes=96,i},e.mvhd.decode=function(t,e){return{ctime:m(t=t.slice(e),0),mtime:m(t,4),timeScale:t.readUInt32BE(8),duration:t.readUInt32BE(12),preferredRate:g(t,16),preferredVolume:b(t,20),matrix:f(t.slice(32,68)),previewTime:t.readUInt32BE(68),previewDuration:t.readUInt32BE(72),posterTime:t.readUInt32BE(76),selectionTime:t.readUInt32BE(80),selectionDuration:t.readUInt32BE(84),currentTime:t.readUInt32BE(88),nextTrackId:t.readUInt32BE(92)}},e.mvhd.encodingLength=function(t){return 96},e.tkhd={},e.tkhd.encode=function(t,i,n){return i=i?i.slice(n):r.alloc(80),u(t.ctime||new Date,i,0),u(t.mtime||new Date,i,4),i.writeUInt32BE(t.trackId||0,8),h(i,12,16),i.writeUInt32BE(t.duration||0,16),h(i,20,28),i.writeUInt16BE(t.layer||0,28),i.writeUInt16BE(t.alternateGroup||0,30),i.writeUInt16BE(t.volume||0,32),d(t.matrix,i,36),i.writeUInt32BE(t.trackWidth||0,72),i.writeUInt32BE(t.trackHeight||0,76),e.tkhd.encode.bytes=80,i},e.tkhd.decode=function(t,e){return{ctime:m(t=t.slice(e),0),mtime:m(t,4),trackId:t.readUInt32BE(8),duration:t.readUInt32BE(16),layer:t.readUInt16BE(28),alternateGroup:t.readUInt16BE(30),volume:t.readUInt16BE(32),matrix:f(t.slice(36,72)),trackWidth:t.readUInt32BE(72),trackHeight:t.readUInt32BE(76)}},e.tkhd.encodingLength=function(t){return 80},e.mdhd={},e.mdhd.encode=function(t,i,n){return 1===t.version?(i=i?i.slice(n):r.alloc(32),l(t.ctime||new Date,i,0),l(t.mtime||new Date,i,8),i.writeUInt32BE(t.timeScale||0,16),i.writeUIntBE(t.duration||0,20,6),i.writeUInt16BE(t.language||0,28),i.writeUInt16BE(t.quality||0,30),e.mdhd.encode.bytes=32,i):(i=i?i.slice(n):r.alloc(20),u(t.ctime||new Date,i,0),u(t.mtime||new Date,i,4),i.writeUInt32BE(t.timeScale||0,8),i.writeUInt32BE(t.duration||0,12),i.writeUInt16BE(t.language||0,16),i.writeUInt16BE(t.quality||0,18),e.mdhd.encode.bytes=20,i)},e.mdhd.decode=function(t,e,i){return t=t.slice(e),i-e!=20?{ctime:p(t,0),mtime:p(t,8),timeScale:t.readUInt32BE(16),duration:t.readUIntBE(20,6),language:t.readUInt16BE(28),quality:t.readUInt16BE(30)}:{ctime:m(t,0),mtime:m(t,4),timeScale:t.readUInt32BE(8),duration:t.readUInt32BE(12),language:t.readUInt16BE(16),quality:t.readUInt16BE(18)}},e.mdhd.encodingLength=function(t){return 1===t.version?32:20},e.vmhd={},e.vmhd.encode=function(t,i,n){(i=i?i.slice(n):r.alloc(8)).writeUInt16BE(t.graphicsMode||0,0);var s=t.opcolor||[0,0,0];return i.writeUInt16BE(s[0],2),i.writeUInt16BE(s[1],4),i.writeUInt16BE(s[2],6),e.vmhd.encode.bytes=8,i},e.vmhd.decode=function(t,e){return{graphicsMode:(t=t.slice(e)).readUInt16BE(0),opcolor:[t.readUInt16BE(2),t.readUInt16BE(4),t.readUInt16BE(6)]}},e.vmhd.encodingLength=function(t){return 8},e.smhd={},e.smhd.encode=function(t,i,n){return(i=i?i.slice(n):r.alloc(4)).writeUInt16BE(t.balance||0,0),h(i,2,4),e.smhd.encode.bytes=4,i},e.smhd.decode=function(t,e){return{balance:(t=t.slice(e)).readUInt16BE(0)}},e.smhd.encodingLength=function(t){return 4},e.stsd={},e.stsd.encode=function(t,i,s){i=i?i.slice(s):r.alloc(e.stsd.encodingLength(t));var o=t.entries||[];i.writeUInt32BE(o.length,0);for(var a=4,h=0;h<o.length;h++){var u=o[h];n.encode(u,i,a),a+=n.encode.bytes}return e.stsd.encode.bytes=a,i},e.stsd.decode=function(t,e,i){for(var r=(t=t.slice(e)).readUInt32BE(0),s=new Array(r),o=4,a=0;a<r;a++){var h=n.decode(t,o,i);s[a]=h,o+=h.length}return{entries:s}},e.stsd.encodingLength=function(t){var e=4;if(!t.entries)return e;for(var i=0;i<t.entries.length;i++)e+=n.encodingLength(t.entries[i]);return e},e.avc1=e.VisualSampleEntry={},e.VisualSampleEntry.encode=function(t,i,s){h(i=i?i.slice(s):r.alloc(e.VisualSampleEntry.encodingLength(t)),0,6),i.writeUInt16BE(t.dataReferenceIndex||0,6),h(i,8,24),i.writeUInt16BE(t.width||0,24),i.writeUInt16BE(t.height||0,26),i.writeUInt32BE(t.hResolution||4718592,28),i.writeUInt32BE(t.vResolution||4718592,32),h(i,36,40),i.writeUInt16BE(t.frameCount||1,40);var o=t.compressorName||"",a=Math.min(o.length,31);i.writeUInt8(a,42),i.write(o,43,a,"utf8"),i.writeUInt16BE(t.depth||24,74),i.writeInt16BE(-1,76);var u=78;(t.children||[]).forEach((function(t){n.encode(t,i,u),u+=n.encode.bytes})),e.VisualSampleEntry.encode.bytes=u},e.VisualSampleEntry.decode=function(t,e,i){t=t.slice(e);for(var r=i-e,s=Math.min(t.readUInt8(42),31),o={dataReferenceIndex:t.readUInt16BE(6),width:t.readUInt16BE(24),height:t.readUInt16BE(26),hResolution:t.readUInt32BE(28),vResolution:t.readUInt32BE(32),frameCount:t.readUInt16BE(40),compressorName:t.toString("utf8",43,43+s),depth:t.readUInt16BE(74),children:[]},a=78;r-a>=8;){var h=n.decode(t,a,r);o.children.push(h),o[h.type]=h,a+=h.length}return o},e.VisualSampleEntry.encodingLength=function(t){var e=78;return(t.children||[]).forEach((function(t){e+=n.encodingLength(t)})),e},e.avcC={},e.avcC.encode=function(t,i,n){i=i?i.slice(n):r.alloc(t.buffer.length),t.buffer.copy(i),e.avcC.encode.bytes=t.buffer.length},e.avcC.decode=function(t,e,i){return{mimeCodec:(t=t.slice(e,i)).toString("hex",1,4),buffer:r.from(t)}},e.avcC.encodingLength=function(t){return t.buffer.length},e.mp4a=e.AudioSampleEntry={},e.AudioSampleEntry.encode=function(t,i,s){h(i=i?i.slice(s):r.alloc(e.AudioSampleEntry.encodingLength(t)),0,6),i.writeUInt16BE(t.dataReferenceIndex||0,6),h(i,8,16),i.writeUInt16BE(t.channelCount||2,16),i.writeUInt16BE(t.sampleSize||16,18),h(i,20,24),i.writeUInt32BE(t.sampleRate||0,24);var o=28;(t.children||[]).forEach((function(t){n.encode(t,i,o),o+=n.encode.bytes})),e.AudioSampleEntry.encode.bytes=o},e.AudioSampleEntry.decode=function(t,e,i){for(var r=i-e,s={dataReferenceIndex:(t=t.slice(e,i)).readUInt16BE(6),channelCount:t.readUInt16BE(16),sampleSize:t.readUInt16BE(18),sampleRate:t.readUInt32BE(24),children:[]},o=28;r-o>=8;){var a=n.decode(t,o,r);s.children.push(a),s[a.type]=a,o+=a.length}return s},e.AudioSampleEntry.encodingLength=function(t){var e=28;return(t.children||[]).forEach((function(t){e+=n.encodingLength(t)})),e},e.esds={},e.esds.encode=function(t,i,n){i=i?i.slice(n):r.alloc(t.buffer.length),t.buffer.copy(i,0),e.esds.encode.bytes=t.buffer.length},e.esds.decode=function(t,e,i){t=t.slice(e,i);var n=s.Descriptor.decode(t,0,t.length),o=("ESDescriptor"===n.tagName?n:{}).DecoderConfigDescriptor||{},a=o.oti||0,h=o.DecoderSpecificInfo,u=h?(248&h.buffer.readUInt8(0))>>3:0,l=null;return a&&(l=a.toString(16),u&&(l+="."+u)),{mimeCodec:l,buffer:r.from(t.slice(0))}},e.esds.encodingLength=function(t){return t.buffer.length},e.stsz={},e.stsz.encode=function(t,i,n){var s=t.entries||[];(i=i?i.slice(n):r.alloc(e.stsz.encodingLength(t))).writeUInt32BE(0,0),i.writeUInt32BE(s.length,4);for(var o=0;o<s.length;o++)i.writeUInt32BE(s[o],4*o+8);return e.stsz.encode.bytes=8+4*s.length,i},e.stsz.decode=function(t,e){for(var i=(t=t.slice(e)).readUInt32BE(0),r=t.readUInt32BE(4),n=new Array(r),s=0;s<r;s++)n[s]=0===i?t.readUInt32BE(4*s+8):i;return{entries:n}},e.stsz.encodingLength=function(t){return 8+4*t.entries.length},e.stss=e.stco={},e.stco.encode=function(t,i,n){var s=t.entries||[];(i=i?i.slice(n):r.alloc(e.stco.encodingLength(t))).writeUInt32BE(s.length,0);for(var o=0;o<s.length;o++)i.writeUInt32BE(s[o],4*o+4);return e.stco.encode.bytes=4+4*s.length,i},e.stco.decode=function(t,e){for(var i=(t=t.slice(e)).readUInt32BE(0),r=new Array(i),n=0;n<i;n++)r[n]=t.readUInt32BE(4*n+4);return{entries:r}},e.stco.encodingLength=function(t){return 4+4*t.entries.length},e.co64={},e.co64.encode=function(t,i,n){var s=t.entries||[];(i=i?i.slice(n):r.alloc(e.co64.encodingLength(t))).writeUInt32BE(s.length,0);for(var a=0;a<s.length;a++)o.encode(s[a],i,8*a+4);return e.co64.encode.bytes=4+8*s.length,i},e.co64.decode=function(t,e){for(var i=(t=t.slice(e)).readUInt32BE(0),r=new Array(i),n=0;n<i;n++)r[n]=o.decode(t,8*n+4);return{entries:r}},e.co64.encodingLength=function(t){return 4+8*t.entries.length},e.stts={},e.stts.encode=function(t,i,n){var s=t.entries||[];(i=i?i.slice(n):r.alloc(e.stts.encodingLength(t))).writeUInt32BE(s.length,0);for(var o=0;o<s.length;o++){var a=8*o+4;i.writeUInt32BE(s[o].count||0,a),i.writeUInt32BE(s[o].duration||0,a+4)}return e.stts.encode.bytes=4+8*t.entries.length,i},e.stts.decode=function(t,e){for(var i=(t=t.slice(e)).readUInt32BE(0),r=new Array(i),n=0;n<i;n++){var s=8*n+4;r[n]={count:t.readUInt32BE(s),duration:t.readUInt32BE(s+4)}}return{entries:r}},e.stts.encodingLength=function(t){return 4+8*t.entries.length},e.ctts={},e.ctts.encode=function(t,i,n){var s=t.entries||[];(i=i?i.slice(n):r.alloc(e.ctts.encodingLength(t))).writeUInt32BE(s.length,0);for(var o=0;o<s.length;o++){var a=8*o+4;i.writeUInt32BE(s[o].count||0,a),i.writeUInt32BE(s[o].compositionOffset||0,a+4)}return e.ctts.encode.bytes=4+8*s.length,i},e.ctts.decode=function(t,e){for(var i=(t=t.slice(e)).readUInt32BE(0),r=new Array(i),n=0;n<i;n++){var s=8*n+4;r[n]={count:t.readUInt32BE(s),compositionOffset:t.readInt32BE(s+4)}}return{entries:r}},e.ctts.encodingLength=function(t){return 4+8*t.entries.length},e.stsc={},e.stsc.encode=function(t,i,n){var s=t.entries||[];(i=i?i.slice(n):r.alloc(e.stsc.encodingLength(t))).writeUInt32BE(s.length,0);for(var o=0;o<s.length;o++){var a=12*o+4;i.writeUInt32BE(s[o].firstChunk||0,a),i.writeUInt32BE(s[o].samplesPerChunk||0,a+4),i.writeUInt32BE(s[o].sampleDescriptionId||0,a+8)}return e.stsc.encode.bytes=4+12*s.length,i},e.stsc.decode=function(t,e){for(var i=(t=t.slice(e)).readUInt32BE(0),r=new Array(i),n=0;n<i;n++){var s=12*n+4;r[n]={firstChunk:t.readUInt32BE(s),samplesPerChunk:t.readUInt32BE(s+4),sampleDescriptionId:t.readUInt32BE(s+8)}}return{entries:r}},e.stsc.encodingLength=function(t){return 4+12*t.entries.length},e.dref={},e.dref.encode=function(t,i,n){i=i?i.slice(n):r.alloc(e.dref.encodingLength(t));var s=t.entries||[];i.writeUInt32BE(s.length,0);for(var o=4,a=0;a<s.length;a++){var h=s[a],u=(h.buf?h.buf.length:0)+4+4;i.writeUInt32BE(u,o),o+=4,i.write(h.type,o,4,"ascii"),o+=4,h.buf&&(h.buf.copy(i,o),o+=h.buf.length)}return e.dref.encode.bytes=o,i},e.dref.decode=function(t,e){for(var i=(t=t.slice(e)).readUInt32BE(0),r=new Array(i),n=4,s=0;s<i;s++){var o=t.readUInt32BE(n),a=t.toString("ascii",n+4,n+8),h=t.slice(n+8,n+o);n+=o,r[s]={type:a,buf:h}}return{entries:r}},e.dref.encodingLength=function(t){var e=4;if(!t.entries)return e;for(var i=0;i<t.entries.length;i++){var r=t.entries[i].buf;e+=(r?r.length:0)+4+4}return e},e.elst={},e.elst.encode=function(t,i,n){var s=t.entries||[];(i=i?i.slice(n):r.alloc(e.elst.encodingLength(t))).writeUInt32BE(s.length,0);for(var o=0;o<s.length;o++){var a=12*o+4;i.writeUInt32BE(s[o].trackDuration||0,a),i.writeUInt32BE(s[o].mediaTime||0,a+4),c(s[o].mediaRate||0,i,a+8)}return e.elst.encode.bytes=4+12*s.length,i},e.elst.decode=function(t,e){for(var i=(t=t.slice(e)).readUInt32BE(0),r=new Array(i),n=0;n<i;n++){var s=12*n+4;r[n]={trackDuration:t.readUInt32BE(s),mediaTime:t.readInt32BE(s+4),mediaRate:g(t,s+8)}}return{entries:r}},e.elst.encodingLength=function(t){return 4+12*t.entries.length},e.hdlr={},e.hdlr.encode=function(t,i,n){i=i?i.slice(n):r.alloc(e.hdlr.encodingLength(t));var s=21+(t.name||"").length;return i.fill(0,0,s),i.write(t.handlerType||"",4,4,"ascii"),function(t,e,i){var n=r.from(t,"utf8");n.copy(e,20),e[20+n.length]=0}(t.name||"",i),e.hdlr.encode.bytes=s,i},e.hdlr.decode=function(t,e,i){return{handlerType:(t=t.slice(e)).toString("ascii",4,8),name:v(t,20,i)}},e.hdlr.encodingLength=function(t){return 21+(t.name||"").length},e.mehd={},e.mehd.encode=function(t,i,n){return(i=i?i.slice(n):r.alloc(4)).writeUInt32BE(t.fragmentDuration||0,0),e.mehd.encode.bytes=4,i},e.mehd.decode=function(t,e){return{fragmentDuration:(t=t.slice(e)).readUInt32BE(0)}},e.mehd.encodingLength=function(t){return 4},e.trex={},e.trex.encode=function(t,i,n){return(i=i?i.slice(n):r.alloc(20)).writeUInt32BE(t.trackId||0,0),i.writeUInt32BE(t.defaultSampleDescriptionIndex||0,4),i.writeUInt32BE(t.defaultSampleDuration||0,8),i.writeUInt32BE(t.defaultSampleSize||0,12),i.writeUInt32BE(t.defaultSampleFlags||0,16),e.trex.encode.bytes=20,i},e.trex.decode=function(t,e){return{trackId:(t=t.slice(e)).readUInt32BE(0),defaultSampleDescriptionIndex:t.readUInt32BE(4),defaultSampleDuration:t.readUInt32BE(8),defaultSampleSize:t.readUInt32BE(12),defaultSampleFlags:t.readUInt32BE(16)}},e.trex.encodingLength=function(t){return 20},e.mfhd={},e.mfhd.encode=function(t,i,n){return(i=i?i.slice(n):r.alloc(4)).writeUInt32BE(t.sequenceNumber||0,0),e.mfhd.encode.bytes=4,i},e.mfhd.decode=function(t,e){return{sequenceNumber:t.readUInt32BE(0)}},e.mfhd.encodingLength=function(t){return 4},e.tfhd={},e.tfhd.encode=function(t,i,n){return(i=i?i.slice(n):r.alloc(4)).writeUInt32BE(t.trackId,0),e.tfhd.encode.bytes=4,i},e.tfhd.decode=function(t,e){},e.tfhd.encodingLength=function(t){return 4},e.tfdt={},e.tfdt.encode=function(t,i,n){return(i=i?i.slice(n):r.alloc(4)).writeUInt32BE(t.baseMediaDecodeTime||0,0),e.tfdt.encode.bytes=4,i},e.tfdt.decode=function(t,e){},e.tfdt.encodingLength=function(t){return 4},e.trun={},e.trun.encode=function(t,i,n){(i=i?i.slice(n):r.alloc(8+16*t.entries.length)).writeUInt32BE(t.entries.length,0),i.writeInt32BE(t.dataOffset,4);for(var s=8,o=0;o<t.entries.length;o++){var a=t.entries[o];i.writeUInt32BE(a.sampleDuration,s),s+=4,i.writeUInt32BE(a.sampleSize,s),s+=4,i.writeUInt32BE(a.sampleFlags,s),s+=4,0===(t.version||0)?i.writeUInt32BE(a.sampleCompositionTimeOffset,s):i.writeInt32BE(a.sampleCompositionTimeOffset,s),s+=4}e.trun.encode.bytes=s},e.trun.decode=function(t,e){},e.trun.encodingLength=function(t){return 8+16*t.entries.length},e.mdat={},e.mdat.encode=function(t,i,r){t.buffer?(t.buffer.copy(i,r),e.mdat.encode.bytes=t.buffer.length):e.mdat.encode.bytes=e.mdat.encodingLength(t)},e.mdat.decode=function(t,e,i){return{buffer:r.from(t.slice(e,i))}},e.mdat.encodingLength=function(t){return t.buffer?t.buffer.length:t.contentLength}},5597:(t,e,i)=>{var r=i(8764).Buffer,n={3:"ESDescriptor",4:"DecoderConfigDescriptor",5:"DecoderSpecificInfo",6:"SLConfigDescriptor"};e.Descriptor={},e.Descriptor.decode=function(t,i,s){var o,a,h=t.readUInt8(i),u=i+1,l=0;do{l=l<<7|127&(o=t.readUInt8(u++))}while(128&o);var c=n[h];return(a=e[c]?e[c].decode(t,u,s):{buffer:r.from(t.slice(u,u+l))}).tag=h,a.tagName=c,a.length=u-i+l,a.contentsLen=l,a},e.DescriptorArray={},e.DescriptorArray.decode=function(t,i,r){for(var s=i,o={};s+2<=r;){var a=e.Descriptor.decode(t,s,r);s+=a.length,o[n[a.tag]||"Descriptor"+a.tag]=a}return o},e.ESDescriptor={},e.ESDescriptor.decode=function(t,i,r){var n=t.readUInt8(i+2),s=i+3;return 128&n&&(s+=2),64&n&&(s+=t.readUInt8(s)+1),32&n&&(s+=2),e.DescriptorArray.decode(t,s,r)},e.DecoderConfigDescriptor={},e.DecoderConfigDescriptor.decode=function(t,i,r){var n=t.readUInt8(i),s=e.DescriptorArray.decode(t,i+13,r);return s.oti=n,s}},2068:(t,e,i)=>{var r=i(8764).Buffer,n=i(4372),s=i(9199),o=4294967295,a=e,h=e.containers={moov:["mvhd","meta","traks","mvex"],trak:["tkhd","tref","trgr","edts","meta","mdia","udta"],edts:["elst"],mdia:["mdhd","hdlr","elng","minf"],minf:["vmhd","smhd","hmhd","sthd","nmhd","dinf","stbl"],dinf:["dref"],stbl:["stsd","stts","ctts","cslg","stsc","stsz","stz2","stco","co64","stss","stsh","padb","stdp","sdtp","sbgps","sgpds","subss","saizs","saios"],mvex:["mehd","trexs","leva"],moof:["mfhd","meta","trafs"],traf:["tfhd","tfdt","trun","sbgps","sgpds","subss","saizs","saios","meta"]};a.encode=function(t,e,i){return a.encodingLength(t),i=i||0,e=e||r.alloc(t.length),a._encode(t,e,i)},a._encode=function(t,e,i){var r=t.type,u=t.length;u>o&&(u=1),e.writeUInt32BE(u,i),e.write(t.type,i+4,4,"ascii");var l=i+8;if(1===u&&(n.encode(t.length,e,l),l+=8),s.fullBoxes[r]&&(e.writeUInt32BE(t.flags||0,l),e.writeUInt8(t.version||0,l),l+=4),h[r])h[r].forEach((function(i){if(5===i.length){var r=t[i]||[];i=i.substr(0,4),r.forEach((function(t){a._encode(t,e,l),l+=a.encode.bytes}))}else t[i]&&(a._encode(t[i],e,l),l+=a.encode.bytes)})),t.otherBoxes&&t.otherBoxes.forEach((function(t){a._encode(t,e,l),l+=a.encode.bytes}));else if(s[r]){var c=s[r].encode;c(t,e,l),l+=c.bytes}else{if(!t.buffer)throw new Error("Either `type` must be set to a known type (not'"+r+"') or `buffer` must be set");t.buffer.copy(e,l),l+=t.buffer.length}return a.encode.bytes=l-i,e},a.readHeaders=function(t,e,i){if(e=e||0,(i=i||t.length)-e<8)return 8;var r,o,a=t.readUInt32BE(e),h=t.toString("ascii",e+4,e+8),u=e+8;if(1===a){if(i-e<16)return 16;a=n.decode(t,u),u+=8}return s.fullBoxes[h]&&(r=t.readUInt8(u),o=16777215&t.readUInt32BE(u),u+=4),{length:a,headersLen:u-e,contentLen:a-(u-e),type:h,version:r,flags:o}},a.decode=function(t,e,i){e=e||0,i=i||t.length;var r=a.readHeaders(t,e,i);if(!r||r.length>i-e)throw new Error("Data too short");return a.decodeWithoutHeaders(r,t,e+r.headersLen,e+r.length)},a.decodeWithoutHeaders=function(t,e,i,n){i=i||0,n=n||e.length;var o=t.type,u={};if(h[o]){u.otherBoxes=[];for(var l=h[o],c=i;n-c>=8;){var d=a.decode(e,c,n);if(c+=d.length,l.indexOf(d.type)>=0)u[d.type]=d;else if(l.indexOf(d.type+"s")>=0){var f=d.type+"s";(u[f]=u[f]||[]).push(d)}else u.otherBoxes.push(d)}}else s[o]?u=(0,s[o].decode)(e,i,n):u.buffer=r.from(e.slice(i,n));return u.length=t.length,u.contentLen=t.contentLen,u.type=t.type,u.version=t.version,u.flags=t.flags,u},a.encodingLength=function(t){var e=t.type,i=8;if(s.fullBoxes[e]&&(i+=4),h[e])h[e].forEach((function(e){if(5===e.length){var r=t[e]||[];e=e.substr(0,4),r.forEach((function(t){t.type=e,i+=a.encodingLength(t)}))}else if(t[e]){var n=t[e];n.type=e,i+=a.encodingLength(n)}})),t.otherBoxes&&t.otherBoxes.forEach((function(t){i+=a.encodingLength(t)}));else if(s[e])i+=s[e].encodingLength(t);else{if(!t.buffer)throw new Error("Either `type` must be set to a known type (not'"+e+"') or `buffer` must be set");i+=t.buffer.length}return i>o&&(i+=8),t.length=i,i}},2604:(t,e,i)=>{var r=i(8764).Buffer,n=i(8473),s=i(354),o=i(2068),a=r.alloc(0);class h extends n.Writable{constructor(t){super(t),this.destroyed=!1,this._pending=0,this._missing=0,this._ignoreEmpty=!1,this._buf=null,this._str=null,this._cb=null,this._ondrain=null,this._writeBuffer=null,this._writeCb=null,this._ondrain=null,this._kick()}destroy(t){this.destroyed||(this.destroyed=!0,t&&this.emit("error",t),this.emit("close"))}_write(t,e,i){if(!this.destroyed){for(var r=!this._str||!this._str._writableState.needDrain;t.length&&!this.destroyed;){if(!this._missing&&!this._ignoreEmpty)return this._writeBuffer=t,void(this._writeCb=i);var n=t.length<this._missing?t.length:this._missing;if(this._buf?t.copy(this._buf,this._buf.length-this._missing):this._str&&(r=this._str.write(n===t.length?t:t.slice(0,n))),this._missing-=n,!this._missing){var s=this._buf,o=this._cb,h=this._str;this._buf=this._cb=this._str=this._ondrain=null,r=!0,this._ignoreEmpty=!1,h&&h.end(),o&&o(s)}t=n===t.length?a:t.slice(n)}if(this._pending&&!this._missing)return this._writeBuffer=t,void(this._writeCb=i);r?i():this._ondrain(i)}}_buffer(t,e){this._missing=t,this._buf=r.alloc(t),this._cb=e}_stream(t,e){return this._missing=t,this._str=new u(this),this._ondrain=s(this._str,"drain"),this._pending++,this._str.on("end",(()=>{this._pending--,this._kick()})),this._cb=e,this._str}_readBox(){const t=(e,i)=>{this._buffer(e,(e=>{i=i?r.concat([i,e]):e;var n=o.readHeaders(i);"number"==typeof n?t(n-i.length,i):(this._pending++,this._headers=n,this.emit("box",n))}))};t(8)}stream(){if(!this._headers)throw new Error("this function can only be called once after 'box' is emitted");var t=this._headers;return this._headers=null,this._stream(t.contentLen,(()=>{this._pending--,this._kick()}))}decode(t){if(!this._headers)throw new Error("this function can only be called once after 'box' is emitted");var e=this._headers;this._headers=null,this._buffer(e.contentLen,(i=>{var r=o.decodeWithoutHeaders(e,i);t(r),this._pending--,this._kick()}))}ignore(){if(!this._headers)throw new Error("this function can only be called once after 'box' is emitted");var t=this._headers;this._headers=null,this._missing=t.contentLen,0===this._missing&&(this._ignoreEmpty=!0),this._cb=()=>{this._pending--,this._kick()}}_kick(){if(!this._pending&&(this._buf||this._str||this._readBox(),this._writeBuffer)){var t=this._writeCb,e=this._writeBuffer;this._writeBuffer=null,this._writeCb=null,this._write(e,null,t)}}}class u extends n.PassThrough{constructor(t){super(),this._parent=t,this.destroyed=!1}destroy(t){this.destroyed||(this.destroyed=!0,this._parent.destroy(t),t&&this.emit("error",t),this.emit("close"))}}t.exports=h},1206:(t,e,i)=>{var r=i(8764).Buffer,n=i(8473),s=i(2068),o=i(4375);function a(){}class h extends n.Readable{constructor(t){super(t),this.destroyed=!1,this._finalized=!1,this._reading=!1,this._stream=null,this._drain=null,this._want=!1,this._onreadable=()=>{this._want&&(this._want=!1,this._read())},this._onend=()=>{this._stream=null}}mdat(t,e){this.mediaData(t,e)}mediaData(t,e){var i=new u(this);return this.box({type:"mdat",contentLength:t,encodeBufferLen:8,stream:i},e),i}box(t,e){if(e||(e=a),this.destroyed)return e(new Error("Encoder is destroyed"));var i;if(t.encodeBufferLen&&(i=r.alloc(t.encodeBufferLen)),t.stream)t.buffer=null,i=s.encode(t,i),this.push(i),this._stream=t.stream,this._stream.on("readable",this._onreadable),this._stream.on("end",this._onend),this._stream.on("end",e),this._forward();else{if(i=s.encode(t,i),this.push(i))return o(e);this._drain=e}}destroy(t){if(!this.destroyed){if(this.destroyed=!0,this._stream&&this._stream.destroy&&this._stream.destroy(),this._stream=null,this._drain){var e=this._drain;this._drain=null,e(t)}t&&this.emit("error",t),this.emit("close")}}finalize(){this._finalized=!0,this._stream||this._drain||this.push(null)}_forward(){if(this._stream)for(;!this.destroyed;){var t=this._stream.read();if(!t)return void(this._want=!!this._stream);if(!this.push(t))return}}_read(){if(!this._reading&&!this.destroyed){if(this._reading=!0,this._stream&&this._forward(),this._drain){var t=this._drain;this._drain=null,t()}this._reading=!1,this._finalized&&this.push(null)}}}class u extends n.PassThrough{constructor(t){super(),this._parent=t,this.destroyed=!1}destroy(t){this.destroyed||(this.destroyed=!0,this._parent.destroy(t),t&&this.emit("error",t),this.emit("close"))}}t.exports=h},2853:(t,e,i)=>{const r=i(2604),n=i(1206);e.decode=t=>new r(t),e.encode=t=>new n(t)},7824:t=>{var e=1e3,i=60*e,r=60*i,n=24*r;function s(t,e,i,r){var n=e>=1.5*i;return Math.round(t/i)+" "+r+(n?"s":"")}t.exports=function(t,o){o=o||{};var a,h,u=typeof t;if("string"===u&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(s){var o=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o;case"weeks":case"week":case"w":return 6048e5*o;case"days":case"day":case"d":return o*n;case"hours":case"hour":case"hrs":case"hr":case"h":return o*r;case"minutes":case"minute":case"mins":case"min":case"m":return o*i;case"seconds":case"second":case"secs":case"sec":case"s":return o*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}}}(t);if("number"===u&&isFinite(t))return o.long?(a=t,(h=Math.abs(a))>=n?s(a,h,n,"day"):h>=r?s(a,h,r,"hour"):h>=i?s(a,h,i,"minute"):h>=e?s(a,h,e,"second"):a+" ms"):function(t){var s=Math.abs(t);return s>=n?Math.round(t/n)+"d":s>=r?Math.round(t/r)+"h":s>=i?Math.round(t/i)+"m":s>=e?Math.round(t/e)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},5673:(t,e,i)=>{const r=i(8473),n=i(778);function s(t){return a(t,{objectMode:!0,highWaterMark:16})}function o(t){return a(t)}function a(t,e){if(!t||"function"==typeof t||t._readableState)return t;const i=new r.Readable(e).wrap(t);return t.destroy&&(i.destroy=t.destroy.bind(t)),i}class h extends r.Readable{constructor(t,e){super({...e,autoDestroy:!0}),this._drained=!1,this._forwarding=!1,this._current=null,this._toStreams2=e&&e.objectMode?s:o,"function"==typeof t?this._queue=t:(this._queue=t.map(this._toStreams2),this._queue.forEach((t=>{"function"!=typeof t&&this._attachErrorListener(t)}))),this._next()}_read(){this._drained=!0,this._forward()}_forward(){if(this._forwarding||!this._drained||!this._current)return;let t;for(this._forwarding=!0;this._drained&&null!==(t=this._current.read());)this._drained=this.push(t);this._forwarding=!1}_destroy(t,e){let i=[];if(this._current&&i.push(this._current),"function"!=typeof this._queue&&(i=i.concat(this._queue)),0===i.length)e(t);else{let r=i.length,s=t;i.forEach((i=>{!function(t,e,i){if(!t.destroy||t.destroyed)i(e);else{const r=n((t=>i(t||e)));t.on("error",r).on("close",(()=>r())).destroy(e,r)}}(i,t,(t=>{s=s||t,0==--r&&e(s)}))}))}}_next(){if(this._current=null,"function"==typeof this._queue)this._queue(((t,e)=>{if(t)return this.destroy(t);e=this._toStreams2(e),this._attachErrorListener(e),this._gotNextStream(e)}));else{let t=this._queue.shift();"function"==typeof t&&(t=this._toStreams2(t()),this._attachErrorListener(t)),this._gotNextStream(t)}}_gotNextStream(t){if(!t)return void this.push(null);this._current=t,this._forward();const e=()=>{this._forward()},i=()=>{if(!t._readableState.ended&&!t.destroyed){const t=new Error("ERR_STREAM_PREMATURE_CLOSE");t.code="ERR_STREAM_PREMATURE_CLOSE",this.destroy(t)}},r=()=>{this._current=null,t.removeListener("readable",e),t.removeListener("end",r),t.removeListener("close",i),t.destroy(),this._next()};t.on("readable",e),t.once("end",r),t.once("close",i)}_attachErrorListener(t){if(!t)return;const e=i=>{t.removeListener("error",e),this.destroy(i)};t.once("error",e)}}h.obj=t=>new h(t,{objectMode:!0,highWaterMark:16}),t.exports=h},354:t=>{t.exports=function(t,e){var i=null;return t.on(e,(function(t){if(i){var e=i;i=null,e(t)}})),function(t){i=t}}},4244:t=>{"use strict";var e=function(t){return t!=t};t.exports=function(t,i){return 0===t&&0===i?1/t==1/i:t===i||!(!e(t)||!e(i))}},609:(t,e,i)=>{"use strict";var r=i(4289),n=i(5559),s=i(4244),o=i(5624),a=i(2281),h=n(o(),Object);r(h,{getPolyfill:o,implementation:s,shim:a}),t.exports=h},5624:(t,e,i)=>{"use strict";var r=i(4244);t.exports=function(){return"function"==typeof Object.is?Object.is:r}},2281:(t,e,i)=>{"use strict";var r=i(5624),n=i(4289);t.exports=function(){var t=r();return n(Object,{is:t},{is:function(){return Object.is!==t}}),t}},8987:(t,e,i)=>{"use strict";var r;if(!Object.keys){var n=Object.prototype.hasOwnProperty,s=Object.prototype.toString,o=i(1414),a=Object.prototype.propertyIsEnumerable,h=!a.call({toString:null},"toString"),u=a.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(t){var e=t.constructor;return e&&e.prototype===t},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!d["$"+t]&&n.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{c(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();r=function(t){var e=null!==t&&"object"==typeof t,i="[object Function]"===s.call(t),r=o(t),a=e&&"[object String]"===s.call(t),d=[];if(!e&&!i&&!r)throw new TypeError("Object.keys called on a non-object");var p=u&&i;if(a&&t.length>0&&!n.call(t,0))for(var m=0;m<t.length;++m)d.push(String(m));if(r&&t.length>0)for(var g=0;g<t.length;++g)d.push(String(g));else for(var b in t)p&&"prototype"===b||!n.call(t,b)||d.push(String(b));if(h)for(var v=function(t){if("undefined"==typeof window||!f)return c(t);try{return c(t)}catch(t){return!1}}(t),y=0;y<l.length;++y)v&&"constructor"===l[y]||!n.call(t,l[y])||d.push(l[y]);return d}}t.exports=r},2215:(t,e,i)=>{"use strict";var r=Array.prototype.slice,n=i(1414),s=Object.keys,o=s?function(t){return s(t)}:i(8987),a=Object.keys;o.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return n(t)?a(r.call(t)):a(t)})}else Object.keys=o;return Object.keys||o},t.exports=o},1414:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var i=e.call(t),r="[object Arguments]"===i;return r||(r="[object Array]"!==i&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),r}},778:(t,e,i)=>{var r=i(2479);function n(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function s(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},i=t.name||"Function wrapped with `once`";return e.onceError=i+" shouldn't be called more than once",e.called=!1,e}t.exports=r(n),t.exports.strict=r(s),n.proto=n((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return n(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return s(this)},configurable:!0})}))},4236:(t,e)=>{"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var n in i)r(i,n)&&(t[n]=i[n])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var n={arraySet:function(t,e,i,r,n){if(e.subarray&&t.subarray)t.set(e.subarray(i,i+r),n);else for(var s=0;s<r;s++)t[n+s]=e[i+s]},flattenChunks:function(t){var e,i,r,n,s,o;for(r=0,e=0,i=t.length;e<i;e++)r+=t[e].length;for(o=new Uint8Array(r),n=0,e=0,i=t.length;e<i;e++)s=t[e],o.set(s,n),n+=s.length;return o}},s={arraySet:function(t,e,i,r,n){for(var s=0;s<r;s++)t[n+s]=e[i+s]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,n)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,s))},e.setTyped(i)},6069:t=>{"use strict";t.exports=function(t,e,i,r){for(var n=65535&t|0,s=t>>>16&65535|0,o=0;0!==i;){i-=o=i>2e3?2e3:i;do{s=s+(n=n+e[r++]|0)|0}while(--o);n%=65521,s%=65521}return n|s<<16|0}},1619:t=>{"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},2869:t=>{"use strict";var e=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();t.exports=function(t,i,r,n){var s=e,o=n+r;t^=-1;for(var a=n;a<o;a++)t=t>>>8^s[255&(t^i[a])];return-1^t}},405:(t,e,i)=>{"use strict";var r,n=i(4236),s=i(342),o=i(6069),a=i(2869),h=i(8898),u=-2,l=258,c=262,d=103,f=113,p=666;function m(t,e){return t.msg=h[e],e}function g(t){return(t<<1)-(t>4?9:0)}function b(t){for(var e=t.length;--e>=0;)t[e]=0}function v(t){var e=t.state,i=e.pending;i>t.avail_out&&(i=t.avail_out),0!==i&&(n.arraySet(t.output,e.pending_buf,e.pending_out,i,t.next_out),t.next_out+=i,e.pending_out+=i,t.total_out+=i,t.avail_out-=i,e.pending-=i,0===e.pending&&(e.pending_out=0))}function y(t,e){s._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,v(t.strm)}function w(t,e){t.pending_buf[t.pending++]=e}function _(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function M(t,e){var i,r,n=t.max_chain_length,s=t.strstart,o=t.prev_length,a=t.nice_match,h=t.strstart>t.w_size-c?t.strstart-(t.w_size-c):0,u=t.window,d=t.w_mask,f=t.prev,p=t.strstart+l,m=u[s+o-1],g=u[s+o];t.prev_length>=t.good_match&&(n>>=2),a>t.lookahead&&(a=t.lookahead);do{if(u[(i=e)+o]===g&&u[i+o-1]===m&&u[i]===u[s]&&u[++i]===u[s+1]){s+=2,i++;do{}while(u[++s]===u[++i]&&u[++s]===u[++i]&&u[++s]===u[++i]&&u[++s]===u[++i]&&u[++s]===u[++i]&&u[++s]===u[++i]&&u[++s]===u[++i]&&u[++s]===u[++i]&&s<p);if(r=l-(p-s),s=p-l,r>o){if(t.match_start=e,o=r,r>=a)break;m=u[s+o-1],g=u[s+o]}}}while((e=f[e&d])>h&&0!=--n);return o<=t.lookahead?o:t.lookahead}function k(t){var e,i,r,s,h,u,l,d,f,p,m=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=m+(m-c)){n.arraySet(t.window,t.window,m,m,0),t.match_start-=m,t.strstart-=m,t.block_start-=m,e=i=t.hash_size;do{r=t.head[--e],t.head[e]=r>=m?r-m:0}while(--i);e=i=m;do{r=t.prev[--e],t.prev[e]=r>=m?r-m:0}while(--i);s+=m}if(0===t.strm.avail_in)break;if(u=t.strm,l=t.window,d=t.strstart+t.lookahead,f=s,p=void 0,(p=u.avail_in)>f&&(p=f),i=0===p?0:(u.avail_in-=p,n.arraySet(l,u.input,u.next_in,p,d),1===u.state.wrap?u.adler=o(u.adler,l,p,d):2===u.state.wrap&&(u.adler=a(u.adler,l,p,d)),u.next_in+=p,u.total_in+=p,p),t.lookahead+=i,t.lookahead+t.insert>=3)for(h=t.strstart-t.insert,t.ins_h=t.window[h],t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+3-1])&t.hash_mask,t.prev[h&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=h,h++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<c&&0!==t.strm.avail_in)}function x(t,e){for(var i,r;;){if(t.lookahead<c){if(k(t),t.lookahead<c&&0===e)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==i&&t.strstart-i<=t.w_size-c&&(t.match_length=M(t,i)),t.match_length>=3)if(r=s._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(y(t,!1),0===t.strm.avail_out)?1:2}function E(t,e){for(var i,r,n;;){if(t.lookahead<c){if(k(t),t.lookahead<c&&0===e)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==i&&t.prev_length<t.max_lazy_match&&t.strstart-i<=t.w_size-c&&(t.match_length=M(t,i),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,r=s._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,r&&(y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((r=s._tr_tally(t,0,t.window[t.strstart-1]))&&y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=s._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(y(t,!1),0===t.strm.avail_out)?1:2}function S(t,e,i,r,n){this.good_length=t,this.max_lazy=e,this.nice_length=i,this.max_chain=r,this.func=n}function T(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new n.Buf16(1146),this.dyn_dtree=new n.Buf16(122),this.bl_tree=new n.Buf16(78),b(this.dyn_ltree),b(this.dyn_dtree),b(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(16),this.heap=new n.Buf16(573),b(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(573),b(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function A(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:f,t.adler=2===e.wrap?0:1,e.last_flush=0,s._tr_init(e),0):m(t,u)}function I(t){var e,i=A(t);return 0===i&&((e=t.state).window_size=2*e.w_size,b(e.head),e.max_lazy_match=r[e.level].max_lazy,e.good_match=r[e.level].good_length,e.nice_match=r[e.level].nice_length,e.max_chain_length=r[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i}function C(t,e,i,r,s,o){if(!t)return u;var a=1;if(-1===e&&(e=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),s<1||s>9||8!==i||r<8||r>15||e<0||e>9||o<0||o>4)return m(t,u);8===r&&(r=9);var h=new T;return t.state=h,h.strm=t,h.wrap=a,h.gzhead=null,h.w_bits=r,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=s+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new n.Buf8(2*h.w_size),h.head=new n.Buf16(h.hash_size),h.prev=new n.Buf16(h.w_size),h.lit_bufsize=1<<s+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new n.Buf8(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=o,h.method=i,I(t)}r=[new S(0,0,0,0,(function(t,e){var i=65535;for(i>t.pending_buf_size-5&&(i=t.pending_buf_size-5);;){if(t.lookahead<=1){if(k(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var r=t.block_start+i;if((0===t.strstart||t.strstart>=r)&&(t.lookahead=t.strstart-r,t.strstart=r,y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-c&&(y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(y(t,!1),t.strm.avail_out),1)})),new S(4,4,8,4,x),new S(4,5,16,8,x),new S(4,6,32,32,x),new S(4,4,16,16,E),new S(8,16,32,32,E),new S(8,16,128,128,E),new S(8,32,128,256,E),new S(32,128,258,1024,E),new S(32,258,258,4096,E)],e.deflateInit=function(t,e){return C(t,e,8,15,8,0)},e.deflateInit2=C,e.deflateReset=I,e.deflateResetKeep=A,e.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?u:(t.state.gzhead=e,0):u},e.deflate=function(t,e){var i,n,o,h;if(!t||!t.state||e>5||e<0)return t?m(t,u):u;if(n=t.state,!t.output||!t.input&&0!==t.avail_in||n.status===p&&4!==e)return m(t,0===t.avail_out?-5:u);if(n.strm=t,i=n.last_flush,n.last_flush=e,42===n.status)if(2===n.wrap)t.adler=0,w(n,31),w(n,139),w(n,8),n.gzhead?(w(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),w(n,255&n.gzhead.time),w(n,n.gzhead.time>>8&255),w(n,n.gzhead.time>>16&255),w(n,n.gzhead.time>>24&255),w(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),w(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(w(n,255&n.gzhead.extra.length),w(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=a(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(w(n,0),w(n,0),w(n,0),w(n,0),w(n,0),w(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),w(n,3),n.status=f);else{var c=8+(n.w_bits-8<<4)<<8;c|=(n.strategy>=2||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(c|=32),c+=31-c%31,n.status=f,_(n,c),0!==n.strstart&&(_(n,t.adler>>>16),_(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),v(t),o=n.pending,n.pending!==n.pending_buf_size));)w(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),v(t),o=n.pending,n.pending===n.pending_buf_size)){h=1;break}h=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,w(n,h)}while(0!==h);n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),0===h&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),v(t),o=n.pending,n.pending===n.pending_buf_size)){h=1;break}h=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,w(n,h)}while(0!==h);n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),0===h&&(n.status=d)}else n.status=d;if(n.status===d&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&v(t),n.pending+2<=n.pending_buf_size&&(w(n,255&t.adler),w(n,t.adler>>8&255),t.adler=0,n.status=f)):n.status=f),0!==n.pending){if(v(t),0===t.avail_out)return n.last_flush=-1,0}else if(0===t.avail_in&&g(e)<=g(i)&&4!==e)return m(t,-5);if(n.status===p&&0!==t.avail_in)return m(t,-5);if(0!==t.avail_in||0!==n.lookahead||0!==e&&n.status!==p){var M=2===n.strategy?function(t,e){for(var i;;){if(0===t.lookahead&&(k(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,i=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,i&&(y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(y(t,!1),0===t.strm.avail_out)?1:2}(n,e):3===n.strategy?function(t,e){for(var i,r,n,o,a=t.window;;){if(t.lookahead<=l){if(k(t),t.lookahead<=l&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(r=a[n=t.strstart-1])===a[++n]&&r===a[++n]&&r===a[++n]){o=t.strstart+l;do{}while(r===a[++n]&&r===a[++n]&&r===a[++n]&&r===a[++n]&&r===a[++n]&&r===a[++n]&&r===a[++n]&&r===a[++n]&&n<o);t.match_length=l-(o-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(i=s._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(i=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),i&&(y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(y(t,!1),0===t.strm.avail_out)?1:2}(n,e):r[n.level].func(n,e);if(3!==M&&4!==M||(n.status=p),1===M||3===M)return 0===t.avail_out&&(n.last_flush=-1),0;if(2===M&&(1===e?s._tr_align(n):5!==e&&(s._tr_stored_block(n,0,0,!1),3===e&&(b(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),v(t),0===t.avail_out))return n.last_flush=-1,0}return 4!==e?0:n.wrap<=0?1:(2===n.wrap?(w(n,255&t.adler),w(n,t.adler>>8&255),w(n,t.adler>>16&255),w(n,t.adler>>24&255),w(n,255&t.total_in),w(n,t.total_in>>8&255),w(n,t.total_in>>16&255),w(n,t.total_in>>24&255)):(_(n,t.adler>>>16),_(n,65535&t.adler)),v(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?0:1)},e.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&e!==d&&e!==f&&e!==p?m(t,u):(t.state=null,e===f?m(t,-3):0):u},e.deflateSetDictionary=function(t,e){var i,r,s,a,h,l,c,d,f=e.length;if(!t||!t.state)return u;if(2===(a=(i=t.state).wrap)||1===a&&42!==i.status||i.lookahead)return u;for(1===a&&(t.adler=o(t.adler,e,f,0)),i.wrap=0,f>=i.w_size&&(0===a&&(b(i.head),i.strstart=0,i.block_start=0,i.insert=0),d=new n.Buf8(i.w_size),n.arraySet(d,e,f-i.w_size,i.w_size,0),e=d,f=i.w_size),h=t.avail_in,l=t.next_in,c=t.input,t.avail_in=f,t.next_in=0,t.input=e,k(i);i.lookahead>=3;){r=i.strstart,s=i.lookahead-2;do{i.ins_h=(i.ins_h<<i.hash_shift^i.window[r+3-1])&i.hash_mask,i.prev[r&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=r,r++}while(--s);i.strstart=r,i.lookahead=2,k(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=l,t.input=c,t.avail_in=h,i.wrap=a,0},e.deflateInfo="pako deflate (from Nodeca project)"},3318:t=>{"use strict";t.exports=function(t,e){var i,r,n,s,o,a,h,u,l,c,d,f,p,m,g,b,v,y,w,_,M,k,x,E,S;i=t.state,r=t.next_in,E=t.input,n=r+(t.avail_in-5),s=t.next_out,S=t.output,o=s-(e-t.avail_out),a=s+(t.avail_out-257),h=i.dmax,u=i.wsize,l=i.whave,c=i.wnext,d=i.window,f=i.hold,p=i.bits,m=i.lencode,g=i.distcode,b=(1<<i.lenbits)-1,v=(1<<i.distbits)-1;t:do{p<15&&(f+=E[r++]<<p,p+=8,f+=E[r++]<<p,p+=8),y=m[f&b];e:for(;;){if(f>>>=w=y>>>24,p-=w,0==(w=y>>>16&255))S[s++]=65535&y;else{if(!(16&w)){if(0==(64&w)){y=m[(65535&y)+(f&(1<<w)-1)];continue e}if(32&w){i.mode=12;break t}t.msg="invalid literal/length code",i.mode=30;break t}_=65535&y,(w&=15)&&(p<w&&(f+=E[r++]<<p,p+=8),_+=f&(1<<w)-1,f>>>=w,p-=w),p<15&&(f+=E[r++]<<p,p+=8,f+=E[r++]<<p,p+=8),y=g[f&v];i:for(;;){if(f>>>=w=y>>>24,p-=w,!(16&(w=y>>>16&255))){if(0==(64&w)){y=g[(65535&y)+(f&(1<<w)-1)];continue i}t.msg="invalid distance code",i.mode=30;break t}if(M=65535&y,p<(w&=15)&&(f+=E[r++]<<p,(p+=8)<w&&(f+=E[r++]<<p,p+=8)),(M+=f&(1<<w)-1)>h){t.msg="invalid distance too far back",i.mode=30;break t}if(f>>>=w,p-=w,M>(w=s-o)){if((w=M-w)>l&&i.sane){t.msg="invalid distance too far back",i.mode=30;break t}if(k=0,x=d,0===c){if(k+=u-w,w<_){_-=w;do{S[s++]=d[k++]}while(--w);k=s-M,x=S}}else if(c<w){if(k+=u+c-w,(w-=c)<_){_-=w;do{S[s++]=d[k++]}while(--w);if(k=0,c<_){_-=w=c;do{S[s++]=d[k++]}while(--w);k=s-M,x=S}}}else if(k+=c-w,w<_){_-=w;do{S[s++]=d[k++]}while(--w);k=s-M,x=S}for(;_>2;)S[s++]=x[k++],S[s++]=x[k++],S[s++]=x[k++],_-=3;_&&(S[s++]=x[k++],_>1&&(S[s++]=x[k++]))}else{k=s-M;do{S[s++]=S[k++],S[s++]=S[k++],S[s++]=S[k++],_-=3}while(_>2);_&&(S[s++]=S[k++],_>1&&(S[s++]=S[k++]))}break}}break}}while(r<n&&s<a);r-=_=p>>3,f&=(1<<(p-=_<<3))-1,t.next_in=r,t.next_out=s,t.avail_in=r<n?n-r+5:5-(r-n),t.avail_out=s<a?a-s+257:257-(s-a),i.hold=f,i.bits=p}},7948:(t,e,i)=>{"use strict";var r=i(4236),n=i(6069),s=i(2869),o=i(3318),a=i(9241),h=-2,u=12,l=30;function c(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function d(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function f(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new r.Buf32(852),e.distcode=e.distdyn=new r.Buf32(592),e.sane=1,e.back=-1,0):h}function p(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,f(t)):h}function m(t,e){var i,r;return t&&t.state?(r=t.state,e<0?(i=0,e=-e):(i=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?h:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=i,r.wbits=e,p(t))):h}function g(t,e){var i,r;return t?(r=new d,t.state=r,r.window=null,0!==(i=m(t,e))&&(t.state=null),i):h}var b,v,y=!0;function w(t){if(y){var e;for(b=new r.Buf32(512),v=new r.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(a(1,t.lens,0,288,b,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;a(2,t.lens,0,32,v,0,t.work,{bits:5}),y=!1}t.lencode=b,t.lenbits=9,t.distcode=v,t.distbits=5}function _(t,e,i,n){var s,o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new r.Buf8(o.wsize)),n>=o.wsize?(r.arraySet(o.window,e,i-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((s=o.wsize-o.wnext)>n&&(s=n),r.arraySet(o.window,e,i-n,s,o.wnext),(n-=s)?(r.arraySet(o.window,e,i-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=s))),0}e.inflateReset=p,e.inflateReset2=m,e.inflateResetKeep=f,e.inflateInit=function(t){return g(t,15)},e.inflateInit2=g,e.inflate=function(t,e){var i,d,f,p,m,g,b,v,y,M,k,x,E,S,T,A,I,C,B,R,P,L,O,D,N=0,j=new r.Buf8(4),U=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return h;(i=t.state).mode===u&&(i.mode=13),m=t.next_out,f=t.output,b=t.avail_out,p=t.next_in,d=t.input,g=t.avail_in,v=i.hold,y=i.bits,M=g,k=b,L=0;t:for(;;)switch(i.mode){case 1:if(0===i.wrap){i.mode=13;break}for(;y<16;){if(0===g)break t;g--,v+=d[p++]<<y,y+=8}if(2&i.wrap&&35615===v){i.check=0,j[0]=255&v,j[1]=v>>>8&255,i.check=s(i.check,j,2,0),v=0,y=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&v)<<8)+(v>>8))%31){t.msg="incorrect header check",i.mode=l;break}if(8!=(15&v)){t.msg="unknown compression method",i.mode=l;break}if(y-=4,P=8+(15&(v>>>=4)),0===i.wbits)i.wbits=P;else if(P>i.wbits){t.msg="invalid window size",i.mode=l;break}i.dmax=1<<P,t.adler=i.check=1,i.mode=512&v?10:u,v=0,y=0;break;case 2:for(;y<16;){if(0===g)break t;g--,v+=d[p++]<<y,y+=8}if(i.flags=v,8!=(255&i.flags)){t.msg="unknown compression method",i.mode=l;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=l;break}i.head&&(i.head.text=v>>8&1),512&i.flags&&(j[0]=255&v,j[1]=v>>>8&255,i.check=s(i.check,j,2,0)),v=0,y=0,i.mode=3;case 3:for(;y<32;){if(0===g)break t;g--,v+=d[p++]<<y,y+=8}i.head&&(i.head.time=v),512&i.flags&&(j[0]=255&v,j[1]=v>>>8&255,j[2]=v>>>16&255,j[3]=v>>>24&255,i.check=s(i.check,j,4,0)),v=0,y=0,i.mode=4;case 4:for(;y<16;){if(0===g)break t;g--,v+=d[p++]<<y,y+=8}i.head&&(i.head.xflags=255&v,i.head.os=v>>8),512&i.flags&&(j[0]=255&v,j[1]=v>>>8&255,i.check=s(i.check,j,2,0)),v=0,y=0,i.mode=5;case 5:if(1024&i.flags){for(;y<16;){if(0===g)break t;g--,v+=d[p++]<<y,y+=8}i.length=v,i.head&&(i.head.extra_len=v),512&i.flags&&(j[0]=255&v,j[1]=v>>>8&255,i.check=s(i.check,j,2,0)),v=0,y=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&((x=i.length)>g&&(x=g),x&&(i.head&&(P=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),r.arraySet(i.head.extra,d,p,x,P)),512&i.flags&&(i.check=s(i.check,d,x,p)),g-=x,p+=x,i.length-=x),i.length))break t;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===g)break t;x=0;do{P=d[p+x++],i.head&&P&&i.length<65536&&(i.head.name+=String.fromCharCode(P))}while(P&&x<g);if(512&i.flags&&(i.check=s(i.check,d,x,p)),g-=x,p+=x,P)break t}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===g)break t;x=0;do{P=d[p+x++],i.head&&P&&i.length<65536&&(i.head.comment+=String.fromCharCode(P))}while(P&&x<g);if(512&i.flags&&(i.check=s(i.check,d,x,p)),g-=x,p+=x,P)break t}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;y<16;){if(0===g)break t;g--,v+=d[p++]<<y,y+=8}if(v!==(65535&i.check)){t.msg="header crc mismatch",i.mode=l;break}v=0,y=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=u;break;case 10:for(;y<32;){if(0===g)break t;g--,v+=d[p++]<<y,y+=8}t.adler=i.check=c(v),v=0,y=0,i.mode=11;case 11:if(0===i.havedict)return t.next_out=m,t.avail_out=b,t.next_in=p,t.avail_in=g,i.hold=v,i.bits=y,2;t.adler=i.check=1,i.mode=u;case u:if(5===e||6===e)break t;case 13:if(i.last){v>>>=7&y,y-=7&y,i.mode=27;break}for(;y<3;){if(0===g)break t;g--,v+=d[p++]<<y,y+=8}switch(i.last=1&v,y-=1,3&(v>>>=1)){case 0:i.mode=14;break;case 1:if(w(i),i.mode=20,6===e){v>>>=2,y-=2;break t}break;case 2:i.mode=17;break;case 3:t.msg="invalid block type",i.mode=l}v>>>=2,y-=2;break;case 14:for(v>>>=7&y,y-=7&y;y<32;){if(0===g)break t;g--,v+=d[p++]<<y,y+=8}if((65535&v)!=(v>>>16^65535)){t.msg="invalid stored block lengths",i.mode=l;break}if(i.length=65535&v,v=0,y=0,i.mode=15,6===e)break t;case 15:i.mode=16;case 16:if(x=i.length){if(x>g&&(x=g),x>b&&(x=b),0===x)break t;r.arraySet(f,d,p,x,m),g-=x,p+=x,b-=x,m+=x,i.length-=x;break}i.mode=u;break;case 17:for(;y<14;){if(0===g)break t;g--,v+=d[p++]<<y,y+=8}if(i.nlen=257+(31&v),v>>>=5,y-=5,i.ndist=1+(31&v),v>>>=5,y-=5,i.ncode=4+(15&v),v>>>=4,y-=4,i.nlen>286||i.ndist>30){t.msg="too many length or distance symbols",i.mode=l;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;y<3;){if(0===g)break t;g--,v+=d[p++]<<y,y+=8}i.lens[U[i.have++]]=7&v,v>>>=3,y-=3}for(;i.have<19;)i.lens[U[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,O={bits:i.lenbits},L=a(0,i.lens,0,19,i.lencode,0,i.work,O),i.lenbits=O.bits,L){t.msg="invalid code lengths set",i.mode=l;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;A=(N=i.lencode[v&(1<<i.lenbits)-1])>>>16&255,I=65535&N,!((T=N>>>24)<=y);){if(0===g)break t;g--,v+=d[p++]<<y,y+=8}if(I<16)v>>>=T,y-=T,i.lens[i.have++]=I;else{if(16===I){for(D=T+2;y<D;){if(0===g)break t;g--,v+=d[p++]<<y,y+=8}if(v>>>=T,y-=T,0===i.have){t.msg="invalid bit length repeat",i.mode=l;break}P=i.lens[i.have-1],x=3+(3&v),v>>>=2,y-=2}else if(17===I){for(D=T+3;y<D;){if(0===g)break t;g--,v+=d[p++]<<y,y+=8}y-=T,P=0,x=3+(7&(v>>>=T)),v>>>=3,y-=3}else{for(D=T+7;y<D;){if(0===g)break t;g--,v+=d[p++]<<y,y+=8}y-=T,P=0,x=11+(127&(v>>>=T)),v>>>=7,y-=7}if(i.have+x>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=l;break}for(;x--;)i.lens[i.have++]=P}}if(i.mode===l)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=l;break}if(i.lenbits=9,O={bits:i.lenbits},L=a(1,i.lens,0,i.nlen,i.lencode,0,i.work,O),i.lenbits=O.bits,L){t.msg="invalid literal/lengths set",i.mode=l;break}if(i.distbits=6,i.distcode=i.distdyn,O={bits:i.distbits},L=a(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,O),i.distbits=O.bits,L){t.msg="invalid distances set",i.mode=l;break}if(i.mode=20,6===e)break t;case 20:i.mode=21;case 21:if(g>=6&&b>=258){t.next_out=m,t.avail_out=b,t.next_in=p,t.avail_in=g,i.hold=v,i.bits=y,o(t,k),m=t.next_out,f=t.output,b=t.avail_out,p=t.next_in,d=t.input,g=t.avail_in,v=i.hold,y=i.bits,i.mode===u&&(i.back=-1);break}for(i.back=0;A=(N=i.lencode[v&(1<<i.lenbits)-1])>>>16&255,I=65535&N,!((T=N>>>24)<=y);){if(0===g)break t;g--,v+=d[p++]<<y,y+=8}if(A&&0==(240&A)){for(C=T,B=A,R=I;A=(N=i.lencode[R+((v&(1<<C+B)-1)>>C)])>>>16&255,I=65535&N,!(C+(T=N>>>24)<=y);){if(0===g)break t;g--,v+=d[p++]<<y,y+=8}v>>>=C,y-=C,i.back+=C}if(v>>>=T,y-=T,i.back+=T,i.length=I,0===A){i.mode=26;break}if(32&A){i.back=-1,i.mode=u;break}if(64&A){t.msg="invalid literal/length code",i.mode=l;break}i.extra=15&A,i.mode=22;case 22:if(i.extra){for(D=i.extra;y<D;){if(0===g)break t;g--,v+=d[p++]<<y,y+=8}i.length+=v&(1<<i.extra)-1,v>>>=i.extra,y-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;A=(N=i.distcode[v&(1<<i.distbits)-1])>>>16&255,I=65535&N,!((T=N>>>24)<=y);){if(0===g)break t;g--,v+=d[p++]<<y,y+=8}if(0==(240&A)){for(C=T,B=A,R=I;A=(N=i.distcode[R+((v&(1<<C+B)-1)>>C)])>>>16&255,I=65535&N,!(C+(T=N>>>24)<=y);){if(0===g)break t;g--,v+=d[p++]<<y,y+=8}v>>>=C,y-=C,i.back+=C}if(v>>>=T,y-=T,i.back+=T,64&A){t.msg="invalid distance code",i.mode=l;break}i.offset=I,i.extra=15&A,i.mode=24;case 24:if(i.extra){for(D=i.extra;y<D;){if(0===g)break t;g--,v+=d[p++]<<y,y+=8}i.offset+=v&(1<<i.extra)-1,v>>>=i.extra,y-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=l;break}i.mode=25;case 25:if(0===b)break t;if(x=k-b,i.offset>x){if((x=i.offset-x)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=l;break}x>i.wnext?(x-=i.wnext,E=i.wsize-x):E=i.wnext-x,x>i.length&&(x=i.length),S=i.window}else S=f,E=m-i.offset,x=i.length;x>b&&(x=b),b-=x,i.length-=x;do{f[m++]=S[E++]}while(--x);0===i.length&&(i.mode=21);break;case 26:if(0===b)break t;f[m++]=i.length,b--,i.mode=21;break;case 27:if(i.wrap){for(;y<32;){if(0===g)break t;g--,v|=d[p++]<<y,y+=8}if(k-=b,t.total_out+=k,i.total+=k,k&&(t.adler=i.check=i.flags?s(i.check,f,k,m-k):n(i.check,f,k,m-k)),k=b,(i.flags?v:c(v))!==i.check){t.msg="incorrect data check",i.mode=l;break}v=0,y=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;y<32;){if(0===g)break t;g--,v+=d[p++]<<y,y+=8}if(v!==(4294967295&i.total)){t.msg="incorrect length check",i.mode=l;break}v=0,y=0}i.mode=29;case 29:L=1;break t;case l:L=-3;break t;case 31:return-4;default:return h}return t.next_out=m,t.avail_out=b,t.next_in=p,t.avail_in=g,i.hold=v,i.bits=y,(i.wsize||k!==t.avail_out&&i.mode<l&&(i.mode<27||4!==e))&&_(t,t.output,t.next_out,k-t.avail_out)?(i.mode=31,-4):(M-=t.avail_in,k-=t.avail_out,t.total_in+=M,t.total_out+=k,i.total+=k,i.wrap&&k&&(t.adler=i.check=i.flags?s(i.check,f,k,t.next_out-k):n(i.check,f,k,t.next_out-k)),t.data_type=i.bits+(i.last?64:0)+(i.mode===u?128:0)+(20===i.mode||15===i.mode?256:0),(0===M&&0===k||4===e)&&0===L&&(L=-5),L)},e.inflateEnd=function(t){if(!t||!t.state)return h;var e=t.state;return e.window&&(e.window=null),t.state=null,0},e.inflateGetHeader=function(t,e){var i;return t&&t.state?0==(2&(i=t.state).wrap)?h:(i.head=e,e.done=!1,0):h},e.inflateSetDictionary=function(t,e){var i,r=e.length;return t&&t.state?0!==(i=t.state).wrap&&11!==i.mode?h:11===i.mode&&n(1,e,r,0)!==i.check?-3:_(t,e,r,r)?(i.mode=31,-4):(i.havedict=1,0):h},e.inflateInfo="pako inflate (from Nodeca project)"},9241:(t,e,i)=>{"use strict";var r=i(4236),n=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],s=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(t,e,i,h,u,l,c,d){var f,p,m,g,b,v,y,w,_,M=d.bits,k=0,x=0,E=0,S=0,T=0,A=0,I=0,C=0,B=0,R=0,P=null,L=0,O=new r.Buf16(16),D=new r.Buf16(16),N=null,j=0;for(k=0;k<=15;k++)O[k]=0;for(x=0;x<h;x++)O[e[i+x]]++;for(T=M,S=15;S>=1&&0===O[S];S--);if(T>S&&(T=S),0===S)return u[l++]=20971520,u[l++]=20971520,d.bits=1,0;for(E=1;E<S&&0===O[E];E++);for(T<E&&(T=E),C=1,k=1;k<=15;k++)if(C<<=1,(C-=O[k])<0)return-1;if(C>0&&(0===t||1!==S))return-1;for(D[1]=0,k=1;k<15;k++)D[k+1]=D[k]+O[k];for(x=0;x<h;x++)0!==e[i+x]&&(c[D[e[i+x]]++]=x);if(0===t?(P=N=c,v=19):1===t?(P=n,L-=257,N=s,j-=257,v=256):(P=o,N=a,v=-1),R=0,x=0,k=E,b=l,A=T,I=0,m=-1,g=(B=1<<T)-1,1===t&&B>852||2===t&&B>592)return 1;for(;;){y=k-I,c[x]<v?(w=0,_=c[x]):c[x]>v?(w=N[j+c[x]],_=P[L+c[x]]):(w=96,_=0),f=1<<k-I,E=p=1<<A;do{u[b+(R>>I)+(p-=f)]=y<<24|w<<16|_|0}while(0!==p);for(f=1<<k-1;R&f;)f>>=1;if(0!==f?(R&=f-1,R+=f):R=0,x++,0==--O[k]){if(k===S)break;k=e[i+c[x]]}if(k>T&&(R&g)!==m){for(0===I&&(I=T),b+=E,C=1<<(A=k-I);A+I<S&&!((C-=O[A+I])<=0);)A++,C<<=1;if(B+=1<<A,1===t&&B>852||2===t&&B>592)return 1;u[m=R&g]=T<<24|A<<16|b-l|0}}return 0!==R&&(u[b+R]=k-I<<24|64<<16|0),d.bits=T,0}},8898:t=>{"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},342:(t,e,i)=>{"use strict";var r=i(4236);function n(t){for(var e=t.length;--e>=0;)t[e]=0}var s=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],o=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],u=new Array(576);n(u);var l=new Array(60);n(l);var c=new Array(512);n(c);var d=new Array(256);n(d);var f=new Array(29);n(f);var p,m,g,b=new Array(30);function v(t,e,i,r,n){this.static_tree=t,this.extra_bits=e,this.extra_base=i,this.elems=r,this.max_length=n,this.has_stree=t&&t.length}function y(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function w(t){return t<256?c[t]:c[256+(t>>>7)]}function _(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function M(t,e,i){t.bi_valid>16-i?(t.bi_buf|=e<<t.bi_valid&65535,_(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=i-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=i)}function k(t,e,i){M(t,i[2*e],i[2*e+1])}function x(t,e){var i=0;do{i|=1&t,t>>>=1,i<<=1}while(--e>0);return i>>>1}function E(t,e,i){var r,n,s=new Array(16),o=0;for(r=1;r<=15;r++)s[r]=o=o+i[r-1]<<1;for(n=0;n<=e;n++){var a=t[2*n+1];0!==a&&(t[2*n]=x(s[a]++,a))}}function S(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function T(t){t.bi_valid>8?_(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function A(t,e,i,r){var n=2*e,s=2*i;return t[n]<t[s]||t[n]===t[s]&&r[e]<=r[i]}function I(t,e,i){for(var r=t.heap[i],n=i<<1;n<=t.heap_len&&(n<t.heap_len&&A(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!A(e,r,t.heap[n],t.depth));)t.heap[i]=t.heap[n],i=n,n<<=1;t.heap[i]=r}function C(t,e,i){var r,n,a,h,u=0;if(0!==t.last_lit)do{r=t.pending_buf[t.d_buf+2*u]<<8|t.pending_buf[t.d_buf+2*u+1],n=t.pending_buf[t.l_buf+u],u++,0===r?k(t,n,e):(k(t,(a=d[n])+256+1,e),0!==(h=s[a])&&M(t,n-=f[a],h),k(t,a=w(--r),i),0!==(h=o[a])&&M(t,r-=b[a],h))}while(u<t.last_lit);k(t,256,e)}function B(t,e){var i,r,n,s=e.dyn_tree,o=e.stat_desc.static_tree,a=e.stat_desc.has_stree,h=e.stat_desc.elems,u=-1;for(t.heap_len=0,t.heap_max=573,i=0;i<h;i++)0!==s[2*i]?(t.heap[++t.heap_len]=u=i,t.depth[i]=0):s[2*i+1]=0;for(;t.heap_len<2;)s[2*(n=t.heap[++t.heap_len]=u<2?++u:0)]=1,t.depth[n]=0,t.opt_len--,a&&(t.static_len-=o[2*n+1]);for(e.max_code=u,i=t.heap_len>>1;i>=1;i--)I(t,s,i);n=h;do{i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],I(t,s,1),r=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=r,s[2*n]=s[2*i]+s[2*r],t.depth[n]=(t.depth[i]>=t.depth[r]?t.depth[i]:t.depth[r])+1,s[2*i+1]=s[2*r+1]=n,t.heap[1]=n++,I(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var i,r,n,s,o,a,h=e.dyn_tree,u=e.max_code,l=e.stat_desc.static_tree,c=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,p=e.stat_desc.max_length,m=0;for(s=0;s<=15;s++)t.bl_count[s]=0;for(h[2*t.heap[t.heap_max]+1]=0,i=t.heap_max+1;i<573;i++)(s=h[2*h[2*(r=t.heap[i])+1]+1]+1)>p&&(s=p,m++),h[2*r+1]=s,r>u||(t.bl_count[s]++,o=0,r>=f&&(o=d[r-f]),a=h[2*r],t.opt_len+=a*(s+o),c&&(t.static_len+=a*(l[2*r+1]+o)));if(0!==m){do{for(s=p-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[p]--,m-=2}while(m>0);for(s=p;0!==s;s--)for(r=t.bl_count[s];0!==r;)(n=t.heap[--i])>u||(h[2*n+1]!==s&&(t.opt_len+=(s-h[2*n+1])*h[2*n],h[2*n+1]=s),r--)}}(t,e),E(s,u,t.bl_count)}function R(t,e,i){var r,n,s=-1,o=e[1],a=0,h=7,u=4;for(0===o&&(h=138,u=3),e[2*(i+1)+1]=65535,r=0;r<=i;r++)n=o,o=e[2*(r+1)+1],++a<h&&n===o||(a<u?t.bl_tree[2*n]+=a:0!==n?(n!==s&&t.bl_tree[2*n]++,t.bl_tree[32]++):a<=10?t.bl_tree[34]++:t.bl_tree[36]++,a=0,s=n,0===o?(h=138,u=3):n===o?(h=6,u=3):(h=7,u=4))}function P(t,e,i){var r,n,s=-1,o=e[1],a=0,h=7,u=4;for(0===o&&(h=138,u=3),r=0;r<=i;r++)if(n=o,o=e[2*(r+1)+1],!(++a<h&&n===o)){if(a<u)do{k(t,n,t.bl_tree)}while(0!=--a);else 0!==n?(n!==s&&(k(t,n,t.bl_tree),a--),k(t,16,t.bl_tree),M(t,a-3,2)):a<=10?(k(t,17,t.bl_tree),M(t,a-3,3)):(k(t,18,t.bl_tree),M(t,a-11,7));a=0,s=n,0===o?(h=138,u=3):n===o?(h=6,u=3):(h=7,u=4)}}n(b);var L=!1;function O(t,e,i,n){M(t,0+(n?1:0),3),function(t,e,i,n){T(t),_(t,i),_(t,~i),r.arraySet(t.pending_buf,t.window,e,i,t.pending),t.pending+=i}(t,e,i)}e._tr_init=function(t){L||(function(){var t,e,i,r,n,h=new Array(16);for(i=0,r=0;r<28;r++)for(f[r]=i,t=0;t<1<<s[r];t++)d[i++]=r;for(d[i-1]=r,n=0,r=0;r<16;r++)for(b[r]=n,t=0;t<1<<o[r];t++)c[n++]=r;for(n>>=7;r<30;r++)for(b[r]=n<<7,t=0;t<1<<o[r]-7;t++)c[256+n++]=r;for(e=0;e<=15;e++)h[e]=0;for(t=0;t<=143;)u[2*t+1]=8,t++,h[8]++;for(;t<=255;)u[2*t+1]=9,t++,h[9]++;for(;t<=279;)u[2*t+1]=7,t++,h[7]++;for(;t<=287;)u[2*t+1]=8,t++,h[8]++;for(E(u,287,h),t=0;t<30;t++)l[2*t+1]=5,l[2*t]=x(t,5);p=new v(u,s,257,286,15),m=new v(l,o,0,30,15),g=new v(new Array(0),a,0,19,7)}(),L=!0),t.l_desc=new y(t.dyn_ltree,p),t.d_desc=new y(t.dyn_dtree,m),t.bl_desc=new y(t.bl_tree,g),t.bi_buf=0,t.bi_valid=0,S(t)},e._tr_stored_block=O,e._tr_flush_block=function(t,e,i,r){var n,s,o=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),B(t,t.l_desc),B(t,t.d_desc),o=function(t){var e;for(R(t,t.dyn_ltree,t.l_desc.max_code),R(t,t.dyn_dtree,t.d_desc.max_code),B(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),n=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=n&&(n=s)):n=s=i+5,i+4<=n&&-1!==e?O(t,e,i,r):4===t.strategy||s===n?(M(t,2+(r?1:0),3),C(t,u,l)):(M(t,4+(r?1:0),3),function(t,e,i,r){var n;for(M(t,e-257,5),M(t,i-1,5),M(t,r-4,4),n=0;n<r;n++)M(t,t.bl_tree[2*h[n]+1],3);P(t,t.dyn_ltree,e-1),P(t,t.dyn_dtree,i-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),C(t,t.dyn_ltree,t.dyn_dtree)),S(t),r&&T(t)},e._tr_tally=function(t,e,i){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(d[i]+256+1)]++,t.dyn_dtree[2*w(e)]++),t.last_lit===t.lit_bufsize-1},e._tr_align=function(t){M(t,2,3),k(t,256,u),function(t){16===t.bi_valid?(_(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},2292:t=>{"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},2818:(t,e,i)=>{"use strict";var r=i(9809);e.certificate=i(1934);var n=r.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));e.RSAPrivateKey=n;var s=r.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));e.RSAPublicKey=s;var o=r.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}));e.PublicKey=o;var a=r.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),h=r.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(a),this.key("subjectPrivateKey").octstr())}));e.PrivateKey=h;var u=r.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));e.EncryptedPrivateKey=u;var l=r.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));e.DSAPrivateKey=l,e.DSAparam=r.define("DSAparam",(function(){this.int()}));var c=r.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(d),this.key("publicKey").optional().explicit(1).bitstr())}));e.ECPrivateKey=c;var d=r.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));e.signature=r.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},1934:(t,e,i)=>{"use strict";var r=i(9809),n=r.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),s=r.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),o=r.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),a=r.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())})),h=r.define("RelativeDistinguishedName",(function(){this.setof(s)})),u=r.define("RDNSequence",(function(){this.seqof(h)})),l=r.define("Name",(function(){this.choice({rdnSequence:this.use(u)})})),c=r.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))})),d=r.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),f=r.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(l),this.key("validity").use(c),this.key("subject").use(l),this.key("subjectPublicKeyInfo").use(a),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(d).optional())})),p=r.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(f),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())}));t.exports=p},7631:(t,e,i)=>{var r=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,n=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,s=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,o=i(3048),a=i(4696),h=i(9509).Buffer;t.exports=function(t,e){var i,u=t.toString(),l=u.match(r);if(l){var c="aes"+l[1],d=h.from(l[2],"hex"),f=h.from(l[3].replace(/[\r\n]/g,""),"base64"),p=o(e,d.slice(0,8),parseInt(l[1],10)).key,m=[],g=a.createDecipheriv(c,p,d);m.push(g.update(f)),m.push(g.final()),i=h.concat(m)}else{var b=u.match(s);i=h.from(b[2].replace(/[\r\n]/g,""),"base64")}return{tag:u.match(n)[1],data:i}}},980:(t,e,i)=>{var r=i(2818),n=i(2562),s=i(7631),o=i(4696),a=i(5632),h=i(9509).Buffer;function u(t){var e;"object"!=typeof t||h.isBuffer(t)||(e=t.passphrase,t=t.key),"string"==typeof t&&(t=h.from(t));var i,u,l=s(t,e),c=l.tag,d=l.data;switch(c){case"CERTIFICATE":u=r.certificate.decode(d,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(u||(u=r.PublicKey.decode(d,"der")),i=u.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return r.RSAPublicKey.decode(u.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return u.subjectPrivateKey=u.subjectPublicKey,{type:"ec",data:u};case"1.2.840.10040.4.1":return u.algorithm.params.pub_key=r.DSAparam.decode(u.subjectPublicKey.data,"der"),{type:"dsa",data:u.algorithm.params};default:throw new Error("unknown key id "+i)}case"ENCRYPTED PRIVATE KEY":d=function(t,e){var i=t.algorithm.decrypt.kde.kdeparams.salt,r=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),s=n[t.algorithm.decrypt.cipher.algo.join(".")],u=t.algorithm.decrypt.cipher.iv,l=t.subjectPrivateKey,c=parseInt(s.split("-")[1],10)/8,d=a.pbkdf2Sync(e,i,r,c,"sha1"),f=o.createDecipheriv(s,d,u),p=[];return p.push(f.update(l)),p.push(f.final()),h.concat(p)}(d=r.EncryptedPrivateKey.decode(d,"der"),e);case"PRIVATE KEY":switch(i=(u=r.PrivateKey.decode(d,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return r.RSAPrivateKey.decode(u.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:u.algorithm.curve,privateKey:r.ECPrivateKey.decode(u.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return u.algorithm.params.priv_key=r.DSAparam.decode(u.subjectPrivateKey,"der"),{type:"dsa",params:u.algorithm.params};default:throw new Error("unknown key id "+i)}case"RSA PUBLIC KEY":return r.RSAPublicKey.decode(d,"der");case"RSA PRIVATE KEY":return r.RSAPrivateKey.decode(d,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:r.DSAPrivateKey.decode(d,"der")};case"EC PRIVATE KEY":return{curve:(d=r.ECPrivateKey.decode(d,"der")).parameters.value,privateKey:d.privateKey};default:throw new Error("unknown key type "+c)}}t.exports=u,u.signature=r.signature},5203:(t,e,i)=>{var r=i(8764).Buffer;const n=i(5799),s=i(7619),o=i(1982),a=i(6993),h=i(9566),u=i(6470),l=i(4159),c=i(4375);function d(t){if("string"==typeof t&&/^(stream-)?magnet:/.test(t)){const e=h(t);if(!e.infoHash)throw new Error("Invalid torrent identifier");return e}if("string"==typeof t&&(/^[a-f0-9]{40}$/i.test(t)||/^[a-z2-7]{32}$/i.test(t)))return h(`magnet:?xt=urn:btih:${t}`);if(r.isBuffer(t)&&20===t.length)return h(`magnet:?xt=urn:btih:${t.toString("hex")}`);if(r.isBuffer(t))return function(t){r.isBuffer(t)&&(t=n.decode(t)),p(t.info,"info"),p(t.info["name.utf-8"]||t.info.name,"info.name"),p(t.info["piece length"],"info['piece length']"),p(t.info.pieces,"info.pieces"),t.info.files?t.info.files.forEach((t=>{p("number"==typeof t.length,"info.files[0].length"),p(t["path.utf-8"]||t.path,"info.files[0].path")})):p("number"==typeof t.info.length,"info.length");const e={info:t.info,infoBuffer:n.encode(t.info),name:(t.info["name.utf-8"]||t.info.name).toString(),announce:[]};e.infoHash=l.sync(e.infoBuffer),e.infoHashBuffer=r.from(e.infoHash,"hex"),void 0!==t.info.private&&(e.private=!!t.info.private),t["creation date"]&&(e.created=new Date(1e3*t["creation date"])),t["created by"]&&(e.createdBy=t["created by"].toString()),r.isBuffer(t.comment)&&(e.comment=t.comment.toString()),Array.isArray(t["announce-list"])&&t["announce-list"].length>0?t["announce-list"].forEach((t=>{t.forEach((t=>{e.announce.push(t.toString())}))})):t.announce&&e.announce.push(t.announce.toString()),r.isBuffer(t["url-list"])&&(t["url-list"]=t["url-list"].length>0?[t["url-list"]]:[]),e.urlList=(t["url-list"]||[]).map((t=>t.toString())),e.announce=Array.from(new Set(e.announce)),e.urlList=Array.from(new Set(e.urlList));const i=t.info.files||[t.info];e.files=i.map(((t,r)=>{const n=[].concat(e.name,t["path.utf-8"]||t.path||[]).map((t=>t.toString()));return{path:u.join.apply(null,[u.sep].concat(n)).slice(1),name:n[n.length-1],length:t.length,offset:i.slice(0,r).reduce(f,0)}})),e.length=i.reduce(f,0);const s=e.files[e.files.length-1];return e.pieceLength=t.info["piece length"],e.lastPieceLength=(s.offset+s.length)%e.pieceLength||e.pieceLength,e.pieces=function(t){const e=[];for(let i=0;i<t.length;i+=20)e.push(t.slice(i,i+20).toString("hex"));return e}(t.info.pieces),e}(t);if(t&&t.infoHash)return t.infoHash=t.infoHash.toLowerCase(),t.announce||(t.announce=[]),"string"==typeof t.announce&&(t.announce=[t.announce]),t.urlList||(t.urlList=[]),t;throw new Error("Invalid torrent identifier")}function f(t,e){return t+e.length}function p(t,e){if(!t)throw new Error(`Torrent is missing required field: ${e}`)}t.exports=d,t.exports.remote=function t(e,i,r){if("function"==typeof i)return t(e,{},i);if("function"!=typeof r)throw new Error("second argument must be a Function");let n;try{n=d(e)}catch(t){}function h(t){try{n=d(t)}catch(t){return r(t)}n&&n.infoHash?r(null,n):r(new Error("Invalid torrent identifier"))}n&&n.infoHash?c((()=>{r(null,n)})):"undefined"!=typeof Blob&&e instanceof Blob?s(e,((t,e)=>{if(t)return r(new Error(`Error converting Blob: ${t.message}`));h(e)})):"function"==typeof a&&/^https?:/.test(e)?(i=Object.assign({url:e,timeout:3e4,headers:{"user-agent":"WebTorrent (https://webtorrent.io)"}},i),a.concat(i,((t,e,i)=>{if(t)return r(new Error(`Error downloading torrent: ${t.message}`));h(i)}))):"function"==typeof o.readFile&&"string"==typeof e?o.readFile(e,((t,e)=>{if(t)return r(new Error("Invalid torrent identifier"));h(e)})):c((()=>{r(new Error("Invalid torrent identifier"))}))},t.exports.toMagnetURI=h.encode,t.exports.toTorrentFile=function(t){const e={info:t.info};return e["announce-list"]=(t.announce||[]).map((t=>(e.announce||(e.announce=t),[t=r.from(t,"utf8")]))),e["url-list"]=t.urlList||[],void 0!==t.private&&(e.private=Number(t.private)),t.created&&(e["creation date"]=t.created.getTime()/1e3|0),t.createdBy&&(e["created by"]=t.createdBy),t.comment&&(e.comment=t.comment),n.encode(e)},r.alloc(0)},6470:(t,e,i)=>{"use strict";var r=i(9590);function n(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function s(t,e){for(var i,r="",n=0,s=-1,o=0,a=0;a<=t.length;++a){if(a<t.length)i=t.charCodeAt(a);else{if(47===i)break;i=47}if(47===i){if(s===a-1||1===o);else if(s!==a-1&&2===o){if(r.length<2||2!==n||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){var h=r.lastIndexOf("/");if(h!==r.length-1){-1===h?(r="",n=0):n=(r=r.slice(0,h)).length-1-r.lastIndexOf("/"),s=a,o=0;continue}}else if(2===r.length||1===r.length){r="",n=0,s=a,o=0;continue}e&&(r.length>0?r+="/..":r="..",n=2)}else r.length>0?r+="/"+t.slice(s+1,a):r=t.slice(s+1,a),n=a-s-1;s=a,o=0}else 46===i&&-1!==o?++o:o=-1}return r}var o={resolve:function(){for(var t,e="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a;o>=0?a=arguments[o]:(void 0===t&&(t=r.cwd()),a=t),n(a),0!==a.length&&(e=a+"/"+e,i=47===a.charCodeAt(0))}return e=s(e,!i),i?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(n(t),0===t.length)return".";var e=47===t.charCodeAt(0),i=47===t.charCodeAt(t.length-1);return 0!==(t=s(t,!e)).length||e||(t="."),t.length>0&&i&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return n(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var i=arguments[e];n(i),i.length>0&&(void 0===t?t=i:t+="/"+i)}return void 0===t?".":o.normalize(t)},relative:function(t,e){if(n(t),n(e),t===e)return"";if((t=o.resolve(t))===(e=o.resolve(e)))return"";for(var i=1;i<t.length&&47===t.charCodeAt(i);++i);for(var r=t.length,s=r-i,a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var h=e.length-a,u=s<h?s:h,l=-1,c=0;c<=u;++c){if(c===u){if(h>u){if(47===e.charCodeAt(a+c))return e.slice(a+c+1);if(0===c)return e.slice(a+c)}else s>u&&(47===t.charCodeAt(i+c)?l=c:0===c&&(l=0));break}var d=t.charCodeAt(i+c);if(d!==e.charCodeAt(a+c))break;47===d&&(l=c)}var f="";for(c=i+l+1;c<=r;++c)c!==r&&47!==t.charCodeAt(c)||(0===f.length?f+="..":f+="/..");return f.length>0?f+e.slice(a+l):(a+=l,47===e.charCodeAt(a)&&++a,e.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(n(t),0===t.length)return".";for(var e=t.charCodeAt(0),i=47===e,r=-1,s=!0,o=t.length-1;o>=1;--o)if(47===(e=t.charCodeAt(o))){if(!s){r=o;break}}else s=!1;return-1===r?i?"/":".":i&&1===r?"//":t.slice(0,r)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');n(t);var i,r=0,s=-1,o=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,h=-1;for(i=t.length-1;i>=0;--i){var u=t.charCodeAt(i);if(47===u){if(!o){r=i+1;break}}else-1===h&&(o=!1,h=i+1),a>=0&&(u===e.charCodeAt(a)?-1==--a&&(s=i):(a=-1,s=h))}return r===s?s=h:-1===s&&(s=t.length),t.slice(r,s)}for(i=t.length-1;i>=0;--i)if(47===t.charCodeAt(i)){if(!o){r=i+1;break}}else-1===s&&(o=!1,s=i+1);return-1===s?"":t.slice(r,s)},extname:function(t){n(t);for(var e=-1,i=0,r=-1,s=!0,o=0,a=t.length-1;a>=0;--a){var h=t.charCodeAt(a);if(47!==h)-1===r&&(s=!1,r=a+1),46===h?-1===e?e=a:1!==o&&(o=1):-1!==e&&(o=-1);else if(!s){i=a+1;break}}return-1===e||-1===r||0===o||1===o&&e===r-1&&e===i+1?"":t.slice(e,r)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var i=e.dir||e.root,r=e.base||(e.name||"")+(e.ext||"");return i?i===e.root?i+r:i+"/"+r:r}(0,t)},parse:function(t){n(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var i,r=t.charCodeAt(0),s=47===r;s?(e.root="/",i=1):i=0;for(var o=-1,a=0,h=-1,u=!0,l=t.length-1,c=0;l>=i;--l)if(47!==(r=t.charCodeAt(l)))-1===h&&(u=!1,h=l+1),46===r?-1===o?o=l:1!==c&&(c=1):-1!==o&&(c=-1);else if(!u){a=l+1;break}return-1===o||-1===h||0===c||1===c&&o===h-1&&o===a+1?-1!==h&&(e.base=e.name=0===a&&s?t.slice(1,h):t.slice(a,h)):(0===a&&s?(e.name=t.slice(1,o),e.base=t.slice(1,h)):(e.name=t.slice(a,o),e.base=t.slice(a,h)),e.ext=t.slice(o,h)),a>0?e.dir=t.slice(0,a-1):s&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,t.exports=o},5632:(t,e,i)=>{e.pbkdf2=i(8638),e.pbkdf2Sync=i(1257)},8638:(t,e,i)=>{var r,n,s=i(9509).Buffer,o=i(7357),a=i(2368),h=i(1257),u=i(7777),l=i.g.crypto&&i.g.crypto.subtle,c={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},d=[];function f(){return n||(n=i.g.process&&i.g.process.nextTick?i.g.process.nextTick:i.g.queueMicrotask?i.g.queueMicrotask:i.g.setImmediate?i.g.setImmediate:i.g.setTimeout)}function p(t,e,i,r,n){return l.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then((function(t){return l.deriveBits({name:"PBKDF2",salt:e,iterations:i,hash:{name:n}},t,r<<3)})).then((function(t){return s.from(t)}))}t.exports=function(t,e,n,m,g,b){"function"==typeof g&&(b=g,g=void 0);var v=c[(g=g||"sha1").toLowerCase()];if(v&&"function"==typeof i.g.Promise){if(o(n,m),t=u(t,a,"Password"),e=u(e,a,"Salt"),"function"!=typeof b)throw new Error("No callback provided to pbkdf2");!function(t,e){t.then((function(t){f()((function(){e(null,t)}))}),(function(t){f()((function(){e(t)}))}))}(function(t){if(i.g.process&&!i.g.process.browser)return Promise.resolve(!1);if(!l||!l.importKey||!l.deriveBits)return Promise.resolve(!1);if(void 0!==d[t])return d[t];var e=p(r=r||s.alloc(8),r,10,128,t).then((function(){return!0})).catch((function(){return!1}));return d[t]=e,e}(v).then((function(i){return i?p(t,e,n,m,v):h(t,e,n,m,g)})),b)}else f()((function(){var i;try{i=h(t,e,n,m,g)}catch(t){return b(t)}b(null,i)}))}},2368:(t,e,i)=>{var r,n=i(9590);r=i.g.process&&i.g.process.browser?"utf-8":i.g.process&&i.g.process.version?parseInt(n.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary":"utf-8",t.exports=r},7357:t=>{var e=Math.pow(2,30)-1;t.exports=function(t,i){if("number"!=typeof t)throw new TypeError("Iterations not a number");if(t<0)throw new TypeError("Bad iterations");if("number"!=typeof i)throw new TypeError("Key length not a number");if(i<0||i>e||i!=i)throw new TypeError("Bad key length")}},1257:(t,e,i)=>{var r=i(8028),n=i(9785),s=i(9072),o=i(9509).Buffer,a=i(7357),h=i(2368),u=i(7777),l=o.alloc(128),c={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function d(t,e,i){var a=function(t){return"rmd160"===t||"ripemd160"===t?function(t){return(new n).update(t).digest()}:"md5"===t?r:function(e){return s(t).update(e).digest()}}(t),h="sha512"===t||"sha384"===t?128:64;e.length>h?e=a(e):e.length<h&&(e=o.concat([e,l],h));for(var u=o.allocUnsafe(h+c[t]),d=o.allocUnsafe(h+c[t]),f=0;f<h;f++)u[f]=54^e[f],d[f]=92^e[f];var p=o.allocUnsafe(h+i+4);u.copy(p,0,0,h),this.ipad1=p,this.ipad2=u,this.opad=d,this.alg=t,this.blocksize=h,this.hash=a,this.size=c[t]}d.prototype.run=function(t,e){return t.copy(e,this.blocksize),this.hash(e).copy(this.opad,this.blocksize),this.hash(this.opad)},t.exports=function(t,e,i,r,n){a(i,r);var s=new d(n=n||"sha1",t=u(t,h,"Password"),(e=u(e,h,"Salt")).length),l=o.allocUnsafe(r),f=o.allocUnsafe(e.length+4);e.copy(f,0,0,e.length);for(var p=0,m=c[n],g=Math.ceil(r/m),b=1;b<=g;b++){f.writeUInt32BE(b,e.length);for(var v=s.run(f,s.ipad1),y=v,w=1;w<i;w++){y=s.run(y,s.ipad2);for(var _=0;_<m;_++)v[_]^=y[_]}v.copy(l,p),p+=m}return l}},7777:(t,e,i)=>{var r=i(9509).Buffer;t.exports=function(t,e,i){if(r.isBuffer(t))return t;if("string"==typeof t)return r.from(t,e);if(ArrayBuffer.isView(t))return r.from(t.buffer);throw new TypeError(i+" must be a string, a Buffer, a typed array or a DataView")}},3786:t=>{t.exports=function(t){return Math.max(16384,1<<Math.log2(t<1024?1:t/1024)+.5|0)}},9590:t=>{const e=t.exports={};function i(){}e.title="browser",e.browser=!0,e.env={},e.argv=[],e.version="",e.versions={},e.on=i,e.addListener=i,e.once=i,e.off=i,e.removeListener=i,e.removeAllListeners=i,e.emit=i,e.prependListener=i,e.prependOnceListener=i,e.nextTick=(t,...e)=>window.queueMicrotask((()=>t(...e))),e.listeners=t=>[],e.cwd=()=>"/",e.umask=()=>0,e.binding=t=>{throw new Error("process.binding is not supported")},e.chdir=t=>{throw new Error("process.chdir is not supported")}},7900:(t,e,i)=>{e.publicEncrypt=i(6559),e.privateDecrypt=i(6138),e.privateEncrypt=function(t,i){return e.publicEncrypt(t,i,!0)},e.publicDecrypt=function(t,i){return e.privateDecrypt(t,i,!0)}},7139:(t,e,i)=>{var r=i(3482),n=i(9509).Buffer;function s(t){var e=n.allocUnsafe(4);return e.writeUInt32BE(t,0),e}t.exports=function(t,e){for(var i,o=n.alloc(0),a=0;o.length<e;)i=s(a++),o=n.concat([o,r("sha1").update(t).update(i).digest()]);return o.slice(0,e)}},2144:function(t,e,i){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function s(t,e,i){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var o;"object"==typeof t?t.exports=s:e.BN=s,s.BN=s,s.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:i(7108).Buffer}catch(t){}function a(t,e){var i=t.charCodeAt(e);return i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function h(t,e,i){var r=a(t,i);return i-1>=e&&(r|=a(t,i-1)<<4),r}function u(t,e,i,r){for(var n=0,s=Math.min(t.length,i),o=e;o<s;o++){var a=t.charCodeAt(o)-48;n*=r,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}s.isBN=function(t){return t instanceof s||null!==t&&"object"==typeof t&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===e?this._parseHex(t,n,i):(this._parseBase(t,e,n),"le"===i&&this._initArray(this.toArray(),e,i)))},s.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},s.prototype._initArray=function(t,e,i){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var s,o,a=0;if("be"===i)for(n=t.length-1,s=0;n>=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===i)for(n=0,s=0;n<t.length;n+=3)o=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(t,e,i){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,s=0,o=0;if("be"===i)for(r=t.length-1;r>=e;r-=2)n=h(t,e,r)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(r=(t.length-e)%2==0?e+1:e;r<t.length;r+=2)n=h(t,e,r)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this.strip()},s.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var s=t.length-i,o=s%r,a=Math.min(s,s-o)+i,h=0,l=i;l<a;l+=r)h=u(t,l,l+r,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==o){var c=1;for(h=u(t,l,t.length,e),l=0;l<o;l++)c*=e;this.imuln(c),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this.strip()},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],s=0|e.words[0],o=n*s,a=67108863&o,h=o/67108864|0;i.words[0]=a;for(var u=1;u<r;u++){for(var l=h>>>26,c=67108863&h,d=Math.min(u,e.length-1),f=Math.max(0,u-t.length+1);f<=d;f++){var p=u-f|0;l+=(o=(n=0|t.words[p])*(s=0|e.words[f])+c)/67108864|0,c=67108863&o}i.words[u]=0|c,h=0|l}return 0!==h?i.words[u]=0|h:i.length--,i.strip()}s.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var n=0,s=0,o=0;o<this.length;o++){var a=this.words[o],h=(16777215&(a<<n|s)).toString(16);i=0!=(s=a>>>24-n&16777215)||o!==this.length-1?l[6-h.length]+h+i:h+i,(n+=2)>=26&&(n-=26,o--)}for(0!==s&&(i=s.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var u=c[t],f=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(t);i=(p=p.idivn(f)).isZero()?m+i:l[u-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return r(void 0!==o),this.toArrayLike(o,t,e)},s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,i){var n=this.byteLength(),s=i||Math.max(1,n);r(n<=s,"byte array longer than desired length"),r(s>0,"Requested array length <= 0"),this.strip();var o,a,h="le"===e,u=new t(s),l=this.clone();if(h){for(a=0;!l.isZero();a++)o=l.andln(255),l.iushrn(8),u[a]=o;for(;a<s;a++)u[a]=0}else{for(a=0;a<s-n;a++)u[a]=0;for(a=0;!l.isZero();a++)o=l.andln(255),l.iushrn(8),u[s-a-1]=o}return u},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var i=this._zeroBits(this.words[e]);if(t+=i,26!==i)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},s.prototype.ior=function(t){return r(0==(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=e.length,this.strip()},s.prototype.iand=function(t){return r(0==(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;r<i.length;r++)this.words[r]=e.words[r]^i.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},s.prototype.ixor=function(t){return r(0==(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},s.prototype.iadd=function(t){var e,i,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0,s=0;s<r.length;s++)e=(0|i.words[s])+(0|r.words[s])+n,this.words[s]=67108863&e,n=e>>>26;for(;0!==n&&s<i.length;s++)e=(0|i.words[s])+n,this.words[s]=67108863&e,n=e>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var s=0,o=0;o<r.length;o++)s=(e=(0|i.words[o])-(0|r.words[o])+s)>>26,this.words[o]=67108863&e;for(;0!==s&&o<i.length;o++)s=(e=(0|i.words[o])+s)>>26,this.words[o]=67108863&e;if(0===s&&o<i.length&&i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this.length=Math.max(this.length,o),i!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,i){var r,n,s,o=t.words,a=e.words,h=i.words,u=0,l=0|o[0],c=8191&l,d=l>>>13,f=0|o[1],p=8191&f,m=f>>>13,g=0|o[2],b=8191&g,v=g>>>13,y=0|o[3],w=8191&y,_=y>>>13,M=0|o[4],k=8191&M,x=M>>>13,E=0|o[5],S=8191&E,T=E>>>13,A=0|o[6],I=8191&A,C=A>>>13,B=0|o[7],R=8191&B,P=B>>>13,L=0|o[8],O=8191&L,D=L>>>13,N=0|o[9],j=8191&N,U=N>>>13,F=0|a[0],q=8191&F,z=F>>>13,H=0|a[1],W=8191&H,$=H>>>13,Z=0|a[2],V=8191&Z,K=Z>>>13,G=0|a[3],J=8191&G,Y=G>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],it=8191&et,rt=et>>>13,nt=0|a[6],st=8191&nt,ot=nt>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,lt=0|a[8],ct=8191<,dt=lt>>>13,ft=0|a[9],pt=8191&ft,mt=ft>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(u+(r=Math.imul(c,q))|0)+((8191&(n=(n=Math.imul(c,z))+Math.imul(d,q)|0))<<13)|0;u=((s=Math.imul(d,z))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(p,q),n=(n=Math.imul(p,z))+Math.imul(m,q)|0,s=Math.imul(m,z);var bt=(u+(r=r+Math.imul(c,W)|0)|0)+((8191&(n=(n=n+Math.imul(c,$)|0)+Math.imul(d,W)|0))<<13)|0;u=((s=s+Math.imul(d,$)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,q),n=(n=Math.imul(b,z))+Math.imul(v,q)|0,s=Math.imul(v,z),r=r+Math.imul(p,W)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(m,W)|0,s=s+Math.imul(m,$)|0;var vt=(u+(r=r+Math.imul(c,V)|0)|0)+((8191&(n=(n=n+Math.imul(c,K)|0)+Math.imul(d,V)|0))<<13)|0;u=((s=s+Math.imul(d,K)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(w,q),n=(n=Math.imul(w,z))+Math.imul(_,q)|0,s=Math.imul(_,z),r=r+Math.imul(b,W)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(v,W)|0,s=s+Math.imul(v,$)|0,r=r+Math.imul(p,V)|0,n=(n=n+Math.imul(p,K)|0)+Math.imul(m,V)|0,s=s+Math.imul(m,K)|0;var yt=(u+(r=r+Math.imul(c,J)|0)|0)+((8191&(n=(n=n+Math.imul(c,Y)|0)+Math.imul(d,J)|0))<<13)|0;u=((s=s+Math.imul(d,Y)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(k,q),n=(n=Math.imul(k,z))+Math.imul(x,q)|0,s=Math.imul(x,z),r=r+Math.imul(w,W)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(_,W)|0,s=s+Math.imul(_,$)|0,r=r+Math.imul(b,V)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(v,V)|0,s=s+Math.imul(v,K)|0,r=r+Math.imul(p,J)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(m,J)|0,s=s+Math.imul(m,Y)|0;var wt=(u+(r=r+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;u=((s=s+Math.imul(d,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(S,q),n=(n=Math.imul(S,z))+Math.imul(T,q)|0,s=Math.imul(T,z),r=r+Math.imul(k,W)|0,n=(n=n+Math.imul(k,$)|0)+Math.imul(x,W)|0,s=s+Math.imul(x,$)|0,r=r+Math.imul(w,V)|0,n=(n=n+Math.imul(w,K)|0)+Math.imul(_,V)|0,s=s+Math.imul(_,K)|0,r=r+Math.imul(b,J)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(v,J)|0,s=s+Math.imul(v,Y)|0,r=r+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,tt)|0;var _t=(u+(r=r+Math.imul(c,it)|0)|0)+((8191&(n=(n=n+Math.imul(c,rt)|0)+Math.imul(d,it)|0))<<13)|0;u=((s=s+Math.imul(d,rt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(I,q),n=(n=Math.imul(I,z))+Math.imul(C,q)|0,s=Math.imul(C,z),r=r+Math.imul(S,W)|0,n=(n=n+Math.imul(S,$)|0)+Math.imul(T,W)|0,s=s+Math.imul(T,$)|0,r=r+Math.imul(k,V)|0,n=(n=n+Math.imul(k,K)|0)+Math.imul(x,V)|0,s=s+Math.imul(x,K)|0,r=r+Math.imul(w,J)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,J)|0,s=s+Math.imul(_,Y)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,Q)|0,s=s+Math.imul(v,tt)|0,r=r+Math.imul(p,it)|0,n=(n=n+Math.imul(p,rt)|0)+Math.imul(m,it)|0,s=s+Math.imul(m,rt)|0;var Mt=(u+(r=r+Math.imul(c,st)|0)|0)+((8191&(n=(n=n+Math.imul(c,ot)|0)+Math.imul(d,st)|0))<<13)|0;u=((s=s+Math.imul(d,ot)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(R,q),n=(n=Math.imul(R,z))+Math.imul(P,q)|0,s=Math.imul(P,z),r=r+Math.imul(I,W)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(C,W)|0,s=s+Math.imul(C,$)|0,r=r+Math.imul(S,V)|0,n=(n=n+Math.imul(S,K)|0)+Math.imul(T,V)|0,s=s+Math.imul(T,K)|0,r=r+Math.imul(k,J)|0,n=(n=n+Math.imul(k,Y)|0)+Math.imul(x,J)|0,s=s+Math.imul(x,Y)|0,r=r+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,tt)|0,r=r+Math.imul(b,it)|0,n=(n=n+Math.imul(b,rt)|0)+Math.imul(v,it)|0,s=s+Math.imul(v,rt)|0,r=r+Math.imul(p,st)|0,n=(n=n+Math.imul(p,ot)|0)+Math.imul(m,st)|0,s=s+Math.imul(m,ot)|0;var kt=(u+(r=r+Math.imul(c,ht)|0)|0)+((8191&(n=(n=n+Math.imul(c,ut)|0)+Math.imul(d,ht)|0))<<13)|0;u=((s=s+Math.imul(d,ut)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(O,q),n=(n=Math.imul(O,z))+Math.imul(D,q)|0,s=Math.imul(D,z),r=r+Math.imul(R,W)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(P,W)|0,s=s+Math.imul(P,$)|0,r=r+Math.imul(I,V)|0,n=(n=n+Math.imul(I,K)|0)+Math.imul(C,V)|0,s=s+Math.imul(C,K)|0,r=r+Math.imul(S,J)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(T,J)|0,s=s+Math.imul(T,Y)|0,r=r+Math.imul(k,Q)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(x,Q)|0,s=s+Math.imul(x,tt)|0,r=r+Math.imul(w,it)|0,n=(n=n+Math.imul(w,rt)|0)+Math.imul(_,it)|0,s=s+Math.imul(_,rt)|0,r=r+Math.imul(b,st)|0,n=(n=n+Math.imul(b,ot)|0)+Math.imul(v,st)|0,s=s+Math.imul(v,ot)|0,r=r+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,s=s+Math.imul(m,ut)|0;var xt=(u+(r=r+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;u=((s=s+Math.imul(d,dt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(j,q),n=(n=Math.imul(j,z))+Math.imul(U,q)|0,s=Math.imul(U,z),r=r+Math.imul(O,W)|0,n=(n=n+Math.imul(O,$)|0)+Math.imul(D,W)|0,s=s+Math.imul(D,$)|0,r=r+Math.imul(R,V)|0,n=(n=n+Math.imul(R,K)|0)+Math.imul(P,V)|0,s=s+Math.imul(P,K)|0,r=r+Math.imul(I,J)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(C,J)|0,s=s+Math.imul(C,Y)|0,r=r+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(T,Q)|0,s=s+Math.imul(T,tt)|0,r=r+Math.imul(k,it)|0,n=(n=n+Math.imul(k,rt)|0)+Math.imul(x,it)|0,s=s+Math.imul(x,rt)|0,r=r+Math.imul(w,st)|0,n=(n=n+Math.imul(w,ot)|0)+Math.imul(_,st)|0,s=s+Math.imul(_,ot)|0,r=r+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(v,ht)|0,s=s+Math.imul(v,ut)|0,r=r+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,dt)|0)+Math.imul(m,ct)|0,s=s+Math.imul(m,dt)|0;var Et=(u+(r=r+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,mt)|0)+Math.imul(d,pt)|0))<<13)|0;u=((s=s+Math.imul(d,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(j,W),n=(n=Math.imul(j,$))+Math.imul(U,W)|0,s=Math.imul(U,$),r=r+Math.imul(O,V)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(D,V)|0,s=s+Math.imul(D,K)|0,r=r+Math.imul(R,J)|0,n=(n=n+Math.imul(R,Y)|0)+Math.imul(P,J)|0,s=s+Math.imul(P,Y)|0,r=r+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,s=s+Math.imul(C,tt)|0,r=r+Math.imul(S,it)|0,n=(n=n+Math.imul(S,rt)|0)+Math.imul(T,it)|0,s=s+Math.imul(T,rt)|0,r=r+Math.imul(k,st)|0,n=(n=n+Math.imul(k,ot)|0)+Math.imul(x,st)|0,s=s+Math.imul(x,ot)|0,r=r+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(_,ht)|0,s=s+Math.imul(_,ut)|0,r=r+Math.imul(b,ct)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(v,ct)|0,s=s+Math.imul(v,dt)|0;var St=(u+(r=r+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((s=s+Math.imul(m,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(j,V),n=(n=Math.imul(j,K))+Math.imul(U,V)|0,s=Math.imul(U,K),r=r+Math.imul(O,J)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(D,J)|0,s=s+Math.imul(D,Y)|0,r=r+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,tt)|0,r=r+Math.imul(I,it)|0,n=(n=n+Math.imul(I,rt)|0)+Math.imul(C,it)|0,s=s+Math.imul(C,rt)|0,r=r+Math.imul(S,st)|0,n=(n=n+Math.imul(S,ot)|0)+Math.imul(T,st)|0,s=s+Math.imul(T,ot)|0,r=r+Math.imul(k,ht)|0,n=(n=n+Math.imul(k,ut)|0)+Math.imul(x,ht)|0,s=s+Math.imul(x,ut)|0,r=r+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,dt)|0)+Math.imul(_,ct)|0,s=s+Math.imul(_,dt)|0;var Tt=(u+(r=r+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,pt)|0))<<13)|0;u=((s=s+Math.imul(v,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(j,J),n=(n=Math.imul(j,Y))+Math.imul(U,J)|0,s=Math.imul(U,Y),r=r+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(D,Q)|0,s=s+Math.imul(D,tt)|0,r=r+Math.imul(R,it)|0,n=(n=n+Math.imul(R,rt)|0)+Math.imul(P,it)|0,s=s+Math.imul(P,rt)|0,r=r+Math.imul(I,st)|0,n=(n=n+Math.imul(I,ot)|0)+Math.imul(C,st)|0,s=s+Math.imul(C,ot)|0,r=r+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(T,ht)|0,s=s+Math.imul(T,ut)|0,r=r+Math.imul(k,ct)|0,n=(n=n+Math.imul(k,dt)|0)+Math.imul(x,ct)|0,s=s+Math.imul(x,dt)|0;var At=(u+(r=r+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((s=s+Math.imul(_,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(j,Q),n=(n=Math.imul(j,tt))+Math.imul(U,Q)|0,s=Math.imul(U,tt),r=r+Math.imul(O,it)|0,n=(n=n+Math.imul(O,rt)|0)+Math.imul(D,it)|0,s=s+Math.imul(D,rt)|0,r=r+Math.imul(R,st)|0,n=(n=n+Math.imul(R,ot)|0)+Math.imul(P,st)|0,s=s+Math.imul(P,ot)|0,r=r+Math.imul(I,ht)|0,n=(n=n+Math.imul(I,ut)|0)+Math.imul(C,ht)|0,s=s+Math.imul(C,ut)|0,r=r+Math.imul(S,ct)|0,n=(n=n+Math.imul(S,dt)|0)+Math.imul(T,ct)|0,s=s+Math.imul(T,dt)|0;var It=(u+(r=r+Math.imul(k,pt)|0)|0)+((8191&(n=(n=n+Math.imul(k,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((s=s+Math.imul(x,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(j,it),n=(n=Math.imul(j,rt))+Math.imul(U,it)|0,s=Math.imul(U,rt),r=r+Math.imul(O,st)|0,n=(n=n+Math.imul(O,ot)|0)+Math.imul(D,st)|0,s=s+Math.imul(D,ot)|0,r=r+Math.imul(R,ht)|0,n=(n=n+Math.imul(R,ut)|0)+Math.imul(P,ht)|0,s=s+Math.imul(P,ut)|0,r=r+Math.imul(I,ct)|0,n=(n=n+Math.imul(I,dt)|0)+Math.imul(C,ct)|0,s=s+Math.imul(C,dt)|0;var Ct=(u+(r=r+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((s=s+Math.imul(T,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(j,st),n=(n=Math.imul(j,ot))+Math.imul(U,st)|0,s=Math.imul(U,ot),r=r+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(D,ht)|0,s=s+Math.imul(D,ut)|0,r=r+Math.imul(R,ct)|0,n=(n=n+Math.imul(R,dt)|0)+Math.imul(P,ct)|0,s=s+Math.imul(P,dt)|0;var Bt=(u+(r=r+Math.imul(I,pt)|0)|0)+((8191&(n=(n=n+Math.imul(I,mt)|0)+Math.imul(C,pt)|0))<<13)|0;u=((s=s+Math.imul(C,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,r=Math.imul(j,ht),n=(n=Math.imul(j,ut))+Math.imul(U,ht)|0,s=Math.imul(U,ut),r=r+Math.imul(O,ct)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(D,ct)|0,s=s+Math.imul(D,dt)|0;var Rt=(u+(r=r+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((s=s+Math.imul(P,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(j,ct),n=(n=Math.imul(j,dt))+Math.imul(U,ct)|0,s=Math.imul(U,dt);var Pt=(u+(r=r+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(D,pt)|0))<<13)|0;u=((s=s+Math.imul(D,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Lt=(u+(r=Math.imul(j,pt))|0)+((8191&(n=(n=Math.imul(j,mt))+Math.imul(U,pt)|0))<<13)|0;return u=((s=Math.imul(U,mt))+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,h[0]=gt,h[1]=bt,h[2]=vt,h[3]=yt,h[4]=wt,h[5]=_t,h[6]=Mt,h[7]=kt,h[8]=xt,h[9]=Et,h[10]=St,h[11]=Tt,h[12]=At,h[13]=It,h[14]=Ct,h[15]=Bt,h[16]=Rt,h[17]=Pt,h[18]=Lt,0!==u&&(h[19]=u,i.length++),i};function m(t,e,i){return(new g).mulp(t,e,i)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=f),s.prototype.mulTo=function(t,e){var i,r=this.length+t.length;return i=10===this.length&&10===t.length?p(this,t,e):r<63?f(this,t,e):r<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,s=0;s<i.length-1;s++){var o=n;n=0;for(var a=67108863&r,h=Math.min(s,e.length-1),u=Math.max(0,s-t.length+1);u<=h;u++){var l=s-u,c=(0|t.words[l])*(0|e.words[u]),d=67108863&c;a=67108863&(d=d+a|0),n+=(o=(o=o+(c/67108864|0)|0)+(d>>>26)|0)>>>26,o&=67108863}i.words[s]=a,r=o,o=n}return 0!==r?i.words[s]=r:i.length--,i.strip()}(this,t,e):m(this,t,e),i},g.prototype.makeRBT=function(t){for(var e=new Array(t),i=s.prototype._countBits(t)-1,r=0;r<t;r++)e[r]=this.revBin(r,i,t);return e},g.prototype.revBin=function(t,e,i){if(0===t||t===i-1)return t;for(var r=0,n=0;n<e;n++)r|=(1&t)<<e-n-1,t>>=1;return r},g.prototype.permute=function(t,e,i,r,n,s){for(var o=0;o<s;o++)r[o]=e[t[o]],n[o]=i[t[o]]},g.prototype.transform=function(t,e,i,r,n,s){this.permute(s,t,e,i,r,n);for(var o=1;o<n;o<<=1)for(var a=o<<1,h=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),l=0;l<n;l+=a)for(var c=h,d=u,f=0;f<o;f++){var p=i[l+f],m=r[l+f],g=i[l+f+o],b=r[l+f+o],v=c*g-d*b;b=c*b+d*g,g=v,i[l+f]=p+g,r[l+f]=m+b,i[l+f+o]=p-g,r[l+f+o]=m-b,f!==a&&(v=h*c-u*d,d=h*d+u*c,c=v)}},g.prototype.guessLen13b=function(t,e){var i=1|Math.max(e,t),r=1&i,n=0;for(i=i/2|0;i;i>>>=1)n++;return 1<<n+1+r},g.prototype.conjugate=function(t,e,i){if(!(i<=1))for(var r=0;r<i/2;r++){var n=t[r];t[r]=t[i-r-1],t[i-r-1]=n,n=e[r],e[r]=-e[i-r-1],e[i-r-1]=-n}},g.prototype.normalize13b=function(t,e){for(var i=0,r=0;r<e/2;r++){var n=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+i;t[r]=67108863&n,i=n<67108864?0:n/67108864|0}return t},g.prototype.convert13b=function(t,e,i,n){for(var s=0,o=0;o<e;o++)s+=0|t[o],i[2*o]=8191&s,s>>>=13,i[2*o+1]=8191&s,s>>>=13;for(o=2*e;o<n;++o)i[o]=0;r(0===s),r(0==(-8192&s))},g.prototype.stub=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=0;return e},g.prototype.mulp=function(t,e,i){var r=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(r),s=this.stub(r),o=new Array(r),a=new Array(r),h=new Array(r),u=new Array(r),l=new Array(r),c=new Array(r),d=i.words;d.length=r,this.convert13b(t.words,t.length,o,r),this.convert13b(e.words,e.length,u,r),this.transform(o,s,a,h,r,n),this.transform(u,s,l,c,r,n);for(var f=0;f<r;f++){var p=a[f]*l[f]-h[f]*c[f];h[f]=a[f]*c[f]+h[f]*l[f],a[f]=p}return this.conjugate(a,h,r),this.transform(a,h,d,s,r,n),this.conjugate(d,s,r),this.normalize13b(d,r),i.negative=t.negative^e.negative,i.length=t.length+e.length,i.strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),m(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){r("number"==typeof t),r(t<67108864);for(var e=0,i=0;i<this.length;i++){var n=(0|this.words[i])*t,s=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=s>>>26,this.words[i]=67108863&s}return 0!==e&&(this.words[i]=e,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i<e.length;i++){var r=i/26|0,n=i%26;e[i]=(t.words[r]&1<<n)>>>n}return e}(t);if(0===e.length)return new s(1);for(var i=this,r=0;r<e.length&&0===e[r];r++,i=i.sqr());if(++r<e.length)for(var n=i.sqr();r<e.length;r++,n=n.sqr())0!==e[r]&&(i=i.mul(n));return i},s.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,i=t%26,n=(t-i)/26,s=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&s,h=(0|this.words[e])-a<<i;this.words[e]=h|o,o=a>>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},s.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,i){var n;r("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<<s,h=i;if(n-=o,n=Math.max(0,n),h){for(var u=0;u<o;u++)h.words[u]=this.words[u];h.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=n);u--){var c=0|this.words[u];this.words[u]=l<<26-s|c>>>s,l=c&a}return h&&0!==l&&(h.words[h.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26,n=1<<e;return!(this.length<=i||!(this.words[i]&n))},s.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return r("number"==typeof t),r(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,i){var n,s,o=t.length+i;this._expand(o);var a=0;for(n=0;n<t.length;n++){s=(0|this.words[n+i])+a;var h=(0|t.words[n])*e;a=((s-=67108863&h)>>26)-(h/67108864|0),this.words[n+i]=67108863&s}for(;n<this.length-i;n++)a=(s=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&s;if(0===a)return this.strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(s=-(0|this.words[n])+a)>>26,this.words[n]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,e){var i=(this.length,t.length),r=this.clone(),n=t,o=0|n.words[n.length-1];0!=(i=26-this._countBits(o))&&(n=n.ushln(i),r.iushln(i),o=0|n.words[n.length-1]);var a,h=r.length-n.length;if("mod"!==e){(a=new s(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=r.clone()._ishlnsubmul(n,1,h);0===l.negative&&(r=l,a&&(a.words[h]=1));for(var c=h-1;c>=0;c--){var d=67108864*(0|r.words[n.length+c])+(0|r.words[n.length+c-1]);for(d=Math.min(d/o|0,67108863),r._ishlnsubmul(n,d,c);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(n,1,c),r.isZero()||(r.negative^=1);a&&(a.words[c]=d)}return a&&a.strip(),r.strip(),"div"!==e&&0!==i&&r.iushrn(i),{div:a||null,mod:r}},s.prototype.divmod=function(t,e,i){return r(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),s=i.cmp(r);return s<0||1===n&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,i=0,n=this.length-1;n>=0;n--)i=(e*i+(0|this.words[n]))%t;return i},s.prototype.idivn=function(t){r(t<=67108863);for(var e=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*e;this.words[i]=n/t|0,e=n%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new s(1),o=new s(0),a=new s(0),h=new s(1),u=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++u;for(var l=i.clone(),c=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(l),h.isub(c)),a.iushrn(1),h.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(a),o.isub(h)):(i.isub(e),a.isub(n),h.isub(o))}return{a,b:h,gcd:i.iushln(u)}},s.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new s(1),a=new s(0),h=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var u=0,l=1;0==(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(h),o.iushrn(1);for(var c=0,d=1;0==(i.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(i.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(a)):(i.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var s=e;e=i,i=s}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var s=n,o=i;0!==s&&o<this.length;o++){var a=0|this.words[o];s=(a+=s)>>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){r<n?e=-1:r>n&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new k(t)},s.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},n(y,v),y.prototype.split=function(t,e){for(var i=4194303,r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var s=t.words[9];for(e.words[e.length++]=s&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(o&i)<<4|s>>>22,s=o}s>>>=22,t.words[n-10]=s,0===s&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i<t.length;i++){var r=0|t.words[i];e+=977*r,t.words[i]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(w,v),n(_,v),n(M,v),M.prototype.imulK=function(t){for(var e=0,i=0;i<t.length;i++){var r=19*(0|t.words[i])+e,n=67108863&r;r>>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return b[t]=e,e},k.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},k.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new s(1)).iushrn(2);return this.pow(t,i)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);r(!n.isZero());var a=new s(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);0!==this.pow(l,u).cmp(h);)l.redIAdd(h);for(var c=this.pow(l,n),d=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),p=o;0!==f.cmp(a);){for(var m=f,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var b=this.pow(c,new s(1).iushln(p-g-1));d=d.redMul(b),c=b.redSqr(),f=f.redMul(c),p=g}return d},k.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},k.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var i=new Array(16);i[0]=new s(1).toRed(this),i[1]=t;for(var r=2;r<i.length;r++)i[r]=this.mul(i[r-1],t);var n=i[0],o=0,a=0,h=e.bitLength()%26;for(0===h&&(h=26),r=e.length-1;r>=0;r--){for(var u=e.words[r],l=h-1;l>=0;l--){var c=u>>l&1;n!==i[0]&&(n=this.sqr(n)),0!==c||0!==o?(o<<=1,o|=c,(4==++a||0===r&&0===l)&&(n=this.mul(n,i[o]),a=0,o=0)):a=0}h=26}return n},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new x(t)},n(x,k),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var i=t.mul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=i.nmd(t),this)},6138:(t,e,i)=>{var r=i(980),n=i(7139),s=i(7859),o=i(2144),a=i(3663),h=i(3482),u=i(4818),l=i(9509).Buffer;t.exports=function(t,e,i){var c;c=t.padding?t.padding:i?1:4;var d,f=r(t),p=f.modulus.byteLength();if(e.length>p||new o(e).cmp(f.modulus)>=0)throw new Error("decryption error");d=i?u(new o(e),f):a(e,f);var m=l.alloc(p-d.length);if(d=l.concat([m,d],p),4===c)return function(t,e){var i=t.modulus.byteLength(),r=h("sha1").update(l.alloc(0)).digest(),o=r.length;if(0!==e[0])throw new Error("decryption error");var a=e.slice(1,o+1),u=e.slice(o+1),c=s(a,n(u,o)),d=s(u,n(c,i-o-1));if(function(t,e){t=l.from(t),e=l.from(e);var i=0,r=t.length;t.length!==e.length&&(i++,r=Math.min(t.length,e.length));for(var n=-1;++n<r;)i+=t[n]^e[n];return i}(r,d.slice(0,o)))throw new Error("decryption error");for(var f=o;0===d[f];)f++;if(1!==d[f++])throw new Error("decryption error");return d.slice(f)}(f,d);if(1===c)return function(t,e,i){for(var r=e.slice(0,2),n=2,s=0;0!==e[n++];)if(n>=e.length){s++;break}var o=e.slice(2,n-1);if(("0002"!==r.toString("hex")&&!i||"0001"!==r.toString("hex")&&i)&&s++,o.length<8&&s++,s)throw new Error("decryption error");return e.slice(n)}(0,d,i);if(3===c)return d;throw new Error("unknown padding")}},6559:(t,e,i)=>{var r=i(980),n=i(1798),s=i(3482),o=i(7139),a=i(7859),h=i(2144),u=i(4818),l=i(3663),c=i(9509).Buffer;t.exports=function(t,e,i){var d;d=t.padding?t.padding:i?1:4;var f,p=r(t);if(4===d)f=function(t,e){var i=t.modulus.byteLength(),r=e.length,u=s("sha1").update(c.alloc(0)).digest(),l=u.length,d=2*l;if(r>i-d-2)throw new Error("message too long");var f=c.alloc(i-r-d-2),p=i-l-1,m=n(l),g=a(c.concat([u,f,c.alloc(1,1),e],p),o(m,p)),b=a(m,o(g,l));return new h(c.concat([c.alloc(1),b,g],i))}(p,e);else if(1===d)f=function(t,e,i){var r,s=e.length,o=t.modulus.byteLength();if(s>o-11)throw new Error("message too long");return r=i?c.alloc(o-s-3,255):function(t){for(var e,i=c.allocUnsafe(t),r=0,s=n(2*t),o=0;r<t;)o===s.length&&(s=n(2*t),o=0),(e=s[o++])&&(i[r++]=e);return i}(o-s-3),new h(c.concat([c.from([0,i?1:2]),r,c.alloc(1),e],o))}(p,e,i);else{if(3!==d)throw new Error("unknown padding");if((f=new h(e)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return i?l(f,p):u(f,p)}},4818:(t,e,i)=>{var r=i(2144),n=i(9509).Buffer;t.exports=function(t,e){return n.from(t.toRed(r.mont(e.modulus)).redPow(new r(e.publicExponent)).fromRed().toArray())}},7859:t=>{t.exports=function(t,e){for(var i=t.length,r=-1;++r<i;)t[r]^=e[r];return t}},4286:(t,e,i)=>{var r=i(9590),n=i(778),s=i(2840),o=i(1156),a=function(){},h=/^v?\.0/.test(r.version),u=function(t){return"function"==typeof t},l=function(t,e,i,r){r=n(r);var l=!1;t.on("close",(function(){l=!0})),s(t,{readable:e,writable:i},(function(t){if(t)return r(t);l=!0,r()}));var c=!1;return function(e){if(!l&&!c)return c=!0,function(t){return!!h&&!!o&&(t instanceof(o.ReadStream||a)||t instanceof(o.WriteStream||a))&&u(t.close)}(t)?t.close(a):function(t){return t.setHeader&&u(t.abort)}(t)?t.abort():u(t.destroy)?t.destroy():void r(e||new Error("stream was destroyed"))}},c=function(t){t()},d=function(t,e){return t.pipe(e)};t.exports=function(){var t,e=Array.prototype.slice.call(arguments),i=u(e[e.length-1]||a)&&e.pop()||a;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var r=e.map((function(n,s){var o=s<e.length-1;return l(n,o,s>0,(function(e){t||(t=e),e&&r.forEach(c),o||(r.forEach(c),i(t))}))}));return e.reduce(d)}},2587:t=>{"use strict";function e(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,i,r,n){i=i||"&",r=r||"=";var s={};if("string"!=typeof t||0===t.length)return s;var o=/\+/g;t=t.split(i);var a=1e3;n&&"number"==typeof n.maxKeys&&(a=n.maxKeys);var h=t.length;a>0&&h>a&&(h=a);for(var u=0;u<h;++u){var l,c,d,f,p=t[u].replace(o,"%20"),m=p.indexOf(r);m>=0?(l=p.substr(0,m),c=p.substr(m+1)):(l=p,c=""),d=decodeURIComponent(l),f=decodeURIComponent(c),e(s,d)?Array.isArray(s[d])?s[d].push(f):s[d]=[s[d],f]:s[d]=f}return s}},2182:t=>{"use strict";var e=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,i,r,n){return i=i||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(n){var s=encodeURIComponent(e(n))+r;return Array.isArray(t[n])?t[n].map((function(t){return s+encodeURIComponent(e(t))})).join(i):s+encodeURIComponent(e(t[n]))})).join(i):n?encodeURIComponent(e(n))+r+encodeURIComponent(e(t)):""}},7673:(t,e,i)=>{"use strict";e.decode=e.parse=i(2587),e.encode=e.stringify=i(2182)},4375:(t,e,i)=>{let r;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:i.g):t=>(r||(r=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},3527:t=>{t.exports="function"==typeof queueMicrotask?queueMicrotask:t=>Promise.resolve().then(t)},5960:t=>{t.exports=function(t){var e=0;return function(){if(e===t.length)return null;var i=t.length-e,r=Math.random()*i|0,n=t[e+r],s=t[e];return t[e]=n,t[e+r]=s,e++,n}}},1798:(t,e,i)=>{"use strict";var r=i(9590),n=65536,s=i(9509).Buffer,o=i.g.crypto||i.g.msCrypto;o&&o.getRandomValues?t.exports=function(t,e){if(t>4294967295)throw new RangeError("requested too many random bytes");var i=s.allocUnsafe(t);if(t>0)if(t>n)for(var a=0;a<t;a+=n)o.getRandomValues(i.slice(a,a+n));else o.getRandomValues(i);return"function"==typeof e?r.nextTick((function(){e(null,i)})):i}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},7963:(t,e,i)=>{"use strict";var r=i(9590);function n(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var s=i(9509),o=i(1798),a=s.Buffer,h=s.kMaxLength,u=i.g.crypto||i.g.msCrypto,l=Math.pow(2,32)-1;function c(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>l||t<0)throw new TypeError("offset must be a uint32");if(t>h||t>e)throw new RangeError("offset out of range")}function d(t,e,i){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>l||t<0)throw new TypeError("size must be a uint32");if(t+e>i||t>h)throw new RangeError("buffer too small")}function f(t,e,i,n){if(r.browser){var s=t.buffer,a=new Uint8Array(s,e,i);return u.getRandomValues(a),n?void r.nextTick((function(){n(null,t)})):t}if(!n)return o(i).copy(t,e),t;o(i,(function(i,r){if(i)return n(i);r.copy(t,e),n(null,t)}))}u&&u.getRandomValues||!r.browser?(e.randomFill=function(t,e,r,n){if(!(a.isBuffer(t)||t instanceof i.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof e)n=e,e=0,r=t.length;else if("function"==typeof r)n=r,r=t.length-e;else if("function"!=typeof n)throw new TypeError('"cb" argument must be a function');return c(e,t.length),d(r,e,t.length),f(t,e,r,n)},e.randomFillSync=function(t,e,r){if(void 0===e&&(e=0),!(a.isBuffer(t)||t instanceof i.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return c(e,t.length),void 0===r&&(r=t.length-e),d(r,e,t.length),f(t,e,r)}):(e.randomFill=n,e.randomFillSync=n)},4622:t=>{"use strict";function e(t,e){return{start:t.start,end:t.end,index:e}}function i(t){return{start:t.start,end:t.end}}function r(t,e){return t.index-e.index}function n(t,e){return t.start-e.start}t.exports=function(t,s,o){if("string"!=typeof s)throw new TypeError("argument str must be a string");var a=s.indexOf("=");if(-1===a)return-2;var h=s.slice(a+1).split(","),u=[];u.type=s.slice(0,a);for(var l=0;l<h.length;l++){var c=h[l].split("-"),d=parseInt(c[0],10),f=parseInt(c[1],10);isNaN(d)?(d=t-f,f=t-1):isNaN(f)&&(f=t-1),f>t-1&&(f=t-1),isNaN(d)||isNaN(f)||d>f||d<0||u.push({start:d,end:f})}return u.length<1?-1:o&&o.combine?function(t){for(var s=t.map(e).sort(n),o=0,a=1;a<s.length;a++){var h=s[a],u=s[o];h.start>u.end+1?s[++o]=h:h.end>u.end&&(u.end=h.end,u.index=Math.min(u.index,h.index))}s.length=o+1;var l=s.sort(r).map(i);return l.type=t.type,l}(u):u}},7856:(t,e,i)=>{const{Writable:r,PassThrough:n}=i(8473);t.exports=class extends r{constructor(t,e={}){super(e),this.destroyed=!1,this._queue=[],this._position=t||0,this._cb=null,this._buffer=null,this._out=null}_write(t,e,i){let r=!0;for(;;){if(this.destroyed)return;if(0===this._queue.length)return this._buffer=t,void(this._cb=i);this._buffer=null;var n=this._queue[0];const e=Math.max(n.start-this._position,0),s=n.end-this._position;if(e>=t.length)return this._position+=t.length,i(null);let o;if(s>t.length){this._position+=t.length,o=0===e?t:t.slice(e),r=n.stream.write(o)&&r;break}this._position+=s,o=0===e&&s===t.length?t:t.slice(e,s),r=n.stream.write(o)&&r,n.last&&n.stream.end(),t=t.slice(s),this._queue.shift()}r?i(null):n.stream.once("drain",i.bind(null,null))}slice(t){if(this.destroyed)return null;Array.isArray(t)||(t=[t]);const e=new n;return t.forEach(((i,r)=>{this._queue.push({start:i.start,end:i.end,stream:e,last:r===t.length-1})})),this._buffer&&this._write(this._buffer,null,this._cb),e}destroy(t){this.destroyed||(this.destroyed=!0,t&&this.emit("error",t))}}},7830:t=>{"use strict";function e(t){return parseInt(t,10)===t}function i(t){function i(e){this.s=function(e){if(void 0===e){e=new Array(t);for(var i=0;i<t;i++)e[i]=Math.floor(Math.random()*t)}else if("string"==typeof e)e=(e=""+e).split("").map((function(e){return e.charCodeAt(0)%t}));else{if(!Array.isArray(e))throw new TypeError("invalid seed key specified");if(!e.every((function(t){return"number"==typeof t&&t===(0|t)})))throw new TypeError("invalid seed key specified: not array of integers")}for(var r=e.length,n=function(){for(var e=new Array(t),i=0;i<t;i++)e[i]=i;return e}(),s=0,o=0;o<t;o++){s=(s+n[o]+e[o%r])%t;var a=n[o];n[o]=n[s],n[s]=a}return n}(e),this.i=0,this.j=0}return i.prototype.randomNative=function(){this.i=(this.i+1)%t,this.j=(this.j+this.s[this.i])%t;var e=this.s[this.i];return this.s[this.i]=this.s[this.j],this.s[this.j]=e,this.s[(this.s[this.i]+this.s[this.j])%t]},i.prototype.randomUInt32=function(){return 256*(256*(256*this.randomByte()+this.randomByte())+this.randomByte())+this.randomByte()},i.prototype.randomFloat=function(){return this.randomUInt32()/4294967296},i.prototype.random=function(){var t,i;if(1===arguments.length)t=0,i=arguments[0];else{if(2!==arguments.length)throw new TypeError("random takes one or two integer arguments");t=arguments[0],i=arguments[1]}if(!e(t)||!e(i))throw new TypeError("random takes one or two integer arguments");return t+this.randomUInt32()%(i-t+1)},i.prototype.currentState=function(){return{i:this.i,j:this.j,s:this.s.slice()}},i.prototype.setState=function(e){var i=e.s,r=e.i,n=e.j;if(!(r===(0|r)&&0<=r&&r<t))throw new Error("state.i should be integer [0, "+(t-1)+"]");if(!(n===(0|n)&&0<=n&&n<t))throw new Error("state.j should be integer [0, "+(t-1)+"]");if(!Array.isArray(i)||i.length!==t)throw new Error("state should be array of length "+t);for(var s=0;s<t;s++)if(-1===i.indexOf(s))throw new Error("state should be permutation of 0.."+(t-1)+": "+s+" is missing");this.i=r,this.j=n,this.s=i.slice()},i}var r=i(256);r.prototype.randomByte=r.prototype.randomNative;var n=i(16);n.prototype.randomByte=function(){return 16*this.randomNative()+this.randomNative()};var s="a".charCodeAt(0),o="0".charCodeAt(0);function a(t){return t<10?String.fromCharCode(o+t):String.fromCharCode(s+t-10)}function h(t){return parseInt(t,16)}n.prototype.currentStateString=function(){var t=this.currentState();return a(t.i)+a(t.j)+t.s.map(a).join("")},n.prototype.setStateString=function(t){if(!t.match(/^[0-9a-f]{18}$/))throw new TypeError("RC4small stateString should be 18 hex character string");var e=h(t[0]),i=h(t[1]),r=t.split("").slice(2).map(h);this.setState({i:e,j:i,s:r})},r.RC4small=n,t.exports=r},4281:t=>{"use strict";var e={};function i(t,i,r){r||(r=Error);var n=function(t){var e,r;function n(e,r,n){return t.call(this,function(t,e,r){return"string"==typeof i?i:i(t,e,r)}(e,r,n))||this}return r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r,n}(r);n.prototype.name=r.name,n.prototype.code=t,e[t]=n}function r(t,e){if(Array.isArray(t)){var i=t.length;return t=t.map((function(t){return String(t)})),i>2?"one of ".concat(e," ").concat(t.slice(0,i-1).join(", "),", or ")+t[i-1]:2===i?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,i){var n,s,o,a,h;if("string"==typeof e&&(s="not ",e.substr(0,s.length)===s)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,i){return(void 0===i||i>t.length)&&(i=t.length),t.substring(i-e.length,i)===e}(t," argument"))o="The ".concat(t," ").concat(n," ").concat(r(e,"type"));else{var u=("number"!=typeof h&&(h=0),h+".".length>(a=t).length||-1===a.indexOf(".",h)?"argument":"property");o='The "'.concat(t,'" ').concat(u," ").concat(n," ").concat(r(e,"type"))}return o+". Received type ".concat(typeof i)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},6753:(t,e,i)=>{"use strict";var r=i(9590),n=Object.keys||function(t){var e=[];for(var i in t)e.push(i);return e};t.exports=l;var s=i(9481),o=i(4229);i(5717)(l,s);for(var a=n(o.prototype),h=0;h<a.length;h++){var u=a[h];l.prototype[u]||(l.prototype[u]=o.prototype[u])}function l(t){if(!(this instanceof l))return new l(t);s.call(this,t),o.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||r.nextTick(d,this)}function d(t){t.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})},2725:(t,e,i)=>{"use strict";t.exports=n;var r=i(4605);function n(t){if(!(this instanceof n))return new n(t);r.call(this,t)}i(5717)(n,r),n.prototype._transform=function(t,e,i){i(null,t)}},9481:(t,e,i)=>{"use strict";var r,n=i(9590);t.exports=E,E.ReadableState=x,i(7187).EventEmitter;var s,o=function(t,e){return t.listeners(e).length},a=i(2503),h=i(8764).Buffer,u=i.g.Uint8Array||function(){},l=i(4616);s=l&&l.debuglog?l.debuglog("stream"):function(){};var c,d,f,p=i(7327),m=i(1195),g=i(2457).getHighWaterMark,b=i(4281).q,v=b.ERR_INVALID_ARG_TYPE,y=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,_=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;i(5717)(E,a);var M=m.errorOrDestroy,k=["error","close","destroy","pause","resume"];function x(t,e,n){r=r||i(6753),t=t||{},"boolean"!=typeof n&&(n=e instanceof r),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",n),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(c||(c=i(2553).s),this.decoder=new c(t.encoding),this.encoding=t.encoding)}function E(t){if(r=r||i(6753),!(this instanceof E))return new E(t);var e=this instanceof r;this._readableState=new x(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function S(t,e,i,r,n){s("readableAddChunk",e);var o,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(s("onEofChunk"),!e.ended){if(e.decoder){var i=e.decoder.end();i&&i.length&&(e.buffer.push(i),e.length+=e.objectMode?1:i.length)}e.ended=!0,e.sync?C(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,B(t)))}}(t,a);else if(n||(o=function(t,e){var i,r;return r=e,h.isBuffer(r)||r instanceof u||"string"==typeof e||void 0===e||t.objectMode||(i=new v("chunk",["string","Buffer","Uint8Array"],e)),i}(a,e)),o)M(t,o);else if(a.objectMode||e&&e.length>0)if("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===h.prototype||(e=function(t){return h.from(t)}(e)),r)a.endEmitted?M(t,new _):T(t,a,e,!0);else if(a.ended)M(t,new y);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!i?(e=a.decoder.write(e),a.objectMode||0!==e.length?T(t,a,e,!1):R(t,a)):T(t,a,e,!1)}else r||(a.reading=!1,R(t,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function T(t,e,i,r){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",i)):(e.length+=e.objectMode?1:i.length,r?e.buffer.unshift(i):e.buffer.push(i),e.needReadable&&C(t)),R(t,e)}Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),E.prototype.destroy=m.destroy,E.prototype._undestroy=m.undestroy,E.prototype._destroy=function(t,e){e(t)},E.prototype.push=function(t,e){var i,r=this._readableState;return r.objectMode?i=!0:"string"==typeof t&&((e=e||r.defaultEncoding)!==r.encoding&&(t=h.from(t,e),e=""),i=!0),S(this,t,e,!1,i)},E.prototype.unshift=function(t){return S(this,t,null,!0,!1)},E.prototype.isPaused=function(){return!1===this._readableState.flowing},E.prototype.setEncoding=function(t){c||(c=i(2553).s);var e=new c(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";null!==r;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var A=1073741824;function I(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=A?t=A:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function C(t){var e=t._readableState;s("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(s("emitReadable",e.flowing),e.emittedReadable=!0,n.nextTick(B,t))}function B(t){var e=t._readableState;s("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,N(t)}function R(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(P,t,e))}function P(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var i=e.length;if(s("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}function L(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function O(t){s("readable nexttick read 0"),t.read(0)}function D(t,e){s("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),N(t),e.flowing&&!e.reading&&t.read(0)}function N(t){var e=t._readableState;for(s("flow",e.flowing);e.flowing&&null!==t.read(););}function j(t,e){return 0===e.length?null:(e.objectMode?i=e.buffer.shift():!t||t>=e.length?(i=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):i=e.buffer.consume(t,e.decoder),i);var i}function U(t){var e=t._readableState;s("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,n.nextTick(F,e,t))}function F(t,e){if(s("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var i=e._writableState;(!i||i.autoDestroy&&i.finished)&&e.destroy()}}function q(t,e){for(var i=0,r=t.length;i<r;i++)if(t[i]===e)return i;return-1}E.prototype.read=function(t){s("read",t),t=parseInt(t,10);var e=this._readableState,i=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return s("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?U(this):C(this),null;if(0===(t=I(t,e))&&e.ended)return 0===e.length&&U(this),null;var r,n=e.needReadable;return s("need readable",n),(0===e.length||e.length-t<e.highWaterMark)&&s("length less than watermark",n=!0),e.ended||e.reading?s("reading or ended",n=!1):n&&(s("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=I(i,e))),null===(r=t>0?j(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),i!==t&&e.ended&&U(this)),null!==r&&this.emit("data",r),r},E.prototype._read=function(t){M(this,new w("_read()"))},E.prototype.pipe=function(t,e){var i=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=t;break;case 1:r.pipes=[r.pipes,t];break;default:r.pipes.push(t)}r.pipesCount+=1,s("pipe count=%d opts=%j",r.pipesCount,e);var a=e&&!1===e.end||t===n.stdout||t===n.stderr?m:h;function h(){s("onend"),t.end()}r.endEmitted?n.nextTick(a):i.once("end",a),t.on("unpipe",(function e(n,o){s("onunpipe"),n===i&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,s("cleanup"),t.removeListener("close",f),t.removeListener("finish",p),t.removeListener("drain",u),t.removeListener("error",d),t.removeListener("unpipe",e),i.removeListener("end",h),i.removeListener("end",m),i.removeListener("data",c),l=!0,!r.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}));var u=function(t){return function(){var e=t._readableState;s("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,N(t))}}(i);t.on("drain",u);var l=!1;function c(e){s("ondata");var n=t.write(e);s("dest.write",n),!1===n&&((1===r.pipesCount&&r.pipes===t||r.pipesCount>1&&-1!==q(r.pipes,t))&&!l&&(s("false write response, pause",r.awaitDrain),r.awaitDrain++),i.pause())}function d(e){s("onerror",e),m(),t.removeListener("error",d),0===o(t,"error")&&M(t,e)}function f(){t.removeListener("finish",p),m()}function p(){s("onfinish"),t.removeListener("close",f),m()}function m(){s("unpipe"),i.unpipe(t)}return i.on("data",c),function(t,e,i){if("function"==typeof t.prependListener)return t.prependListener(e,i);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(i):t._events.error=[i,t._events.error]:t.on(e,i)}(t,"error",d),t.once("close",f),t.once("finish",p),t.emit("pipe",i),r.flowing||(s("pipe resume"),i.resume()),t},E.prototype.unpipe=function(t){var e=this._readableState,i={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,i)),this;if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<n;s++)r[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=q(e.pipes,t);return-1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,i)),this},E.prototype.on=function(t,e){var i=a.prototype.on.call(this,t,e),r=this._readableState;return"data"===t?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===t&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,s("on readable",r.length,r.reading),r.length?C(this):r.reading||n.nextTick(O,this))),i},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(t,e){var i=a.prototype.removeListener.call(this,t,e);return"readable"===t&&n.nextTick(L,this),i},E.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||n.nextTick(L,this),e},E.prototype.resume=function(){var t=this._readableState;return t.flowing||(s("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,n.nextTick(D,t,e))}(this,t)),t.paused=!1,this},E.prototype.pause=function(){return s("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(s("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},E.prototype.wrap=function(t){var e=this,i=this._readableState,r=!1;for(var n in t.on("end",(function(){if(s("wrapped end"),i.decoder&&!i.ended){var t=i.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(n){s("wrapped data"),i.decoder&&(n=i.decoder.write(n)),i.objectMode&&null==n||(i.objectMode||n&&n.length)&&(e.push(n)||(r=!0,t.pause()))})),t)void 0===this[n]&&"function"==typeof t[n]&&(this[n]=function(e){return function(){return t[e].apply(t,arguments)}}(n));for(var o=0;o<k.length;o++)t.on(k[o],this.emit.bind(this,k[o]));return this._read=function(e){s("wrapped _read",e),r&&(r=!1,t.resume())},this},"function"==typeof Symbol&&(E.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=i(5850)),d(this)}),Object.defineProperty(E.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(E.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(E.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),E._fromList=j,Object.defineProperty(E.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(E.from=function(t,e){return void 0===f&&(f=i(5167)),f(E,t,e)})},4605:(t,e,i)=>{"use strict";t.exports=l;var r=i(4281).q,n=r.ERR_METHOD_NOT_IMPLEMENTED,s=r.ERR_MULTIPLE_CALLBACK,o=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=r.ERR_TRANSFORM_WITH_LENGTH_0,h=i(6753);function u(t,e){var i=this._transformState;i.transforming=!1;var r=i.writecb;if(null===r)return this.emit("error",new s);i.writechunk=null,i.writecb=null,null!=e&&this.push(e),r(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function l(t){if(!(this instanceof l))return new l(t);h.call(this,t),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",c)}function c(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush((function(e,i){d(t,e,i)}))}function d(t,e,i){if(e)return t.emit("error",e);if(null!=i&&t.push(i),t._writableState.length)throw new a;if(t._transformState.transforming)throw new o;return t.push(null)}i(5717)(l,h),l.prototype.push=function(t,e){return this._transformState.needTransform=!1,h.prototype.push.call(this,t,e)},l.prototype._transform=function(t,e,i){i(new n("_transform()"))},l.prototype._write=function(t,e,i){var r=this._transformState;if(r.writecb=i,r.writechunk=t,r.writeencoding=e,!r.transforming){var n=this._readableState;(r.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},l.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},l.prototype._destroy=function(t,e){h.prototype._destroy.call(this,t,(function(t){e(t)}))}},4229:(t,e,i)=>{"use strict";var r,n=i(9590);function s(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,i){var r=t.entry;for(t.entry=null;r;){var n=r.callback;e.pendingcb--,n(undefined),r=r.next}e.corkedRequestsFree.next=t}(e,t)}}t.exports=E,E.WritableState=x;var o,a={deprecate:i(4927)},h=i(2503),u=i(8764).Buffer,l=i.g.Uint8Array||function(){},c=i(1195),d=i(2457).getHighWaterMark,f=i(4281).q,p=f.ERR_INVALID_ARG_TYPE,m=f.ERR_METHOD_NOT_IMPLEMENTED,g=f.ERR_MULTIPLE_CALLBACK,b=f.ERR_STREAM_CANNOT_PIPE,v=f.ERR_STREAM_DESTROYED,y=f.ERR_STREAM_NULL_VALUES,w=f.ERR_STREAM_WRITE_AFTER_END,_=f.ERR_UNKNOWN_ENCODING,M=c.errorOrDestroy;function k(){}function x(t,e,o){r=r||i(6753),t=t||{},"boolean"!=typeof o&&(o=e instanceof r),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=d(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var i=t._writableState,r=i.sync,s=i.writecb;if("function"!=typeof s)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(i),e)!function(t,e,i,r,s){--e.pendingcb,i?(n.nextTick(s,r),n.nextTick(B,t,e),t._writableState.errorEmitted=!0,M(t,r)):(s(r),t._writableState.errorEmitted=!0,M(t,r),B(t,e))}(t,i,r,e,s);else{var o=I(i)||t.destroyed;o||i.corked||i.bufferProcessing||!i.bufferedRequest||A(t,i),r?n.nextTick(T,t,i,o,s):T(t,i,o,s)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function E(t){var e=this instanceof(r=r||i(6753));if(!e&&!o.call(E,this))return new E(t);this._writableState=new x(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),h.call(this)}function S(t,e,i,r,n,s,o){e.writelen=r,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new v("write")):i?t._writev(n,e.onwrite):t._write(n,s,e.onwrite),e.sync=!1}function T(t,e,i,r){i||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),B(t,e)}function A(t,e){e.bufferProcessing=!0;var i=e.bufferedRequest;if(t._writev&&i&&i.next){var r=e.bufferedRequestCount,n=new Array(r),o=e.corkedRequestsFree;o.entry=i;for(var a=0,h=!0;i;)n[a]=i,i.isBuf||(h=!1),i=i.next,a+=1;n.allBuffers=h,S(t,e,!0,e.length,n,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new s(e),e.bufferedRequestCount=0}else{for(;i;){var u=i.chunk,l=i.encoding,c=i.callback;if(S(t,e,!1,e.objectMode?1:u.length,u,l,c),i=i.next,e.bufferedRequestCount--,e.writing)break}null===i&&(e.lastBufferedRequest=null)}e.bufferedRequest=i,e.bufferProcessing=!1}function I(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function C(t,e){t._final((function(i){e.pendingcb--,i&&M(t,i),e.prefinished=!0,t.emit("prefinish"),B(t,e)}))}function B(t,e){var i=I(e);if(i&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,n.nextTick(C,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var r=t._readableState;(!r||r.autoDestroy&&r.endEmitted)&&t.destroy()}return i}i(5717)(E,h),x.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(x.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(E,Symbol.hasInstance,{value:function(t){return!!o.call(this,t)||this===E&&t&&t._writableState instanceof x}})):o=function(t){return t instanceof this},E.prototype.pipe=function(){M(this,new b)},E.prototype.write=function(t,e,i){var r,s=this._writableState,o=!1,a=!s.objectMode&&(r=t,u.isBuffer(r)||r instanceof l);return a&&!u.isBuffer(t)&&(t=function(t){return u.from(t)}(t)),"function"==typeof e&&(i=e,e=null),a?e="buffer":e||(e=s.defaultEncoding),"function"!=typeof i&&(i=k),s.ending?function(t,e){var i=new w;M(t,i),n.nextTick(e,i)}(this,i):(a||function(t,e,i,r){var s;return null===i?s=new y:"string"==typeof i||e.objectMode||(s=new p("chunk",["string","Buffer"],i)),!s||(M(t,s),n.nextTick(r,s),!1)}(this,s,t,i))&&(s.pendingcb++,o=function(t,e,i,r,n,s){if(!i){var o=function(t,e,i){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=u.from(e,i)),e}(e,r,n);r!==o&&(i=!0,n="buffer",r=o)}var a=e.objectMode?1:r.length;e.length+=a;var h=e.length<e.highWaterMark;if(h||(e.needDrain=!0),e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:n,isBuf:i,callback:s,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else S(t,e,!1,a,r,n,s);return h}(this,s,a,t,e,i)),o},E.prototype.cork=function(){this._writableState.corked++},E.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||A(this,t))},E.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(E.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(t,e,i){i(new m("_write()"))},E.prototype._writev=null,E.prototype.end=function(t,e,i){var r=this._writableState;return"function"==typeof t?(i=t,t=null,e=null):"function"==typeof e&&(i=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||function(t,e,i){e.ending=!0,B(t,e),i&&(e.finished?n.nextTick(i):t.once("finish",i)),e.ended=!0,t.writable=!1}(this,r,i),this},Object.defineProperty(E.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),E.prototype.destroy=c.destroy,E.prototype._undestroy=c.undestroy,E.prototype._destroy=function(t,e){e(t)}},5850:(t,e,i)=>{"use strict";var r,n=i(9590);function s(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var o=i(8610),a=Symbol("lastResolve"),h=Symbol("lastReject"),u=Symbol("error"),l=Symbol("ended"),c=Symbol("lastPromise"),d=Symbol("handlePromise"),f=Symbol("stream");function p(t,e){return{value:t,done:e}}function m(t){var e=t[a];if(null!==e){var i=t[f].read();null!==i&&(t[c]=null,t[a]=null,t[h]=null,e(p(i,!1)))}}function g(t){n.nextTick(m,t)}var b=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((s(r={get stream(){return this[f]},next:function(){var t=this,e=this[u];if(null!==e)return Promise.reject(e);if(this[l])return Promise.resolve(p(void 0,!0));if(this[f].destroyed)return new Promise((function(e,i){n.nextTick((function(){t[u]?i(t[u]):e(p(void 0,!0))}))}));var i,r=this[c];if(r)i=new Promise(function(t,e){return function(i,r){t.then((function(){e[l]?i(p(void 0,!0)):e[d](i,r)}),r)}}(r,this));else{var s=this[f].read();if(null!==s)return Promise.resolve(p(s,!1));i=new Promise(this[d])}return this[c]=i,i}},Symbol.asyncIterator,(function(){return this})),s(r,"return",(function(){var t=this;return new Promise((function(e,i){t[f].destroy(null,(function(t){t?i(t):e(p(void 0,!0))}))}))})),r),b);t.exports=function(t){var e,i=Object.create(v,(s(e={},f,{value:t,writable:!0}),s(e,a,{value:null,writable:!0}),s(e,h,{value:null,writable:!0}),s(e,u,{value:null,writable:!0}),s(e,l,{value:t._readableState.endEmitted,writable:!0}),s(e,d,{value:function(t,e){var r=i[f].read();r?(i[c]=null,i[a]=null,i[h]=null,t(p(r,!1))):(i[a]=t,i[h]=e)},writable:!0}),e));return i[c]=null,o(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=i[h];return null!==e&&(i[c]=null,i[a]=null,i[h]=null,e(t)),void(i[u]=t)}var r=i[a];null!==r&&(i[c]=null,i[a]=null,i[h]=null,r(p(void 0,!0))),i[l]=!0})),t.on("readable",g.bind(null,i)),i}},7327:(t,e,i)=>{"use strict";function r(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function n(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function s(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var o=i(8764).Buffer,a=i(2361).inspect,h=a&&a.custom||"inspect";t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,i;return e=t,i=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,i=""+e.data;e=e.next;)i+=t+e.data;return i}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var e,i,r,n=o.allocUnsafe(t>>>0),s=this.head,a=0;s;)e=s.data,i=n,r=a,o.prototype.copy.call(e,i,r),a+=s.data.length,s=s.next;return n}},{key:"consume",value:function(t,e){var i;return t<this.head.data.length?(i=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):i=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,i=1,r=e.data;for(t-=r.length;e=e.next;){var n=e.data,s=t>n.length?n.length:t;if(s===n.length?r+=n:r+=n.slice(0,t),0==(t-=s)){s===n.length?(++i,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=n.slice(s));break}++i}return this.length-=i,r}},{key:"_getBuffer",value:function(t){var e=o.allocUnsafe(t),i=this.head,r=1;for(i.data.copy(e),t-=i.data.length;i=i.next;){var n=i.data,s=t>n.length?n.length:t;if(n.copy(e,e.length-t,0,s),0==(t-=s)){s===n.length?(++r,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=n.slice(s));break}++r}return this.length-=r,e}},{key:h,value:function(t,e){return a(this,function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?r(Object(i),!0).forEach((function(e){n(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}],i&&s(e.prototype,i),t}()},1195:(t,e,i)=>{"use strict";var r=i(9590);function n(t,e){o(t,e),s(t)}function s(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function o(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var i=this,a=this._readableState&&this._readableState.destroyed,h=this._writableState&&this._writableState.destroyed;return a||h?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,r.nextTick(o,this,t)):r.nextTick(o,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?i._writableState?i._writableState.errorEmitted?r.nextTick(s,i):(i._writableState.errorEmitted=!0,r.nextTick(n,i,t)):r.nextTick(n,i,t):e?(r.nextTick(s,i),e(t)):r.nextTick(s,i)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var i=t._readableState,r=t._writableState;i&&i.autoDestroy||r&&r.autoDestroy?t.destroy(e):t.emit("error",e)}}},8610:(t,e,i)=>{"use strict";var r=i(4281).q.ERR_STREAM_PREMATURE_CLOSE;function n(){}t.exports=function t(e,i,s){if("function"==typeof i)return t(e,null,i);i||(i={}),s=function(t){var e=!1;return function(){if(!e){e=!0;for(var i=arguments.length,r=new Array(i),n=0;n<i;n++)r[n]=arguments[n];t.apply(this,r)}}}(s||n);var o=i.readable||!1!==i.readable&&e.readable,a=i.writable||!1!==i.writable&&e.writable,h=function(){e.writable||l()},u=e._writableState&&e._writableState.finished,l=function(){a=!1,u=!0,o||s.call(e)},c=e._readableState&&e._readableState.endEmitted,d=function(){o=!1,c=!0,a||s.call(e)},f=function(t){s.call(e,t)},p=function(){var t;return o&&!c?(e._readableState&&e._readableState.ended||(t=new r),s.call(e,t)):a&&!u?(e._writableState&&e._writableState.ended||(t=new r),s.call(e,t)):void 0},m=function(){e.req.on("finish",l)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",l),e.on("abort",p),e.req?m():e.on("request",m)):a&&!e._writableState&&(e.on("end",h),e.on("close",h)),e.on("end",d),e.on("finish",l),!1!==i.error&&e.on("error",f),e.on("close",p),function(){e.removeListener("complete",l),e.removeListener("abort",p),e.removeListener("request",m),e.req&&e.req.removeListener("finish",l),e.removeListener("end",h),e.removeListener("close",h),e.removeListener("finish",l),e.removeListener("end",d),e.removeListener("error",f),e.removeListener("close",p)}}},5167:t=>{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(t,e,i)=>{"use strict";var r,n=i(4281).q,s=n.ERR_MISSING_ARGS,o=n.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function h(t,e,n,s){s=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(s);var a=!1;t.on("close",(function(){a=!0})),void 0===r&&(r=i(8610)),r(t,{readable:e,writable:n},(function(t){if(t)return s(t);a=!0,s()}));var h=!1;return function(e){if(!a&&!h)return h=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void s(e||new o("pipe"))}}function u(t){t()}function l(t,e){return t.pipe(e)}function c(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}t.exports=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];var r,n=c(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new s("streams");var o=e.map((function(t,i){var s=i<e.length-1;return h(t,s,i>0,(function(t){r||(r=t),t&&o.forEach(u),s||(o.forEach(u),n(r))}))}));return e.reduce(l)}},2457:(t,e,i)=>{"use strict";var r=i(4281).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,i,n){var s=function(t,e,i){return null!=t.highWaterMark?t.highWaterMark:e?t[i]:null}(e,n,i);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new r(n?i:"highWaterMark",s);return Math.floor(s)}return t.objectMode?16:16384}}},2503:(t,e,i)=>{t.exports=i(7187).EventEmitter},8473:(t,e,i)=>{(e=t.exports=i(9481)).Stream=e,e.Readable=e,e.Writable=i(4229),e.Duplex=i(6753),e.Transform=i(4605),e.PassThrough=i(2725),e.finished=i(8610),e.pipeline=i(9946)},38:(t,e,i)=>{e.render=function(t,e,i,r){"function"==typeof i&&(r=i,i={}),i||(i={}),r||(r=()=>{}),y(t),w(i),"string"==typeof e&&(e=document.querySelector(e)),b(t,(r=>{if(e.nodeName!==r.toUpperCase()){const i=o.extname(t.name).toLowerCase();throw new Error(`Cannot render "${i}" inside a "${e.nodeName.toLowerCase()}" element, expected "${r}"`)}return"video"!==r&&"audio"!==r||_(e,i),e}),i,r)},e.append=function(t,e,i,r){if("function"==typeof i&&(r=i,i={}),i||(i={}),r||(r=()=>{}),y(t),w(i),"string"==typeof e&&(e=document.querySelector(e)),e&&("VIDEO"===e.nodeName||"AUDIO"===e.nodeName))throw new Error("Invalid video/audio node argument. Argument must be root element that video/audio tag will be appended to.");function n(t){const i=document.createElement(t);return e.appendChild(i),i}b(t,(function(t){return"video"===t||"audio"===t?function(t){const r=n(t);return _(r,i),e.appendChild(r),r}(t):n(t)}),i,(function(t,e){t&&e&&e.remove(),r(t,e)}))},e.mime=i(876);const r=i(1227)("render-media"),n=i(4264),s=i(6567),o=i(6470),a=i(8677),h=i(7235),u=[".m4a",".m4b",".m4p",".m4v",".mp4"],l=[".m4v",".mkv",".mp4",".webm"],c=[].concat(l,[".m4a",".m4b",".m4p",".mp3"]),d=[".mov",".ogv"],f=[".aac",".oga",".ogg",".wav",".flac"],p=[".bmp",".gif",".jpeg",".jpg",".png",".svg"],m=[".css",".html",".js",".md",".pdf",".srt",".txt"],g="undefined"!=typeof window&&window.MediaSource;function b(t,e,i,a){const b=o.extname(t.name).toLowerCase();let y,w=0;function _(){return!("number"==typeof t.length&&t.length>i.maxBlobLength&&(r("File length too large for Blob URL approach: %d (max: %d)",t.length,i.maxBlobLength),S(new Error(`File length too large for Blob URL approach: ${t.length} (max: ${i.maxBlobLength})`)),1))}function M(i){_()&&(y=e(i),v(t,((t,e)=>{if(t)return S(t);y.addEventListener("error",S),y.addEventListener("loadstart",k),y.addEventListener("loadedmetadata",x),y.src=e})))}function k(){if(y.removeEventListener("loadstart",k),i.autoplay){const t=y.play();void 0!==t&&t.catch(S)}}function x(){y.removeEventListener("loadedmetadata",x),a(null,y)}function E(){v(t,((t,i)=>{if(t)return S(t);".pdf"!==b?(y=e("iframe"),y.sandbox="allow-forms allow-scripts",y.src=i):(y=e("object"),y.setAttribute("typemustmatch",!0),y.setAttribute("type","application/pdf"),y.setAttribute("data",i)),a(null,y)}))}function S(e){e.message=`Error rendering file "${t.name}": ${e.message}`,r(e.message),a(e)}c.includes(b)?function(){const i=l.includes(b)?"video":"audio";function n(){r(`Use MediaSource API for ${t.name}`),f(),y.addEventListener("error",d),y.addEventListener("loadstart",k),y.addEventListener("loadedmetadata",x);const e=new s(y).createWriteStream((i=t.name,{".m4a":'audio/mp4; codecs="mp4a.40.5"',".m4b":'audio/mp4; codecs="mp4a.40.5"',".m4p":'audio/mp4; codecs="mp4a.40.5"',".m4v":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".mkv":'video/webm; codecs="avc1.640029, mp4a.40.5"',".mp3":"audio/mpeg",".mp4":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".webm":'video/webm; codecs="vorbis, vp8"'}[o.extname(i).toLowerCase()]));var i;t.createReadStream().pipe(e),w&&(y.currentTime=w)}function a(){r(`Use Blob URL for ${t.name}`),f(),y.addEventListener("error",S),y.addEventListener("loadstart",k),y.addEventListener("loadedmetadata",x),v(t,((t,e)=>{if(t)return S(t);y.src=e,w&&(y.currentTime=w)}))}function c(t){r("videostream error: fallback to MediaSource API: %o",t.message||t),y.removeEventListener("error",c),y.removeEventListener("loadedmetadata",x),n()}function d(t){r("MediaSource API error: fallback to Blob URL: %o",t.message||t),_()&&(y.removeEventListener("error",d),y.removeEventListener("loadedmetadata",x),a())}function f(){y||(y=e(i),y.addEventListener("progress",(()=>{w=y.currentTime})))}g?u.includes(b)?(r(`Use \`videostream\` package for ${t.name}`),f(),y.addEventListener("error",c),y.addEventListener("loadstart",k),y.addEventListener("loadedmetadata",x),new h(t,y)):n():a()}():d.includes(b)?M("video"):f.includes(b)?M("audio"):p.includes(b)?(y=e("img"),v(t,((e,i)=>{if(e)return S(e);y.src=i,y.alt=t.name,a(null,y)}))):m.includes(b)?E():function(){r('Unknown file extension "%s" - will attempt to render into iframe',b);let e="";t.createReadStream({start:0,end:1e3}).setEncoding("utf8").on("data",(t=>{e+=t})).on("end",(function(){n(e)?(r('File extension "%s" appears ascii, so will render.',b),E()):(r('File extension "%s" appears non-ascii, will not render.',b),a(new Error(`Unsupported file type "${b}": Cannot append to DOM`)))})).on("error",a)}()}function v(t,i){const r=o.extname(t.name).toLowerCase();a(t.createReadStream(),e.mime[r]).then((t=>i(null,t)),(t=>i(t)))}function y(t){if(null==t)throw new Error("file cannot be null or undefined");if("string"!=typeof t.name)throw new Error("missing or invalid file.name property");if("function"!=typeof t.createReadStream)throw new Error("missing or invalid file.createReadStream property")}function w(t){null==t.autoplay&&(t.autoplay=!1),null==t.muted&&(t.muted=!1),null==t.controls&&(t.controls=!0),null==t.maxBlobLength&&(t.maxBlobLength=2e8)}function _(t,e){t.autoplay=!!e.autoplay,t.muted=!!e.muted,t.controls=!!e.controls}},9785:(t,e,i)=>{"use strict";var r=i(8764).Buffer,n=i(5717),s=i(3349),o=new Array(16),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],h=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],l=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],c=[0,1518500249,1859775393,2400959708,2840853838],d=[1352829926,1548603684,1836072691,2053994217,0];function f(){s.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(t,e){return t<<e|t>>>32-e}function m(t,e,i,r,n,s,o,a){return p(t+(e^i^r)+s+o|0,a)+n|0}function g(t,e,i,r,n,s,o,a){return p(t+(e&i|~e&r)+s+o|0,a)+n|0}function b(t,e,i,r,n,s,o,a){return p(t+((e|~i)^r)+s+o|0,a)+n|0}function v(t,e,i,r,n,s,o,a){return p(t+(e&r|i&~r)+s+o|0,a)+n|0}function y(t,e,i,r,n,s,o,a){return p(t+(e^(i|~r))+s+o|0,a)+n|0}n(f,s),f.prototype._update=function(){for(var t=o,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var i=0|this._a,r=0|this._b,n=0|this._c,s=0|this._d,f=0|this._e,w=0|this._a,_=0|this._b,M=0|this._c,k=0|this._d,x=0|this._e,E=0;E<80;E+=1){var S,T;E<16?(S=m(i,r,n,s,f,t[a[E]],c[0],u[E]),T=y(w,_,M,k,x,t[h[E]],d[0],l[E])):E<32?(S=g(i,r,n,s,f,t[a[E]],c[1],u[E]),T=v(w,_,M,k,x,t[h[E]],d[1],l[E])):E<48?(S=b(i,r,n,s,f,t[a[E]],c[2],u[E]),T=b(w,_,M,k,x,t[h[E]],d[2],l[E])):E<64?(S=v(i,r,n,s,f,t[a[E]],c[3],u[E]),T=g(w,_,M,k,x,t[h[E]],d[3],l[E])):(S=y(i,r,n,s,f,t[a[E]],c[4],u[E]),T=m(w,_,M,k,x,t[h[E]],d[4],l[E])),i=f,f=s,s=p(n,10),n=r,r=S,w=x,x=k,k=p(M,10),M=_,_=T}var A=this._b+n+k|0;this._b=this._c+s+x|0,this._c=this._d+f+w|0,this._d=this._e+i+_|0,this._e=this._a+r+M|0,this._a=A},f.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=r.alloc?r.alloc(20):new r(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=f},9967:(t,e,i)=>{t.exports=function(t,e,i){if("number"!=typeof e)throw new Error("second argument must be a Number");let n,s,o,a,h,u,l=!0;function c(t){function e(){i&&i(t,n),i=null}l?r(e):e()}function d(e,i,r){if(n[e]=r,i&&(h=!0),0==--o||i)c(i);else if(!h&&u<s){let e;a?(e=a[u],u+=1,t[e]((function(t,i){d(e,t,i)}))):(e=u,u+=1,t[e]((function(t,i){d(e,t,i)})))}}Array.isArray(t)?(n=[],o=s=t.length):(a=Object.keys(t),n={},o=s=a.length),u=e,o?a?a.some((function(i,r){return t[i]((function(t,e){d(i,t,e)})),r===e-1})):t.some((function(t,i){return t((function(t,e){d(i,t,e)})),i===e-1})):c(null),l=!1};const r=i(4375)},4595:(t,e,i)=>{t.exports=function(t,e){let i,n,s,o=!0;function a(t){function n(){e&&e(t,i),e=null}o?r(n):n()}function h(t,e,r){i[t]=r,(0==--n||e)&&a(e)}Array.isArray(t)?(i=[],n=t.length):(s=Object.keys(t),i={},n=s.length),n?s?s.forEach((function(e){t[e]((function(t,i){h(e,t,i)}))})):t.forEach((function(t,e){t((function(t,i){h(e,t,i)}))})):a(null),o=!1};const r=i(4375)},4029:function(t,e,i){var r,n=i(5108);"undefined"!=typeof self&&self,r=function(){return function(t){var e={};function i(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=3)}([function(t,e,i){var r=i(5),n=i(1),s=n.toHex,o=n.ceilHeapSize,a=i(6),h=function(t){for(t+=9;t%64>0;t+=1);return t},u=function(t,e){var i=new Int32Array(t,e+320,5),r=new Int32Array(5),n=new DataView(r.buffer);return n.setInt32(0,i[0],!1),n.setInt32(4,i[1],!1),n.setInt32(8,i[2],!1),n.setInt32(12,i[3],!1),n.setInt32(16,i[4],!1),r},l=function(){function t(e){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(e=e||65536)%64>0)throw new Error("Chunk size must be a multiple of 128 bit");this._offset=0,this._maxChunkLen=e,this._padMaxChunkLen=h(e),this._heap=new ArrayBuffer(o(this._padMaxChunkLen+320+20)),this._h32=new Int32Array(this._heap),this._h8=new Int8Array(this._heap),this._core=new r({Int32Array},{},this._heap)}return t.prototype._initState=function(t,e){this._offset=0;var i=new Int32Array(t,e+320,5);i[0]=1732584193,i[1]=-271733879,i[2]=-1732584194,i[3]=271733878,i[4]=-1009589776},t.prototype._padChunk=function(t,e){var i=h(t),r=new Int32Array(this._heap,0,i>>2);return function(t,e){var i=new Uint8Array(t.buffer),r=e%4,n=e-r;switch(r){case 0:i[n+3]=0;case 1:i[n+2]=0;case 2:i[n+1]=0;case 3:i[n+0]=0}for(var s=1+(e>>2);s<t.length;s++)t[s]=0}(r,t),function(t,e,i){t[e>>2]|=128<<24-(e%4<<3),t[14+(2+(e>>2)&-16)]=i/(1<<29)|0,t[15+(2+(e>>2)&-16)]=i<<3}(r,t,e),i},t.prototype._write=function(t,e,i,r){a(t,this._h8,this._h32,e,i,r||0)},t.prototype._coreCall=function(t,e,i,r,n){var s=i;this._write(t,e,i),n&&(s=this._padChunk(i,r)),this._core.hash(s,this._padMaxChunkLen)},t.prototype.rawDigest=function(t){var e=t.byteLength||t.length||t.size||0;this._initState(this._heap,this._padMaxChunkLen);var i=0,r=this._maxChunkLen;for(i=0;e>i+r;i+=r)this._coreCall(t,i,r,e,!1);return this._coreCall(t,i,e-i,e,!0),u(this._heap,this._padMaxChunkLen)},t.prototype.digest=function(t){return s(this.rawDigest(t).buffer)},t.prototype.digestFromString=function(t){return this.digest(t)},t.prototype.digestFromBuffer=function(t){return this.digest(t)},t.prototype.digestFromArrayBuffer=function(t){return this.digest(t)},t.prototype.resetState=function(){return this._initState(this._heap,this._padMaxChunkLen),this},t.prototype.append=function(t){var e=0,i=t.byteLength||t.length||t.size||0,r=this._offset%this._maxChunkLen,n=void 0;for(this._offset+=i;e<i;)n=Math.min(i-e,this._maxChunkLen-r),this._write(t,e,n,r),e+=n,(r+=n)===this._maxChunkLen&&(this._core.hash(this._maxChunkLen,this._padMaxChunkLen),r=0);return this},t.prototype.getState=function(){var t=void 0;if(this._offset%this._maxChunkLen)t=this._heap.slice(0);else{var e=new Int32Array(this._heap,this._padMaxChunkLen+320,5);t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}return{offset:this._offset,heap:t}},t.prototype.setState=function(t){return this._offset=t.offset,20===t.heap.byteLength?new Int32Array(this._heap,this._padMaxChunkLen+320,5).set(new Int32Array(t.heap)):this._h32.set(new Int32Array(t.heap)),this},t.prototype.rawEnd=function(){var t=this._offset,e=t%this._maxChunkLen,i=this._padChunk(e,t);this._core.hash(i,this._padMaxChunkLen);var r=u(this._heap,this._padMaxChunkLen);return this._initState(this._heap,this._padMaxChunkLen),r},t.prototype.end=function(){return s(this.rawEnd().buffer)},t}();t.exports=l,t.exports._core=r},function(t,e){for(var i=new Array(256),r=0;r<256;r++)i[r]=(r<16?"0":"")+r.toString(16);t.exports.toHex=function(t){for(var e=new Uint8Array(t),r=new Array(t.byteLength),n=0;n<r.length;n++)r[n]=i[e[n]];return r.join("")},t.exports.ceilHeapSize=function(t){var e=0;if(t<=65536)return 65536;if(t<16777216)for(e=1;e<t;e<<=1);else for(e=16777216;e<t;e+=16777216);return e},t.exports.isDedicatedWorkerScope=function(t){var e="WorkerGlobalScope"in t&&t instanceof t.WorkerGlobalScope,i="SharedWorkerGlobalScope"in t&&t instanceof t.SharedWorkerGlobalScope,r="ServiceWorkerGlobalScope"in t&&t instanceof t.ServiceWorkerGlobalScope;return e&&!i&&!r}},function(t,e,i){t.exports=function(){var t=i(0),e=function(t,i,r,n,s){var o=new self.FileReader;o.onloadend=function(){if(o.error)return s(o.error);var a=o.result;i+=o.result.byteLength;try{t.append(a)}catch(t){return void s(t)}i<n.size?e(t,i,r,n,s):s(null,t.end())},o.readAsArrayBuffer(n.slice(i,i+r))},r=!0;return self.onmessage=function(i){if(r){var n=i.data.data,s=i.data.file,o=i.data.id;if(void 0!==o&&(s||n)){var a=i.data.blockSize||4194304,h=new t(a);h.resetState();var u=function(t,e){t?self.postMessage({id:o,error:t.name}):self.postMessage({id:o,hash:e})};n&&function(t,e,i){try{i(null,t.digest(e))}catch(t){return i(t)}}(h,n,u),s&&e(h,0,a,s,u)}}},function(){r=!1}}},function(t,e,i){var r=i(4),n=i(0),s=i(7),o=i(2),a=i(1).isDedicatedWorkerScope,h="undefined"!=typeof self&&a(self);n.disableWorkerBehaviour=h?o():function(){},n.createWorker=function(){var t=r(2),e=t.terminate;return t.terminate=function(){URL.revokeObjectURL(t.objectURL),e.call(t)},t},n.createHash=s,t.exports=n},function(t,e,i){function r(t){var e={};function i(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=t,i.c=e,i.i=function(t){return t},i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/",i.oe=function(t){throw n.error(t),t};var r=i(i.s=ENTRY_MODULE);return r.default||r}var s="\\((/\\*.*?\\*/)?s?.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)";function o(t){return(t+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function a(t,e,r){var n={};n[r]=[];var a=e.toString(),h=a.match(/^function\s?\(\w+,\s*\w+,\s*(\w+)\)/);if(!h)return n;for(var u,l=h[1],c=new RegExp("(\\\\n|\\W)"+o(l)+s,"g");u=c.exec(a);)"dll-reference"!==u[3]&&n[r].push(u[3]);for(c=new RegExp("\\("+o(l)+'\\("(dll-reference\\s([\\.|\\-|\\+|\\w|/|@]+))"\\)\\)'+s,"g");u=c.exec(a);)t[u[2]]||(n[r].push(u[1]),t[u[2]]=i(u[1]).m),n[u[2]]=n[u[2]]||[],n[u[2]].push(u[4]);return n}function h(t){return Object.keys(t).reduce((function(e,i){return e||t[i].length>0}),!1)}t.exports=function(t,e){e=e||{};var n={main:i.m},s=e.all?{main:Object.keys(n)}:function(t,e){for(var i={main:[e]},r={main:[]},n={main:{}};h(i);)for(var s=Object.keys(i),o=0;o<s.length;o++){var u=s[o],l=i[u].pop();if(n[u]=n[u]||{},!n[u][l]&&t[u][l]){n[u][l]=!0,r[u]=r[u]||[],r[u].push(l);for(var c=a(t,t[u][l],u),d=Object.keys(c),f=0;f<d.length;f++)i[d[f]]=i[d[f]]||[],i[d[f]]=i[d[f]].concat(c[d[f]])}}return r}(n,t),o="";Object.keys(s).filter((function(t){return"main"!==t})).forEach((function(t){for(var e=0;s[t][e];)e++;s[t].push(e),n[t][e]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",o=o+"var "+t+" = ("+r.toString().replace("ENTRY_MODULE",JSON.stringify(e))+")({"+s[t].map((function(e){return JSON.stringify(e)+": "+n[t][e].toString()})).join(",")+"});\n"})),o=o+"("+r.toString().replace("ENTRY_MODULE",JSON.stringify(t))+")({"+s.main.map((function(t){return JSON.stringify(t)+": "+n.main[t].toString()})).join(",")+"})(self);";var u=new window.Blob([o],{type:"text/javascript"});if(e.bare)return u;var l=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(u),c=new window.Worker(l);return c.objectURL=l,c}},function(t,e){t.exports=function(t,e,i){"use asm";var r=new t.Int32Array(i);function n(t,e){t=t|0;e=e|0;var i=0,n=0,s=0,o=0,a=0,h=0,u=0,l=0,c=0,d=0,f=0,p=0,m=0,g=0;s=r[e+320>>2]|0;a=r[e+324>>2]|0;u=r[e+328>>2]|0;c=r[e+332>>2]|0;f=r[e+336>>2]|0;for(i=0;(i|0)<(t|0);i=i+64|0){o=s;h=a;l=u;d=c;p=f;for(n=0;(n|0)<64;n=n+4|0){g=r[i+n>>2]|0;m=((s<<5|s>>>27)+(a&u|~a&c)|0)+((g+f|0)+1518500249|0)|0;f=c;c=u;u=a<<30|a>>>2;a=s;s=m;r[t+n>>2]=g}for(n=t+64|0;(n|0)<(t+80|0);n=n+4|0){g=(r[n-12>>2]^r[n-32>>2]^r[n-56>>2]^r[n-64>>2])<<1|(r[n-12>>2]^r[n-32>>2]^r[n-56>>2]^r[n-64>>2])>>>31;m=((s<<5|s>>>27)+(a&u|~a&c)|0)+((g+f|0)+1518500249|0)|0;f=c;c=u;u=a<<30|a>>>2;a=s;s=m;r[n>>2]=g}for(n=t+80|0;(n|0)<(t+160|0);n=n+4|0){g=(r[n-12>>2]^r[n-32>>2]^r[n-56>>2]^r[n-64>>2])<<1|(r[n-12>>2]^r[n-32>>2]^r[n-56>>2]^r[n-64>>2])>>>31;m=((s<<5|s>>>27)+(a^u^c)|0)+((g+f|0)+1859775393|0)|0;f=c;c=u;u=a<<30|a>>>2;a=s;s=m;r[n>>2]=g}for(n=t+160|0;(n|0)<(t+240|0);n=n+4|0){g=(r[n-12>>2]^r[n-32>>2]^r[n-56>>2]^r[n-64>>2])<<1|(r[n-12>>2]^r[n-32>>2]^r[n-56>>2]^r[n-64>>2])>>>31;m=((s<<5|s>>>27)+(a&u|a&c|u&c)|0)+((g+f|0)-1894007588|0)|0;f=c;c=u;u=a<<30|a>>>2;a=s;s=m;r[n>>2]=g}for(n=t+240|0;(n|0)<(t+320|0);n=n+4|0){g=(r[n-12>>2]^r[n-32>>2]^r[n-56>>2]^r[n-64>>2])<<1|(r[n-12>>2]^r[n-32>>2]^r[n-56>>2]^r[n-64>>2])>>>31;m=((s<<5|s>>>27)+(a^u^c)|0)+((g+f|0)-899497514|0)|0;f=c;c=u;u=a<<30|a>>>2;a=s;s=m;r[n>>2]=g}s=s+o|0;a=a+h|0;u=u+l|0;c=c+d|0;f=f+p|0}r[e+320>>2]=s;r[e+324>>2]=a;r[e+328>>2]=u;r[e+332>>2]=c;r[e+336>>2]=f}return{hash:n}}},function(t,e){var i=this,r=void 0;"undefined"!=typeof self&&void 0!==self.FileReaderSync&&(r=new self.FileReaderSync);var n=function(t,e,i,r,n,s){var o=void 0,a=s%4,h=(n+a)%4,u=n-h;switch(a){case 0:e[s]=t[r+3];case 1:e[s+1-(a<<1)|0]=t[r+2];case 2:e[s+2-(a<<1)|0]=t[r+1];case 3:e[s+3-(a<<1)|0]=t[r]}if(!(n<h+(4-a))){for(o=4-a;o<u;o=o+4|0)i[s+o>>2|0]=t[r+o]<<24|t[r+o+1]<<16|t[r+o+2]<<8|t[r+o+3];switch(h){case 3:e[s+u+1|0]=t[r+u+2];case 2:e[s+u+2|0]=t[r+u+1];case 1:e[s+u+3|0]=t[r+u]}}};t.exports=function(t,e,s,o,a,h){if("string"==typeof t)return function(t,e,i,r,n,s){var o=void 0,a=s%4,h=(n+a)%4,u=n-h;switch(a){case 0:e[s]=t.charCodeAt(r+3);case 1:e[s+1-(a<<1)|0]=t.charCodeAt(r+2);case 2:e[s+2-(a<<1)|0]=t.charCodeAt(r+1);case 3:e[s+3-(a<<1)|0]=t.charCodeAt(r)}if(!(n<h+(4-a))){for(o=4-a;o<u;o=o+4|0)i[s+o>>2]=t.charCodeAt(r+o)<<24|t.charCodeAt(r+o+1)<<16|t.charCodeAt(r+o+2)<<8|t.charCodeAt(r+o+3);switch(h){case 3:e[s+u+1|0]=t.charCodeAt(r+u+2);case 2:e[s+u+2|0]=t.charCodeAt(r+u+1);case 1:e[s+u+3|0]=t.charCodeAt(r+u)}}}(t,e,s,o,a,h);if(t instanceof Array)return n(t,e,s,o,a,h);if(i&&i.Buffer&&i.Buffer.isBuffer(t))return n(t,e,s,o,a,h);if(t instanceof ArrayBuffer)return n(new Uint8Array(t),e,s,o,a,h);if(t.buffer instanceof ArrayBuffer)return n(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),e,s,o,a,h);if(t instanceof Blob)return function(t,e,i,n,s,o){var a=void 0,h=o%4,u=(s+h)%4,l=s-u,c=new Uint8Array(r.readAsArrayBuffer(t.slice(n,n+s)));switch(h){case 0:e[o]=c[3];case 1:e[o+1-(h<<1)|0]=c[2];case 2:e[o+2-(h<<1)|0]=c[1];case 3:e[o+3-(h<<1)|0]=c[0]}if(!(s<u+(4-h))){for(a=4-h;a<l;a=a+4|0)i[o+a>>2|0]=c[a]<<24|c[a+1]<<16|c[a+2]<<8|c[a+3];switch(u){case 3:e[o+l+1|0]=c[l+2];case 2:e[o+l+2|0]=c[l+1];case 1:e[o+l+3|0]=c[l]}}}(t,e,s,o,a,h);throw new Error("Unsupported data type.")}},function(t,e,i){var r=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),n=i(0),s=i(1).toHex,o=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._rusha=new n,this._rusha.resetState()}return t.prototype.update=function(t){return this._rusha.append(t),this},t.prototype.digest=function(t){var e=this._rusha.rawEnd().buffer;if(!t)return e;if("hex"===t)return s(e);throw new Error("unsupported digest encoding")},r(t,[{key:"state",get:function(){return this._rusha.getState()},set:function(t){this._rusha.setState(t)}}]),t}();t.exports=function(){return new o}}])},t.exports=r()},9509:(t,e,i)=>{var r=i(8764),n=r.Buffer;function s(t,e){for(var i in t)e[i]=t[i]}function o(t,e,i){return n(t,e,i)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(s(r,e),e.Buffer=o),o.prototype=Object.create(n.prototype),s(n,o),o.from=function(t,e,i){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,i)},o.alloc=function(t,e,i){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=n(t);return void 0!==e?"string"==typeof i?r.fill(e,i):r.fill(e):r.fill(0),r},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}},2399:(t,e,i)=>{"use strict";var r,n=i(9590),s=i(8764),o=s.Buffer,a={};for(r in s)s.hasOwnProperty(r)&&"SlowBuffer"!==r&&"Buffer"!==r&&(a[r]=s[r]);var h=a.Buffer={};for(r in o)o.hasOwnProperty(r)&&"allocUnsafe"!==r&&"allocUnsafeSlow"!==r&&(h[r]=o[r]);if(a.Buffer.prototype=o.prototype,h.from&&h.from!==Uint8Array.from||(h.from=function(t,e,i){if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof t);if(t&&void 0===t.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);return o(t,e,i)}),h.alloc||(h.alloc=function(t,e,i){if("number"!=typeof t)throw new TypeError('The "size" argument must be of type number. Received type '+typeof t);if(t<0||t>=2*(1<<30))throw new RangeError('The value "'+t+'" is invalid for option "size"');var r=o(t);return e&&0!==e.length?"string"==typeof i?r.fill(e,i):r.fill(e):r.fill(0),r}),!a.kStringMaxLength)try{a.kStringMaxLength=n.binding("buffer").kStringMaxLength}catch(t){}a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),t.exports=a},4189:(t,e,i)=>{var r=i(9509).Buffer;function n(t,e){this._block=r.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}n.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=r.from(t,e));for(var i=this._block,n=this._blockSize,s=t.length,o=this._len,a=0;a<s;){for(var h=o%n,u=Math.min(s-a,n-h),l=0;l<u;l++)i[h+l]=t[a+l];a+=u,(o+=u)%n==0&&this._update(i)}return this._len+=s,this},n.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var i=8*this._len;if(i<=4294967295)this._block.writeUInt32BE(i,this._blockSize-4);else{var r=(4294967295&i)>>>0,n=(i-r)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var s=this._hash();return t?s.toString(t):s},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=n},9072:(t,e,i)=>{var r=t.exports=function(t){t=t.toLowerCase();var e=r[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};r.sha=i(4448),r.sha1=i(8336),r.sha224=i(8432),r.sha256=i(7499),r.sha384=i(1686),r.sha512=i(7816)},4448:(t,e,i)=>{var r=i(5717),n=i(4189),s=i(9509).Buffer,o=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function h(){this.init(),this._w=a,n.call(this,64,56)}function u(t){return t<<30|t>>>2}function l(t,e,i,r){return 0===t?e&i|~e&r:2===t?e&i|e&r|i&r:e^i^r}r(h,n),h.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},h.prototype._update=function(t){for(var e,i=this._w,r=0|this._a,n=0|this._b,s=0|this._c,a=0|this._d,h=0|this._e,c=0;c<16;++c)i[c]=t.readInt32BE(4*c);for(;c<80;++c)i[c]=i[c-3]^i[c-8]^i[c-14]^i[c-16];for(var d=0;d<80;++d){var f=~~(d/20),p=0|((e=r)<<5|e>>>27)+l(f,n,s,a)+h+i[d]+o[f];h=a,a=s,s=u(n),n=r,r=p}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=h+this._e|0},h.prototype._hash=function(){var t=s.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=h},8336:(t,e,i)=>{var r=i(5717),n=i(4189),s=i(9509).Buffer,o=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function h(){this.init(),this._w=a,n.call(this,64,56)}function u(t){return t<<5|t>>>27}function l(t){return t<<30|t>>>2}function c(t,e,i,r){return 0===t?e&i|~e&r:2===t?e&i|e&r|i&r:e^i^r}r(h,n),h.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},h.prototype._update=function(t){for(var e,i=this._w,r=0|this._a,n=0|this._b,s=0|this._c,a=0|this._d,h=0|this._e,d=0;d<16;++d)i[d]=t.readInt32BE(4*d);for(;d<80;++d)i[d]=(e=i[d-3]^i[d-8]^i[d-14]^i[d-16])<<1|e>>>31;for(var f=0;f<80;++f){var p=~~(f/20),m=u(r)+c(p,n,s,a)+h+i[f]+o[p]|0;h=a,a=s,s=l(n),n=r,r=m}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=h+this._e|0},h.prototype._hash=function(){var t=s.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=h},8432:(t,e,i)=>{var r=i(5717),n=i(7499),s=i(4189),o=i(9509).Buffer,a=new Array(64);function h(){this.init(),this._w=a,s.call(this,64,56)}r(h,n),h.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},h.prototype._hash=function(){var t=o.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=h},7499:(t,e,i)=>{var r=i(5717),n=i(4189),s=i(9509).Buffer,o=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=new Array(64);function h(){this.init(),this._w=a,n.call(this,64,56)}function u(t,e,i){return i^t&(e^i)}function l(t,e,i){return t&e|i&(t|e)}function c(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function d(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function f(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}r(h,n),h.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},h.prototype._update=function(t){for(var e,i=this._w,r=0|this._a,n=0|this._b,s=0|this._c,a=0|this._d,h=0|this._e,p=0|this._f,m=0|this._g,g=0|this._h,b=0;b<16;++b)i[b]=t.readInt32BE(4*b);for(;b<64;++b)i[b]=0|(((e=i[b-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+i[b-7]+f(i[b-15])+i[b-16];for(var v=0;v<64;++v){var y=g+d(h)+u(h,p,m)+o[v]+i[v]|0,w=c(r)+l(r,n,s)|0;g=m,m=p,p=h,h=a+y|0,a=s,s=n,n=r,r=y+w|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=h+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},h.prototype._hash=function(){var t=s.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=h},1686:(t,e,i)=>{var r=i(5717),n=i(7816),s=i(4189),o=i(9509).Buffer,a=new Array(160);function h(){this.init(),this._w=a,s.call(this,128,112)}r(h,n),h.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},h.prototype._hash=function(){var t=o.allocUnsafe(48);function e(e,i,r){t.writeInt32BE(e,r),t.writeInt32BE(i,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=h},7816:(t,e,i)=>{var r=i(5717),n=i(4189),s=i(9509).Buffer,o=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function h(){this.init(),this._w=a,n.call(this,128,112)}function u(t,e,i){return i^t&(e^i)}function l(t,e,i){return t&e|i&(t|e)}function c(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function d(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function f(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function m(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function g(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function b(t,e){return t>>>0<e>>>0?1:0}r(h,n),h.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},h.prototype._update=function(t){for(var e=this._w,i=0|this._ah,r=0|this._bh,n=0|this._ch,s=0|this._dh,a=0|this._eh,h=0|this._fh,v=0|this._gh,y=0|this._hh,w=0|this._al,_=0|this._bl,M=0|this._cl,k=0|this._dl,x=0|this._el,E=0|this._fl,S=0|this._gl,T=0|this._hl,A=0;A<32;A+=2)e[A]=t.readInt32BE(4*A),e[A+1]=t.readInt32BE(4*A+4);for(;A<160;A+=2){var I=e[A-30],C=e[A-30+1],B=f(I,C),R=p(C,I),P=m(I=e[A-4],C=e[A-4+1]),L=g(C,I),O=e[A-14],D=e[A-14+1],N=e[A-32],j=e[A-32+1],U=R+D|0,F=B+O+b(U,R)|0;F=(F=F+P+b(U=U+L|0,L)|0)+N+b(U=U+j|0,j)|0,e[A]=F,e[A+1]=U}for(var q=0;q<160;q+=2){F=e[q],U=e[q+1];var z=l(i,r,n),H=l(w,_,M),W=c(i,w),$=c(w,i),Z=d(a,x),V=d(x,a),K=o[q],G=o[q+1],J=u(a,h,v),Y=u(x,E,S),X=T+V|0,Q=y+Z+b(X,T)|0;Q=(Q=(Q=Q+J+b(X=X+Y|0,Y)|0)+K+b(X=X+G|0,G)|0)+F+b(X=X+U|0,U)|0;var tt=$+H|0,et=W+z+b(tt,$)|0;y=v,T=S,v=h,S=E,h=a,E=x,a=s+Q+b(x=k+X|0,k)|0,s=n,k=M,n=r,M=_,r=i,_=w,i=Q+et+b(w=X+tt|0,X)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+M|0,this._dl=this._dl+k|0,this._el=this._el+x|0,this._fl=this._fl+E|0,this._gl=this._gl+S|0,this._hl=this._hl+T|0,this._ah=this._ah+i+b(this._al,w)|0,this._bh=this._bh+r+b(this._bl,_)|0,this._ch=this._ch+n+b(this._cl,M)|0,this._dh=this._dh+s+b(this._dl,k)|0,this._eh=this._eh+a+b(this._el,x)|0,this._fh=this._fh+h+b(this._fl,E)|0,this._gh=this._gh+v+b(this._gl,S)|0,this._hh=this._hh+y+b(this._hl,T)|0},h.prototype._hash=function(){var t=s.allocUnsafe(64);function e(e,i,r){t.writeInt32BE(e,r),t.writeInt32BE(i,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=h},7485:(t,e,i)=>{var r=i(8764).Buffer;t.exports=function(t,e){var i=[];t.on("data",(function(t){i.push(t)})),t.once("end",(function(){e&&e(null,r.concat(i)),e=null})),t.once("error",(function(t){e&&e(t),e=null}))}},6993:(t,e,i)=>{var r=i(8764).Buffer;t.exports=d;const n=i(7485),s=i(1356),o=i(8501),a=i(9267),h=i(778),u=i(7673),l=i(8575),c=t=>null!==t&&"object"==typeof t&&"function"==typeof t.pipe;function d(t,e){if(t=Object.assign({maxRedirects:10},"string"==typeof t?{url:t}:t),e=h(e),t.url){const{hostname:e,port:i,protocol:r,auth:n,path:s}=l.parse(t.url);delete t.url,e||i||r||n?Object.assign(t,{hostname:e,port:i,protocol:r,auth:n,path:s}):t.path=s}const i={"accept-encoding":"gzip, deflate"};let n;t.headers&&Object.keys(t.headers).forEach((e=>i[e.toLowerCase()]=t.headers[e])),t.headers=i,t.body?n=t.json&&!c(t.body)?JSON.stringify(t.body):t.body:t.form&&(n="string"==typeof t.form?t.form:u.stringify(t.form),t.headers["content-type"]="application/x-www-form-urlencoded"),n&&(t.method||(t.method="POST"),c(n)||(t.headers["content-length"]=r.byteLength(n)),t.json&&!t.form&&(t.headers["content-type"]="application/json")),delete t.body,delete t.form,t.json&&(t.headers.accept="application/json"),t.method&&(t.method=t.method.toUpperCase());const f=t.hostname,p=("https:"===t.protocol?a:o).request(t,(i=>{if(!1!==t.followRedirects&&i.statusCode>=300&&i.statusCode<400&&i.headers.location){t.url=i.headers.location,delete t.headers.host,i.resume();const r=l.parse(t.url).hostname;return null!==r&&r!==f&&(delete t.headers.cookie,delete t.headers.authorization),"POST"===t.method&&[301,302].includes(i.statusCode)&&(t.method="GET",delete t.headers["content-length"],delete t.headers["content-type"]),0==t.maxRedirects--?e(new Error("too many redirects")):d(t,e)}const r="function"==typeof s&&"HEAD"!==t.method;e(null,r?s(i):i)}));return p.on("timeout",(()=>{p.abort(),e(new Error("Request timed out"))})),p.on("error",e),c(n)?n.on("error",e).pipe(p):p.end(n),p}d.concat=(t,e)=>d(t,((i,r)=>{if(i)return e(i);n(r,((i,n)=>{if(i)return e(i);if(t.json)try{n=JSON.parse(n.toString())}catch(i){return e(i,r,n)}e(null,r,n)}))})),["get","post","put","patch","head","delete"].forEach((t=>{d[t]=(e,i)=>("string"==typeof e&&(e={url:e}),d(Object.assign({method:t.toUpperCase()},e),i))}))},8853:(t,e,i)=>{var r=i(5108);const n=i(1227)("simple-peer"),s=i(5177),o=i(1798),a=i(8473),h=i(4375),u=i(2114),{Buffer:l}=i(8764),c=65536;function d(t){return t.replace(/a=ice-options:trickle\s\n/g,"")}class f extends a.Duplex{constructor(t){if(super(t=Object.assign({allowHalfOpen:!1},t)),this._id=o(4).toString("hex").slice(0,7),this._debug("new peer %o",t),this.channelName=t.initiator?t.channelName||o(20).toString("hex"):null,this.initiator=t.initiator||!1,this.channelConfig=t.channelConfig||f.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},f.config,t.config),this.offerOptions=t.offerOptions||{},this.answerOptions=t.answerOptions||{},this.sdpTransform=t.sdpTransform||(t=>t),this.streams=t.streams||(t.stream?[t.stream]:[]),this.trickle=void 0===t.trickle||t.trickle,this.allowHalfTrickle=void 0!==t.allowHalfTrickle&&t.allowHalfTrickle,this.iceCompleteTimeout=t.iceCompleteTimeout||5e3,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=t.wrtc&&"object"==typeof t.wrtc?t.wrtc:s(),!this._wrtc)throw"undefined"==typeof window?u(new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"),"ERR_WEBRTC_SUPPORT"):u(new Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(t){return void this.destroy(u(t,"ERR_PC_CONSTRUCTOR"))}this._isReactNativeWebrtc="number"==typeof this._pc._peerConnectionId,this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=t=>{this._onIceCandidate(t)},"object"==typeof this._pc.peerIdentity&&this._pc.peerIdentity.catch((t=>{this.destroy(u(t,"ERR_PC_PEER_IDENTITY"))})),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=t=>{this._setupData(t)},this.streams&&this.streams.forEach((t=>{this.addStream(t)})),this._pc.ontrack=t=>{this._onTrack(t)},this._debug("initial negotiation"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&"open"===this._channel.readyState}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(t){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if("string"==typeof t)try{t=JSON.parse(t)}catch(e){t={}}this._debug("signal()"),t.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),t.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(t.transceiverRequest.kind,t.transceiverRequest.init)),t.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(t.candidate):this._pendingCandidates.push(t.candidate)),t.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(t)).then((()=>{this.destroyed||(this._pendingCandidates.forEach((t=>{this._addIceCandidate(t)})),this._pendingCandidates=[],"offer"===this._pc.remoteDescription.type&&this._createAnswer())})).catch((t=>{this.destroy(u(t,"ERR_SET_REMOTE_DESCRIPTION"))})),t.sdp||t.candidate||t.renegotiate||t.transceiverRequest||this.destroy(u(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(t){const e=new this._wrtc.RTCIceCandidate(t);this._pc.addIceCandidate(e).catch((t=>{!e.address||e.address.endsWith(".local")?("Ignoring unsupported ICE candidate.",r.warn("Ignoring unsupported ICE candidate.")):this.destroy(u(t,"ERR_ADD_ICE_CANDIDATE"))}))}send(t){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(t)}}addTransceiver(t,e){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(t,e),this._needsNegotiation()}catch(t){this.destroy(u(t,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transceiverRequest:{kind:t,init:e}})}}addStream(t){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot addStream after peer is destroyed"),"ERR_DESTROYED");this._debug("addStream()"),t.getTracks().forEach((e=>{this.addTrack(e,t)}))}}addTrack(t,e){if(this.destroying)return;if(this.destroyed)throw u(new Error("cannot addTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("addTrack()");const i=this._senderMap.get(t)||new Map;let r=i.get(e);if(r)throw r.removed?u(new Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED"):u(new Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED");r=this._pc.addTrack(t,e),i.set(e,r),this._senderMap.set(t,i),this._needsNegotiation()}replaceTrack(t,e,i){if(this.destroying)return;if(this.destroyed)throw u(new Error("cannot replaceTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("replaceTrack()");const r=this._senderMap.get(t),n=r?r.get(i):null;if(!n)throw u(new Error("Cannot replace track that was never added."),"ERR_TRACK_NOT_ADDED");e&&this._senderMap.set(e,r),null!=n.replaceTrack?n.replaceTrack(e):this.destroy(u(new Error("replaceTrack is not supported in this browser"),"ERR_UNSUPPORTED_REPLACETRACK"))}removeTrack(t,e){if(this.destroying)return;if(this.destroyed)throw u(new Error("cannot removeTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSender()");const i=this._senderMap.get(t),r=i?i.get(e):null;if(!r)throw u(new Error("Cannot remove track that was never added."),"ERR_TRACK_NOT_ADDED");try{r.removed=!0,this._pc.removeTrack(r)}catch(t){"NS_ERROR_UNEXPECTED"===t.name?this._sendersAwaitingStable.push(r):this.destroy(u(t,"ERR_REMOVE_TRACK"))}this._needsNegotiation()}removeStream(t){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot removeStream after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSenders()"),t.getTracks().forEach((e=>{this.removeTrack(e,t)}))}}_needsNegotiation(){this._debug("_needsNegotiation"),this._batchedNegotiation||(this._batchedNegotiation=!0,h((()=>{this._batchedNegotiation=!1,this.initiator||!this._firstNegotiation?(this._debug("starting batched negotiation"),this.negotiate()):this._debug("non-initiator initial negotiation request discarded"),this._firstNegotiation=!1})))}negotiate(){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot negotiate after peer is destroyed"),"ERR_DESTROYED");this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("start negotiation"),setTimeout((()=>{this._createOffer()}),0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("requesting negotiation from initiator"),this.emit("signal",{type:"renegotiate",renegotiate:!0})),this._isNegotiating=!0}}destroy(t){this._destroy(t,(()=>{}))}_destroy(t,e){this.destroyed||this.destroying||(this.destroying=!0,this._debug("destroying (error: %s)",t&&(t.message||t)),h((()=>{if(this.destroyed=!0,this.destroying=!1,this._debug("destroy (error: %s)",t&&(t.message||t)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener("finish",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch(t){}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch(t){}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,t&&this.emit("error",t),this.emit("close"),e()})))}_setupData(t){if(!t.channel)return this.destroy(u(new Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"));this._channel=t.channel,this._channel.binaryType="arraybuffer","number"==typeof this._channel.bufferedAmountLowThreshold&&(this._channel.bufferedAmountLowThreshold=c),this.channelName=this._channel.label,this._channel.onmessage=t=>{this._onChannelMessage(t)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=t=>{const e=t.error instanceof Error?t.error:new Error(`Datachannel error: ${t.message} ${t.filename}:${t.lineno}:${t.colno}`);this.destroy(u(e,"ERR_DATA_CHANNEL"))};let e=!1;this._closingInterval=setInterval((()=>{this._channel&&"closing"===this._channel.readyState?(e&&this._onChannelClose(),e=!0):e=!1}),5e3)}_read(){}_write(t,e,i){if(this.destroyed)return i(u(new Error("cannot write after peer is destroyed"),"ERR_DATA_CHANNEL"));if(this._connected){try{this.send(t)}catch(t){return this.destroy(u(t,"ERR_DATA_CHANNEL"))}this._channel.bufferedAmount>c?(this._debug("start backpressure: bufferedAmount %d",this._channel.bufferedAmount),this._cb=i):i(null)}else this._debug("write before connect"),this._chunk=t,this._cb=i}_onFinish(){if(this.destroyed)return;const t=()=>{setTimeout((()=>this.destroy()),1e3)};this._connected?t():this.once("connect",t)}_startIceCompleteTimeout(){this.destroyed||this._iceCompleteTimer||(this._debug("started iceComplete timeout"),this._iceCompleteTimer=setTimeout((()=>{this._iceComplete||(this._iceComplete=!0,this._debug("iceComplete timeout completed"),this.emit("iceTimeout"),this.emit("_iceComplete"))}),this.iceCompleteTimeout))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then((t=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(t.sdp=d(t.sdp)),t.sdp=this.sdpTransform(t.sdp);const e=()=>{if(this.destroyed)return;const e=this._pc.localDescription||t;this._debug("signal"),this.emit("signal",{type:e.type,sdp:e.sdp})};this._pc.setLocalDescription(t).then((()=>{this._debug("createOffer success"),this.destroyed||(this.trickle||this._iceComplete?e():this.once("_iceComplete",e))})).catch((t=>{this.destroy(u(t,"ERR_SET_LOCAL_DESCRIPTION"))}))})).catch((t=>{this.destroy(u(t,"ERR_CREATE_OFFER"))}))}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach((t=>{t.mid||!t.sender.track||t.requested||(t.requested=!0,this.addTransceiver(t.sender.track.kind))}))}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then((t=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(t.sdp=d(t.sdp)),t.sdp=this.sdpTransform(t.sdp);const e=()=>{if(this.destroyed)return;const e=this._pc.localDescription||t;this._debug("signal"),this.emit("signal",{type:e.type,sdp:e.sdp}),this.initiator||this._requestMissingTransceivers()};this._pc.setLocalDescription(t).then((()=>{this.destroyed||(this.trickle||this._iceComplete?e():this.once("_iceComplete",e))})).catch((t=>{this.destroy(u(t,"ERR_SET_LOCAL_DESCRIPTION"))}))})).catch((t=>{this.destroy(u(t,"ERR_CREATE_ANSWER"))}))}_onConnectionStateChange(){this.destroyed||"failed"===this._pc.connectionState&&this.destroy(u(new Error("Connection failed."),"ERR_CONNECTION_FAILURE"))}_onIceStateChange(){if(this.destroyed)return;const t=this._pc.iceConnectionState,e=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",t,e),this.emit("iceStateChange",t,e),"connected"!==t&&"completed"!==t||(this._pcReady=!0,this._maybeReady()),"failed"===t&&this.destroy(u(new Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE")),"closed"===t&&this.destroy(u(new Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}getStats(t){const e=t=>("[object Array]"===Object.prototype.toString.call(t.values)&&t.values.forEach((e=>{Object.assign(t,e)})),t);0===this._pc.getStats.length||this._isReactNativeWebrtc?this._pc.getStats().then((i=>{const r=[];i.forEach((t=>{r.push(e(t))})),t(null,r)}),(e=>t(e))):this._pc.getStats.length>0?this._pc.getStats((i=>{if(this.destroyed)return;const r=[];i.result().forEach((t=>{const i={};t.names().forEach((e=>{i[e]=t.stat(e)})),i.id=t.id,i.type=t.type,i.timestamp=t.timestamp,r.push(e(i))})),t(null,r)}),(e=>t(e))):t(null,[])}_maybeReady(){if(this._debug("maybeReady pc %s channel %s",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;const t=()=>{this.destroyed||this.getStats(((e,i)=>{if(this.destroyed)return;e&&(i=[]);const r={},n={},s={};let o=!1;i.forEach((t=>{"remotecandidate"!==t.type&&"remote-candidate"!==t.type||(r[t.id]=t),"localcandidate"!==t.type&&"local-candidate"!==t.type||(n[t.id]=t),"candidatepair"!==t.type&&"candidate-pair"!==t.type||(s[t.id]=t)}));const a=t=>{o=!0;let e=n[t.localCandidateId];e&&(e.ip||e.address)?(this.localAddress=e.ip||e.address,this.localPort=Number(e.port)):e&&e.ipAddress?(this.localAddress=e.ipAddress,this.localPort=Number(e.portNumber)):"string"==typeof t.googLocalAddress&&(e=t.googLocalAddress.split(":"),this.localAddress=e[0],this.localPort=Number(e[1])),this.localAddress&&(this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4");let i=r[t.remoteCandidateId];i&&(i.ip||i.address)?(this.remoteAddress=i.ip||i.address,this.remotePort=Number(i.port)):i&&i.ipAddress?(this.remoteAddress=i.ipAddress,this.remotePort=Number(i.portNumber)):"string"==typeof t.googRemoteAddress&&(i=t.googRemoteAddress.split(":"),this.remoteAddress=i[0],this.remotePort=Number(i[1])),this.remoteAddress&&(this.remoteFamily=this.remoteAddress.includes(":")?"IPv6":"IPv4"),this._debug("connect local: %s:%s remote: %s:%s",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(i.forEach((t=>{"transport"===t.type&&t.selectedCandidatePairId&&a(s[t.selectedCandidatePairId]),("googCandidatePair"===t.type&&"true"===t.googActiveConnection||("candidatepair"===t.type||"candidate-pair"===t.type)&&t.selected)&&a(t)})),o||Object.keys(s).length&&!Object.keys(n).length){if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(e){return this.destroy(u(e,"ERR_DATA_CHANNEL"))}this._chunk=null,this._debug('sent chunk from "write before connect"');const t=this._cb;this._cb=null,t(null)}"number"!=typeof this._channel.bufferedAmountLowThreshold&&(this._interval=setInterval((()=>this._onInterval()),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")}else setTimeout(t,100)}))};t()}_onInterval(){!this._cb||!this._channel||this._channel.bufferedAmount>c||this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||("stable"===this._pc.signalingState&&(this._isNegotiating=!1,this._debug("flushing sender queue",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach((t=>{this._pc.removeTrack(t),this._queuedNegotiation=!0})),this._sendersAwaitingStable=[],this._queuedNegotiation?(this._debug("flushing negotiation queue"),this._queuedNegotiation=!1,this._needsNegotiation()):(this._debug("negotiated"),this.emit("negotiated"))),this._debug("signalingStateChange %s",this._pc.signalingState),this.emit("signalingStateChange",this._pc.signalingState))}_onIceCandidate(t){this.destroyed||(t.candidate&&this.trickle?this.emit("signal",{type:"candidate",candidate:{candidate:t.candidate.candidate,sdpMLineIndex:t.candidate.sdpMLineIndex,sdpMid:t.candidate.sdpMid}}):t.candidate||this._iceComplete||(this._iceComplete=!0,this.emit("_iceComplete")),t.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(t){if(this.destroyed)return;let e=t.data;e instanceof ArrayBuffer&&(e=l.from(e)),this.push(e)}_onChannelBufferedAmountLow(){if(this.destroyed||!this._cb)return;this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);const t=this._cb;this._cb=null,t(null)}_onChannelOpen(){this._connected||this.destroyed||(this._debug("on channel open"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug("on channel close"),this.destroy())}_onTrack(t){this.destroyed||t.streams.forEach((e=>{this._debug("on track"),this.emit("track",t.track,e),this._remoteTracks.push({track:t.track,stream:e}),this._remoteStreams.some((t=>t.id===e.id))||(this._remoteStreams.push(e),h((()=>{this._debug("on stream"),this.emit("stream",e)})))}))}_debug(){const t=[].slice.call(arguments);t[0]="["+this._id+"] "+t[0],n.apply(null,t)}}f.WEBRTC_SUPPORT=!!s(),f.config={iceServers:[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}],sdpSemantics:"unified-plan"},f.channelConfig={},t.exports=f},4159:(t,e,i)=>{const r=i(4029),n=i(4580),s=new r,o="undefined"!=typeof window?window:self,a=o.crypto||o.msCrypto||{};let h=a.subtle||a.webkitSubtle;function u(t){return s.digest(t)}try{h.digest({name:"sha-1"},new Uint8Array).catch((function(){h=!1}))}catch(t){h=!1}t.exports=function(t,e){h?("string"==typeof t&&(t=function(t){const e=t.length,i=new Uint8Array(e);for(let r=0;r<e;r++)i[r]=t.charCodeAt(r);return i}(t)),h.digest({name:"sha-1"},t).then((function(t){e(function(t){const e=t.length,i=[];for(let r=0;r<e;r++){const e=t[r];i.push((e>>>4).toString(16)),i.push((15&e).toString(16))}return i.join("")}(new Uint8Array(t)))}),(function(){e(u(t))}))):"undefined"!=typeof window?n(t,(function(i,r){e(i?u(t):r)})):queueMicrotask((()=>e(u(t))))},t.exports.sync=u},4580:(t,e,i)=>{const r=i(4029);let n,s,o;t.exports=function(t,e){n||(n=r.createWorker(),s=1,o={},n.onmessage=function(t){const e=t.data.id,i=o[e];delete o[e],null!=t.data.error?i(new Error("Rusha worker error: "+t.data.error)):i(null,t.data.hash)}),o[s]=e,n.postMessage({id:s,data:t}),s+=1}},522:(t,e,i)=>{var r=i(8764).Buffer;const n=i(1227)("simple-websocket"),s=i(1798),o=i(8473),a=i(4375),h=i(3719),u="function"!=typeof h?WebSocket:h;class l extends o.Duplex{constructor(t={}){if("string"==typeof t&&(t={url:t}),super(t=Object.assign({allowHalfOpen:!1},t)),null==t.url&&null==t.socket)throw new Error("Missing required `url` or `socket` option");if(null!=t.url&&null!=t.socket)throw new Error("Must specify either `url` or `socket` option, not both");if(this._id=s(4).toString("hex").slice(0,7),this._debug("new websocket: %o",t),this.connected=!1,this.destroyed=!1,this._chunk=null,this._cb=null,this._interval=null,t.socket)this.url=t.socket.url,this._ws=t.socket,this.connected=t.socket.readyState===u.OPEN;else{this.url=t.url;try{this._ws="function"==typeof h?new u(t.url,null,{...t,encoding:void 0}):new u(t.url)}catch(t){return void a((()=>this.destroy(t)))}}this._ws.binaryType="arraybuffer",t.socket&&this.connected?a((()=>this._handleOpen())):this._ws.onopen=()=>this._handleOpen(),this._ws.onmessage=t=>this._handleMessage(t),this._ws.onclose=()=>this._handleClose(),this._ws.onerror=t=>this._handleError(t),this._handleFinishBound=()=>this._handleFinish(),this.once("finish",this._handleFinishBound)}send(t){this._ws.send(t)}destroy(t){this._destroy(t,(()=>{}))}_destroy(t,e){if(!this.destroyed){if(this._debug("destroy (error: %s)",t&&(t.message||t)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this.connected=!1,this.destroyed=!0,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._handleFinishBound&&this.removeListener("finish",this._handleFinishBound),this._handleFinishBound=null,this._ws){const e=this._ws,i=()=>{e.onclose=null};if(e.readyState===u.CLOSED)i();else try{e.onclose=i,e.close()}catch(t){i()}e.onopen=null,e.onmessage=null,e.onerror=()=>{}}this._ws=null,t&&this.emit("error",t),this.emit("close"),e()}}_read(){}_write(t,e,i){if(this.destroyed)return i(new Error("cannot write after socket is destroyed"));if(this.connected){try{this.send(t)}catch(t){return this.destroy(t)}"function"!=typeof h&&this._ws.bufferedAmount>65536?(this._debug("start backpressure: bufferedAmount %d",this._ws.bufferedAmount),this._cb=i):i(null)}else this._debug("write before connect"),this._chunk=t,this._cb=i}_handleOpen(){if(!this.connected&&!this.destroyed){if(this.connected=!0,this._chunk){try{this.send(this._chunk)}catch(t){return this.destroy(t)}this._chunk=null,this._debug('sent chunk from "write before connect"');const t=this._cb;this._cb=null,t(null)}"function"!=typeof h&&(this._interval=setInterval((()=>this._onInterval()),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")}}_handleMessage(t){if(this.destroyed)return;let e=t.data;e instanceof ArrayBuffer&&(e=r.from(e)),this.push(e)}_handleClose(){this.destroyed||(this._debug("on close"),this.destroy())}_handleError(t){this.destroy(new Error(`Error connecting to ${this.url}`))}_handleFinish(){if(this.destroyed)return;const t=()=>{setTimeout((()=>this.destroy()),1e3)};this.connected?t():this.once("connect",t)}_onInterval(){if(!this._cb||!this._ws||this._ws.bufferedAmount>65536)return;this._debug("ending backpressure: bufferedAmount %d",this._ws.bufferedAmount);const t=this._cb;this._cb=null,t(null)}_debug(){const t=[].slice.call(arguments);t[0]="["+this._id+"] "+t[0],n.apply(null,t)}}l.WEBSOCKET_SUPPORT=!!u,t.exports=l},558:(t,e,i)=>{const r=i(7768),n=i(9929);t.exports={Throttle:r,ThrottleGroup:n}},9929:(t,e,i)=>{const{TokenBucket:r}=i(5516),n=i(7768);t.exports=class{constructor(t={}){if("object"!=typeof t)throw new Error("Options must be an object");this.throttles=[],this.setEnabled(t.enabled),this.setRate(t.rate,t.chunksize)}getEnabled(){return this._enabled}getRate(){return this.bucket.tokensPerInterval}getChunksize(){return this.chunksize}setEnabled(t=!0){if("boolean"!=typeof t)throw new Error("Enabled must be a boolean");this._enabled=t;for(const e of this.throttles)e.setEnabled(t)}setRate(t,e=null){if(!Number.isInteger(t)||t<0)throw new Error("Rate must be an integer bigger than zero");if(t=parseInt(t),e&&("number"!=typeof e||e<=0))throw new Error("Chunksize must be bigger than zero");if(e=e||Math.max(parseInt(t/10),1),e=parseInt(e),t>0&&e>t)throw new Error("Chunk size must be smaller than rate");this.bucket||(this.bucket=new r(t,t,"second",null)),this.bucket.bucketSize=t,this.bucket.tokensPerInterval=t,this.chunksize=e}setChunksize(t){if(!Number.isInteger(t)||t<=0)throw new Error("Chunk size must be an integer bigger than zero");const e=this.getRate();if(t=parseInt(t),e>0&&t>e)throw new Error("Chunk size must be smaller than rate");this.chunksize=t}throttle(t={}){if("object"!=typeof t)throw new Error("Options must be an object");return new n({...t,group:this})}destroy(){for(const t of this.throttles)t.destroy();this.throttles=[]}_addThrottle(t){if(!(t instanceof n))throw new Error("Throttle must be an instance of Throttle");this.throttles.push(t)}_removeThrottle(t){const e=this.throttles.indexOf(t);e>-1&&this.throttles.splice(e,1)}}},7768:(t,e,i)=>{const{EventEmitter:r}=i(7187),{Transform:n}=i(1237),{wait:s}=i(5324);t.exports=class extends n{constructor(t={}){if(super(),"object"!=typeof t)throw new Error("Options must be an object");const e=Object.assign({},t);if(e.group&&!(e.group instanceof o))throw new Error("Group must be an instanece of ThrottleGroup");e.group||(e.group=new o(e)),this._setEnabled(e.enabled||e.group.enabled),this._group=e.group,this._emitter=new r,this._destroyed=!1,this._group._addThrottle(this)}getEnabled(){return this._enabled}getGroup(){return this._group}_setEnabled(t=!0){if("boolean"!=typeof t)throw new Error("Enabled must be a boolean");this._enabled=t}setEnabled(t){this._setEnabled(t),this._enabled?this._emitter.emit("enabled"):this._emitter.emit("disabled")}_transform(t,e){this._processChunk(t,e)}async _waitForTokens(t){return new Promise(((e,i)=>{let r=!1;const n=this;function s(t){if(n._emitter.removeListener("disabled",s),n._emitter.removeListener("destroyed",s),!r){if(r=!0,t)return i(t);e()}}this._emitter.once("disabled",s),this._emitter.once("destroyed",s),this._group.bucket.removeTokens(t,s)}))}_areBothEnabled(){return this._enabled&&this._group.getEnabled()}async _processChunk(t,e){if(!this._areBothEnabled())return e(null,t);let i=0,r=this._group.getChunksize(),n=t.slice(i,i+r);for(;n.length>0;){if(this._areBothEnabled())try{for(;0===this._group.getRate()&&!this._destroyed&&this._areBothEnabled();)if(await s(1e3),this._destroyed)return;if(this._areBothEnabled()&&!this._group.bucket.tryRemoveTokens(n.length)&&(await this._waitForTokens(n.length),this._destroyed))return}catch(t){return e(t)}this.push(n),i+=r,r=this._areBothEnabled()?this._group.getChunksize():t.length-i,n=t.slice(i,i+r)}return e()}destroy(...t){this._group._removeThrottle(this),this._destroyed=!0,this._emitter.emit("destroyed"),super.destroy(...t)}};const o=i(9929)},5324:t=>{t.exports={wait:function(t){return new Promise((e=>setTimeout(e,t)))}}},9529:t=>{var e,i=1,r=65535,n=function(){i=i+1&r};t.exports=function(t){e||(e=setInterval(n,250)).unref&&e.unref();var s=4*(t||5),o=[0],a=1,h=i-1&r;return function(t){var e=i-h&r;for(e>s&&(e=s),h=i;e--;)a===s&&(a=0),o[a]=o[0===a?s-1:a-1],a++;t&&(o[a-1]+=t);var n=o[a-1],u=o.length<s?0:o[a===s?0:a];return o.length<4?n:4*(n-u)/o.length}}},2830:(t,e,i)=>{t.exports=n;var r=i(7187).EventEmitter;function n(){r.call(this)}i(5717)(n,r),n.Readable=i(9481),n.Writable=i(4229),n.Duplex=i(6753),n.Transform=i(4605),n.PassThrough=i(2725),n.finished=i(8610),n.pipeline=i(9946),n.Stream=n,n.prototype.pipe=function(t,e){var i=this;function n(e){t.writable&&!1===t.write(e)&&i.pause&&i.pause()}function s(){i.readable&&i.resume&&i.resume()}i.on("data",n),t.on("drain",s),t._isStdio||e&&!1===e.end||(i.on("end",a),i.on("close",h));var o=!1;function a(){o||(o=!0,t.end())}function h(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function u(t){if(l(),0===r.listenerCount(this,"error"))throw t}function l(){i.removeListener("data",n),t.removeListener("drain",s),i.removeListener("end",a),i.removeListener("close",h),i.removeListener("error",u),t.removeListener("error",u),i.removeListener("end",l),i.removeListener("close",l),t.removeListener("close",l)}return i.on("error",u),t.on("error",u),i.on("end",l),i.on("close",l),t.on("close",l),t.emit("pipe",i),t}},8501:(t,e,i)=>{var r=i(1989),n=i(5676),s=i(7529),o=i(584),a=i(8575),h=e;h.request=function(t,e){t="string"==typeof t?a.parse(t):s(t);var n=-1===i.g.location.protocol.search(/^https?:$/)?"http:":"",o=t.protocol||n,h=t.hostname||t.host,u=t.port,l=t.path||"/";h&&-1!==h.indexOf(":")&&(h="["+h+"]"),t.url=(h?o+"//"+h:"")+(u?":"+u:"")+l,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var c=new r(t);return e&&c.on("response",e),c},h.get=function(t,e){var i=h.request(t,e);return i.end(),i},h.ClientRequest=r,h.IncomingMessage=n.IncomingMessage,h.Agent=function(){},h.Agent.defaultMaxSockets=4,h.globalAgent=new h.Agent,h.STATUS_CODES=o,h.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]},8725:(t,e,i)=>{var r;function n(){if(void 0!==r)return r;if(i.g.XMLHttpRequest){r=new i.g.XMLHttpRequest;try{r.open("GET",i.g.XDomainRequest?"/":"https://example.com")}catch(t){r=null}}else r=null;return r}function s(t){var e=n();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch(t){}return!1}function o(t){return"function"==typeof t}e.fetch=o(i.g.fetch)&&o(i.g.ReadableStream),e.writableStream=o(i.g.WritableStream),e.abortController=o(i.g.AbortController),e.arraybuffer=e.fetch||s("arraybuffer"),e.msstream=!e.fetch&&s("ms-stream"),e.mozchunkedarraybuffer=!e.fetch&&s("moz-chunked-arraybuffer"),e.overrideMimeType=e.fetch||!!n()&&o(n().overrideMimeType),r=null},1989:(t,e,i)=>{var r=i(8764).Buffer,n=i(9590),s=i(8725),o=i(5717),a=i(5676),h=i(8473),u=a.IncomingMessage,l=a.readyStates,c=t.exports=function(t){var e,i=this;h.Writable.call(i),i._opts=t,i._body=[],i._headers={},t.auth&&i.setHeader("Authorization","Basic "+r.from(t.auth).toString("base64")),Object.keys(t.headers).forEach((function(e){i.setHeader(e,t.headers[e])}));var n=!0;if("disable-fetch"===t.mode||"requestTimeout"in t&&!s.abortController)n=!1,e=!0;else if("prefer-streaming"===t.mode)e=!1;else if("allow-wrong-content-type"===t.mode)e=!s.overrideMimeType;else{if(t.mode&&"default"!==t.mode&&"prefer-fast"!==t.mode)throw new Error("Invalid value for opts.mode");e=!0}i._mode=function(t,e){return s.fetch&&e?"fetch":s.mozchunkedarraybuffer?"moz-chunked-arraybuffer":s.msstream?"ms-stream":s.arraybuffer&&t?"arraybuffer":"text"}(e,n),i._fetchTimer=null,i._socketTimeout=null,i._socketTimer=null,i.on("finish",(function(){i._onFinish()}))};o(c,h.Writable),c.prototype.setHeader=function(t,e){var i=t.toLowerCase();-1===d.indexOf(i)&&(this._headers[i]={name:t,value:e})},c.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null},c.prototype.removeHeader=function(t){delete this._headers[t.toLowerCase()]},c.prototype._onFinish=function(){var t=this;if(!t._destroyed){var e=t._opts;"timeout"in e&&0!==e.timeout&&t.setTimeout(e.timeout);var r=t._headers,o=null;"GET"!==e.method&&"HEAD"!==e.method&&(o=new Blob(t._body,{type:(r["content-type"]||{}).value||""}));var a=[];if(Object.keys(r).forEach((function(t){var e=r[t].name,i=r[t].value;Array.isArray(i)?i.forEach((function(t){a.push([e,t])})):a.push([e,i])})),"fetch"===t._mode){var h=null;if(s.abortController){var u=new AbortController;h=u.signal,t._fetchAbortController=u,"requestTimeout"in e&&0!==e.requestTimeout&&(t._fetchTimer=i.g.setTimeout((function(){t.emit("requestTimeout"),t._fetchAbortController&&t._fetchAbortController.abort()}),e.requestTimeout))}i.g.fetch(t._opts.url,{method:t._opts.method,headers:a,body:o||void 0,mode:"cors",credentials:e.withCredentials?"include":"same-origin",signal:h}).then((function(e){t._fetchResponse=e,t._resetTimers(!1),t._connect()}),(function(e){t._resetTimers(!0),t._destroyed||t.emit("error",e)}))}else{var c=t._xhr=new i.g.XMLHttpRequest;try{c.open(t._opts.method,t._opts.url,!0)}catch(e){return void n.nextTick((function(){t.emit("error",e)}))}"responseType"in c&&(c.responseType=t._mode),"withCredentials"in c&&(c.withCredentials=!!e.withCredentials),"text"===t._mode&&"overrideMimeType"in c&&c.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in e&&(c.timeout=e.requestTimeout,c.ontimeout=function(){t.emit("requestTimeout")}),a.forEach((function(t){c.setRequestHeader(t[0],t[1])})),t._response=null,c.onreadystatechange=function(){switch(c.readyState){case l.LOADING:case l.DONE:t._onXHRProgress()}},"moz-chunked-arraybuffer"===t._mode&&(c.onprogress=function(){t._onXHRProgress()}),c.onerror=function(){t._destroyed||(t._resetTimers(!0),t.emit("error",new Error("XHR error")))};try{c.send(o)}catch(e){return void n.nextTick((function(){t.emit("error",e)}))}}}},c.prototype._onXHRProgress=function(){var t=this;t._resetTimers(!1),function(t){try{var e=t.status;return null!==e&&0!==e}catch(t){return!1}}(t._xhr)&&!t._destroyed&&(t._response||t._connect(),t._response._onXHRProgress(t._resetTimers.bind(t)))},c.prototype._connect=function(){var t=this;t._destroyed||(t._response=new u(t._xhr,t._fetchResponse,t._mode,t._resetTimers.bind(t)),t._response.on("error",(function(e){t.emit("error",e)})),t.emit("response",t._response))},c.prototype._write=function(t,e,i){this._body.push(t),i()},c.prototype._resetTimers=function(t){var e=this;i.g.clearTimeout(e._socketTimer),e._socketTimer=null,t?(i.g.clearTimeout(e._fetchTimer),e._fetchTimer=null):e._socketTimeout&&(e._socketTimer=i.g.setTimeout((function(){e.emit("timeout")}),e._socketTimeout))},c.prototype.abort=c.prototype.destroy=function(t){var e=this;e._destroyed=!0,e._resetTimers(!0),e._response&&(e._response._destroyed=!0),e._xhr?e._xhr.abort():e._fetchAbortController&&e._fetchAbortController.abort(),t&&e.emit("error",t)},c.prototype.end=function(t,e,i){"function"==typeof t&&(i=t,t=void 0),h.Writable.prototype.end.call(this,t,e,i)},c.prototype.setTimeout=function(t,e){var i=this;e&&i.once("timeout",e),i._socketTimeout=t,i._resetTimers(!1)},c.prototype.flushHeaders=function(){},c.prototype.setNoDelay=function(){},c.prototype.setSocketKeepAlive=function(){};var d=["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","via"]},5676:(t,e,i)=>{var r=i(9590),n=i(8764).Buffer,s=i(8725),o=i(5717),a=i(8473),h=e.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},u=e.IncomingMessage=function(t,e,i,o){var h=this;if(a.Readable.call(h),h._mode=i,h.headers={},h.rawHeaders=[],h.trailers={},h.rawTrailers=[],h.on("end",(function(){r.nextTick((function(){h.emit("close")}))})),"fetch"===i){if(h._fetchResponse=e,h.url=e.url,h.statusCode=e.status,h.statusMessage=e.statusText,e.headers.forEach((function(t,e){h.headers[e.toLowerCase()]=t,h.rawHeaders.push(e,t)})),s.writableStream){var u=new WritableStream({write:function(t){return o(!1),new Promise((function(e,i){h._destroyed?i():h.push(n.from(t))?e():h._resumeFetch=e}))},close:function(){o(!0),h._destroyed||h.push(null)},abort:function(t){o(!0),h._destroyed||h.emit("error",t)}});try{return void e.body.pipeTo(u).catch((function(t){o(!0),h._destroyed||h.emit("error",t)}))}catch(t){}}var l=e.body.getReader();!function t(){l.read().then((function(e){h._destroyed||(o(e.done),e.done?h.push(null):(h.push(n.from(e.value)),t()))})).catch((function(t){o(!0),h._destroyed||h.emit("error",t)}))}()}else if(h._xhr=t,h._pos=0,h.url=t.responseURL,h.statusCode=t.status,h.statusMessage=t.statusText,t.getAllResponseHeaders().split(/\r?\n/).forEach((function(t){var e=t.match(/^([^:]+):\s*(.*)/);if(e){var i=e[1].toLowerCase();"set-cookie"===i?(void 0===h.headers[i]&&(h.headers[i]=[]),h.headers[i].push(e[2])):void 0!==h.headers[i]?h.headers[i]+=", "+e[2]:h.headers[i]=e[2],h.rawHeaders.push(e[1],e[2])}})),h._charset="x-user-defined",!s.overrideMimeType){var c=h.rawHeaders["mime-type"];if(c){var d=c.match(/;\s*charset=([^;])(;|$)/);d&&(h._charset=d[1].toLowerCase())}h._charset||(h._charset="utf-8")}};o(u,a.Readable),u.prototype._read=function(){var t=this._resumeFetch;t&&(this._resumeFetch=null,t())},u.prototype._onXHRProgress=function(t){var e=this,r=e._xhr,s=null;switch(e._mode){case"text":if((s=r.responseText).length>e._pos){var o=s.substr(e._pos);if("x-user-defined"===e._charset){for(var a=n.alloc(o.length),u=0;u<o.length;u++)a[u]=255&o.charCodeAt(u);e.push(a)}else e.push(o,e._charset);e._pos=s.length}break;case"arraybuffer":if(r.readyState!==h.DONE||!r.response)break;s=r.response,e.push(n.from(new Uint8Array(s)));break;case"moz-chunked-arraybuffer":if(s=r.response,r.readyState!==h.LOADING||!s)break;e.push(n.from(new Uint8Array(s)));break;case"ms-stream":if(s=r.response,r.readyState!==h.LOADING)break;var l=new i.g.MSStreamReader;l.onprogress=function(){l.result.byteLength>e._pos&&(e.push(n.from(new Uint8Array(l.result.slice(e._pos)))),e._pos=l.result.byteLength)},l.onload=function(){t(!0),e.push(null)},l.readAsArrayBuffer(s)}e._xhr.readyState===h.DONE&&"ms-stream"!==e._mode&&(t(!0),e.push(null))}},8677:(t,e,i)=>{t.exports=async function(t,e){const i=await r(t,e);return URL.createObjectURL(i)};const r=i(2428)},2428:t=>{t.exports=function(t,e){if(null!=e&&"string"!=typeof e)throw new Error("Invalid mimetype, expected string.");return new Promise(((i,r)=>{const n=[];t.on("data",(t=>n.push(t))).once("end",(()=>{const t=null!=e?new Blob(n,{type:e}):new Blob(n);i(t)})).once("error",r)}))}},5100:(t,e,i)=>{var r=i(8764).Buffer,n=i(778);t.exports=function(t,e,i){i=n(i);var s=r.alloc(e),o=0;t.on("data",(function(t){t.copy(s,o),o+=t.length})).on("end",(function(){i(null,s)})).on("error",i)}},1237:(t,e,i)=>{const{EventEmitter:r}=i(7187),n=new Error("Stream was destroyed"),s=new Error("Premature close"),o=i(3527),a=i(1607),h=33554431,u=1^h,l=8192,c=384^h,d=8<<16,f=32<<16,p=64<<16,m=8454144,g=256<<16,b=33488895,v=65544,y=2105344,w=6|y,_=8470536,M=8404999,k=589831,x=Symbol.asyncIterator||Symbol("asyncIterator");class E{constructor(t,{highWaterMark:e=16384,map:i=null,mapWritable:r,byteLength:n,byteLengthWritable:s}={}){this.stream=t,this.queue=new a,this.highWaterMark=e,this.buffered=0,this.error=null,this.pipeline=null,this.byteLength=s||n||Z,this.map=r||i,this.afterWrite=R.bind(this),this.afterUpdateNextTick=O.bind(this)}get ended(){return 0!=(this.stream._duplexState&f)}push(t){return null!==this.map&&(t=this.map(t)),this.buffered+=this.byteLength(t),this.queue.push(t),this.buffered<this.highWaterMark?(this.stream._duplexState|=d,!0):(this.stream._duplexState|=1572864,!1)}shift(){const t=this.queue.shift(),e=this.stream;return this.buffered-=this.byteLength(t),0===this.buffered&&(e._duplexState&=33030143),t}end(t){"function"==typeof t?this.stream.once("finish",t):null!=t&&this.push(t),this.stream._duplexState=33423359&(this.stream._duplexState|g)}autoBatch(t,e){const i=[],r=this.stream;for(i.push(t);589824==(r._duplexState&k);)i.push(r._writableState.shift());if(0!=(7&r._duplexState))return e(null);r._writev(i,e)}update(){const t=this.stream;for(;(t._duplexState&k)===d;){const e=this.shift();t._duplexState|=327680,t._write(e,this.afterWrite),t._duplexState&=33292287}0==(196608&t._duplexState)&&this.updateNonPrimary()}updateNonPrimary(){const t=this.stream;if((19464199&t._duplexState)===g)return t._duplexState=16777215&(65536|t._duplexState),void t._final(C.bind(this));2!=(6&t._duplexState)?1==(t._duplexState&M)&&(t._duplexState=(t._duplexState|v)&u,t._open(D.bind(this))):0==(t._duplexState&_)&&(t._duplexState|=v,t._destroy(B.bind(this)))}updateNextTick(){0==(this.stream._duplexState&m)&&(this.stream._duplexState|=m,o(this.afterUpdateNextTick))}}class S{constructor(t,{highWaterMark:e=16384,map:i=null,mapReadable:r,byteLength:n,byteLengthReadable:s}={}){this.stream=t,this.queue=new a,this.highWaterMark=e,this.buffered=0,this.error=null,this.pipeline=null,this.byteLength=s||n||Z,this.map=r||i,this.pipeTo=null,this.afterRead=P.bind(this),this.afterUpdateNextTick=L.bind(this)}get ended(){return 0!=(this.stream._duplexState&l)}pipe(t,e){if(null!==this.pipeTo)throw new Error("Can only pipe to one destination");if(this.stream._duplexState|=256,this.pipeTo=t,this.pipeline=new A(this.stream,t,e||null),e&&this.stream.on("error",V),$(t))t._writableState.pipeline=this.pipeline,e&&t.on("error",V),t.on("finish",this.pipeline.finished.bind(this.pipeline));else{const e=this.pipeline.done.bind(this.pipeline,t),i=this.pipeline.done.bind(this.pipeline,t,null);t.on("error",e),t.on("close",i),t.on("finish",this.pipeline.finished.bind(this.pipeline))}t.on("drain",I.bind(this)),this.stream.emit("piping",t),t.emit("pipe",this.stream)}push(t){const e=this.stream;return null===t?(this.highWaterMark=0,e._duplexState=33521647&(512|e._duplexState),!1):(null!==this.map&&(t=this.map(t)),this.buffered+=this.byteLength(t),this.queue.push(t),e._duplexState=33521663&(64|e._duplexState),this.buffered<this.highWaterMark)}shift(){const t=this.queue.shift();return this.buffered-=this.byteLength(t),0===this.buffered&&(this.stream._duplexState&=33550271),t}unshift(t){let e;const i=[];for(;void 0!==(e=this.queue.shift());)i.push(e);this.push(t);for(let t=0;t<i.length;t++)this.queue.push(i[t])}read(){const t=this.stream;if(64==(8263&t._duplexState)){const e=this.shift();return null!==this.pipeTo&&!1===this.pipeTo.write(e)&&(t._duplexState&=c),0!=(1024&t._duplexState)&&t.emit("data",e),e}return null}drain(){const t=this.stream;for(;64==(8263&t._duplexState)&&0!=(384&t._duplexState);){const e=this.shift();null!==this.pipeTo&&!1===this.pipeTo.write(e)&&(t._duplexState&=c),0!=(1024&t._duplexState)&&t.emit("data",e)}}update(){const t=this.stream;for(this.drain();this.buffered<this.highWaterMark&&0==(41487&t._duplexState);)t._duplexState|=32808,t._read(this.afterRead),t._duplexState&=33554399,0==(8&t._duplexState)&&this.drain();2112==(6215&t._duplexState)&&(t._duplexState|=4096,t.emit("readable")),0==(24&t._duplexState)&&this.updateNonPrimary()}updateNonPrimary(){const t=this.stream;512==(583&t._duplexState)&&(t._duplexState=33553919&(t._duplexState|l),t.emit("end"),(t._duplexState&w)===y&&(t._duplexState|=2),null!==this.pipeTo&&this.pipeTo.end()),2!=(6&t._duplexState)?1==(t._duplexState&M)&&(t._duplexState=(t._duplexState|v)&u,t._open(D.bind(this))):0==(t._duplexState&_)&&(t._duplexState|=v,t._destroy(B.bind(this)))}updateNextTick(){0==(16392&this.stream._duplexState)&&(this.stream._duplexState|=16392,o(this.afterUpdateNextTick))}}class T{constructor(t){this.data=null,this.afterTransform=N.bind(t),this.afterFinal=null}}class A{constructor(t,e,i){this.from=t,this.to=e,this.afterPipe=i,this.error=null,this.pipeToFinished=!1}finished(){this.pipeToFinished=!0}done(t,e){e&&(this.error=e),t!==this.to||(this.to=null,null===this.from)?t!==this.from||(this.from=null,null===this.to)?(null!==this.afterPipe&&this.afterPipe(this.error),this.to=this.from=this.afterPipe=null):0==(t._duplexState&l)&&this.to.destroy(this.error||new Error("Readable stream closed before ending")):0!=(this.from._duplexState&l)&&this.pipeToFinished||this.from.destroy(this.error||new Error("Writable stream closed prematurely"))}}function I(){this.stream._duplexState|=256,0==(40&this.stream._duplexState)?this.updateNextTick():this.drain()}function C(t){const e=this.stream;t&&e.destroy(t),0==(6&e._duplexState)&&(e._duplexState|=f,e.emit("finish")),(e._duplexState&w)===y&&(e._duplexState|=2),e._duplexState&=b,this.update()}function B(t){const e=this.stream;t||this.error===n||(t=this.error),t&&e.emit("error",t),e._duplexState|=4,e.emit("close");const i=e._readableState,r=e._writableState;null!==i&&null!==i.pipeline&&i.pipeline.done(e,t),null!==r&&null!==r.pipeline&&r.pipeline.done(e,t)}function R(t){const e=this.stream;t&&e.destroy(t),e._duplexState&=b,1048576==(1638407&e._duplexState)&&(e._duplexState&=32505855,(e._duplexState&p)===p&&e.emit("drain")),0==(262144&e._duplexState)&&this.update()}function P(t){t&&this.stream.destroy(t),this.stream._duplexState&=33554423,0==(32&this.stream._duplexState)&&this.update()}function L(){this.stream._duplexState&=33538039,this.update()}function O(){this.stream._duplexState&=25100287,this.update()}function D(t){const e=this.stream;t&&e.destroy(t),0==(2&e._duplexState)&&(0==(8711&e._duplexState)&&(e._duplexState|=16),0==(18874375&e._duplexState)&&(e._duplexState|=131072),e.emit("open")),e._duplexState&=33488887,null!==e._writableState&&e._writableState.update(),null!==e._readableState&&e._readableState.update()}function N(t,e){null!=e&&this.push(e),this._writableState.afterWrite(t)}class j extends r{constructor(t){super(),this._duplexState=0,this._readableState=null,this._writableState=null,t&&(t.open&&(this._open=t.open),t.destroy&&(this._destroy=t.destroy),t.predestroy&&(this._predestroy=t.predestroy),t.signal&&t.signal.addEventListener("abort",K.bind(this)))}_open(t){t(null)}_destroy(t){t(null)}_predestroy(){}get readable(){return null!==this._readableState||void 0}get writable(){return null!==this._writableState||void 0}get destroyed(){return 0!=(4&this._duplexState)}get destroying(){return 0!=(6&this._duplexState)}destroy(t){0==(6&this._duplexState)&&(t||(t=n),this._duplexState=33423343&(2|this._duplexState),null!==this._readableState&&(this._readableState.error=t,this._readableState.updateNextTick()),null!==this._writableState&&(this._writableState.error=t,this._writableState.updateNextTick()),this._predestroy())}on(t,e){return null!==this._readableState&&("data"===t&&(this._duplexState|=1152,this._readableState.updateNextTick()),"readable"===t&&(this._duplexState|=2048,this._readableState.updateNextTick())),null!==this._writableState&&"drain"===t&&(this._duplexState|=p,this._writableState.updateNextTick()),super.on(t,e)}}class U extends j{constructor(t){super(t),this._duplexState|=2097153,this._readableState=new S(this,t),t&&(t.read&&(this._read=t.read),t.eagerOpen&&this.resume().pause())}_read(t){t(null)}pipe(t,e){return this._readableState.pipe(t,e),this._readableState.updateNextTick(),t}read(){return this._readableState.updateNextTick(),this._readableState.read()}push(t){return this._readableState.updateNextTick(),this._readableState.push(t)}unshift(t){return this._readableState.updateNextTick(),this._readableState.unshift(t)}resume(){return this._duplexState|=128,this._readableState.updateNextTick(),this}pause(){return this._duplexState&=33554303,this}static _fromAsyncIterator(t,e){let i;const r=new U({...e,read(e){t.next().then(n).then(e.bind(null,null)).catch(e)},predestroy(){i=t.return()},destroy(t){if(!i)return t(null);i.then(t.bind(null,null)).catch(t)}});return r;function n(t){t.done?r.push(null):r.push(t.value)}}static from(t,e){if($(i=t)&&i.readable)return t;var i;if(t[x])return this._fromAsyncIterator(t[x](),e);Array.isArray(t)||(t=void 0===t?[]:[t]);let r=0;return new U({...e,read(e){this.push(r===t.length?null:t[r++]),e(null)}})}static isBackpressured(t){return 0!=(8710&t._duplexState)||t._readableState.buffered>=t._readableState.highWaterMark}static isPaused(t){return 0==(128&t._duplexState)}[x](){const t=this;let e=null,i=null,r=null;return this.on("error",(t=>{e=t})),this.on("readable",(function(){null!==i&&s(t.read())})),this.on("close",(function(){null!==i&&s(null)})),{[x](){return this},next:()=>new Promise((function(e,n){i=e,r=n;const o=t.read();null!==o?s(o):0!=(4&t._duplexState)&&s(null)})),return:()=>o(null),throw:t=>o(t)};function s(s){null!==r&&(e?r(e):null===s&&0==(t._duplexState&l)?r(n):i({value:s,done:null===s}),r=i=null)}function o(e){return t.destroy(e),new Promise(((i,r)=>{if(4&t._duplexState)return i({value:void 0,done:!0});t.once("close",(function(){e?r(e):i({value:void 0,done:!0})}))}))}}}class F extends U{constructor(t){super(t),this._duplexState=1,this._writableState=new E(this,t),t&&(t.writev&&(this._writev=t.writev),t.write&&(this._write=t.write),t.final&&(this._final=t.final))}_writev(t,e){e(null)}_write(t,e){this._writableState.autoBatch(t,e)}_final(t){t(null)}write(t){return this._writableState.updateNextTick(),this._writableState.push(t)}end(t){return this._writableState.updateNextTick(),this._writableState.end(t),this}}class q extends F{constructor(t){super(t),this._transformState=new T(this),t&&(t.transform&&(this._transform=t.transform),t.flush&&(this._flush=t.flush))}_write(t,e){this._readableState.buffered>=this._readableState.highWaterMark?this._transformState.data=t:this._transform(t,this._transformState.afterTransform)}_read(t){if(null!==this._transformState.data){const e=this._transformState.data;this._transformState.data=null,t(null),this._transform(e,this._transformState.afterTransform)}else t(null)}_transform(t,e){e(null,t)}_flush(t){t(null)}_final(t){this._transformState.afterFinal=t,this._flush(z.bind(this))}}function z(t,e){const i=this._transformState.afterFinal;if(t)return i(t);null!=e&&this.push(e),this.push(null),i(null)}function H(t,...e){const i=Array.isArray(t)?[...t,...e]:[t,...e],r=i.length&&"function"==typeof i[i.length-1]?i.pop():null;if(i.length<2)throw new Error("Pipeline requires at least 2 streams");let n=i[0],o=null,a=null;for(let t=1;t<i.length;t++)o=i[t],$(n)?n.pipe(o,u):(h(n,!0,t>1,u),n.pipe(o)),n=o;if(r){let t=!1;o.on("finish",(()=>{t=!0})),o.on("error",(t=>{a=a||t})),o.on("close",(()=>r(a||(t?null:s))))}return o;function h(t,e,i,r){t.on("error",r),t.on("close",(function(){return e&&t._readableState&&!t._readableState.ended||i&&t._writableState&&!t._writableState.ended?r(s):void 0}))}function u(t){if(t&&!a){a=t;for(const e of i)e.destroy(t)}}}function W(t){return!!t._readableState||!!t._writableState}function $(t){return"number"==typeof t._duplexState&&W(t)}function Z(t){return function(t){return"object"==typeof t&&null!==t&&"number"==typeof t.byteLength}(t)?t.byteLength:1024}function V(){}function K(){this.destroy(new Error("Stream aborted."))}t.exports={pipeline:H,pipelinePromise:function(...t){return new Promise(((e,i)=>H(...t,(t=>{if(t)return i(t);e()}))))},isStream:W,isStreamx:$,Stream:j,Writable:class extends j{constructor(t){super(t),this._duplexState|=8193,this._writableState=new E(this,t),t&&(t.writev&&(this._writev=t.writev),t.write&&(this._write=t.write),t.final&&(this._final=t.final))}_writev(t,e){e(null)}_write(t,e){this._writableState.autoBatch(t,e)}_final(t){t(null)}static isBackpressured(t){return 0!=(19922950&t._duplexState)}write(t){return this._writableState.updateNextTick(),this._writableState.push(t)}end(t){return this._writableState.updateNextTick(),this._writableState.end(t),this}},Readable:U,Duplex:F,Transform:q,PassThrough:class extends q{}}},2553:(t,e,i)=>{"use strict";var r=i(9509).Buffer,n=r.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(r.isEncoding===n||!n(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=h,this.end=u,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=l,this.end=c,e=3;break;default:return this.write=d,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,i=function(t,e,i){if(128!=(192&e[0]))return t.lastNeed=0,"<22>";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"<22>";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"<22>"}}(this,t);return void 0!==i?i:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function h(t,e){if((t.length-e)%2==0){var i=t.toString("utf16le",e);if(i){var r=i.charCodeAt(i.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,i)}return e}function l(t,e){var i=(t.length-e)%3;return 0===i?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,1===i?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-i))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function d(t){return t.toString(this.encoding)}function f(t){return t&&t.length?this.write(t):""}e.s=s,s.prototype.write=function(t){if(0===t.length)return"";var e,i;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<t.length?e?e+this.text(t,i):this.text(t,i):e||""},s.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"<22>":e},s.prototype.text=function(t,e){var i=function(t,e,i){var r=e.length-1;if(r<i)return 0;var n=o(e[r]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--r<i||-2===n?0:(n=o(e[r]))>=0?(n>0&&(t.lastNeed=n-2),n):--r<i||-2===n?0:(n=o(e[r]))>=0?(n>0&&(2===n?n=0:t.lastNeed=n-3),n):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;var r=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},s.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},5017:(t,e,i)=>{var r=i(883);e.encode=r.encode,e.decode=r.decode},883:(t,e,i)=>{"use strict";var r=i(8764).Buffer,n=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];e.encode=function(t){r.isBuffer(t)||(t=new r(t));for(var e,i,n=0,s=0,o=0,a=0,h=new r(8*(e=t,i=Math.floor(e.length/5),e.length%5==0?i:i+1));n<t.length;){var u=t[n];o>3?(a=(a=u&255>>o)<<(o=(o+5)%8)|(n+1<t.length?t[n+1]:0)>>8-o,n++):(a=u>>8-(o+5)&31,0==(o=(o+5)%8)&&n++),h[s]="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".charCodeAt(a),s++}for(n=s;n<h.length;n++)h[n]=61;return h},e.decode=function(t){var e,i=0,s=0,o=0;r.isBuffer(t)||(t=new r(t));for(var a=new r(Math.ceil(5*t.length/8)),h=0;h<t.length&&61!==t[h];h++){var u=t[h]-48;if(!(u<n.length))throw new Error("Invalid input - it is not base32 encoded string");s=n[u],i<=3?0==(i=(i+5)%8)?(e|=s,a[o]=e,o++,e=0):e|=255&s<<8-i:(e|=255&s>>>(i=(i+5)%8),a[o]=e,o++,e=255&s<<8-i)}return a.slice(0,o)}},2885:(t,e,i)=>{var r=i(8764).Buffer;t.exports=function(t){if(t instanceof Uint8Array){if(0===t.byteOffset&&t.byteLength===t.buffer.byteLength)return t.buffer;if("function"==typeof t.buffer.slice)return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}if(r.isBuffer(t)){for(var e=new Uint8Array(t.length),i=t.length,n=0;n<i;n++)e[n]=t[n];return e.buffer}throw new Error("Argument must be a Buffer")}},3207:(t,e,i)=>{var r=i(9590);const n=i(1227)("torrent-discovery"),s=i(2378),o=i(7187).EventEmitter,a=i(4595),h=i(8735),u=i(2067);t.exports=class extends o{constructor(t){if(super(),!t.peerId)throw new Error("Option `peerId` is required");if(!t.infoHash)throw new Error("Option `infoHash` is required");if(!r.browser&&!t.port)throw new Error("Option `port` is required");this.peerId="string"==typeof t.peerId?t.peerId:t.peerId.toString("hex"),this.infoHash="string"==typeof t.infoHash?t.infoHash.toLowerCase():t.infoHash.toString("hex"),this._port=t.port,this._userAgent=t.userAgent,this.destroyed=!1,this._announce=t.announce||[],this._intervalMs=t.intervalMs||9e5,this._trackerOpts=null,this._dhtAnnouncing=!1,this._dhtTimeout=!1,this._internalDHT=!1,this._onWarning=t=>{this.emit("warning",t)},this._onError=t=>{this.emit("error",t)},this._onDHTPeer=(t,e)=>{e.toString("hex")===this.infoHash&&this.emit("peer",`${t.host}:${t.port}`,"dht")},this._onTrackerPeer=t=>{this.emit("peer",t,"tracker")},this._onTrackerAnnounce=()=>{this.emit("trackerAnnounce")},this._onLSDPeer=(t,e)=>{this.emit("peer",t,"lsd")};const e=(t,e)=>{const i=new s(e);return i.on("warning",this._onWarning),i.on("error",this._onError),i.listen(t),this._internalDHT=!0,i};!1===t.tracker?this.tracker=null:t.tracker&&"object"==typeof t.tracker?(this._trackerOpts=Object.assign({},t.tracker),this.tracker=this._createTracker()):this.tracker=this._createTracker(),!1===t.dht||"function"!=typeof s?this.dht=null:t.dht&&"function"==typeof t.dht.addNode?this.dht=t.dht:t.dht&&"object"==typeof t.dht?this.dht=e(t.dhtPort,t.dht):this.dht=e(t.dhtPort),this.dht&&(this.dht.on("peer",this._onDHTPeer),this._dhtAnnounce()),!1===t.lsd||"function"!=typeof u?this.lsd=null:this.lsd=this._createLSD()}updatePort(t){t!==this._port&&(this._port=t,this.dht&&this._dhtAnnounce(),this.tracker&&(this.tracker.stop(),this.tracker.destroy((()=>{this.tracker=this._createTracker()}))))}complete(t){this.tracker&&this.tracker.complete(t)}destroy(t){if(this.destroyed)return;this.destroyed=!0,clearTimeout(this._dhtTimeout);const e=[];this.tracker&&(this.tracker.stop(),this.tracker.removeListener("warning",this._onWarning),this.tracker.removeListener("error",this._onError),this.tracker.removeListener("peer",this._onTrackerPeer),this.tracker.removeListener("update",this._onTrackerAnnounce),e.push((t=>{this.tracker.destroy(t)}))),this.dht&&this.dht.removeListener("peer",this._onDHTPeer),this._internalDHT&&(this.dht.removeListener("warning",this._onWarning),this.dht.removeListener("error",this._onError),e.push((t=>{this.dht.destroy(t)}))),this.lsd&&(this.lsd.removeListener("warning",this._onWarning),this.lsd.removeListener("error",this._onError),this.lsd.removeListener("peer",this._onLSDPeer),e.push((t=>{this.lsd.destroy(t)}))),a(e,t),this.dht=null,this.tracker=null,this.lsd=null,this._announce=null}_createTracker(){const t=Object.assign({},this._trackerOpts,{infoHash:this.infoHash,announce:this._announce,peerId:this.peerId,port:this._port,userAgent:this._userAgent}),e=new h(t);return e.on("warning",this._onWarning),e.on("error",this._onError),e.on("peer",this._onTrackerPeer),e.on("update",this._onTrackerAnnounce),e.setInterval(this._intervalMs),e.start(),e}_dhtAnnounce(){this._dhtAnnouncing||(n("dht announce"),this._dhtAnnouncing=!0,clearTimeout(this._dhtTimeout),this.dht.announce(this.infoHash,this._port,(t=>{this._dhtAnnouncing=!1,n("dht announce complete"),t&&this.emit("warning",t),this.emit("dhtAnnounce"),this.destroyed||(this._dhtTimeout=setTimeout((()=>{this._dhtAnnounce()}),this._intervalMs+Math.floor(Math.random()*this._intervalMs/5)),this._dhtTimeout.unref&&this._dhtTimeout.unref())})))}_createLSD(){const t=Object.assign({},{infoHash:this.infoHash,peerId:this.peerId,port:this._port}),e=new u(t);return e.on("warning",this._onWarning),e.on("error",this._onError),e.on("peer",this._onLSDPeer),e.start(),e}}},8687:(t,e,i)=>{var r=i(8764).Buffer;const n=16384;class s{constructor(t){this.length=t,this.missing=t,this.sources=null,this._chunks=Math.ceil(t/n),this._remainder=t%n||n,this._buffered=0,this._buffer=null,this._cancellations=null,this._reservations=0,this._flushed=!1}chunkLength(t){return t===this._chunks-1?this._remainder:n}chunkLengthRemaining(t){return this.length-t*n}chunkOffset(t){return t*n}reserve(){return this.init()?this._cancellations.length?this._cancellations.pop():this._reservations<this._chunks?this._reservations++:-1:-1}reserveRemaining(){if(!this.init())return-1;if(this._cancellations.length||this._reservations<this._chunks){let t=this._reservations;for(;this._cancellations.length;)t=Math.min(t,this._cancellations.pop());return this._reservations=this._chunks,t}return-1}cancel(t){this.init()&&this._cancellations.push(t)}cancelRemaining(t){this.init()&&(this._reservations=t)}get(t){return this.init()?this._buffer[t]:null}set(t,e,i){if(!this.init())return!1;const r=e.length,s=Math.ceil(r/n);for(let r=0;r<s;r++)if(!this._buffer[t+r]){const s=r*n,o=e.slice(s,s+n);this._buffered++,this._buffer[t+r]=o,this.missing-=o.length,this.sources.includes(i)||this.sources.push(i)}return this._buffered===this._chunks}flush(){if(!this._buffer||this._chunks!==this._buffered)return null;const t=r.concat(this._buffer,this.length);return this._buffer=null,this._cancellations=null,this.sources=null,this._flushed=!0,t}init(){return!this._flushed&&(this._buffer||(this._buffer=new Array(this._chunks),this._cancellations=[],this.sources=[]),!0)}}Object.defineProperty(s,"BLOCK_LENGTH",{value:n}),t.exports=s},5054:(t,e,i)=>{var r=i(8764).Buffer,n=i(4501).strict;t.exports=function(t){if(n(t)){var e=r.from(t.buffer);return t.byteLength!==t.buffer.byteLength&&(e=e.slice(t.byteOffset,t.byteOffset+t.byteLength)),e}return r.from(t)}},4372:(t,e,i)=>{var r=i(2822),n=Math.pow(2,32);e.encodingLength=function(){return 8},e.encode=function(t,e,i){e||(e=r(8)),i||(i=0);var s=Math.floor(t/n),o=t-s*n;return e.writeUInt32BE(s,i),e.writeUInt32BE(o,i+4),e},e.decode=function(t,e){e||(e=0);var i=t.readUInt32BE(e),r=t.readUInt32BE(e+4);return i*n+r},e.encode.bytes=8,e.decode.bytes=8},6581:t=>{t.exports=function(t,e){if(!(e>=t.length||e<0)){var i=t.pop();if(e<t.length){var r=t[e];return t[e]=i,r}return i}}},2511:function(t,e,i){var r;t=i.nmd(t),function(n){e&&e.nodeType,t&&t.nodeType;var s="object"==typeof i.g&&i.g;s.global!==s&&s.window!==s&&s.self;var o,a=2147483647,h=36,u=/^xn--/,l=/[^\x20-\x7E]/,c=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,p=String.fromCharCode;function m(t){throw RangeError(d[t])}function g(t,e){for(var i=t.length,r=[];i--;)r[i]=e(t[i]);return r}function b(t,e){var i=t.split("@"),r="";return i.length>1&&(r=i[0]+"@",t=i[1]),r+g((t=t.replace(c,".")).split("."),e).join(".")}function v(t){for(var e,i,r=[],n=0,s=t.length;n<s;)(e=t.charCodeAt(n++))>=55296&&e<=56319&&n<s?56320==(64512&(i=t.charCodeAt(n++)))?r.push(((1023&e)<<10)+(1023&i)+65536):(r.push(e),n--):r.push(e);return r}function y(t){return g(t,(function(t){var e="";return t>65535&&(e+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+p(t)})).join("")}function w(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function _(t,e,i){var r=0;for(t=i?f(t/700):t>>1,t+=f(t/e);t>455;r+=h)t=f(t/35);return f(r+36*t/(t+38))}function M(t){var e,i,r,n,s,o,u,l,c,d,p,g=[],b=t.length,v=0,w=128,M=72;for((i=t.lastIndexOf("-"))<0&&(i=0),r=0;r<i;++r)t.charCodeAt(r)>=128&&m("not-basic"),g.push(t.charCodeAt(r));for(n=i>0?i+1:0;n<b;){for(s=v,o=1,u=h;n>=b&&m("invalid-input"),((l=(p=t.charCodeAt(n++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:h)>=h||l>f((a-v)/o))&&m("overflow"),v+=l*o,!(l<(c=u<=M?1:u>=M+26?26:u-M));u+=h)o>f(a/(d=h-c))&&m("overflow"),o*=d;M=_(v-s,e=g.length+1,0==s),f(v/e)>a-w&&m("overflow"),w+=f(v/e),v%=e,g.splice(v++,0,w)}return y(g)}function k(t){var e,i,r,n,s,o,u,l,c,d,g,b,y,M,k,x=[];for(b=(t=v(t)).length,e=128,i=0,s=72,o=0;o<b;++o)(g=t[o])<128&&x.push(p(g));for(r=n=x.length,n&&x.push("-");r<b;){for(u=a,o=0;o<b;++o)(g=t[o])>=e&&g<u&&(u=g);for(u-e>f((a-i)/(y=r+1))&&m("overflow"),i+=(u-e)*y,e=u,o=0;o<b;++o)if((g=t[o])<e&&++i>a&&m("overflow"),g==e){for(l=i,c=h;!(l<(d=c<=s?1:c>=s+26?26:c-s));c+=h)k=l-d,M=h-d,x.push(p(w(d+k%M,0))),l=f(k/M);x.push(p(w(l,0))),s=_(i,y,r==n),i=0,++r}++i,++e}return x.join("")}o={version:"1.3.2",ucs2:{decode:v,encode:y},decode:M,encode:k,toASCII:function(t){return b(t,(function(t){return l.test(t)?"xn--"+k(t):t}))},toUnicode:function(t){return b(t,(function(t){return u.test(t)?M(t.slice(4).toLowerCase()):t}))}},void 0===(r=function(){return o}.call(e,i,e,t))||(t.exports=r)}()},8575:(t,e,i)=>{"use strict";var r=i(2511),n=i(2502);function s(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}e.parse=y,e.resolve=function(t,e){return y(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?y(t,!1,!0).resolveObject(e):e},e.format=function(t){return n.isString(t)&&(t=y(t)),t instanceof s?t.format():s.prototype.format.call(t)},e.Url=s;var o=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,h=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(u),c=["%","/","?",";","#"].concat(l),d=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=i(7673);function y(t,e,i){if(t&&n.isObject(t)&&t instanceof s)return t;var r=new s;return r.parse(t,e,i),r}s.prototype.parse=function(t,e,i){if(!n.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var s=t.indexOf("?"),a=-1!==s&&s<t.indexOf("#")?"?":"#",u=t.split(a);u[0]=u[0].replace(/\\/g,"/");var y=t=u.join(a);if(y=y.trim(),!i&&1===t.split("#").length){var w=h.exec(y);if(w)return this.path=y,this.href=y,this.pathname=w[1],w[2]?(this.search=w[2],this.query=e?v.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var _=o.exec(y);if(_){var M=(_=_[0]).toLowerCase();this.protocol=M,y=y.substr(_.length)}if(i||_||y.match(/^\/\/[^@\/]+@[^@\/]+/)){var k="//"===y.substr(0,2);!k||_&&g[_]||(y=y.substr(2),this.slashes=!0)}if(!g[_]&&(k||_&&!b[_])){for(var x,E,S=-1,T=0;T<d.length;T++)-1!==(A=y.indexOf(d[T]))&&(-1===S||A<S)&&(S=A);for(-1!==(E=-1===S?y.lastIndexOf("@"):y.lastIndexOf("@",S))&&(x=y.slice(0,E),y=y.slice(E+1),this.auth=decodeURIComponent(x)),S=-1,T=0;T<c.length;T++){var A;-1!==(A=y.indexOf(c[T]))&&(-1===S||A<S)&&(S=A)}-1===S&&(S=y.length),this.host=y.slice(0,S),y=y.slice(S),this.parseHost(),this.hostname=this.hostname||"";var I="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!I)for(var C=this.hostname.split(/\./),B=(T=0,C.length);T<B;T++){var R=C[T];if(R&&!R.match(f)){for(var P="",L=0,O=R.length;L<O;L++)R.charCodeAt(L)>127?P+="x":P+=R[L];if(!P.match(f)){var D=C.slice(0,T),N=C.slice(T+1),j=R.match(p);j&&(D.push(j[1]),N.unshift(j[2])),N.length&&(y="/"+N.join(".")+y),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),I||(this.hostname=r.toASCII(this.hostname));var U=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+U,this.href+=this.host,I&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!m[M])for(T=0,B=l.length;T<B;T++){var q=l[T];if(-1!==y.indexOf(q)){var z=encodeURIComponent(q);z===q&&(z=escape(q)),y=y.split(q).join(z)}}var H=y.indexOf("#");-1!==H&&(this.hash=y.substr(H),y=y.slice(0,H));var W=y.indexOf("?");if(-1!==W?(this.search=y.substr(W),this.query=y.substr(W+1),e&&(this.query=v.parse(this.query)),y=y.slice(0,W)):e&&(this.search="",this.query={}),y&&(this.pathname=y),b[M]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){U=this.pathname||"";var $=this.search||"";this.path=U+$}return this.href=this.format(),this},s.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",i=this.pathname||"",r=this.hash||"",s=!1,o="";this.host?s=t+this.host:this.hostname&&(s=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(s+=":"+this.port)),this.query&&n.isObject(this.query)&&Object.keys(this.query).length&&(o=v.stringify(this.query));var a=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||b[e])&&!1!==s?(s="//"+(s||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):s||(s=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),e+s+(i=i.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(a=a.replace("#","%23"))+r},s.prototype.resolve=function(t){return this.resolveObject(y(t,!1,!0)).format()},s.prototype.resolveObject=function(t){if(n.isString(t)){var e=new s;e.parse(t,!1,!0),t=e}for(var i=new s,r=Object.keys(this),o=0;o<r.length;o++){var a=r[o];i[a]=this[a]}if(i.hash=t.hash,""===t.href)return i.href=i.format(),i;if(t.slashes&&!t.protocol){for(var h=Object.keys(t),u=0;u<h.length;u++){var l=h[u];"protocol"!==l&&(i[l]=t[l])}return b[i.protocol]&&i.hostname&&!i.pathname&&(i.path=i.pathname="/"),i.href=i.format(),i}if(t.protocol&&t.protocol!==i.protocol){if(!b[t.protocol]){for(var c=Object.keys(t),d=0;d<c.length;d++){var f=c[d];i[f]=t[f]}return i.href=i.format(),i}if(i.protocol=t.protocol,t.host||g[t.protocol])i.pathname=t.pathname;else{for(var p=(t.pathname||"").split("/");p.length&&!(t.host=p.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),i.pathname=p.join("/")}if(i.search=t.search,i.query=t.query,i.host=t.host||"",i.auth=t.auth,i.hostname=t.hostname||t.host,i.port=t.port,i.pathname||i.search){var m=i.pathname||"",v=i.search||"";i.path=m+v}return i.slashes=i.slashes||t.slashes,i.href=i.format(),i}var y=i.pathname&&"/"===i.pathname.charAt(0),w=t.host||t.pathname&&"/"===t.pathname.charAt(0),_=w||y||i.host&&t.pathname,M=_,k=i.pathname&&i.pathname.split("/")||[],x=(p=t.pathname&&t.pathname.split("/")||[],i.protocol&&!b[i.protocol]);if(x&&(i.hostname="",i.port=null,i.host&&(""===k[0]?k[0]=i.host:k.unshift(i.host)),i.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===p[0]?p[0]=t.host:p.unshift(t.host)),t.host=null),_=_&&(""===p[0]||""===k[0])),w)i.host=t.host||""===t.host?t.host:i.host,i.hostname=t.hostname||""===t.hostname?t.hostname:i.hostname,i.search=t.search,i.query=t.query,k=p;else if(p.length)k||(k=[]),k.pop(),k=k.concat(p),i.search=t.search,i.query=t.query;else if(!n.isNullOrUndefined(t.search))return x&&(i.hostname=i.host=k.shift(),(I=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=I.shift(),i.host=i.hostname=I.shift())),i.search=t.search,i.query=t.query,n.isNull(i.pathname)&&n.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i;if(!k.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var E=k.slice(-1)[0],S=(i.host||t.host||k.length>1)&&("."===E||".."===E)||""===E,T=0,A=k.length;A>=0;A--)"."===(E=k[A])?k.splice(A,1):".."===E?(k.splice(A,1),T++):T&&(k.splice(A,1),T--);if(!_&&!M)for(;T--;T)k.unshift("..");!_||""===k[0]||k[0]&&"/"===k[0].charAt(0)||k.unshift(""),S&&"/"!==k.join("/").substr(-1)&&k.push("");var I,C=""===k[0]||k[0]&&"/"===k[0].charAt(0);return x&&(i.hostname=i.host=C?"":k.length?k.shift():"",(I=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=I.shift(),i.host=i.hostname=I.shift())),(_=_||i.host&&k.length)&&!C&&k.unshift(""),k.length?i.pathname=k.join("/"):(i.pathname=null,i.path=null),n.isNull(i.pathname)&&n.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},s.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},2502:t=>{"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},2219:(t,e,i)=>{var r=i(8764).Buffer;const{EventEmitter:n}=i(7187),s=i(5799),o=i(8833).default,a=i(1227)("ut_metadata"),h=i(4159),u=16384;t.exports=t=>{class e extends n{constructor(e){super(),this._wire=e,this._fetching=!1,this._metadataComplete=!1,this._metadataSize=null,this._remainingRejects=null,this._bitfield=new o(0,{grow:1e3}),r.isBuffer(t)&&this.setMetadata(t)}onHandshake(t,e,i){this._infoHash=t}onExtendedHandshake(t){return t.m&&t.m.ut_metadata?t.metadata_size?"number"!=typeof t.metadata_size||1e7<t.metadata_size||t.metadata_size<=0?this.emit("warning",new Error("Peer gave invalid metadata size")):(this._metadataSize=t.metadata_size,this._numPieces=Math.ceil(this._metadataSize/u),this._remainingRejects=2*this._numPieces,void this._requestPieces()):this.emit("warning",new Error("Peer does not have metadata")):this.emit("warning",new Error("Peer does not support ut_metadata"))}onMessage(t){let e,i;try{const r=t.toString(),n=r.indexOf("ee")+2;e=s.decode(r.substring(0,n)),i=t.slice(n)}catch(t){return}switch(e.msg_type){case 0:this._onRequest(e.piece);break;case 1:this._onData(e.piece,i,e.total_size);break;case 2:this._onReject(e.piece)}}fetch(){this._metadataComplete||(this._fetching=!0,this._metadataSize&&this._requestPieces())}cancel(){this._fetching=!1}setMetadata(t){if(this._metadataComplete)return!0;a("set metadata");try{const e=s.decode(t).info;e&&(t=s.encode(e))}catch(t){}return!(this._infoHash&&this._infoHash!==h.sync(t)||(this.cancel(),this.metadata=t,this._metadataComplete=!0,this._metadataSize=this.metadata.length,this._wire.extendedHandshake.metadata_size=this._metadataSize,this.emit("metadata",s.encode({info:s.decode(this.metadata)})),0))}_send(t,e){let i=s.encode(t);r.isBuffer(e)&&(i=r.concat([i,e])),this._wire.extended("ut_metadata",i)}_request(t){this._send({msg_type:0,piece:t})}_data(t,e,i){const r={msg_type:1,piece:t};"number"==typeof i&&(r.total_size=i),this._send(r,e)}_reject(t){this._send({msg_type:2,piece:t})}_onRequest(t){if(!this._metadataComplete)return void this._reject(t);const e=t*u;let i=e+u;i>this._metadataSize&&(i=this._metadataSize);const r=this.metadata.slice(e,i);this._data(t,r,this._metadataSize)}_onData(t,e,i){e.length>u||!this._fetching||(e.copy(this.metadata,t*u),this._bitfield.set(t),this._checkDone())}_onReject(t){this._remainingRejects>0&&this._fetching?(this._request(t),this._remainingRejects-=1):this.emit("warning",new Error('Peer sent "reject" too much'))}_requestPieces(){if(this._fetching){this.metadata=r.alloc(this._metadataSize);for(let t=0;t<this._numPieces;t++)this._request(t)}}_checkDone(){let t=!0;for(let e=0;e<this._numPieces;e++)if(!this._bitfield.get(e)){t=!1;break}t&&(this.setMetadata(this.metadata)||this._failedMetadata())}_failedMetadata(){this._bitfield=new o(0,{grow:1e3}),this._remainingRejects-=this._numPieces,this._remainingRejects>0?this._requestPieces():this.emit("warning",new Error("Peer sent invalid metadata"))}}return e.prototype.name="ut_metadata",e}},4927:(t,e,i)=>{var r=i(5108);function n(t){try{if(!i.g.localStorage)return!1}catch(t){return!1}var e=i.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var i=!1;return function(){if(!i){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?r.trace(e):r.warn(e),i=!0}return t.apply(this,arguments)}}},384:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},5955:(t,e,i)=>{"use strict";var r=i(2584),n=i(8662),s=i(6430),o=i(5692);function a(t){return t.call.bind(t)}var h="undefined"!=typeof BigInt,u="undefined"!=typeof Symbol,l=a(Object.prototype.toString),c=a(Number.prototype.valueOf),d=a(String.prototype.valueOf),f=a(Boolean.prototype.valueOf);if(h)var p=a(BigInt.prototype.valueOf);if(u)var m=a(Symbol.prototype.valueOf);function g(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function b(t){return"[object Map]"===l(t)}function v(t){return"[object Set]"===l(t)}function y(t){return"[object WeakMap]"===l(t)}function w(t){return"[object WeakSet]"===l(t)}function _(t){return"[object ArrayBuffer]"===l(t)}function M(t){return"undefined"!=typeof ArrayBuffer&&(_.working?_(t):t instanceof ArrayBuffer)}function k(t){return"[object DataView]"===l(t)}function x(t){return"undefined"!=typeof DataView&&(k.working?k(t):t instanceof DataView)}e.isArgumentsObject=r,e.isGeneratorFunction=n,e.isTypedArray=o,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):o(t)||x(t)},e.isUint8Array=function(t){return"Uint8Array"===s(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===s(t)},e.isUint16Array=function(t){return"Uint16Array"===s(t)},e.isUint32Array=function(t){return"Uint32Array"===s(t)},e.isInt8Array=function(t){return"Int8Array"===s(t)},e.isInt16Array=function(t){return"Int16Array"===s(t)},e.isInt32Array=function(t){return"Int32Array"===s(t)},e.isFloat32Array=function(t){return"Float32Array"===s(t)},e.isFloat64Array=function(t){return"Float64Array"===s(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===s(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===s(t)},b.working="undefined"!=typeof Map&&b(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(b.working?b(t):t instanceof Map)},v.working="undefined"!=typeof Set&&v(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(v.working?v(t):t instanceof Set)},y.working="undefined"!=typeof WeakMap&&y(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(y.working?y(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},_.working="undefined"!=typeof ArrayBuffer&&_(new ArrayBuffer),e.isArrayBuffer=M,k.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&k(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=x;var E="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function S(t){return"[object SharedArrayBuffer]"===l(t)}function T(t){return void 0!==E&&(void 0===S.working&&(S.working=S(new E)),S.working?S(t):t instanceof E)}function A(t){return g(t,c)}function I(t){return g(t,d)}function C(t){return g(t,f)}function B(t){return h&&g(t,p)}function R(t){return u&&g(t,m)}e.isSharedArrayBuffer=T,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===l(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===l(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===l(t)},e.isGeneratorObject=function(t){return"[object Generator]"===l(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===l(t)},e.isNumberObject=A,e.isStringObject=I,e.isBooleanObject=C,e.isBigIntObject=B,e.isSymbolObject=R,e.isBoxedPrimitive=function(t){return A(t)||I(t)||C(t)||B(t)||R(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(M(t)||T(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},9539:(t,e,i)=>{var r=i(9590),n=i(5108),s=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),i={},r=0;r<e.length;r++)i[e[r]]=Object.getOwnPropertyDescriptor(t,e[r]);return i},o=/%[sdj%]/g;e.format=function(t){if(!w(t)){for(var e=[],i=0;i<arguments.length;i++)e.push(l(arguments[i]));return e.join(" ")}i=1;for(var r=arguments,n=r.length,s=String(t).replace(o,(function(t){if("%%"===t)return"%";if(i>=n)return t;switch(t){case"%s":return String(r[i++]);case"%d":return Number(r[i++]);case"%j":try{return JSON.stringify(r[i++])}catch(t){return"[Circular]"}default:return t}})),a=r[i];i<n;a=r[++i])v(a)||!k(a)?s+=" "+a:s+=" "+l(a);return s},e.deprecate=function(t,i){if(void 0!==r&&!0===r.noDeprecation)return t;if(void 0===r)return function(){return e.deprecate(t,i).apply(this,arguments)};var s=!1;return function(){if(!s){if(r.throwDeprecation)throw new Error(i);r.traceDeprecation?n.trace(i):n.error(i),s=!0}return t.apply(this,arguments)}};var a={},h=/^$/;if(r.env.NODE_DEBUG){var u=r.env.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),h=new RegExp("^"+u+"$","i")}function l(t,i){var r={seen:[],stylize:d};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),b(i)?r.showHidden=i:i&&e._extend(r,i),_(r.showHidden)&&(r.showHidden=!1),_(r.depth)&&(r.depth=2),_(r.colors)&&(r.colors=!1),_(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=c),f(r,t,r.depth)}function c(t,e){var i=l.styles[e];return i?"["+l.colors[i][0]+"m"+t+"["+l.colors[i][1]+"m":t}function d(t,e){return t}function f(t,i,r){if(t.customInspect&&i&&S(i.inspect)&&i.inspect!==e.inspect&&(!i.constructor||i.constructor.prototype!==i)){var n=i.inspect(r,t);return w(n)||(n=f(t,n,r)),n}var s=function(t,e){if(_(e))return t.stylize("undefined","undefined");if(w(e)){var i="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(i,"string")}return y(e)?t.stylize(""+e,"number"):b(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}(t,i);if(s)return s;var o=Object.keys(i),a=function(t){var e={};return t.forEach((function(t,i){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(i)),E(i)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return p(i);if(0===o.length){if(S(i)){var h=i.name?": "+i.name:"";return t.stylize("[Function"+h+"]","special")}if(M(i))return t.stylize(RegExp.prototype.toString.call(i),"regexp");if(x(i))return t.stylize(Date.prototype.toString.call(i),"date");if(E(i))return p(i)}var u,l="",c=!1,d=["{","}"];return g(i)&&(c=!0,d=["[","]"]),S(i)&&(l=" [Function"+(i.name?": "+i.name:"")+"]"),M(i)&&(l=" "+RegExp.prototype.toString.call(i)),x(i)&&(l=" "+Date.prototype.toUTCString.call(i)),E(i)&&(l=" "+p(i)),0!==o.length||c&&0!=i.length?r<0?M(i)?t.stylize(RegExp.prototype.toString.call(i),"regexp"):t.stylize("[Object]","special"):(t.seen.push(i),u=c?function(t,e,i,r,n){for(var s=[],o=0,a=e.length;o<a;++o)B(e,String(o))?s.push(m(t,e,i,r,String(o),!0)):s.push("");return n.forEach((function(n){n.match(/^\d+$/)||s.push(m(t,e,i,r,n,!0))})),s}(t,i,r,a,o):o.map((function(e){return m(t,i,r,a,e,c)})),t.seen.pop(),function(t,e,i){return t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?i[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+i[1]:i[0]+e+" "+t.join(", ")+" "+i[1]}(u,l,d)):d[0]+l+d[1]}function p(t){return"["+Error.prototype.toString.call(t)+"]"}function m(t,e,i,r,n,s){var o,a,h;if((h=Object.getOwnPropertyDescriptor(e,n)||{value:e[n]}).get?a=h.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):h.set&&(a=t.stylize("[Setter]","special")),B(r,n)||(o="["+n+"]"),a||(t.seen.indexOf(h.value)<0?(a=v(i)?f(t,h.value,null):f(t,h.value,i-1)).indexOf("\n")>-1&&(a=s?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),_(o)){if(s&&n.match(/^\d+$/))return a;(o=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+a}function g(t){return Array.isArray(t)}function b(t){return"boolean"==typeof t}function v(t){return null===t}function y(t){return"number"==typeof t}function w(t){return"string"==typeof t}function _(t){return void 0===t}function M(t){return k(t)&&"[object RegExp]"===T(t)}function k(t){return"object"==typeof t&&null!==t}function x(t){return k(t)&&"[object Date]"===T(t)}function E(t){return k(t)&&("[object Error]"===T(t)||t instanceof Error)}function S(t){return"function"==typeof t}function T(t){return Object.prototype.toString.call(t)}function A(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!a[t])if(h.test(t)){var i=r.pid;a[t]=function(){var r=e.format.apply(e,arguments);n.error("%s %d: %s",t,i,r)}}else a[t]=function(){};return a[t]},e.inspect=l,l.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]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=i(5955),e.isArray=g,e.isBoolean=b,e.isNull=v,e.isNullOrUndefined=function(t){return null==t},e.isNumber=y,e.isString=w,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=_,e.isRegExp=M,e.types.isRegExp=M,e.isObject=k,e.isDate=x,e.types.isDate=x,e.isError=E,e.types.isNativeError=E,e.isFunction=S,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=i(384);var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function C(){var t=new Date,e=[A(t.getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":");return[t.getDate(),I[t.getMonth()],e].join(" ")}function B(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){n.log("%s - %s",C(),e.format.apply(e,arguments))},e.inherits=i(5717),e._extend=function(t,e){if(!e||!k(e))return t;for(var i=Object.keys(e),r=i.length;r--;)t[i[r]]=e[i[r]];return t};var R="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(t,e){if(!t){var i=new Error("Promise was rejected with a falsy value");i.reason=t,t=i}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(R&&t[R]){var e;if("function"!=typeof(e=t[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,R,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,i,r=new Promise((function(t,r){e=t,i=r})),n=[],s=0;s<arguments.length;s++)n.push(arguments[s]);n.push((function(t,r){t?i(t):e(r)}));try{t.apply(this,n)}catch(t){i(t)}return r}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),R&&Object.defineProperty(e,R,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,s(t))},e.promisify.custom=R,e.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function e(){for(var e=[],i=0;i<arguments.length;i++)e.push(arguments[i]);var n=e.pop();if("function"!=typeof n)throw new TypeError("The last argument must be of type Function");var s=this,o=function(){return n.apply(s,arguments)};t.apply(this,e).then((function(t){r.nextTick(o.bind(null,null,t))}),(function(t){r.nextTick(P.bind(null,t,o))}))}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,s(t)),e}},9872:(t,e,i)=>{var r=i(8764).Buffer;const n=i(7513),s=i(7187),o=i(2853),a=i(2068),h=i(7856);class u{constructor(t,e){this._entries=t,this._countName=e||"count",this._index=0,this._offset=0,this.value=this._entries[0]}inc(){this._offset++,this._offset>=this._entries[this._index][this._countName]&&(this._index++,this._offset=0),this.value=this._entries[this._index]}}t.exports=class extends s{constructor(t){super(),this._tracks=[],this._file=t,this._decoder=null,this._findMoov(0)}_findMoov(t){this._decoder&&this._decoder.destroy();let e=0;this._decoder=o.decode();const i=this._file.createReadStream({start:t});i.pipe(this._decoder);const r=n=>{"moov"===n.type?(this._decoder.removeListener("box",r),this._decoder.decode((t=>{i.destroy();try{this._processMoov(t)}catch(t){t.message=`Cannot parse mp4 file: ${t.message}`,this.emit("error",t)}}))):n.length<4096?(e+=n.length,this._decoder.ignore()):(this._decoder.removeListener("box",r),e+=n.length,i.destroy(),this._decoder.destroy(),this._findMoov(t+e))};this._decoder.on("box",r)}_processMoov(t){const e=t.traks;this._tracks=[],this._hasVideo=!1,this._hasAudio=!1;for(let r=0;r<e.length;r++){const n=e[r],s=n.mdia.minf.stbl,o=s.stsd.entries[0],a=n.mdia.hdlr.handlerType;let h,l;if("vide"===a&&"avc1"===o.type){if(this._hasVideo)continue;this._hasVideo=!0,h="avc1",o.avcC&&(h+=`.${o.avcC.mimeCodec}`),l=`video/mp4; codecs="${h}"`}else{if("soun"!==a||"mp4a"!==o.type)continue;if(this._hasAudio)continue;this._hasAudio=!0,h="mp4a",o.esds&&o.esds.mimeCodec&&(h+=`.${o.esds.mimeCodec}`),l=`audio/mp4; codecs="${h}"`}const c=[];let d=0,f=0,p=0,m=0,g=0,b=0;const v=new u(s.stts.entries);let y=null;s.ctts&&(y=new u(s.ctts.entries));let w=0;for(;;){var i=s.stsc.entries[g];const t=s.stsz.entries[d],e=v.value.duration,r=y?y.value.compositionOffset:0;let n=!0;s.stss&&(n=s.stss.entries[w]===d+1);const o=s.stco||s.co64;if(c.push({size:t,duration:e,dts:b,presentationOffset:r,sync:n,offset:m+o.entries[p]}),d++,d>=s.stsz.entries.length)break;if(f++,m+=t,f>=i.samplesPerChunk){f=0,m=0,p++;const t=s.stsc.entries[g+1];t&&p+1>=t.firstChunk&&g++}b+=e,v.inc(),y&&y.inc(),n&&w++}n.mdia.mdhd.duration=0,n.tkhd.duration=0;const _=i.sampleDescriptionId,M={type:"moov",mvhd:t.mvhd,traks:[{tkhd:n.tkhd,mdia:{mdhd:n.mdia.mdhd,hdlr:n.mdia.hdlr,elng:n.mdia.elng,minf:{vmhd:n.mdia.minf.vmhd,smhd:n.mdia.minf.smhd,dinf:n.mdia.minf.dinf,stbl:{stsd:s.stsd,stts:{version:0,flags:0,entries:[]},ctts:{version:0,flags:0,entries:[]},stsc:{version:0,flags:0,entries:[]},stsz:{version:0,flags:0,entries:[]},stco:{version:0,flags:0,entries:[]},stss:{version:0,flags:0,entries:[]}}}}}],mvex:{mehd:{fragmentDuration:t.mvhd.duration},trexs:[{trackId:n.tkhd.trackId,defaultSampleDescriptionIndex:_,defaultSampleDuration:0,defaultSampleSize:0,defaultSampleFlags:0}]}};this._tracks.push({fragmentSequence:1,trackId:n.tkhd.trackId,timeScale:n.mdia.mdhd.timeScale,samples:c,currSample:null,currTime:null,moov:M,mime:l})}if(0===this._tracks.length)return void this.emit("error",new Error("no playable tracks"));t.mvhd.duration=0,this._ftyp={type:"ftyp",brand:"iso5",brandVersion:0,compatibleBrands:["iso5"]};const n=a.encode(this._ftyp),s=this._tracks.map((t=>{const e=a.encode(t.moov);return{mime:t.mime,init:r.concat([n,e])}}));this.emit("ready",s)}seek(t){if(!this._tracks)throw new Error("Not ready yet; wait for 'ready' event");this._fileStream&&(this._fileStream.destroy(),this._fileStream=null);let e=-1;if(this._tracks.map(((i,r)=>{i.outStream&&i.outStream.destroy(),i.inStream&&(i.inStream.destroy(),i.inStream=null);const n=i.outStream=o.encode(),s=this._generateFragment(r,t);if(!s)return n.finalize();(-1===e||s.ranges[0].start<e)&&(e=s.ranges[0].start);const a=t=>{n.destroyed||n.box(t.moof,(e=>{if(e)return this.emit("error",e);n.destroyed||i.inStream.slice(t.ranges).pipe(n.mediaData(t.length,(t=>{if(t)return this.emit("error",t);if(n.destroyed)return;const e=this._generateFragment(r);if(!e)return n.finalize();a(e)})))}))};a(s)})),e>=0){const t=this._fileStream=this._file.createReadStream({start:e});this._tracks.forEach((i=>{i.inStream=new h(e,{highWaterMark:1e7}),t.pipe(i.inStream)}))}return this._tracks.map((t=>t.outStream))}_findSampleBefore(t,e){const i=this._tracks[t],r=Math.floor(i.timeScale*e);let s=n(i.samples,r,((t,e)=>t.dts+t.presentationOffset-e));for(-1===s?s=0:s<0&&(s=-s-2);!i.samples[s].sync;)s--;return s}_generateFragment(t,e){const i=this._tracks[t];let r;if(r=void 0!==e?this._findSampleBefore(t,e):i.currSample,r>=i.samples.length)return null;const n=i.samples[r].dts;let s=0;const o=[];for(var a=r;a<i.samples.length;a++){const t=i.samples[a];if(t.sync&&t.dts-n>=1*i.timeScale)break;s+=t.size;const e=o.length-1;e<0||o[e].end!==t.offset?o.push({start:t.offset,end:t.offset+t.size}):o[e].end+=t.size}return i.currSample=a,{moof:this._generateMoof(t,r,a),ranges:o,length:s}}_generateMoof(t,e,i){const r=this._tracks[t],n=[];let s=0;for(let t=e;t<i;t++){const e=r.samples[t];e.presentationOffset<0&&(s=1),n.push({sampleDuration:e.duration,sampleSize:e.size,sampleFlags:e.sync?33554432:16842752,sampleCompositionTimeOffset:e.presentationOffset})}const o={type:"moof",mfhd:{sequenceNumber:r.fragmentSequence++},trafs:[{tfhd:{flags:131072,trackId:r.trackId},tfdt:{baseMediaDecodeTime:r.samples[e].dts},trun:{flags:3841,dataOffset:8,entries:n,version:s}}]};return o.trafs[0].trun.dataOffset+=a.encodingLength(o),o}}},7235:(t,e,i)=>{var r=i(5108);const n=i(6567),s=i(4286),o=i(9872);function a(t,e,i={}){if(!(this instanceof a))return r.warn("Don't invoke VideoStream without the 'new' keyword."),new a(t,e,i);this.detailedError=null,this._elem=e,this._elemWrapper=new n(e),this._waitingFired=!1,this._trackMeta=null,this._file=t,this._tracks=null,"none"!==this._elem.preload&&this._createMuxer(),this._onError=()=>{this.detailedError=this._elemWrapper.detailedError,this.destroy()},this._onWaiting=()=>{this._waitingFired=!0,this._muxer?this._tracks&&this._pump():this._createMuxer()},e.autoplay&&(e.preload="auto"),e.addEventListener("waiting",this._onWaiting),e.addEventListener("error",this._onError)}a.prototype={_createMuxer(){this._muxer=new o(this._file),this._muxer.on("ready",(t=>{this._tracks=t.map((t=>{const e=this._elemWrapper.createWriteStream(t.mime);e.on("error",(t=>{this._elemWrapper.error(t)}));const i={muxed:null,mediaSource:e,initFlushed:!1,onInitFlushed:null};return e.write(t.init,(t=>{i.initFlushed=!0,i.onInitFlushed&&i.onInitFlushed(t)})),i})),(this._waitingFired||"auto"===this._elem.preload)&&this._pump()})),this._muxer.on("error",(t=>{this._elemWrapper.error(t)}))},_pump(){const t=this._muxer.seek(this._elem.currentTime,!this._tracks);this._tracks.forEach(((e,i)=>{const r=()=>{e.muxed&&(e.muxed.destroy(),e.mediaSource=this._elemWrapper.createWriteStream(e.mediaSource),e.mediaSource.on("error",(t=>{this._elemWrapper.error(t)}))),e.muxed=t[i],s(e.muxed,e.mediaSource)};e.initFlushed?r():e.onInitFlushed=t=>{t?this._elemWrapper.error(t):r()}}))},destroy(){this.destroyed||(this.destroyed=!0,this._elem.removeEventListener("waiting",this._onWaiting),this._elem.removeEventListener("error",this._onError),this._tracks&&this._tracks.forEach((t=>{t.muxed&&t.muxed.destroy()})),this._elem.src="")}},t.exports=a},221:(t,e,i)=>{var r=i(8764).Buffer,n=i(5108);const s=i(7187),o=i(6470),a=i(7485),h=i(3202),u=i(1227),l=i(146),c=i(2050),d=i(4595),f=i(5203),p=i(8853),m=i(4375),g=i(1798),b=i(4159),v=i(9529),{ThrottleGroup:y}=i(558),w=i(7523),_=i(5363),{version:M}=i(1907),k=u("webtorrent"),x=M.replace(/\d*./g,(t=>("0"+t%100).slice(-2))).slice(0,4),E=`-WW${x}-`;class S extends s{constructor(t={}){super(),"string"==typeof t.peerId?this.peerId=t.peerId:r.isBuffer(t.peerId)?this.peerId=t.peerId.toString("hex"):this.peerId=r.from(E+g(9).toString("base64")).toString("hex"),this.peerIdBuffer=r.from(this.peerId,"hex"),"string"==typeof t.nodeId?this.nodeId=t.nodeId:r.isBuffer(t.nodeId)?this.nodeId=t.nodeId.toString("hex"):this.nodeId=g(20).toString("hex"),this.nodeIdBuffer=r.from(this.nodeId,"hex"),this._debugId=this.peerId.toString("hex").substring(0,7),this.destroyed=!1,this.listening=!1,this.torrentPort=t.torrentPort||0,this.dhtPort=t.dhtPort||0,this.tracker=void 0!==t.tracker?t.tracker:{},this.lsd=!1!==t.lsd,this.torrents=[],this.maxConns=Number(t.maxConns)||55,this.utp=S.UTP_SUPPORT&&!1!==t.utp,this._downloadLimit=Math.max("number"==typeof t.downloadLimit?t.downloadLimit:-1,-1),this._uploadLimit=Math.max("number"==typeof t.uploadLimit?t.uploadLimit:-1,-1),this.serviceWorker=null,this.workerKeepAliveInterval=null,this.workerPortCount=0,!0===t.secure&&i(563).enableSecure(),this._debug("new webtorrent (peerId %s, nodeId %s, port %s)",this.peerId,this.nodeId,this.torrentPort),this.throttleGroups={down:new y({rate:Math.max(this._downloadLimit,0),enabled:this._downloadLimit>=0}),up:new y({rate:Math.max(this._uploadLimit,0),enabled:this._uploadLimit>=0})},this.tracker&&("object"!=typeof this.tracker&&(this.tracker={}),globalThis.WRTC&&!this.tracker.wrtc&&(this.tracker.wrtc=globalThis.WRTC)),"function"==typeof w?this._connPool=new w(this):m((()=>{this._onListening()})),this._downloadSpeed=v(),this._uploadSpeed=v(),!1!==t.dht&&"function"==typeof l?(this.dht=new l(Object.assign({},{nodeId:this.nodeId},t.dht)),this.dht.once("error",(t=>{this._destroy(t)})),this.dht.once("listening",(()=>{const t=this.dht.address();t&&(this.dhtPort=t.port)})),this.dht.setMaxListeners(0),this.dht.listen(this.dhtPort)):this.dht=!1,this.enableWebSeeds=!1!==t.webSeeds;const e=()=>{this.destroyed||(this.ready=!0,this.emit("ready"))};"function"==typeof c&&null!=t.blocklist?c(t.blocklist,{headers:{"user-agent":`WebTorrent/${M} (https://webtorrent.io)`}},((t,i)=>{if(t)return n.error(`Failed to load blocklist: ${t.message}`);this.blocked=i,e()})):m(e)}loadWorker(t,e=(()=>{})){if(!(t instanceof ServiceWorker))throw new Error("Invalid worker registration");if("activated"!==t.state)throw new Error("Worker isn't activated");this.serviceWorker=t,navigator.serviceWorker.addEventListener("message",(t=>{const{data:e}=t;if(!e.type||"webtorrent"===!e.type||!e.url)return null;let[i,...r]=e.url.slice(e.url.indexOf(e.scope+"webtorrent/")+11+e.scope.length).split("/");if(r=decodeURI(r.join("/")),!i||!r)return null;const[n]=t.ports,s=this.get(i)&&this.get(i).files.find((t=>t.path===r));if(!s)return null;const[o,a,h]=s._serve(e),u=a&&a[Symbol.asyncIterator](),l=()=>{n.onmessage=null,a&&a.destroy(),h&&h.destroy(),this.workerPortCount--,this.workerPortCount||(clearInterval(this.workerKeepAliveInterval),this.workerKeepAliveInterval=null)};n.onmessage=async t=>{if(t.data){let t;try{t=(await u.next()).value}catch(t){}n.postMessage(t),t||l(),this.workerKeepAliveInterval||(this.workerKeepAliveInterval=setInterval((()=>fetch(`${this.serviceWorker.scriptURL.substr(0,this.serviceWorker.scriptURL.lastIndexOf("/")+1).slice(window.location.origin.length)}webtorrent/keepalive/`)),2e4))}else l()},this.workerPortCount++,n.postMessage(o)})),e(this.serviceWorker)}get downloadSpeed(){return this._downloadSpeed()}get uploadSpeed(){return this._uploadSpeed()}get progress(){const t=this.torrents.filter((t=>1!==t.progress));return t.reduce(((t,e)=>t+e.downloaded),0)/(t.reduce(((t,e)=>t+(e.length||0)),0)||1)}get ratio(){return this.torrents.reduce(((t,e)=>t+e.uploaded),0)/(this.torrents.reduce(((t,e)=>t+e.received),0)||1)}get(t){if(t instanceof _){if(this.torrents.includes(t))return t}else{let e;try{e=f(t)}catch(t){}if(!e)return null;if(!e.infoHash)throw new Error("Invalid torrent identifier");for(const t of this.torrents)if(t.infoHash===e.infoHash)return t}return null}add(t,e={},i=(()=>{})){if(this.destroyed)throw new Error("client is destroyed");"function"==typeof e&&([e,i]=[{},e]);const r=()=>{if(!this.destroyed)for(const t of this.torrents)if(t.infoHash===s.infoHash&&t!==s)return void s._destroy(new Error(`Cannot add duplicate torrent ${s.infoHash}`))},n=()=>{this.destroyed||(i(s),this.emit("torrent",s))};this._debug("add"),e=e?Object.assign({},e):{};const s=new _(t,this,e);return this.torrents.push(s),s.once("_infoHash",r),s.once("ready",n),s.once("close",(function t(){s.removeListener("_infoHash",r),s.removeListener("ready",n),s.removeListener("close",t)})),s}seed(t,e,i){if(this.destroyed)throw new Error("client is destroyed");"function"==typeof e&&([e,i]=[{},e]),this._debug("seed"),(e=e?Object.assign({},e):{}).skipVerify=!0;const r="string"==typeof t;r&&(e.path=o.dirname(t)),e.createdBy||(e.createdBy=`WebTorrent/${x}`);const s=t=>{this._debug("on seed"),"function"==typeof i&&i(t),t.emit("seed"),this.emit("seed",t)},u=this.add(null,e,(t=>{const i=[i=>{if(r||e.preloadedStore)return i();t.load(l,i)}];this.dht&&i.push((e=>{t.once("dhtAnnounce",e)})),d(i,(e=>{if(!this.destroyed)return e?t._destroy(e):void s(t)}))}));let l;return"undefined"!=typeof FileList&&t instanceof FileList?t=Array.from(t):Array.isArray(t)||(t=[t]),d(t.map((t=>i=>{!e.preloadedStore&&function(t){return"object"==typeof t&&null!=t&&"function"==typeof t.pipe}(t)?a(t,((e,r)=>{if(e)return i(e);r.name=t.name,i(null,r)})):i(null,t)})),((t,r)=>{if(!this.destroyed)return t?u._destroy(t):void h.parseInput(r,e,((t,s)=>{if(!this.destroyed){if(t)return u._destroy(t);l=s.map((t=>t.getStream)),h(r,e,((t,e)=>{if(this.destroyed)return;if(t)return u._destroy(t);const r=this.get(e);r?(n.warn("A torrent with the same id is already being seeded"),u._destroy(),"function"==typeof i&&i(r)):u._onTorrentId(e)}))}}))})),u}remove(t,e,i){if("function"==typeof e)return this.remove(t,null,e);if(this._debug("remove"),!this.get(t))throw new Error(`No torrent with id ${t}`);this._remove(t,e,i)}_remove(t,e,i){if("function"==typeof e)return this._remove(t,null,e);const r=this.get(t);r&&(this.torrents.splice(this.torrents.indexOf(r),1),r.destroy(e,i),this.dht&&this.dht._tables.remove(r.infoHash))}address(){return this.listening?this._connPool?this._connPool.tcpServer.address():{address:"0.0.0.0",family:"IPv4",port:0}:null}throttleDownload(t){return t=Number(t),!(isNaN(t)||!isFinite(t)||t<-1)&&(this._downloadLimit=t,this._downloadLimit<0?this.throttleGroups.down.setEnabled(!1):(this.throttleGroups.down.setEnabled(!0),void this.throttleGroups.down.setRate(this._downloadLimit)))}throttleUpload(t){return t=Number(t),!(isNaN(t)||!isFinite(t)||t<-1)&&(this._uploadLimit=t,this._uploadLimit<0?this.throttleGroups.up.setEnabled(!1):(this.throttleGroups.up.setEnabled(!0),void this.throttleGroups.up.setRate(this._uploadLimit)))}destroy(t){if(this.destroyed)throw new Error("client already destroyed");this._destroy(null,t)}_destroy(t,e){this._debug("client destroy"),this.destroyed=!0;const i=this.torrents.map((t=>e=>{t.destroy(e)}));this._connPool&&i.push((t=>{this._connPool.destroy(t)})),this.dht&&i.push((t=>{this.dht.destroy(t)})),d(i,e),t&&this.emit("error",t),this.torrents=[],this._connPool=null,this.dht=null,this.throttleGroups.down.destroy(),this.throttleGroups.up.destroy()}_onListening(){if(this._debug("listening"),this.listening=!0,this._connPool){const t=this._connPool.tcpServer.address();t&&(this.torrentPort=t.port)}this.emit("listening")}_debug(){const t=[].slice.call(arguments);t[0]=`[${this._debugId}] ${t[0]}`,k(...t)}_getByHash(t){for(const e of this.torrents)if(e.infoHashHash||(e.infoHashHash=b.sync(r.from("72657132"+e.infoHash,"hex"))),t===e.infoHashHash)return e;return null}}S.WEBRTC_SUPPORT=p.WEBRTC_SUPPORT,S.UTP_SUPPORT=w.UTP_SUPPORT,S.VERSION=M,t.exports=S},1208:(t,e,i)=>{const r=i(2830),n=i(1227),s=i(2840),o=n("webtorrent:file-stream");class a extends r.Readable{constructor(t,e){super(e),this._torrent=t._torrent;const i=e&&e.start||0,r=e&&e.end&&e.end<t.length?e.end:t.length-1,n=t._torrent.pieceLength;this._startPiece=(i+t.offset)/n|0,this._endPiece=(r+t.offset)/n|0,this._piece=this._startPiece,this._offset=i+t.offset-this._startPiece*n,this._missing=r-i+1,this._reading=!1,this._notifying=!1,this._criticalLength=Math.min(1048576/n|0,2),this._torrent.select(this._startPiece,this._endPiece,!0,(()=>{this._notify()})),s(this,(t=>{this.destroy(t)}))}_read(){this._reading||(this._reading=!0,this._notify())}_notify(){if(!this._reading||0===this._missing)return;if(!this._torrent.bitfield.get(this._piece))return this._torrent.critical(this._piece,this._piece+this._criticalLength);if(this._notifying)return;if(this._notifying=!0,this._torrent.destroyed)return this.destroy(new Error("Torrent removed"));const t=this._piece,e={};t===this._torrent.pieces.length-1&&(e.length=this._torrent.lastPieceLength),this._torrent.store.get(t,e,((e,i)=>{if(this._notifying=!1,!this.destroyed){if(o("read %s (length %s) (err %s)",t,i&&i.length,e&&e.message),e)return this.destroy(e);this._offset&&(i=i.slice(this._offset),this._offset=0),this._missing<i.length&&(i=i.slice(0,this._missing)),this._missing-=i.length,o("pushing buffer of length %s",i.length),this._reading=!1,this.push(i),0===this._missing&&this.push(null)}})),this._piece+=1}_destroy(t,e){this._torrent.destroyed||this._torrent.deselect(this._startPiece,this._endPiece,!0),e(t)}}t.exports=a},1234:(t,e,i)=>{const r=i(7187),{PassThrough:n}=i(2830),s=i(6470),o=i(38),a=i(2428),h=i(8677),u=i(5100),l=i(4375),c=i(4622),d=i(3893),f=i(2840),p=i(1208);t.exports=class extends r{constructor(t,e){super(),this._torrent=t,this._destroyed=!1,this._fileStreams=new Set,this.name=e.name,this.path=e.path,this.length=e.length,this.offset=e.offset,this.done=!1;const i=e.offset,r=i+e.length-1;this._startPiece=i/this._torrent.pieceLength|0,this._endPiece=r/this._torrent.pieceLength|0,0===this.length&&(this.done=!0,this.emit("done")),this._serviceWorker=t.client.serviceWorker}get downloaded(){if(this._destroyed||!this._torrent.bitfield)return 0;const{pieces:t,bitfield:e,pieceLength:i,lastPieceLength:r}=this._torrent,{_startPiece:n,_endPiece:s}=this,o=n=>{const s=n===t.length-1?r:i;return e.get(n)?s:s-t[n].missing};let a=0;for(let e=n;e<=s;e+=1){const h=o(e);if(a+=h,e===n){const t=this.offset%i;a-=Math.min(t,h)}if(e===s){const e=(s===t.length-1?r:i)-(this.offset+this.length)%i;a-=Math.min(e,h)}}return a}get progress(){return this.length?this.downloaded/this.length:0}select(t){0!==this.length&&this._torrent.select(this._startPiece,this._endPiece,t)}deselect(){0!==this.length&&this._torrent.deselect(this._startPiece,this._endPiece,!1)}createReadStream(t){if(0===this.length){const t=new n;return l((()=>{t.end()})),t}const e=new p(this,t);return this._fileStreams.add(e),e.once("close",(()=>{this._fileStreams.delete(e)})),e}getBuffer(t){u(this.createReadStream(),this.length,t)}getBlob(t){if("undefined"==typeof window)throw new Error("browser-only method");a(this.createReadStream(),this._getMimeType()).then((e=>t(null,e)),(e=>t(e)))}getBlobURL(t){if("undefined"==typeof window)throw new Error("browser-only method");h(this.createReadStream(),this._getMimeType()).then((e=>t(null,e)),(e=>t(e)))}appendTo(t,e,i){if("undefined"==typeof window)throw new Error("browser-only method");o.append(this,t,e,i)}renderTo(t,e,i){if("undefined"==typeof window)throw new Error("browser-only method");o.render(this,t,e,i)}_serve(t){const e={status:200,headers:{"Accept-Ranges":"bytes","Content-Type":d.getType(this.name),"Cache-Control":"no-cache, no-store, must-revalidate, max-age=0",Expires:"0"},body:"HEAD"===t.method?"":"STREAM"};"document"===t.destination&&(e.headers["Content-Type"]="application/octet-stream",e.headers["Content-Disposition"]="attachment",e.body="DOWNLOAD");let i=c(this.length,t.headers.range||"");i.constructor===Array?(e.status=206,i=i[0],e.headers["Content-Range"]=`bytes ${i.start}-${i.end}/${this.length}`,e.headers["Content-Length"]=""+(i.end-i.start+1)):e.headers["Content-Length"]=this.length;const r="GET"===t.method&&this.createReadStream(i);let n=null;return r&&this.emit("stream",{stream:r,req:t,file:this},(t=>{n=t,f(t,(()=>{t&&t.destroy(),r.destroy()}))})),[e,n||r,n&&r]}getStreamURL(t=(()=>{})){if("undefined"==typeof window)throw new Error("browser-only method");if(!this._serviceWorker)throw new Error("No worker registered");if("activated"!==this._serviceWorker.state)throw new Error("Worker isn't activated");t(null,`${this._serviceWorker.scriptURL.substr(0,this._serviceWorker.scriptURL.lastIndexOf("/")+1).slice(window.location.origin.length)}webtorrent/${this._torrent.infoHash}/${encodeURI(this.path)}`)}streamTo(t,e=(()=>{})){if("undefined"==typeof window)throw new Error("browser-only method");if(!this._serviceWorker)throw new Error("No worker registered");if("activated"!==this._serviceWorker.state)throw new Error("Worker isn't activated");const i=this._serviceWorker.scriptURL.substr(0,this._serviceWorker.scriptURL.lastIndexOf("/")+1).slice(window.location.origin.length);t.src=`${i}webtorrent/${this._torrent.infoHash}/${encodeURI(this.path)}`,e(null,t)}_getMimeType(){return o.mime[s.extname(this.name).toLowerCase()]}_destroy(){this._destroyed=!0,this._torrent=null;for(const t of this._fileStreams)t.destroy();this._fileStreams.clear()}}},563:(t,e,i)=>{const r=i(7187),{Transform:n}=i(2830),s=i(6581),o=i(1227),a=i(5228),h=o("webtorrent:peer");let u=!1;e.enableSecure=()=>{u=!0},e.createWebRTCPeer=(t,e,i)=>{const r=new d(t.id,"webrtc");if(r.conn=t,r.swarm=e,r.throttleGroups=i,r.conn.connected)r.onConnect();else{const t=()=>{r.conn.removeListener("connect",e),r.conn.removeListener("error",i)},e=()=>{t(),r.onConnect()},i=e=>{t(),r.destroy(e)};r.conn.once("connect",e),r.conn.once("error",i),r.startConnectTimeout()}return r},e.createTCPIncomingPeer=(t,e)=>l(t,"tcpIncoming",e),e.createUTPIncomingPeer=(t,e)=>l(t,"utpIncoming",e),e.createTCPOutgoingPeer=(t,e,i)=>c(t,e,"tcpOutgoing",i),e.createUTPOutgoingPeer=(t,e,i)=>c(t,e,"utpOutgoing",i);const l=(t,e,i)=>{const r=`${t.remoteAddress}:${t.remotePort}`,n=new d(r,e);return n.conn=t,n.addr=r,n.throttleGroups=i,n.onConnect(),n},c=(t,e,i,r)=>{const n=new d(t,i);return n.addr=t,n.swarm=e,n.throttleGroups=r,n};e.createWebSeedPeer=(t,e,i,r)=>{const n=new d(e,"webSeed");return n.swarm=i,n.conn=t,n.throttleGroups=r,n.onConnect(),n};class d extends r{constructor(t,e){super(),this.id=t,this.type=e,h("new %s Peer %s",e,t),this.addr=null,this.conn=null,this.swarm=null,this.wire=null,this.connected=!1,this.destroyed=!1,this.timeout=null,this.retries=0,this.sentPe1=!1,this.sentPe2=!1,this.sentPe3=!1,this.sentPe4=!1,this.sentHandshake=!1}onConnect(){if(this.destroyed)return;this.connected=!0,h("Peer %s connected",this.id),clearTimeout(this.connectTimeout);const t=this.conn;t.once("end",(()=>{this.destroy()})),t.once("close",(()=>{this.destroy()})),t.once("finish",(()=>{this.destroy()})),t.once("error",(t=>{this.destroy(t)}));const e=this.wire=new a(this.type,this.retries,u);e.once("end",(()=>{this.destroy()})),e.once("close",(()=>{this.destroy()})),e.once("finish",(()=>{this.destroy()})),e.once("error",(t=>{this.destroy(t)})),e.once("pe1",(()=>{this.onPe1()})),e.once("pe2",(()=>{this.onPe2()})),e.once("pe3",(()=>{this.onPe3()})),e.once("pe4",(()=>{this.onPe4()})),e.once("handshake",((t,e)=>{this.onHandshake(t,e)})),this.startHandshakeTimeout(),this.setThrottlePipes(),this.swarm&&("tcpOutgoing"===this.type?u&&0===this.retries&&!this.sentPe1?this.sendPe1():this.sentHandshake||this.handshake():"tcpIncoming"===this.type||this.sentHandshake||this.handshake())}sendPe1(){this.wire.sendPe1(),this.sentPe1=!0}onPe1(){this.sendPe2()}sendPe2(){this.wire.sendPe2(),this.sentPe2=!0}onPe2(){this.sendPe3()}sendPe3(){this.wire.sendPe3(this.swarm.infoHash),this.sentPe3=!0}onPe3(t){this.swarm&&(this.swarm.infoHashHash!==t&&this.destroy(new Error("unexpected crypto handshake info hash for this swarm")),this.sendPe4())}sendPe4(){this.wire.sendPe4(this.swarm.infoHash),this.sentPe4=!0}onPe4(){this.sentHandshake||this.handshake()}clearPipes(){this.conn.unpipe(),this.wire.unpipe()}setThrottlePipes(){const t=this;this.conn.pipe(this.throttleGroups.down.throttle()).pipe(new n({transform(e,i,r){t.emit("download",e.length),t.destroyed||r(null,e)}})).pipe(this.wire).pipe(this.throttleGroups.up.throttle()).pipe(new n({transform(e,i,r){t.emit("upload",e.length),t.destroyed||r(null,e)}})).pipe(this.conn)}onHandshake(t,e){if(!this.swarm)return;if(this.destroyed)return;if(this.swarm.destroyed)return this.destroy(new Error("swarm already destroyed"));if(t!==this.swarm.infoHash)return this.destroy(new Error("unexpected handshake info hash for this swarm"));if(e===this.swarm.peerId)return this.destroy(new Error("refusing to connect to ourselves"));h("Peer %s got handshake %s",this.id,t),clearTimeout(this.handshakeTimeout),this.retries=0;let i=this.addr;!i&&this.conn.remoteAddress&&this.conn.remotePort&&(i=`${this.conn.remoteAddress}:${this.conn.remotePort}`),this.swarm._onWire(this.wire,i),this.swarm&&!this.swarm.destroyed&&(this.sentHandshake||this.handshake())}handshake(){const t={dht:!this.swarm.private&&!!this.swarm.client.dht,fast:!0};this.wire.handshake(this.swarm.infoHash,this.swarm.client.peerId,t),this.sentHandshake=!0}startConnectTimeout(){clearTimeout(this.connectTimeout);this.connectTimeout=setTimeout((()=>{this.destroy(new Error("connect timeout"))}),{webrtc:25e3,tcpOutgoing:5e3,utpOutgoing:5e3}[this.type]),this.connectTimeout.unref&&this.connectTimeout.unref()}startHandshakeTimeout(){clearTimeout(this.handshakeTimeout),this.handshakeTimeout=setTimeout((()=>{this.destroy(new Error("handshake timeout"))}),25e3),this.handshakeTimeout.unref&&this.handshakeTimeout.unref()}destroy(t){if(this.destroyed)return;this.destroyed=!0,this.connected=!1,h("destroy %s %s (error: %s)",this.type,this.id,t&&(t.message||t)),clearTimeout(this.connectTimeout),clearTimeout(this.handshakeTimeout);const e=this.swarm,i=this.conn,r=this.wire;this.swarm=null,this.conn=null,this.wire=null,e&&r&&s(e.wires,e.wires.indexOf(r)),i&&(i.on("error",(()=>{})),i.destroy()),r&&r.destroy(),e&&e.removePeer(this.id)}}},742:t=>{t.exports=class{constructor(t){this._torrent=t,this._numPieces=t.pieces.length,this._pieces=new Array(this._numPieces),this._onWire=t=>{this.recalculate(),this._initWire(t)},this._onWireHave=t=>{this._pieces[t]+=1},this._onWireBitfield=()=>{this.recalculate()},this._torrent.wires.forEach((t=>{this._initWire(t)})),this._torrent.on("wire",this._onWire),this.recalculate()}getRarestPiece(t){let e=[],i=1/0;for(let r=0;r<this._numPieces;++r){if(t&&!t(r))continue;const n=this._pieces[r];n===i?e.push(r):n<i&&(e=[r],i=n)}return e.length?e[Math.random()*e.length|0]:-1}destroy(){this._torrent.removeListener("wire",this._onWire),this._torrent.wires.forEach((t=>{this._cleanupWireEvents(t)})),this._torrent=null,this._pieces=null,this._onWire=null,this._onWireHave=null,this._onWireBitfield=null}_initWire(t){t._onClose=()=>{this._cleanupWireEvents(t);for(let e=0;e<this._numPieces;++e)this._pieces[e]-=t.peerPieces.get(e)},t.on("have",this._onWireHave),t.on("bitfield",this._onWireBitfield),t.once("close",t._onClose)}recalculate(){this._pieces.fill(0);for(const t of this._torrent.wires)for(let e=0;e<this._numPieces;++e)this._pieces[e]+=t.peerPieces.get(e)}_cleanupWireEvents(t){t.removeListener("have",this._onWireHave),t.removeListener("bitfield",this._onWireBitfield),t._onClose&&t.removeListener("close",t._onClose),t._onClose=null}}},5363:(t,e,i)=>{var r=i(9590);const n=i(7187),s=i(9608),o=i(8856),a=i(5688),h=i(6470),u=i(2884),{default:l}=i(8833),c=i(9421),d=i(5293),f=i(9648),p=i(1227),m=i(3207),g=i(1191),b=i(6993),v=i(3700),y=i(9417),w=i(1191),_=i(5673),M=i(4595),k=i(9967),x=i(5203),E=i(8687),S=i(4286),T=i(4375),A=i(5960),I=i(4159),C=i(9529),B=i(2219),R=i(7525),P=i(1234),L=i(563),O=i(742),D=i(6322),N=i(4854),j=i(6695),U=p("webtorrent:torrent"),F=5e3,q=3*E.BLOCK_LENGTH,z=r.browser?f().length:2,H=[1e3,5e3,15e3],W=`WebTorrent/${i(1907).version} (https://webtorrent.io)`;let $;try{$=h.join(s.statSync("/tmp")&&"/tmp","webtorrent")}catch(t){$=h.join("function"==typeof a.tmpdir?a.tmpdir():"/","webtorrent")}function Z(t,e){let i=2+Math.ceil(e*t.downloadSpeed()/E.BLOCK_LENGTH);if(t.peerExtendedHandshake){const e=t.peerExtendedHandshake.reqq;"number"==typeof e&&e>0&&(i=Math.min(i,e))}return i}function V(){}t.exports=class extends n{constructor(t,e,i){super(),this._debugId="unknown infohash",this.client=e,this.announce=i.announce,this.urlList=i.urlList,this.path=i.path||$,this.addUID=i.addUID||!1,this.skipVerify=!!i.skipVerify,this._store=i.store||g,this._preloadedStore=i.preloadedStore||null,this._storeCacheSlots=void 0!==i.storeCacheSlots?i.storeCacheSlots:20,this._destroyStoreOnDestroy=i.destroyStoreOnDestroy||!1,this._getAnnounceOpts=i.getAnnounceOpts,"boolean"==typeof i.private&&(this.private=i.private),this.strategy=i.strategy||"sequential",this.maxWebConns=i.maxWebConns||4,this._rechokeNumSlots=!1===i.uploads||0===i.uploads?0:+i.uploads||10,this._rechokeOptimisticWire=null,this._rechokeOptimisticTime=0,this._rechokeIntervalId=null,this.ready=!1,this.destroyed=!1,this.paused=i.paused||!1,this.done=!1,this.metadata=null,this.store=null,this.storeOpts=i.storeOpts,this.files=[],this.pieces=[],this._amInterested=!1,this._selections=[],this._critical=[],this.wires=[],this._queue=[],this._peers={},this._peersLength=0,this.received=0,this.uploaded=0,this._downloadSpeed=C(),this._uploadSpeed=C(),this._servers=[],this._xsRequests=[],this._fileModtimes=i.fileModtimes,null!==t&&this._onTorrentId(t),this._debug("new torrent")}get timeRemaining(){return this.done?0:0===this.downloadSpeed?1/0:(this.length-this.downloaded)/this.downloadSpeed*1e3}get downloaded(){if(!this.bitfield)return 0;let t=0;for(let e=0,i=this.pieces.length;e<i;++e)if(this.bitfield.get(e))t+=e===i-1?this.lastPieceLength:this.pieceLength;else{const i=this.pieces[e];t+=i.length-i.missing}return t}get downloadSpeed(){return this._downloadSpeed()}get uploadSpeed(){return this._uploadSpeed()}get progress(){return this.length?this.downloaded/this.length:0}get ratio(){return this.uploaded/(this.received||this.length)}get numPeers(){return this.wires.length}get torrentFileBlobURL(){if("undefined"==typeof window)throw new Error("browser-only property");return this.torrentFile?URL.createObjectURL(new Blob([this.torrentFile],{type:"application/x-bittorrent"})):null}get _numQueued(){return this._queue.length+(this._peersLength-this._numConns)}get _numConns(){let t=0;for(const e in this._peers)this._peers[e].connected&&(t+=1);return t}_onTorrentId(t){if(this.destroyed)return;let e;try{e=x(t)}catch(t){}e?(this.infoHash=e.infoHash,this._debugId=e.infoHash.toString("hex").substring(0,7),T((()=>{this.destroyed||this._onParsedTorrent(e)}))):x.remote(t,((t,e)=>{if(!this.destroyed)return t?this._destroy(t):void this._onParsedTorrent(e)}))}_onParsedTorrent(t){if(!this.destroyed){if(this._processParsedTorrent(t),!this.infoHash)return this._destroy(new Error("Malformed torrent data: No info hash"));this._rechokeIntervalId=setInterval((()=>{this._rechoke()}),1e4),this._rechokeIntervalId.unref&&this._rechokeIntervalId.unref(),this.emit("_infoHash",this.infoHash),this.destroyed||(this.emit("infoHash",this.infoHash),this.destroyed||(this.client.listening?this._onListening():this.client.once("listening",(()=>{this._onListening()}))))}}_processParsedTorrent(t){this._debugId=t.infoHash.toString("hex").substring(0,7),void 0!==this.private&&(t.private=this.private),this.announce&&(t.announce=t.announce.concat(this.announce)),this.client.tracker&&i.g.WEBTORRENT_ANNOUNCE&&!t.private&&(t.announce=t.announce.concat(i.g.WEBTORRENT_ANNOUNCE)),this.urlList&&(t.urlList=t.urlList.concat(this.urlList)),t.announce=Array.from(new Set(t.announce)),t.urlList=Array.from(new Set(t.urlList)),Object.assign(this,t),this.magnetURI=x.toMagnetURI(t),this.torrentFile=x.toTorrentFile(t)}_onListening(){this.destroyed||(this.info?this._onMetadata(this):(this.xs&&this._getMetadataFromServer(),this._startDiscovery()))}_startDiscovery(){if(this.discovery||this.destroyed)return;let t=this.client.tracker;t&&(t=Object.assign({},this.client.tracker,{getAnnounceOpts:()=>{if(this.destroyed)return;const t={uploaded:this.uploaded,downloaded:this.downloaded,left:Math.max(this.length-this.downloaded,0)};return this.client.tracker.getAnnounceOpts&&Object.assign(t,this.client.tracker.getAnnounceOpts()),this._getAnnounceOpts&&Object.assign(t,this._getAnnounceOpts()),t}})),this.peerAddresses&&this.peerAddresses.forEach((t=>this.addPeer(t))),this.discovery=new m({infoHash:this.infoHash,announce:this.announce,peerId:this.client.peerId,dht:!this.private&&this.client.dht,tracker:t,port:this.client.torrentPort,userAgent:W,lsd:this.client.lsd}),this.discovery.on("error",(t=>{this._destroy(t)})),this.discovery.on("peer",((t,e)=>{this._debug("peer %s discovered via %s",t,e),"string"==typeof t&&this.done||this.addPeer(t)})),this.discovery.on("trackerAnnounce",(()=>{this.emit("trackerAnnounce"),0===this.numPeers&&this.emit("noPeers","tracker")})),this.discovery.on("dhtAnnounce",(()=>{this.emit("dhtAnnounce"),0===this.numPeers&&this.emit("noPeers","dht")})),this.discovery.on("warning",(t=>{this.emit("warning",t)}))}_getMetadataFromServer(){const t=this,e=(Array.isArray(this.xs)?this.xs:[this.xs]).map((e=>i=>{!function(e,i){if(0!==e.indexOf("http://")&&0!==e.indexOf("https://"))return t.emit("warning",new Error(`skipping non-http xs param: ${e}`)),i(null);const r={url:e,method:"GET",headers:{"user-agent":W}};let n;try{n=b.concat(r,(function(r,n,s){if(t.destroyed)return i(null);if(t.metadata)return i(null);if(r)return t.emit("warning",new Error(`http error from xs param: ${e}`)),i(null);if(200!==n.statusCode)return t.emit("warning",new Error(`non-200 status code ${n.statusCode} from xs param: ${e}`)),i(null);let o;try{o=x(s)}catch(r){}return o?o.infoHash!==t.infoHash?(t.emit("warning",new Error(`got torrent file with incorrect info hash from xs param: ${e}`)),i(null)):(t._onMetadata(o),void i(null)):(t.emit("warning",new Error(`got invalid torrent file from xs param: ${e}`)),i(null))}))}catch(r){return t.emit("warning",new Error(`skipping invalid url xs param: ${e}`)),i(null)}t._xsRequests.push(n)}(e,i)}));M(e)}_onMetadata(t){if(this.metadata||this.destroyed)return;let e;if(this._debug("got metadata"),this._xsRequests.forEach((t=>{t.abort()})),this._xsRequests=[],t&&t.infoHash)e=t;else try{e=x(t)}catch(t){return this._destroy(t)}this._processParsedTorrent(e),this.metadata=this.torrentFile,this.client.enableWebSeeds&&this.urlList.forEach((t=>{this.addWebSeed(t)})),this._rarityMap=new O(this),this.files=this.files.map((t=>new P(this,t)));let i=this._preloadedStore;if(i||(i=new this._store(this.pieceLength,{...this.storeOpts,torrent:this,path:this.path,files:this.files,length:this.length,name:this.name+" - "+this.infoHash.slice(0,8),addUID:this.addUID})),this._storeCacheSlots>0&&!(i instanceof w)&&(i=new c(i,{max:this._storeCacheSlots})),this.store=new v(i),this.so?this.files.forEach(((t,e)=>{this.so.includes(e)?this.files[e].select():this.files[e].deselect()})):0!==this.pieces.length&&this.select(0,this.pieces.length-1,!1),this._hashes=this.pieces,this.pieces=this.pieces.map(((t,e)=>{const i=e===this.pieces.length-1?this.lastPieceLength:this.pieceLength;return new E(i)})),this._reservations=this.pieces.map((()=>[])),this.bitfield=new l(this.pieces.length),this.wires.forEach((t=>{t.ut_metadata&&t.ut_metadata.setMetadata(this.metadata),this._onWireWithMetadata(t)})),this.emit("metadata"),!this.destroyed)if(this.skipVerify)this._markAllVerified(),this._onStore();else{const t=t=>{if(t)return this._destroy(t);this._debug("done verifying"),this._onStore()};this._debug("verifying existing torrent data"),this._fileModtimes&&this._store===g?this.getFileModtimes(((e,i)=>{if(e)return this._destroy(e);this.files.map(((t,e)=>i[e]===this._fileModtimes[e])).every((t=>t))?(this._markAllVerified(),this._onStore()):this._verifyPieces(t)})):this._verifyPieces(t)}}getFileModtimes(t){const e=[];k(this.files.map(((t,i)=>r=>{const n=this.addUID?h.join(this.name+" - "+this.infoHash.slice(0,8)):h.join(this.path,t.path);s.stat(n,((t,n)=>{if(t&&"ENOENT"!==t.code)return r(t);e[i]=n&&n.mtime.getTime(),r(null)}))})),z,(i=>{this._debug("done getting file modtimes"),t(i,e)}))}_verifyPieces(t){k(this.pieces.map(((t,e)=>t=>{if(this.destroyed)return t(new Error("torrent is destroyed"));const i={};e===this.pieces.length-1&&(i.length=this.lastPieceLength),this.store.get(e,i,((i,r)=>this.destroyed?t(new Error("torrent is destroyed")):i?T((()=>t(null))):void I(r,(i=>{if(this.destroyed)return t(new Error("torrent is destroyed"));i===this._hashes[e]?(this._debug("piece verified %s",e),this._markVerified(e)):this._debug("piece invalid %s",e),t(null)}))))})),z,t)}rescanFiles(t){if(this.destroyed)throw new Error("torrent is destroyed");t||(t=V),this._verifyPieces((e=>{if(e)return this._destroy(e),t(e);this._checkDone(),t(null)}))}_markAllVerified(){for(let t=0;t<this.pieces.length;t++)this._markVerified(t)}_markVerified(t){this.pieces[t]=null,this._reservations[t]=null,this.bitfield.set(t,!0)}_hasAllPieces(){for(let t=0;t<this.pieces.length;t++)if(!this.bitfield.get(t))return!1;return!0}_hasNoPieces(){return!this._hasMorePieces(0)}_hasMorePieces(t){let e=0;for(let i=0;i<this.pieces.length;i++)if(this.bitfield.get(i)&&(e+=1,e>t))return!0;return!1}_onStore(){this.destroyed||(this._debug("on store"),this._startDiscovery(),this.ready=!0,this.emit("ready"),this._checkDone(),this._updateSelections())}destroy(t,e){if("function"==typeof t)return this.destroy(null,t);this._destroy(null,t,e)}_destroy(t,e,i){if("function"==typeof e)return this._destroy(t,null,e);if(this.destroyed)return;this.destroyed=!0,this._debug("destroy"),this.client._remove(this),clearInterval(this._rechokeIntervalId),this._xsRequests.forEach((t=>{t.abort()})),this._rarityMap&&this._rarityMap.destroy();for(const t in this._peers)this.removePeer(t);this.files.forEach((t=>{t instanceof P&&t._destroy()}));const r=this._servers.map((t=>e=>{t.destroy(e)}));if(this.discovery&&r.push((t=>{this.discovery.destroy(t)})),this.store){let t=this._destroyStoreOnDestroy;e&&void 0!==e.destroyStore&&(t=e.destroyStore),r.push((e=>{t?this.store.destroy(e):this.store.close(e)}))}M(r,i),t&&(0===this.listenerCount("error")?this.client.emit("error",t):this.emit("error",t)),this.emit("close"),this.client=null,this.files=[],this.discovery=null,this.store=null,this._rarityMap=null,this._peers=null,this._servers=null,this._xsRequests=null}addPeer(t){if(this.destroyed)throw new Error("torrent is destroyed");if(!this.infoHash)throw new Error("addPeer() must not be called before the `infoHash` event");let e;if(this.client.blocked){if("string"==typeof t){let i;try{i=u(t)}catch(e){return this._debug("ignoring peer: invalid %s",t),this.emit("invalidPeer",t),!1}e=i[0]}else"string"==typeof t.remoteAddress&&(e=t.remoteAddress);if(e&&this.client.blocked.contains(e))return this._debug("ignoring peer: blocked %s",t),"string"!=typeof t&&t.destroy(),this.emit("blockedPeer",t),!1}const i=this.client.utp&&this._isIPv4(e)?"utp":"tcp",r=!!this._addPeer(t,i);return r?this.emit("peer",t):this.emit("invalidPeer",t),r}_addPeer(t,e){if(this.destroyed)return"string"!=typeof t&&t.destroy(),null;if("string"==typeof t&&!this._validAddr(t))return this._debug("ignoring peer: invalid %s",t),null;const i=t&&t.id||t;if(this._peers[i])return this._debug("ignoring peer: duplicate (%s)",i),"string"!=typeof t&&t.destroy(),null;if(this.paused)return this._debug("ignoring peer: torrent is paused"),"string"!=typeof t&&t.destroy(),null;let r;return this._debug("add peer %s",i),r="string"==typeof t?"utp"===e?L.createUTPOutgoingPeer(t,this,this.client.throttleGroups):L.createTCPOutgoingPeer(t,this,this.client.throttleGroups):L.createWebRTCPeer(t,this,this.client.throttleGroups),this._registerPeer(r),"string"==typeof t&&(this._queue.push(r),this._drain()),r}addWebSeed(t){if(this.destroyed)throw new Error("torrent is destroyed");let e,i;if("string"==typeof t){if(e=t,!/^https?:\/\/.+/.test(e))return this.emit("warning",new Error(`ignoring invalid web seed: ${e}`)),void this.emit("invalidPeer",e);if(this._peers[e])return this.emit("warning",new Error(`ignoring duplicate web seed: ${e}`)),void this.emit("invalidPeer",e);i=new j(e,this)}else{if(!t||"string"!=typeof t.connId)return void this.emit("warning",new Error("addWebSeed must be passed a string or connection object with id property"));if(i=t,e=i.connId,this._peers[e])return this.emit("warning",new Error(`ignoring duplicate web seed: ${e}`)),void this.emit("invalidPeer",e)}this._debug("add web seed %s",e);const r=L.createWebSeedPeer(i,e,this,this.client.throttleGroups);this._registerPeer(r),this.emit("peer",e)}_addIncomingPeer(t){return this.destroyed?t.destroy(new Error("torrent is destroyed")):this.paused?t.destroy(new Error("torrent is paused")):(this._debug("add incoming peer %s",t.id),void this._registerPeer(t))}_registerPeer(t){t.on("download",(t=>{this.destroyed||(this.received+=t,this._downloadSpeed(t),this.client._downloadSpeed(t),this.emit("download",t),this.destroyed||this.client.emit("download",t))})),t.on("upload",(t=>{this.destroyed||(this.uploaded+=t,this._uploadSpeed(t),this.client._uploadSpeed(t),this.emit("upload",t),this.destroyed||this.client.emit("upload",t))})),this._peers[t.id]=t,this._peersLength+=1}removePeer(t){const e=t&&t.id||t;(t=this._peers[e])&&(this._debug("removePeer %s",e),delete this._peers[e],this._peersLength-=1,t.destroy(),this._drain())}select(t,e,i,r){if(this.destroyed)throw new Error("torrent is destroyed");if(t<0||e<t||this.pieces.length<=e)throw new Error(`invalid selection ${t} : ${e}`);i=Number(i)||0,this._debug("select %s-%s (priority %s)",t,e,i),this._selections.push({from:t,to:e,offset:0,priority:i,notify:r||V}),this._selections.sort(((t,e)=>e.priority-t.priority)),this._updateSelections()}deselect(t,e,i){if(this.destroyed)throw new Error("torrent is destroyed");i=Number(i)||0,this._debug("deselect %s-%s (priority %s)",t,e,i);for(let r=0;r<this._selections.length;++r){const n=this._selections[r];if(n.from===t&&n.to===e&&n.priority===i){this._selections.splice(r,1);break}}this._updateSelections()}critical(t,e){if(this.destroyed)throw new Error("torrent is destroyed");this._debug("critical %s-%s",t,e);for(let i=t;i<=e;++i)this._critical[i]=!0;this._updateSelections()}_onWire(t,e){if(this._debug("got wire %s (%s)",t._debugId,e||"Unknown"),this.wires.push(t),e){const i=u(e);t.remoteAddress=i[0],t.remotePort=i[1]}this.client.dht&&this.client.dht.listening&&t.on("port",(i=>{if(!this.destroyed&&!this.client.dht.destroyed){if(!t.remoteAddress)return this._debug("ignoring PORT from peer with no address");if(0===i||i>65536)return this._debug("ignoring invalid PORT from peer");this._debug("port: %s (from %s)",i,e),this.client.dht.addNode({host:t.remoteAddress,port:i})}})),t.on("timeout",(()=>{this._debug("wire timeout (%s)",e),t.destroy()})),"webSeed"!==t.type&&t.setTimeout(3e4,!0),t.setKeepAlive(!0),t.use(B(this.metadata)),t.ut_metadata.on("warning",(t=>{this._debug("ut_metadata warning: %s",t.message)})),this.metadata||(t.ut_metadata.on("metadata",(t=>{this._debug("got metadata via ut_metadata"),this._onMetadata(t)})),t.ut_metadata.fetch()),"function"!=typeof R||this.private||(t.use(R()),t.ut_pex.on("peer",(t=>{this.done||(this._debug("ut_pex: got peer: %s (from %s)",t,e),this.addPeer(t))})),t.ut_pex.on("dropped",(t=>{const i=this._peers[t];i&&!i.connected&&(this._debug("ut_pex: dropped peer: %s (from %s)",t,e),this.removePeer(t))})),t.once("close",(()=>{t.ut_pex.reset()}))),t.use(y()),this.emit("wire",t,e),this.metadata&&T((()=>{this._onWireWithMetadata(t)}))}_onWireWithMetadata(t){let e=null;const i=()=>{this.destroyed||t.destroyed||(this._numQueued>2*(this._numConns-this.numPeers)&&t.amInterested?t.destroy():(e=setTimeout(i,F),e.unref&&e.unref()))};let r;const n=()=>{if(t.peerPieces.buffer.length===this.bitfield.buffer.length){for(r=0;r<this.pieces.length;++r)if(!t.peerPieces.get(r))return;t.isSeeder=!0,t.choke()}};t.on("bitfield",(()=>{n(),this._update(),this._updateWireInterest(t)})),t.on("have",(()=>{n(),this._update(),this._updateWireInterest(t)})),t.lt_donthave.on("donthave",(()=>{n(),this._update(),this._updateWireInterest(t)})),t.on("have-all",(()=>{t.isSeeder=!0,t.choke(),this._update(),this._updateWireInterest(t)})),t.on("have-none",(()=>{t.isSeeder=!1,this._update(),this._updateWireInterest(t)})),t.on("allowed-fast",(t=>{this._update()})),t.once("interested",(()=>{t.unchoke()})),t.once("close",(()=>{clearTimeout(e)})),t.on("choke",(()=>{clearTimeout(e),e=setTimeout(i,F),e.unref&&e.unref()})),t.on("unchoke",(()=>{clearTimeout(e),this._update()})),t.on("request",((e,i,r,n)=>{if(r>131072)return t.destroy();this.pieces[e]||this.store.get(e,{offset:i,length:r},n)})),t.hasFast&&this._hasAllPieces()?t.haveAll():t.hasFast&&this._hasNoPieces()?t.haveNone():t.bitfield(this.bitfield),this._updateWireInterest(t),t.peerExtensions.dht&&this.client.dht&&this.client.dht.listening&&t.port(this.client.dht.address().port),"webSeed"!==t.type&&(e=setTimeout(i,F),e.unref&&e.unref()),t.isSeeder=!1,n()}_updateSelections(){this.ready&&!this.destroyed&&(T((()=>{this._gcSelections()})),this._updateInterest(),this._update())}_gcSelections(){for(let t=0;t<this._selections.length;++t){const e=this._selections[t],i=e.offset;for(;this.bitfield.get(e.from+e.offset)&&e.from+e.offset<e.to;)e.offset+=1;i!==e.offset&&e.notify(),e.to===e.from+e.offset&&this.bitfield.get(e.from+e.offset)&&(this._selections.splice(t,1),t-=1,e.notify(),this._updateInterest())}this._selections.length||this.emit("idle")}_updateInterest(){const t=this._amInterested;this._amInterested=!!this._selections.length,this.wires.forEach((t=>this._updateWireInterest(t))),t!==this._amInterested&&(this._amInterested?this.emit("interested"):this.emit("uninterested"))}_updateWireInterest(t){let e=!1;for(let i=0;i<this.pieces.length;++i)if(this.pieces[i]&&t.peerPieces.get(i)){e=!0;break}e?t.interested():t.uninterested()}_update(){if(this.destroyed)return;const t=A(this.wires);let e;for(;e=t();)this._updateWireWrapper(e)}_updateWireWrapper(t){const e=this;"undefined"!=typeof window&&"function"==typeof window.requestIdleCallback?window.requestIdleCallback((()=>{e._updateWire(t)}),{timeout:250}):e._updateWire(t)}_updateWire(t){const e=this,i=Z(t,.5);if(t.requests.length>=i)return;const r=Z(t,1);if(t.peerChoking)t.hasFast&&t.peerAllowedFastSet.length>0&&!this._hasMorePieces(t.peerAllowedFastSet.length-1)&&function(){if(t.requests.length>=r)return!1;for(const i of t.peerAllowedFastSet){if(t.peerPieces.get(i)&&!e.bitfield.get(i))for(;e._request(t,i,!1)&&t.requests.length<r;);if(!(t.requests.length<r))return!0}}();else{if(!t.downloaded)return function(){if(t.requests.length)return;let i=e._selections.length;for(;i--;){const r=e._selections[i];let s;if("rarest"===e.strategy){const i=r.from+r.offset,o=r.to,a=o-i+1,h={};let u=0;const l=n(i,o,h);for(;u<a&&(s=e._rarityMap.getRarestPiece(l),!(s<0));){if(e._request(t,s,!1))return;h[s]=!0,u+=1}}else for(s=r.to;s>=r.from+r.offset;--s)if(t.peerPieces.get(s)&&e._request(t,s,!1))return}}();o(!1)||o(!0)}function n(e,i,r,n){return s=>s>=e&&s<=i&&!(s in r)&&t.peerPieces.get(s)&&(!n||n(s))}function s(t){let i=t;for(let r=t;r<e._selections.length&&e._selections[r].priority;r++)i=r;const r=e._selections[t];e._selections[t]=e._selections[i],e._selections[i]=r}function o(i){if(t.requests.length>=r)return!0;const o=function(){const i=t.downloadSpeed()||1;if(i>q)return()=>!0;const r=Math.max(1,t.requests.length)*E.BLOCK_LENGTH/i;let n=10,s=0;return t=>{if(!n||e.bitfield.get(t))return!0;let o=e.pieces[t].missing;for(;s<e.wires.length;s++){const a=e.wires[s],h=a.downloadSpeed();if(!(h<q)&&!(h<=i)&&a.peerPieces.get(t)&&!((o-=h*r)>0))return n--,!1}return!0}}();for(let a=0;a<e._selections.length;a++){const h=e._selections[a];let u;if("rarest"===e.strategy){const l=h.from+h.offset,c=h.to,d=c-l+1,f={};let p=0;const m=n(l,c,f,o);for(;p<d&&(u=e._rarityMap.getRarestPiece(m),!(u<0));){for(;e._request(t,u,e._critical[u]||i)&&t.requests.length<r;);if(!(t.requests.length<r))return h.priority&&s(a),!0;f[u]=!0,p++}}else for(u=h.from+h.offset;u<=h.to;u++)if(t.peerPieces.get(u)&&o(u)){for(;e._request(t,u,e._critical[u]||i)&&t.requests.length<r;);if(!(t.requests.length<r))return h.priority&&s(a),!0}}return!1}}_rechoke(){if(!this.ready)return;const t=this.wires.map((t=>({wire:t,random:Math.random()}))).sort(((t,e)=>{const i=t.wire,r=e.wire;return i.downloadSpeed()!==r.downloadSpeed()?i.downloadSpeed()-r.downloadSpeed():i.uploadSpeed()!==r.uploadSpeed()?i.uploadSpeed()-r.uploadSpeed():i.amChoking!==r.amChoking?i.amChoking?-1:1:t.random-e.random})).map((t=>t.wire));this._rechokeOptimisticTime<=0?this._rechokeOptimisticWire=null:this._rechokeOptimisticTime-=1;let e=0;for(;t.length>0&&e<this._rechokeNumSlots-1;){const i=t.pop();i.isSeeder||i===this._rechokeOptimisticWire||(i.unchoke(),i.peerInterested&&e++)}if(null===this._rechokeOptimisticWire&&this._rechokeNumSlots>0){const e=t.filter((t=>t.peerInterested));if(e.length>0){const t=e[(i=e.length,Math.random()*i|0)];t.unchoke(),this._rechokeOptimisticWire=t,this._rechokeOptimisticTime=2}}var i;t.filter((t=>t!==this._rechokeOptimisticWire)).forEach((t=>t.choke()))}_hotswap(t,e){const i=t.downloadSpeed();if(i<E.BLOCK_LENGTH)return!1;if(!this._reservations[e])return!1;const r=this._reservations[e];if(!r)return!1;let n,s,o=1/0;for(s=0;s<r.length;s++){const e=r[s];if(!e||e===t)continue;const a=e.downloadSpeed();a>=q||2*a>i||a>o||(n=e,o=a)}if(!n)return!1;for(s=0;s<r.length;s++)r[s]===n&&(r[s]=null);for(s=0;s<n.requests.length;s++){const t=n.requests[s];t.piece===e&&this.pieces[e].cancel(t.offset/E.BLOCK_LENGTH|0)}return this.emit("hotswap",n,t,e),!0}_request(t,e,i){const r=this,n=t.requests.length,s="webSeed"===t.type;if(r.bitfield.get(e))return!1;const o=s?Math.min(function(t,e,i){return 1+Math.ceil(1*t.downloadSpeed()/i)}(t,0,r.pieceLength),r.maxWebConns):Z(t,1);if(n>=o)return!1;const a=r.pieces[e];let h=s?a.reserveRemaining():a.reserve();if(-1===h&&i&&r._hotswap(t,e)&&(h=s?a.reserveRemaining():a.reserve()),-1===h)return!1;let u=r._reservations[e];u||(u=r._reservations[e]=[]);let l=u.indexOf(null);-1===l&&(l=u.length),u[l]=t;const c=a.chunkOffset(h),d=s?a.chunkLengthRemaining(h):a.chunkLength(h);function f(){T((()=>{r._update()}))}return t.request(e,c,d,(function i(n,o){if(r.destroyed)return;if(!r.ready)return r.once("ready",(()=>{i(n,o)}));if(u[l]===t&&(u[l]=null),a!==r.pieces[e])return f();if(n)return r._debug("error getting piece %s (offset: %s length: %s) from %s: %s",e,c,d,`${t.remoteAddress}:${t.remotePort}`,n.message),s?a.cancelRemaining(h):a.cancel(h),void f();if(r._debug("got piece %s (offset: %s length: %s) from %s",e,c,d,`${t.remoteAddress}:${t.remotePort}`),!a.set(h,o,t))return f();const p=a.flush();I(p,(t=>{r.destroyed||(t===r._hashes[e]?(r._debug("piece verified %s",e),r.store.put(e,p,(t=>{t?r._destroy(t):(r.pieces[e]=null,r._markVerified(e),r.wires.forEach((t=>{t.have(e)})),r._checkDone()&&!r.destroyed&&r.discovery.complete(),f())}))):(r.pieces[e]=new E(a.length),r.emit("warning",new Error(`Piece ${e} failed verification`)),f()))}))})),!0}_checkDone(){if(this.destroyed)return;this.files.forEach((t=>{if(!t.done){for(let e=t._startPiece;e<=t._endPiece;++e)if(!this.bitfield.get(e))return;t.done=!0,t.emit("done"),this._debug(`file done: ${t.name}`)}}));let t=!0;for(const e of this._selections){for(let i=e.from;i<=e.to;i++)if(!this.bitfield.get(i)){t=!1;break}if(!t)break}return!this.done&&t?(this.done=!0,this._debug(`torrent done: ${this.infoHash}`),this.emit("done")):this.done=!1,this._gcSelections(),t}load(t,e){if(this.destroyed)throw new Error("torrent is destroyed");if(!this.ready)return this.once("ready",(()=>{this.load(t,e)}));Array.isArray(t)||(t=[t]),e||(e=V);const i=new _(t),r=new d(this.store,this.pieceLength);S(i,r,(t=>{if(t)return e(t);this._markAllVerified(),this._checkDone(),e(null)}))}createServer(t){if("function"!=typeof D)throw new Error("node.js-only method");if(this.destroyed)throw new Error("torrent is destroyed");const e=new D(this,t);return this._servers.push(e),e}pause(){this.destroyed||(this._debug("pause"),this.paused=!0)}resume(){this.destroyed||(this._debug("resume"),this.paused=!1,this._drain())}_debug(){const t=[].slice.call(arguments);t[0]=`[${this.client?this.client._debugId:"No Client"}] [${this._debugId}] ${t[0]}`,U(...t)}_drain(){if(this._debug("_drain numConns %s maxConns %s",this._numConns,this.client.maxConns),"function"!=typeof o.connect||this.destroyed||this.paused||this._numConns>=this.client.maxConns)return;this._debug("drain (%s queued, %s/%s peers)",this._numQueued,this.numPeers,this.client.maxConns);const t=this._queue.shift();if(!t)return;this._debug("%s connect attempt to %s",t.type,t.addr);const e=u(t.addr),i={host:e[0],port:e[1]};this.client.utp&&"utpOutgoing"===t.type?t.conn=N.connect(i.port,i.host):t.conn=o.connect(i);const r=t.conn;r.once("connect",(()=>{t.onConnect()})),r.once("error",(e=>{t.destroy(e)})),t.startConnectTimeout(),r.on("close",(()=>{if(this.destroyed)return;if(t.retries>=H.length){if(this.client.utp){const e=this._addPeer(t.addr,"tcp");e&&(e.retries=0)}else this._debug("conn %s closed: will not re-add (max %s attempts)",t.addr,H.length);return}const e=H[t.retries];this._debug("conn %s closed: will re-add to queue in %sms (attempt %s)",t.addr,e,t.retries+1);const i=setTimeout((()=>{if(this.destroyed)return;const e=u(t.addr)[0],i=this.client.utp&&this._isIPv4(e)?"utp":"tcp",r=this._addPeer(t.addr,i);r&&(r.retries=t.retries+1)}),e);i.unref&&i.unref()}))}_validAddr(t){let e;try{e=u(t)}catch(t){return!1}const i=e[0],r=e[1];return r>0&&r<65535&&!("127.0.0.1"===i&&r===this.client.torrentPort)}_isIPv4(t){return/^((?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/.test(t)}}},6695:(t,e,i)=>{var r=i(8764).Buffer;const{default:n}=i(8833),s=i(1227),o=i(6993),a=i(9417),h=i(4159),u=i(5228),l=s("webtorrent:webconn"),c=i(1907).version;t.exports=class extends u{constructor(t,e){super(),this.url=t,this.connId=t,this.webPeerId=h.sync(t),this._torrent=e,this._init()}_init(){this.setKeepAlive(!0),this.use(a()),this.once("handshake",((t,e)=>{if(this.destroyed)return;this.handshake(t,this.webPeerId);const i=this._torrent.pieces.length,r=new n(i);for(let t=0;t<=i;t++)r.set(t,!0);this.bitfield(r)})),this.once("interested",(()=>{l("interested"),this.unchoke()})),this.on("uninterested",(()=>{l("uninterested")})),this.on("choke",(()=>{l("choke")})),this.on("unchoke",(()=>{l("unchoke")})),this.on("bitfield",(()=>{l("bitfield")})),this.lt_donthave.on("donthave",(()=>{l("donthave")})),this.on("request",((t,e,i,r)=>{l("request pieceIndex=%d offset=%d length=%d",t,e,i),this.httpRequest(t,e,i,((e,i)=>{if(e){this.lt_donthave.donthave(t);const e=setTimeout((()=>{this.destroyed||this.have(t)}),1e4);e.unref&&e.unref()}r(e,i)}))}))}httpRequest(t,e,i,n){const s=t*this._torrent.pieceLength+e,a=s+i-1,h=this._torrent.files;let u;if(h.length<=1)u=[{url:this.url,start:s,end:a}];else{const t=h.filter((t=>t.offset<=a&&t.offset+t.length>s));if(t.length<1)return n(new Error("Could not find file corresponding to web seed range request"));u=t.map((t=>{const e=t.offset+t.length-1;return{url:this.url+("/"===this.url[this.url.length-1]?"":"/")+t.path,fileOffsetInRange:Math.max(t.offset-s,0),start:Math.max(s-t.offset,0),end:Math.min(e,a-t.offset)}}))}let d,f=0,p=!1;u.length>1&&(d=r.alloc(i)),u.forEach((r=>{const s=r.url,a=r.start,h=r.end;l("Requesting url=%s pieceIndex=%d offset=%d length=%d start=%d end=%d",s,t,e,i,a,h);const m={url:s,method:"GET",headers:{"user-agent":`WebTorrent/${c} (https://webtorrent.io)`,range:`bytes=${a}-${h}`},timeout:6e4};function g(t,e){if(t.statusCode<200||t.statusCode>=300){if(p)return;return p=!0,n(new Error(`Unexpected HTTP status code ${t.statusCode}`))}l("Got data of length %d",e.length),1===u.length?n(null,e):(e.copy(d,r.fileOffsetInRange),++f===u.length&&n(null,d))}o.concat(m,((t,e,i)=>{if(!p)return t?"undefined"==typeof window||s.startsWith(`${window.location.origin}/`)?(p=!0,n(t)):o.head(s,((e,i)=>{if(!p){if(e)return p=!0,n(e);if(i.statusCode<200||i.statusCode>=300)return p=!0,n(new Error(`Unexpected HTTP status code ${i.statusCode}`));if(i.url===s)return p=!0,n(t);m.url=i.url,o.concat(m,((t,e,i)=>{if(!p)return t?(p=!0,n(t)):void g(e,i)}))}})):void g(e,i)}))}))}destroy(){super.destroy(),this._torrent=null}}},6430:(t,e,i)=>{"use strict";var r=i(9804),n=i(3083),s=i(1924),o=s("Object.prototype.toString"),a=i(6410)(),h="undefined"==typeof globalThis?i.g:globalThis,u=n(),l=s("String.prototype.slice"),c={},d=i(882),f=Object.getPrototypeOf;a&&d&&f&&r(u,(function(t){if("function"==typeof h[t]){var e=new h[t];if(Symbol.toStringTag in e){var i=f(e),r=d(i,Symbol.toStringTag);if(!r){var n=f(i);r=d(n,Symbol.toStringTag)}c[t]=r.get}}}));var p=i(5692);t.exports=function(t){return!!p(t)&&(a&&Symbol.toStringTag in t?function(t){var e=!1;return r(c,(function(i,r){if(!e)try{var n=i.call(t);n===r&&(e=n)}catch(t){}})),e}(t):l(o(t),8,-1))}},2479:t=>{t.exports=function t(e,i){if(e&&i)return t(e)(i);if("function"!=typeof e)throw new TypeError("need wrapper function");return Object.keys(e).forEach((function(t){r[t]=e[t]})),r;function r(){for(var t=new Array(arguments.length),i=0;i<t.length;i++)t[i]=arguments[i];var r=e.apply(this,t),n=t[t.length-1];return"function"==typeof r&&r!==n&&Object.keys(n).forEach((function(t){r[t]=n[t]})),r}}},7529:t=>{t.exports=function(){for(var t={},i=0;i<arguments.length;i++){var r=arguments[i];for(var n in r)e.call(r,n)&&(t[n]=r[n])}return t};var e=Object.prototype.hasOwnProperty},950:()=>{},9354:()=>{},3762:()=>{},8333:()=>{},59:()=>{},6601:()=>{},9214:()=>{},8623:()=>{},2528:()=>{},970:()=>{},7748:()=>{},5568:()=>{},6619:()=>{},1982:()=>{},7108:()=>{},1156:()=>{},2361:()=>{},4616:()=>{},1356:()=>{},3719:()=>{},2378:()=>{},2067:()=>{},6322:()=>{},4854:()=>{},9608:()=>{},8856:()=>{},5688:()=>{},7525:()=>{},7523:()=>{},146:()=>{},2050:()=>{},3083:(t,e,i)=>{"use strict";var r=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],n="undefined"==typeof globalThis?i.g:globalThis;t.exports=function(){for(var t=[],e=0;e<r.length;e++)"function"==typeof n[r[e]]&&(t[t.length]=r[e]);return t}},882:(t,e,i)=>{"use strict";var r=i(210)("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(t){r=null}t.exports=r},4946:t=>{"use strict";t.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},5207:t=>{"use strict";t.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},1308:t=>{"use strict";t.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},9799:t=>{"use strict";t.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},8597:t=>{"use strict";t.exports={i8:"6.5.4"}},2562:t=>{"use strict";t.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')},876:t=>{"use strict";t.exports=JSON.parse('{".3gp":"video/3gpp",".aac":"audio/aac",".aif":"audio/x-aiff",".aiff":"audio/x-aiff",".atom":"application/atom+xml",".avi":"video/x-msvideo",".bmp":"image/bmp",".bz2":"application/x-bzip2",".conf":"text/plain",".css":"text/css",".csv":"text/plain",".diff":"text/x-diff",".doc":"application/msword",".flv":"video/x-flv",".gif":"image/gif",".gz":"application/x-gzip",".htm":"text/html",".html":"text/html",".ico":"image/vnd.microsoft.icon",".ics":"text/calendar",".iso":"application/octet-stream",".jar":"application/java-archive",".jpeg":"image/jpeg",".jpg":"image/jpeg",".js":"application/javascript",".json":"application/json",".less":"text/css",".log":"text/plain",".m3u":"audio/x-mpegurl",".m4a":"audio/x-m4a",".m4b":"audio/mp4",".m4p":"audio/mp4",".m4v":"video/x-m4v",".manifest":"text/cache-manifest",".markdown":"text/x-markdown",".mathml":"application/mathml+xml",".md":"text/x-markdown",".mid":"audio/midi",".midi":"audio/midi",".mov":"video/quicktime",".mp3":"audio/mpeg",".mp4":"video/mp4",".mp4v":"video/mp4",".mpeg":"video/mpeg",".mpg":"video/mpeg",".odp":"application/vnd.oasis.opendocument.presentation",".ods":"application/vnd.oasis.opendocument.spreadsheet",".odt":"application/vnd.oasis.opendocument.text",".oga":"audio/ogg",".ogg":"application/ogg",".pdf":"application/pdf",".png":"image/png",".pps":"application/vnd.ms-powerpoint",".ppt":"application/vnd.ms-powerpoint",".ps":"application/postscript",".psd":"image/vnd.adobe.photoshop",".qt":"video/quicktime",".rar":"application/x-rar-compressed",".rdf":"application/rdf+xml",".rss":"application/rss+xml",".rtf":"application/rtf",".svg":"image/svg+xml",".svgz":"image/svg+xml",".swf":"application/x-shockwave-flash",".tar":"application/x-tar",".tbz":"application/x-bzip-compressed-tar",".text":"text/plain",".tif":"image/tiff",".tiff":"image/tiff",".torrent":"application/x-bittorrent",".ttf":"application/x-font-ttf",".txt":"text/plain",".wav":"audio/wav",".webm":"video/webm",".wma":"audio/x-ms-wma",".wmv":"video/x-ms-wmv",".xls":"application/vnd.ms-excel",".xml":"application/xml",".yaml":"text/yaml",".yml":"text/yaml",".zip":"application/zip"}')},1907:t=>{"use strict";t.exports=JSON.parse('{"name":"webtorrent","description":"Streaming torrent client","version":"1.8.5","author":{"name":"WebTorrent LLC","email":"feross@webtorrent.io","url":"https://webtorrent.io"},"browser":{"./lib/server.js":false,"./lib/conn-pool.js":false,"./lib/utp.js":false,"bittorrent-dht/client":false,"fs":false,"fs-chunk-store":"memory-chunk-store","load-ip-set":false,"net":false,"os":false,"ut_pex":false},"browserify":{"transform":["package-json-versionify"]},"bugs":{"url":"https://github.com/webtorrent/webtorrent/issues"},"chromeapp":{"./lib/utp.js":false,"fs-chunk-store":"memory-chunk-store","http":"@webtorrent/http-node","load-ip-set":false,"net":"chrome-net","os":false},"dependencies":{"@webtorrent/http-node":"^1.3.0","addr-to-ip-port":"^1.5.4","bitfield":"^4.0.0","bittorrent-dht":"^10.0.2","bittorrent-protocol":"^3.5.1","cache-chunk-store":"^3.2.2","chrome-net":"^3.3.4","chunk-store-stream":"^4.3.0","cpus":"^1.0.3","create-torrent":"^5.0.1","debug":"^4.3.3","end-of-stream":"^1.4.4","escape-html":"^1.0.3","fs-chunk-store":"^2.0.4","immediate-chunk-store":"^2.2.0","load-ip-set":"^2.2.1","lt_donthave":"^1.0.1","memory-chunk-store":"^1.3.5","mime":"^3.0.0","multistream":"^4.1.0","package-json-versionify":"^1.0.4","parse-torrent":"^9.1.4","pump":"^3.0.0","queue-microtask":"^1.2.3","random-iterate":"^1.0.1","randombytes":"^2.1.0","range-parser":"^1.2.1","render-media":"^4.1.0","run-parallel":"^1.2.0","run-parallel-limit":"^1.1.0","simple-concat":"^1.0.1","simple-get":"^4.0.1","simple-peer":"^9.11.1","simple-sha1":"^3.1.0","speed-limiter":"^1.0.2","speedometer":"^1.1.0","stream-to-blob":"^2.0.1","stream-to-blob-url":"^3.0.2","stream-with-known-length-to-buffer":"^1.0.4","torrent-discovery":"^9.4.9","torrent-piece":"^2.0.1","unordered-array-remove":"^1.0.2","ut_metadata":"^3.5.2","ut_pex":"^3.0.2"},"devDependencies":{"@webtorrent/semantic-release-config":"1.0.7","airtap":"4.0.4","airtap-manual":"1.0.0","airtap-sauce":"1.1.2","babel-minify":"0.5.1","bittorrent-tracker":"9.18.4","browserify":"17.0.0","disc":"1.3.3","finalhandler":"1.1.2","network-address":"1.1.2","run-series":"1.1.9","semantic-release":"19.0.2","serve-static":"1.14.2","standard":"*","tape":"5.5.2","webtorrent-fixtures":"1.7.5"},"optionalDependencies":{"utp-native":"^2.5.3"},"engines":{"node":">=12"},"funding":[{"type":"github","url":"https://github.com/sponsors/feross"},{"type":"patreon","url":"https://www.patreon.com/feross"},{"type":"consulting","url":"https://feross.org/support"}],"homepage":"https://webtorrent.io","keywords":["bittorrent","bittorrent client","download","mad science","p2p","peer-to-peer","peers","streaming","swarm","torrent","web torrent","webrtc","webrtc data","webtorrent"],"license":"MIT","main":"index.js","repository":{"type":"git","url":"git://github.com/webtorrent/webtorrent.git"},"scripts":{"build":"npm run build-js && npm run build-js-worker && npm run build-chromeapp","build-chromeapp":"browserify --browser-field=chromeapp --standalone WebTorrent . | minify --mangle=false > webtorrent.chromeapp.js","build-chromeapp-debug":"browserify --browser-field=chromeapp --standalone WebTorrent . > webtorrent.chromeapp.js","build-js":"browserify --standalone WebTorrent . | minify --mangle=false > webtorrent.min.js","build-js-worker":"browserify ./lib/worker.js | minify --mangle=false > sw.min.js","build-js-debug":"browserify --standalone WebTorrent . > webtorrent.debug.js","build-js-worker-debug":"browserify ./lib/worker.js > sw.debug.js","prepublishOnly":"npm run build && npm run update-authors","preversion":"npm run build && npm run update-authors","size":"npm run size-js && npm run size-disc","size-disc":"browserify --full-paths . | discify --open","size-js":"npm run build && cat webtorrent.min.js | gzip | wc -c","test":"standard && npm run test-node && npm run test-browser","test-browser":"airtap --concurrency 1 -- test/*.js test/browser/*.js","test-browser-local":"airtap --preset local -- test/*.js test/browser/*.js","test-node":"tape test/*.js test/node/*.js","update-authors":"./scripts/update-authors.sh"},"standard":{"ignore":["webtorrent.min.js","sw.min.js","webtorrent.chromeapp.js"]},"renovate":{"extends":["github>webtorrent/renovate-config"],"rangeStrategy":"bump"},"release":{"extends":"@webtorrent/semantic-release-config"}}')}},e={};function i(r){var n=e[r];if(void 0!==n)return n.exports;var s=e[r]={id:r,loaded:!1,exports:{}};return t[r].call(s.exports,s,s.exports,i),s.loaded=!0,s.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r={};(()=>{"use strict";i.d(r,{L:()=>Wt});var t=i(221),e=i.n(t),n=i(3277),s=i(8473),o=i(2635),a=i(8764).Buffer,h=i(5108);const u=new Set(["ssa","ass"]),l=["readOrder","layer","style","name","marginL","marginR","marginV","effect","text"];function c(t,e){const i=t.Children.find((t=>t.id===e));return i?i.data:void 0}class d extends s.Transform{constructor(){super(),this.subtitleTracks=new Map,this.timecodeScale=1,this._currentClusterTimecode=null,this.decoder=new n.LE({bufferTagIds:[n.Av.TimecodeScale,n.Av.Tracks,n.Av.BlockGroup,n.Av.AttachedFile]}),this.decoder.on("data",this.parseEbmlSubtitles.bind(this))}parseEbmlSubtitles(t){if(t.id===n.Av.TimecodeScale&&(this.timecodeScale=t.data/1e6),t.id===n.Av.Timecode&&(this._currentClusterTimecode=t.data),t.id===n.Av.Tracks){for(const e of t.Children.filter((t=>t.id===n.Av.TrackEntry))){if(17!==c(e,n.Av.TrackType))continue;const t=c(e,n.Av.CodecID)||"";if(t.startsWith("S_TEXT")){const i={number:c(e,n.Av.TrackNumber),language:c(e,n.Av.Language),type:t.substring(7).toLowerCase()},r=c(e,n.Av.Name);r&&(i.name=r);const s=c(e,n.Av.CodecPrivate);s&&(i.header=s.toString()),e.Children.find((t=>t.id===n.Av.ContentEncodings&&t.Children.find((t=>t.id===n.Av.ContentEncoding&&t.Children.find((t=>t.id===n.Av.ContentCompression))))))&&(i._compressed=!0),this.subtitleTracks.set(i.number,i)}}this.emit("tracks",Array.from(this.subtitleTracks.values()))}if(t.id===n.Av.BlockGroup){const e=t.Children.find((t=>t.id===n.Av.Block));if(e&&this.subtitleTracks.has(e.track)){const i=c(t,n.Av.BlockDuration),r=this.subtitleTracks.get(e.track),s={text:(r._compressed?(0,o.inflateSync)(a.from(e.payload)):e.payload).toString("utf8"),time:(e.value+this._currentClusterTimecode)*this.timecodeScale,duration:i*this.timecodeScale};if(u.has(r.type)){const t=s.text.split(",");for(let e="ssa"===r.type?2:1;e<8;e++)s[l[e]]=t[e];s.text=t.slice(8).join(",")}this.emit("subtitle",s,e.track)}}t.id===n.Av.AttachedFile&&this.emit("file",{filename:c(t,n.Av.FileName),mimetype:c(t,n.Av.FileMimeType),data:c(t,n.Av.FileData)})}}class f extends d{constructor(){super(),this.decoder.on("data",(t=>{t.id===n.Av.Tracks&&0===this.subtitleTracks.size&&this.end()}))}_write(t,e,i){this.decoder.write(t),i(null,t)}}class p extends d{constructor(t){super(),t instanceof d&&(t.once("drain",(()=>t.end())),this.subtitleTracks=t.subtitleTracks,this.timecodeScale=t.timecodeScale,this.unstable=!0)}_transform(t,e,i){if(this.unstable){for(let e=0;e<t.length-12;e++)if(31===t[e]&&67===t[e+1]&&182===t[e+2]&&117===t[e+3]&&231===t[e+4+(8-Math.floor(Math.log2(t[e+4])))]){this.unstable=!1,this.decoderWrite(t.slice(e));break}}else this.decoderWrite(t);i(null,t)}decoderWrite(t){try{this.decoder.write(t)}catch(t){h.warn("[matroska-subtitles] EBML stream decoding error")}}}function m(t){return new Promise(((e,i)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>i(t.error)}))}function g(t,e){const i=(!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(t){var e=function(){return indexedDB.databases().finally(t)};r=setInterval(e,100),e()})).finally((function(){return clearInterval(r)})):Promise.resolve()).then((()=>{const i=indexedDB.open(t);return i.onupgradeneeded=()=>i.result.createObjectStore(e),m(i)}));var r;return(t,r)=>i.then((i=>r(i.transaction(e,t).objectStore(e))))}let b;function v(){return b||(b=g("keyval-store","keyval")),b}function y(t,e,i=v()){return i("readwrite",(i=>(i.put(e,t),m(i.transaction))))}function w(t,e=v()){return e("readwrite",(e=>(e.delete(t),m(e.transaction))))}const _=g("fsa-chunk-store","handles");(function(t=v()){return t("readonly",(e=>{if(e.getAll&&e.getAllKeys)return Promise.all([m(e.getAllKeys()),m(e.getAll())]).then((([t,e])=>t.map(((t,i)=>[t,e[i]]))));const i=[];return t("readonly",(t=>function(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},m(t.transaction)}(t,(t=>i.push([t.key,t.value]))).then((()=>i))))}))})(_).then((t=>{for(const[e,i]of t)i.removeEntry(e,{recursive:!0}),w(e,_)}));class M{constructor(t,e={}){if(this.chunkLength=Number(t),!this.chunkLength)throw new Error("First argument must be a chunk length");if(this.closed=!1,this.name=e.name||"default",this.rootDirPromise=e.rootDir||navigator.storage.getDirectory(),this.storageDirPromise=this._getStorageDirectoryHandle(),this.chunksDirPromise=e.files&&e.rootDir&&this._getChunksDirHandle()||this.storageDirPromise,this.chunks=[],this.chunkMap=[],this.directoryMap={},e.files&&e.rootDir){if(this.files=e.files.slice(0).map(((t,e,i)=>{if(null==t.path)throw new Error("File is missing `path` property");if(null==t.length)throw new Error("File is missing `length` property");if(null==t.offset)if(0===e)t.offset=0;else{const r=i[e-1];t.offset=r.offset+r.length}null==t.handle&&(t.handle=this._createFileHandle({path:t.path}));const r=t.offset,n=t.offset+t.length,s=Math.floor(r/this.chunkLength),o=Math.floor((n-1)/this.chunkLength);for(let e=s;e<=o;++e){const i=e*this.chunkLength,s=r<i?0:r-i,o=n>i+this.chunkLength?this.chunkLength:n-i,a=r>i?0:i-r;this.chunkMap[e]||(this.chunkMap[e]=[]),this.chunkMap[e].push({from:s,to:o,offset:a,file:t})}return t})),window.addEventListener("pagehide",this.cleanup),this.length=this.files.reduce(((t,e)=>t+e.length),0),null!=e.length&&e.length!==this.length)throw new Error("total `files` length is not equal to explicit `length` option")}else this.length=Number(e.length)||1/0;this.length!==1/0&&(this.lastChunkLength=this.length%this.chunkLength||this.chunkLength,this.lastChunkIndex=Math.ceil(this.length/this.chunkLength)-1)}async _getChunksDirHandle(){const t=await this.storageDirPromise;return await t.getDirectoryHandle("chunks",{create:!0})}async _getStorageDirectoryHandle(){const t=await this.rootDirPromise;return await t.getDirectoryHandle(this.name,{create:!0})}async _getChunk(t){let e=this.chunks[t];if(!e){const i=t.toString(),r=await this.chunksDirPromise;e=this.chunks[t]={fileHandlePromise:r.getFileHandle(i,{create:!0})}}return e}async _createFileHandle(t){const e=t.path.slice(t.path.lastIndexOf("/")+1);return(await this._getDirectoryHandle(t)).getFileHandle(e,{create:!0})}async _getDirectoryHandle(t){const e=t.path.lastIndexOf("/");if(-1===e||0===e)return this.storageDirPromise;const i=t.path=t.path.slice(0,e);if(!this.directoryMap[i]){const e=this._getDirectoryHandle(t);this.directoryMap[i]=(await e).getDirectoryHandle(i.slice(i.lastIndexOf("/")+1),{create:!0})}return this.directoryMap[i]}put(t,e,i=(()=>{})){if(this.closed)return void queueMicrotask((()=>i(new Error("Storage is closed"))));const r=t===this.lastChunkIndex;if(r&&e.length!==this.lastChunkLength)queueMicrotask((()=>{i(new Error(`Last chunk length must be ${this.lastChunkLength}`))}));else if(r||e.length===this.chunkLength){if((async()=>{try{const i=await this._getChunk(t),r=await i.fileHandlePromise,n=await r.createWritable({keepExistingData:!1});await n.write(e),await n.close()}catch(t){return void i(t)}this.files||i(null)})(),this.files){const r=this.chunkMap[t];r||queueMicrotask((()=>i(new Error("No files matching the request range"))));const n=r.map((t=>(async()=>{try{const{file:i}=t;i.stream||(i.stream=(await i.handle).createWritable({keepExistingData:!0}));const r=await i.stream;return await r.write({type:"write",position:t.offset,data:e.slice(t.from,t.to)}),null}catch(t){return i(t)}})()));Promise.all(n).then((()=>i(null)))}}else queueMicrotask((()=>{i(new Error(`Chunk length must be ${this.chunkLength}`))}))}get(t,e,i=(()=>{})){if("function"==typeof e)return this.get(t,null,e);if(this.closed)return void queueMicrotask((()=>i(new Error("Storage is closed"))));const r=t===this.lastChunkIndex?this.lastChunkLength:this.chunkLength;e||(e={});const n=e.offset||0,s=e.length?n+e.length:r,o=e.length||r-n;if(!this.files||this.chunks[t])(async()=>{let e;try{const i=await this._getChunk(t),s=await i.fileHandlePromise;let a=await s.getFile();0===n&&o===r||(a=a.slice(n,o+n)),e=await a.arrayBuffer()}catch(t){return void i(t)}if(0===e.byteLength){const e=new Error(`Index ${t} does not exist`);return e.notFound=!0,void i(e)}i(null,new Uint8Array(e))})();else{let r=this.chunkMap[t];if(r||queueMicrotask((()=>i(new Error("No files matching the request range")))),e&&(r=r.filter((t=>t.to>n&&t.from<s)),0===r.length&&queueMicrotask((()=>i(new Error("No files matching the request range"))))),n===s)return queueMicrotask((()=>i(null,new Uint8Array(0))));const o=r.map((t=>(async()=>{let i=t.from,r=t.to,o=t.offset;e&&(r>s&&(r=s),i<n&&(o+=n-i,i=n));try{const e=await t.file.handle,n=(await e.getFile()).slice(o,o+r-i);return await n.arrayBuffer()}catch(t){return t}})()));Promise.all(o).then((t=>{1===t.length?i(null,new Uint8Array(t[0])):new Blob(t).arrayBuffer().then((t=>{i(null,new Uint8Array(t))}))}))}}async close(t=(()=>{}),e){this.closed?queueMicrotask((()=>t(new Error("Storage is closed")))):(this.closed=!0,this.chunkMap=[],this.directoryMap={},await this.cleanup(e),queueMicrotask((()=>{t(null)})))}async cleanup(t){if(this.chunks=[],this.files){const e=[];for(const t of this.files)t.stream&&(e.push(await(await t.stream).close()),t.stream=null);if(!0!==t){const t=await this.storageDirPromise;y("chunks",t,_),await t.removeEntry("chunks",{recursive:!0}),w("chunks",_)}await Promise.all(e)}}async destroy(t=(()=>{})){if(this.closed)return void queueMicrotask((()=>t(new Error("Storage is closed"))));const e=await this.rootDirPromise;y(this.name,e,_),this.close((async()=>{try{await e.removeEntry(this.name,{recursive:!0}),w(this.name,_)}catch(e){return void t(e)}t(null)}),!0)}}var k=i(4137),x=i(1191),E=i(9421);const S=!!window.chrome;class T{constructor(t,e={}){if(this.chunkLength=Number(t),!this.chunkLength)throw new Error("First argument must be a chunk length");this.length=Number(e.length)||1/0,this.fallbackStore=null,this.chunkCount=null,this.stores=[],this.chunks=[];const i=(t,i)=>{const r=e;if(i&&i<this.length){this.chunkCount=Math.floor(i/this.chunkLength);const t=this.chunkCount*this.chunkLength;r.length=this.length-t,this.fallbackStore=new x(this.chunkLength,r),this.stores.push(this.fallbackStore),r.length=t}const n=new E(new t(this.chunkLength,r),{max:e.max||20});this.stores.push(n),this.chunkCount?(this.chunks[this.chunkCount-1]=n,this.chunks.fill(n)):this.fallbackStore=n};this.registration=navigator.storage.estimate().then((t=>{const r=t.quota-t.usage-Math.max(Number(e.reserved)||0,16777216);!0===e.onlyMem||r<=0?(this.fallbackStore=new x(this.chunkLength,e),this.stores.push(this.fallbackStore),this.chunkCount=0):"getDirectory"in navigator.storage?i(M,!e.rootDir&&r):i(k,!(S&&2147483648===t.quota)&&r)}))}get(t,e,i){this.registration.then((()=>{this.chunks[t]?this.chunks[t].get(t,e,i):this.fallbackStore.get(t-this.chunkCount,e,i)}))}put(t,e,i){this.registration.then((()=>{this.chunks[t]?this.chunks[t].put(t,e,i):this.fallbackStore.put(t-this.chunkCount,e,i)}))}close(t=(()=>{})){const e=[];for(const t of this.stores)e.push(new Promise((e=>t.close(e))));Promise.all(e).then((e=>{e=e.filter((t=>t)),t(e.length>1?e:e[0])}))}destroy(t=(()=>{})){const e=[];for(const t of this.stores)e.push(new Promise((e=>t.destroy(e))));Promise.all(e).then((e=>{e=e.filter((t=>t)),t(e.length>1?e:e[0])}))}}var A=i(5108);class I{constructor(t={}){if(window.Worker){if(this.canvas=t.canvas,this.renderMode=t.renderMode||"offscreen","blend"!==this.renderMode&&"normal"!==this.renderMode&&("undefined"==typeof createImageBitmap?this.renderMode="normal":"undefined"!=typeof OffscreenCanvas&&(this.renderMode="offscreen")),this.targetFps=t.targetFps||23.976,this.prescaleTradeoff=t.prescaleTradeoff||null,this.softHeightLimit=t.softHeightLimit||1080,this.hardHeightLimit=t.hardHeightLimit||2160,this.resizeVariation=t.resizeVariation||.2,this.video=t.video,this.canvasParent=null,this.onReadyEvent=t.onReady,this.onErrorEvent=t.onError,this.debug=!!t.debug,this.lastRenderTime=0,this.timeOffset=t.timeOffset||0,this.renderedItems=[],this.renderAhead=1024*(t.renderAhead||0)*1024*.9,this.oneshotState={eventStart:null,eventOver:!1,iteration:0,renderRequested:!1,requestNextTimestamp:-1,prevWidth:null,prevHeight:null},this.renderFrameData=null,this.workerActive=!1,this.frameId=0,this.workerActive=!1,this.worker||(this.worker=new Worker(t.workerUrl||"subtitles-octopus-worker.js"),this.worker.onmessage=t=>this.onWorkerMessage(t),this.worker.onerror=t=>this.workerError(t)),this.createCanvas(),this.setVideo(t.video),this.worker.postMessage({target:"worker-init",width:this.canvas.width,height:this.canvas.height,URL:document.URL,currentScript:t.workerUrl||"subtitles-octopus-worker.js",preMain:!0,renderMode:this.renderMode,subUrl:t.subUrl,subContent:t.subContent||null,fallbackFont:t.fallbackFont||null,lazyFontLoading:t.lazyFontLoading||!1,fonts:t.fonts||[],availableFonts:t.availableFonts||[],debug:this.debug,targetFps:this.targetFps,libassMemoryLimit:t.libassMemoryLimit||0,libassGlyphLimit:t.libassGlyphLimit||0,renderOnDemand:this.renderAhead>0,dropAllAnimations:!!t.dropAllAnimations}),"offscreen"===this.renderMode&&this.pushOffscreenCanvas(),this.initDone=!0,(()=>{if("function"==typeof ImageData.prototype.constructor)try{return new ImageData(new Uint8ClampedArray([0,0,0,0]),1,1)}catch(t){A.log("detected that ImageData is not constructable despite browser saying so")}const t=document.createElement("canvas").getContext("2d");window.ImageData=()=>{let e,i=0;arguments[0]instanceof Uint8ClampedArray&&(e=arguments[i++]);const r=arguments[i++],n=arguments[i],s=t.createImageData(r,n);return e&&s.data.set(e),s}})(),"offscreen"!==this.renderMode){this.ctx=this.canvas.getContext("2d"),this.bufferCanvas=document.createElement("canvas"),this.bufferCanvasCtx=this.bufferCanvas.getContext("2d"),this.bufferCanvas.width=1,this.bufferCanvas.height=1;const t=new Uint8ClampedArray([0,255,0,0]),e=new ImageData(t,1,1);this.bufferCanvasCtx.clearRect(0,0,1,1),this.ctx.clearRect(0,0,1,1);const i=this.ctx.getImageData(0,0,1,1).data;this.bufferCanvasCtx.putImageData(e,0,0),this.ctx.drawImage(this.bufferCanvas,0,0);const r=this.ctx.getImageData(0,0,1,1).data;this.hasAlphaBug=i[1]!==r[1],this.hasAlphaBug&&A.log("Detected a browser having issue with transparent pixels, applying workaround")}}else this.workerError("worker not supported")}workerError(t){if(A.error("Worker error: ",t),this.onErrorEvent&&this.onErrorEvent(t),!this.debug)throw this.destroy(),new Error("Worker error: "+t)}pushOffscreenCanvas(){const t=this.canvas.transferControlToOffscreen();this.worker.postMessage({target:"offscreenCanvas",canvas:t},[t])}createCanvas(){this.video?(this.canvas=document.createElement("canvas"),this.canvas.className="subtitles-octopus-canvas",this.canvas.style.display="none",this.canvasParent=document.createElement("div"),this.canvasParent.className="subtitles-octopus-canvas-parent",this.canvasParent.appendChild(this.canvas),this.video.nextSibling?this.video.parentNode.insertBefore(this.canvasParent,this.video.nextSibling):this.video.parentNode.appendChild(this.canvasParent)):this.canvas||this.workerError("Don't know where to render: you should give video or canvas in options.")}setVideo(t){if(this.video=t,this.video){let e=this.video.paused;const i=i=>{null!=i&&(e=i),this.setCurrentTime(this.video.paused||e,t.currentTime+this.timeOffset)};this.video.addEventListener("timeupdate",(()=>i()),!1),this.video.addEventListener("progress",(()=>i()),!1),this.video.addEventListener("waiting",(()=>i(!0)),!1),this.video.addEventListener("pause",(()=>i(!0)),!1),this.video.addEventListener("seeking",(()=>i(!0)),!1),this.video.addEventListener("playing",(()=>i(!1)),!1),this.video.addEventListener("seeked",(()=>{i(!1),this.renderAhead>0&&this._cleanPastRendered(this.video.currentTime+this.timeOffset,!0)}),!1),this.video.addEventListener("ratechange",this.setRate.bind(this),!1),"undefined"!=typeof ResizeObserver&&(this.ro=new ResizeObserver(this.resize.bind(this,0,0,0,0)),this.ro.observe(this.video)),this.video.videoWidth>0?this.resize():this.video.addEventListener("loadedmetadata",this.resize.bind(this,0,0,0,0),!1)}}getVideoPosition(){const t=this.video.videoWidth/this.video.videoHeight,{offsetWidth:e,offsetHeight:i}=this.video;let r=e,n=i;return e/i>t?r=Math.floor(i*t):n=Math.floor(e/t),{width:r,height:n,x:(e-r)/2,y:(i-n)/2}}_cleanPastRendered(t,e){let i=[];for(const e of this.renderedItems)(e.emptyFinish<0||e.emptyFinish>=t)&&i.push(e);if(e&&i.length>0&&t<i[0].eventStart)if(i[0].eventStart-t>60)A.info("seeked back too far, cleaning prerender buffer"),i=[];else{A.info("seeked backwards, need to free up some buffer");let t=0;const e=.3*this.renderAhead,r=[];for(const n of i){if(t+=n.size,t>=e)break;r.push(n)}i=r}const r=i.length<this.renderedItems;return this.renderedItems=i,r}processOneshot(t){if(t.iteration!==this.oneshotState.iteration)return void A.debug("received stale prerender, ignoring");this.debug&&A.info("oneshot received (start="+t.eventStart+", empty="+t.emptyFinish+"), render: "+Math.round(t.spentTime)+" ms"),this.oneshotState.renderRequested=!1,Math.abs(t.lastRenderedTime-this.oneshotState.requestNextTimestamp)<.01&&(this.oneshotState.requestNextTimestamp=-1),t.eventStart-t.lastRenderedTime>.01&&this.renderedItems.push({eventStart:t.lastRenderedTime,eventFinish:t.lastRenderedTime-.001,emptyFinish:t.eventStart,viewport:t.viewport,spentTime:0,blendTime:0,items:[],animated:!1,size:0});const e=[];let i=0;for(const r of t.canvases)e.push({...r,image:new ImageData(new Uint8ClampedArray(r.buffer),r.w,r.h)}),i+=r.buffer.byteLength;let r=!1;if(t.emptyFinish>0&&t.emptyFinish-t.eventStart<1/this.targetFps||t.animated){const e=t.eventStart+1/this.targetFps;t.emptyFinish=e,t.eventFinish=e,r=!0}this.renderedItems.push({...t,items:e,size:i}),this.renderedItems.sort(((t,e)=>t.eventStart-e.eventStart)),this.oneshotState.requestNextTimestamp>=0?this.tryRequestOneshot(this.oneshotState.requestNextTimestamp,!0):t.eventStart<0?A.info('oneshot received "end of frames" event'):t.emptyFinish>=0?this.tryRequestOneshot(t.emptyFinish,r):A.info("there are no more events to prerender")}tryRequestOneshot(t,e){if(!this.renderAhead||this.renderAhead<=0)return;if(this.oneshotState.renderRequested&&!e)return;if(void 0===t){if(!this.video)return;t=this.video.currentTime+this.timeOffset}let i=0;for(const e of this.renderedItems){if(e.emptyFinish<0)return void A.info("oneshot already reached end-of-events");if(t>=e.eventStart&&t<e.emptyFinish)return void A.debug("not requesting a render for "+t+" as event already covering it exists (start="+e.eventStart+", empty="+e.emptyFinish+")");i+=e.size}if(i<=this.renderAhead){const i=t-(e?0:.001);this.oneshotState.renderRequested?(this.workerActive&&A.info("worker busy, requesting to seek"),this.oneshotState.requestNextTimestamp=i):(this.oneshotState.renderRequested=!0,this.worker.postMessage({target:"oneshot-render",lastRendered:i,renderNow:e,iteration:this.oneshotState.iteration}))}}_renderSubtitleEvent(t,e){const i=t.eventFinish<e;if(this.oneshotState.eventStart===t.eventStart&&this.oneshotState.eventOver===i)return;this.oneshotState.eventStart=t.eventStart,this.oneshotState.eventOver=i;const r=performance.now();if(t.viewport.width===this.canvas.width&&t.viewport.height===this.canvas.height||(this.canvas.width=t.viewport.width,this.canvas.height=t.viewport.height),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),!i)for(const e of t.items)this.bufferCanvas.width=e.w,this.bufferCanvas.height=e.h,this.bufferCanvasCtx.putImageData(e.image,0,0),this.ctx.drawImage(this.bufferCanvas,e.x,e.y);if(this.debug){const e=Math.round(performance.now()-r);A.log("render: "+Math.round(t.spentTime-t.blendTime)+" ms, blend: "+Math.round(t.blendTime)+" ms, draw: "+e+" ms")}}oneshotRender(){if(window.requestAnimationFrame(this.oneshotRender),!this.video)return;const t=this.video.currentTime+this.timeOffset;let e=-1,i=!1,r=!1;for(const n of this.renderedItems)if(!i&&n.eventStart<=t&&(n.emptyFinish<0||n.emptyFinish>t))this._renderSubtitleEvent(n,t),i=!0,e=n.emptyFinish;else if(e>=0){if(!(n.eventStart-e<.01))break;e=n.emptyFinish,r=n.animated}i?this._cleanPastRendered(t)&&e>=0&&this.tryRequestOneshot(e,r):Math.abs(this.oneshotState.requestNextTimestamp-t)>.01&&(this._cleanPastRendered(t),this.tryRequestOneshot(t,!0))}resetRenderAheadCache(t){if(this.renderAhead>0){const e=[];if(t&&this.oneshotState.prevHeight&&this.oneshotState.prevWidth){if(this.oneshotState.prevHeight===this.canvas.height&&this.oneshotState.prevWidth===this.canvas.width)return;let t=10,i=.3*this.renderAhead;this.canvas.height>=this.oneshotState.prevHeight*(1-this.resizeVariation)&&this.canvas.height<=this.oneshotState.prevHeight*(1+this.resizeVariation)&&this.canvas.width>=this.oneshotState.prevWidth*(1-this.resizeVariation)&&this.canvas.width<=this.oneshotState.prevWidth*(1+this.resizeVariation)&&(A.debug("viewport changes are small, leaving more of prerendered buffer"),t=30,i=.5*this.renderAhead);const r=this.video.currentTime+this.timeOffset+t;let n=0;for(const t of this.renderedItems){if(t.emptyFinish<0||t.emptyFinish>=r)break;if(n+=t.size,n>=i)break;e.push(t)}}A.info("resetting prerender cache"),this.renderedItems=e,this.oneshotState.eventStart=null,this.oneshotState.iteration++,this.oneshotState.renderRequested=!1,this.oneshotState.prevHeight=this.canvas.height,this.oneshotState.prevWidth=this.canvas.width,window.requestAnimationFrame(this.oneshotRender),this.tryRequestOneshot(void 0,!0)}}renderFrames(t){const e=performance.now();this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height);for(const e of t.canvases){this.bufferCanvas.width=e.w,this.bufferCanvas.height=e.h;const t=new Uint8ClampedArray(e.buffer);if(this.hasAlphaBug)for(let e=3;e<t.length;e+=4)t[e]=t[e]>=1?t[e]:1;const i=new ImageData(t,e.w,e.h);this.bufferCanvasCtx.putImageData(i,0,0),this.ctx.drawImage(this.bufferCanvas,e.x,e.y)}if(this.debug){const i=performance.now()-e,r=t.blendTime;void 0!==r?A.log("render: "+Math.round(t.spentTime-r)+" ms, blend: "+Math.round(r)+" ms, draw: "+i+" ms; TOTAL="+Math.round(t.spentTime+i)+" ms"):A.log({length:t.canvases.length,sum:t.libassTime+t.decodeTime+i,libassTime:t.libassTime,decodeTime:t.decodeTime,drawTime:i}),this.renderStart=performance.now()}}renderFastFrames(t){const e=performance.now();this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height);for(const e of t.bitmaps)this.ctx.drawImage(e.bitmap,e.x,e.y);if(this.debug){const i=performance.now()-e;A.log({length:t.bitmaps.length,sum:t.libassTime+t.decodeTime+i,libassTime:t.libassTime,decodeTime:t.decodeTime,drawTime:i}),this.renderStart=performance.now()}}_computeCanvasSize(t,e){return null===this.prescaleTradeoff?e>this.hardHeightLimit&&(t=t*this.hardHeightLimit/e,e=this.hardHeightLimit):this.prescaleTradeoff>1?e*this.prescaleTradeoff<=this.softHeightLimit?(t*=this.prescaleTradeoff,e*=this.prescaleTradeoff):e<this.softHeightLimit?(t=t*this.softHeightLimit/e,e=this.softHeightLimit):e>=this.hardHeightLimit&&(t=t*this.hardHeightLimit/e,e=this.hardHeightLimit):e>=this.softHeightLimit&&(e*this.prescaleTradeoff<=this.softHeightLimit?(t=t*this.softHeightLimit/e,e=this.softHeightLimit):e*this.prescaleTradeoff<=this.hardHeightLimit?(t*=this.prescaleTradeoff,e*=this.prescaleTradeoff):(t=t*this.hardHeightLimit/e,e=this.hardHeightLimit)),{width:t,height:e}}resize(t=0,e=0,i=0,r=0){let n=null;if((!t||!e)&&this.video){n=this.getVideoPosition();const s=this._computeCanvasSize(n.width*(window.devicePixelRatio||1),n.height*(window.devicePixelRatio||1));t=s.width,e=s.height;const o=this.canvasParent.getBoundingClientRect().top-this.video.getBoundingClientRect().top;i=n.y-o,r=n.x}this.canvas.style.top===i&&this.canvas.style.left===r||(null!=n&&(this.canvasParent.style.position="relative",this.canvas.style.display="block",this.canvas.style.position="absolute",this.canvas.style.top=i+"px",this.canvas.style.left=r+"px",this.canvas.style.pointerEvents="none",this.canvas.style.width=n.width+"px",this.canvas.style.height=n.height+"px"),this.canvas.width===t&&this.canvas.height===e||("offscreen"===this.renderMode&&this.initDone&&(this.canvasParent.remove(),this.canvasParent=void 0,this.createCanvas()),this.resizeTimeoutBuffer?(clearTimeout(this.resizeTimeoutBuffer),this.resizeTimeoutBuffer=setTimeout((()=>{this.resizeTimeoutBuffer=void 0,this.rePaint(t,e,i,r,n)}),50)):(this.rePaint(t,e,i,r,n),this.resizeTimeoutBuffer=setTimeout((()=>{this.resizeTimeoutBuffer=void 0}),50))))}rePaint(t=0,e=0,i=0,r=0,n){"offscreen"===this.renderMode&&this.canvasParent&&this.initDone&&(this.canvasParent.remove(),this.canvasParent=void 0,this.createCanvas()),this.canvas.width=t,this.canvas.height=e,null!=n&&(this.canvasParent.style.position="relative",this.canvas.style.display="block",this.canvas.style.position="absolute",this.canvas.style.top=i+"px",this.canvas.style.left=r+"px",this.canvas.style.pointerEvents="none",this.canvas.style.width=n.width+"px",this.canvas.style.height=n.height+"px"),"offscreen"===this.renderMode&&this.initDone&&this.pushOffscreenCanvas(),this.worker.postMessage({target:"canvas",width:this.canvas.width,height:this.canvas.height}),this.resetRenderAheadCache(!0)}onWorkerMessage(t){this.workerActive||(this.workerActive=!0,this.onReadyEvent&&this.onReadyEvent());const e=t.data;switch(e.target){case"stdout":A.log(e.content);break;case"stderr":A.error(e.content);break;case"canvas":switch(e.op){case"renderCanvas":this.lastRenderTime<e.time&&(this.lastRenderTime=e.time,window.requestAnimationFrame(this.renderFrames.bind(this,e)));break;case"renderFastCanvas":this.lastRenderTime<e.time&&(this.lastRenderTime=e.time,window.requestAnimationFrame(this.renderFastFrames.bind(this,e)));break;case"oneshot-result":this.processOneshot(e);break;default:throw e.target}break;case"tick":this.frameId=e.id,this.worker.postMessage({target:"tock",id:this.frameId});break;case"custom":this.onCustomMessage?this.onCustomMessage(t):A.error("Custom message received but client onCustomMessage not implemented.");break;case"ready":break;default:A.log(e)}}runBenchmark(){this.worker.postMessage({target:"runBenchmark"})}customMessage(t,e={}){this.worker.postMessage({target:"custom",userData:t,preMain:e.preMain})}setCurrentTime(t,e){this.worker.postMessage({target:"video",isPaused:t,currentTime:e})}setTrackByUrl(t){this.worker.postMessage({target:"set-track-by-url",url:t}),this.resetRenderAheadCache(!1)}setTrack(t){this.worker.postMessage({target:"set-track",content:t}),this.resetRenderAheadCache(!1)}freeTrack(){this.worker.postMessage({target:"free-track"}),this.resetRenderAheadCache(!1)}setRate(){this.worker.postMessage({target:"video",rate:this.video.playbackRate})}destroy(){this.worker.postMessage({target:"destroy"}),this.worker.terminate(),this.workerActive=!1,this.video&&this.video.parentNode.removeChild(this.canvasParent)}createEvent(t){this.worker.postMessage({target:"create-event",event:t})}getEvents(){this.worker.postMessage({target:"get-events"})}setEvent(t,e){this.worker.postMessage({target:"set-event",event:t,index:e})}removeEvent(t){this.worker.postMessage({target:"remove-event",index:t})}createStyle(t){this.worker.postMessage({target:"create-style",style:t})}getStyles(){this.worker.postMessage({target:"get-styles"})}setStyle(t,e){this.worker.postMessage({target:"set-style",style:t,index:e})}removeStyle(t){this.worker.postMessage({target:"remove-style",index:t})}}function C(t,e=t.iceGatheringState){return"complete"!==e&&new Promise((e=>{t.addEventListener("icegatheringstatechange",(()=>"complete"===t.iceGatheringState&&e()))}))}class B{constructor(t={}){let{polite:e=!0,trickle:i=!0}=t,{port1:r,port2:n}=new MessageChannel,s=t=>n.postMessage(JSON.stringify(t));const o=new RTCPeerConnection({iceServers:t?.iceServers||[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}]}),a=new AbortController,h={signal:a.signal};o.addEventListener("iceconnectionstatechange",(()=>{"disconnected"!==o.iceConnectionState&&"failed"!==o.iceConnectionState||a.abort()}),h);const u=o.createDataChannel("both",{negotiated:!0,id:0});this.pc=o,this.dc=u,this.signal=a.signal,this.polite=e,this.signalingPort=r,this.ready=new Promise((t=>{u.addEventListener("open",(()=>{i=!0,s=t=>u.send(JSON.stringify(t)),r.close(),n.close(),this.ready=n=r=n.onmessage=null,t()}),{once:!0,...h})})),o.addEventListener("icecandidate",(({candidate:t})=>{i&&s({candidate:t})}),{...h});let l=!1,c=!1;async function d({data:t}){const{description:e,candidate:r}="string"==typeof t?JSON.parse(t):t;if(e){const t="offer"===e.type&&(l||"stable"!==o.signalingState);if(c=!this.polite&&t,c)return;if(t)await Promise.all([o.setLocalDescription({type:"rollback"}),o.setRemoteDescription(e)]);else try{"answer"===e.type&&"stable"===o.signalingState||await o.setRemoteDescription(e)}catch(t){}"offer"===e.type&&(await o.setLocalDescription(await o.createAnswer()),i||await C(o,"new"),s({description:o.localDescription}))}else r&&await o.addIceCandidate(r)}o.addEventListener("negotiationneeded",(async()=>{l=!0;const t=await o.createOffer();if("stable"===o.signalingState)if(await o.setLocalDescription(t),l=!1,i)s({description:o.localDescription});else{await C(o);const t=o.localDescription.toJSON();t.sdp=t.sdp.replace(/a=ice-options:trickle\s\n/g,""),s({description:t})}}),{...h}),n.onmessage=d.bind(this),u.addEventListener("message",d.bind(this),{...h})}}window.Peer=B;var R=i(5108);const P=[" B"," KB"," MB"," GB"," TB"];class L extends(e()){constructor(t={}){super(t.WebTorrentOpts),this.storeOpts=t.storeOpts||{};const e=location.pathname.substr(0,location.pathname.lastIndexOf("/")+1),i=location.origin+e+"sw.js"===navigator.serviceWorker?.controller?.scriptURL&&navigator.serviceWorker.controller,r=t=>{const e=t=>"activated"===t.state&&this.loadWorker(t);e(t)||t.addEventListener("statechange",(({target:t})=>e(t)))};if(i?r(i):navigator.serviceWorker.register("sw.js",{scope:e}).then((t=>{r(t.active||t.waiting||t.installing)})).catch((t=>{if("InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state."!==String(t))throw t;location.reload()})),window.addEventListener("beforeunload",(()=>{this.destroy(),this.cleanupVideo()})),this.video=t.video,this.controls=t.controls||{},this.controls.setVolume&&(this.controls.setVolume.addEventListener("input",(t=>this.setVolume(t.target.value))),this.setVolume(),this.oldVolume=void 0,"audioTracks"in HTMLVideoElement.prototype&&this.controls.audioButton&&this.video.addEventListener("loadedmetadata",(()=>{if(this.video.audioTracks.length>1){this.controls.audioButton.removeAttribute("disabled");for(const t of this.video.audioTracks)this.createRadioElement(t,"audio")}else this.controls.audioButton.setAttribute("disabled","")}))),this.controls.ppToggle&&(this.controls.ppToggle.addEventListener("click",(()=>this.playPause())),this.controls.ppToggle.addEventListener("dblclick",(()=>this.toggleFullscreen()))),this.controls.setProgress&&(this.controls.setProgress.addEventListener("input",(t=>this.setProgress(t.target.value))),this.controls.setProgress.addEventListener("mouseup",(t=>this.dragBarEnd(t.target.value))),this.controls.setProgress.addEventListener("touchend",(t=>this.dragBarEnd(t.target.value))),this.controls.setProgress.addEventListener("mousedown",(t=>this.dragBarStart(t.target.value))),this.video.addEventListener("timeupdate",(t=>{this.immerseTimeout&&"#player"===document.location.hash&&!this.video.paused&&this.setProgress(t.target.currentTime/t.target.duration*100)})),this.video.addEventListener("ended",(()=>this.setProgress(100)))),this.video.addEventListener("loadedmetadata",(()=>this.findSubtitleFiles(this.currentFile))),this.subtitleData={fonts:[],headers:[],tracks:[],current:void 0,renderer:void 0,stream:void 0,parser:void 0,parsed:void 0,timeout:void 0,defaultHeader:`[V4+ Styles]\nFormat: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding\nStyle: Default,${t.defaultSSAStyles||"Roboto Medium,26,&H00FFFFFF,&H000000FF,&H00020713,&H00000000,0,0,0,0,100,100,0,0,1,1.3,0,2,20,20,23,1"}\n[Events]\n\n`},this.completed=!1,this.video.addEventListener("timeupdate",(()=>this.checkCompletion())),this.nextTimeout=void 0,t.autoNext&&this.video.addEventListener("ended",(()=>this.playNext())),this.resolveFileMedia=t.resolveFileMedia,this.currentFile=void 0,this.videoFile=void 0,this.controls.thumbnail){this.generateThumbnails=t.generateThumbnails;const e=document.createElement("canvas");e.width=t.thumbnailWidth||150,this.thumbnailData={thumbnails:[],canvas:e,context:e.getContext("2d"),interval:void 0,video:void 0},this.video.addEventListener("loadedmetadata",(()=>this.initThumbnail())),this.video.addEventListener("timeupdate",(()=>this.createThumbnail(this.video)))}t.visibilityLossPause&&(this.wasPaused=!0,document.addEventListener("visibilitychange",(()=>{this.video.ended||("hidden"===document.visibilityState?(this.wasPaused=this.video.paused,this.video.pause()):this.wasPaused||this.playPause())}))),this.onDone=void 0,this.destroyStore=null==t.destroyStore||!!t.destroyStore,this.immerseTimeout=void 0,this.immerseTime=t.immerseTime||5,this.playerWrapper=t.playerWrapper,this.player=t.player,this.player&&(this.player.addEventListener("fullscreenchange",(()=>this.updateFullscreen())),this.player.addEventListener("mousemove",(()=>requestAnimationFrame((()=>this.resetImmerse())))),this.player.addEventListener("touchmove",(()=>requestAnimationFrame((()=>this.resetImmerse())))),this.player.addEventListener("keypress",(()=>requestAnimationFrame((()=>this.resetImmerse())))),this.player.addEventListener("mouseleave",(()=>requestAnimationFrame((()=>this.immersePlayer())))),this.doubleTapTimeout=void 0,this.player.addEventListener("touchend",(t=>{this.doubleTapTimeout?(t.preventDefault(),clearTimeout(this.doubleTapTimeout),this.doubleTapTimeout=void 0,this.toggleFullscreen()):this.doubleTapTimeout=setTimeout((()=>{this.doubleTapTimeout=void 0}),200)}))),this.bufferTimeout=void 0,this.video.addEventListener("playing",(()=>this.hideBuffering())),this.video.addEventListener("canplay",(()=>this.hideBuffering())),this.video.addEventListener("loadeddata",(()=>this.hideBuffering())),this.video.addEventListener("waiting",(()=>this.showBuffering()));const n=t=>{t?this.controls.toggleCast.removeAttribute("disabled"):this.controls.toggleCast.setAttribute("disabled","")};"PresentationRequest"in window?(this.presentationRequest=new PresentationRequest(["lib/cast.html"]),this.presentationRequest.addEventListener("connectionavailable",(t=>this.initCast(t))),this.presentationConnection=null,navigator.presentation.defaultRequest=this.presentationRequest,this.presentationRequest.getAvailability().then((t=>{t.onchange=t=>n(t.target.value),n(t.value)}))):this.controls.toggleCast.setAttribute("disabled",""),"pictureInPictureEnabled"in document?(this.burnIn=t.burnIn,this.controls.togglePopout&&this.controls.togglePopout.removeAttribute("disabled"),this.burnIn&&this.video.addEventListener("enterpictureinpicture",(()=>{this.subtitleData.renderer&&this.togglePopout()}))):(this.video.setAttribute("disablePictureInPicture",""),this.controls.togglePopout&&this.controls.togglePopout.setAttribute("disabled","")),this.seekTime=t.seekTime||5,"mediaSession"in navigator&&(navigator.mediaSession.setActionHandler("play",(()=>this.playPause())),navigator.mediaSession.setActionHandler("pause",(()=>this.playPause())),navigator.mediaSession.setActionHandler("seekbackward",(()=>this.seek(this.seekTime))),navigator.mediaSession.setActionHandler("seekforward",(()=>this.seek(this.seekTime))),navigator.mediaSession.setActionHandler("nexttrack",(()=>this.playNext())),"setPositionState"in navigator.mediaSession&&this.video.addEventListener("timeupdate",(()=>this.updatePositionState()))),this.subtitleExtensions=[".srt",".vtt",".ass",".ssa"],this.videoExtensions=[".3g2",".3gp",".asf",".avi",".dv",".flv",".gxf",".m2ts",".m4a",".m4b",".m4p",".m4r",".m4v",".mkv",".mov",".mp4",".mpd",".mpeg",".mpg",".mxf",".nut",".ogm",".ogv",".swf",".ts",".vob",".webm",".wmv",".wtv"],this.videoFiles=void 0,this.updateDisplay(),this.offlineTorrents=JSON.parse(localStorage.getItem("offlineTorrents"))||{},Object.values(this.offlineTorrents).forEach((t=>this.offlineDownload(new Blob([new Uint8Array(t)])))),this.streamedDownload=t.streamedDownload,this.fps=23.976,"requestVideoFrameCallback"in HTMLVideoElement.prototype&&this.video.addEventListener("loadeddata",(()=>{this.fps=new Promise((t=>{let e=null,i=!1,r=0;const n=(s,o)=>{if(r)if(e){const r=(1/((o.mediaTime-e.mediaTime)/(o.presentedFrames-e.presentedFrames))).toFixed(3);this.currentFile.name.endsWith(".mkv")?t(r<25&&r>22?23.976:r<31&&r>28?29.97:r<62&&r>58?59.94:r):t(r),i&&this.video.pause()}else e=o,this.video.requestVideoFrameCallback(n);else r++,this.video.paused&&(i=!0,this.video.play()),this.video.requestVideoFrameCallback(n)};this.video.requestVideoFrameCallback(n)}))}));for(const[t,e]of Object.entries(this.controls))if(this[t])if(e.constructor===Array)for(const i of e)i.addEventListener("click",(e=>{this[t](e.target.value)}));else e.addEventListener("click",(e=>{this[t](e.target.value)}));document.addEventListener("keydown",(t=>{if("F5"===t.key&&t.preventDefault(),"#player"===location.hash)switch(t.key){case" ":this.playPause();break;case"n":this.playNext();break;case"m":this.toggleMute();break;case"p":this.togglePopout();break;case"t":this.toggleTheatre();break;case"c":this.captions();break;case"f":this.toggleFullscreen();break;case"s":this.seek(85);break;case"ArrowLeft":this.seek(-this.seekTime);break;case"ArrowRight":this.seek(this.seekTime);break;case"ArrowUp":this.setVolume(Number(this.controls.setVolume.value)+5);break;case"ArrowDown":this.setVolume(Number(this.controls.setVolume.value)-5);break;case"Escape":location.hash="#home"}}))}async buildVideo(t,e={}){if(this.cleanupVideo(),e.file?this.currentFile=e.file:this.videoFiles.length>1?this.currentFile=this.videoFiles.filter((async t=>await this.resolveFileMedia({fileName:t.name}).then((t=>Number(t.episodeNumber)===Number(e.episode||1)||t===e.media))))[0]||this.videoFiles[0]:this.currentFile=this.videoFiles[0],this.nowPlaying=e.media&&(1===this.videoFiles.length||e.forceMedia&&e.file)?e.media:this.resolveFileMedia?await this.resolveFileMedia({fileName:this.currentFile.name,method:"SearchName"}):void 0,this.nowPlaying){navNowPlaying&&navNowPlaying.classList.remove("d-none");const t=[this.nowPlaying.episodeNumber,this.nowPlaying.episodeTitle].filter((t=>t)).join(" - ");"mediaSession"in navigator&&(navigator.mediaSession.metadata=new MediaMetadata({title:this.nowPlaying.mediaTitle||this.nowPlaying.name||"WebTorrentPlayer",artist:"Episode "+t,album:this.nowPlaying.name||"WebTorrentPlayer",artwork:[{src:this.nowPlaying.episodeThumbnail||this.nowPlaying.mediaCover||"",sizes:"256x256",type:"image/jpg"}]})),this.nowPlaying.episodeThumbnail&&(this.video.poster=this.nowPlaying.episodeThumbnail),this.changeControlsIcon("nowPlaying","EP "+t),document.title=[this.nowPlaying.mediaTitle,!!t&&"EP "+t,this.nowPlaying.name||"WebTorrentPlayer"].filter((t=>t)).join(" - ")}if(this.currentFile.name.endsWith("mkv")){let t=null;this.currentFile.on("stream",(({stream:e})=>{t=e})),this.initParser(this.currentFile).then((()=>{this.currentFile.on("stream",(({stream:t,req:e},i)=>{"video"!==e.destination||this.subtitleData.parsed||(this.subtitleData.stream=new p(this.subtitleData.stream),this.handleSubtitleParser(this.subtitleData.stream,!0),t.pipe(this.subtitleData.stream),i(this.subtitleData.stream))})),t?.destroy()}))}await navigator.serviceWorker.ready,this.currentFile.done?this.postDownload():this.onDone=this.currentFile.on("done",(()=>this.postDownload())),this.currentFile.streamTo(this.video),this.video.load(),this.playVideo(),this.controls.downloadFile&&this.currentFile.getStreamURL(((t,e)=>{this.controls.downloadFile.href=e}))}cleanupVideo(){this.presentationConnection?.terminate(),document.pictureInPictureElement&&document.exitPictureInPicture(),this.subtitleData.renderer?.destroy(),this.subtitleData.parser?.destroy(),this.subtitleData.stream?.destroy(),this.subtitleData.fonts?.forEach((t=>URL.revokeObjectURL(t))),this.controls.downloadFile&&(this.controls.downloadFile.href=""),this.currentFile=void 0,this.video.poster="",this.video.pause(),this.video.src="",this.video.load(),this.onDone=void 0,document.title=this.nowPlaying?.name||"WebTorrentPlayer",this.setProgress(0),Object.assign(this.subtitleData,{fonts:[],headers:[],tracks:[],current:void 0,renderer:void 0,stream:void 0,parser:void 0,parsed:void 0,timeout:void 0}),this.controls.thumbnail&&Object.assign(this.thumbnailData,{thumbnails:[],interval:void 0,video:void 0}),this.completed=!1,this.changeControlsIcon("nowPlaying",""),this.controls.captionsButton&&this.controls.captionsButton.setAttribute("disabled",""),this.changeControlsIcon("selectCaptions",""),this.changeControlsIcon("selectAudio",""),this.controls.openPlaylist&&this.controls.openPlaylist.setAttribute("disabled",""),navNowPlaying&&navNowPlaying.classList.add("d-none"),"mediaSession"in navigator&&(navigator.mediaSession.metadata=void 0),this.fps=23.976}changeControlsIcon(t,e){if(this.controls[t])if(this.controls[t].constructor===Array)for(const i of this.controls[t])i.textContent=e;else this.controls[t].textContent=e}async playVideo(){try{await this.video.play(),this.changeControlsIcon("playPause","pause")}catch(t){this.changeControlsIcon("playPause","play_arrow")}}playPause(){this.video.paused?this.playVideo():(this.changeControlsIcon("playPause","play_arrow"),this.video.pause())}setVolume(t){const e=void 0===t?Number(this.controls.setVolume.value):t;this.controls.setVolume.value=e,this.controls.setVolume.style.setProperty("--volume-level",e+"%"),this.changeControlsIcon("toggleMute",0===e?"volume_off":"volume_up"),this.video.volume=e/100}toggleMute(){0===this.video.volume?this.setVolume(this.oldVolume):(this.oldVolume=100*this.video.volume,this.setVolume(0))}toggleTheatre(){this.playerWrapper.classList.toggle("nav-hidden")}toggleFullscreen(){document.fullscreenElement?document.exitFullscreen():this.player.requestFullscreen()}updateFullscreen(){this.changeControlsIcon("toggleFullscreen",document.fullscreenElement?"fullscreen_exit":"fullscreen")}openPlaylist(){this.emit("playlist",{files:this.videoFiles})}playNext(){clearTimeout(this.nextTimeout),this.nextTimeout=setTimeout((()=>{if(this.videoFiles?.indexOf(this.currentFile)<this.videoFiles?.length-1){const t=this.nowPlaying;t.episodeNumber+=1;const e=this.currentFile._torrent;this.buildVideo(e,{media:t,file:this.videoFiles[this.videoFiles.indexOf(this.currentFile)+1]})}else this.emit("next",{file:this.currentFile,filemedia:this.nowPlaying})}),200)}playLast(){clearTimeout(this.nextTimeout),this.nextTimeout=setTimeout((()=>{if(this.videoFiles?.indexOf(this.currentFile)){const t=this.nowPlaying;t.episodeNumber-=1;const e=this.currentFile._torrent;this.buildVideo(e,{media:t,file:this.videoFiles[this.videoFiles.indexOf(this.currentFile)-1]})}else this.emit("prev",{file:this.currentFile,filemedia:this.nowPlaying})}),200)}toggleCast(){this.video.readyState&&(this.presentationConnection?this.presentationConnection?.terminate():this.presentationRequest.start())}initCast(t){let e=new B({polite:!0});this.presentationConnection=t.connection,this.presentationConnection.addEventListener("terminate",(()=>{this.presentationConnection=null,this.changeControlsIcon("toggleCast","cast"),this.player.classList.remove("pip"),e=null})),e.signalingPort.onmessage=({data:t})=>{this.presentationConnection.send(t)},this.presentationConnection.addEventListener("message",(({data:t})=>{e.signalingPort.postMessage(t)})),e.dc.onopen=async()=>{if(await this.fps,e&&this.presentationConnection){this.changeControlsIcon("toggleCast","cast_connected"),this.player.classList.add("pip");const t=[],i=this.video.captureStream();if(this.burnIn){const{stream:e,destroy:r}=await this.getBurnIn(!this.subtitleData.renderer);t.push(e.getVideoTracks()[0],i.getAudioTracks()[0]),this.presentationConnection.addEventListener("terminate",r)}else t.push(i.getVideoTracks()[0],i.getAudioTracks()[0]);for(const r of t)e.pc.addTrack(r,i);this.video.play()}}}async togglePopout(){if(this.video.readyState)if(this.burnIn)if(await this.fps,this.subtitleData.renderer)if(document.pictureInPictureElement&&!document.pictureInPictureElement.id)document.exitPictureInPicture();else{const t=document.createElement("video"),{stream:e,destroy:i}=await this.getBurnIn();t.srcObject=e,t.onloadedmetadata=()=>{t.play(),t.requestPictureInPicture().then(this.player.classList.add("pip")).catch((e=>{R.warn("Failed To Burn In Subtitles "+e),i(),t.remove(),this.player.classList.remove("pip")}))},t.onleavepictureinpicture=()=>{i(),t.remove(),this.player.classList.remove("pip")}}else this.video!==document.pictureInPictureElement?this.video.requestPictureInPicture():document.exitPictureInPicture();else this.video!==document.pictureInPictureElement?this.video.requestPictureInPicture():document.exitPictureInPicture()}async getBurnIn(t){const e=document.createElement("canvas"),i=e.getContext("2d",{alpha:!1}),r=await this.fps;let n=null,s=null;if(e.width=this.video.videoWidth,e.height=this.video.videoHeight,"requestVideoFrameCallback"in HTMLVideoElement.prototype){const r=async()=>{i.drawImage(this.video,0,0),t||i.drawImage(this.subtitleData.renderer?.canvas,0,0,e.width,e.height),n=this.video.requestVideoFrameCallback(r)};n=this.video.requestVideoFrameCallback(r),s=()=>{this.video.cancelVideoFrameCallback(n),e.remove()}}else{const o=()=>{i.drawImage(this.video,0,0),t||i.drawImage(this.subtitleData.renderer?.canvas,0,0,e.width,e.height),n=function(t,e){const i=Date.now();let r=requestAnimationFrame((function n(){Date.now()-i>=e?t():r=requestAnimationFrame(n)}));return{clear:()=>cancelAnimationFrame(r)}}(o,500/r)};n=requestAnimationFrame(o),s=()=>{var t;(t=n)&&t.clear(),e.remove()}}return{stream:e.captureStream(),destroy:s}}toTS(t,e){if(isNaN(t)||t<0)return e?"0:00:00.00":"00:00";const i=Math.floor(t/3600);let r=Math.floor(t/60)-60*i,n=e?(t%60).toFixed(2):Math.floor(t%60);return r<10&&(r="0"+r),n<10&&(n="0"+n),i>0||e?i+":"+r+":"+n:r+":"+n}prettyBytes(t){if(isNaN(t))return"0 B";if(t<1)return t+" B";const e=Math.min(Math.floor(Math.log(t)/Math.log(1e3)),P.length-1);return Number((t/Math.pow(1e3,e)).toFixed(2))+P[e]}getBytes(t){const e=t.split(" ");return e[0]*1024**(["B","KiB","MiB","GiB","TiB","Bytes","KB","MB","GB","TB"].indexOf(e[1]||"B")%5)}seek(t){85===t&&this.video.currentTime<10?this.video.currentTime=90:85===t&&this.video.duration-this.video.currentTime<90?this.video.currentTime=this.video.duration:this.video.currentTime+=t,this.setProgress(this.video.currentTime/this.video.duration*100)}forward(){this.seek(this.seekTime)}rewind(){this.seek(-this.seekTime)}immersePlayer(){this.player.classList.add("immersed"),this.immerseTimeout=void 0}resetImmerse(){this.immerseTimeout?clearTimeout(this.immerseTimeout):this.player.classList.remove("immersed"),this.immerseTimeout=setTimeout((()=>this.immersePlayer()),1e3*this.immerseTime)}hideBuffering(){this.bufferTimeout&&(clearTimeout(this.bufferTimeout),this.bufferTimeout=void 0,this.player.classList.remove("buffering"))}showBuffering(){this.bufferTimeout=setTimeout((()=>{this.player.classList.add("buffering"),this.resetImmerse()}),150)}checkCompletion(){!this.completed&&this.video.duration-180<this.video.currentTime&&(this.completed=!0,this.emit("watched",{file:this.currentFile,filemedia:this.nowPlaying}))}updatePositionState(){this.video.duration&&navigator.mediaSession.setPositionState({duration:this.video.duration||0,playbackRate:this.video.playbackRate||0,position:this.video.currentTime||0})}initThumbnail(){const t=this.thumbnailData.canvas.width/(this.video.videoWidth/this.video.videoHeight);this.thumbnailData.interval=this.video.duration/300<5?5:this.video.duration/300,this.thumbnailData.canvas.height=t,this.controls.thumbnail.style.setProperty("height",t+"px")}createThumbnail(t){if(t?.readyState>=2){const e=Math.floor(t.currentTime/this.thumbnailData.interval);this.thumbnailData.thumbnails[e]||(this.thumbnailData.context.fillRect(0,0,150,this.thumbnailData.canvas.height),this.thumbnailData.context.drawImage(t,0,0,150,this.thumbnailData.canvas.height),this.thumbnailData.thumbnails[e]=this.thumbnailData.canvas.toDataURL("image/jpeg"))}}finishThumbnails(t){const e=performance.now(),i=document.createElement("video");let r=0;i.preload="none",i.volume=0,i.playbackRate=0,i.addEventListener("loadeddata",(()=>n())),i.addEventListener("canplay",(()=>{this.createThumbnail(this.thumbnailData.video),n()})),this.thumbnailData.video=i;const n=()=>{for(;this.thumbnailData.thumbnails[r]&&r<=Math.floor(this.thumbnailData.video.duration/this.thumbnailData.interval);)r++;this.thumbnailData.video?.currentTime!==this.thumbnailData.video?.duration?this.thumbnailData.video.currentTime=r*this.thumbnailData.interval:(this.thumbnailData.video?.removeAttribute("src"),this.thumbnailData.video?.load(),this.thumbnailData.video?.remove(),delete this.thumbnailData.video,R.log("Thumbnail creating finished",r,this.toTS((performance.now()-e)/1e3))),r++};this.thumbnailData.video.src=t,this.thumbnailData.video.play(),R.log("Thumbnail creating started")}dragBarEnd(t){this.video.currentTime=this.video.duration*t/100||0,this.playVideo()}dragBarStart(t){this.video.pause(),this.setProgress(t)}setProgress(t){t=t||0;const e=this.video.duration*t/100||0;this.controls.progressWrapper&&this.controls.progressWrapper.style.setProperty("--progress",t+"%"),this.controls.thumbnail&&(this.controls.thumbnail.src=this.thumbnailData.thumbnails[Math.floor(e/this.thumbnailData.interval)]||" "),this.controls.setProgress&&(this.controls.setProgress.dataset.elapsed=this.toTS(e),this.controls.setProgress.value=t),this.controls.progressWrapper&&(this.controls.progressWrapper.dataset.elapsed=this.toTS(e),this.controls.progressWrapper.dataset.remaining=this.toTS(this.video.duration-e))}updateDisplay(){this.currentFile&&this.currentFile._torrent&&(this.player&&this.player.style.setProperty("--download",100*this.currentFile.progress+"%"),this.controls.peers&&(this.controls.peers.dataset.value=this.currentFile._torrent.numPeers),this.controls.downSpeed&&(this.controls.downSpeed.dataset.value=this.prettyBytes(this.currentFile._torrent.downloadSpeed)+"/s"),this.controls.upSpeed&&(this.controls.upSpeed.dataset.value=this.prettyBytes(this.currentFile._torrent.uploadSpeed)+"/s")),setTimeout((()=>requestAnimationFrame((()=>this.updateDisplay()))),200)}createRadioElement(t,e){if("captions"===e&&this.controls.selectCaptions&&this.controls.captionsButton||"audio"===e&&this.controls.selectAudio){const i=document.createDocumentFragment(),r=document.createElement("input"),n=document.createElement("label");r.name=`${e}-radio-set`,r.type="radio",r.id="captions"===e?`${e}-${t?t.number:"off"}-radio`:`${e}-${t.id}-radio`,r.value="captions"===e?t?t.number:-1:t.id,r.checked="captions"===e?t?.number===this.subtitleData.current:t.enabled,n.htmlFor="captions"===e?`${e}-${t?t.number:"off"}-radio`:`${e}-${t.id}-radio`,n.textContent=t?"captions"===e?(t.language||(Object.values(this.subtitleData.headers).some((t=>"eng"===t.language||"en"===t.language))?t.type:"eng"))+(t.name?" - "+t.name:""):(t.language||(Object.values(this.video.audioTracks).some((t=>"eng"===t.language||"en"===t.language))?t.label:"eng"))+(t.label?" - "+t.label:""):"OFF",i.append(r),i.append(n),"captions"===e?(this.controls.selectCaptions.append(i),this.controls.captionsButton.removeAttribute("disabled")):this.controls.selectAudio.append(i)}}selectAudio(t){if(void 0!==t){for(const e of this.video.audioTracks)e.enabled=e.id===t;this.seek(-.5)}}selectCaptions(t){void 0!==t&&(t=Number(t),this.subtitleData.current=t,this.subtitleData.timeout||(this.subtitleData.timeout=setTimeout((()=>{this.subtitleData.timeout=void 0,this.subtitleData.renderer&&this.subtitleData.renderer.setTrack(-1!==t?this.subtitleData.headers[t].header.slice(0,-1)+Array.from(this.subtitleData.tracks[t]).join("\n"):this.subtitleData.defaultHeader)}),1e3)))}constructSub(t,e){if(!0===e){const e=t.text.match(/<[^>]+>/g);e&&e.forEach((e=>{/<\//.test(e)?t.text=t.text.replace(e,e.replace("</","{\\").replace(">","0}")):t.text=t.text.replace(e,e.replace("<","{\\").replace(">","1}"))})),t.text.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/ /g,"\\h")}return"Dialogue: "+(t.layer||0)+","+this.toTS(t.time/1e3,!0)+","+this.toTS((t.time+t.duration)/1e3,!0)+","+(t.style||"Default")+","+(t.name||"")+","+(t.marginL||"0")+","+(t.marginR||"0")+","+(t.marginV||"0")+","+(t.effect||"")+","+t.text||0}parseSubtitles(t,e){return new Promise((i=>{if(t.name.endsWith(".mkv")){let r=new f;this.handleSubtitleParser(r,e);const n=()=>{R.log("Sub parsing finished",this.toTS((performance.now()-s)/1e3)),this.subtitleData.parsed=!0,this.subtitleData.stream?.destroy(),this.subtitleData.parser?.destroy(),o?.destroy(),this.subtitleData.stream=void 0,this.subtitleData.parser=void 0,this.selectCaptions(this.subtitleData.current),r=void 0,this.video.paused||(this.video.pause(),this.playVideo()),i()};r.once("tracks",(t=>{t.length||n()})),r.once("finish",n);const s=performance.now();R.log("Sub parsing started");const o=t.createReadStream();this.subtitleData.parser=o.pipe(r)}else i()}))}initParser(t){return new Promise((e=>{const i=this.subtitleData.stream=new f;this.handleSubtitleParser(this.subtitleData.stream),i.once("tracks",(t=>{t.length||(this.subtitleData.parsed=!0,e(),this.subtitleData.stream.destroy(),r.destroy())})),i.on("subtitle",(()=>{e(),r.destroy()}));const r=t.createReadStream({end:t.length/2});r.pipe(i)}))}handleSubtitleParser(t,e){t.once("tracks",(t=>{t.length?t.forEach((t=>{this.subtitleData.tracks[t.number]||("ass"!==t.type&&(t.header=this.subtitleData.defaultHeader),this.subtitleData.current||(this.subtitleData.current=t.number,this.createRadioElement(void 0,"captions")),this.subtitleData.tracks[t.number]=new Set,this.subtitleData.headers[t.number]=t,this.createRadioElement(t,"captions"))})):this.subtitleData.parsed=!0})),t.on("subtitle",((t,e)=>{this.subtitleData.parsed||(this.subtitleData.renderer||this.initSubtitleRenderer(),this.subtitleData.tracks[e].add(this.constructSub(t,"ass"!==this.subtitleData.headers[e].type)),this.subtitleData.current===e&&this.selectCaptions(e))})),e||t.on("file",(t=>{"application/x-truetype-font"!==t.mimetype&&"application/font-woff"!==t.mimetype&&"application/vnd.ms-opentype"!==t.mimetype||this.subtitleData.fonts.push(URL.createObjectURL(new Blob([t.data],{type:t.mimetype})))}))}async initSubtitleRenderer(){if(!this.subtitleData.renderer){const t={video:this.video,targetFps:await this.fps,subContent:this.subtitleData.headers[this.subtitleData.current].header.slice(0,-1),renderMode:"offscreen",fonts:this.subtitleData.fonts,fallbackFont:"https://fonts.gstatic.com/s/roboto/v20/KFOlCnqEu92Fr1MmEU9fBBc4.woff2",workerUrl:"lib/subtitles-octopus-worker.js",onReady:()=>{this.video.paused||(this.video.pause(),this.playVideo())}};this.subtitleData.renderer||(this.subtitleData.renderer=new I(t),this.selectCaptions(this.subtitleData.current))}}convertSubFile(t,e,i){const r=/(?:\d+\n)?(\S{9,12})\s?-->\s?(\S{9,12})(.*)\n([\s\S]*)$/i;t.getBuffer(((t,n)=>{const s=e?n.toString():[];if(e)i(s);else{const t=n.toString().replace(/\r/g,"");for(const e of t.split("\n\n")){const t=e.match(r);if(t){t[1]=t[1].match(/.*[.,]\d{2}/)[0],t[2]=t[2].match(/.*[.,]\d{2}/)[0],9===t[1].length?t[1]="0:"+t[1]:"0"===t[1][0]&&(t[1]=t[1].substring(1)),t[1].replace(",","."),9===t[2].length?t[2]="0:"+t[2]:"0"===t[2][0]&&(t[2]=t[2].substring(1)),t[2].replace(",",".");const e=t[4].match(/<[^>]+>/g);e&&e.forEach((e=>{/<\//.test(e)?t[4]=t[4].replace(e,e.replace("</","{\\").replace(">","0}")):t[4]=t[4].replace(e,e.replace("<","{\\").replace(">","1}"))})),s.push("Dialogue: 0,"+t[1].replace(",",".")+","+t[2].replace(",",".")+",Default,,0,0,0,,"+t[4])}}i(s)}}))}findSubtitleFiles(t){const e=t.path.split(t.name)[0],i=t._torrent.files.filter((t=>this.subtitleExtensions.some((e=>t.name.endsWith(e)))&&(1===this.videoFiles.length||2===t.path.split(e).length)));if(i.length){this.createRadioElement(void 0,"captions"),this.subtitleData.parsed=!0,this.subtitleData.current=0;for(const[e,r]of i.entries()){const i=r.name.endsWith(".ass")||r.name.endsWith(".ssa"),n=/\.(\w+)$/,s=r.name.replace(t.name,"")===r.name?r.name.replace(t.name.replace(n,""),"").slice(0,-4).replace(/[,._-]/g," ").trim():r.name.replace(t.name,"").slice(0,-4).replace(/[,._-]/g," ").trim(),o={header:this.subtitleData.defaultHeader,language:s,number:e,type:r.name.match(n)[1]};this.subtitleData.headers.push(o),this.subtitleData.tracks[e]=[],this.createRadioElement(o,"captions"),this.convertSubFile(r,i,(t=>{i?this.subtitleData.headers[e].header=t:this.subtitleData.tracks[e]=t,this.subtitleData.current===e&&this.selectCaptions(this.subtitleData.current)})),this.initSubtitleRenderer()}}}postDownload(){this.emit("download-done",{file:this.currentFile}),this.parseSubtitles(this.currentFile,!0).then((()=>{this.generateThumbnails&&this.finishThumbnails(this.video.src)}))}playTorrent(t,e={}){const i=(t,e)=>{t.on("noPeers",(()=>{this.emit("no-peers",t)})),this.streamedDownload&&(t.files.forEach((t=>t.deselect())),t.deselect(0,t.pieces.length-1,!1)),this.videoFiles=t.files.filter((t=>this.videoExtensions.some((e=>t.name.endsWith(e))))),this.emit("video-files",{files:this.videoFiles,torrent:t}),this.videoFiles.length>1&&t.files.forEach((t=>t.deselect())),this.videoFiles?this.buildVideo(t,e):(this.emit("no-file",t),this.cleanupTorrents())};document.location.hash="#player",this.cleanupVideo(),this.cleanupTorrents(),t instanceof Object?i(t,e):this.get(t)?i(this.get(t),e):this.add(t,{destroyStoreOnDestroy:this.destroyStore,storeOpts:this.storeOpts,storeCacheSlots:0,store:T,announce:this.tracker.announce||["wss://tracker.openwebtorrent.com","wss://spacetradersapi-chatbox.herokuapp.com:443/announce","wss://peertube.cpy.re:443/tracker/socket"]},(t=>{i(t,e)}))}cleanupTorrents(){this.torrents.filter((t=>!this.offlineTorrents[t.infoHash])).forEach((t=>t.destroy()))}offlineDownload(t){const e=this.add(t,{storeOpts:this.storeOpts,store:T,storeCacheSlots:0,announce:this.tracker.announce||["wss://tracker.openwebtorrent.com","wss://spacetradersapi-chatbox.herokuapp.com:443/announce","wss://peertube.cpy.re:443/tracker/socket"]});e.on("metadata",(()=>{this.offlineTorrents[e.infoHash]||(this.offlineTorrents[e.infoHash]=Array.from(e.torrentFile),localStorage.setItem("offlineTorrents",JSON.stringify(this.offlineTorrents))),this.emit("offline-torrent",e)}))}}const O=halfmoon;var D=i.n(O),N=i(5108);D().showModal=t=>{const e=document.getElementById(t);e&&e.classList.add("show")},D().hideModal=t=>{const e=document.getElementById(t);e&&e.classList.remove("show")};const j=new URLSearchParams(location.href);j.get("access_token")&&(localStorage.setItem("ALtoken",j.get("access_token")),window.location="/app/#home");const U=window.chrome?-1!==navigator.userAgent.indexOf("Edg")?"edge":"chromium":"firefox";function F(t){const e=Math.floor(t/86400);t-=3600*e*24;const i=Math.floor(t/3600);t-=3600*i;const r=Math.floor(t/60);t-=60*r;const n=[];return e&&n.push(e+"d"),(e||i)&&n.push(i+"h"),(e||i||r)&&n.push(r+"m"),n.join(" ")}function q(t){const e={};for(const i in t)if(t[i]&&t[i].constructor===Object){const r=q(t[i]);for(const t in r)e[t]=r[t]}else e[i]=t[i];return e}const z=(new DOMParser).parseFromString.bind(new DOMParser);function H(t,e){if(!e){e=0;let i=t.length||t.byteLength||0;for(;i--;)e+=t[i].length}const i=new Uint8Array(e);let r=0;for(let e=0,n=t.length;e<n;e++){const n=t[e];i.set(n,r),r+=n.byteLength||n.length}return i}const W=t=>new Promise((e=>setTimeout(e,t)));class ${constructor(){this.queue=[],this.destroyed=!1,this.lastfn=null}add(t){if(!this.destroyed)if(!this.queue.length||t.index>this.queue[this.queue.length-1].index||t.index<this.queue[0].index-10)this.queue.push(t),1===this.queue.length&&this._next();else{for(let e=0;e<this.queue.length;e++)if(this.queue[e].index>t.index)return void this.queue.splice(e,0,t);this.queue.push(t),N.warn("got bad")}}async _next(){const t=this.queue[0];await t.fn(),this._remove(t),!this.destroyed&&this.queue.length&&this._next()}_remove(t){this.destroyed||this.queue.splice(this.queue.indexOf(t),1)}destroy(){this.destroyed=!0,this.queue=null}}function Z(t){return new Promise(((e,i)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>i(t.error)}))}function V(t,e){const i=function(){if(navigator.userAgentData||!/Safari\//.test(navigator.userAgent)||/Chrom(e|ium)\//.test(navigator.userAgent)||!indexedDB.databases)return Promise.resolve();let t;return new Promise((e=>{const i=()=>indexedDB.databases().finally(e);t=setInterval(i,100),i()})).finally((()=>clearInterval(t)))}().then((()=>{const i=indexedDB.open(t);return i.onupgradeneeded=()=>i.result.createObjectStore(e),Z(i)}));return(t,r)=>i.then((i=>r(i.transaction(e,t).objectStore(e))))}let K;function G(){return K||(K=V("keyval-store","keyval")),K}const J=[volume,player2,player3,player5,player6,player10,subtitle1,subtitle3,torrent1,torrent2,torrent3,torrent4,torrent7,torrent8,torrent9,torrent10,other1,other2,other3];setRes.addEventListener("click",(function(){localStorage.removeItem("settings"),location.reload()})),settingsTab.addEventListener("click",et),volume.addEventListener("click",et),regProtButton.addEventListener("click",(function(){"registerProtocolHandler"in navigator&&navigator.registerProtocolHandler("magnet",`${location.href.replace(location.hash,"")}#home&file=%s`,"Miru")}));const Y=JSON.parse(localStorage.getItem("settings"))||{};let X,Q;async function tt(){for(const t of J)Y[t.id]="checkbox"===t.type?t.checked:t.value;localStorage.setItem("settings",JSON.stringify(Y)),"showDirectoryPicker"in window&&Y.torrent5&&function(t,e,i=G()){i("readwrite",(i=>(i.put(e,t),Z(i.transaction))))}("directory",await Y.torrent5,X)}function et(){clearTimeout(Q),Q=setTimeout(tt,500)}"showDirectoryPicker"in window&&(X=V("handle-store","handles"),Y.torrent5=function(t,e=G()){return e("readonly",(e=>Z(e.get(t))))}("directory",X).then((t=>t?(torrent5label.value="Folder: "+t.name,t):null)),torrent5.classList.remove("d-none"),torrent5.onclick=async()=>{const t=await window.showDirectoryPicker();await t.requestPermission({mode:"readwrite"}),Y.torrent5=t,torrent5label.value="Folder: "+t.name||0}),clearRelCache.onclick=()=>{localStorage.removeItem("relations"),location.reload()};for(const t of Object.entries(Y)){const e=J.filter((e=>e.id===t[0]))[0];e&&("checkbox"===e.type?e.checked=t[1]:e.value=t[1])}tt(),other1.oninput=()=>other1.checked&&Notification.requestPermission().then((t=>{other1.checked="denied"!==t}));var it=i(5108);const rt={edge:["DTS"],chromium:["DTS","AC3","HEVC","x265","H.265"],firefox:["DTS","AC3","HEVC","x265","H.265",".3gp",".mkv"]};function nt(t){return fetch(t).then((t=>{if(t.ok)return t.text().then((t=>z(t,"text/xml")));throw Error(t.statusText)})).catch((t=>{D().initStickyAlert({content:"Failed fetching RSS!<br>"+t,title:"Search Failed",alertType:"alert-danger",fillType:""}),it.error(t)}))}function st(){return Object.values(torrent4list.options).filter((t=>t.value===Y.torrent4))[0]?new URL(Object.values(torrent4list.options).filter((t=>t.value===Y.torrent4))[0].textContent+Y.torrent1):new URL(Y.torrent4+Y.torrent1)}function ot(){const t=[navSchedule,homeContinueMore,homeReleasesMore,homePlanningMore,homeTrendingMore,homeRomanceMore,homeActionMore],e=[homeContinue,homeReleases,homePlanning,homeTrending,homeRomance,homeAction],i=[searchText,searchGenre,searchYear,searchSeason,searchFormat,searchStatus,searchSort],r=document.querySelector(".browse"),n={continue:async function(t){t||d(r);const e=await wt({method:"UserLists",status_in:"CURRENT",id:bt,page:t||1});return f({media:e.data.Page.mediaList.map((t=>t.media)).filter((t=>"RELEASING"!==t.status||t.mediaListEntry?.progress<t.nextAiringEpisode?.episode-1)),gallery:r,method:"continue",page:t||1}),e.data.Page.pageInfo.hasNextPage},releases:async function(){d(r);const t=await ct((await nt(st())).querySelectorAll("item"));return r.textContent="",r.append(...t),home.classList.remove("loading"),home.onscroll=void 0,!1},planning:async function(t){t||d(r);const e=await wt({method:"UserLists",status_in:"PLANNING",id:bt,page:t||1});return f({media:e.data.Page.mediaList.map((t=>t.media)),gallery:r,method:"planning",page:t||1}),e.data.Page.pageInfo.hasNextPage},trending:async function(){return d(r),m(),searchSort.value="TRENDING_DESC",await n.search()},romance:async function(){return d(r),m(),searchGenre.value="romance",searchSort.value="TRENDING_DESC",await n.search()},action:async function(){return d(r),m(),searchGenre.value="action",searchSort.value="TRENDING_DESC",await n.search()},schedule:async function(t){t||d(r);const e=await wt({method:"AiringSchedule",page:t||1});return f({media:e.data.Page.airingSchedules.filter((t=>"CN"!==t.media.countryOfOrigin&&!1===t.media.isAdult)),gallery:r,method:"schedule",page:t||1,schedule:!0}),e.data.Page.pageInfo.hasNextPage},search:async function(t){const e={method:"Search",page:t||1},n={};Object.assign(n,e);for(const t of i)t.value&&(n[t.dataset.option]=t.value);if(Object.keys(e).length!==Object.keys(n).length){const e=await wt(n);return f({media:e.data.Page.media,gallery:r,method:"search",page:t||1}),e.data.Page.pageInfo.hasNextPage}return searchClear.classList.remove("text-primary"),home.classList.remove("loading"),p(),!1}},s={continue:function(){wt({method:"UserLists",status_in:"CURRENT",id:bt,perPage:50}).then((t=>{f({media:t.data.Page.mediaList.filter((({media:t})=>"RELEASING"!==t.status||t.mediaListEntry?.progress<t.nextAiringEpisode?.episode-1)).slice(0,5).map((t=>t.media)),gallery:homeContinue})}))},releases:async function(){const t=await nt(st());if(t){const e=t.querySelector("pubDate").textContent;if(u!==e){u&&(homeReleases.textContent="",homeReleases.append(...o(5)),Y.other1&&It({fileName:t.querySelector("item title").textContent,isRelease:!0}).then((e=>{new Notification(e.media.title.userPreferred,{body:`Episode ${e.episodeNumber} was just released!`,icon:e.media.coverImage.medium}).onclick=async()=>{window.parent.focus(),Ct[e.parseObject.anime_title]=(await wt({id:e.media.id,method:"SearchIDSingle"})).data.Media.id,Wt.playTorrent(t.querySelector("item link").textContent,{media:e,episode:e.episode})}}))),u=e;const i=await ct(t.querySelectorAll("item"),5);homeReleases.textContent="",homeReleases.append(...i)}}},planning:function(){wt({method:"UserLists",status_in:"PLANNING",id:bt,perPage:5}).then((t=>{f({media:t.data.Page.mediaList.map((t=>t.media)),gallery:homePlanning})}))},trending:function(){wt({method:"Search",id:bt,perPage:5,sort:"TRENDING_DESC"}).then((t=>{f({media:t.data.Page.media,gallery:homeTrending})}))},romance:function(){wt({method:"Search",genre:"Romance",perPage:5,sort:"TRENDING_DESC"}).then((t=>{f({media:t.data.Page.media,gallery:homeRomance})}))},action:function(){wt({method:"Search",genre:"Action",perPage:5,sort:"TRENDING_DESC"}).then((t=>{f({media:t.data.Page.media,gallery:homeAction})}))}},o=function(t){const e=[];for(;t--;)e.push(at.cloneNode(!0));return e};let a,h,u,l,c=!0;function d(t){home.classList.add("loading"),t.textContent="",t.append(...o(10))}function f(t){1===t.page&&home.classList.remove("loading"),t.method&&(c=!1,home.onscroll=function(){this.scrollTop+this.clientHeight>this.scrollHeight-800&&!a&&c&&(c=!1,a=setTimeout((function(){a=void 0}),1e3),n[t.method](t.page+1).then((t=>{c=t})))}),t.page&&1!==t.page||(t.gallery.textContent="");const e=new Date,i=[];t.media.forEach((r=>{if(t.schedule){if(r.timeUntilAiring&&(!h||new Date(+e+1e3*r.timeUntilAiring).getDay()!==h.getDay())){const t=document.createElement("div");h=new Date(+e+1e3*r.timeUntilAiring),t.classList.add("day-row","font-size-24","font-weight-bold","h-50","d-flex","align-items-end"),t.textContent=h.toLocaleDateString("en-US",{weekday:"long"}),i.push(t)}r=r.media}i.push(lt({media:r,schedule:t.schedule,onclick:()=>gt(r)}))})),t.gallery.append(...i),c=!0}for(const t of e)s[t.dataset.function]();setInterval(s.releases,3e4);for(const e of t)e.onclick=function(){home.scrollTop=0,home.classList.add("browsing"),searchClear.classList.add("text-primary"),n[e.dataset.function]()};function p(){m(),searchClear.classList.remove("text-primary"),home.classList.remove("browsing"),u=void 0,home.onscroll=void 0,home.scrollTop=0;for(const t of e)t.textContent="",t.append(...o(5)),s[t.dataset.function]();document.querySelector(".browse").textContent=""}function m(){for(const t of i)t.value=""}navHome.onclick=p,searchClear.onclick=p,searchWrapper.oninput=()=>{l?clearTimeout(l):(home.classList.add("browsing"),d(r),home.scrollTop=0),searchClear.classList.add("text-primary"),l=setTimeout((()=>{n.search(),l=void 0}),500)}}"audioTracks"in HTMLVideoElement.prototype||rt[U].push("mutli audio","dual audio");const at=skeletonCardTemplate.cloneNode(!0).content,ht=bareCardTemplate.cloneNode(!0).content,ut=fullCardTemplate.cloneNode(!0).content;function lt(t){if(t.media){const e=ut.cloneNode(!0),i=e.querySelectorAll("*");return i[0].onclick=t.onclick,i[0].style=`--color:${t.media.coverImage.color||"#1890ff"};`,i[3].src=t.media.coverImage.extraLarge||"",i[6].textContent=[t.media.title.userPreferred,t.episodeNumber].filter((t=>t)).join(" - "),t.schedule&&t.media.nextAiringEpisode&&(i[7].textContent="EP "+t.media.nextAiringEpisode.episode+" in "+F(t.media.nextAiringEpisode.timeUntilAiring)),i[8].innerHTML="<span>"+["TV"===t.media.format?"TV Show":t.media.format?.toLowerCase().replace(/_/g," "),t.media.episodes?t.media.episodes+" Episodes":t.media.duration?t.media.duration+" Minutes":void 0,t.media.status?.toLowerCase().replace(/_/g," "),[t.media.season?.toLowerCase(),t.media.seasonYear].filter((t=>t)).join(" ")].filter((t=>t)).join("</span><span>")+"</span>",i[13].innerHTML=t.media.description,i[14].innerHTML=t.media.genres.map((t=>`<span class="badge badge-pill badge-color text-dark mt-5 font-weight-bold">${t}</span> `)).join(""),e}if(t.parseObject){const e=ht.cloneNode(!0);return e.querySelector("h5").textContent=[t.parseObject.anime_title,t.parseObject.episode_number].filter((t=>t)).join(" - "),e.firstElementChild.onclick=t.onclick,e}return at.cloneNode(!0)}async function ct(t,e){const i=[];return(await It({fileName:[...t].map((t=>t.querySelector("title").textContent)).slice(0,e),isRelease:!0})).forEach(((e,r)=>{e.onclick=()=>Wt.playTorrent(t[r].querySelector("link").textContent,{media:e,episode:e.episode}),i.push(lt(e))})),localStorage.setItem("relations",JSON.stringify(Ct)),i}const dt=document.createElement("span");dt.classList.add("badge","badge-pill","shadow");const ft=[{property:"episode",label:"Airing",icon:"schedule",custom:"property"},{property:"genres",label:"Genres",icon:"theater_comedy"},{property:"season",label:"Season",icon:"spa",custom:"property"},{property:"episodes",label:"Episodes",icon:"theaters",custom:"property"},{property:"duration",label:"Duration",icon:"timer"},{property:"format",label:"Format",icon:"monitor"},{property:"status",label:"Status",icon:"live_tv"},{property:"nodes",label:"Studio",icon:"business"},{property:"source",label:"Source",icon:"source"},{property:"averageScore",label:"Rating",icon:"trending_up",custom:"property"},{property:"english",label:"English",icon:"title"},{property:"romaji",label:"Romaji",icon:"translate"},{property:"native",label:"Native",icon:"語",custom:"icon"}],pt=detailTemplate.cloneNode(!0).content;trailerClose.onclick=()=>{trailerVideo.src=""},navNowPlaying.onclick=()=>{Wt.nowPlaying.media&>(Wt.nowPlaying.media)};const mt=viewAnime.querySelectorAll("*");function gt(t,e){D().showModal("viewAnime");const i=q(t);mt[9].src=i.extraLarge||i.medium,mt[13].textContent=i.userPreferred,mt[17].textContent=i.averageScore+"%",mt[20].textContent="TV"===i.format?i.format:i.format?.toLowerCase(),1===i.episodes||!i.episodes&&!i.episode?(mt[14].classList.add("movie"),mt[31].classList.add("movie"),mt[28].textContent=i.duration+" min"):(mt[31].classList.remove("movie"),mt[14].classList.remove("movie"),mt[24].textContent=i.episodes),mt[29].textContent="",mt[29].append(...function(t=[]){const e=[];for(const i of t){const t=dt.cloneNode(!0);t.textContent=i,e.push(t)}return e}(i.genres)),i.episodes||i.episode?(mt[31].classList.remove("hidden"),mt[33].onclick=()=>{At(t,Number(mt[44].value)||1),D().hideModal("viewAnime")},mt[44].value=e||Math.min(Number(i.progress)+1||1,i.episodes),mt[35].textContent=i.progress&&i.progress!==i.episodes?"Continue":"Play",mt[46].onclick=()=>{At(t,Number(mt[56].value)||1,!0),D().hideModal("viewAnime")},mt[56].value=e||Math.min(Number(i.progress)+1||1,i.episodes)):mt[31].classList.add("hidden"),i.bannerImage?mt[4].style=`background-image: linear-gradient(0deg, rgba(17,20,23,1) 0%, rgba(17,20,23,0.80) 25%, rgba(17,20,23,0.40) 50%, rgba(37,40,44,0) 100%), url('${i.bannerImage}') !important`:mt[4].style="background-image: linear-gradient(0deg, rgba(17,20,23,1) 0%, rgba(17,20,23,0.80) 25%, rgba(17,20,23,0.40) 50%, rgba(37,40,44,0) 100%) !important",mt[57].onclick=()=>{return e=t.trailer,trailerVideo.src="",D().toggleModal("trailer"),void("youtube"===e.site&&(trailerVideo.src="https://www.youtube.com/embed/"+e.id));var e},mt[63].innerHTML=i.description,mt[66].textContent="",mt[66].append(...function(t){const e=[];for(const i of ft)if(t[i.property]){const r=pt.cloneNode(!0),n=r.querySelectorAll("*");switch(t[i.property].constructor){case String:n[4].textContent=t[i.property].replace(/_/g," ").toLowerCase();break;case Number:n[4].textContent=t[i.property];break;case Array:"nodes"===i.property?n[4].textContent=t[i.property][0]&&t[i.property][0].name:n[4].textContent=t[i.property].join(", ").replace(/_/g," ").toLowerCase()}switch(n[1].textContent=i.icon,n[3].textContent=i.label,i.custom){case"icon":n[1].classList.remove("material-icons","font-size-24"),n[1].classList.add("d-flex","align-items-center","text-nowrap","font-size-12","font-weight-bold");break;case"property":"episodes"===i.property&&t.progress?n[4].innerHTML=`Watched <b>${t.progress}</b> of <b>${t.episodes}</b>`:"averageScore"===i.property?n[4].textContent=t.averageScore+"%":"season"===i.property?n[4].textContent=[t.season?.toLowerCase(),t.seasonYear].filter((t=>t)).join(" "):"episode"===i.property?n[4].textContent=`Ep ${t.episode}: ${F(t.timeUntilAiring)}`:n[4].textContent=t[i.property]}e.push(r)}return e}(i))}let bt;"firefox"===U&&D().initStickyAlert({content:"Your browser will likely not support many video formats, containers and features. Please use Chromium!",title:"Bad Browser",alertType:"alert-danger",fillType:""});var vt=i(5108);async function yt(t){return await fetch("https://graphql.anilist.co",t).then((async t=>{const e=await t.json();if(!t.ok)for(const t of e.errors)D().initStickyAlert({content:`Failed making request to anilist!<br>${t.status} - ${t.message}`,title:"Search Failed",alertType:"alert-danger",fillType:""}),vt.error(t);return e}))}async function wt(t){let e;const i={type:"ANIME",sort:t.sort||"TRENDING_DESC",page:t.page||1,perPage:t.perPage||30,status_in:t.status_in||"[CURRENT,PLANNING]",chunk:t.chunk||1,perchunk:t.perChunk||30,startDate:!Y.other3&&(t.startDate||20210328)||1e7},r={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"}},n="\nid,\ntitle {\n romaji,\n english,\n native,\n userPreferred\n},\ndescription(\n asHtml: true\n),\nseason,\nseasonYear,\nformat,\nstatus,\nepisodes,\nduration,\naverageScore,\ngenres,\ncoverImage {\n extraLarge,\n medium,\n color\n},\ncountryOfOrigin,\nisAdult,\nbannerImage,\nsynonyms,\nnextAiringEpisode {\n timeUntilAiring,\n episode\n},\ntrailer {\n id,\n site\n},\nstreamingEpisodes {\n title,\n thumbnail\n},\nmediaListEntry {\n progress\n},\nsource,\nstudios(isMain: true) {\n nodes {\n name\n }\n},\nrelations {\n edges {\n relationType(version:2)\n node {\n id,\n title {\n userPreferred\n },\n coverImage {\n medium\n },\n type,\n status,\n format,\n episodes\n }\n }\n}";switch(t.status&&(i.status=t.status),localStorage.getItem("ALtoken")&&(r.headers.Authorization=localStorage.getItem("ALtoken")),t.method){case"SearchName":i.search=t.name,e=` \nquery ($page: Int, $perPage: Int, $sort: [MediaSort], $type: MediaType, $search: String, $status: [MediaStatus]) {\n Page (page: $page, perPage: $perPage) {\n pageInfo {\n hasNextPage\n },\n media(type: $type, search: $search, sort: $sort, status_in: $status) {\n ${n}\n }\n }\n}`;break;case"SearchIDSingle":i.id=t.id,e=` \nquery ($id: Int, $type: MediaType) { \n Media (id: $id, type: $type) {\n ${n}\n }\n}`;break;case"SearchIDS":i.id=t.id,e=` \nquery ($id: [Int], $type: MediaType, $page: Int, $perPage: Int) { \n Page (page: $page, perPage: $perPage) {\n pageInfo {\n hasNextPage\n },\n media (id_in: $id, type: $type) {\n ${n}\n }\n }\n}`;break;case"Viewer":e=" \nquery {\n Viewer {\n avatar {\n medium\n },\n name,\n id\n }\n}";break;case"UserLists":i.id=t.id,e=` \nquery ($page: Int, $perPage: Int, $id: Int, $type: MediaType, $status_in: [MediaListStatus]){\n Page (page: $page, perPage: $perPage) {\n pageInfo {\n hasNextPage\n },\n mediaList (userId: $id, type: $type, status_in: $status_in) {\n media {\n ${n}\n }\n }\n }\n}`;break;case"SearchIDStatus":i.id=bt,i.mediaId=t.id,e=" \nquery ($id: Int, $mediaId: Int){\n MediaList(userId: $id, mediaId: $mediaId) {\n status,\n progress,\n repeat\n }\n}";break;case"AiringSchedule":{const t=new Date,r=t.getDay()>=1?t.getDay()-1:6-t.getDay();t.setDate(t.getDate()-r),t.setHours(0,0,0,0),i.from=t.getTime()/1e3,i.to=(t.getTime()+6048e5)/1e3,e=` \nquery ($page: Int, $perPage: Int, $from: Int, $to: Int) {\n Page (page: $page, perPage: $perPage) {\n pageInfo {\n hasNextPage\n },\n airingSchedules(airingAt_greater: $from, airingAt_lesser: $to) {\n episode,\n timeUntilAiring,\n airingAt,\n media{\n ${n}\n }\n }\n }\n}`;break}case"Search":i.genre=t.genre,i.search=t.search,i.year=t.year,i.season=t.season,i.format=t.format,i.status=t.status,i.sort=t.sort||"SEARCH_MATCH",e=` \nquery ($page: Int, $perPage: Int, $sort: [MediaSort], $type: MediaType, $search: String, $status: MediaStatus, $season: MediaSeason, $year: Int, $genre: String, $format: MediaFormat, $startDate: FuzzyDateInt) {\n Page (page: $page, perPage: $perPage) {\n pageInfo {\n hasNextPage\n },\n media(type: $type, search: $search, sort: $sort, status: $status, season: $season, seasonYear: $year, genre: $genre, format: $format, startDate_greater: $startDate) {\n ${n}\n }\n }\n}`}return r.body=JSON.stringify({query:e.replace(/\s/g,""),variables:i}),await yt(r)}const _t=anitomyscript;var Mt=i.n(_t),kt=i(5108);const xt=/(^magnet:){1}|(^[A-F\d]{8,40}$){1}|(.*\.torrent$){1}/i,Et=/\.(jpeg|jpg|gif|png|webp)/i;function St(t,e){if("file"===e){const e=new FileReader;e.onload=t=>{D().initStickyAlert({content:`Looking up anime for image.<br><img class="w-200 rounded pt-5" src="${t.target.result}">`})},e.readAsDataURL(t.get("image"))}else D().initStickyAlert({content:`Looking up anime for image.<br><img class="w-200 rounded pt-5" src="${t}">`});let i,r=`https://api.trace.moe/search?cutBorders&url=${t}`;"file"===e&&(i={method:"POST",body:t},r="https://api.trace.moe/search"),fetch(r,i).then((t=>t.json())).then((async({result:t})=>{t&&t[0].similarity>=.85?gt((await wt({method:"SearchIDSingle",id:t[0].anilist})).data.Media,t[0].episode):D().initStickyAlert({content:"Couldn't find anime for specified image! Try to remove black bars, or use a more detailed image.",title:"Search Failed",alertType:"alert-danger",fillType:""})}))}window.addEventListener("paste",(async t=>{const e=t.clipboardData.items[0];if(e&&0===e.type.indexOf("image")){t.preventDefault();const i=new FormData;i.append("image",e.getAsFile()),St(i,"file")}else e&&"text/plain"===e.type?e.getAsString((e=>{xt.exec(e)?(t.preventDefault(),searchText.value="",Wt.playTorrent(e)):Et.exec(e)&&(t.preventDefault(),searchText.value="",St(e))})):e&&"text/html"===e.type&&e.getAsString((e=>{const i=z(e,"text/html").querySelectorAll("img")[0];i&&(t.preventDefault(),searchText.value="",St(i.src))}))})),j.get("link")&&(St(j.get("link")),window.location="/app/#home");const Tt=/Episode (\d+) - (.*)/;async function At(t,e,i){parseInt(e)<10&&(e=`0${e}`);const r=document.querySelector("tbody.results"),n=await async function(t,e,i){const r=document.createDocumentFragment(),n=[...new Set(Object.values(t.title).concat(t.synonyms).filter((t=>null!=t)))].join(")|(").replace(/&/g,"%26"),s=1!==t.episodes&&("FINISHED"===t.status&&Y.torrent9?`"01-${t.episodes}"|"01~${t.episodes}"|"Batch"|"Complete"|"+${e}+"|"+${e}v"|"S01"`:`"+${e}+"|"+${e}v"`)||"",o=rt[U].join("|"),a=`${Y.torrent1}`||'"1080p"',h=!0===Y.torrent3?2:0,u=new URL(`https://meowinjapanese.cf/?page=rss&c=1_2&f=${h}&s=seeders&o=desc&q=(${n})${s}${a}-(${o})`),l=(await nt(u)).querySelectorAll("item *");if(!l.length)return r;const c=[];for(let t=Math.floor(l.length/15);t--;){const e=15*t;c[t]={title:l[e].textContent,hash:l[e+1].textContent,seeders:l[e+4].textContent,leechers:l[e+5].textContent,downloads:l[e+6].textContent,size:l[e+10].textContent}}c.sort(((t,e)=>e.seeders-t.seeders));const d=t?.streamingEpisodes.filter((t=>Tt.exec(t.title)&&Number(Tt.exec(t.title)[1])===Number(t)))[0],f={mediaTitle:t?.title.userPreferred,episodeNumber:Number(e),episodeTitle:d?Tt.exec(d.title)[2]:void 0,episodeThumbnail:d?.thumbnail,mediaCover:t?.coverImage.medium,name:"Miru",media:t};return Y.torrent2&&(i?Wt.offlineDownload(c[0].hash):Wt.playTorrent(c[0].hash,{media:f,episode:e}),D().toggleModal("tsearch")),c.forEach(((t,n)=>{const s=document.createElement("tr");s.innerHTML+=`\n<th>${n+1}</th>\n<td>${t.title}</td>\n<td>${t.size}</td>\n<td>${t.seeders}</td>\n<td>${t.leechers}</td>\n<td>${t.downloads}</td>\n<td class="pointer">Play</td>`,s.onclick=()=>{i?Wt.offlineDownload(t.hash):Wt.playTorrent(t.hash,{media:f,episode:e}),D().hideModal("tsearch")},r.appendChild(s)})),r}(t,e,i);0===n.children.length?D().initStickyAlert({content:`Couldn't find torrent for ${t.title.userPreferred} Episode ${parseInt(e)}! Try specifying a torrent manually.`,title:"Search Failed",alertType:"alert-danger",fillType:""}):(r.innerHTML="",r.appendChild(n),D().toggleModal("tsearch"))}async function It(t){const e=t.fileName.constructor===Array?t.fileName.map((t=>Mt()(t))):[Mt()(t.fileName)],i=await Promise.all(e);await Promise.all([...new Set(i.map((t=>t.anime_title)))].map((t=>async function(t){if(!(t in Ct)){const e={name:t,method:"SearchName",perPage:1,status:["RELEASING","FINISHED"],sort:"SEARCH_MATCH",startDate:1e7};let i=await wt(e);if(!i.data.Page.media[0]){const t=e.name.search(/S\d/);e.name=(-1!==t&&e.name.slice(0,t)+e.name.slice(t+1,e.name.length)||e.name).replace("(TV)","").replace(/ (19[5-9]\d|20[0-6]\d)/,"").replace("-",""),e.status=["RELEASING","FINISHED"],i=await wt(e)}i.data.Page.media[0]?Ct[t]=i.data.Page.media[0].id:Ct[t]=null}}(t))));const r={};for(let t=[...new Set(i.map((t=>Ct[t.anime_title])))];t.length;t=t.slice(50))for await(const e of(await wt({method:"SearchIDS",id:t.slice(0,50),perPage:50})).data.Page.media)r[e.id]=e;const n=[];for(const t of i){let e,i=r[Ct[t.anime_title]];async function s(r){let n,o,a,h;if(r.episode.constructor===Array?(n=Number(r.episode[0]),o=Number(r.episode[r.episode.length-1])):n=o=Number(r.episode),r.media.relations.edges.some((t=>"PREQUEL"===t.relationType&&("TV"===t.node.format||"TV_SHORT")))&&!r.increment?a=r.media.relations.edges.filter((t=>"PREQUEL"===t.relationType&&("TV"===t.node.format||"TV_SHORT")))[0].node:r.media.relations.edges.some((t=>"SEQUEL"===t.relationType&&("TV"===t.node.format||"TV_SHORT")))&&(a=r.media.relations.edges.filter((t=>"SEQUEL"===t.relationType&&("TV"===t.node.format||"TV_SHORT")))[0].node,h=!0),a?.episodes&&o-(r.offset+i.episodes)>(i.nextAiringEpisode?.episode||i.episodes)){const t=await wt({method:"SearchIDSingle",id:a.id});await s({media:t.data.Media,episode:r.episode,offset:r.offset+t.data.Media.episodes,increment:h})}else if(a?.episodes&&o-(r.offset+i.episodes)<=(i.nextAiringEpisode?.episode||i.episodes)&&n-(r.offset+i.episodes)>0){if(e=r.episode.constructor===Array?`${t.episode_number[0]-(r.offset+i.episodes)} ~ ${t.episode_number[t.episode_number.length-1]-(r.offset+i.episodes)}`:r.episode-(r.offset+i.episodes),r.increment||h){const t=await wt({method:"SearchIDSingle",id:a.id});i=t.data.Media}}else kt.log("error in parsing!",r.media,a),D().initStickyAlert({content:`Failed resolving anime episode!<br>${r.media.title.userPreferred} - ${o}`,title:"Parsing Error",alertType:"alert-secondary",fillType:""}),e=r.episode.constructor===Array?`${Number(t.episode_number[0])} ~ ${Number(t.episode_number[t.episode_number.length-1])}`:Number(r.episode)}("MOVIE"!==i?.format||i.episodes||i.nextAiringEpisode.episode)&&t.episode_number&&(t.episode_number.constructor===Array?1===parseInt(t.episode_number[0])?e=`${t.episode_number[0]} ~ ${t.episode_number[t.episode_number.length-1]}`:(i?.episodes||i?.nextAiringEpisode?.episode)&&parseInt(t.episode_number[t.episode_number.length-1])>(i.episodes||i.nextAiringEpisode.episode)?await s({media:i,episode:t.episode_number,offset:0}):e=`${Number(t.episode_number[0])} ~ ${Number(t.episode_number[t.episode_number.length-1])}`:(i?.episodes||i?.nextAiringEpisode?.episode)&&parseInt(t.episode_number)>(i.episodes||i.nextAiringEpisode.episode)?await s({media:i,episode:t.episode_number,offset:0}):e=Number(t.episode_number));const o=i?.streamingEpisodes.filter((e=>Tt.exec(e.title)&&Number(Tt.exec(e.title)[1])===Number(t.episode_number)))[0];n.push({mediaTitle:i?.title.userPreferred,episodeNumber:e,episodeTitle:o&&Tt.exec(o.title)[2],episodeThumbnail:o?.thumbnail,mediaCover:i?.coverImage.medium,name:"Miru",parseObject:t,media:i})}return 1===n.length?n[0]:n}const Ct=JSON.parse(localStorage.getItem("relations"))||{};var Bt=i(8833),Rt=i(4159),Pt=i.n(Rt),Lt=i(5228),Ot=i.n(Lt);const Dt=globalThis.gapi,Nt={apiKey:"",clientId:"",scope:"https://www.googleapis.com/auth/drive.readonly",discoveryDocs:["https://www.googleapis.com/discovery/v1/apis/drive/v3/rest"]};var jt=i(5108),Ut=i(8764).Buffer;const Ft=new Promise((t=>{(0,Dt.load)("client:auth2",(()=>{Dt.client.init(Object.assign({},Nt)).then((()=>{const e=Dt.auth2.getAuthInstance();if(e.isSignedIn.listen((i=>{if(!0===i){if(!e.currentUser.get().getAuthResponse().scope.includes("https://www.googleapis.com/auth/drive.readonly"))return D().initStickyAlert({content:"You didn't grant permission for Google Drive access, try again!",title:"Login Error",alertType:"alert-danger",fillType:""}),e.signOut();t(e.currentUser.get().getAuthResponse().access_token),gsignin.classList.add("d-none")}})),e.isSignedIn.get()){if(!e.currentUser.get().getAuthResponse().scope.includes("https://www.googleapis.com/auth/drive.readonly"))return D().initStickyAlert({content:"You didn't grant permission for Google Drive access, try again!",title:"Login Error",alertType:"alert-danger",fillType:""}),e.signOut();t(e.currentUser.get().getAuthResponse().access_token)}else gsignin.onclick=e.signIn,gsignin.classList.remove("d-none")}))}))}));async function qt(t){return new Promise((e=>{Ft.then((()=>{Dt.client.drive.files.list({pageSize:1,fields:"files(id)",includeItemsFromAllDrives:!0,supportsAllDrives:!0,corpora:"allDrives",q:`name = '${t}'`}).then((t=>{jt.log(t),e(t?.result?.files?.length&&t?.result?.files[0].id)}))}))}))}class zt extends(Ot()){constructor(t){super(),this.connId=t.infoHash+" gdrive",this.webPeerId=Pt().sync(this.connId),this._torrent=t,this.lastRequest={},this.sleep=null,this.queue=new $,this._init()}_init(){this.setKeepAlive(!0),this.once("handshake",((t,e)=>{if(this.destroyed)return;this.handshake(t,this.webPeerId);const i=this._torrent.pieces.length,r=new Bt.default(i);for(let t=0;t<=i;t++)r.set(t,!0);this.bitfield(r)})),this.once("interested",(()=>{this.unchoke()})),this.on("request",((t,e,i,r)=>{const n=()=>this.queue.add({fn:async()=>await this.httpRequest(t,e,i,((t,e)=>{if(t||e?.length!==i)return n();r(t,e)})),index:t});n()}))}async httpRequest(t,e,i,r){const n=t*this._torrent.pieceLength+e,s=n+i-1,o=this._torrent.files;let a;if(o.length<=1)a=[{url:`https://www.googleapis.com/drive/v3/files/${o[0].gDriveID}?supportsAllDrives=true&alt=media&key=${Nt.apiKey}`,start:n,end:s}];else{const t=o.filter((t=>t.offset<=s&&t.offset+t.length>n));if(t.length<1)return r(new Error("Could not find file corresponding to web seed range request"));a=t.map((t=>{const e=t.offset+t.length-1;return{url:`https://www.googleapis.com/drive/v3/files/${t.gDriveID}?supportsAllDrives=true&alt=media&key=${Nt.apiKey}`,fileOffsetInRange:Math.max(t.offset-n,0),start:Math.max(n-t.offset,0),end:Math.min(e,s-t.offset)}}))}let h,u=0,l=!1;a.length>1&&(h=Ut.alloc(i));let{res:c,reader:d,endRange:f,setSize:p,ctrl:m}=this.lastRequest;for await(const t of a){const{url:e,start:i,end:n}=t;function s(e,i){if(!e||e.status<200||e.status>=300){if(l)return;return l=!0,r(new Error(`Unexpected HTTP status code ${e?.status}`))}1===a.length?r(null,i):(i.copy(h,t.fileOffsetInRange),++u===a.length&&r(null,h))}if(f!==i-1||m?.signal?.aborted){async function*t(t){let e=[],i=0,r=!1,n=512;for(yield t=>{n=t};!r;){const s=await t.read();if(r=s.done,r)return void(yield H(e,i));for(i+=s.value.byteLength,e.push(s.value);i>=n;){const t=H(e);i-=n,yield t.slice(0,n),e=[t.slice(n,t.length)]}}}m&&m.abort(),m=new AbortController,await this.sleep;try{c=await fetch(e,{headers:{range:`bytes=${i}-`,authorization:"Bearer "+await Ft},signal:m.signal})}catch(t){throw this.sleep=W(500),s(),t}this.sleep=W(500),d=t(c.body.getReader()),p=(await d.next()).value}f=n,p(n-i+1),s(c,(await d.next()).value||new Uint8Array)}this.lastRequest={res:c,reader:d,endRange:f,setSize:p,ctrl:m}}destroy(){this.lastRequest?.ctrl?.abort(),this.queue.destroy(),this.lastRequest?.ctrl?.abort(),super.destroy(),this._torrent=null}}const Ht={};for(const t of document.getElementsByClassName("ctrl"))Ht[t.dataset.name]?Ht[t.dataset.name]=[Ht[t.dataset.name],t]:Ht[t.dataset.name]=t;window.addEventListener("beforeunload",(()=>{Wt.destroy()}));const Wt=new L({WebTorrentOpts:{maxConns:127,downloadLimit:1048576*Y.torrent7,uploadLimit:1572864*Y.torrent7,tracker:{announce:Y.torrent10.split("\n")},destroyStore:!0},controls:Ht,video,player,destroyStore:!0,playerWrapper:pageWrapper,burnIn:Y.subtitle3,seekTime:Number(Y.player3),immerseTime:Number(Y.player2),visibilityLossPause:Y.player10,autoNext:Y.player6,streamedDownload:Y.torrent8,generateThumbnails:Y.player5,defaultSSAStyles:Object.values(subtitle1list.options).filter((t=>t.value===Y.subtitle1))[0].textContent,resolveFileMedia:It});Wt.on("download-done",(({file:t})=>{D().initStickyAlert({content:`<span class="text-break">${t.name}</span> has finished downloading. Now seeding.`,title:"Download Complete",alertType:"alert-success",fillType:""})})),Wt.on("torrent",(async function(t){await Ft;for await(const e of t.files){const t=await qt(e.name);if(!t)return D().initStickyAlert({content:`Couldn't find a GDrive file for ${e.name}! Can't create webseed!`,title:"GDrive Error!",alertType:"alert-secondary",fillType:""}),null;e.gDriveID=t,await W(1e3)}t.addWebSeed(new zt(t))})),Wt.on("watched",(({filemedia:t})=>{(t?.media?.episodes||t?.media?.nextAiringEpisode?.episode)&&Y.other2&&(t.media.episodes||t.media.nextAiringEpisode?.episode>t.episodeNumber)&&function(t){t.media&&localStorage.getItem("ALtoken")&&wt({method:"SearchIDStatus",id:t.media.id}).then((e=>{if(e.errors&&404===e.errors[0].status||e.data.MediaList.progress<=t.episodeNumber||1===t.episodes){const i="\nmutation ($id: Int, $status: MediaListStatus, $episode: Int, $repeat: Int) {\n SaveMediaListEntry (mediaId: $id, status: $status, progress: $episode, repeat: $repeat) {\n id,\n status,\n progress,\n repeat\n }\n}",r={repeat:0,id:t.media.id,status:"CURRENT",episode:t.episodeNumber||1};t.episodeNumber!==t.media.episodes&&1!==t.episodes||(r.status="COMPLETED","COMPLETED"===e.data.MediaList.status&&(r.repeat=e.data.MediaList.repeat+1)),yt({method:"POST",headers:{Authorization:"Bearer "+localStorage.getItem("ALtoken"),"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({query:i,variables:r})})}}))}(t)})),Wt.on("playlist",(()=>{window.location.hash="#playlist"})),Wt.on("next",(({filemedia:t})=>{t.media?At(t.media,parseInt(t.episodeNumber)+1):D().initStickyAlert({content:"Couldn't find anime name! Try specifying a torrent manually.",title:"Search Failed",alertType:"alert-danger",fillType:""})})),Wt.on("prev",(({filemedia:t})=>{t.media?At(t.media,t.episodeNumber-1):D().initStickyAlert({content:"Couldn't find anime name! Try specifying a torrent manually.",title:"Search Failed",alertType:"alert-danger",fillType:""})})),Wt.on("offline-torrent",(t=>{It({fileName:t.name}).then((e=>{e.onclick=()=>Wt.playTorrent(t,{media:e,episode:e.episode});const i=lt(e);document.querySelector(".downloads").appendChild(i)}))})),Wt.on("video-files",(async({files:t,torrent:e})=>{document.querySelector(".playlist").textContent="";const i=[];for(const r of t){const t=await It({fileName:r.name});t.onclick=()=>{Wt.buildVideo(e,{media:t,episode:t.parseObject.episode,file:r})},i.push(lt(t))}document.querySelector(".playlist").append(...i)})),Wt.on("no-files",(t=>{D().initStickyAlert({content:`Couldn't find video file for <span class="text-break">${t.infoHash}</span>!`,title:"Search Failed",alertType:"alert-danger",fillType:""})})),Wt.on("no peers",(t=>{1!==t.progress&&D().initStickyAlert({content:`Couldn't find peers for <span class="text-break">${t.infoHash}</span>! Try a torrent with more seeders.`,title:"Search Failed",alertType:"alert-danger",fillType:""})})),Wt.nowPlaying={name:"Miru"},window.client=Wt,j.get("file")&&Wt.playTorrent(j.get("file")),queueMicrotask((function(){localStorage.getItem("ALtoken")?wt({method:"Viewer"}).then((t=>{oauth.removeAttribute("href"),oauth.setAttribute("data-title",`${t.data.Viewer.name}\nClick To Logout`),oauth.innerHTML=`\n <span class="text-nowrap d-flex align-items-center">\n <img src="${t.data.Viewer.avatar.medium}">\n <span class="text">${t.data.Viewer.name}</span>\n <span class="material-icons menu text">logout</span>\n </span>`,oauth.onclick=()=>{localStorage.removeItem("ALtoken"),location.reload()},bt=t.data.Viewer.id,ot()})):(ot(),home.classList.add("noauth"))}))})()})();
|
||
//# sourceMappingURL=bundle.js.map |